ryujin 2.1.1 revision 71cdc42292164f8095c0bd62c4ea75ebcfac58fa
Loading...
Searching...
No Matches
List of all members
ryujin::ErrorEvaluation< Description, dim, Number > Class Template Referencefinal

#include <source/error_evaluation.h>

Inheritance diagram for ryujin::ErrorEvaluation< Description, dim, Number >:
Inheritance graph
[legend]
Collaboration diagram for ryujin::ErrorEvaluation< Description, dim, Number >:
Collaboration graph
[legend]

Public Member Functions

Constructor and setup
 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")
 
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
 

Detailed Description

template<typename Description, int dim, typename Number = double>
class ryujin::ErrorEvaluation< Description, dim, Number >

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.

Member Typedef Documentation

◆ HyperbolicSystem

template<typename Description , int dim, typename Number = double>
using ryujin::ErrorEvaluation< Description, dim, Number >::HyperbolicSystem = typename Description::HyperbolicSystem

Definition at line 53 of file error_evaluation.h.

◆ ParabolicSystem

template<typename Description , int dim, typename Number = double>
using ryujin::ErrorEvaluation< Description, dim, Number >::ParabolicSystem = typename Description::ParabolicSystem

Definition at line 54 of file error_evaluation.h.

◆ View

template<typename Description , int dim, typename Number = double>
using ryujin::ErrorEvaluation< Description, dim, Number >::View = typename HyperbolicSystem::template View<dim, Number>

Definition at line 56 of file error_evaluation.h.

◆ StateVector

template<typename Description , int dim, typename Number = double>
using ryujin::ErrorEvaluation< Description, dim, Number >::StateVector = typename View::StateVector

Definition at line 60 of file error_evaluation.h.

◆ InitialPrecomputedVector

template<typename Description , int dim, typename Number = double>
using ryujin::ErrorEvaluation< Description, dim, Number >::InitialPrecomputedVector = typename View::InitialPrecomputedVector

Definition at line 61 of file error_evaluation.h.

◆ ScalarHostVector

template<typename Description , int dim, typename Number = double>
using ryujin::ErrorEvaluation< Description, dim, Number >::ScalarHostVector = Vectors::ScalarHostVector<Number>

Definition at line 62 of file error_evaluation.h.

Constructor & Destructor Documentation

◆ ErrorEvaluation()

template<typename Description , int dim, typename Number >
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.

Member Function Documentation

◆ prepare()

template<typename Description , int dim, typename Number >
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.

◆ compute()

template<typename Description , int dim, typename Number >
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.

Note
The function requires MPI communication and is not reentrant. The returned values are only meaningful on world rank 0.

Definition at line 106 of file error_evaluation.template.h.

◆ write_out()

template<typename Description , int dim, typename Number >
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.

◆ print_summary()

template<typename Description , int dim, typename Number >
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.

Member Data Documentation

◆ problem_dimension

template<typename Description , int dim, typename Number = double>
constexpr auto ryujin::ErrorEvaluation< Description, dim, Number >::problem_dimension = View::problem_dimension
staticconstexpr

Definition at line 58 of file error_evaluation.h.


The documentation for this class was generated from the following files: