SpECTRE
v2024.09.29
|
A weighted exponential averager of
#include <Averager.hpp>
Classes | |
struct | Average0thDeriv |
struct | AverageTimescaleFraction |
Public Types | |
using | options = implementation defined |
Public Member Functions | |
Averager (double avg_timescale_frac, bool average_0th_deriv_of_q) | |
avg_timescale_frac determines the exponential averaging timescale through avg_timescale_frac avg_timescale_frac must be positive. average_0th_deriv_of_q determines whether the call operator returns an averaged or unaveraged quantity for the 0th derivative of true returns an averaged 0th derivative of false returns the raw 0th derivative of average_0th_deriv_of_q option only specifies whether to return an averaged value for the 0th derivative piece of the function. | |
Averager (Averager &&rhs) | |
Averager & | operator= (Averager &&rhs) |
Averager (const Averager &)=default | |
Averager & | operator= (const Averager &)=default |
const std::optional< std::array< DataVector, DerivOrder+1 > > & | operator() (double time) const |
Returns time , provided there is sufficient data. The averager is limited by the need for at least (DerivOrder + 1) data points in order to provide the DerivOrder 'th derivative. If sufficient data is available, it returns DerivOrder 'th derivative, at time . If using_average_0th_deriv_of_q() is true , then the returned 0th derivative of std::optional . | |
void | clear () |
A function that allows for resetting the averager. | |
void | update (double time, const DataVector &raw_q, const DataVector ×cales) |
The function responsible for updating the averaged values at time . Requires raw_q (the raw components of timescales (the associated damping times for each component). | |
double | last_time_updated () const |
Returns the latest time at which the averager has sufficient data to return | |
double | average_time (double time) const |
Returns the exponentially averaged time at time . The time is averaged along side | |
bool | using_average_0th_deriv_of_q () const |
Returns a bool corresponding to whether average_0th_deriv_of_q is true /false . | |
double | avg_timescale_frac () const |
Returns the averaging timescale fraction. | |
void | assign_time_between_measurements (const double current_time_between_measurements) |
Assign the minimum of the measurement timescales related to a specific control system to time_between_measurements_. | |
bool | is_ready (const double time) const |
Returns true if the averager is ready to receive a measurement. | |
void | pup (PUP::er &p) |
Static Public Attributes | |
static constexpr Options::String | help |
Friends | |
template<size_t DDerivOrder> | |
bool | operator== (const Averager< DDerivOrder > &, const Averager< DDerivOrder > &) |
A weighted exponential averager of
The purpose of the averager is to provide DerivOrder
'th derivative. The 0th derivative of average_0th_deriv_of_q
option allows for specifying that the 0th derivative should be averaged in addition to the derivatives. This may be desirable for control systems where
The averager is designed to support DerivOrders 1, 2, and 3. If an additional DerivOrder is needed, finite differencing needs to be implemented to specifically handle that order (as it seems like overkill to generalize the differencing stencil at this time).
|
staticconstexpr |