OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
FMDummy.cpp
Go to the documentation of this file.
1 #include "Fields/FMDummy.h"
2 #include "Fields/Fieldmap.hpp"
3 
4 
5 FMDummy::FMDummy(std::string aFilename):
6  Fieldmap(aFilename),
7  zbegin_m(0.0),
8  zend_m(-1e-3) {
9 
10  std::stringstream errormsg;
11  errormsg << "THERE SEEMS TO BE SOMETHING WRONG WITH YOUR FIELD MAP '" << Filename_m << "'.\n"
12  << "Could not determine the file type.\n"
13  << "Please check the section about field maps in the user manual.\n";
14  std::string errormsg_str = typeset_msg(errormsg.str(), "error");
15  WARNMSG(errormsg_str << "\n" << endl);
16 
17  if(Ippl::myNode() == 0) {
18  std::ofstream omsg("errormsg.txt", std::ios_base::app);
19  omsg << errormsg_str << std::endl;
20  omsg.close();
21  }
23 }
24 
26 { }
27 
29 { }
30 
32 { }
33 
34 bool FMDummy::getFieldstrength(const Vector_t &/*R*/, Vector_t &/*E*/, Vector_t &/*B*/) const {
35  return false;
36 }
37 
38 bool FMDummy::getFieldDerivative(const Vector_t &/*R*/, Vector_t &/*E*/, Vector_t &/*B*/, const DiffDirection &/*dir*/) const {
39  return false;
40 }
41 
42 void FMDummy::getFieldDimensions(double &zBegin, double &zEnd) const {
43  zBegin = zbegin_m;
44  zEnd = zend_m;
45 }
46 void FMDummy::getFieldDimensions(double &/*xIni*/, double &/*xFinal*/, double &/*yIni*/, double &/*yFinal*/, double &/*zIni*/, double &/*zFinal*/) const {}
47 
49 { }
50 
51 void FMDummy::getInfo(Inform */*msg*/)
52 { }
53 
54 double FMDummy::getFrequency() const {
55  static double dummy = 0.0;
56  return dummy;
57 }
58 
59 void FMDummy::setFrequency(double /*freq*/)
60 { }
DiffDirection
Definition: Fieldmap.h:54
Inform & endl(Inform &inf)
Definition: Inform.cpp:42
#define WARNMSG(msg)
Definition: IpplInfo.h:349
constexpr double e
The value of.
Definition: Physics.h:39
void disableFieldmapWarning()
Definition: Fieldmap.cpp:613
static std::string typeset_msg(const std::string &msg, const std::string &title)
Definition: Fieldmap.cpp:652
std::string Filename_m
Definition: Fieldmap.h:117
virtual void swap()
Definition: FMDummy.cpp:48
virtual void getInfo(Inform *)
Definition: FMDummy.cpp:51
virtual bool getFieldstrength(const Vector_t &R, Vector_t &E, Vector_t &B) const
Definition: FMDummy.cpp:34
virtual void getFieldDimensions(double &zBegin, double &zEnd) const
Definition: FMDummy.cpp:42
~FMDummy()
Definition: FMDummy.cpp:25
virtual void freeMap()
Definition: FMDummy.cpp:31
virtual void setFrequency(double freq)
Definition: FMDummy.cpp:59
FMDummy(std::string aFilename)
Definition: FMDummy.cpp:5
virtual bool getFieldDerivative(const Vector_t &R, Vector_t &E, Vector_t &B, const DiffDirection &dir) const
Definition: FMDummy.cpp:38
virtual void readMap()
Definition: FMDummy.cpp:28
virtual double getFrequency() const
Definition: FMDummy.cpp:54
double zend_m
Definition: FMDummy.h:26
double zbegin_m
Definition: FMDummy.h:25
Definition: Inform.h:42
static int myNode()
Definition: IpplInfo.cpp:691