OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
Static Public Member Functions | Private Member Functions | Static Private Member Functions | Static Private Attributes | List of all members
SectorMagneticFieldMap::IO Class Reference

handles reading sector field maps More...

#include <SectorMagneticFieldMap.h>

Static Public Member Functions

static interpolation::VectorMapreadMap (std::string file_name, std::vector< double > units, SectorMagneticFieldMap::symmetry sym, int poly_order, int smoothing_order)
 

Private Member Functions

 IO ()
 
 IO (const IO &map)
 
 ~IO ()
 

Static Private Member Functions

static std::vector
< std::vector< double > > 
readLines (std::string file_name, std::vector< double > units)
 
static interpolation::ThreeDGridgenerateGrid (const std::vector< std::vector< double > > field_points, SectorMagneticFieldMap::symmetry sym)
 
static interpolation::VectorMapgetInterpolator (const std::vector< std::vector< double > > field_points, interpolation::ThreeDGrid *grid, SectorMagneticFieldMap::symmetry sym)
 
static interpolation::VectorMapgetInterpolatorPolyPatch (const std::vector< std::vector< double > > field_points, interpolation::ThreeDGrid *grid, SectorMagneticFieldMap::symmetry sym, int poly_order, int smoothing_order)
 
static bool floatGreaterEqual (double in1, double in2)
 
static bool comparator (std::vector< double > field_item1, std::vector< double > field_item2)
 

Static Private Attributes

static const double floatTolerance_m = 1e-3
 
static const int sortOrder_m [3] = {0, 1, 2}
 
static const std::string errMsg1
 

Detailed Description

handles reading sector field maps

SectorMagneticFieldMap::IO provides routines to read a sector field map for input to tracking.

Definition at line 242 of file SectorMagneticFieldMap.h.

Constructor & Destructor Documentation

SectorMagneticFieldMap::IO::IO ( )
private
SectorMagneticFieldMap::IO::IO ( const IO map)
private
SectorMagneticFieldMap::IO::~IO ( )
private

Member Function Documentation

bool SectorMagneticFieldMap::IO::comparator ( std::vector< double >  field_item1,
std::vector< double >  field_item2 
)
staticprivate

Definition at line 418 of file SectorMagneticFieldMap.cpp.

References fabs().

Referenced by readLines().

Here is the call graph for this function:

bool SectorMagneticFieldMap::IO::floatGreaterEqual ( double  in1,
double  in2 
)
staticprivate

Definition at line 480 of file SectorMagneticFieldMap.cpp.

ThreeDGrid * SectorMagneticFieldMap::IO::generateGrid ( const std::vector< std::vector< double > >  field_points,
SectorMagneticFieldMap::symmetry  sym 
)
staticprivate

Definition at line 486 of file SectorMagneticFieldMap.cpp.

References endl(), gmsg, and interpolation::ThreeDGrid::setConstantSpacing().

Referenced by readMap().

Here is the call graph for this function:

VectorMap * SectorMagneticFieldMap::IO::getInterpolator ( const std::vector< std::vector< double > >  field_points,
interpolation::ThreeDGrid grid,
SectorMagneticFieldMap::symmetry  sym 
)
staticprivate

Definition at line 375 of file SectorMagneticFieldMap.cpp.

References interpolation::ThreeDGrid::xSize(), interpolation::ThreeDGrid::ySize(), and interpolation::ThreeDGrid::zSize().

Referenced by readMap().

Here is the call graph for this function:

VectorMap * SectorMagneticFieldMap::IO::getInterpolatorPolyPatch ( const std::vector< std::vector< double > >  field_points,
interpolation::ThreeDGrid grid,
SectorMagneticFieldMap::symmetry  sym,
int  poly_order,
int  smoothing_order 
)
staticprivate

Definition at line 331 of file SectorMagneticFieldMap.cpp.

References SectorMagneticFieldMap::dipole, endl(), gmsg, and interpolation::PPSolveFactory::solve().

Referenced by readMap().

Here is the call graph for this function:

std::vector< std::vector< double > > SectorMagneticFieldMap::IO::readLines ( std::string  file_name,
std::vector< double >  units 
)
staticprivate

Definition at line 431 of file SectorMagneticFieldMap.cpp.

References comparator(), SectorField::convertToPolar(), endl(), and gmsg.

Referenced by readMap().

Here is the call graph for this function:

VectorMap * SectorMagneticFieldMap::IO::readMap ( std::string  file_name,
std::vector< double >  units,
SectorMagneticFieldMap::symmetry  sym,
int  poly_order,
int  smoothing_order 
)
static

Read in the field map

Read in the field map with some specified geometry

Parameters
file_namename of the file containing the field map
unitsunits of the file - should be 6-vector
symsymmetry of the file - either "none" (full field map) or "dipole" (field map is reflected about y = 0)
poly_orderorder of the polynomial fit
smoothing_orderorder of the polynomial smoothing

Definition at line 294 of file SectorMagneticFieldMap.cpp.

References endl(), generateGrid(), getInterpolator(), getInterpolatorPolyPatch(), gmsg, and readLines().

Referenced by SectorMagneticFieldMap::readMap().

Here is the call graph for this function:

Member Data Documentation

const std::string SectorMagneticFieldMap::IO::errMsg1
staticprivate
Initial value:
=
std::string("field points during read ")+
std::string("operation; this could mean that the field ")+
std::string("map was not complete, or that OPAL could ")+
std::string("not calculate regular grid spacings properly. ")+
std::string("Check that the field map is on a cylindrical ")+
std::string("grid written in Cartesian coordinates and the ")+
std::string("grid points are written with enough precision (")+
std::string("check the grid size information above).")

Definition at line 303 of file SectorMagneticFieldMap.h.

const double SectorMagneticFieldMap::IO::floatTolerance_m = 1e-3
staticprivate

Definition at line 262 of file SectorMagneticFieldMap.h.

const int SectorMagneticFieldMap::IO::sortOrder_m = {0, 1, 2}
staticprivate

Definition at line 263 of file SectorMagneticFieldMap.h.


The documentation for this class was generated from the following files: