ryujin 2.5.0 revision c64172211cf21344cb9b9b0f3a1266aa6400d392
Loading...
Searching...
No Matches
List of all members
ryujin::ScalarConservation::HyperbolicSystemView< dim, Number, MemorySpace > Class Template Reference

#include <include/ryujin/scalar_conservation/hyperbolic_system.h>

Public Member Functions

Constructor and setup
 HyperbolicSystemView (const HyperbolicSystem &hyperbolic_system)
 
Access to runtime parameters
DEAL_II_ALWAYS_INLINE const std::string & flux () const
 
DEAL_II_HOST_DEVICE_ALWAYS_INLINE ScalarNumber derivative_approximation_delta () const
 
Low-level access to the flux function parser
Note
The oracle functions flux_function() and flux_gradient_function() call into the selected flux and are thus only available on the host.
DEAL_II_ALWAYS_INLINE dealii::Tensor< 1, dim, Number > flux_function (const Number &u) const
 
DEAL_II_ALWAYS_INLINE dealii::Tensor< 1, dim, Number > flux_gradient_function (const Number &u) const
 
Special functions for boundary states
template<typename Lambda >
DEAL_II_HOST_DEVICE_ALWAYS_INLINE state_type apply_boundary_conditions (const dealii::types::boundary_id id, const state_type &U, const dealii::Tensor< 1, dim, Number > &normal, const Lambda &get_dirichlet_data) const
 
State transformations
template<typename ST >
DEAL_II_HOST_DEVICE_ALWAYS_INLINE state_type expand_state (const ST &state) const
 
DEAL_II_HOST_DEVICE_ALWAYS_INLINE state_type from_primitive_state (const state_type &primitive_state) const
 
DEAL_II_HOST_DEVICE_ALWAYS_INLINE state_type to_primitive_state (const state_type &state) const
 
template<typename Lambda >
DEAL_II_HOST_DEVICE_ALWAYS_INLINE state_type apply_galilei_transform (const state_type &state, const Lambda &) const
 

Typedefs and constexpr constants

using ScalarNumber = typename get_value_type< Number >::type
 
using state_type = dealii::Tensor< 1, problem_dimension, Number >
 
using flux_type = dealii::Tensor< 1, problem_dimension, dealii::Tensor< 1, dim, Number > >
 
using flux_contribution_type = flux_type
 
using precomputed_type = std::array< Number, n_precomputed_values >
 
using initial_precomputed_type = std::array< Number, n_initial_precomputed_values >
 
template<int n_comp>
using VectorView = MultiComponentVectorView< ScalarNumber, n_comp, MemorySpace, false >
 
using PrecomputedVectorView = VectorView< n_precomputed_values >
 
using InitialPrecomputedVectorView = VectorView< n_initial_precomputed_values >
 
static constexpr unsigned int problem_dimension = 1
 
static constexpr unsigned int n_precomputed_values = 2 * dim
 
static constexpr unsigned int n_initial_precomputed_values = 0
 

Flux computations

static constexpr bool have_high_order_flux = false
 
DEAL_II_HOST_DEVICE dealii::Tensor< 1, dim, Number > construct_flux_tensor (const precomputed_type &precomputed_state) const
 
DEAL_II_HOST_DEVICE dealii::Tensor< 1, dim, Number > construct_flux_gradient_tensor (const precomputed_type &precomputed_state) const
 
DEAL_II_HOST_DEVICE flux_contribution_type flux_contribution (const PrecomputedVectorView &pv, const InitialPrecomputedVectorView &, const unsigned int i, const state_type &) const
 
DEAL_II_HOST_DEVICE flux_contribution_type flux_contribution (const PrecomputedVectorView &pv, const InitialPrecomputedVectorView &, const unsigned int *js, const state_type &) const
 
DEAL_II_HOST_DEVICE state_type flux_divergence (const flux_contribution_type &flux_i, const flux_contribution_type &flux_j, const dealii::Tensor< 1, dim, Number > &c_ij) const
 
state_type high_order_flux_divergence (const flux_contribution_type &, const flux_contribution_type &, const dealii::Tensor< 1, dim, Number > &c_ij) const =delete
 

Computing stencil source terms

static constexpr bool have_source_terms = false
 
state_type nodal_source (const PrecomputedVectorView &pv, const unsigned int i, const state_type &U_i, const ScalarNumber tau) const =delete
 
state_type nodal_source (const PrecomputedVectorView &pv, const unsigned int *js, const state_type &U_j, const ScalarNumber tau) const =delete
 

Computing derived physical quantities

DEAL_II_HOST_DEVICE Number square_entropy (const Number &u) const
 
DEAL_II_HOST_DEVICE Number square_entropy_derivative (const Number &u) const
 
DEAL_II_HOST_DEVICE Number kruzkov_entropy (const Number &k, const Number &u) const
 
DEAL_II_HOST_DEVICE Number kruzkov_entropy_derivative (const Number &k, const Number &u) const
 
DEAL_II_HOST_DEVICE_ALWAYS_INLINE bool is_admissible (const state_type &) const
 
static DEAL_II_HOST_DEVICE Number state (const state_type &U)
 

Detailed Description

template<int dim, typename Number, typename MemorySpace>
class ryujin::ScalarConservation::HyperbolicSystemView< dim, Number, MemorySpace >

A view on the HyperbolicSystem 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.

Note
This class is designed to be copied by value into computation loops with access to either the host or device memory space.

Definition at line 144 of file hyperbolic_system.h.

Member Typedef Documentation

◆ ScalarNumber

template<int dim, typename Number , typename MemorySpace >
using ryujin::ScalarConservation::HyperbolicSystemView< dim, Number, MemorySpace >::ScalarNumber = typename get_value_type<Number>::type

The underlying scalar number type.

Definition at line 160 of file hyperbolic_system.h.

◆ state_type

template<int dim, typename Number , typename MemorySpace >
using ryujin::ScalarConservation::HyperbolicSystemView< dim, Number, MemorySpace >::state_type = dealii::Tensor<1, problem_dimension, Number>

Storage type for a (conserved) state vector \(\boldsymbol U\).

Definition at line 170 of file hyperbolic_system.h.

◆ flux_type

template<int dim, typename Number , typename MemorySpace >
using ryujin::ScalarConservation::HyperbolicSystemView< dim, Number, MemorySpace >::flux_type = dealii::Tensor<1, problem_dimension, dealii::Tensor<1, dim, Number> >

Storage type for the flux \(\mathbf{f}\).

Definition at line 175 of file hyperbolic_system.h.

◆ flux_contribution_type

template<int dim, typename Number , typename MemorySpace >
using ryujin::ScalarConservation::HyperbolicSystemView< dim, Number, MemorySpace >::flux_contribution_type = flux_type

The storage type used for flux contributions.

Definition at line 181 of file hyperbolic_system.h.

◆ precomputed_type

template<int dim, typename Number , typename MemorySpace >
using ryujin::ScalarConservation::HyperbolicSystemView< dim, Number, MemorySpace >::precomputed_type = std::array<Number, n_precomputed_values>

Array type used for precomputed values.

Definition at line 191 of file hyperbolic_system.h.

◆ initial_precomputed_type

template<int dim, typename Number , typename MemorySpace >
using ryujin::ScalarConservation::HyperbolicSystemView< dim, Number, MemorySpace >::initial_precomputed_type = std::array<Number, n_initial_precomputed_values>

Array type used for precomputed initial values.

Definition at line 201 of file hyperbolic_system.h.

◆ VectorView

template<int dim, typename Number , typename MemorySpace >
template<int n_comp>
using ryujin::ScalarConservation::HyperbolicSystemView< dim, Number, MemorySpace >::VectorView = MultiComponentVectorView<ScalarNumber, n_comp, MemorySpace, false>

Definition at line 205 of file hyperbolic_system.h.

◆ PrecomputedVectorView

template<int dim, typename Number , typename MemorySpace >
using ryujin::ScalarConservation::HyperbolicSystemView< dim, Number, MemorySpace >::PrecomputedVectorView = VectorView<n_precomputed_values>

MulticomponentVectorView for accessing a vector of precomputed states:

Definition at line 212 of file hyperbolic_system.h.

◆ InitialPrecomputedVectorView

template<int dim, typename Number , typename MemorySpace >
using ryujin::ScalarConservation::HyperbolicSystemView< dim, Number, MemorySpace >::InitialPrecomputedVectorView = VectorView<n_initial_precomputed_values>

MulticomponentVectorView for accessing a vector of precomputed initial states:

Definition at line 218 of file hyperbolic_system.h.

Constructor & Destructor Documentation

◆ HyperbolicSystemView()

template<int dim, typename Number , typename MemorySpace >
ryujin::ScalarConservation::HyperbolicSystemView< dim, Number, MemorySpace >::HyperbolicSystemView ( const HyperbolicSystem &  hyperbolic_system)
inline

Constructor taking a reference to the underlying HyperbolicSystem

Definition at line 231 of file hyperbolic_system.h.

Member Function Documentation

◆ flux()

template<int dim, typename Number , typename MemorySpace >
DEAL_II_ALWAYS_INLINE const std::string & ryujin::ScalarConservation::HyperbolicSystemView< dim, Number, MemorySpace >::flux ( ) const
inline

Return the name of the selected flux.

Note
This function is only available on the host.

Definition at line 249 of file hyperbolic_system.h.

◆ derivative_approximation_delta()

template<int dim, typename Number , typename MemorySpace >
DEAL_II_HOST_DEVICE_ALWAYS_INLINE ScalarNumber ryujin::ScalarConservation::HyperbolicSystemView< dim, Number, MemorySpace >::derivative_approximation_delta ( ) const
inline

◆ flux_function()

template<int dim, typename Number , typename MemorySpace >
DEAL_II_ALWAYS_INLINE dealii::Tensor< 1, dim, Number > ryujin::ScalarConservation::HyperbolicSystemView< dim, Number, MemorySpace >::flux_function ( const Number &  u) const
inline

For a given state \(u\) compute the flux \(f(u)\).

Definition at line 673 of file hyperbolic_system.h.

◆ flux_gradient_function()

template<int dim, typename Number , typename MemorySpace >
DEAL_II_ALWAYS_INLINE dealii::Tensor< 1, dim, Number > ryujin::ScalarConservation::HyperbolicSystemView< dim, Number, MemorySpace >::flux_gradient_function ( const Number &  u) const
inline

For a given state \(u\) compute the flux gradient \(f'(u)\).

Definition at line 695 of file hyperbolic_system.h.

◆ state()

template<int dim, typename Number , typename MemorySpace >
DEAL_II_HOST_DEVICE_ALWAYS_INLINE Number ryujin::ScalarConservation::HyperbolicSystemView< dim, Number, MemorySpace >::state ( const state_type &  U)
static

Return the scalar value stored in the state "vector". Given the fact that a scalar conservation equation is indeed scalar this simply unwraps the Tensor from the state_type and returns the one and only entry.

Definition at line 718 of file hyperbolic_system.h.

◆ square_entropy()

template<int dim, typename Number , typename MemorySpace >
DEAL_II_HOST_DEVICE_ALWAYS_INLINE Number ryujin::ScalarConservation::HyperbolicSystemView< dim, Number, MemorySpace >::square_entropy ( const Number &  u) const

For a given state U, compute the square entropy

\[ \eta = 1/2 u^2. \]

Definition at line 726 of file hyperbolic_system.h.

◆ square_entropy_derivative()

template<int dim, typename Number , typename MemorySpace >
DEAL_II_HOST_DEVICE_ALWAYS_INLINE Number ryujin::ScalarConservation::HyperbolicSystemView< dim, Number, MemorySpace >::square_entropy_derivative ( const Number &  u) const

For a given state U, compute the derivative of the square entropy

\[ \eta' = u. \]

Definition at line 735 of file hyperbolic_system.h.

◆ kruzkov_entropy()

template<int dim, typename Number , typename MemorySpace >
DEAL_II_HOST_DEVICE_ALWAYS_INLINE Number ryujin::ScalarConservation::HyperbolicSystemView< dim, Number, MemorySpace >::kruzkov_entropy ( const Number &  k,
const Number &  u 
) const

For a given state U, compute the Krŭzkov entropy

\[ \eta = |u-k|. \]

Definition at line 744 of file hyperbolic_system.h.

◆ kruzkov_entropy_derivative()

template<int dim, typename Number , typename MemorySpace >
DEAL_II_HOST_DEVICE_ALWAYS_INLINE Number ryujin::ScalarConservation::HyperbolicSystemView< dim, Number, MemorySpace >::kruzkov_entropy_derivative ( const Number &  k,
const Number &  u 
) const

For a given state U, compute the derivative of the Krŭzkov entropy:

\[ \eta' = \text{sgn}(u-k). \]

Definition at line 753 of file hyperbolic_system.h.

◆ is_admissible()

template<int dim, typename Number , typename MemorySpace >
DEAL_II_HOST_DEVICE_ALWAYS_INLINE bool ryujin::ScalarConservation::HyperbolicSystemView< dim, Number, MemorySpace >::is_admissible ( const state_type &  ) const
inline

Returns whether the state U is admissible. If U is a vectorized state then U is admissible if all vectorized values are admissible.

Definition at line 339 of file hyperbolic_system.h.

◆ apply_boundary_conditions()

template<int dim, typename Number , typename MemorySpace >
template<typename Lambda >
DEAL_II_HOST_DEVICE_ALWAYS_INLINE state_type ryujin::ScalarConservation::HyperbolicSystemView< dim, Number, MemorySpace >::apply_boundary_conditions ( const dealii::types::boundary_id  id,
const state_type &  U,
const dealii::Tensor< 1, dim, Number > &  normal,
const Lambda &  get_dirichlet_data 
) const

Apply boundary conditions.

◆ construct_flux_tensor()

template<int dim, typename Number , typename MemorySpace >
DEAL_II_HOST_DEVICE_ALWAYS_INLINE dealii::Tensor< 1, dim, Number > ryujin::ScalarConservation::HyperbolicSystemView< dim, Number, MemorySpace >::construct_flux_tensor ( const precomputed_type &  precomputed_state) const

Helper function that given a precomputed_state constructs a dealii::Tensor with the flux \(f(u)\).

Definition at line 822 of file hyperbolic_system.h.

References ryujin::precomputed.

◆ construct_flux_gradient_tensor()

template<int dim, typename Number , typename MemorySpace >
DEAL_II_HOST_DEVICE_ALWAYS_INLINE dealii::Tensor< 1, dim, Number > ryujin::ScalarConservation::HyperbolicSystemView< dim, Number, MemorySpace >::construct_flux_gradient_tensor ( const precomputed_type &  precomputed_state) const

Helper function that given a precomputed_state constructs a dealii::Tensor with the gradient of the flux \(f(u)\) with respect to the state \(u\).

Definition at line 834 of file hyperbolic_system.h.

References ryujin::precomputed.

◆ flux_contribution() [1/2]

template<int dim, typename Number , typename MemorySpace >
DEAL_II_HOST_DEVICE_ALWAYS_INLINE auto ryujin::ScalarConservation::HyperbolicSystemView< dim, Number, MemorySpace >::flux_contribution ( const PrecomputedVectorView &  pv,
const InitialPrecomputedVectorView &  ,
const unsigned int  i,
const state_type &   
) const

Given a state U_i and an index i compute flux contributions.

Intended usage:

for (unsigned int i = n_internal; i < n_owned; ++i) {
// ...
const auto flux_i = flux_contribution(precomputed..., i, U_i);
for (unsigned int col_idx = 1; col_idx < row_length; ++col_idx) {
// ...
const auto flux_j = flux_contribution(precomputed..., js, U_j);
const auto flux_ij = flux_divergence(flux_i, flux_j, c_ij);
}
}
DEAL_II_HOST_DEVICE flux_contribution_type flux_contribution(const PrecomputedVectorView &pv, const InitialPrecomputedVectorView &, const unsigned int i, const state_type &) const
DEAL_II_HOST_DEVICE state_type flux_divergence(const flux_contribution_type &flux_i, const flux_contribution_type &flux_j, const dealii::Tensor< 1, dim, Number > &c_ij) const

For the Euler equations we simply compute f(U_i).

Definition at line 847 of file hyperbolic_system.h.

◆ flux_contribution() [2/2]

template<int dim, typename Number , typename MemorySpace >
DEAL_II_HOST_DEVICE_ALWAYS_INLINE auto ryujin::ScalarConservation::HyperbolicSystemView< dim, Number, MemorySpace >::flux_contribution ( const PrecomputedVectorView &  pv,
const InitialPrecomputedVectorView &  ,
const unsigned int *  js,
const state_type &   
) const

Definition at line 863 of file hyperbolic_system.h.

◆ flux_divergence()

template<int dim, typename Number , typename MemorySpace >
DEAL_II_HOST_DEVICE_ALWAYS_INLINE auto ryujin::ScalarConservation::HyperbolicSystemView< dim, Number, MemorySpace >::flux_divergence ( const flux_contribution_type &  flux_i,
const flux_contribution_type &  flux_j,
const dealii::Tensor< 1, dim, Number > &  c_ij 
) const

Given flux contributions flux_i and flux_j compute the flux (-f(U_i) - f(U_j)

Definition at line 879 of file hyperbolic_system.h.

References ryujin::add(), and ryujin::contract().

◆ high_order_flux_divergence()

template<int dim, typename Number , typename MemorySpace >
state_type ryujin::ScalarConservation::HyperbolicSystemView< dim, Number, MemorySpace >::high_order_flux_divergence ( const flux_contribution_type &  ,
const flux_contribution_type &  ,
const dealii::Tensor< 1, dim, Number > &  c_ij 
) const
delete

◆ nodal_source() [1/2]

template<int dim, typename Number , typename MemorySpace >
state_type ryujin::ScalarConservation::HyperbolicSystemView< dim, Number, MemorySpace >::nodal_source ( const PrecomputedVectorView &  pv,
const unsigned int  i,
const state_type &  U_i,
const ScalarNumber  tau 
) const
delete

◆ nodal_source() [2/2]

template<int dim, typename Number , typename MemorySpace >
state_type ryujin::ScalarConservation::HyperbolicSystemView< dim, Number, MemorySpace >::nodal_source ( const PrecomputedVectorView &  pv,
const unsigned int *  js,
const state_type &  U_j,
const ScalarNumber  tau 
) const
delete

◆ expand_state()

template<int dim, typename Number , typename MemorySpace >
template<typename ST >
DEAL_II_HOST_DEVICE_ALWAYS_INLINE state_type ryujin::ScalarConservation::HyperbolicSystemView< dim, Number, MemorySpace >::expand_state ( const ST &  state) const
inline

Given a state vector associated with a different spatial dimensions than the current one, return an "expanded" version of the state vector associated with dim spatial dimensions where the momentum vector of the conserved state state is expaned with zeros to a total length of dim entries.

Note
dim has to be larger or equal than the dimension of the ST vector.

Definition at line 470 of file hyperbolic_system.h.

References ryujin::state.

◆ from_primitive_state()

template<int dim, typename Number , typename MemorySpace >
DEAL_II_HOST_DEVICE_ALWAYS_INLINE state_type ryujin::ScalarConservation::HyperbolicSystemView< dim, Number, MemorySpace >::from_primitive_state ( const state_type &  primitive_state) const
inline

Given a primitive state [rho, u_1, ..., u_d, p] return a conserved state

Definition at line 480 of file hyperbolic_system.h.

◆ to_primitive_state()

template<int dim, typename Number , typename MemorySpace >
DEAL_II_HOST_DEVICE_ALWAYS_INLINE state_type ryujin::ScalarConservation::HyperbolicSystemView< dim, Number, MemorySpace >::to_primitive_state ( const state_type &  state) const
inline

Given a conserved state return a primitive state [rho, u_1, ..., u_d, p]

Definition at line 490 of file hyperbolic_system.h.

References ryujin::state.

◆ apply_galilei_transform()

template<int dim, typename Number , typename MemorySpace >
template<typename Lambda >
DEAL_II_HOST_DEVICE_ALWAYS_INLINE state_type ryujin::ScalarConservation::HyperbolicSystemView< dim, Number, MemorySpace >::apply_galilei_transform ( const state_type &  state,
const Lambda &   
) const
inline

Transform the current state according to a given operator lambda acting on a dim dimensional momentum (or velocity) vector.

Definition at line 501 of file hyperbolic_system.h.

References ryujin::state.

Member Data Documentation

◆ problem_dimension

template<int dim, typename Number , typename MemorySpace >
constexpr unsigned int ryujin::ScalarConservation::HyperbolicSystemView< dim, Number, MemorySpace >::problem_dimension = 1
staticconstexpr

The dimension of the state space.

Definition at line 165 of file hyperbolic_system.h.

◆ n_precomputed_values

template<int dim, typename Number , typename MemorySpace >
constexpr unsigned int ryujin::ScalarConservation::HyperbolicSystemView< dim, Number, MemorySpace >::n_precomputed_values = 2 * dim
staticconstexpr

The number of precomputed values.

Definition at line 186 of file hyperbolic_system.h.

Referenced by ryujin::ScalarConservation::HyperbolicSystem::fill_precomputed_values().

◆ n_initial_precomputed_values

template<int dim, typename Number , typename MemorySpace >
constexpr unsigned int ryujin::ScalarConservation::HyperbolicSystemView< dim, Number, MemorySpace >::n_initial_precomputed_values = 0
staticconstexpr

The number of precomputed initial values.

Definition at line 196 of file hyperbolic_system.h.

◆ have_high_order_flux

template<int dim, typename Number , typename MemorySpace >
constexpr bool ryujin::ScalarConservation::HyperbolicSystemView< dim, Number, MemorySpace >::have_high_order_flux = false
staticconstexpr

The low-order and high-order fluxes are the same

Definition at line 426 of file hyperbolic_system.h.

◆ have_source_terms

template<int dim, typename Number , typename MemorySpace >
constexpr bool ryujin::ScalarConservation::HyperbolicSystemView< dim, Number, MemorySpace >::have_source_terms = false
staticconstexpr

We do not have source terms

Definition at line 440 of file hyperbolic_system.h.


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