ryujin 2.1.1 revision ee5cbcbf2346c1299c942d0e1f13b46449973c18
Loading...
Searching...
No Matches
List of all members
ryujin::Euler::WaveSpeedEstimatorView< dim, Number, MemorySpace > Class Template Reference

#include <source/euler/wave_speed_estimator.h>

Public Member Functions

Compute wavespeed estimates
 WaveSpeedEstimatorView (const View &view, const WaveSpeedEstimator< ScalarNumber > &wave_speed_estimator)
 
DEAL_II_HOST_DEVICE_ALWAYS_INLINE ScalarNumber newton_tolerance () const
 
DEAL_II_HOST_DEVICE_ALWAYS_INLINE unsigned int newton_max_iterations () const
 
DEAL_II_HOST_DEVICE Number compute (const primitive_type &riemann_data_i, const primitive_type &riemann_data_j) const
 
DEAL_II_HOST_DEVICE Number compute (const PrecomputedVectorView &pv, const state_type &U_i, const state_type &U_j, const unsigned int i, const unsigned int *js, const dealii::Tensor< 1, dim, Number > &n_ij) const
 

Protected Member Functions

Internal methods
DEAL_II_HOST_DEVICE Number f (const primitive_type &riemann_data, const Number p_star) const
 
DEAL_II_HOST_DEVICE Number df (const primitive_type &riemann_data, const Number &p_star) const
 
DEAL_II_HOST_DEVICE Number phi (const primitive_type &riemann_data_i, const primitive_type &riemann_data_j, const Number p_in) const
 
DEAL_II_HOST_DEVICE Number dphi (const primitive_type &riemann_data_i, const primitive_type &riemann_data_j, const Number &p) const
 
DEAL_II_HOST_DEVICE Number phi_of_p_max (const primitive_type &riemann_data_i, const primitive_type &riemann_data_j) const
 
DEAL_II_HOST_DEVICE Number lambda1_minus (const primitive_type &riemann_data, const Number p_star) const
 
DEAL_II_HOST_DEVICE Number lambda3_plus (const primitive_type &primitive_state, const Number p_star) const
 
DEAL_II_HOST_DEVICE std::array< Number, 2 > compute_gap (const primitive_type &riemann_data_i, const primitive_type &riemann_data_j, const Number p_1, const Number p_2) const
 
DEAL_II_HOST_DEVICE Number compute_lambda (const primitive_type &riemann_data_i, const primitive_type &riemann_data_j, const Number p_star) const
 
DEAL_II_HOST_DEVICE Number p_star_two_rarefaction (const primitive_type &riemann_data_i, const primitive_type &riemann_data_j) const
 
DEAL_II_HOST_DEVICE Number p_star_failsafe (const primitive_type &riemann_data_i, const primitive_type &riemann_data_j) const
 
DEAL_II_HOST_DEVICE primitive_type riemann_data_from_state (const state_type &U, const dealii::Tensor< 1, dim, Number > &n_ij) const
 

Typedefs and constexpr constants

using View = HyperbolicSystemView< dim, Number, MemorySpace >
 
using ScalarNumber = typename View::ScalarNumber
 
using state_type = typename View::state_type
 
using primitive_type = std::array< Number, riemann_data_size >
 
using precomputed_type = typename View::precomputed_type
 
using PrecomputedVectorView = typename View::PrecomputedVectorView
 
static constexpr auto problem_dimension = View::problem_dimension
 
static constexpr unsigned int riemann_data_size = 4
 

Detailed Description

template<int dim, typename Number, typename MemorySpace>
class ryujin::Euler::WaveSpeedEstimatorView< dim, Number, MemorySpace >

A view of the WaveSpeedEstimator that makes the interface available for a given dimension dim and choice of number type Number (which can be a scalar float, or double, as well as a VectorizedArray holding packed scalars).

Definition at line 168 of file wave_speed_estimator.h.

Member Typedef Documentation

◆ View

template<int dim, typename Number , typename MemorySpace >
using ryujin::Euler::WaveSpeedEstimatorView< dim, Number, MemorySpace >::View = HyperbolicSystemView<dim, Number, MemorySpace>

Definition at line 181 of file wave_speed_estimator.h.

◆ ScalarNumber

template<int dim, typename Number , typename MemorySpace >
using ryujin::Euler::WaveSpeedEstimatorView< dim, Number, MemorySpace >::ScalarNumber = typename View::ScalarNumber

Definition at line 183 of file wave_speed_estimator.h.

◆ state_type

template<int dim, typename Number , typename MemorySpace >
using ryujin::Euler::WaveSpeedEstimatorView< dim, Number, MemorySpace >::state_type = typename View::state_type

Definition at line 187 of file wave_speed_estimator.h.

◆ primitive_type

template<int dim, typename Number , typename MemorySpace >
using ryujin::Euler::WaveSpeedEstimatorView< dim, Number, MemorySpace >::primitive_type = std::array<Number, riemann_data_size>

The array type to store the expanded primitive state for the Riemann solver \([\rho, v, p, a]\)

Definition at line 199 of file wave_speed_estimator.h.

◆ precomputed_type

template<int dim, typename Number , typename MemorySpace >
using ryujin::Euler::WaveSpeedEstimatorView< dim, Number, MemorySpace >::precomputed_type = typename View::precomputed_type

Definition at line 201 of file wave_speed_estimator.h.

◆ PrecomputedVectorView

template<int dim, typename Number , typename MemorySpace >
using ryujin::Euler::WaveSpeedEstimatorView< dim, Number, MemorySpace >::PrecomputedVectorView = typename View::PrecomputedVectorView

Definition at line 203 of file wave_speed_estimator.h.

Constructor & Destructor Documentation

◆ WaveSpeedEstimatorView()

template<int dim, typename Number , typename MemorySpace >
ryujin::Euler::WaveSpeedEstimatorView< dim, Number, MemorySpace >::WaveSpeedEstimatorView ( const View view,
const WaveSpeedEstimator< ScalarNumber > &  wave_speed_estimator 
)
inline

Constructor taking a HyperbolicSystemView and a WaveSpeedEstimator object as arguments

Definition at line 215 of file wave_speed_estimator.h.

Member Function Documentation

◆ newton_tolerance()

template<int dim, typename Number , typename MemorySpace >
DEAL_II_HOST_DEVICE_ALWAYS_INLINE ScalarNumber ryujin::Euler::WaveSpeedEstimatorView< dim, Number, MemorySpace >::newton_tolerance ( ) const
inline

Return the tolerance for the quadratic Newton stopping criterion.

Definition at line 227 of file wave_speed_estimator.h.

◆ newton_max_iterations()

template<int dim, typename Number , typename MemorySpace >
DEAL_II_HOST_DEVICE_ALWAYS_INLINE unsigned int ryujin::Euler::WaveSpeedEstimatorView< dim, Number, MemorySpace >::newton_max_iterations ( ) const
inline

Return the maximal number of quadratic Newton iterations.

Definition at line 236 of file wave_speed_estimator.h.

◆ compute() [1/2]

template<int dim, typename Number , typename MemorySpace >
DEAL_II_HOST_DEVICE Number ryujin::Euler::WaveSpeedEstimatorView< dim, Number, MemorySpace >::compute ( const primitive_type riemann_data_i,
const primitive_type riemann_data_j 
) const

For two given 1D primitive states riemann_data_i and riemann_data_j, compute an estimation of an upper bound for the maximum wavespeed lambda.

Definition at line 439 of file wave_speed_estimator.h.

References ryujin::compare_and_apply_mask(), and ryujin::quadratic_newton_step().

◆ compute() [2/2]

template<int dim, typename Number , typename MemorySpace >
DEAL_II_HOST_DEVICE_ALWAYS_INLINE Number ryujin::Euler::WaveSpeedEstimatorView< dim, Number, MemorySpace >::compute ( const PrecomputedVectorView pv,
const state_type U_i,
const state_type U_j,
const unsigned int  i,
const unsigned int *  js,
const dealii::Tensor< 1, dim, Number > &  n_ij 
) const

For two given states U_i a U_j and a (normalized) "direction" n_ij compute an estimation of an upper bound for lambda.

Returns a tuple consisting of lambda max and the number of Newton iterations used in the solver to find it.

Definition at line 619 of file wave_speed_estimator.h.

◆ f()

template<int dim, typename Number , typename MemorySpace >
DEAL_II_ALWAYS_INLINE Number ryujin::EulerAEOS::WaveSpeedEstimatorView< dim, Number >::f ( const primitive_type riemann_data,
const Number  p_star 
) const
inlineprotected

See [5], page 912, (3.4).

Cost: 1x pow, 1x division, 2x sqrt

Definition at line 636 of file wave_speed_estimator.h.

References ryujin::compare_and_apply_mask(), and ryujin::pow().

◆ df()

template<int dim, typename Number , typename MemorySpace >
DEAL_II_HOST_DEVICE_ALWAYS_INLINE Number ryujin::Euler::WaveSpeedEstimatorView< dim, Number, MemorySpace >::df ( const primitive_type riemann_data,
const Number &  p_star 
) const
protected

See [5], page 912, (3.4).

Cost: 1x pow, 3x division, 1x sqrt

Definition at line 663 of file wave_speed_estimator.h.

References ryujin::compare_and_apply_mask(), and ryujin::pow().

◆ phi()

template<int dim, typename Number , typename MemorySpace >
DEAL_II_ALWAYS_INLINE Number ryujin::EulerAEOS::WaveSpeedEstimatorView< dim, Number >::phi ( const primitive_type riemann_data_i,
const primitive_type riemann_data_j,
const Number  p_in 
) const
inlineprotected

See [5], page 912, (3.3).

Cost: 2x pow, 6x division, 2x sqrt

Definition at line 699 of file wave_speed_estimator.h.

◆ dphi()

template<int dim, typename Number , typename MemorySpace >
DEAL_II_HOST_DEVICE_ALWAYS_INLINE Number ryujin::Euler::WaveSpeedEstimatorView< dim, Number, MemorySpace >::dphi ( const primitive_type riemann_data_i,
const primitive_type riemann_data_j,
const Number &  p 
) const
protected

See [5], page 912, (3.3).

Cost: 2x pow, 6x division, 2x sqrt

Definition at line 713 of file wave_speed_estimator.h.

◆ phi_of_p_max()

template<int dim, typename Number , typename MemorySpace >
DEAL_II_HOST_DEVICE_ALWAYS_INLINE Number ryujin::Euler::WaveSpeedEstimatorView< dim, Number, MemorySpace >::phi_of_p_max ( const primitive_type riemann_data_i,
const primitive_type riemann_data_j 
) const
protected

See [5], page 912, (3.3).

The approximate Riemann solver is based on a function phi(p) that is montone increasing in p, concave down and whose (weak) third derivative is non-negative and locally bounded [1, p. 912]. Because we actually do not perform any iteration for computing our wavespeed estimate we can get away by only implementing a specialized variant of the phi function that computes phi(p_max). It inlines the implementation of the "f" function and eliminates all unnecessary branches in "f".

Cost: 0x pow, 2x division, 2x sqrt

Definition at line 736 of file wave_speed_estimator.h.

◆ lambda1_minus()

template<int dim, typename Number , typename MemorySpace >
DEAL_II_HOST_DEVICE_ALWAYS_INLINE Number ryujin::Euler::WaveSpeedEstimatorView< dim, Number, MemorySpace >::lambda1_minus ( const primitive_type riemann_data,
const Number  p_star 
) const
protected

see [5], page 912, (3.7)

Cost: 0x pow, 1x division, 1x sqrt

Definition at line 777 of file wave_speed_estimator.h.

References ryujin::positive_part().

◆ lambda3_plus()

template<int dim, typename Number , typename MemorySpace >
DEAL_II_HOST_DEVICE_ALWAYS_INLINE Number ryujin::Euler::WaveSpeedEstimatorView< dim, Number, MemorySpace >::lambda3_plus ( const primitive_type primitive_state,
const Number  p_star 
) const
protected

see [5], page 912, (3.8)

Cost: 0x pow, 1x division, 1x sqrt

Definition at line 801 of file wave_speed_estimator.h.

References ryujin::positive_part().

◆ compute_gap()

template<int dim, typename Number , typename MemorySpace >
DEAL_II_HOST_DEVICE_ALWAYS_INLINE std::array< Number, 2 > ryujin::Euler::WaveSpeedEstimatorView< dim, Number, MemorySpace >::compute_gap ( const primitive_type riemann_data_i,
const primitive_type riemann_data_j,
const Number  p_1,
const Number  p_2 
) const
protected

For two given primitive states riemann_data_i and riemann_data_j, and two guesses p_1 <= p* <= p_2, compute the gap in lambda between both guesses.

See [5], page 914, (4.4a), (4.4b), (4.5), and (4.6)

Cost: 0x pow, 4x division, 4x sqrt

For two given primitive states riemann_data_i and riemann_data_j, and two guesses p_1 <= p* <= p_2, compute the gap in lambda between both guesses.

See [1], page 914, (4.4a), (4.4b), (4.5), and (4.6)

Cost: 0x pow, 4x division, 4x sqrt

Definition at line 828 of file wave_speed_estimator.h.

References ryujin::negative_part(), and ryujin::positive_part().

◆ compute_lambda()

template<int dim, typename Number , typename MemorySpace >
DEAL_II_HOST_DEVICE_ALWAYS_INLINE Number ryujin::Euler::WaveSpeedEstimatorView< dim, Number, MemorySpace >::compute_lambda ( const primitive_type riemann_data_i,
const primitive_type riemann_data_j,
const Number  p_star 
) const
protected

see [5], page 912, (3.9)

For two given primitive states riemann_data_i and riemann_data_j, and a guess p_2, compute an upper bound for lambda.

Cost: 0x pow, 2x division, 2x sqrt (inclusive)

Definition at line 863 of file wave_speed_estimator.h.

References ryujin::negative_part(), and ryujin::positive_part().

◆ p_star_two_rarefaction()

template<int dim, typename Number , typename MemorySpace >
DEAL_II_HOST_DEVICE_ALWAYS_INLINE Number ryujin::Euler::WaveSpeedEstimatorView< dim, Number, MemorySpace >::p_star_two_rarefaction ( const primitive_type riemann_data_i,
const primitive_type riemann_data_j 
) const
protected

Two-rarefaction approximation to p_star computed for two primitive states riemann_data_i and riemann_data_j.

See [5], page 914, (4.3)

Cost: 2x pow, 2x division, 0x sqrt

Definition at line 885 of file wave_speed_estimator.h.

References ryujin::positive_part(), and ryujin::pow().

◆ p_star_failsafe()

template<int dim, typename Number , typename MemorySpace >
DEAL_II_HOST_DEVICE_ALWAYS_INLINE Number ryujin::Euler::WaveSpeedEstimatorView< dim, Number, MemorySpace >::p_star_failsafe ( const primitive_type riemann_data_i,
const primitive_type riemann_data_j 
) const
protected

Failsafe approximation to p_star computed for two primitive states riemann_data_i and riemann_data_j.

See [2], (5.11):

Cost: 0x pow, 3x division, 3x sqrt

Definition at line 940 of file wave_speed_estimator.h.

◆ riemann_data_from_state()

template<int dim, typename Number , typename MemorySpace >
DEAL_II_HOST_DEVICE_ALWAYS_INLINE auto ryujin::Euler::WaveSpeedEstimatorView< dim, Number, MemorySpace >::riemann_data_from_state ( const state_type U,
const dealii::Tensor< 1, dim, Number > &  n_ij 
) const
protected

For a given (2+dim dimensional) state vector U, and a (normalized) "direction" n_ij, first compute the corresponding projected state in the corresponding 1D Riemann problem, and then compute and return the Riemann data [rho, u, p, a] (used in the approximative Riemann solver).

Definition at line 986 of file wave_speed_estimator.h.

Member Data Documentation

◆ problem_dimension

template<int dim, typename Number , typename MemorySpace >
constexpr auto ryujin::Euler::WaveSpeedEstimatorView< dim, Number, MemorySpace >::problem_dimension = View::problem_dimension
staticconstexpr

Definition at line 185 of file wave_speed_estimator.h.

◆ riemann_data_size

template<int dim, typename Number , typename MemorySpace >
constexpr unsigned int ryujin::Euler::WaveSpeedEstimatorView< dim, Number, MemorySpace >::riemann_data_size = 4
staticconstexpr

Number of components in a primitive state, we store \([\rho, v, p, a]\), thus, 4.

Definition at line 193 of file wave_speed_estimator.h.


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