OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
TestFM2DMagnetoStatic.cpp File Reference

Unit tests for FM2DMagnetoStatic fieldmap class. More...

#include <gtest/gtest.h>
#include "Fields/FM2DMagnetoStatic.h"
#include "Fields/Fieldmap.h"
#include "Ippl.h"
#include "Physics/Units.h"
#include "Utilities/GeneralOpalException.h"
#include <cmath>
#include <filesystem>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
Include dependency graph for TestFM2DMagnetoStatic.cpp:

Go to the source code of this file.

Classes

class  FM2DMagnetoStaticTest
 

Functions

 TEST_F (FM2DMagnetoStaticTest, ParseXZOrientation)
 
 TEST_F (FM2DMagnetoStaticTest, ParseZXOrientation)
 
 TEST_F (FM2DMagnetoStaticTest, UniformFieldStrength)
 
 TEST_F (FM2DMagnetoStaticTest, OutsideZRange)
 
 TEST_F (FM2DMagnetoStaticTest, OutsideRadialRange)
 
 TEST_F (FM2DMagnetoStaticTest, IsInside)
 
 TEST_F (FM2DMagnetoStaticTest, SwapToggle)
 
 TEST_F (FM2DMagnetoStaticTest, Normalization)
 
 TEST_F (FM2DMagnetoStaticTest, BilinearInterpolation)
 
 TEST_F (FM2DMagnetoStaticTest, ComputeFieldStatic)
 
 TEST_F (FM2DMagnetoStaticTest, GetFieldDerivativeThrows)
 
 TEST_F (FM2DMagnetoStaticTest, GetFieldDimensions6ArgReturnsBoundingBox)
 
 TEST_F (FM2DMagnetoStaticTest, FrequencyThrows)
 
 TEST_F (FM2DMagnetoStaticTest, GetInfoNoCrash)
 
 TEST_F (FM2DMagnetoStaticTest, MissingFile)
 
 TEST_F (FM2DMagnetoStaticTest, DictionaryCaching)
 
 TEST_F (FM2DMagnetoStaticTest, ReadFreeCycle)
 
 TEST_F (FM2DMagnetoStaticTest, GridPointAccuracy)
 
 TEST_F (FM2DMagnetoStaticTest, XZvsZXConsistency)
 
 TEST_F (FM2DMagnetoStaticTest, RadialFieldProjection)
 
 TEST_F (FM2DMagnetoStaticTest, FieldAccumulation)
 

Detailed Description

Unit tests for FM2DMagnetoStatic fieldmap class.

Tests cover:

  • File parsing (XZ and ZX orientations)
  • Field dimensions retrieval
  • Point field evaluation via getFieldstrength (bilinear interpolation)
  • Boundary / out-of-range behaviour
  • isInside() helper
  • swap() toggle
  • Normalization flag
  • Static computeField() kernel
  • getFieldDerivative / getFieldDimensions(6-arg) / getFrequency / setFrequency throw
  • getInfo prints without crashing
  • Invalid / missing file handling

Definition in file TestFM2DMagnetoStatic.cpp.

Function Documentation

◆ TEST_F() [1/21]

TEST_F ( FM2DMagnetoStaticTest  ,
BilinearInterpolation   
)

Definition at line 349 of file TestFM2DMagnetoStatic.cpp.

References Units::cm2m, Fieldmap::getFieldstrength(), and nr.

Here is the call graph for this function:

◆ TEST_F() [2/21]

TEST_F ( FM2DMagnetoStaticTest  ,
ComputeFieldStatic   
)

Definition at line 413 of file TestFM2DMagnetoStatic.cpp.

◆ TEST_F() [3/21]

TEST_F ( FM2DMagnetoStaticTest  ,
DictionaryCaching   
)

Definition at line 549 of file TestFM2DMagnetoStatic.cpp.

References nr.

◆ TEST_F() [4/21]

TEST_F ( FM2DMagnetoStaticTest  ,
FieldAccumulation   
)

Definition at line 686 of file TestFM2DMagnetoStatic.cpp.

References Fieldmap::getFieldstrength(), and nr.

Here is the call graph for this function:

◆ TEST_F() [5/21]

TEST_F ( FM2DMagnetoStaticTest  ,
FrequencyThrows   
)

Definition at line 511 of file TestFM2DMagnetoStatic.cpp.

References Fieldmap::getFrequency(), nr, and Fieldmap::setFrequency().

Here is the call graph for this function:

◆ TEST_F() [6/21]

TEST_F ( FM2DMagnetoStaticTest  ,
GetFieldDerivativeThrows   
)

Definition at line 471 of file TestFM2DMagnetoStatic.cpp.

References DX, Fieldmap::getFieldDerivative(), and nr.

Here is the call graph for this function:

◆ TEST_F() [7/21]

TEST_F ( FM2DMagnetoStaticTest  ,
GetFieldDimensions6ArgReturnsBoundingBox   
)

Definition at line 489 of file TestFM2DMagnetoStatic.cpp.

References Units::cm2m, Fieldmap::getFieldDimensions(), and nr.

Here is the call graph for this function:

◆ TEST_F() [8/21]

TEST_F ( FM2DMagnetoStaticTest  ,
GetInfoNoCrash   
)

Definition at line 526 of file TestFM2DMagnetoStatic.cpp.

References Fieldmap::getInfo(), and nr.

Here is the call graph for this function:

◆ TEST_F() [9/21]

TEST_F ( FM2DMagnetoStaticTest  ,
GridPointAccuracy   
)

Definition at line 594 of file TestFM2DMagnetoStatic.cpp.

References Units::cm2m, Fieldmap::getFieldstrength(), and nr.

Here is the call graph for this function:

◆ TEST_F() [10/21]

TEST_F ( FM2DMagnetoStaticTest  ,
IsInside   
)

Definition at line 280 of file TestFM2DMagnetoStatic.cpp.

References nr.

◆ TEST_F() [11/21]

TEST_F ( FM2DMagnetoStaticTest  ,
MissingFile   
)

Definition at line 541 of file TestFM2DMagnetoStatic.cpp.

◆ TEST_F() [12/21]

TEST_F ( FM2DMagnetoStaticTest  ,
Normalization   
)

Definition at line 323 of file TestFM2DMagnetoStatic.cpp.

References Fieldmap::getFieldstrength(), and nr.

Here is the call graph for this function:

◆ TEST_F() [13/21]

TEST_F ( FM2DMagnetoStaticTest  ,
OutsideRadialRange   
)

Definition at line 259 of file TestFM2DMagnetoStatic.cpp.

References Fieldmap::getFieldstrength(), and nr.

Here is the call graph for this function:

◆ TEST_F() [14/21]

TEST_F ( FM2DMagnetoStaticTest  ,
OutsideZRange   
)

Definition at line 223 of file TestFM2DMagnetoStatic.cpp.

References Fieldmap::getFieldstrength(), and nr.

Here is the call graph for this function:

◆ TEST_F() [15/21]

TEST_F ( FM2DMagnetoStaticTest  ,
ParseXZOrientation   
)

Definition at line 152 of file TestFM2DMagnetoStatic.cpp.

References Units::cm2m, Fieldmap::getFieldDimensions(), Fieldmap::getType(), nr, and T2DMagnetoStatic.

Here is the call graph for this function:

◆ TEST_F() [16/21]

TEST_F ( FM2DMagnetoStaticTest  ,
ParseZXOrientation   
)

Definition at line 174 of file TestFM2DMagnetoStatic.cpp.

References Units::cm2m, Fieldmap::getFieldDimensions(), and nr.

Here is the call graph for this function:

◆ TEST_F() [17/21]

TEST_F ( FM2DMagnetoStaticTest  ,
RadialFieldProjection   
)

Definition at line 654 of file TestFM2DMagnetoStatic.cpp.

References Fieldmap::getFieldstrength(), and nr.

Here is the call graph for this function:

◆ TEST_F() [18/21]

TEST_F ( FM2DMagnetoStaticTest  ,
ReadFreeCycle   
)

Definition at line 563 of file TestFM2DMagnetoStatic.cpp.

References Fieldmap::freeMap(), Fieldmap::getFieldstrength(), nr, and Fieldmap::readMap().

Here is the call graph for this function:

◆ TEST_F() [19/21]

TEST_F ( FM2DMagnetoStaticTest  ,
SwapToggle   
)

Definition at line 306 of file TestFM2DMagnetoStatic.cpp.

References nr.

◆ TEST_F() [20/21]

TEST_F ( FM2DMagnetoStaticTest  ,
UniformFieldStrength   
)

Definition at line 195 of file TestFM2DMagnetoStatic.cpp.

References Fieldmap::getFieldstrength(), and nr.

Here is the call graph for this function:

◆ TEST_F() [21/21]

TEST_F ( FM2DMagnetoStaticTest  ,
XZvsZXConsistency   
)

Definition at line 624 of file TestFM2DMagnetoStatic.cpp.

References Fieldmap::getFieldstrength(), and nr.

Here is the call graph for this function: