OPALX (Object Oriented Parallel Accelerator Library for Exascal) MINIorX
OPALX
FM3DMagnetoStaticH5Block.cpp
Go to the documentation of this file.
1//
2// Class FM3DMagnetoStaticH5Block
3// Class for magneto-static 3D field-maps stored in H5hut files.
4//
5// Copyright (c) 2020, Achim Gsell, Paul Scherrer Institut, Villigen PSI, Switzerland
6// All rights reserved.
7//
8// This file is part of OPAL.
9//
10// OPAL is free software: you can redistribute it and/or modify
11// it under the terms of the GNU General Public License as published by
12// the Free Software Foundation, either version 3 of the License, or
13// (at your option) any later version.
14//
15// You should have received a copy of the GNU General Public License
16// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
17//
18
21
31
35
37 if (!FieldstrengthEz_m.empty()) {
38 return;
39 }
41 long long last_step = getNumSteps() - 1;
42 setStep(last_step);
43
44 size_t field_size = num_gridpx_m * num_gridpy_m * num_gridpz_m;
45 FieldstrengthEx_m.resize(field_size);
46 FieldstrengthEy_m.resize(field_size);
47 FieldstrengthEz_m.resize(field_size);
48 FieldstrengthBx_m.resize(field_size);
49 FieldstrengthBy_m.resize(field_size);
50 FieldstrengthBz_m.resize(field_size);
51
54
55 closeFile();
56 *ippl::Info << level3
57 << typeset_msg(
58 "3d magneto static fieldmap '" + Filename_m + "' (H5hut format) read",
59 "info")
60 << endl;
61}
63 if (FieldstrengthEz_m.empty()) {
64 return;
65 }
66 FieldstrengthEx_m.clear();
67 FieldstrengthEy_m.clear();
68 FieldstrengthEz_m.clear();
69 FieldstrengthBx_m.clear();
70 FieldstrengthBy_m.clear();
71 FieldstrengthBz_m.clear();
72 *ippl::Info << level3 << typeset_msg("freed fieldmap '" + Filename_m + "'", "info") << endl;
73}
74
85
87 return 0.0;
88}
ippl::Vector< T, Dim > Vector_t
@ T3DMagnetoStaticH5Block
Definition Fieldmap.h:35
MapType Type
Definition Fieldmap.h:118
static std::string typeset_msg(const std::string &msg, const std::string &title)
Definition Fieldmap.cpp:607
std::string Filename_m
Definition Fieldmap.h:120
void getFieldInfo(const char *)
long long getNumSteps(void)
void openFileMPIOCollective(const std::string aFilename)
std::vector< double > FieldstrengthEz_m
void setStep(const long long)
virtual bool isInside(const Vector_t< double, 3 > &r) const
void getResonanceFrequency(void)
std::vector< double > FieldstrengthEx_m
void readField(const char *name, double *x, double *y, double *z)
Vector_t< double, 3 > interpolateTrilinearly(const std::vector< double > &, const std::vector< double > &, const std::vector< double > &, const Vector_t< double, 3 > &X) const
std::vector< double > FieldstrengthEy_m
FM3DMagnetoStaticH5Block(std::string aFilename)
std::vector< double > FieldstrengthBz_m
virtual double getFrequency() const
std::vector< double > FieldstrengthBy_m
virtual bool getFieldstrength(const Vector_t< double, 3 > &R, Vector_t< double, 3 > &E, Vector_t< double, 3 > &B) const
std::vector< double > FieldstrengthBx_m