18#ifndef CLASSIC_FIELDMAP3DH5BLOCKBASE_H
19#define CLASSIC_FIELDMAP3DH5BLOCKBASE_H
25#include <h5core/h5_types.h>
36static_assert (
sizeof(double) ==
sizeof (h5_float64_t),
37 "double and h5_float64_t are not the same type" );
38static_assert (
sizeof(
long long) ==
sizeof (h5_int64_t),
39 "long long and h5_int64_t are not the same type" );
54 double &zBegin,
double &zEnd
61 double &xIni,
double &xFinal,
62 double &yIni,
double &yFinal,
63 double &zIni,
double &zFinal
95 std::vector<std::pair<double, double> >& F);
105 const std::string& filename);
236 const double ax = std::floor(fx);
237 const double ay = std::floor(fy);
238 const double az = std::floor(fz);
240 idx.
i = (
unsigned int)std::min(std::max(ax, 0.0), (double)(
num_gridpx_m - 2));
241 idx.
j = (
unsigned int)std::min(std::max(ay, 0.0), (double)(
num_gridpy_m - 2));
242 idx.
k = (
unsigned int)std::min(std::max(az, 0.0), (double)(
num_gridpz_m - 2));
246 idx.
weight(0) = fx - (double)idx.
i;
247 idx.
weight(1) = fy - (double)idx.
j;
248 idx.
weight(2) = fz - (double)idx.
k;
255 const IndexTriplet& idx,
256 unsigned short corner)
const;
264 enum :
unsigned short {
std::shared_ptr< _FM3DH5BlockBase > FM3DH5BlockBase
virtual bool isInside(const Vector_t &r) const
virtual double getFrequency() const
bool anyNonZero(const FieldArray &x, const FieldArray &y, const FieldArray &z) const
void setStep(const long long)
virtual bool getFieldstrength(const Vector_t &, Vector_t &, Vector_t &) const =0
FieldArray FieldstrengthEx_m
void getResonanceFrequency(void)
virtual bool getFieldDerivative(const Vector_t &, Vector_t &, Vector_t &, const DiffDirection &) const
virtual void getInfo(Inform *msg)
IndexTriplet getIndex(const Vector_t &X) const
unsigned int num_gridpx_m
virtual ~_FM3DH5BlockBase()
unsigned long getIndex(unsigned int i, unsigned int j, unsigned int k) const
virtual void setFrequency(double freq)
double getWeightedData(const FieldArray &data, const IndexTriplet &idx, unsigned short corner) const
void getFieldInfo(const char *)
virtual void getOnaxisEz(std::vector< std::pair< double, double > > &F)
Vector_t interpolateTrilinearly(const FieldArray &, const FieldArray &, const FieldArray &, const Vector_t &X) const
void readField(const char *name, double *x, double *y, double *z)
void openFileMPIOCollective(const std::string &filename)
long long getNumSteps(void)
unsigned int num_gridpz_m
unsigned int num_gridpy_m
FieldArray FieldstrengthEz_m
virtual void getFieldDimensions(double &xIni, double &xFinal, double &yIni, double &yFinal, double &zIni, double &zFinal) const
FieldArray FieldstrengthEy_m
virtual void getFieldDimensions(double &zBegin, double &zEnd) const
bool tryMapComponents(const char *name, long long step, FieldArray &x, FieldArray &y, FieldArray &z, std::size_t n)