OpenLB 1.7
|
Check time-convergence of a scalar. More...
#include <benchmarkUtil.h>
Public Member Functions | |
ValueTracer (T u, T L, T epsilon) | |
Ctor. | |
ValueTracer (int deltaT, T epsilon) | |
Ctor. | |
ValueTracer (int deltaT, T epsilon, std::string name) | |
Ctor. | |
void | resetScale (T u, T L) |
Change values of u and L to update characteristic scales of the system. | |
void | resetValues () |
reinitializes the values | |
int | getDeltaT () const |
Get characteristic time scale. | |
void | takeValue (T val, bool doPrint=false) |
Feed the object with a new measured scalar. | |
bool | hasConverged () const |
Test for convergence, with respect to stdDev. | |
bool | convergenceCheck () const |
Test for convergence, with respect to difference between min and max value;. | |
bool | hasConvergedMinMax () const |
Test for convergence, with respect to difference between min and max value;. | |
T | computeAverage () const |
T | computeStdDev (T average) const |
T | getEpsilon () const |
void | setEpsilon (T epsilon) |
Check time-convergence of a scalar.
This class is useful, for example to check convergence of the velocity field for the simulation of a stationary flow. Convergence is claimed when the standard deviation of the monitored value is smaller than epsilon times the average. The statistics are taken over a macroscopic time scale of the system.
Definition at line 49 of file benchmarkUtil.h.
olb::util::ValueTracer< T >::ValueTracer | ( | T | u, |
T | L, | ||
T | epsilon ) |
Ctor.
u | The characteristic velocity of the system, for computation of the characteristic time scale. |
L | The characteristic length of the system, for computation of the characteristic time scale. |
epsilon | Precision of the convergence. |
Definition at line 45 of file benchmarkUtil.hh.
olb::util::ValueTracer< T >::ValueTracer | ( | int | deltaT, |
T | epsilon ) |
Ctor.
deltaT | corresponds to iteration steps (averaging) |
epsilon | allowed derivation of quantity |
Definition at line 54 of file benchmarkUtil.hh.
olb::util::ValueTracer< T >::ValueTracer | ( | int | deltaT, |
T | epsilon, | ||
std::string | name ) |
Ctor.
deltaT | corresponds to iteration steps (averaging) |
epsilon | allowed derivation of quantity |
name | quantity name |
Definition at line 63 of file benchmarkUtil.hh.
T olb::util::ValueTracer< T >::computeAverage | ( | ) | const |
Definition at line 162 of file benchmarkUtil.hh.
T olb::util::ValueTracer< T >::computeStdDev | ( | T | average | ) | const |
Definition at line 168 of file benchmarkUtil.hh.
References olb::util::average(), and olb::util::sqrt().
bool olb::util::ValueTracer< T >::convergenceCheck | ( | ) | const |
Test for convergence, with respect to difference between min and max value;.
Definition at line 130 of file benchmarkUtil.hh.
References olb::util::abs(), olb::util::average(), and olb::util::fabs().
int olb::util::ValueTracer< T >::getDeltaT | ( | ) | const |
Get characteristic time scale.
Definition at line 72 of file benchmarkUtil.hh.
T olb::util::ValueTracer< T >::getEpsilon | ( | ) | const |
Definition at line 179 of file benchmarkUtil.hh.
bool olb::util::ValueTracer< T >::hasConverged | ( | ) | const |
Test for convergence, with respect to stdDev.
Definition at line 112 of file benchmarkUtil.hh.
References olb::util::abs(), olb::util::average(), and olb::util::fabs().
bool olb::util::ValueTracer< T >::hasConvergedMinMax | ( | ) | const |
Test for convergence, with respect to difference between min and max value;.
Definition at line 148 of file benchmarkUtil.hh.
References olb::util::abs(), olb::util::average(), olb::util::max_element(), and olb::util::min_element().
void olb::util::ValueTracer< T >::resetScale | ( | T | u, |
T | L ) |
Change values of u and L to update characteristic scales of the system.
Definition at line 93 of file benchmarkUtil.hh.
References olb::util::abs().
void olb::util::ValueTracer< T >::resetValues | ( | ) |
reinitializes the values
Definition at line 103 of file benchmarkUtil.hh.
void olb::util::ValueTracer< T >::setEpsilon | ( | T | epsilon | ) |
Definition at line 185 of file benchmarkUtil.hh.
void olb::util::ValueTracer< T >::takeValue | ( | T | val, |
bool | doPrint = false ) |
Feed the object with a new measured scalar.
Definition at line 78 of file benchmarkUtil.hh.
References olb::util::abs(), and olb::util::average().