ryujin 2.5.0 revision c64172211cf21344cb9b9b0f3a1266aa6400d392
Loading...
Searching...
No Matches
List of all members
ryujin::HyperbolicModule< HyperbolicDescription, dim, Number > Class Template Referencefinal

#include <include/ryujin/typed/hyperbolic_module.h>

Inheritance diagram for ryujin::HyperbolicModule< HyperbolicDescription, dim, Number >:
Inheritance graph
[legend]
Collaboration diagram for ryujin::HyperbolicModule< HyperbolicDescription, dim, Number >:
Collaboration graph
[legend]

Public Member Functions

Constructor and setup
 HyperbolicModule (const MPIEnsemble &mpi_ensemble, const OfflineData< dim, Number > &offline_data, const HyperbolicSystem &hyperbolic_system, const InitialValues< HyperbolicDescription, dim, Number > &initial_values, const std::string &subsection="/HyperbolicModule")
 
void prepare () override
 
Functions for performing explicit time steps
void reinit_state_vector (StateVector< Number > &state_vector) const override
 
void prepare_state_vector (StateVector< Number > &state_vector, Number t) const override
 
void fill_precomputed_values (StateVector< Number > &state_vector) const override
 
Number forward_euler_step (const StateVector< Number > &old_state_vector, StageVectors stage_state_vectors, StageWeights stage_weights, StateVector< Number > &new_state_vector, Number t, Number tau, Number tau_max=std::numeric_limits< Number >::max()) const override
 
Information and statistics
void print_solver_statistics (std::ostream &) const override
 
- Public Member Functions inherited from ryujin::Interface::HyperbolicModule< dim, Number >
void set_cfl (Number new_cfl) const
 
void set_acceptable_tau_max_ratio (Number new_acceptable_tau_max_ratio) const
 

Typedefs and constexpr constants

using StageVectors = typename Interface::HyperbolicModule< dim, Number >::StageVectors
 
using StageWeights = typename Interface::HyperbolicModule< dim, Number >::StageWeights
 
using HyperbolicSystem = typename HyperbolicDescription::HyperbolicSystem
 
using View = typename HyperbolicSystem::template View< dim, Number >
 
using Indicator = typename HyperbolicDescription::template Indicator< Number >
 
using Limiter = typename HyperbolicDescription::template Limiter< Number >
 
using WaveSpeedEstimator = typename HyperbolicDescription::template WaveSpeedEstimator< Number >
 
using state_type = typename View::state_type
 
using precomputed_type = typename View::precomputed_type
 
using initial_precomputed_type = typename View::initial_precomputed_type
 
static constexpr auto problem_dimension = View::problem_dimension
 
static constexpr auto n_precomputed_values = View::n_precomputed_values
 
static constexpr auto n_initial_precomputed_values
 

Additional Inherited Members

- Protected Member Functions inherited from ryujin::Interface::HyperbolicModule< dim, Number >
 HyperbolicModule (const unsigned int problem_dimension, const unsigned int n_precomputed_values, const std::string &subsection)
 
- Protected Attributes inherited from ryujin::Interface::HyperbolicModule< dim, Number >
Number cfl_
 
Number acceptable_tau_max_ratio_
 

Detailed Description

template<typename HyperbolicDescription, int dim, typename Number = double>
class ryujin::HyperbolicModule< HyperbolicDescription, dim, Number >

Explicit forward Euler time-stepping for hyperbolic systems with convex limiting.

This module is described in detail in [17], Alg. 1.

Definition at line 37 of file hyperbolic_module.h.

Member Typedef Documentation

◆ StageVectors

template<typename HyperbolicDescription , int dim, typename Number = double>
using ryujin::HyperbolicModule< HyperbolicDescription, dim, Number >::StageVectors = typename Interface::HyperbolicModule<dim, Number>::StageVectors

Definition at line 45 of file hyperbolic_module.h.

◆ StageWeights

template<typename HyperbolicDescription , int dim, typename Number = double>
using ryujin::HyperbolicModule< HyperbolicDescription, dim, Number >::StageWeights = typename Interface::HyperbolicModule<dim, Number>::StageWeights

Definition at line 48 of file hyperbolic_module.h.

◆ HyperbolicSystem

template<typename HyperbolicDescription , int dim, typename Number = double>
using ryujin::HyperbolicModule< HyperbolicDescription, dim, Number >::HyperbolicSystem = typename HyperbolicDescription::HyperbolicSystem

Definition at line 51 of file hyperbolic_module.h.

◆ View

template<typename HyperbolicDescription , int dim, typename Number = double>
using ryujin::HyperbolicModule< HyperbolicDescription, dim, Number >::View = typename HyperbolicSystem::template View<dim, Number>

Definition at line 53 of file hyperbolic_module.h.

◆ Indicator

template<typename HyperbolicDescription , int dim, typename Number = double>
using ryujin::HyperbolicModule< HyperbolicDescription, dim, Number >::Indicator = typename HyperbolicDescription::template Indicator<Number>

Definition at line 55 of file hyperbolic_module.h.

◆ Limiter

template<typename HyperbolicDescription , int dim, typename Number = double>
using ryujin::HyperbolicModule< HyperbolicDescription, dim, Number >::Limiter = typename HyperbolicDescription::template Limiter<Number>

Definition at line 58 of file hyperbolic_module.h.

◆ WaveSpeedEstimator

template<typename HyperbolicDescription , int dim, typename Number = double>
using ryujin::HyperbolicModule< HyperbolicDescription, dim, Number >::WaveSpeedEstimator = typename HyperbolicDescription::template WaveSpeedEstimator<Number>

Definition at line 60 of file hyperbolic_module.h.

◆ state_type

template<typename HyperbolicDescription , int dim, typename Number = double>
using ryujin::HyperbolicModule< HyperbolicDescription, dim, Number >::state_type = typename View::state_type

Definition at line 65 of file hyperbolic_module.h.

◆ precomputed_type

template<typename HyperbolicDescription , int dim, typename Number = double>
using ryujin::HyperbolicModule< HyperbolicDescription, dim, Number >::precomputed_type = typename View::precomputed_type

Definition at line 69 of file hyperbolic_module.h.

◆ initial_precomputed_type

template<typename HyperbolicDescription , int dim, typename Number = double>
using ryujin::HyperbolicModule< HyperbolicDescription, dim, Number >::initial_precomputed_type = typename View::initial_precomputed_type

Definition at line 74 of file hyperbolic_module.h.

Constructor & Destructor Documentation

◆ HyperbolicModule()

template<typename HyperbolicDescription , int dim, typename Number >
ryujin::HyperbolicModule< HyperbolicDescription, dim, Number >::HyperbolicModule ( const MPIEnsemble &  mpi_ensemble,
const OfflineData< dim, Number > &  offline_data,
const HyperbolicSystem &  hyperbolic_system,
const InitialValues< HyperbolicDescription, dim, Number > &  initial_values,
const std::string &  subsection = "/HyperbolicModule< HyperbolicDescription, dim, Number >" 
)

Constructor

Definition at line 43 of file hyperbolic_module.template.h.

Member Function Documentation

◆ prepare()

template<typename HyperbolicDescription , int dim, typename Number >
void ryujin::HyperbolicModule< HyperbolicDescription, dim, Number >::prepare ( )
override

Prepare time stepping. A call to prepare() allocates temporary storage and is necessary before any of the following time-stepping functions can be called.

Definition at line 64 of file hyperbolic_module.template.h.

References ryujin::have_separate_memory_spaces, and ryujin::implicit_transfers.

◆ reinit_state_vector()

template<typename HyperbolicDescription , int dim, typename Number >
void ryujin::HyperbolicModule< HyperbolicDescription, dim, Number >::reinit_state_vector ( StateVector< Number > &  state_vector) const
override

(Re)initialize the hyperbolic state vector component and the precomputed vector component of the state vector.

Note
This routine does not modify the parabolic state vector component.

Helper function that (re)initializes the state and the precomputed component of a StateVector to proper sizes.

Note
This method does neither initialize nor resize the parabolic state vector component. The ParabolicModule itself has to ensure proper setup during prepare_state_vector() and solve().

Definition at line 158 of file hyperbolic_module.template.h.

◆ prepare_state_vector()

template<typename HyperbolicDescription , int dim, typename Number >
void ryujin::HyperbolicModule< HyperbolicDescription, dim, Number >::prepare_state_vector ( StateVector< Number > &  state_vector,
Number  t 
) const
override

This function preprocesses a given state vector U in preparation for an explicit euler step performed by the forward_euler_step() function. The function performs the following tasks:

  • We update the U component of the state vector by enforcing boundary conditions for the supplied time time t. We then updates ghost ranges on U so that the state vector is consistent across MPI ranks.
  • The function then runs the precomputation loop that populates the "precomputed values" component of the state vector and distributes the result over all MPI ranks by updating ghost ranges of the precomputed values vector.

Definition at line 192 of file hyperbolic_module.template.h.

References ryujin::precomputed, and ryujin::state.

◆ fill_precomputed_values()

template<typename HyperbolicDescription , int dim, typename Number >
void ryujin::HyperbolicModule< HyperbolicDescription, dim, Number >::fill_precomputed_values ( StateVector< Number > &  state_vector) const
overridevirtual

Populate the precomputed values of the state vector state_vector from its hyperbolic state and update the ghost values. In contrast to prepare_state_vector() no boundary conditions are applied and constrained degrees of freedom are not skipped.

Note
This function operates on the selected memory space.

Implements ryujin::Interface::HyperbolicModule< dim, Number >.

Definition at line 232 of file hyperbolic_module.template.h.

References ryujin::StateVector< Number >::precomputed, ryujin::precomputed, and ryujin::state.

◆ forward_euler_step()

template<typename HyperbolicDescription , int dim, typename Number >
Number ryujin::HyperbolicModule< HyperbolicDescription, dim, Number >::forward_euler_step ( const StateVector< Number > &  old_state_vector,
StageVectors  stage_state_vectors,
StageWeights  stage_weights,
StateVector< Number > &  new_state_vector,
Number  t,
Number  tau,
Number  tau_max = std::numeric_limits<Number>::max() 
) const
overridevirtual

Given a reference to a previous state vector old_state_vector at time t perform an explicit euler step (and store the result in new_state_vector). The function returns the time step size tau with which the update was performed.

If tau is nonzero the step is performed with tau. If tau is 0 the step is performed with the minimum of tau_max and the computed maximal time step size according to the CFL condition.

The function takes an optional list of states stage_state_vectors together with a list of weights stage_weights to construct a modified high-order flux. The standard high-order flux reads (cf. [17], Eq. 12):

\begin{align} \newcommand{\bF}{{\boldsymbol F}} \newcommand{\bU}{{\boldsymbol U}} \newcommand\bUni{\bU^n_i} \newcommand\bUnj{\bU^n_j} \newcommand{\polf}{{\mathbb f}} \newcommand\Ii{\mathcal{I}(i)} \newcommand{\bc}{{\boldsymbol c}} \sum_{j\in\Ii} \frac{m_{ij}}{m_{j}} \; \frac{m_{j}}{\tau_n}\big( \tilde\bU_j^{H,n+1} - \bU_j^{n}\big) \;=\; \bF^n_i + \sum_{j\in\Ii}d_{ij}^{H,n}\big(\bUnj-\bUni\big), \qquad\text{with}\quad \bF^n_i\;:=\; \sum_{j\in\Ii}\Big(-(\polf(\bUni)+\polf(\bUnj)) \cdot\bc_{ij}\Big). \end{align}

Instead, the function replaces \(\bF^n_i\) in the right-hand side by the modified high-order flux:

\begin{align} \newcommand{\bF}{{\boldsymbol F}} \newcommand{\bU}{{\boldsymbol U}} \newcommand\bUnis{\bU^{s,n}_i} \newcommand\bUnjs{\bU^{s,n}_j} \newcommand{\polf}{{\mathbb f}} \newcommand\Ii{\mathcal{I}(i)} \newcommand{\bc}{{\boldsymbol c}} \tilde{\bF}^n_i\;:=\; \big(1-\sum_{s=1}^{\text{stages}}\omega_s\big)\bF^n_i \;+\; \sum_{s=1}^{\text{stages}}\omega_s \bF^{s,n}_i \qquad\text{with}\quad \bF^{s,n}_i\;:=\; \sum_{j\in\Ii}\Big(-(\polf(\bUnis)+\polf(\bUnjs)) \cdot\bc_{ij}\Big). \end{align}

where \(\omega_s\) denotes the weights for the given stages \(\bU^{s,n}\). The high-order viscosity term \(d_{ij}^{H,n}(\bU^n_j-\bU^n_i)\) is always evaluated with the old state. Source terms, if present, are combined with the same weights.

Note
The routine only performs an explicit update step on the locally owned dof index range. It neither updates the precomputed block of the state vector, sets boundary conditions (prior) to the update step, nor automatically updates the ghost range of the vector. It is thus necessary to call HyperbolicModule::prepare_state_vector() on old_state_vector prior to calling forward_euler_step().

Implements ryujin::Interface::HyperbolicModule< dim, Number >.

Definition at line 410 of file hyperbolic_module.template.h.

◆ print_solver_statistics()

template<typename HyperbolicDescription , int dim, typename Number = double>
void ryujin::HyperbolicModule< HyperbolicDescription, dim, Number >::print_solver_statistics ( std::ostream &  ) const
inlineoverride

Print a status line with solver statistics. The explicit update has no solver statistics to report.

Definition at line 218 of file hyperbolic_module.h.

Member Data Documentation

◆ problem_dimension

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

Definition at line 63 of file hyperbolic_module.h.

◆ n_precomputed_values

template<typename HyperbolicDescription , int dim, typename Number = double>
constexpr auto ryujin::HyperbolicModule< HyperbolicDescription, dim, Number >::n_precomputed_values = View::n_precomputed_values
staticconstexpr

Definition at line 67 of file hyperbolic_module.h.

◆ n_initial_precomputed_values

template<typename HyperbolicDescription , int dim, typename Number = double>
constexpr auto ryujin::HyperbolicModule< HyperbolicDescription, dim, Number >::n_initial_precomputed_values
staticconstexpr
Initial value:
=
View::n_initial_precomputed_values

Definition at line 71 of file hyperbolic_module.h.


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