template<typename Field_T, typename SolutionFunction_T = std::function< typename Field_T::value_type ( const Vector3< real_t > & ) >, typename Filter_T = DefaultEvaluationFilter>
class walberla::field::AccuracyEvaluation< Field_T, SolutionFunction_T, Filter_T >
Class for evaluating the accuracy of a simulation.
Accuracy Evaluation
Class for evaluating the accuracy of a simulation by comparing simulation values with values provided by a solution function (can be the analytical solution, if one exists). Comparison is performed by evaluating discrete weighted L1, L2, and Lmax norms of the error (error = difference between simulation and solution values). For each cell that is evaluated, the weight corresponds to the volume fraction of the cell in relation to the entire domain.
Do not create objects of class AccuracyEvaluation directly, better use one of the various 'makeAccuracyEvaluation' functions below!
Template parameters:
- Field_T: the field storing the simulation values (also works if the field stores data of type Vector3)
- SolutionFunction_T: type of the solution function - must return Field_T::value_type and must take one parameter of type Vector3<real_t> that corresponds to a position inside the simulation domain (simulation domain = returned by calling getDomain() at the block storage)
- Filter_T: the type of the evaluation filter (see Evaluation Filter in 'EvaluationFilter.h')
Parameters for setting up and controlling accuracy evaluation:
- blocks: the block storage
- fieldId: block data ID of the field
- solution: the solution callback function - must return the solution when called with a position inside the domain
- filter: the evaluation filter that indicates which cells are processed
- plot frequency: the plotting interval - used for saving the data to file. If set to '0', no plotting data is created.
- log frequency: the logging interval - used for logging the data via the Logging singleton. If set to '0', no logging is performed.
- filename: the name of the file that stores the data for plotting
- normalization factor: an optional factor the simulation values and the solution values are multiplied with
- required and incompatible selectors
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 'makeAccuracyEvaluation' 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 'makeAccuracyEvaluation' functions that take configuration file data as an additional parameter in order to parse the configuration file for setting up and controlling accuracy evaluation. The configuration file block looks like as follows:
{
plotFrequency [unsigned integer];
logFrequency [unsigned integer];
filename [string];
normalization [floating point value];
}
Example:
{
plotFrequency 10;
logFrequency 1000;
filename Accuracy.txt;
}
Note that the shared pointer returned by all 'makeAccuracyEvaluation' functions can be captured by a SharedFunctor for immediate registration at a time loop (see field::makeSharedFunctor).