OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
ClassicField.cpp
Go to the documentation of this file.
2
3extern Inform *gmsg;
4
5ClassicField::ClassicField(std::shared_ptr<Component> element, const double &start, const double &end):
6 element_m(element),
7 start_m(start),
8 end_m(end),
9 is_on_m(false)
10{ }
11
13 element_m = nullptr;
14}
15
16void ClassicField::setOn(const double &kineticEnergy) {
17 if(!is_on_m) {
18 element_m->goOnline(kineticEnergy);
19 INFOMSG(level3 << element_m->getName() << " gone live" << endl);
20 is_on_m = true;
21 }
22}
23
25 if(is_on_m) {
26 element_m->goOffline();
27 INFOMSG(level3 << element_m->getName() << " gone off" << endl);
28 is_on_m = false;
29 }
30}
PartBunchBase< T, Dim >::ConstIterator end(PartBunchBase< T, Dim > const &bunch)
Inform * gmsg
Definition: Main.cpp:61
Inform & endl(Inform &inf)
Definition: Inform.cpp:42
Inform & level3(Inform &inf)
Definition: Inform.cpp:47
#define INFOMSG(msg)
Definition: IpplInfo.h:348
void setOn(const double &kinematicEnergy)
std::shared_ptr< Component > element_m
Definition: ClassicField.h:37
ClassicField(std::shared_ptr< Component >, const double &, const double &)
Definition: ClassicField.cpp:5
Definition: Inform.h:42