OPALX (Object Oriented Parallel Accelerator Library for Exascal) MINIorX
OPALX
ClassicField.cpp
Go to the documentation of this file.
2
3extern Inform* gmsg;
4
6 std::shared_ptr<Component> element, const double& start, const double& end)
7 : element_m(element), start_m(start), end_m(end), is_on_m(false) {
8}
9
13
14void ClassicField::setOn(const double& kineticEnergy) {
15 if (!is_on_m) {
16 element_m->goOnline(kineticEnergy);
17 *gmsg << "* " << element_m->getName() << " gone live" << endl;
18 is_on_m = true;
19 }
20}
21
23 if (is_on_m) {
24 element_m->goOffline();
25 *gmsg << "* " << element_m->getName() << " gone off" << endl;
26 is_on_m = false;
27 }
28}
Inform * gmsg
Definition changes.cpp:7
PartBunch< T, Dim >::ConstIterator end(PartBunch< T, Dim > const &bunch)
void setOn(const double &kinematicEnergy)
std::shared_ptr< Component > element_m
ClassicField(std::shared_ptr< Component >, const double &, const double &)