template<typename Field_T, typename Filter_T = DefaultEvaluationFilter, typename CheckFunction_T = std::function<bool ( const typename Field_T::value_type & value )>>
class walberla::field::StabilityChecker< Field_T, Filter_T, CheckFunction_T >
Class/functor for checking a running simulation for non-finite values in a specific field.
Stability Checker
If non-finite values are detected in the field that is checked, the simulation is aborted. Optionally, information about all cells that contain non-finite vales can be logged via the Logging or saved as VTK output for further investigation.
It is important to be aware that checking for non-finite values will not work when using FASTMATH: https://stackoverflow.com/questions/22931147/stdisinf-does-not-work-with-ffast-math-how-to-check-for-infinity https://community.intel.com/t5/Intel-C-Compiler/icx-2021-3-0-bug-isinf-wrong-result/m-p/1316407#M39279
Thus a different checkFunction must be used for the StabilityChecker when FASTMATH is enabled.
Do not create objects of class StabilityChecker directly, better use one of the various 'makeStabilityChecker' functions below!
Template parameters:
- Field_T: the field storing the simulation values (also works if the field stores data of type Vector3)
- Filter_T: the type of the evaluation filter (see Evaluation Filter in 'EvaluationFilter.h')
For the parameters for setting up and controlling the stability checker see the documentation of the constructor of this class.
You do not have to specify an evaluation filter! If you do not specify any filter, all cells are processed and no cell is excluded.
If you want to use a flag field as evaluation filter, fitting 'makeStabilityChecker' functions already exist. These functions need an additional template parameter FlagField_T and you have to provide the block data ID of the flag field together with a set of flag UIDs that specify which cells need to be processed.
There also exist 'makeStabilityChecker' functions that take configuration file data as an additional parameter in order to parse the configuration file for setting up and controlling the stability checker. The configuration file block looks like as follows:
{
checkFrequency [unsigned integer];
streamOutput [boolean];
vtkOutput [boolean];
vtkBaseFolder [string];
vtkExecutionFolder [string];
vtkIdentifier [string];
vtkBinary [boolean];
vtkLittleEndian [boolean];
vtkMPIIO [boolean];
vtkForcePVTU [boolean];
}
Example:
{
checkFrequency 100;
streamOutput false;
vtkOutput true;
vtkBaseFolder /home/anonymous/vtk;
}
For documentation of the VTK parameters see VTK via Configuration File.
Note that the shared pointer returned by all 'makeStabilityChecker' functions can be captured by a SharedFunctor for immediate registration at a time loop (see field::makeSharedFunctor).
|
| StabilityChecker (const weak_ptr< StructuredBlockStorage > &blocks, const ConstBlockDataID &fieldId, const Filter_T &filter, const uint_t checkFrequency, const bool outputToStream=true, const bool outputVTK=true, const Set< SUID > &requiredSelectors=Set< SUID >::emptySet(), const Set< SUID > &incompatibleSelectors=Set< SUID >::emptySet()) |
| Constructor for class 'StabilityChecker'. More...
|
|
| StabilityChecker (const weak_ptr< StructuredBlockStorage > &blocks, const ConstBlockDataID &fieldId, const Filter_T &filter, const uint_t checkFrequency, CheckFunction_T checkFunction, const bool outputToStream=true, const bool outputVTK=true, const Set< SUID > &requiredSelectors=Set< SUID >::emptySet(), const Set< SUID > &incompatibleSelectors=Set< SUID >::emptySet()) |
|
| StabilityChecker (const weak_ptr< StructuredBlockStorage > &blocks, const ConstBlockDataID &fieldId, const uint_t checkFrequency, const bool outputToStream=true, const bool outputVTK=true, const Set< SUID > &requiredSelectors=Set< SUID >::emptySet(), const Set< SUID > &incompatibleSelectors=Set< SUID >::emptySet()) |
|
| StabilityChecker (const weak_ptr< StructuredBlockStorage > &blocks, const ConstBlockDataID &fieldId, const uint_t checkFrequency, CheckFunction_T checkFunction, const bool outputToStream=true, const bool outputVTK=true, const Set< SUID > &requiredSelectors=Set< SUID >::emptySet(), const Set< SUID > &incompatibleSelectors=Set< SUID >::emptySet()) |
|
void | setVTKBaseFolder (const std::string &vtkBaseFolder) |
|
void | setVTKExecutionFolder (const std::string &vtkExecutionFolder) |
|
void | setVTKIdentifier (const std::string &vtkIdentifier) |
|
void | setVTKBinary (const bool vtkBinary) |
|
void | setVTKLittleEndian (const bool vtkLittleEndian) |
|
void | setVTKMPIIO (const bool vtkMPIIO) |
|
void | setVTKForcePVTU (const bool vtkForcePVTU) |
|
void | operator() () |
|