28#ifndef _CLASSIC_FIELDS_SECTORMAGNETICFIELDMAP_HH_
29#define _CLASSIC_FIELDS_SECTORMAGNETICFIELDMAP_HH_
178 void print(std::ostream& out);
214 void Rotate(
double* value,
double angle);
225 static std::map<std::string, SectorMagneticFieldMap*>
_fields;
256 std::vector<double> units,
259 int smoothing_order);
266 static std::vector< std::vector<double> >
readLines
267 (std::string file_name, std::vector<double> units);
271 const std::vector< std::vector<double> > field_points,
276 const std::vector< std::vector<double> > field_points,
281 const std::vector< std::vector<double> > field_points,
285 int smoothing_order);
293 (std::vector<double> field_item1, std::vector<double> field_item2);
ThreeDGrid holds grid information for a rectangular grid used in e.g.
VectorMap is an abstract class that defines mapping from one vector to another.
SectorField is an abstraction type for a sector field map i.e.
handles field map grids with sector geometry
bool getFieldstrength(const Vector_t &R_c, Vector_t &E_c, Vector_t &B_c) const
Return the field value in polar coordinates.
bool applySymmetry(double *R_temp) const
Reflect R_temp about y if below bbmin.
const std::string filename_m
void freeMap()
Delete the field map interpolator and set pointer to nullptr.
void setFrequency(double)
Magnetostatic field map - so does nothing.
interpolation::VectorMap * interpolator_m
SectorMagneticFieldMap & operator=(const SectorMagneticFieldMap &field)
static void clearFieldCache()
Delete cached fields.
std::vector< double > units_m
void setInterpolator(interpolation::VectorMap *interpolator)
Set the interpolator.
void readMap()
Read in the field map from the file.
static std::string SymmetryToString(symmetry sym)
double getPhiOffset() const
Get phi offset.
double getDeltaPhi() const
Get change in azimuthal angle between entrance and exit.
SectorMagneticFieldMap(std::string file_name, std::string symmetry, double length_units, double field_units, int polynomial_order, int smoothing_order)
Generate the field map by calling SectorMagneticFieldMap::IO.
bool getFieldDerivative(const Vector_t &R, Vector_t &E, Vector_t &B, const DiffDirection &dir) const
Not implemented - throws a LogicalError.
static symmetry StringToSymmetry(std::string name)
void setPhiOffset(double dphi)
Set phi offset.
void setSymmetry(std::string name)
Set the field map symmetry.
interpolation::VectorMap * getInterpolator()
Get a pointer to the interpolator or nullptr if it is not set.
double getFrequency() const
Magnetostatic field map - so returns 0.
static const double fractionalBBPhiTolerance_m
void Rotate(double *value, double angle)
~SectorMagneticFieldMap()
Destructor - delete allocated memory.
void getInfo(Inform *msg)
Print summary information about the field map to Inform.
friend class SectorMagneticFieldMapIO
std::string getFieldMapFileName() const
Get the field map file name.
std::string getSymmetry() const
Get a string corresponding to the field map symmetry.
void print(std::ostream &out)
Print summary information about the field map to out.
static std::map< std::string, SectorMagneticFieldMap * > _fields
handles reading sector field maps
static const std::string errMsg1
static interpolation::ThreeDGrid * generateGrid(const std::vector< std::vector< double > > field_points, SectorMagneticFieldMap::symmetry sym)
static std::vector< std::vector< double > > readLines(std::string file_name, std::vector< double > units)
static bool comparator(std::vector< double > field_item1, std::vector< double > field_item2)
static const double floatTolerance_m
static interpolation::VectorMap * getInterpolatorPolyPatch(const std::vector< std::vector< double > > field_points, interpolation::ThreeDGrid *grid, SectorMagneticFieldMap::symmetry sym, int poly_order, int smoothing_order)
static interpolation::VectorMap * getInterpolator(const std::vector< std::vector< double > > field_points, interpolation::ThreeDGrid *grid, SectorMagneticFieldMap::symmetry sym)
static const int sortOrder_m[3]
static bool floatGreaterEqual(double in1, double in2)
static interpolation::VectorMap * readMap(std::string file_name, std::vector< double > units, SectorMagneticFieldMap::symmetry sym, int poly_order, int smoothing_order)
Read in the field map.