TimeSmoothedFields< Fields > Class Template Reference

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_
 

Detailed Description

template<class Fields>
class TimeSmoothedFields< Fields >

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.

Constructor & Destructor Documentation

◆ TimeSmoothedFields() [1/2]

template<class Fields >
TimeSmoothedFields< Fields >::TimeSmoothedFields ( std::size_t  n,
Mdouble  time 
)
inline

Constructor; sets the size of the fields_ vector and time_; sets sumWeights_ to zero.

58  : time_(time), sumWeights_(0), fields_(n)
59  {}
const unsigned n
Definition: CG3DPackingUnitTest.cpp:32
Mdouble time_
Definition: TimeSmoothedFields.h:80
Mdouble sumWeights_
Definition: TimeSmoothedFields.h:85
std::vector< Fields > fields_
Definition: TimeSmoothedFields.h:75

◆ TimeSmoothedFields() [2/2]

template<class Fields >
TimeSmoothedFields< Fields >::TimeSmoothedFields ( const TimeSmoothedFields< Fields > &  a)
default

Default copy Constructor; copies all member variables.

◆ ~TimeSmoothedFields()

template<class Fields >
TimeSmoothedFields< Fields >::~TimeSmoothedFields ( )
default

Default destructor; does nothing.

Member Data Documentation

◆ fields_

template<class Fields >
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.

◆ sumWeights_

template<class Fields >
Mdouble TimeSmoothedFields< Fields >::sumWeights_

The sum of weights of all time steps that are already computed

◆ time_

template<class Fields >
Mdouble TimeSmoothedFields< Fields >::time_

The time for which smoothed-time fields are evaluated


The documentation for this class was generated from the following file: