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::AccuracyEvaluationLinePlot< Field_T, SolutionFunction_T, Filter_T >
Class for plotting simulation (and solution) values along a line through the domain.
Accuracy Evaluation Line Plot
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). Simulation and solution values are evaluated along a line perpendicular to the x-axis. The data is saved to a file that can be used for plotting graphs.
Do not create objects of class AccuracyEvaluationLinePlot directly, better use one of the various 'makeAccuracyEvaluationLinePlot' 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
- y-axis: true = plot along y axis, false = plot along z axis
- line point: a point that specifies the position of the line - this point is always relative to the entire domain with [<0,0,0>,<1,1,1>], i.e., all coordinates of this point (x, y, and z) must be in [0;1]
- normalization factor: an optional factor the simulation values and the solution values are multiplied with
- domain normalization: By default, the data points in the file are relative to the simulation space as given by the domain bounding box (blocks->getDomain()). However, you can overwrite the size of the domain via the domain normalization parameter. If you do so, the data points in the file will correspond to this 'normalized' domain. This essentially scales the axis in the plot to a desired range.
- required and incompatible selectors
You do not have to specify an evaluation filter! If you do not specify any filter, all cells on the line are processed and no cell is excluded.
If you want to use a flag field as evaluation filter, fitting 'makeAccuracyEvaluationLinePlot' 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 'makeAccuracyEvaluationLinePlot' 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:
{
y [boolean];
point [Vector3: <real,real,real>];
normalization [floating point value];
domain [
AABB: [<real,real,real>,<real,real,real>]];
}
Example:
{
y true;
point <0.5,0.5,0.5>;
normalization 1;
domain [<-1,-1,-1>,<1,1,1>];
}
Note that the shared pointer returned by all 'makeAccuracyEvaluationLinePlot' functions can be dereferenced and called with a string (=filename) in order to generate a plot straight away or it can be passed to a 'makeAccuracyEvaluationLinePlotter' function (see Accuracy Evaluation Line Plotter) in order to generate a series of plots.