Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
Classes | Typedefs | Functions
shammath Namespace Reference

namespace for math utility More...

Classes

struct  AABB
 Axis-Aligned bounding box. More...
 
struct  ConsState
 
struct  CoordRange
 
class  CoordRangeTransform
 
class  DiscontinuousIterator
 Discontinuous Iterator will iterate over every values in an integer set in the most discontinuous way possible. More...
 
struct  DustConsState
 
struct  DustFluxes
 
struct  DustPrimState
 
struct  Fluxes
 
struct  has_phi_tilde_3d
 
struct  has_phi_tilde_3d< T, Tscal, std::void_t< decltype(T::phi_tilde_3d(std::declval< Tscal >()))> >
 
struct  has_phi_tilde_3d_prime
 
struct  has_phi_tilde_3d_prime< T, Tscal, std::void_t< decltype(T::phi_tilde_3d_prime(std::declval< Tscal >()))> >
 
class  LatticeCubic
 utility for generating Cubic crystal lattices More...
 
class  LatticeError
 
class  LatticeHCP
 utility for generating HCP crystal lattices More...
 
class  mat
 Matrix class based on std::array storage and mdspan. More...
 
struct  paving_function_general_3d
 A structure for 3D paving functions with general boundary conditions (periodic or reflective per directions). More...
 
struct  paving_function_general_3d_shear_x
 A structure for 3D paving functions with shearing along the x-axis and general boundary conditions. More...
 
struct  paving_function_periodic_3d
 A structure for 3D paving functions with periodic boundary conditions. More...
 
struct  PrimState
 
struct  Ray
 Ray representation for intersection testing. More...
 
struct  RingRay
 Ring ray representation for intersection testing. More...
 
class  SPHKernelGen
 
struct  SymTensor3d_1
 
struct  SymTensor3d_2
 
struct  SymTensor3d_3
 
struct  SymTensor3d_4
 
struct  SymTensor3d_5
 
struct  SymTensorCollection
 
struct  SymTensorCollection< T, 0, 0 >
 
struct  SymTensorCollection< T, 0, 1 >
 
struct  SymTensorCollection< T, 0, 2 >
 
struct  SymTensorCollection< T, 0, 3 >
 
struct  SymTensorCollection< T, 0, 4 >
 
struct  SymTensorCollection< T, 0, 5 >
 
struct  SymTensorCollection< T, 1, 1 >
 
struct  SymTensorCollection< T, 1, 2 >
 
struct  SymTensorCollection< T, 1, 3 >
 
struct  SymTensorCollection< T, 1, 4 >
 
struct  SymTensorCollection< T, 1, 5 >
 
class  vec
 Vector class based on std::array storage and mdspan. More...
 

Typedefs

template<class flt_type >
using M4 = SPHKernelGen< flt_type, details::KernelDefM4< flt_type > >
 The M4 SPH kernel.
 
template<class flt_type >
using M5 = SPHKernelGen< flt_type, details::KernelDefM5< flt_type > >
 The M5 SPH kernel.
 
template<class flt_type >
using M6 = SPHKernelGen< flt_type, details::KernelDefM6< flt_type > >
 The M6 SPH kernel.
 
template<class flt_type >
using M7 = SPHKernelGen< flt_type, details::KernelDefM7< flt_type > >
 The M7 SPH kernel.
 
template<class flt_type >
using M8 = SPHKernelGen< flt_type, details::KernelDefM8< flt_type > >
 The M8 SPH kernel.
 
template<class flt_type >
using M9 = SPHKernelGen< flt_type, details::KernelDefM9< flt_type > >
 The M8 SPH kernel.
 
template<class flt_type >
using M10 = SPHKernelGen< flt_type, details::KernelDefM10< flt_type > >
 The M8 SPH kernel.
 
template<class flt_type >
using C2 = SPHKernelGen< flt_type, details::KernelDefC2< flt_type > >
 The C2 SPH kernel.
 
template<class flt_type >
using C4 = SPHKernelGen< flt_type, details::KernelDefC4< flt_type > >
 The C4 SPH kernel.
 
template<class flt_type >
using C6 = SPHKernelGen< flt_type, details::KernelDefC6< flt_type > >
 The C6 SPH kernel.
 
template<class flt_type >
using TGauss3 = SPHKernelGen< flt_type, details::KernelDefTGauss3< flt_type > >
 Truncated Gaussian kernel with compact support R=3h.
 
template<class flt_type >
using TGauss5 = SPHKernelGen< flt_type, details::KernelDefTGauss5< flt_type > >
 Truncated Gaussian kernel with compact support R=5h.
 
template<class flt_type >
using M4DH = SPHKernelGen< flt_type, details::KernelDefM4DoubleHump< flt_type > >
 The M4DoubleHump SPH kernel.
 
template<class flt_type >
using M4DH3 = SPHKernelGen< flt_type, details::KernelDefM4DoubleHump3< flt_type > >
 The M4DoubleHump3 SPH kernel.
 
template<class flt_type >
using M4DH5 = SPHKernelGen< flt_type, details::KernelDefM4DoubleHump5< flt_type > >
 The M4DoubleHump5 SPH kernel.
 
template<class flt_type >
using M4DH7 = SPHKernelGen< flt_type, details::KernelDefM4DoubleHump7< flt_type > >
 The M4DoubleHump7 SPH kernel.
 
template<class flt_type >
using M4Shift2 = SPHKernelGen< flt_type, details::KernelDefM4Shift2< flt_type > >
 The M4Shift2 SPH kernel.
 
template<class flt_type >
using M4Shift4 = SPHKernelGen< flt_type, details::KernelDefM4Shift4< flt_type > >
 The M4Shift4 SPH kernel.
 
template<class flt_type >
using M4Shift8 = SPHKernelGen< flt_type, details::KernelDefM4Shift8< flt_type > >
 The M4Shift8 SPH kernel.
 
template<class flt_type >
using M4Shift16 = SPHKernelGen< flt_type, details::KernelDefM4Shift16< flt_type > >
 The M4Shift16 SPH kernel.
 

Functions

template<class T >
derivative_upwind (T x, T dx, std::function< T(T)> &&fct)
 Compute the derivative of a function at x using the upwind method.
 
template<class T >
derivative_centered (T x, T dx, std::function< T(T)> &&fct)
 Compute the derivative of a function at x using the centered difference method.
 
template<class T >
derivative_3point_forward (T x, T dx, std::function< T(T)> &&fct)
 Compute the derivative of a function at x using a 3-point forward finite difference.
 
template<class T >
derivative_3point_backward (T x, T dx, std::function< T(T)> &&fct)
 Compute the derivative of a function at x using a 3-point backward finite difference.
 
template<class T >
derivative_5point_midpoint (T x, T dx, std::function< T(T)> &&fct)
 Compute the derivative of a function at x using a 5-point centered finite difference.
 
template<class T >
estim_deriv_step (u32 order)
 Estimate the best step size for numerical differentiation of given order.
 
template<class T , class Lambda >
constexpr T integ_riemann_sum (T start, T end, T step, Lambda &&fct)
 
template<class T , std::enable_if_t< sham::is_valid_sycl_base_type< T >, int > = 0>
bool is_in_half_open (T val, T min, T max)
 return true if val is in [min,max[
 
template<class T >
bool is_in_half_open (sycl::vec< T, 2 > val, sycl::vec< T, 2 > min, sycl::vec< T, 2 > max)
 Check if value is in [min,max) for 2D vectors.
 
template<class T >
bool is_in_half_open (sycl::vec< T, 3 > val, sycl::vec< T, 3 > min, sycl::vec< T, 3 > max)
 Check if value is in [min,max) for 3D vectors.
 
template<class T >
bool is_in_half_open (sycl::vec< T, 4 > val, sycl::vec< T, 4 > min, sycl::vec< T, 4 > max)
 Check if value is in [min,max) for 4D vectors.
 
template<class T >
bool is_in_half_open (sycl::vec< T, 8 > val, sycl::vec< T, 8 > min, sycl::vec< T, 8 > max)
 Check if value is in [min,max) for 8D vectors.
 
template<class T >
bool is_in_half_open (sycl::vec< T, 16 > val, sycl::vec< T, 16 > min, sycl::vec< T, 16 > max)
 Check if value is in [min,max) for 16D vectors.
 
template<class T , std::enable_if_t< sham::is_valid_sycl_base_type< T >, int > = 0>
bool domain_are_connected (T bmin1, T bmax1, T bmin2, T bmax2)
 Check if two 1D intervals share boundary or overlap.
 
template<class T >
bool domain_are_connected (sycl::vec< T, 2 > bmin1, sycl::vec< T, 2 > bmax1, sycl::vec< T, 2 > bmin2, sycl::vec< T, 2 > bmax2)
 Check if two 2D boxes share boundary or overlap.
 
template<class T >
bool domain_are_connected (sycl::vec< T, 3 > bmin1, sycl::vec< T, 3 > bmax1, sycl::vec< T, 3 > bmin2, sycl::vec< T, 3 > bmax2)
 Check if two 3D boxes share boundary or overlap.
 
template<class T , std::enable_if_t< sham::is_valid_sycl_base_type< T >, int > = 0>
bool domain_have_intersect (T bmin1, T bmax1, T bmin2, T bmax2)
 Check if two 1D intervals have non-empty intersection.
 
template<class T >
bool domain_have_intersect (sycl::vec< T, 2 > bmin1, sycl::vec< T, 2 > bmax1, sycl::vec< T, 2 > bmin2, sycl::vec< T, 2 > bmax2)
 Check if two 2D boxes have non-empty intersection.
 
template<class T >
bool domain_have_intersect (sycl::vec< T, 3 > bmin1, sycl::vec< T, 3 > bmax1, sycl::vec< T, 3 > bmin2, sycl::vec< T, 3 > bmax2)
 Check if two 3D boxes have non-empty intersection.
 
template<class T >
bool domain_have_common_face (sycl::vec< T, 3 > bmin1, sycl::vec< T, 3 > bmax1, sycl::vec< T, 3 > bmin2, sycl::vec< T, 3 > bmax2)
 Check if two 3D boxes share a common face.
 
template<class T , int n>
constexpr mat< T, n, n > mat_identity ()
 Returns the identity matrix of size n.
 
constexpr auto sequence_mk ()
 precomputed optimal Taylor's polynomial orders
 
constexpr auto sequence_qk ()
 precomputed optimal Paterson-Stockmeyer intergers (it's used to compute the matrix power)
 
constexpr auto sequence_rk ()
 precomputed optimal Paterson-Stockmeyer polynomial degrees
 
constexpr auto sequence_theta_mk ()
 precomputed optimal sequence based on backward error analysis
 
constexpr auto sequence_nheta_mk ()
 precomputed optimal sequence based on backward error analysis
 
constexpr auto define_bexp_coef ()
 1/(i!)
 
template<class T , class Extents1 , class Layout1 , class Accessor1 >
void order_scale (const i32 K, std::array< i32, 9 > &seq_mk, std::array< f64, 9 > &seq_theta_mk, const std::mdspan< T, Extents1, Layout1, Accessor1 > &A, const size_t size_A, i32 &k_star, i32 &m_star, i32 &s_star)
 this function compute the Taylor's polynomial order (m_star) the optimal number of matrix product during the taylor evaluation step(k_star) and the optimal scaling factor (s_star)
 
template<typename T , class U , class Extents1 , class Extents2 , class Extents3 , class Extents4 , class Extents5 , class Layout1 , class Layout2 , class Layout3 , class Layout4 , class Layout5 , class Accessor1 , class Accessor2 , class Accessor3 , class Accessor4 , class Accessor5 >
void taylor_eval (const i32 r, const i32 q, std::array< f64, 30 > &bi_seq, const size_t size, const std::mdspan< T, Extents1, Layout1, Accessor1 > &A, const std::mdspan< T, Extents2, Layout2, Accessor2 > &F, const std::mdspan< T, Extents3, Layout3, Accessor3 > &B, const std::mdspan< T, Extents4, Layout4, Accessor4 > &I, const std::mdspan< T, Extents5, Layout5, Accessor5 > &Id)
 This function compute the Taylor polynomial up to order m_star.
 
template<typename T , class U , class Extents1 , class Extents2 , class Extents3 , class Extents4 , class Extents5 , class Layout1 , class Layout2 , class Layout3 , class Layout4 , class Layout5 , class Accessor1 , class Accessor2 , class Accessor3 , class Accessor4 , class Accessor5 >
void mat_exp (const i32 K, const std::mdspan< T, Extents1, Layout1, Accessor1 > &A, const std::mdspan< T, Extents2, Layout2, Accessor2 > &F, const std::mdspan< T, Extents3, Layout3, Accessor3 > &B, const std::mdspan< T, Extents4, Layout4, Accessor4 > &I, const std::mdspan< T, Extents5, Layout5, Accessor5 > &Id, const size_t size_A)
 matrix scaling-squaring Talylor-based matrix exponential
 
template<class T >
auto compute_inv_33 (std::array< sycl::vec< T, 3 >, 3 > mat) -> std::array< sycl::vec< T, 3 >, 3 >
 
template<class T >
auto mat_prod_33 (std::array< sycl::vec< T, 3 >, 3 > mat_a, std::array< sycl::vec< T, 3 >, 3 > mat_b) -> std::array< sycl::vec< T, 3 >, 3 >
 
template<class T , class Extents , class Layout , class Accessor , class Func >
void mat_set_vals (const std::mdspan< T, Extents, Layout, Accessor > &input, Func &&func)
 Set the elements of a matrix according to a user-provided function.
 
template<class T , class Extents , class Layout , class Accessor , class Func >
void mat_update_vals (const std::mdspan< T, Extents, Layout, Accessor > &input, Func &&func)
 Update the elements of a matrix according to a user-provided function.
 
template<class T , class Extents , class Layout , class Accessor >
void mat_set_identity (const std::mdspan< T, Extents, Layout, Accessor > &input1)
 Set the content of a matrix to the identity matrix.
 
template<class T , class Extents , class Layout , class Accessor >
void mat_mul_scalar (const std::mdspan< T, Extents, Layout, Accessor > &input, const T &scalar)
 Multiply a matrix by a scalar value.
 
template<class T , class Extents , class Layout , class Accessor >
void mat_copy (const std::mdspan< T, Extents, Layout, Accessor > &input, const std::mdspan< T, Extents, Layout, Accessor > &output)
 Copy a matrix to another matrix.
 
template<class T , class Extents1 , class Extents2 , class Extents3 , class Layout1 , class Layout2 , class Layout3 , class Accessor1 , class Accessor2 , class Accessor3 >
void mat_plus (const std::mdspan< T, Extents1, Layout1, Accessor1 > &input1, const std::mdspan< T, Extents2, Layout2, Accessor2 > &input2, const std::mdspan< T, Extents3, Layout3, Accessor3 > &output)
 Add two matrices element-wise.
 
template<class T , class Extents1 , class Extents2 , class Layout1 , class Layout2 , class Accessor1 , class Accessor2 >
void mat_plus_equal (const std::mdspan< T, Extents1, Layout1, Accessor1 > &inout, const std::mdspan< T, Extents2, Layout2, Accessor2 > &matb)
 Add a matrix to another matrix element-wise and store the result in the first matrix.
 
template<class T , class Extents1 , class Extents2 , class Extents3 , class Layout1 , class Layout2 , class Layout3 , class Accessor1 , class Accessor2 , class Accessor3 >
void mat_sub (const std::mdspan< T, Extents1, Layout1, Accessor1 > &input1, const std::mdspan< T, Extents2, Layout2, Accessor2 > &input2, const std::mdspan< T, Extents3, Layout3, Accessor3 > &output)
 Subtract two matrices element-wise.
 
template<class T , class Extents1 , class Extents2 , class Layout1 , class Layout2 , class Accessor1 , class Accessor2 >
void mat_sub_equal (const std::mdspan< T, Extents1, Layout1, Accessor1 > &inout, const std::mdspan< T, Extents2, Layout2, Accessor2 > &matb)
 Subtract a matrix from another matrix element-wise and store the result in the first matrix.
 
template<class Ta , class Tb , class Extents1 , class Extents2 , class Extents3 , class Layout1 , class Layout2 , class Layout3 , class Accessor1 , class Accessor2 , class Accessor3 >
void mat_prod (const std::mdspan< Ta, Extents1, Layout1, Accessor1 > &input1, const std::mdspan< Ta, Extents2, Layout2, Accessor2 > &input2, const std::mdspan< Tb, Extents3, Layout3, Accessor3 > &output)
 Compute the product of two matrices.
 
template<class T , class SizeType , class Layout , class Accessor >
void mat_inv_33 (const std::mdspan< T, std::extents< SizeType, 3, 3 >, Layout, Accessor > &input, const std::mdspan< T, std::extents< SizeType, 3, 3 >, Layout, Accessor > &output)
 Compute the inverse of a 3x3 matrix.
 
template<class T , class U , class Extents , class Layout , class Accessor >
void mat_L1_norm (const std::mdspan< T, Extents, Layout, Accessor > &input, U &res)
 compute the L1 norm of a given matrix
 
template<class T , class Extents , class Layout , class Accessor >
void mat_set_nul (const std::mdspan< T, Extents, Layout, Accessor > &input)
 Set the content of a matrix to zero.
 
template<class T , class Extents , class Layout , class Accessor >
void vec_set_nul (const std::mdspan< T, Extents, Layout, Accessor > &input)
 Set the content of a vector to zero.
 
template<class T , class Extents , class Layout , class Accessor >
void vec_copy (const std::mdspan< T, Extents, Layout, Accessor > &input, const std::mdspan< T, Extents, Layout, Accessor > &output)
 Copy the content of one vector in another.
 
template<class T , class U , class Extents1 , class Extents2 , class Layout1 , class Layout2 , class Accessor1 , class Accessor2 >
void vec_axpy_beta (const U alpha, const std::mdspan< T, Extents1, Layout1, Accessor1 > &input, const U beta, const std::mdspan< T, Extents2, Layout2, Accessor2 > &output)
 This function compute y = alpha*x + beta*y with x,y both vectors.
 
template<class T , class U , class Extents1 , class Extents2 , class Layout1 , class Layout2 , class Accessor1 , class Accessor2 >
void vec_axpy (const U alpha, const std::mdspan< T, Extents1, Layout1, Accessor1 > &input, const std::mdspan< T, Extents2, Layout2, Accessor2 > &output)
 This function compute y = alpha*x + y with x,y both vectors.
 
template<class T , class U , class Extents1 , class Extents2 , class Layout1 , class Layout2 , class Accessor1 , class Accessor2 >
void mat_axpy_beta (const U alpha, const std::mdspan< T, Extents1, Layout1, Accessor1 > &input, const U beta, const std::mdspan< T, Extents2, Layout2, Accessor2 > &output)
 This function compute M = alpha*N + beta*M with M,N both matrices.
 
template<class T , class U , class Extents1 , class Extents2 , class Layout1 , class Layout2 , class Accessor1 , class Accessor2 >
void mat_axpy (const U alpha, const std::mdspan< T, Extents1, Layout1, Accessor1 > &input, const std::mdspan< T, Extents2, Layout2, Accessor2 > &output)
 This function compute M = alpha*N + beta*M with M,N both matrices.
 
template<class T , class U , class Extents1 , class Extents2 , class Extents3 , class Layout1 , class Layout2 , class Layout3 , class Accessor1 , class Accessor2 , class Accessor3 >
void mat_gemm (const U alpha, const std::mdspan< T, Extents1, Layout1, Accessor1 > &input1, const std::mdspan< T, Extents2, Layout2, Accessor2 > &input2, const U beta, const std::mdspan< T, Extents3, Layout3, Accessor3 > &output)
 This function compute C = alpha*A*B + beta*C with A,B,C are matrices.
 
template<class T , class U , class Extents1 , class Layout1 , class Accessor1 >
void mat_plus_equal_scalar_id (const std::mdspan< T, Extents1, Layout1, Accessor1 > &inout, const U beta)
 This function compute addition of a matrix with mutiple of identity matrix A +=beta * I, where I is an Identity matrix. A is a matrix.
 
template<class T , class U , class Extents1 , class Extents2 , class Extents3 , class Layout1 , class Layout2 , class Layout3 , class Accessor1 , class Accessor2 , class Accessor3 >
void mat_gemv (const U alpha, const std::mdspan< T, Extents1, Layout1, Accessor1 > &M, const std::mdspan< T, Extents2, Layout2, Accessor2 > &x, const U beta, const std::mdspan< T, Extents3, Layout3, Accessor3 > &y)
 This function performs matrix-vector multiplication as y = a*Mx + b*y.
 
template<typename Tvec , class paving_func >
AABB< Tvec > f_aabb (const paving_func &paving, const AABB< Tvec > &aabb, int i, int j, int k)
 
template<typename Tvec , class paving_func >
AABB< Tvec > f_aabb_inv (const paving_func &paving, const AABB< Tvec > &aabb, int i, int j, int k)
 
template<class Tvec >
const ConsState< Tvec > operator+ (const ConsState< Tvec > &lhs, const ConsState< Tvec > &rhs)
 
template<class Tvec >
const ConsState< Tvec > operator- (const ConsState< Tvec > &lhs, const ConsState< Tvec > &rhs)
 
template<class Tvec >
const ConsState< Tvec > operator* (const typename ConsState< Tvec >::Tscal factor, const ConsState< Tvec > &rhs)
 
template<class Tvec >
const ConsState< Tvec > operator* (const ConsState< Tvec > &lhs, const typename ConsState< Tvec >::Tscal factor)
 
template<class Tvec >
constexpr shambase::VecComponent< Tvec > rhoekin (shambase::VecComponent< Tvec > rho, Tvec v)
 
template<class Tvec >
constexpr ConsState< Tvec > prim_to_cons (const PrimState< Tvec > prim, typename PrimState< Tvec >::Tscal gamma)
 
template<class Tvec >
constexpr PrimState< Tvec > cons_to_prim (const ConsState< Tvec > cons, typename ConsState< Tvec >::Tscal gamma)
 
template<class Tvec >
constexpr ConsState< Tvec > hydro_flux_x (const ConsState< Tvec > cons, typename ConsState< Tvec >::Tscal gamma)
 
template<class Tvec >
constexpr shambase::VecComponent< Tvec > sound_speed (PrimState< Tvec > prim, shambase::VecComponent< Tvec > gamma)
 
template<class Tcons >
constexpr Tcons rusanov_flux_x (Tcons cL, Tcons cR, typename Tcons::Tscal gamma)
 
template<class Tcons >
constexpr Tcons y_to_x (const Tcons c)
 
template<class Tcons >
constexpr Tcons x_to_y (const Tcons c)
 
template<class Tcons >
constexpr Tcons z_to_x (const Tcons c)
 
template<class Tcons >
constexpr Tcons x_to_z (const Tcons c)
 
template<class Tcons >
constexpr Tcons invert_axis (const Tcons c)
 
template<class Tcons >
constexpr Tcons rusanov_flux_y (Tcons cL, Tcons cR, typename Tcons::Tscal gamma)
 
template<class Tcons >
constexpr Tcons rusanov_flux_z (Tcons cL, Tcons cR, typename Tcons::Tscal gamma)
 
template<class Tcons >
constexpr Tcons rusanov_flux_mx (Tcons cL, Tcons cR, typename Tcons::Tscal gamma)
 
template<class Tcons >
constexpr Tcons rusanov_flux_my (Tcons cL, Tcons cR, typename Tcons::Tscal gamma)
 
template<class Tcons >
constexpr Tcons rusanov_flux_mz (Tcons cL, Tcons cR, typename Tcons::Tscal gamma)
 
template<class Tcons >
constexpr auto hll_flux_x (const Tcons consL, const Tcons consR, const typename Tcons::Tscal gamma)
 
template<class Tcons >
constexpr Tcons hll_flux_y (Tcons cL, Tcons cR, typename Tcons::Tscal gamma)
 
template<class Tcons >
constexpr Tcons hll_flux_z (Tcons cL, Tcons cR, typename Tcons::Tscal gamma)
 
template<class Tcons >
constexpr Tcons hll_flux_mx (Tcons cL, Tcons cR, typename Tcons::Tscal gamma)
 
template<class Tcons >
constexpr Tcons hll_flux_my (Tcons cL, Tcons cR, typename Tcons::Tscal gamma)
 
template<class Tcons >
constexpr Tcons hll_flux_mz (Tcons cL, Tcons cR, typename Tcons::Tscal gamma)
 
template<class Tcons >
constexpr Tcons hllc_flux_x (Tcons cL, Tcons cR, typename Tcons::Tscal gamma)
 HLLC solver based on section 10.4 from Toro 3rd Edition , Springer 2009. The wave speeds estimates are based on Bernd Einfeldt (SIAM, 1988), On Godunov-Type Methods for Gas Dynamics.
 
template<class Tcons >
constexpr Tcons hllc_flux_y (Tcons cL, Tcons cR, typename Tcons::Tscal gamma)
 HLLC flux in the +y direction.
 
template<class Tcons >
constexpr Tcons hllc_flux_z (Tcons cL, Tcons cR, typename Tcons::Tscal gamma)
 HLLC flux in the +z direction.
 
template<class Tcons >
constexpr Tcons hllc_flux_mx (Tcons cL, Tcons cR, typename Tcons::Tscal gamma)
 HLLC flux in the -x direction.
 
template<class Tcons >
constexpr Tcons hllc_flux_my (Tcons cL, Tcons cR, typename Tcons::Tscal gamma)
 HLLC flux in the -y direction.
 
template<class Tcons >
constexpr Tcons hllc_flux_mz (Tcons cL, Tcons cR, typename Tcons::Tscal gamma)
 HLLC flux in the -z direction.
 
template<class Tvec >
const DustConsState< Tvec > operator+ (const DustConsState< Tvec > &lhs, const DustConsState< Tvec > &rhs)
 
template<class Tvec >
const DustConsState< Tvec > operator- (const DustConsState< Tvec > &lhs, const DustConsState< Tvec > &rhs)
 
template<class Tvec >
const DustConsState< Tvec > operator* (const DustConsState< Tvec > &lhs, const typename DustConsState< Tvec >::Tscal factor)
 
template<class Tvec >
const DustConsState< Tvec > operator* (const typename DustConsState< Tvec >::Tscal factor, const DustConsState< Tvec > &rhs)
 
template<class Tvec >
constexpr DustConsState< Tvec > d_prim_to_cons (const DustPrimState< Tvec > d_prim)
 
template<class Tvec >
constexpr DustPrimState< Tvec > d_cons_to_prim (const DustConsState< Tvec > d_cons)
 
template<class Tvec >
constexpr DustConsState< Tvec > d_hydro_flux_x (const DustConsState< Tvec > d_cons)
 
template<class Tcons >
constexpr Tcons d_x_to_y (const Tcons c)
 
template<class Tcons >
constexpr Tcons d_y_to_x (const Tcons c)
 
template<class Tcons >
constexpr Tcons d_x_to_z (const Tcons c)
 
template<class Tcons >
constexpr Tcons d_z_to_x (const Tcons c)
 
template<class Tcons >
constexpr Tcons d_invert_axis (const Tcons c)
 
template<class Tcons >
constexpr auto d_hll_flux_x (Tcons cL, Tcons cR)
 
template<class Tcons >
constexpr auto huang_bai_flux_x (Tcons cL, Tcons cR)
 
template<class Tcons >
constexpr Tcons d_hll_flux_y (Tcons cL, Tcons cR)
 
template<class Tcons >
constexpr Tcons d_hll_flux_z (Tcons cL, Tcons cR)
 
template<class Tcons >
constexpr Tcons d_hll_flux_mx (Tcons cL, Tcons cR)
 
template<class Tcons >
constexpr Tcons d_hll_flux_my (Tcons cL, Tcons cR)
 
template<class Tcons >
constexpr Tcons d_hll_flux_mz (Tcons cL, Tcons cR)
 
template<class Tcons >
constexpr Tcons huang_bai_flux_y (Tcons cL, Tcons cR)
 
template<class Tcons >
constexpr Tcons huang_bai_flux_z (Tcons cL, Tcons cR)
 
template<class Tcons >
constexpr Tcons huang_bai_flux_mx (Tcons cL, Tcons cR)
 
template<class Tcons >
constexpr Tcons huang_bai_flux_my (Tcons cL, Tcons cR)
 
template<class Tcons >
constexpr Tcons huang_bai_flux_mz (Tcons cL, Tcons cR)
 
template<class T >
van_leer_slope (T f, T g)
 Van leer slope limiter.
 
template<class T >
van_leer_slope_symetric (T sR, T sL)
 
template<class T >
minmod (T sR, T sL)
 
template<class T >
float newton_rhaphson (std::function< T(T)> &&f, std::function< T(T)> &&df, T epsilon_c, T x_0)
 
template<class T >
operator* (const SymTensor3d_5< T > &a, const SymTensor3d_5< T > &b)
 
template<class T >
SymTensor3d_1< T > operator* (const SymTensor3d_5< T > &a, const SymTensor3d_4< T > &b)
 
template<class T >
SymTensor3d_2< T > operator* (const SymTensor3d_5< T > &a, const SymTensor3d_3< T > &b)
 
template<class T >
SymTensor3d_3< T > operator* (const SymTensor3d_5< T > &a, const SymTensor3d_2< T > &b)
 
template<class T >
SymTensor3d_4< T > operator* (const SymTensor3d_5< T > &a, const SymTensor3d_1< T > &b)
 
template<class T >
SymTensor3d_5< T > operator* (const T &a, const SymTensor3d_5< T > &b)
 
template<class T >
SymTensor3d_4< T > operator* (const SymTensor3d_1< T > &a, const SymTensor3d_5< T > &b)
 
template<class T >
SymTensor3d_3< T > operator* (const SymTensor3d_2< T > &a, const SymTensor3d_5< T > &b)
 
template<class T >
SymTensor3d_2< T > operator* (const SymTensor3d_3< T > &a, const SymTensor3d_5< T > &b)
 
template<class T >
SymTensor3d_1< T > operator* (const SymTensor3d_4< T > &a, const SymTensor3d_5< T > &b)
 
template<class T >
operator* (const SymTensor3d_4< T > &a, const SymTensor3d_4< T > &b)
 
template<class T >
SymTensor3d_1< T > operator* (const SymTensor3d_4< T > &a, const SymTensor3d_3< T > &b)
 
template<class T >
SymTensor3d_2< T > operator* (const SymTensor3d_4< T > &a, const SymTensor3d_2< T > &b)
 
template<class T >
SymTensor3d_3< T > operator* (const SymTensor3d_4< T > &a, const SymTensor3d_1< T > &b)
 
template<class T >
SymTensor3d_4< T > operator* (const T &a, const SymTensor3d_4< T > &b)
 
template<class T >
SymTensor3d_3< T > operator* (const SymTensor3d_1< T > &a, const SymTensor3d_4< T > &b)
 
template<class T >
SymTensor3d_2< T > operator* (const SymTensor3d_2< T > &a, const SymTensor3d_4< T > &b)
 
template<class T >
SymTensor3d_1< T > operator* (const SymTensor3d_3< T > &a, const SymTensor3d_4< T > &b)
 
template<class T >
operator* (const SymTensor3d_3< T > &a, const SymTensor3d_3< T > &b)
 
template<class T >
SymTensor3d_1< T > operator* (const SymTensor3d_3< T > &a, const SymTensor3d_2< T > &b)
 
template<class T >
SymTensor3d_2< T > operator* (const SymTensor3d_3< T > &a, const SymTensor3d_1< T > &b)
 
template<class T >
SymTensor3d_1< T > operator* (const SymTensor3d_2< T > &a, const SymTensor3d_3< T > &b)
 
template<class T >
SymTensor3d_2< T > operator* (const SymTensor3d_1< T > &a, const SymTensor3d_3< T > &b)
 
template<class T >
SymTensor3d_3< T > operator* (const T &a, const SymTensor3d_3< T > &b)
 
template<class T >
operator* (const SymTensor3d_2< T > &a, const SymTensor3d_2< T > &b)
 
template<class T >
SymTensor3d_1< T > operator* (const SymTensor3d_2< T > &a, const SymTensor3d_1< T > &b)
 
template<class T >
SymTensor3d_1< T > operator* (const SymTensor3d_1< T > &a, const SymTensor3d_2< T > &b)
 
template<class T >
SymTensor3d_2< T > operator* (const T &a, const SymTensor3d_2< T > &b)
 
template<class T >
operator* (const SymTensor3d_1< T > &a, const SymTensor3d_1< T > &b)
 
template<class T >
SymTensor3d_1< T > operator* (const T &a, const SymTensor3d_1< T > &b)
 
template<class T >
void throw_ill_formed (T lower, T upper, SourceLocation call, SourceLocation loc=SourceLocation{})
 
void check_divisor_throw (u64_3 val, u64_3 divisor)
 
template<class Ta , class Tb >
void check_divisor_throw (Ta val, Tb divisor)
 

Detailed Description

namespace for math utility

Typedef Documentation

◆ C2

template<class flt_type >
using shammath::C2 = typedef SPHKernelGen<flt_type, details::KernelDefC2<flt_type> >

The C2 SPH kernel.

Todo:
add graph
Template Parameters
flt_typethe flating point representation to use

Definition at line 2456 of file sphkernels.hpp.

◆ C4

template<class flt_type >
using shammath::C4 = typedef SPHKernelGen<flt_type, details::KernelDefC4<flt_type> >

The C4 SPH kernel.

Todo:
add graph
Template Parameters
flt_typethe flating point representation to use

Definition at line 2465 of file sphkernels.hpp.

◆ C6

template<class flt_type >
using shammath::C6 = typedef SPHKernelGen<flt_type, details::KernelDefC6<flt_type> >

The C6 SPH kernel.

Todo:
add graph
Template Parameters
flt_typethe flating point representation to use

Definition at line 2474 of file sphkernels.hpp.

◆ M10

template<class flt_type >
using shammath::M10 = typedef SPHKernelGen<flt_type, details::KernelDefM10<flt_type> >

The M8 SPH kernel.

Todo:
add graph
Template Parameters
flt_typethe flating point representation to use

Definition at line 2447 of file sphkernels.hpp.

◆ M4

template<class flt_type >
using shammath::M4 = typedef SPHKernelGen<flt_type, details::KernelDefM4<flt_type> >

The M4 SPH kernel.

Todo:
add graph
Template Parameters
flt_typethe flating point representation to use

Definition at line 2393 of file sphkernels.hpp.

◆ M4DH

template<class flt_type >
using shammath::M4DH = typedef SPHKernelGen<flt_type, details::KernelDefM4DoubleHump<flt_type> >

The M4DoubleHump SPH kernel.

Todo:
add graph
Template Parameters
flt_typethe flating point representation to use

Definition at line 2499 of file sphkernels.hpp.

◆ M4DH3

template<class flt_type >
using shammath::M4DH3 = typedef SPHKernelGen<flt_type, details::KernelDefM4DoubleHump3<flt_type> >

The M4DoubleHump3 SPH kernel.

Todo:
add graph
Template Parameters
flt_typethe flating point representation to use

Definition at line 2508 of file sphkernels.hpp.

◆ M4DH5

template<class flt_type >
using shammath::M4DH5 = typedef SPHKernelGen<flt_type, details::KernelDefM4DoubleHump5<flt_type> >

The M4DoubleHump5 SPH kernel.

Todo:
add graph
Template Parameters
flt_typethe flating point representation to use

Definition at line 2517 of file sphkernels.hpp.

◆ M4DH7

template<class flt_type >
using shammath::M4DH7 = typedef SPHKernelGen<flt_type, details::KernelDefM4DoubleHump7<flt_type> >

The M4DoubleHump7 SPH kernel.

Todo:
add graph
Template Parameters
flt_typethe flating point representation to use

Definition at line 2526 of file sphkernels.hpp.

◆ M4Shift16

template<class flt_type >
using shammath::M4Shift16 = typedef SPHKernelGen<flt_type, details::KernelDefM4Shift16<flt_type> >

The M4Shift16 SPH kernel.

Todo:
add graph
Template Parameters
flt_typethe flating point representation to use

Definition at line 2562 of file sphkernels.hpp.

◆ M4Shift2

template<class flt_type >
using shammath::M4Shift2 = typedef SPHKernelGen<flt_type, details::KernelDefM4Shift2<flt_type> >

The M4Shift2 SPH kernel.

Todo:
add graph
Template Parameters
flt_typethe flating point representation to use

Definition at line 2535 of file sphkernels.hpp.

◆ M4Shift4

template<class flt_type >
using shammath::M4Shift4 = typedef SPHKernelGen<flt_type, details::KernelDefM4Shift4<flt_type> >

The M4Shift4 SPH kernel.

Todo:
add graph
Template Parameters
flt_typethe flating point representation to use

Definition at line 2544 of file sphkernels.hpp.

◆ M4Shift8

template<class flt_type >
using shammath::M4Shift8 = typedef SPHKernelGen<flt_type, details::KernelDefM4Shift8<flt_type> >

The M4Shift8 SPH kernel.

Todo:
add graph
Template Parameters
flt_typethe flating point representation to use

Definition at line 2553 of file sphkernels.hpp.

◆ M5

template<class flt_type >
using shammath::M5 = typedef SPHKernelGen<flt_type, details::KernelDefM5<flt_type> >

The M5 SPH kernel.

Todo:
add graph
Template Parameters
flt_typethe flating point representation to use

Definition at line 2402 of file sphkernels.hpp.

◆ M6

template<class flt_type >
using shammath::M6 = typedef SPHKernelGen<flt_type, details::KernelDefM6<flt_type> >

The M6 SPH kernel.

Todo:
add graph
Template Parameters
flt_typethe flating point representation to use

Definition at line 2411 of file sphkernels.hpp.

◆ M7

template<class flt_type >
using shammath::M7 = typedef SPHKernelGen<flt_type, details::KernelDefM7<flt_type> >

The M7 SPH kernel.

Todo:
add graph
Template Parameters
flt_typethe flating point representation to use

Definition at line 2420 of file sphkernels.hpp.

◆ M8

template<class flt_type >
using shammath::M8 = typedef SPHKernelGen<flt_type, details::KernelDefM8<flt_type> >

The M8 SPH kernel.

Todo:
add graph
Template Parameters
flt_typethe flating point representation to use

Definition at line 2429 of file sphkernels.hpp.

◆ M9

template<class flt_type >
using shammath::M9 = typedef SPHKernelGen<flt_type, details::KernelDefM9<flt_type> >

The M8 SPH kernel.

Todo:
add graph
Template Parameters
flt_typethe flating point representation to use

Definition at line 2438 of file sphkernels.hpp.

◆ TGauss3

template<class flt_type >
using shammath::TGauss3 = typedef SPHKernelGen<flt_type, details::KernelDefTGauss3<flt_type> >

Truncated Gaussian kernel with compact support R=3h.

Template Parameters
flt_typethe floating point representation to use

Definition at line 2482 of file sphkernels.hpp.

◆ TGauss5

template<class flt_type >
using shammath::TGauss5 = typedef SPHKernelGen<flt_type, details::KernelDefTGauss5<flt_type> >

Truncated Gaussian kernel with compact support R=5h.

Template Parameters
flt_typethe floating point representation to use

Definition at line 2490 of file sphkernels.hpp.

Function Documentation

◆ check_divisor_throw() [1/2]

template<class Ta , class Tb >
void shammath::check_divisor_throw ( Ta  val,
Tb  divisor 
)

Definition at line 59 of file CoordRangeTransform.cpp.

◆ check_divisor_throw() [2/2]

void shammath::check_divisor_throw ( u64_3  val,
u64_3  divisor 
)

Definition at line 25 of file CoordRangeTransform.cpp.

◆ compute_inv_33()

template<class T >
auto shammath::compute_inv_33 ( std::array< sycl::vec< T, 3 >, 3 >  mat) -> std::array<sycl::vec<T, 3>, 3>
inline

Definition at line 25 of file matrix_legacy.hpp.

◆ cons_to_prim()

template<class Tvec >
constexpr PrimState< Tvec > shammath::cons_to_prim ( const ConsState< Tvec >  cons,
typename ConsState< Tvec >::Tscal  gamma 
)
inlineconstexpr

Definition at line 133 of file riemann.hpp.

◆ d_cons_to_prim()

template<class Tvec >
constexpr DustPrimState< Tvec > shammath::d_cons_to_prim ( const DustConsState< Tvec >  d_cons)
inlineconstexpr

Definition at line 111 of file riemann_dust.hpp.

◆ d_hll_flux_mx()

template<class Tcons >
constexpr Tcons shammath::d_hll_flux_mx ( Tcons  cL,
Tcons  cR 
)
inlineconstexpr

Definition at line 227 of file riemann_dust.hpp.

◆ d_hll_flux_my()

template<class Tcons >
constexpr Tcons shammath::d_hll_flux_my ( Tcons  cL,
Tcons  cR 
)
inlineconstexpr

Definition at line 232 of file riemann_dust.hpp.

◆ d_hll_flux_mz()

template<class Tcons >
constexpr Tcons shammath::d_hll_flux_mz ( Tcons  cL,
Tcons  cR 
)
inlineconstexpr

Definition at line 237 of file riemann_dust.hpp.

◆ d_hll_flux_x()

template<class Tcons >
constexpr auto shammath::d_hll_flux_x ( Tcons  cL,
Tcons  cR 
)
inlineconstexpr

Definition at line 180 of file riemann_dust.hpp.

◆ d_hll_flux_y()

template<class Tcons >
constexpr Tcons shammath::d_hll_flux_y ( Tcons  cL,
Tcons  cR 
)
inlineconstexpr

Definition at line 217 of file riemann_dust.hpp.

◆ d_hll_flux_z()

template<class Tcons >
constexpr Tcons shammath::d_hll_flux_z ( Tcons  cL,
Tcons  cR 
)
inlineconstexpr

Definition at line 222 of file riemann_dust.hpp.

◆ d_hydro_flux_x()

template<class Tvec >
constexpr DustConsState< Tvec > shammath::d_hydro_flux_x ( const DustConsState< Tvec >  d_cons)
inlineconstexpr

Definition at line 119 of file riemann_dust.hpp.

◆ d_invert_axis()

template<class Tcons >
constexpr Tcons shammath::d_invert_axis ( const Tcons  c)
inlineconstexpr

Definition at line 170 of file riemann_dust.hpp.

◆ d_prim_to_cons()

template<class Tvec >
constexpr DustConsState< Tvec > shammath::d_prim_to_cons ( const DustPrimState< Tvec >  d_prim)
inlineconstexpr

Definition at line 103 of file riemann_dust.hpp.

◆ d_x_to_y()

template<class Tcons >
constexpr Tcons shammath::d_x_to_y ( const Tcons  c)
inlineconstexpr

Definition at line 129 of file riemann_dust.hpp.

◆ d_x_to_z()

template<class Tcons >
constexpr Tcons shammath::d_x_to_z ( const Tcons  c)
inlineconstexpr

Definition at line 150 of file riemann_dust.hpp.

◆ d_y_to_x()

template<class Tcons >
constexpr Tcons shammath::d_y_to_x ( const Tcons  c)
inlineconstexpr

Definition at line 140 of file riemann_dust.hpp.

◆ d_z_to_x()

template<class Tcons >
constexpr Tcons shammath::d_z_to_x ( const Tcons  c)
inlineconstexpr

Definition at line 160 of file riemann_dust.hpp.

◆ define_bexp_coef()

constexpr auto shammath::define_bexp_coef ( )
inlineconstexpr

1/(i!)

Definition at line 128 of file matrix_exponential.hpp.

◆ derivative_3point_backward()

template<class T >
T shammath::derivative_3point_backward ( x,
dx,
std::function< T(T)> &&  fct 
)
inline

Compute the derivative of a function at x using a 3-point backward finite difference.

This method computes the derivative using the points x, x - dx and x - 2*dx. This method has a second-order accuracy.

Parameters
xpoint at which to evaluate the derivative
dxspacing between two consecutive points
fctfunction to evaluate
Returns
the derivative of the function at x

Definition at line 87 of file derivatives.hpp.

◆ derivative_3point_forward()

template<class T >
T shammath::derivative_3point_forward ( x,
dx,
std::function< T(T)> &&  fct 
)
inline

Compute the derivative of a function at x using a 3-point forward finite difference.

This method computes the derivative using the points x, x + dx and x + 2*dx. This method has a second-order accuracy.

Parameters
xpoint at which to evaluate the derivative
dxspacing between two consecutive points
fctfunction to evaluate
Returns
the derivative of the function at x

Definition at line 71 of file derivatives.hpp.

◆ derivative_5point_midpoint()

template<class T >
T shammath::derivative_5point_midpoint ( x,
dx,
std::function< T(T)> &&  fct 
)
inline

Compute the derivative of a function at x using a 5-point centered finite difference.

This method computes the derivative using the points x, x + dx, x - dx, x + 2*dx and x - 2*dx. This method has a fourth-order accuracy.

Parameters
xpoint at which to evaluate the derivative
dxspacing between two consecutive points
fctfunction to evaluate
Returns
the derivative of the function at x

Definition at line 103 of file derivatives.hpp.

◆ derivative_centered()

template<class T >
T shammath::derivative_centered ( x,
dx,
std::function< T(T)> &&  fct 
)
inline

Compute the derivative of a function at x using the centered difference method.

The centered difference method computes the derivative using the average rate of change between the points x + dx and x - dx. This method is second-order accurate.

Parameters
xpoint at which to evaluate the derivative
dxspacing between two consecutive points
fctfunction to evaluate
Returns
the derivative of the function at x

Definition at line 55 of file derivatives.hpp.

◆ derivative_upwind()

template<class T >
T shammath::derivative_upwind ( x,
dx,
std::function< T(T)> &&  fct 
)
inline

Compute the derivative of a function at x using the upwind method.

The upwind method is a first order method that uses the current value of the function and the value at the neighboring point to compute the derivative. The neighboring point is chosen such that it is located in the direction of the flow.

Parameters
xpoint at which to evaluate the derivative
dxspacing between two consecutive points
fctfunction to evaluate
Returns
the derivative of the function at x

Definition at line 38 of file derivatives.hpp.

◆ domain_are_connected() [1/3]

template<class T >
bool shammath::domain_are_connected ( sycl::vec< T, 2 >  bmin1,
sycl::vec< T, 2 >  bmax1,
sycl::vec< T, 2 >  bmin2,
sycl::vec< T, 2 >  bmax2 
)
inline

Check if two 2D boxes share boundary or overlap.

Template Parameters
TComponent type
Parameters
bmin1Minimum bounds of first box
bmax1Maximum bounds of first box
bmin2Minimum bounds of second box
bmax2Maximum bounds of second box
Returns
true if boxes are connected (share boundary or overlap)

Definition at line 171 of file intervals.hpp.

+ Here is the call graph for this function:

◆ domain_are_connected() [2/3]

template<class T >
bool shammath::domain_are_connected ( sycl::vec< T, 3 >  bmin1,
sycl::vec< T, 3 >  bmax1,
sycl::vec< T, 3 >  bmin2,
sycl::vec< T, 3 >  bmax2 
)
inline

Check if two 3D boxes share boundary or overlap.

Template Parameters
TComponent type
Parameters
bmin1Minimum bounds of first box
bmax1Maximum bounds of first box
bmin2Minimum bounds of second box
bmax2Maximum bounds of second box
Returns
true if boxes are connected (share boundary or overlap)

Definition at line 193 of file intervals.hpp.

+ Here is the call graph for this function:

◆ domain_are_connected() [3/3]

template<class T , std::enable_if_t< sham::is_valid_sycl_base_type< T >, int > = 0>
bool shammath::domain_are_connected ( bmin1,
bmax1,
bmin2,
bmax2 
)
inline

Check if two 1D intervals share boundary or overlap.

Template Parameters
TScalar type
Parameters
bmin1Minimum of first interval
bmax1Maximum of first interval
bmin2Minimum of second interval
bmax2Maximum of second interval
Returns
true if intervals are connected (share boundary or overlap)

Definition at line 156 of file intervals.hpp.

◆ domain_have_common_face()

template<class T >
bool shammath::domain_have_common_face ( sycl::vec< T, 3 >  bmin1,
sycl::vec< T, 3 >  bmax1,
sycl::vec< T, 3 >  bmin2,
sycl::vec< T, 3 >  bmax2 
)
inline

Check if two 3D boxes share a common face.

Template Parameters
TComponent type
Parameters
bmin1Minimum bounds of first box
bmax1Maximum bounds of first box
bmin2Minimum bounds of second box
bmax2Maximum bounds of second box
Returns
true if boxes share a common face

Definition at line 284 of file intervals.hpp.

+ Here is the call graph for this function:

◆ domain_have_intersect() [1/3]

template<class T >
bool shammath::domain_have_intersect ( sycl::vec< T, 2 >  bmin1,
sycl::vec< T, 2 >  bmax1,
sycl::vec< T, 2 >  bmin2,
sycl::vec< T, 2 >  bmax2 
)
inline

Check if two 2D boxes have non-empty intersection.

Template Parameters
TComponent type
Parameters
bmin1Minimum bounds of first box
bmax1Maximum bounds of first box
bmin2Minimum bounds of second box
bmax2Maximum bounds of second box
Returns
true if boxes have non-empty intersection

Definition at line 235 of file intervals.hpp.

+ Here is the call graph for this function:

◆ domain_have_intersect() [2/3]

template<class T >
bool shammath::domain_have_intersect ( sycl::vec< T, 3 >  bmin1,
sycl::vec< T, 3 >  bmax1,
sycl::vec< T, 3 >  bmin2,
sycl::vec< T, 3 >  bmax2 
)
inline

Check if two 3D boxes have non-empty intersection.

Template Parameters
TComponent type
Parameters
bmin1Minimum bounds of first box
bmax1Maximum bounds of first box
bmin2Minimum bounds of second box
bmax2Maximum bounds of second box
Returns
true if boxes have non-empty intersection

Definition at line 257 of file intervals.hpp.

+ Here is the call graph for this function:

◆ domain_have_intersect() [3/3]

template<class T , std::enable_if_t< sham::is_valid_sycl_base_type< T >, int > = 0>
bool shammath::domain_have_intersect ( bmin1,
bmax1,
bmin2,
bmax2 
)
inline

Check if two 1D intervals have non-empty intersection.

Template Parameters
TScalar type
Parameters
bmin1Minimum of first interval
bmax1Maximum of first interval
bmin2Minimum of second interval
bmax2Maximum of second interval
Returns
true if intervals have non-empty intersection

Definition at line 220 of file intervals.hpp.

◆ estim_deriv_step()

template<class T >
T shammath::estim_deriv_step ( u32  order)
inline

Estimate the best step size for numerical differentiation of given order.

Parameters
orderthe order of the numerical differentiation
Returns
the estimated step size

Definition at line 114 of file derivatives.hpp.

+ Here is the call graph for this function:

◆ f_aabb()

template<typename Tvec , class paving_func >
AABB< Tvec > shammath::f_aabb ( const paving_func &  paving,
const AABB< Tvec > &  aabb,
int  i,
int  j,
int  k 
)
inline

Definition at line 28 of file paving_function.hpp.

◆ f_aabb_inv()

template<typename Tvec , class paving_func >
AABB< Tvec > shammath::f_aabb_inv ( const paving_func &  paving,
const AABB< Tvec > &  aabb,
int  i,
int  j,
int  k 
)
inline

Definition at line 47 of file paving_function.hpp.

◆ hll_flux_mx()

template<class Tcons >
constexpr Tcons shammath::hll_flux_mx ( Tcons  cL,
Tcons  cR,
typename Tcons::Tscal  gamma 
)
inlineconstexpr

Definition at line 346 of file riemann.hpp.

◆ hll_flux_my()

template<class Tcons >
constexpr Tcons shammath::hll_flux_my ( Tcons  cL,
Tcons  cR,
typename Tcons::Tscal  gamma 
)
inlineconstexpr

Definition at line 351 of file riemann.hpp.

◆ hll_flux_mz()

template<class Tcons >
constexpr Tcons shammath::hll_flux_mz ( Tcons  cL,
Tcons  cR,
typename Tcons::Tscal  gamma 
)
inlineconstexpr

Definition at line 356 of file riemann.hpp.

◆ hll_flux_x()

template<class Tcons >
constexpr auto shammath::hll_flux_x ( const Tcons  consL,
const Tcons  consR,
const typename Tcons::Tscal  gamma 
)
inlineconstexpr

Definition at line 294 of file riemann.hpp.

◆ hll_flux_y()

template<class Tcons >
constexpr Tcons shammath::hll_flux_y ( Tcons  cL,
Tcons  cR,
typename Tcons::Tscal  gamma 
)
inlineconstexpr

Definition at line 336 of file riemann.hpp.

◆ hll_flux_z()

template<class Tcons >
constexpr Tcons shammath::hll_flux_z ( Tcons  cL,
Tcons  cR,
typename Tcons::Tscal  gamma 
)
inlineconstexpr

Definition at line 341 of file riemann.hpp.

◆ hllc_flux_mx()

template<class Tcons >
constexpr Tcons shammath::hllc_flux_mx ( Tcons  cL,
Tcons  cR,
typename Tcons::Tscal  gamma 
)
inlineconstexpr

HLLC flux in the -x direction.

Definition at line 502 of file riemann.hpp.

+ Here is the call graph for this function:

◆ hllc_flux_my()

template<class Tcons >
constexpr Tcons shammath::hllc_flux_my ( Tcons  cL,
Tcons  cR,
typename Tcons::Tscal  gamma 
)
inlineconstexpr

HLLC flux in the -y direction.

Definition at line 510 of file riemann.hpp.

+ Here is the call graph for this function:

◆ hllc_flux_mz()

template<class Tcons >
constexpr Tcons shammath::hllc_flux_mz ( Tcons  cL,
Tcons  cR,
typename Tcons::Tscal  gamma 
)
inlineconstexpr

HLLC flux in the -z direction.

Definition at line 518 of file riemann.hpp.

+ Here is the call graph for this function:

◆ hllc_flux_x()

template<class Tcons >
constexpr Tcons shammath::hllc_flux_x ( Tcons  cL,
Tcons  cR,
typename Tcons::Tscal  gamma 
)
inlineconstexpr

HLLC solver based on section 10.4 from Toro 3rd Edition , Springer 2009. The wave speeds estimates are based on Bernd Einfeldt (SIAM, 1988), On Godunov-Type Methods for Gas Dynamics.

Template Parameters
Tcons
Parameters
cLleft conservative state
cRright conservative state
gammaadiabatic index

Definition at line 370 of file riemann.hpp.

◆ hllc_flux_y()

template<class Tcons >
constexpr Tcons shammath::hllc_flux_y ( Tcons  cL,
Tcons  cR,
typename Tcons::Tscal  gamma 
)
inlineconstexpr

HLLC flux in the +y direction.

Definition at line 486 of file riemann.hpp.

+ Here is the call graph for this function:

◆ hllc_flux_z()

template<class Tcons >
constexpr Tcons shammath::hllc_flux_z ( Tcons  cL,
Tcons  cR,
typename Tcons::Tscal  gamma 
)
inlineconstexpr

HLLC flux in the +z direction.

Definition at line 494 of file riemann.hpp.

+ Here is the call graph for this function:

◆ huang_bai_flux_mx()

template<class Tcons >
constexpr Tcons shammath::huang_bai_flux_mx ( Tcons  cL,
Tcons  cR 
)
inlineconstexpr

Definition at line 252 of file riemann_dust.hpp.

◆ huang_bai_flux_my()

template<class Tcons >
constexpr Tcons shammath::huang_bai_flux_my ( Tcons  cL,
Tcons  cR 
)
inlineconstexpr

Definition at line 257 of file riemann_dust.hpp.

◆ huang_bai_flux_mz()

template<class Tcons >
constexpr Tcons shammath::huang_bai_flux_mz ( Tcons  cL,
Tcons  cR 
)
inlineconstexpr

Definition at line 262 of file riemann_dust.hpp.

◆ huang_bai_flux_x()

template<class Tcons >
constexpr auto shammath::huang_bai_flux_x ( Tcons  cL,
Tcons  cR 
)
inlineconstexpr

Definition at line 196 of file riemann_dust.hpp.

◆ huang_bai_flux_y()

template<class Tcons >
constexpr Tcons shammath::huang_bai_flux_y ( Tcons  cL,
Tcons  cR 
)
inlineconstexpr

Definition at line 242 of file riemann_dust.hpp.

◆ huang_bai_flux_z()

template<class Tcons >
constexpr Tcons shammath::huang_bai_flux_z ( Tcons  cL,
Tcons  cR 
)
inlineconstexpr

Definition at line 247 of file riemann_dust.hpp.

◆ hydro_flux_x()

template<class Tvec >
constexpr ConsState< Tvec > shammath::hydro_flux_x ( const ConsState< Tvec >  cons,
typename ConsState< Tvec >::Tscal  gamma 
)
inlineconstexpr

Definition at line 150 of file riemann.hpp.

◆ integ_riemann_sum()

template<class T , class Lambda >
constexpr T shammath::integ_riemann_sum ( start,
end,
step,
Lambda &&  fct 
)
inlineconstexpr

Definition at line 24 of file integrator.hpp.

◆ invert_axis()

template<class Tcons >
constexpr Tcons shammath::invert_axis ( const Tcons  c)
inlineconstexpr

Definition at line 258 of file riemann.hpp.

◆ is_in_half_open() [1/6]

template<class T >
bool shammath::is_in_half_open ( sycl::vec< T, 16 >  val,
sycl::vec< T, 16 >  min,
sycl::vec< T, 16 >  max 
)
inline

Check if value is in [min,max) for 16D vectors.

Template Parameters
TComponent type
Parameters
valValue to test
minLower bounds
maxUpper bounds
Returns
true if val is in [min, max) for all components

Definition at line 121 of file intervals.hpp.

+ Here is the call graph for this function:

◆ is_in_half_open() [2/6]

template<class T >
bool shammath::is_in_half_open ( sycl::vec< T, 2 >  val,
sycl::vec< T, 2 >  min,
sycl::vec< T, 2 >  max 
)
inline

Check if value is in [min,max) for 2D vectors.

Template Parameters
TComponent type
Parameters
valValue to test
minLower bounds
maxUpper bounds
Returns
true if val is in [min, max) for all components

Definition at line 50 of file intervals.hpp.

+ Here is the call graph for this function:

◆ is_in_half_open() [3/6]

template<class T >
bool shammath::is_in_half_open ( sycl::vec< T, 3 >  val,
sycl::vec< T, 3 >  min,
sycl::vec< T, 3 >  max 
)
inline

Check if value is in [min,max) for 3D vectors.

Template Parameters
TComponent type
Parameters
valValue to test
minLower bounds
maxUpper bounds
Returns
true if val is in [min, max) for all components

Definition at line 66 of file intervals.hpp.

+ Here is the call graph for this function:

◆ is_in_half_open() [4/6]

template<class T >
bool shammath::is_in_half_open ( sycl::vec< T, 4 >  val,
sycl::vec< T, 4 >  min,
sycl::vec< T, 4 >  max 
)
inline

Check if value is in [min,max) for 4D vectors.

Template Parameters
TComponent type
Parameters
valValue to test
minLower bounds
maxUpper bounds
Returns
true if val is in [min, max) for all components

Definition at line 82 of file intervals.hpp.

+ Here is the call graph for this function:

◆ is_in_half_open() [5/6]

template<class T >
bool shammath::is_in_half_open ( sycl::vec< T, 8 >  val,
sycl::vec< T, 8 >  min,
sycl::vec< T, 8 >  max 
)
inline

Check if value is in [min,max) for 8D vectors.

Template Parameters
TComponent type
Parameters
valValue to test
minLower bounds
maxUpper bounds
Returns
true if val is in [min, max) for all components

Definition at line 99 of file intervals.hpp.

+ Here is the call graph for this function:

◆ is_in_half_open() [6/6]

template<class T , std::enable_if_t< sham::is_valid_sycl_base_type< T >, int > = 0>
bool shammath::is_in_half_open ( val,
min,
max 
)
inline

return true if val is in [min,max[

Template Parameters
T
Parameters
val
min
max
Returns
true
false

Definition at line 36 of file intervals.hpp.

◆ mat_axpy()

template<class T , class U , class Extents1 , class Extents2 , class Layout1 , class Layout2 , class Accessor1 , class Accessor2 >
void shammath::mat_axpy ( const U  alpha,
const std::mdspan< T, Extents1, Layout1, Accessor1 > &  input,
const std::mdspan< T, Extents2, Layout2, Accessor2 > &  output 
)
inline

This function compute M = alpha*N + beta*M with M,N both matrices.

Parameters
alphaa scalar
inputa matrix -> N
outputa matrix -> M

Definition at line 549 of file matrix_op.hpp.

+ Here is the call graph for this function:

◆ mat_axpy_beta()

template<class T , class U , class Extents1 , class Extents2 , class Layout1 , class Layout2 , class Accessor1 , class Accessor2 >
void shammath::mat_axpy_beta ( const U  alpha,
const std::mdspan< T, Extents1, Layout1, Accessor1 > &  input,
const U  beta,
const std::mdspan< T, Extents2, Layout2, Accessor2 > &  output 
)
inline

This function compute M = alpha*N + beta*M with M,N both matrices.

Parameters
alphaa scalar
inputa matrix -> N
betaa scalar
outputa matrix -> M

Definition at line 517 of file matrix_op.hpp.

◆ mat_copy()

template<class T , class Extents , class Layout , class Accessor >
void shammath::mat_copy ( const std::mdspan< T, Extents, Layout, Accessor > &  input,
const std::mdspan< T, Extents, Layout, Accessor > &  output 
)
inline

Copy a matrix to another matrix.

Parameters
inputThe matrix to copy
outputThe matrix to copy to

This function copies each element of the input matrix to the corresponding element of the output matrix.

Definition at line 129 of file matrix_op.hpp.

◆ mat_exp()

template<typename T , class U , class Extents1 , class Extents2 , class Extents3 , class Extents4 , class Extents5 , class Layout1 , class Layout2 , class Layout3 , class Layout4 , class Layout5 , class Accessor1 , class Accessor2 , class Accessor3 , class Accessor4 , class Accessor5 >
void shammath::mat_exp ( const i32  K,
const std::mdspan< T, Extents1, Layout1, Accessor1 > &  A,
const std::mdspan< T, Extents2, Layout2, Accessor2 > &  F,
const std::mdspan< T, Extents3, Layout3, Accessor3 > &  B,
const std::mdspan< T, Extents4, Layout4, Accessor4 > &  I,
const std::mdspan< T, Extents5, Layout5, Accessor5 > &  Id,
const size_t  size_A 
)
inline

matrix scaling-squaring Talylor-based matrix exponential

Parameters
Kmaximum number of matrix product allow
Ainput matrix
Foutput matrix
B,I,Idmatrices
size_Asize of matrices

Definition at line 336 of file matrix_exponential.hpp.

+ Here is the call graph for this function:

◆ mat_gemm()

template<class T , class U , class Extents1 , class Extents2 , class Extents3 , class Layout1 , class Layout2 , class Layout3 , class Accessor1 , class Accessor2 , class Accessor3 >
void shammath::mat_gemm ( const U  alpha,
const std::mdspan< T, Extents1, Layout1, Accessor1 > &  input1,
const std::mdspan< T, Extents2, Layout2, Accessor2 > &  input2,
const U  beta,
const std::mdspan< T, Extents3, Layout3, Accessor3 > &  output 
)
inline

This function compute C = alpha*A*B + beta*C with A,B,C are matrices.

Parameters
alphaa scalar
input1a matrix -> A
input2a matrix -> B
betaa scalar
outputa matrix -> C

Definition at line 578 of file matrix_op.hpp.

◆ mat_gemv()

template<class T , class U , class Extents1 , class Extents2 , class Extents3 , class Layout1 , class Layout2 , class Layout3 , class Accessor1 , class Accessor2 , class Accessor3 >
void shammath::mat_gemv ( const U  alpha,
const std::mdspan< T, Extents1, Layout1, Accessor1 > &  M,
const std::mdspan< T, Extents2, Layout2, Accessor2 > &  x,
const U  beta,
const std::mdspan< T, Extents3, Layout3, Accessor3 > &  y 
)
inline

This function performs matrix-vector multiplication as y = a*Mx + b*y.

Parameters
alphaa scalar ->a
Ma matrix
xvector
betaa scalar ->b
ya vector

Definition at line 637 of file matrix_op.hpp.

◆ mat_identity()

template<class T , int n>
constexpr mat< T, n, n > shammath::mat_identity ( )
inlineconstexpr

Returns the identity matrix of size n.

Definition at line 84 of file matrix.hpp.

+ Here is the call graph for this function:

◆ mat_inv_33()

template<class T , class SizeType , class Layout , class Accessor >
void shammath::mat_inv_33 ( const std::mdspan< T, std::extents< SizeType, 3, 3 >, Layout, Accessor > &  input,
const std::mdspan< T, std::extents< SizeType, 3, 3 >, Layout, Accessor > &  output 
)
inline

Compute the inverse of a 3x3 matrix.

Parameters
inputThe input matrix to invert.
outputThe output matrix to store the result.

This function computes the inverse of a 3x3 matrix and stores the result in the output matrix.

Note that this function assumes that the input matrix is invertible. If the determinant of the matrix is zero, the function will produce an invalid result.

Definition at line 351 of file matrix_op.hpp.

◆ mat_L1_norm()

template<class T , class U , class Extents , class Layout , class Accessor >
void shammath::mat_L1_norm ( const std::mdspan< T, Extents, Layout, Accessor > &  input,
U &  res 
)
inline

compute the L1 norm of a given matrix

Parameters
inputThe input matrix
resThe result of the L1 norm of input

This function computes the compute the L1 norm of a given matrix and store the result in res

Definition at line 394 of file matrix_op.hpp.

◆ mat_mul_scalar()

template<class T , class Extents , class Layout , class Accessor >
void shammath::mat_mul_scalar ( const std::mdspan< T, Extents, Layout, Accessor > &  input,
const T &  scalar 
)
inline

Multiply a matrix by a scalar value.

Parameters
inputThe matrix to multiply
scalarThe scalar value to multiply by

This function multiplies each element of the matrix by the scalar value, and stores the result back in the matrix.

Definition at line 112 of file matrix_op.hpp.

+ Here is the call graph for this function:

◆ mat_plus()

template<class T , class Extents1 , class Extents2 , class Extents3 , class Layout1 , class Layout2 , class Layout3 , class Accessor1 , class Accessor2 , class Accessor3 >
void shammath::mat_plus ( const std::mdspan< T, Extents1, Layout1, Accessor1 > &  input1,
const std::mdspan< T, Extents2, Layout2, Accessor2 > &  input2,
const std::mdspan< T, Extents3, Layout3, Accessor3 > &  output 
)
inline

Add two matrices element-wise.

Parameters
input1The first input matrix.
input2The second input matrix.
outputThe output matrix to store the result.

This function performs element-wise addition of two matrices and stores the result in the output matrix. The dimensions of both input matrices and the output matrix must be the same.

Definition at line 165 of file matrix_op.hpp.

◆ mat_plus_equal()

template<class T , class Extents1 , class Extents2 , class Layout1 , class Layout2 , class Accessor1 , class Accessor2 >
void shammath::mat_plus_equal ( const std::mdspan< T, Extents1, Layout1, Accessor1 > &  inout,
const std::mdspan< T, Extents2, Layout2, Accessor2 > &  matb 
)
inline

Add a matrix to another matrix element-wise and store the result in the first matrix.

Parameters
inoutThe matrix to be updated with the element-wise addition result.
matbThe matrix to add to the first matrix.

This function performs element-wise addition of the second matrix to the first matrix, modifying the first matrix with the result. The matrices must have the same dimensions.

Definition at line 200 of file matrix_op.hpp.

◆ mat_plus_equal_scalar_id()

template<class T , class U , class Extents1 , class Layout1 , class Accessor1 >
void shammath::mat_plus_equal_scalar_id ( const std::mdspan< T, Extents1, Layout1, Accessor1 > &  inout,
const U  beta 
)
inline

This function compute addition of a matrix with mutiple of identity matrix A +=beta * I, where I is an Identity matrix. A is a matrix.

Parameters
inouta matrix -> A
betaa scalar

Definition at line 610 of file matrix_op.hpp.

◆ mat_prod()

template<class Ta , class Tb , class Extents1 , class Extents2 , class Extents3 , class Layout1 , class Layout2 , class Layout3 , class Accessor1 , class Accessor2 , class Accessor3 >
void shammath::mat_prod ( const std::mdspan< Ta, Extents1, Layout1, Accessor1 > &  input1,
const std::mdspan< Ta, Extents2, Layout2, Accessor2 > &  input2,
const std::mdspan< Tb, Extents3, Layout3, Accessor3 > &  output 
)
inline

Compute the product of two matrices.

Parameters
input1The first input matrix.
input2The second input matrix.
outputThe output matrix to store the result.

This function computes the product of two matrices and stores the result in the output matrix. The matrices must satisfy the following conditions:

  • The number of rows of the first matrix must be equal to the number of rows of the output matrix.
  • The number of columns of the first matrix must be equal to the number of rows of the second matrix.
  • The number of columns of the second matrix must be equal to the number of columns of the output matrix.

Definition at line 316 of file matrix_op.hpp.

◆ mat_prod_33()

template<class T >
auto shammath::mat_prod_33 ( std::array< sycl::vec< T, 3 >, 3 >  mat_a,
std::array< sycl::vec< T, 3 >, 3 >  mat_b 
) -> std::array<sycl::vec<T, 3>, 3>
inline

Definition at line 53 of file matrix_legacy.hpp.

◆ mat_set_identity()

template<class T , class Extents , class Layout , class Accessor >
void shammath::mat_set_identity ( const std::mdspan< T, Extents, Layout, Accessor > &  input1)
inline

Set the content of a matrix to the identity matrix.

Parameters
input1The matrix to set to the identity matrix
Note
The matrix must be square.

The identity matrix is a matrix with all elements on the main diagonal (from the top-left to the bottom-right) set to 1, and all other elements set to 0.

Definition at line 93 of file matrix_op.hpp.

+ Here is the call graph for this function:

◆ mat_set_nul()

template<class T , class Extents , class Layout , class Accessor >
void shammath::mat_set_nul ( const std::mdspan< T, Extents, Layout, Accessor > &  input)
inline

Set the content of a matrix to zero.

Parameters
inputThe matrix to set to the nul matrix

Definition at line 411 of file matrix_op.hpp.

+ Here is the call graph for this function:

◆ mat_set_vals()

template<class T , class Extents , class Layout , class Accessor , class Func >
void shammath::mat_set_vals ( const std::mdspan< T, Extents, Layout, Accessor > &  input,
Func &&  func 
)
inline

Set the elements of a matrix according to a user-provided function.

Parameters
inputThe matrix to set the elements of
funcThe function to use to set the elements of the matrix. The function must take two arguments, the first being the row index and the second being the column index. The function must return a value of type T.

The function func is called for each element of the matrix, and the value returned by the function is used to set the corresponding element of the matrix.

Definition at line 44 of file matrix_op.hpp.

+ Here is the call graph for this function:

◆ mat_sub()

template<class T , class Extents1 , class Extents2 , class Extents3 , class Layout1 , class Layout2 , class Layout3 , class Accessor1 , class Accessor2 , class Accessor3 >
void shammath::mat_sub ( const std::mdspan< T, Extents1, Layout1, Accessor1 > &  input1,
const std::mdspan< T, Extents2, Layout2, Accessor2 > &  input2,
const std::mdspan< T, Extents3, Layout3, Accessor3 > &  output 
)
inline

Subtract two matrices element-wise.

Parameters
input1The first input matrix.
input2The second input matrix.
outputThe output matrix to store the result.

This function performs element-wise subtraction of the second matrix from the first matrix and stores the result in the output matrix. The dimensions of both input matrices and the output matrix must be the same.

Definition at line 236 of file matrix_op.hpp.

◆ mat_sub_equal()

template<class T , class Extents1 , class Extents2 , class Layout1 , class Layout2 , class Accessor1 , class Accessor2 >
void shammath::mat_sub_equal ( const std::mdspan< T, Extents1, Layout1, Accessor1 > &  inout,
const std::mdspan< T, Extents2, Layout2, Accessor2 > &  matb 
)
inline

Subtract a matrix from another matrix element-wise and store the result in the first matrix.

Parameters
inoutThe matrix to be updated with the element-wise subtraction result.
matbThe matrix to subtract from the first matrix.

This function performs element-wise subtraction of the second matrix from the first matrix, modifying the first matrix with the result. The matrices must have the same dimensions.

Definition at line 272 of file matrix_op.hpp.

◆ mat_update_vals()

template<class T , class Extents , class Layout , class Accessor , class Func >
void shammath::mat_update_vals ( const std::mdspan< T, Extents, Layout, Accessor > &  input,
Func &&  func 
)
inline

Update the elements of a matrix according to a user-provided function.

Parameters
inputThe matrix to update the elements of
funcThe function to use to update the elements of the matrix. The function must take three arguments, the first being the value of the element to update, the second being the row index and the third being the column index.

The function func is called for each element of the matrix, and the value returned by the function is used to update the corresponding element of the matrix.

Definition at line 69 of file matrix_op.hpp.

+ Here is the call graph for this function:

◆ minmod()

template<class T >
T shammath::minmod ( sR,
sL 
)
inline

Definition at line 66 of file slopeLimiter.hpp.

◆ newton_rhaphson()

template<class T >
float shammath::newton_rhaphson ( std::function< T(T)> &&  f,
std::function< T(T)> &&  df,
epsilon_c,
x_0 
)

Definition at line 25 of file solve.hpp.

◆ operator*() [1/34]

template<class Tvec >
const ConsState< Tvec > shammath::operator* ( const ConsState< Tvec > &  lhs,
const typename ConsState< Tvec >::Tscal  factor 
)

Definition at line 94 of file riemann.hpp.

◆ operator*() [2/34]

template<class Tvec >
const DustConsState< Tvec > shammath::operator* ( const DustConsState< Tvec > &  lhs,
const typename DustConsState< Tvec >::Tscal  factor 
)

Definition at line 84 of file riemann_dust.hpp.

◆ operator*() [3/34]

template<class T >
T shammath::operator* ( const SymTensor3d_1< T > &  a,
const SymTensor3d_1< T > &  b 
)

Definition at line 994 of file symtensors.hpp.

◆ operator*() [4/34]

template<class T >
SymTensor3d_1< T > shammath::operator* ( const SymTensor3d_1< T > &  a,
const SymTensor3d_2< T > &  b 
)

Definition at line 982 of file symtensors.hpp.

◆ operator*() [5/34]

template<class T >
SymTensor3d_2< T > shammath::operator* ( const SymTensor3d_1< T > &  a,
const SymTensor3d_3< T > &  b 
)

Definition at line 961 of file symtensors.hpp.

◆ operator*() [6/34]

template<class T >
SymTensor3d_3< T > shammath::operator* ( const SymTensor3d_1< T > &  a,
const SymTensor3d_4< T > &  b 
)
inline

Definition at line 928 of file symtensors.hpp.

◆ operator*() [7/34]

template<class T >
SymTensor3d_4< T > shammath::operator* ( const SymTensor3d_1< T > &  a,
const SymTensor3d_5< T > &  b 
)
inline

Definition at line 882 of file symtensors.hpp.

◆ operator*() [8/34]

template<class T >
SymTensor3d_1< T > shammath::operator* ( const SymTensor3d_2< T > &  a,
const SymTensor3d_1< T > &  b 
)

Definition at line 977 of file symtensors.hpp.

◆ operator*() [9/34]

template<class T >
T shammath::operator* ( const SymTensor3d_2< T > &  a,
const SymTensor3d_2< T > &  b 
)

Definition at line 972 of file symtensors.hpp.

◆ operator*() [10/34]

template<class T >
SymTensor3d_1< T > shammath::operator* ( const SymTensor3d_2< T > &  a,
const SymTensor3d_3< T > &  b 
)

Definition at line 957 of file symtensors.hpp.

◆ operator*() [11/34]

template<class T >
SymTensor3d_2< T > shammath::operator* ( const SymTensor3d_2< T > &  a,
const SymTensor3d_4< T > &  b 
)
inline

Definition at line 933 of file symtensors.hpp.

◆ operator*() [12/34]

template<class T >
SymTensor3d_3< T > shammath::operator* ( const SymTensor3d_2< T > &  a,
const SymTensor3d_5< T > &  b 
)
inline

Definition at line 887 of file symtensors.hpp.

◆ operator*() [13/34]

template<class T >
SymTensor3d_2< T > shammath::operator* ( const SymTensor3d_3< T > &  a,
const SymTensor3d_1< T > &  b 
)

Definition at line 952 of file symtensors.hpp.

◆ operator*() [14/34]

template<class T >
SymTensor3d_1< T > shammath::operator* ( const SymTensor3d_3< T > &  a,
const SymTensor3d_2< T > &  b 
)

Definition at line 948 of file symtensors.hpp.

◆ operator*() [15/34]

template<class T >
T shammath::operator* ( const SymTensor3d_3< T > &  a,
const SymTensor3d_3< T > &  b 
)

Definition at line 944 of file symtensors.hpp.

◆ operator*() [16/34]

template<class T >
SymTensor3d_1< T > shammath::operator* ( const SymTensor3d_3< T > &  a,
const SymTensor3d_4< T > &  b 
)
inline

Definition at line 938 of file symtensors.hpp.

◆ operator*() [17/34]

template<class T >
SymTensor3d_2< T > shammath::operator* ( const SymTensor3d_3< T > &  a,
const SymTensor3d_5< T > &  b 
)
inline

Definition at line 892 of file symtensors.hpp.

◆ operator*() [18/34]

template<class T >
SymTensor3d_3< T > shammath::operator* ( const SymTensor3d_4< T > &  a,
const SymTensor3d_1< T > &  b 
)

Definition at line 918 of file symtensors.hpp.

◆ operator*() [19/34]

template<class T >
SymTensor3d_2< T > shammath::operator* ( const SymTensor3d_4< T > &  a,
const SymTensor3d_2< T > &  b 
)

Definition at line 913 of file symtensors.hpp.

◆ operator*() [20/34]

template<class T >
SymTensor3d_1< T > shammath::operator* ( const SymTensor3d_4< T > &  a,
const SymTensor3d_3< T > &  b 
)

Definition at line 908 of file symtensors.hpp.

◆ operator*() [21/34]

template<class T >
T shammath::operator* ( const SymTensor3d_4< T > &  a,
const SymTensor3d_4< T > &  b 
)

Definition at line 903 of file symtensors.hpp.

◆ operator*() [22/34]

template<class T >
SymTensor3d_1< T > shammath::operator* ( const SymTensor3d_4< T > &  a,
const SymTensor3d_5< T > &  b 
)
inline

Definition at line 897 of file symtensors.hpp.

◆ operator*() [23/34]

template<class T >
SymTensor3d_4< T > shammath::operator* ( const SymTensor3d_5< T > &  a,
const SymTensor3d_1< T > &  b 
)

Definition at line 872 of file symtensors.hpp.

◆ operator*() [24/34]

template<class T >
SymTensor3d_3< T > shammath::operator* ( const SymTensor3d_5< T > &  a,
const SymTensor3d_2< T > &  b 
)

Definition at line 867 of file symtensors.hpp.

◆ operator*() [25/34]

template<class T >
SymTensor3d_2< T > shammath::operator* ( const SymTensor3d_5< T > &  a,
const SymTensor3d_3< T > &  b 
)

Definition at line 862 of file symtensors.hpp.

◆ operator*() [26/34]

template<class T >
SymTensor3d_1< T > shammath::operator* ( const SymTensor3d_5< T > &  a,
const SymTensor3d_4< T > &  b 
)

Definition at line 857 of file symtensors.hpp.

◆ operator*() [27/34]

template<class T >
T shammath::operator* ( const SymTensor3d_5< T > &  a,
const SymTensor3d_5< T > &  b 
)

Definition at line 852 of file symtensors.hpp.

◆ operator*() [28/34]

template<class T >
SymTensor3d_1< T > shammath::operator* ( const T &  a,
const SymTensor3d_1< T > &  b 
)

Definition at line 999 of file symtensors.hpp.

◆ operator*() [29/34]

template<class T >
SymTensor3d_2< T > shammath::operator* ( const T &  a,
const SymTensor3d_2< T > &  b 
)

Definition at line 987 of file symtensors.hpp.

◆ operator*() [30/34]

template<class T >
SymTensor3d_3< T > shammath::operator* ( const T &  a,
const SymTensor3d_3< T > &  b 
)

Definition at line 965 of file symtensors.hpp.

◆ operator*() [31/34]

template<class T >
SymTensor3d_4< T > shammath::operator* ( const T &  a,
const SymTensor3d_4< T > &  b 
)

Definition at line 923 of file symtensors.hpp.

◆ operator*() [32/34]

template<class T >
SymTensor3d_5< T > shammath::operator* ( const T &  a,
const SymTensor3d_5< T > &  b 
)

Definition at line 877 of file symtensors.hpp.

◆ operator*() [33/34]

template<class Tvec >
const ConsState< Tvec > shammath::operator* ( const typename ConsState< Tvec >::Tscal  factor,
const ConsState< Tvec > &  rhs 
)

Definition at line 88 of file riemann.hpp.

◆ operator*() [34/34]

template<class Tvec >
const DustConsState< Tvec > shammath::operator* ( const typename DustConsState< Tvec >::Tscal  factor,
const DustConsState< Tvec > &  rhs 
)

Definition at line 90 of file riemann_dust.hpp.

◆ operator+() [1/2]

template<class Tvec >
const ConsState< Tvec > shammath::operator+ ( const ConsState< Tvec > &  lhs,
const ConsState< Tvec > &  rhs 
)

Definition at line 61 of file riemann.hpp.

◆ operator+() [2/2]

template<class Tvec >
const DustConsState< Tvec > shammath::operator+ ( const DustConsState< Tvec > &  lhs,
const DustConsState< Tvec > &  rhs 
)

Definition at line 57 of file riemann_dust.hpp.

◆ operator-() [1/2]

template<class Tvec >
const ConsState< Tvec > shammath::operator- ( const ConsState< Tvec > &  lhs,
const ConsState< Tvec > &  rhs 
)

Definition at line 74 of file riemann.hpp.

◆ operator-() [2/2]

template<class Tvec >
const DustConsState< Tvec > shammath::operator- ( const DustConsState< Tvec > &  lhs,
const DustConsState< Tvec > &  rhs 
)

Definition at line 70 of file riemann_dust.hpp.

◆ order_scale()

template<class T , class Extents1 , class Layout1 , class Accessor1 >
void shammath::order_scale ( const i32  K,
std::array< i32, 9 > &  seq_mk,
std::array< f64, 9 > &  seq_theta_mk,
const std::mdspan< T, Extents1, Layout1, Accessor1 > &  A,
const size_t  size_A,
i32 k_star,
i32 m_star,
i32 s_star 
)
inline

this function compute the Taylor's polynomial order (m_star) the optimal number of matrix product during the taylor evaluation step(k_star) and the optimal scaling factor (s_star)

Parameters
Kmaximum number of matrix product allow
seq_mkprecomputed set of Polynomial order
seq_theta_mkprecomputed set of parameters
Athe matrix
size_Athe matrix A size
k_starthe optimal number of matrix product during the taylor evaluation step
m_starthe Taylor's polynomial order
s_starthe optimal scaling factor

Definition at line 178 of file matrix_exponential.hpp.

◆ prim_to_cons()

template<class Tvec >
constexpr ConsState< Tvec > shammath::prim_to_cons ( const PrimState< Tvec >  prim,
typename PrimState< Tvec >::Tscal  gamma 
)
inlineconstexpr

Definition at line 116 of file riemann.hpp.

◆ rhoekin()

template<class Tvec >
constexpr shambase::VecComponent< Tvec > shammath::rhoekin ( shambase::VecComponent< Tvec >  rho,
Tvec  v 
)
inlineconstexpr

Definition at line 108 of file riemann.hpp.

◆ rusanov_flux_mx()

template<class Tcons >
constexpr Tcons shammath::rusanov_flux_mx ( Tcons  cL,
Tcons  cR,
typename Tcons::Tscal  gamma 
)
inlineconstexpr

Definition at line 279 of file riemann.hpp.

◆ rusanov_flux_my()

template<class Tcons >
constexpr Tcons shammath::rusanov_flux_my ( Tcons  cL,
Tcons  cR,
typename Tcons::Tscal  gamma 
)
inlineconstexpr

Definition at line 284 of file riemann.hpp.

◆ rusanov_flux_mz()

template<class Tcons >
constexpr Tcons shammath::rusanov_flux_mz ( Tcons  cL,
Tcons  cR,
typename Tcons::Tscal  gamma 
)
inlineconstexpr

Definition at line 289 of file riemann.hpp.

◆ rusanov_flux_x()

template<class Tcons >
constexpr Tcons shammath::rusanov_flux_x ( Tcons  cL,
Tcons  cR,
typename Tcons::Tscal  gamma 
)
inlineconstexpr

Definition at line 194 of file riemann.hpp.

◆ rusanov_flux_y()

template<class Tcons >
constexpr Tcons shammath::rusanov_flux_y ( Tcons  cL,
Tcons  cR,
typename Tcons::Tscal  gamma 
)
inlineconstexpr

Definition at line 269 of file riemann.hpp.

◆ rusanov_flux_z()

template<class Tcons >
constexpr Tcons shammath::rusanov_flux_z ( Tcons  cL,
Tcons  cR,
typename Tcons::Tscal  gamma 
)
inlineconstexpr

Definition at line 274 of file riemann.hpp.

◆ sequence_mk()

constexpr auto shammath::sequence_mk ( )
inlineconstexpr

precomputed optimal Taylor's polynomial orders

%%% ALGORITHM GSQT (GENERAL SCALING AND SQUARING TAYLOR ALGORITHM) %%% INPUT: An n x n matrix A, preprocessed if appropriate % K, the maximum allowed number of matrix products; % {m_k}, k = 1 : K, the orders of the associated polynomials Step 1: Execute Algorithm Order-scale, which selects the order and scaling parameters of Taylor polynomial Step 2: Execute Algorithm Taylor-eval to evaluate the Taylor polynomial in the scaled matrix Step 3: Execute the appropriate number of squaring steps of Taylor polynomial.

Definition at line 41 of file matrix_exponential.hpp.

◆ sequence_nheta_mk()

constexpr auto shammath::sequence_nheta_mk ( )
inlineconstexpr

precomputed optimal sequence based on backward error analysis

Definition at line 111 of file matrix_exponential.hpp.

◆ sequence_qk()

constexpr auto shammath::sequence_qk ( )
inlineconstexpr

precomputed optimal Paterson-Stockmeyer intergers (it's used to compute the matrix power)

Definition at line 60 of file matrix_exponential.hpp.

◆ sequence_rk()

constexpr auto shammath::sequence_rk ( )
inlineconstexpr

precomputed optimal Paterson-Stockmeyer polynomial degrees

Definition at line 77 of file matrix_exponential.hpp.

◆ sequence_theta_mk()

constexpr auto shammath::sequence_theta_mk ( )
inlineconstexpr

precomputed optimal sequence based on backward error analysis

Definition at line 94 of file matrix_exponential.hpp.

◆ sound_speed()

template<class Tvec >
constexpr shambase::VecComponent< Tvec > shammath::sound_speed ( PrimState< Tvec >  prim,
shambase::VecComponent< Tvec >  gamma 
)
inlineconstexpr

Definition at line 168 of file riemann.hpp.

◆ taylor_eval()

template<typename T , class U , class Extents1 , class Extents2 , class Extents3 , class Extents4 , class Extents5 , class Layout1 , class Layout2 , class Layout3 , class Layout4 , class Layout5 , class Accessor1 , class Accessor2 , class Accessor3 , class Accessor4 , class Accessor5 >
void shammath::taylor_eval ( const i32  r,
const i32  q,
std::array< f64, 30 > &  bi_seq,
const size_t  size,
const std::mdspan< T, Extents1, Layout1, Accessor1 > &  A,
const std::mdspan< T, Extents2, Layout2, Accessor2 > &  F,
const std::mdspan< T, Extents3, Layout3, Accessor3 > &  B,
const std::mdspan< T, Extents4, Layout4, Accessor4 > &  I,
const std::mdspan< T, Extents5, Layout5, Accessor5 > &  Id 
)
inline

This function compute the Taylor polynomial up to order m_star.

Parameters
qPaterson-Stockmeyer interger (it's used to compute the matrix power)
rPaterson-Stockmeyer polynomial degree
bi_seqsequence of coef needed for Paterson-Stockmeyer coefficient B_k
sizesize of matrices
Ainput matrix
Foutput matrix
B,I,Idmatrices for intermediate computations

Definition at line 274 of file matrix_exponential.hpp.

◆ throw_ill_formed()

template<class T >
void shammath::throw_ill_formed ( lower,
upper,
SourceLocation  call,
SourceLocation  loc = SourceLocation{} 
)

Definition at line 25 of file CoordRange.cpp.

◆ van_leer_slope()

template<class T >
T shammath::van_leer_slope ( f,
g 
)
inline

Van leer slope limiter.

\[ \\phi(f,g) = \frac{f g + \vert f g \vert}{f + g + \epsilon} \]

Todo:
clarify the definition, normally this is done as adimensionalized function but here it is not.
Template Parameters
T
Parameters
f
g
Returns
T

Definition at line 40 of file slopeLimiter.hpp.

◆ van_leer_slope_symetric()

template<class T >
T shammath::van_leer_slope_symetric ( sR,
sL 
)
inline

Definition at line 50 of file slopeLimiter.hpp.

◆ vec_axpy()

template<class T , class U , class Extents1 , class Extents2 , class Layout1 , class Layout2 , class Accessor1 , class Accessor2 >
void shammath::vec_axpy ( const U  alpha,
const std::mdspan< T, Extents1, Layout1, Accessor1 > &  input,
const std::mdspan< T, Extents2, Layout2, Accessor2 > &  output 
)
inline

This function compute y = alpha*x + y with x,y both vectors.

Parameters
alphaa scalar ->
inputa vector ->x
outputa vector ->y

Definition at line 492 of file matrix_op.hpp.

+ Here is the call graph for this function:

◆ vec_axpy_beta()

template<class T , class U , class Extents1 , class Extents2 , class Layout1 , class Layout2 , class Accessor1 , class Accessor2 >
void shammath::vec_axpy_beta ( const U  alpha,
const std::mdspan< T, Extents1, Layout1, Accessor1 > &  input,
const U  beta,
const std::mdspan< T, Extents2, Layout2, Accessor2 > &  output 
)
inline

This function compute y = alpha*x + beta*y with x,y both vectors.

Parameters
alphaa scalar ->
inputa vector ->x
betaa scalar
outputa vector ->y

Definition at line 463 of file matrix_op.hpp.

◆ vec_copy()

template<class T , class Extents , class Layout , class Accessor >
void shammath::vec_copy ( const std::mdspan< T, Extents, Layout, Accessor > &  input,
const std::mdspan< T, Extents, Layout, Accessor > &  output 
)
inline

Copy the content of one vector in another.

Parameters
inputthe source vector
outputthe destination vector

Definition at line 436 of file matrix_op.hpp.

◆ vec_set_nul()

template<class T , class Extents , class Layout , class Accessor >
void shammath::vec_set_nul ( const std::mdspan< T, Extents, Layout, Accessor > &  input)
inline

Set the content of a vector to zero.

Parameters
inputthe vector to set to zero

Definition at line 423 of file matrix_op.hpp.

◆ x_to_y()

template<class Tcons >
constexpr Tcons shammath::x_to_y ( const Tcons  c)
inlineconstexpr

Definition at line 225 of file riemann.hpp.

◆ x_to_z()

template<class Tcons >
constexpr Tcons shammath::x_to_z ( const Tcons  c)
inlineconstexpr

Definition at line 247 of file riemann.hpp.

◆ y_to_x()

template<class Tcons >
constexpr Tcons shammath::y_to_x ( const Tcons  c)
inlineconstexpr

Definition at line 214 of file riemann.hpp.

◆ z_to_x()

template<class Tcons >
constexpr Tcons shammath::z_to_x ( const Tcons  c)
inlineconstexpr

Definition at line 236 of file riemann.hpp.