![]() |
ryujin 2.1.1 revision 71cdc42292164f8095c0bd62c4ea75ebcfac58fa
|
#include <source/error_evaluation.h>


Public Member Functions | |
Constructor and setup | |
| ErrorEvaluation (const MPIEnsemble &mpi_ensemble, const OfflineData< dim, Number > &offline_data, const HyperbolicSystem &hyperbolic_system, const ParabolicSystem ¶bolic_system, const InitialPrecomputedVector &initial_precomputed, const std::string &subsection="/ErrorEvaluation") | |
| void | prepare (const std::string &name) |
Functions for computing and reporting errors | |
| std::vector< Number > | compute (const StateVector &state_vector, const StateVector &analytic) const |
| void | write_out (const StateVector &state_vector, const StateVector &analytic, Number t) const |
| void | print_summary (std::ostream &stream, Number t, dealii::types::global_dof_index n_global_dofs, const std::vector< Number > &norms) const |
Typedefs and constexpr constants | |
| using | HyperbolicSystem = typename Description::HyperbolicSystem |
| using | ParabolicSystem = typename Description::ParabolicSystem |
| using | View = typename HyperbolicSystem::template View< dim, Number > |
| using | StateVector = typename View::StateVector |
| using | InitialPrecomputedVector = typename View::InitialPrecomputedVector |
| using | ScalarHostVector = Vectors::ScalarHostVector< Number > |
| static constexpr auto | problem_dimension = View::problem_dimension |
The ErrorEvaluation class computes error norms of the numerical solution with respect to an analytic solution.
The analytic solution is provided by the InitialValues class, i.e., the selected initial state configuration is evaluated at the current time. Consequently, error evaluation is only meaningful for initial state configurations that describe an exact (time-dependent) solution of the underlying equations.
The quantities for which the error is computed can be freely chosen via a configuration file, as well as the error norms (L1, L2, Linf). The individual errors are then consolidated by summing over all selected quantities (and, if applicable, over all MPI ensembles). The result is one number per selected norm.
The class also writes out the computed error into a log file <base name>-error.log.
Definition at line 45 of file error_evaluation.h.
| using ryujin::ErrorEvaluation< Description, dim, Number >::HyperbolicSystem = typename Description::HyperbolicSystem |
Definition at line 53 of file error_evaluation.h.
| using ryujin::ErrorEvaluation< Description, dim, Number >::ParabolicSystem = typename Description::ParabolicSystem |
Definition at line 54 of file error_evaluation.h.
| using ryujin::ErrorEvaluation< Description, dim, Number >::View = typename HyperbolicSystem::template View<dim, Number> |
Definition at line 56 of file error_evaluation.h.
| using ryujin::ErrorEvaluation< Description, dim, Number >::StateVector = typename View::StateVector |
Definition at line 60 of file error_evaluation.h.
| using ryujin::ErrorEvaluation< Description, dim, Number >::InitialPrecomputedVector = typename View::InitialPrecomputedVector |
Definition at line 61 of file error_evaluation.h.
| using ryujin::ErrorEvaluation< Description, dim, Number >::ScalarHostVector = Vectors::ScalarHostVector<Number> |
Definition at line 62 of file error_evaluation.h.
| ryujin::ErrorEvaluation< Description, dim, Number >::ErrorEvaluation | ( | const MPIEnsemble & | mpi_ensemble, |
| const OfflineData< dim, Number > & | offline_data, | ||
| const HyperbolicSystem & | hyperbolic_system, | ||
| const ParabolicSystem & | parabolic_system, | ||
| const InitialPrecomputedVector & | initial_precomputed, | ||
| const std::string & | subsection = "/ErrorEvaluation< Description, dim, Number >" |
||
| ) |
Constructor.
Definition at line 22 of file error_evaluation.template.h.
| void ryujin::ErrorEvaluation< Description, dim, Number >::prepare | ( | const std::string & | name | ) |
Prepare error evaluation. A call to prepare() validates the selected quantities and norms and is necessary before compute(), write_out(), or print_summary() can be called.
The string parameter name is used as base name for the error log file <name>-error.log. Calling prepare() resets the log file and writes out a header describing its contents.
Definition at line 63 of file error_evaluation.template.h.
| std::vector< Number > ryujin::ErrorEvaluation< Description, dim, Number >::compute | ( | const StateVector & | state_vector, |
| const StateVector & | analytic | ||
| ) | const |
Compute the consolidated error norms of the difference between the state vector state_vector and the analytic solution analytic (interpolated at the same time). The returned vector contains one value per selected norm in the order in which the norms have been selected.
Definition at line 106 of file error_evaluation.template.h.
| void ryujin::ErrorEvaluation< Description, dim, Number >::write_out | ( | const StateVector & | state_vector, |
| const StateVector & | analytic, | ||
| Number | t | ||
| ) | const |
Compute the consolidated error norms at time t and append a line to the error log file.
Definition at line 196 of file error_evaluation.template.h.
| void ryujin::ErrorEvaluation< Description, dim, Number >::print_summary | ( | std::ostream & | stream, |
| Number | t, | ||
| dealii::types::global_dof_index | n_global_dofs, | ||
| const std::vector< Number > & | norms | ||
| ) | const |
Print a human readable summary of the error norms norms (as returned by compute()) at time t and for a discretization with n_global_dofs degrees of freedom to stream.
Definition at line 222 of file error_evaluation.template.h.
|
staticconstexpr |
Definition at line 58 of file error_evaluation.h.