1#ifndef CLASSIC_FIELDMAP_HH
2#define CLASSIC_FIELDMAP_HH
4#define READ_BUFFER_LENGTH 256
11#include "gsl/gsl_interp.h"
12#include "gsl/gsl_spline.h"
69 static void readMap(std::string Filename);
70 static void freeMap(std::string Filename);
72 static std::string
typeset_msg(
const std::string &msg,
const std::string &title);
78 virtual void getFieldDimensions(
double &xIni,
double &xFinal,
double &yIni,
double &yFinal,
double &zIni,
double &zFinal)
const = 0;
83 virtual void setEdgeConstants(
const double &bendAngle,
const double &entranceAngle,
const double &exitAngle);
87 std::vector<double> &engeCoeffsExit);
89 double &entranceParameter2,
90 double &entranceParameter3);
92 double &exitParameter2,
93 double &exitParameter3);
99 virtual void getOnaxisEz(std::vector<std::pair<double, double> > & onaxis);
121 void getLine(std::ifstream & in, std::string & buffer) {
125 static void getLine(std::ifstream &in,
int &lines_read, std::string &buffer);
128 bool interpretLine(std::ifstream &in, S &value,
const bool &file_length_known =
true);
129 template<
class S,
class T>
130 bool interpretLine(std::ifstream &in, S &value1,
T &value2,
const bool &file_length_known =
true);
131 template<
class S,
class T,
class U>
132 bool interpretLine(std::ifstream &in, S &value1,
T &value2, U &value3,
const bool &file_length_known =
true);
133 template<
class S,
class T,
class U,
class V>
134 bool interpretLine(std::ifstream &in, S &value1,
T &value2, U &value3, V &value4,
const bool &file_length_known =
true);
136 bool interpretLine(std::ifstream &in, S &value1, S &value2, S &value3, S &value4, S &value5, S &value6,
const bool &file_length_known =
true);
141 const bool &read_all,
142 const std::string &error_msg,
143 const std::string &found);
152 void checkMap(
unsigned int accuracy,
153 std::pair<double, double> fieldDimensions,
155 const std::vector<double> &fourierCoefficients,
156 gsl_spline *splineCoefficients,
157 gsl_interp_accel *splineAccelerator);
159 void checkMap(
unsigned int accuracy,
161 const std::vector<double> &zSampling,
162 const std::vector<double> &fourierCoefficients,
163 gsl_spline *splineCoefficients,
164 gsl_interp_accel *splineAccelerator);
169 const std::pair<double, double> &xrange,
170 const std::pair<double, double> &yrange,
171 const std::pair<double, double> &zrange,
172 const std::vector<Vector_t> &ef,
173 const std::vector<Vector_t> &bf);
#define READ_BUFFER_LENGTH
@ T2DElectroStatic_cspline
@ T2DMagnetoStatic_cspline
@ T3DMagnetoStatic_Extended
@ T3DMagnetoStaticH5Block
virtual void getInfo(Inform *msg)=0
virtual void getFieldDimensions(double &zBegin, double &zEnd) const =0
static Fieldmap * getFieldmap(std::string Filename, bool fast=false)
static void deleteFieldmap(std::string Filename)
static std::string alpha_numeric
static std::map< std::string, FieldmapDescription > FieldmapDictionary
static MapType readHeader(std::string Filename)
virtual void setFrequency(double freq)=0
bool interpreteEOF(std::ifstream &in)
virtual void setFieldLength(const double &)
virtual bool isInside(const Vector_t &) const
void missingValuesWarning()
virtual void getOnaxisEz(std::vector< std::pair< double, double > > &onaxis)
virtual bool getFieldstrength(const Vector_t &R, Vector_t &E, Vector_t &B) const =0
virtual void get1DProfile1EntranceParam(double &entranceParameter1, double &entranceParameter2, double &entranceParameter3)
void checkMap(unsigned int accuracy, std::pair< double, double > fieldDimensions, double deltaZ, const std::vector< double > &fourierCoefficients, gsl_spline *splineCoefficients, gsl_interp_accel *splineAccelerator)
void lowResolutionWarning(double squareError, double maxError)
void interpretWarning(const std::ios_base::iostate &state, const bool &read_all, const std::string &error_msg, const std::string &found)
virtual void getFieldDimensions(double &xIni, double &xFinal, double &yIni, double &yFinal, double &zIni, double &zFinal) const =0
Fieldmap(const std::string &aFilename)
void disableFieldmapWarning()
virtual double getFrequency() const =0
static char buffer_m[256]
static std::vector< std::string > getListFieldmapNames()
static std::string typeset_msg(const std::string &msg, const std::string &title)
virtual bool getFieldDerivative(const Vector_t &R, Vector_t &E, Vector_t &B, const DiffDirection &dir) const =0
static void clearDictionary()
virtual double getFieldGap()
virtual void setEdgeConstants(const double &bendAngle, const double &entranceAngle, const double &exitAngle)
virtual void setFieldGap(double gap)
bool interpretLine(std::ifstream &in, S &value, const bool &file_length_known=true)
void exceedingValuesWarning()
virtual void get1DProfile1EngeCoeffs(std::vector< double > &engeCoeffsEntry, std::vector< double > &engeCoeffsExit)
void getLine(std::ifstream &in, std::string &buffer)
virtual void get1DProfile1ExitParam(double &exitParameter1, double &exitParameter2, double &exitParameter3)
void write3DField(unsigned int nx, unsigned int ny, unsigned int nz, const std::pair< double, double > &xrange, const std::pair< double, double > &yrange, const std::pair< double, double > &zrange, const std::vector< Vector_t > &ef, const std::vector< Vector_t > &bf)
FieldmapDescription(MapType aType, Fieldmap *aMap)