20 h5_size_t grid_dims[3];
23 h5_size_t len_name = 20;
28 h5_prop_t props = H5CreateFileProp ();
30 h5err = H5SetPropFileMPIOCollective (props, &comm);
31 assert (h5err != H5_ERR);
32 h5_file_t file = H5OpenFile (aFilename.c_str(), H5_O_RDONLY, props);
33 assert (file != (h5_file_t)H5_ERR);
36 h5_int64_t last_step = H5GetNumSteps(file) - 1;
37 assert (last_step >= 0);
38 h5err = H5SetStep(file, last_step);
39 assert (h5err != H5_ERR);
41 h5_int64_t num_fields = H5BlockGetNumFields(file);
42 assert (num_fields != H5_ERR);
44 for(h5_ssize_t i = 0; i < num_fields; ++ i) {
45 h5err = H5BlockGetFieldInfo(file, (h5_size_t)i, name, len_name, &grid_rank, grid_dims, &field_dims, &ftype);
46 assert (h5err != H5_ERR);
47 if(strcmp(name,
"Efield") == 0) {
53 h5err = H5Block3dGetFieldSpacing(file,
"Efield", &
hx_m, &
hy_m, &
hz_m);
54 assert (h5err != H5_ERR);
56 assert (h5err != H5_ERR);
65 h5err = H5ReadFileAttribFloat64(file,
"Resonance Frequency(Hz)", &
frequency_m);
66 assert (h5err != H5_ERR);
69 h5err = H5CloseFile(file);
70 assert (h5err != H5_ERR);
86 h5_prop_t props = H5CreateFileProp ();
88 h5err = H5SetPropFileMPIOCollective (props, &comm);
89 assert (h5err != H5_ERR);
90 h5_file_t file = H5OpenFile (
Filename_m.c_str(), H5_O_RDONLY, props);
91 assert (file != (h5_file_t)H5_ERR);
96 h5_int64_t last_step = H5GetNumSteps(file) - 1;
97 h5err = H5SetStep(file, last_step);
98 assert (h5err != H5_ERR);
107 h5err = H5Block3dSetView(file,
111 assert (h5err != H5_ERR);
112 h5err = H5Block3dReadVector3dFieldFloat64(
118 assert (h5err != H5_ERR);
119 h5err = H5Block3dReadVector3dFieldFloat64(
125 assert (h5err != H5_ERR);
127 h5err = H5CloseFile(file);
128 assert (h5err != H5_ERR);
178 E(0) += (1.0 - lever_x) * (1.0 - lever_y) * (1.0 - lever_z) *
FieldstrengthEx_m[index1]
188 E(1) += (1.0 - lever_x) * (1.0 - lever_y) * (1.0 - lever_z) *
FieldstrengthEy_m[index1]
197 E(2) += (1.0 - lever_x) * (1.0 - lever_y) * (1.0 - lever_z) *
FieldstrengthEz_m[index1]
206 B(0) += ((1.0 - lever_x) * (1.0 - lever_y) * (1.0 - lever_z) *
FieldstrengthHx_m[index1]
215 B(1) += ((1.0 - lever_x) * (1.0 - lever_y) * (1.0 - lever_z) *
FieldstrengthHy_m[index1]
224 B(2) += ((1.0 - lever_x) * (1.0 - lever_y) * (1.0 - lever_z) *
FieldstrengthHz_m[index1]
263 (*msg) <<
" hx= " <<
hx_m <<
" hy= " <<
hy_m <<
" hz= " <<
hz_m <<
" [mm] " <<
endl;
294 if(
fabs(F[i].second) > Ez_max) {
295 Ez_max =
fabs(F[i].second);
301 F[i].second /= Ez_max;
std::vector< h5_float64_t > FieldstrengthEx_m
virtual void setFrequency(double freq)
PETE_TUTree< FnFabs, typename T::PETE_Expr_t > fabs(const PETE_Expr< T > &l)
constexpr double two_pi
The value of .
static std::string typeset_msg(const std::string &msg, const std::string &title)
virtual bool getFieldstrength(const Vector_t &R, Vector_t &E, Vector_t &B) const
std::vector< h5_float64_t > FieldstrengthHy_m
FM3DH5Block(std::string aFilename)
constexpr double mu_0
The permeability of vacuum in Vs/Am.
virtual bool getFieldDerivative(const Vector_t &R, Vector_t &E, Vector_t &B, const DiffDirection &dir) const
virtual void getInfo(Inform *msg)
static MPI_Comm getComm()
std::vector< h5_float64_t > FieldstrengthEz_m
virtual void getFieldDimensions(double &zBegin, double &zEnd, double &rBegin, double &rEnd) const
std::vector< h5_float64_t > FieldstrengthEy_m
std::vector< h5_float64_t > FieldstrengthHz_m
std::vector< h5_float64_t > FieldstrengthHx_m
virtual void getOnaxisEz(std::vector< std::pair< double, double > > &F)
virtual double getFrequency() const
Inform & level3(Inform &inf)
PETE_TUTree< FnFloor, typename T::PETE_Expr_t > floor(const PETE_Expr< T > &l)
Inform & endl(Inform &inf)