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

#include <source/euler/limiter.h>

Public Member Functions

Stencil-based computation of bounds

Intended usage:

for (unsigned int i = n_internal; i < n_owned; ++i) {
// ...
limiter_view.reset(pv, i, U_i, flux_i);
for (unsigned int col_idx = 1; col_idx < row_length; ++col_idx) {
// ...
limiter_view.accumulate(pv, js, U_j, flux_j, scaled_c_ij,
affine_shift);
}
limiter_view.bounds(hd_i);
}
DEAL_II_HOST_DEVICE void reset(const PrecomputedVectorView &pv, const unsigned int i, const state_type &U_i, const flux_contribution_type &flux_i)
Definition limiter.h:473
DEAL_II_HOST_DEVICE void accumulate(const PrecomputedVectorView &pv, const unsigned int *js, const state_type &U_j, const flux_contribution_type &flux_j, const dealii::Tensor< 1, dim, Number > &scaled_c_ij, const state_type &affine_shift)
Definition limiter.h:499
DEAL_II_HOST_DEVICE Bounds bounds(const Number hd_i) const
Definition limiter.h:550
DEAL_II_HOST_DEVICE void reset (const PrecomputedVectorView &pv, const unsigned int i, const state_type &U_i, const flux_contribution_type &flux_i)
 
DEAL_II_HOST_DEVICE void accumulate (const PrecomputedVectorView &pv, const unsigned int *js, const state_type &U_j, const flux_contribution_type &flux_j, const dealii::Tensor< 1, dim, Number > &scaled_c_ij, const state_type &affine_shift)
 
DEAL_II_HOST_DEVICE Bounds bounds (const Number hd_i) const
 
Convex limiter
DEAL_II_HOST_DEVICE std::tuple< Number, bool > limit (const Bounds &bounds, const state_type &U, const state_type &P, const Number t_min=Number(0.), const Number t_max=Number(1.)) const
 

Typedefs and constexpr constants

using View = HyperbolicSystemView< dim, Number, MemorySpace >
 
using ScalarNumber = typename View::ScalarNumber
 
using state_type = typename View::state_type
 
using flux_contribution_type = typename View::flux_contribution_type
 
using precomputed_type = typename View::precomputed_type
 
using PrecomputedVectorView = typename View::PrecomputedVectorView
 
static constexpr auto problem_dimension = View::problem_dimension
 

Computation and manipulation of bounds

using Bounds = std::array< Number, n_bounds >
 
static constexpr unsigned int n_bounds = 3
 
 LimiterView (const View &view, const Limiter< ScalarNumber > &limiter)
 
DEAL_II_HOST_DEVICE_ALWAYS_INLINE unsigned int iterations () const
 
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_ALWAYS_INLINE ScalarNumber relaxation_factor () const
 
DEAL_II_HOST_DEVICE Bounds projection_bounds_from_state (const PrecomputedVectorView &pv, const unsigned int i, const state_type &U_i) const
 
DEAL_II_HOST_DEVICE Bounds combine_bounds (const Bounds &bounds_left, const Bounds &bounds_right) const
 
DEAL_II_HOST_DEVICE Bounds fully_relax_bounds (const Bounds &bounds, const Number &hd) const
 

Detailed Description

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

A view of the Limiter 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 200 of file limiter.h.

Member Typedef Documentation

◆ View

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

Definition at line 213 of file limiter.h.

◆ ScalarNumber

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

Definition at line 215 of file limiter.h.

◆ state_type

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

Definition at line 219 of file limiter.h.

◆ flux_contribution_type

template<int dim, typename Number , typename MemorySpace >
using ryujin::Euler::LimiterView< dim, Number, MemorySpace >::flux_contribution_type = typename View::flux_contribution_type

Definition at line 221 of file limiter.h.

◆ precomputed_type

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

Definition at line 223 of file limiter.h.

◆ PrecomputedVectorView

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

Definition at line 225 of file limiter.h.

◆ Bounds

template<int dim, typename Number , typename MemorySpace >
using ryujin::Euler::LimiterView< dim, Number, MemorySpace >::Bounds = std::array<Number, n_bounds>

Array type used to store accumulated bounds.

Definition at line 240 of file limiter.h.

Constructor & Destructor Documentation

◆ LimiterView()

template<int dim, typename Number , typename MemorySpace >
ryujin::Euler::LimiterView< dim, Number, MemorySpace >::LimiterView ( const View view,
const Limiter< ScalarNumber > &  limiter 
)
inline

Constructor taking a HyperbolicSystemView and a Limiter object as arguments

Definition at line 246 of file limiter.h.

Member Function Documentation

◆ iterations()

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

Return the number of limiter iterations.

Definition at line 255 of file limiter.h.

◆ newton_tolerance()

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

Return the tolerance for the quadratic Newton stopping criterion.

Definition at line 263 of file limiter.h.

◆ newton_max_iterations()

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

Return the maximal number of quadratic Newton iterations.

Definition at line 272 of file limiter.h.

◆ relaxation_factor()

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

Return the factor used for scaling the relaxation window.

Definition at line 280 of file limiter.h.

◆ projection_bounds_from_state()

template<int dim, typename Number , typename MemorySpace >
DEAL_II_HOST_DEVICE_ALWAYS_INLINE auto ryujin::Euler::LimiterView< dim, Number, MemorySpace >::projection_bounds_from_state ( const PrecomputedVectorView pv,
const unsigned int  i,
const state_type U_i 
) const

Given a state U_i and an index i return "strict" bounds, i.e., a minimal convex set containing the state.

Definition at line 418 of file limiter.h.

◆ combine_bounds()

template<int dim, typename Number , typename MemorySpace >
DEAL_II_HOST_DEVICE_ALWAYS_INLINE auto ryujin::Euler::LimiterView< dim, Number, MemorySpace >::combine_bounds ( const Bounds bounds_left,
const Bounds bounds_right 
) const

Given two bounds bounds_left, bounds_right, this function computes a larger, combined set of bounds that this is a (convex) superset of the two.

Definition at line 433 of file limiter.h.

◆ fully_relax_bounds()

template<int dim, typename Number , typename MemorySpace >
DEAL_II_HOST_DEVICE_ALWAYS_INLINE auto ryujin::Euler::LimiterView< dim, Number, MemorySpace >::fully_relax_bounds ( const Bounds bounds,
const Number &  hd 
) const

This function applies a relaxation to a given a (strict) bound bounds using a non dimensionalized measure hd (that should scale as $h^d$, where $h$ is the local mesh size). This is done for the case of the Euler equations by multiplying maximum bounds with $(1+r)$ and minimum bounds with $(1-r)$, while ensuring that the bounds still describe an admissible state.

Definition at line 447 of file limiter.h.

◆ reset()

template<int dim, typename Number , typename MemorySpace >
DEAL_II_HOST_DEVICE_ALWAYS_INLINE void ryujin::Euler::LimiterView< dim, Number, MemorySpace >::reset ( const PrecomputedVectorView pv,
const unsigned int  i,
const state_type U_i,
const flux_contribution_type flux_i 
)

Reset temporary storage

Definition at line 473 of file limiter.h.

◆ accumulate()

template<int dim, typename Number , typename MemorySpace >
DEAL_II_HOST_DEVICE_ALWAYS_INLINE void ryujin::Euler::LimiterView< dim, Number, MemorySpace >::accumulate ( const PrecomputedVectorView pv,
const unsigned int *  js,
const state_type U_j,
const flux_contribution_type flux_j,
const dealii::Tensor< 1, dim, Number > &  scaled_c_ij,
const state_type affine_shift 
)

When looping over the sparsity row, add the contribution associated with the neighboring state U_j.

Definition at line 499 of file limiter.h.

◆ bounds()

template<int dim, typename Number , typename MemorySpace >
DEAL_II_HOST_DEVICE_ALWAYS_INLINE auto ryujin::Euler::LimiterView< dim, Number, MemorySpace >::bounds ( const Number  hd_i) const

Return the computed bounds (with relaxation applied).

Definition at line 550 of file limiter.h.

◆ limit()

template<int dim, typename Number , typename MemorySpace >
DEAL_II_HOST_DEVICE std::tuple< Number, bool > ryujin::Euler::LimiterView< dim, Number, MemorySpace >::limit ( const Bounds bounds,
const state_type U,
const state_type P,
const Number  t_min = Number(0.),
const Number  t_max = Number(1.) 
) const

Given a state \(\mathbf U\) and an update \(\mathbf P\) this function computes and returns the maximal coefficient \(t\), obeying \(t_{\text{min}} < t < t_{\text{max}}\), such that the selected local minimum principles are obeyed.

The returned boolean is set to true if the original low-order update was within bounds.

Note
If the debug option DEBUG_EXPENSIVE_BOUNDS_CHECK is set to true, then the boolean is set to true if the low-order and the resulting high-order update are within bounds. The latter might be violated due to round-off errors when computing the limiter bounds.

Definition at line 580 of file limiter.h.

References ryujin::compare_and_apply_mask(), ryujin::negative_part(), ryujin::positive_part(), ryujin::pow(), and ryujin::quadratic_newton_step().

Member Data Documentation

◆ problem_dimension

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

Definition at line 217 of file limiter.h.

◆ n_bounds

template<int dim, typename Number , typename MemorySpace >
constexpr unsigned int ryujin::Euler::LimiterView< dim, Number, MemorySpace >::n_bounds = 3
staticconstexpr

The number of stored entries in the bounds array.

Definition at line 235 of file limiter.h.


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