36 "The \"DUMPFIELDS\" statement dumps a field map to a user-defined "
37 "field file, for checking that fields are read in correctly "
38 "from disk. The fields are written out on a Cartesian grid.") {
41 (
"FILE_NAME",
"Name of the file to which field data is dumped");
44 (
"X_START",
"Start point in the grid in x [m]");
47 (
"DX",
"Grid step size in x [m]");
50 (
"X_STEPS",
"Number of steps in x");
53 (
"Y_START",
"Start point in the grid in y [m]");
56 (
"DY",
"Grid step size in y [m]");
59 (
"Y_STEPS",
"Number of steps in y");
62 (
"Z_START",
"Start point in the grid in z [m]");
65 (
"DZ",
"Grid step size in z [m]");
68 (
"Z_STEPS",
"Number of steps in z");
131 (*it)->writeFieldThis(field);
138 "The grid was nullptr; there was a problem with the DumpFields initialisation.");
140 if (field ==
nullptr) {
142 "The field to be written was nullptr.");
145 *gmsg << *
this <<
endl;
148 if (std::filesystem::path(
filename_m).is_absolute() ==
true) {
160 std::ofstream fout(fname.c_str(), std::ofstream::out);
163 "Failed to open DumpFields file " +
filename_m);
167 fout << 1 <<
" x [m]\n";
168 fout << 2 <<
" y [m]\n";
169 fout << 3 <<
" z [m]\n";
170 fout << 4 <<
" Bx [kGauss]\n";
171 fout << 5 <<
" By [kGauss]\n";
172 fout << 6 <<
" Bz [kGauss]\n";
179 it.getPosition(&point[0]);
180 field->
apply(point, centroid, time, E, B);
181 fout << point[0] <<
" " << point[1] <<
" " << point[2] <<
" ";
182 fout << B[0] <<
" " << B[1] <<
" " << B[2] <<
"\n";
186 "Something went wrong during writing " +
filename_m);
192 os <<
"* ************* D U M P F I E L D S *********************************************** " <<
std::endl;
203 os <<
"* ********************************************************************************** " <<
std::endl;
Attribute makeReal(const std::string &name, const std::string &help)
Make real attribute.
static OpalData * getInstance()
virtual void writeFieldThis(Component *field)
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two distribute and or modify the software for each author s protection and we want to make certain that everyone understands that there is no warranty for this free software If the software is modified by someone else and passed we want its recipients to know that what they have is not the so that any problems introduced by others will not reflect on the original authors reputations any free program is threatened constantly by software patents We wish to avoid the danger that redistributors of a free program will individually obtain patent in effect making the program proprietary To prevent we have made it clear that any patent must be licensed for everyone s free use or not licensed at all The precise terms and conditions for distribution and modification follow GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR DISTRIBUTION AND MODIFICATION This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License The refers to any such program or and a work based on the Program means either the Program or any derivative work under copyright a work containing the Program or a portion of it
std::string getString(const Attribute &attr)
Get string value.
static void writeFields(Component *field)
Mesh::Iterator begin() const
virtual DumpFields * clone(const std::string &name)
static std::unordered_set< DumpFields * > dumpsSet_m
Inform & endl(Inform &inf)
std::string::iterator iterator
virtual bool apply(const size_t &i, const double &t, Vector_t &E, Vector_t &B)
void registerOwnership(const AttributeHandler::OwnerType &itsClass) const
The base class for all OPAL exceptions.
std::string getAuxiliaryOutputDirectory() const
get the name of the the additional data directory
Attribute makeString(const std::string &name, const std::string &help)
Make string attribute.
void print(std::ostream &os) const
std::vector< Attribute > itsAttr
The object attributes.
std::string combineFilePath(std::initializer_list< std::string > ilist)
double getReal(const Attribute &attr)
Return real value.
Mesh::Iterator end() const
Interface for a single beam element.
void checkInt(double real, std::string name, double tolerance)
The base class for all OPAL actions.
interpolation::ThreeDGrid * grid_m