|
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 |
| double | getIntegral (double time) override |
| SinusoidalTimeDependence * | clone () override |
| Inform & | print (Inform &os) const |
Public Member Functions inherited from AbstractTimeDependence | |
| virtual | ~AbstractTimeDependence () |
Private Attributes | |
| std::vector< double > | f_m |
| std::vector< double > | p_m |
| std::vector< double > | a_m |
| std::vector< double > | o_m |
Additional Inherited Members | |
Static Public Member Functions inherited from AbstractTimeDependence | |
| 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) |
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.
|
default |
Default Constructor makes a 0 length polynomial
Referenced by clone().
|
overridedefault |
Destructor does default
|
overridevirtual |
Inheritable clone function
Implements AbstractTimeDependence.
Definition at line 74 of file SinusoidalTimeDependence.cpp.
References a_m, f_m, o_m, p_m, and SinusoidalTimeDependence().

|
overridevirtual |
Return the integral from 0 to time
| time | simulation time |
Implements AbstractTimeDependence.
Definition at line 52 of file SinusoidalTimeDependence.cpp.
|
overridevirtual |
Return the sinusoidal value
| time | simulation time |
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 78 of file SinusoidalTimeDependence.cpp.
References a_m, endl(), f_m, Inform::flags(), o_m, and p_m.
Referenced by operator<<().

|
private |
Definition at line 77 of file SinusoidalTimeDependence.h.
Referenced by clone(), getIntegral(), getValue(), and print().
|
private |
Definition at line 75 of file SinusoidalTimeDependence.h.
Referenced by clone(), getIntegral(), getValue(), and print().
|
private |
Definition at line 78 of file SinusoidalTimeDependence.h.
Referenced by clone(), getIntegral(), getValue(), and print().
|
private |
Definition at line 76 of file SinusoidalTimeDependence.h.
Referenced by clone(), getIntegral(), getValue(), and print().