|
A helper class for TimeSmoothedCG containing the time-smoothed variables. More...
#include <TimeSmoothedFields.h>
Public Member Functions | |
TimeSmoothedFields (std::size_t n, Mdouble time) | |
Constructor; sets the size of the fields_ vector and time_; sets sumWeights_ to zero. More... | |
TimeSmoothedFields (const TimeSmoothedFields &a)=default | |
Default copy Constructor; copies all member variables. More... | |
~TimeSmoothedFields ()=default | |
Default destructor; does nothing. More... | |
Public Attributes | |
std::vector< Fields > | fields_ |
Mdouble | time_ |
Mdouble | sumWeights_ |
A helper class for TimeSmoothedCG containing the time-smoothed variables.
Time-smoothing of the Fields is achieved by averaging the field values F over time,
\[\bar F(t,w_t) = \frac{\sum_i w(t-t_i) F(t_i)}{\sum_i w(t-t_i)},\]
with the weight given by a Gaussian distribution,
\[\bar w(t-t_i) = exp(-(t-t_i)^2/2w_t^2).\]
Thus, the smoothed fields have to be stored over several time steps until the full sum has been computed. This is done in TimeSmoothedCG::averages_, which is a vector of TimeSmoothedFields values; for each time step $t$ at which smoothed values are computed, a TimeSmoothedFields object is added at \(t-t_{cutoff}\), then values are continually added until the smoothed field is fully computed at time \(t+t_{cutoff}\); the data is then written and removed from the vector.
|
inline |
Constructor; sets the size of the fields_ vector and time_; sets sumWeights_ to zero.
|
default |
Default copy Constructor; copies all member variables.
|
default |
Default destructor; does nothing.
std::vector<Fields> TimeSmoothedFields< Fields >::fields_ |
A vector of StandardFields values whose length is equal to the number of CGPoints. Is used to compute the time-smoothed fields.
Mdouble TimeSmoothedFields< Fields >::sumWeights_ |
The sum of weights of all time steps that are already computed
Mdouble TimeSmoothedFields< Fields >::time_ |
The time for which smoothed-time fields are evaluated