|
OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
|
#include <SinusoidalTimeDependence.h>
Public Member Functions | |
| SinusoidalTimeDependence (const std::vector< double > &f, const std::vector< double > &p, const std::vector< double > &a, const std::vector< double > &o) | |
| SinusoidalTimeDependence ()=default | |
| ~SinusoidalTimeDependence () override=default | |
| double | getValue (double time) override |
| SinusoidalTimeDependence * | clone () override |
| Inform & | print (Inform &os) const |
Static Public Member Functions | |
| static std::shared_ptr< AbstractTimeDependence > | getTimeDependence (std::string name) |
| static void | setTimeDependence (std::string name, std::shared_ptr< AbstractTimeDependence > time_dep) |
| static std::string | getName (std::shared_ptr< AbstractTimeDependence > time_dep) |
Private Attributes | |
| std::vector< double > | f_m |
| std::vector< double > | p_m |
| std::vector< double > | a_m |
| std::vector< double > | o_m |
Static Private Attributes | |
| static std::map< std::string, std::shared_ptr< AbstractTimeDependence > > | td_map |
Time dependence that follows sum of a set of sinusoids sigma_over_i(a[i] / 2 * sin(2 * pi * f[i] * t + p[i]) + o[i]) a is the peak to peak amplitude, f is the frequency, p is the phase offset, o is the DC offset, t is the time.
Definition at line 34 of file SinusoidalTimeDependence.h.
| SinusoidalTimeDependence::SinusoidalTimeDependence | ( | const std::vector< double > & | f, |
| const std::vector< double > & | p, | ||
| const std::vector< double > & | a, | ||
| const std::vector< double > & | o ) |
Constructor
| f | the frequencies in Hz; can be of arbitrary length |
| p | the phase offsets in radians; can be of arbitrary length |
| a | the peak-to-peak amplitude; can be of arbitrary length |
| o | the DC offset; can be of arbitrary length (user is responsible for issues like floating point precision). |
Definition at line 24 of file SinusoidalTimeDependence.cpp.
References a, a_m, f_m, o_m, and p_m.
Referenced by clone(), and ~SinusoidalTimeDependence().
|
default |
Default Constructor makes a 0 length polynomial
Referenced by clone().
|
overridedefault |
Destructor does default
References SinusoidalTimeDependence().
|
overridevirtual |
Inheritable clone function
Implements AbstractTimeDependence.
Definition at line 52 of file SinusoidalTimeDependence.cpp.
References a_m, f_m, o_m, p_m, SinusoidalTimeDependence(), and SinusoidalTimeDependence().
|
staticinherited |
Get the name corresponding to a given time_dep
| time_dep | time dependence to lookup |
| GeneralClassicException | if time_dep is not recognised |
Definition at line 50 of file AbstractTimeDependence.cpp.
References td_map.
|
staticinherited |
Look up the time dependence that has a given name
| name | name of the time dependence |
| GeneralClassicException | if name is not recognised |
Definition at line 36 of file AbstractTimeDependence.cpp.
Referenced by PyOpal::PyAbstractTimeDependence::function(), VariableRFCavity::initialise(), MultipoleT::initialiseTimeDepencencies(), and ParallelCyclotronTracker::visitRFCavity().
|
overridevirtual |
Return the sinusoidal value
| time | simulation time in seconds |
Implements AbstractTimeDependence.
Definition at line 30 of file SinusoidalTimeDependence.cpp.
Print the sinusoidals
| os | "Inform" stream to which the sinusoidals are printed. |
Definition at line 56 of file SinusoidalTimeDependence.cpp.
References a_m, endl(), f_m, Inform::flags(), o_m, and p_m.
Referenced by operator<<().
|
staticinherited |
Add a value to the lookup table
| name | name of the time dependence. If name already exists in the map, it is overwritten with the new value. |
| time_dep | shared_ptr to the time dependence. |
Definition at line 45 of file AbstractTimeDependence.cpp.
Referenced by OpalPolynomialTimeDependence::update(), OpalSinusoidalTimeDependence::update(), and OpalSplineTimeDependence::update().
|
private |
Definition at line 72 of file SinusoidalTimeDependence.h.
Referenced by clone(), getValue(), print(), and SinusoidalTimeDependence().
|
private |
Definition at line 70 of file SinusoidalTimeDependence.h.
Referenced by clone(), getValue(), print(), and SinusoidalTimeDependence().
|
private |
Definition at line 73 of file SinusoidalTimeDependence.h.
Referenced by clone(), getValue(), print(), and SinusoidalTimeDependence().
|
private |
Definition at line 71 of file SinusoidalTimeDependence.h.
Referenced by clone(), getValue(), print(), and SinusoidalTimeDependence().
|
staticprivateinherited |
Definition at line 95 of file AbstractTimeDependence.h.
Referenced by getName(), getTimeDependence(), and setTimeDependence().