![]() |
Shamrock 2025.10.0
Astrophysical Code
|
namespace for math utility More...
Classes | |
| struct | Ray |
| Ray representation for intersection testing. More... | |
| struct | RingRay |
| Ring ray representation for intersection testing. More... | |
| struct | AABB |
| Axis-Aligned bounding box. More... | |
| struct | CoordRange |
| class | CoordRangeTransform |
| class | LatticeError |
| class | LatticeHCP |
| utility for generating HCP crystal lattices More... | |
| class | LatticeCubic |
| utility for generating Cubic crystal lattices More... | |
| class | DiscontinuousIterator |
| Discontinuous Iterator will iterate over every values in an integer set in the most discontinuous way possible. More... | |
| class | mat |
| Matrix class based on std::array storage and mdspan. More... | |
| class | vec |
| Vector class based on std::array storage and mdspan. More... | |
| class | mat_d |
| Matrix class with runtime size based on std::vector storage and mdspan. More... | |
| class | vec_d |
| Vector class with runtime size based on std::vector storage and mdspan. More... | |
| struct | paving_function_periodic_3d |
| A structure for 3D paving functions with periodic boundary conditions. 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 | ConsState |
| struct | PrimState |
| struct | Fluxes |
| struct | DustConsState |
| struct | DustPrimState |
| struct | DustFluxes |
| struct | FluidStateAdiabatic |
| FluidStateSpec implementation for an ideal (adiabatic) gas equation of state. More... | |
| struct | FluidStateDust |
| cons_to_prim/prim_to_cons/vn/flux wrapper for a pressureless (dust) fluid. Unlike FluidStateAdiabatic there is no equation of state, so sound_speed() and gamma() are not defined here; this type satisfies DustFluidStateSpec rather than FluidStateSpec. More... | |
| 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 | SPHKernelGen |
| struct | SymTensorCollection |
| struct | SymTensorCollection< T, 0, 5 > |
| struct | SymTensorCollection< T, 0, 4 > |
| struct | SymTensorCollection< T, 0, 3 > |
| struct | SymTensorCollection< T, 0, 2 > |
| struct | SymTensorCollection< T, 0, 1 > |
| struct | SymTensorCollection< T, 0, 0 > |
| struct | SymTensorCollection< T, 1, 5 > |
| struct | SymTensorCollection< T, 1, 4 > |
| struct | SymTensorCollection< T, 1, 3 > |
| struct | SymTensorCollection< T, 1, 2 > |
| struct | SymTensorCollection< T, 1, 1 > |
| struct | SymTensor3d_1 |
| struct | SymTensor3d_2 |
| struct | SymTensor3d_3 |
| struct | SymTensor3d_4 |
| struct | SymTensor3d_5 |
Concepts | |
| concept | FluidStateSpec |
| An equation of state paired with the flux/wave-speed operations a Riemann solver needs, so that solvers (see riemann_rusanov.hpp, riemann_hll.hpp) can be written once and instantiated for any fluid state satisfying this interface. | |
| concept | DustFluidStateSpec |
| The flux operations a dust (pressureless) Riemann solver needs, so that solvers (see riemann_dust_hll.hpp, riemann_dust_huang_bai.hpp) can be written once and instantiated for any dust state satisfying this interface. Analogous to FluidStateSpec but without an equation of state, hence no sound_speed(). | |
| concept | FluidStateAdiabaticSpec |
| A FluidStateSpec that also exposes the adiabatic index, for solvers (e.g. HLLC) that need gamma directly rather than only through cons_to_prim/prim_to_cons/flux. Satisfied by a state-independent gamma() (a single constant adiabatic index) or a per-state gamma(prim) (e.g. a spatially/species-varying index); see get_adiabatic_index_lr() for how solvers should read it. | |
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> | |
| 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> | |
| 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> | |
| 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> | |
| 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> | |
| 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> | |
| 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, class Lambda> | |
| constexpr std::pair< std::vector< T >, std::vector< T > > | euler_ode (T start, T end, T step, Lambda &&ode, T x0, T u0) |
| Euler solving of ODE The ode has the form. | |
| 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 | vec_set_vals (const std::mdspan< T, Extents, Layout, Accessor > &input, Func &&func) |
| Set the elements of a vector 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<class T, class Extents1, class Extents2, class Layout1, class Layout2, class Accessor1, class Accessor2> | |
| void | mat_transpose (const std::mdspan< T, Extents1, Layout1, Accessor1 > &input, const std::mdspan< T, Extents2, Layout2, Accessor2 > &output) |
| This function transposes a matrix. | |
| template<class T, class Extents1, class Extents2, class Layout1, class Layout2, class Accessor1, class Accessor2> | |
| void | Cholesky_decomp (const std::mdspan< T, Extents1, Layout1, Accessor1 > &M, const std::mdspan< T, Extents2, Layout2, Accessor2 > &L) |
| This function performs Cholesky decomposition. From a (real) symmetric, definite-positive square matrix \( M \), return a lower triangular matrix \( L \) such that. | |
| template<class T, class Extents1, class Extents2, class Extents3, class Layout1, class Layout2, class Layout3, class Accessor1, class Accessor2, class Accessor3> | |
| void | Cholesky_solve (const std::mdspan< T, Extents1, Layout1, Accessor1 > &M, const std::mdspan< T, Extents2, Layout2, Accessor2 > &y, const std::mdspan< T, Extents3, Layout3, Accessor3 > &x) |
| This function solves a system of linear equations with Cholesky decomposition. The system must have the form. | |
| 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<FluidStateAdiabaticSpec FSpec> | |
| constexpr std::pair< typename FSpec::Tscal, typename FSpec::Tscal > | get_adiabatic_index_lr (const FSpec &fspec, const typename FSpec::Tprim &prim_l, const typename FSpec::Tprim &prim_r) |
| Read the left/right adiabatic indices a HLLC-style solver should use for a given L/R pair. | |
| 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_n (const PrimState< Tvec > prim, Tvec n, typename PrimState< Tvec >::Tscal vn, typename PrimState< Tvec >::Tscal gamma) |
| Euler flux across a face of normal n, given a precomputed normal velocity vn = dot(prim.vel, n). | |
| template<class Tvec> | |
| constexpr ConsState< Tvec > | hydro_flux_n (const PrimState< Tvec > prim, Tvec n, typename PrimState< Tvec >::Tscal gamma) |
| Euler flux across a face of normal n. | |
| template<class Tvec> | |
| constexpr shambase::VecComponent< Tvec > | sound_speed (PrimState< Tvec > prim, shambase::VecComponent< Tvec > 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 Tprim> | |
| constexpr Tprim | prim_y_to_x (const Tprim p) |
| template<class Tprim> | |
| constexpr Tprim | prim_z_to_x (const Tprim p) |
| template<class Tprim> | |
| constexpr Tprim | prim_invert_axis (const Tprim p) |
| 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_n (const DustPrimState< Tvec > d_prim, Tvec n, typename DustPrimState< Tvec >::Tscal vn) |
| Pressureless (dust) flux across a face of normal n, given a precomputed normal velocity vn = dot(d_prim.vel, n). | |
| template<class Tvec> | |
| constexpr DustConsState< Tvec > | d_hydro_flux_n (const DustPrimState< Tvec > d_prim, Tvec n) |
| Pressureless (dust) flux across a face of normal n. | |
| 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 Tprim> | |
| constexpr Tprim | d_prim_y_to_x (const Tprim p) |
| template<class Tprim> | |
| constexpr Tprim | d_prim_z_to_x (const Tprim p) |
| template<class Tprim> | |
| constexpr Tprim | d_prim_invert_axis (const Tprim p) |
| template<DustFluidStateSpec FSpec> | |
| constexpr FSpec::Tcons | d_hll_flux (const FSpec &fspec, const typename FSpec::Tprim &prim_l, const typename FSpec::Tprim &prim_r, const typename FSpec::Tvec &n) |
| Dust HLL flux across a face with unit normal n. | |
| template<DustFluidStateSpec FSpec> | |
| constexpr FSpec::Tcons | huang_bai_flux (const FSpec &fspec, const typename FSpec::Tprim &prim_l, const typename FSpec::Tprim &prim_r, const typename FSpec::Tvec &n) |
| Huang & Bai dust flux across a face with unit normal n. | |
| template<FluidStateSpec FSpec> | |
| constexpr FSpec::Tcons | hll_flux (const FSpec &fspec, const typename FSpec::Tprim &prim_l, const typename FSpec::Tprim &prim_r, const typename FSpec::Tvec &n) |
| HLL flux across a face with unit normal n. | |
| template<FluidStateAdiabaticSpec FSpec> | |
| constexpr FSpec::Tcons | hllc_adiab_toro_flux (const FSpec &fspec, const typename FSpec::Tprim &prim_l, const typename FSpec::Tprim &prim_r, const typename FSpec::Tvec &n) |
| 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, using the pressure in the star region estimated through the primitive variable solver (valid for an adiabatic equation of state). Computes the flux across a face with unit normal n. | |
| template<FluidStateSpec FSpec> | |
| constexpr FSpec::Tcons | hllc_davis_flux (const FSpec &fspec, const typename FSpec::Tprim &prim_l, const typename FSpec::Tprim &prim_r, const typename FSpec::Tvec &n) |
| HLLC solver based on section 10.4 from Toro 3rd Edition , Springer 2009, using the Davis (1988) wave speed estimate instead of the pressure based (p*) estimate, i.e. s_l = min(velx_l - cs_l, velx_r - cs_r) s_r = max(velx_l + cs_l, velx_r + cs_r) This estimate does not rely on an adiabatic equation of state for the pressure in the star region and can therefore be used for other equations of state. Computes the flux across a face with unit normal n. | |
| template<FluidStateSpec FSpec> | |
| constexpr FSpec::Tcons | rusanov_flux (const FSpec &fspec, const typename FSpec::Tprim &prim_l, const typename FSpec::Tprim &prim_r, const typename FSpec::Tvec &n) |
| Rusanov flux across a face with unit normal n. | |
| template<class T> | |
| T | van_leer_slope (T f, T g) |
| Van leer slope limiter. | |
| template<class T> | |
| T | van_leer_slope_symetric (T sR, T sL) |
| template<class T> | |
| 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, class Lambda> | |
| std::pair< std::vector< T >, T > | least_squares (const Lambda &f, const std::vector< T > &X, const std::vector< T > &Y, const std::vector< T > &p0, int maxits=1000, T tolerance=1e-9) |
| This function determines the best fit parameters \( \vec p \) for a given function \( f(\vec p, \mathbf X) \) with least squares. | |
| template<class T> | |
| 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> | |
| 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> | |
| 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> | |
| 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> | |
| 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) |
namespace for math utility
| using shammath::C2 = SPHKernelGen<flt_type, details::KernelDefC2<flt_type>> |
The C2 SPH kernel.
| flt_type | the flating point representation to use |
Definition at line 2456 of file sphkernels.hpp.
| using shammath::C4 = SPHKernelGen<flt_type, details::KernelDefC4<flt_type>> |
The C4 SPH kernel.
| flt_type | the flating point representation to use |
Definition at line 2465 of file sphkernels.hpp.
| using shammath::C6 = SPHKernelGen<flt_type, details::KernelDefC6<flt_type>> |
The C6 SPH kernel.
| flt_type | the flating point representation to use |
Definition at line 2474 of file sphkernels.hpp.
| using shammath::M10 = SPHKernelGen<flt_type, details::KernelDefM10<flt_type>> |
The M8 SPH kernel.
| flt_type | the flating point representation to use |
Definition at line 2447 of file sphkernels.hpp.
| using shammath::M4 = SPHKernelGen<flt_type, details::KernelDefM4<flt_type>> |
The M4 SPH kernel.
| flt_type | the flating point representation to use |
Definition at line 2393 of file sphkernels.hpp.
| using shammath::M4DH = SPHKernelGen<flt_type, details::KernelDefM4DoubleHump<flt_type>> |
The M4DoubleHump SPH kernel.
| flt_type | the flating point representation to use |
Definition at line 2499 of file sphkernels.hpp.
| using shammath::M4DH3 = SPHKernelGen<flt_type, details::KernelDefM4DoubleHump3<flt_type>> |
The M4DoubleHump3 SPH kernel.
| flt_type | the flating point representation to use |
Definition at line 2508 of file sphkernels.hpp.
| using shammath::M4DH5 = SPHKernelGen<flt_type, details::KernelDefM4DoubleHump5<flt_type>> |
The M4DoubleHump5 SPH kernel.
| flt_type | the flating point representation to use |
Definition at line 2517 of file sphkernels.hpp.
| using shammath::M4DH7 = SPHKernelGen<flt_type, details::KernelDefM4DoubleHump7<flt_type>> |
The M4DoubleHump7 SPH kernel.
| flt_type | the flating point representation to use |
Definition at line 2526 of file sphkernels.hpp.
| using shammath::M4Shift16 = SPHKernelGen<flt_type, details::KernelDefM4Shift16<flt_type>> |
The M4Shift16 SPH kernel.
| flt_type | the flating point representation to use |
Definition at line 2562 of file sphkernels.hpp.
| using shammath::M4Shift2 = SPHKernelGen<flt_type, details::KernelDefM4Shift2<flt_type>> |
The M4Shift2 SPH kernel.
| flt_type | the flating point representation to use |
Definition at line 2535 of file sphkernels.hpp.
| using shammath::M4Shift4 = SPHKernelGen<flt_type, details::KernelDefM4Shift4<flt_type>> |
The M4Shift4 SPH kernel.
| flt_type | the flating point representation to use |
Definition at line 2544 of file sphkernels.hpp.
| using shammath::M4Shift8 = SPHKernelGen<flt_type, details::KernelDefM4Shift8<flt_type>> |
The M4Shift8 SPH kernel.
| flt_type | the flating point representation to use |
Definition at line 2553 of file sphkernels.hpp.
| using shammath::M5 = SPHKernelGen<flt_type, details::KernelDefM5<flt_type>> |
The M5 SPH kernel.
| flt_type | the flating point representation to use |
Definition at line 2402 of file sphkernels.hpp.
| using shammath::M6 = SPHKernelGen<flt_type, details::KernelDefM6<flt_type>> |
The M6 SPH kernel.
| flt_type | the flating point representation to use |
Definition at line 2411 of file sphkernels.hpp.
| using shammath::M7 = SPHKernelGen<flt_type, details::KernelDefM7<flt_type>> |
The M7 SPH kernel.
| flt_type | the flating point representation to use |
Definition at line 2420 of file sphkernels.hpp.
| using shammath::M8 = SPHKernelGen<flt_type, details::KernelDefM8<flt_type>> |
The M8 SPH kernel.
| flt_type | the flating point representation to use |
Definition at line 2429 of file sphkernels.hpp.
| using shammath::M9 = SPHKernelGen<flt_type, details::KernelDefM9<flt_type>> |
The M8 SPH kernel.
| flt_type | the flating point representation to use |
Definition at line 2438 of file sphkernels.hpp.
| using shammath::TGauss3 = SPHKernelGen<flt_type, details::KernelDefTGauss3<flt_type>> |
Truncated Gaussian kernel with compact support R=3h.
| flt_type | the floating point representation to use |
Definition at line 2482 of file sphkernels.hpp.
| using shammath::TGauss5 = SPHKernelGen<flt_type, details::KernelDefTGauss5<flt_type>> |
Truncated Gaussian kernel with compact support R=5h.
| flt_type | the floating point representation to use |
Definition at line 2490 of file sphkernels.hpp.
| void shammath::check_divisor_throw | ( | Ta | val, |
| Tb | divisor ) |
Definition at line 59 of file CoordRangeTransform.cpp.
| void shammath::check_divisor_throw | ( | u64_3 | val, |
| u64_3 | divisor ) |
Definition at line 25 of file CoordRangeTransform.cpp.
|
inline |
This function performs Cholesky decomposition. From a (real) symmetric, definite-positive square matrix \( M \), return a lower triangular matrix \( L \) such that.
\[ M = L L^T \]
| M | a square symmetric, definite-positive matrix |
| L | the output matrix to store the lower triangular matrix obtained by Cholesky decomposition |
Definition at line 723 of file matrix_op.hpp.
|
inline |
This function solves a system of linear equations with Cholesky decomposition. The system must have the form.
\[ Mx = y \]
where \( M \) is a (real) symmetric, definite-positive square matrix.
| M | a square symmetric, definite-positive matrix |
| y | a vector, right hand side of the system |
| x | the ouput vector to store the solution of the system |
Definition at line 770 of file matrix_op.hpp.
|
inline |
Definition at line 25 of file matrix_legacy.hpp.
|
inlineconstexpr |
Definition at line 229 of file riemann_common.hpp.
|
inlineconstexpr |
Definition at line 466 of file riemann_common.hpp.
|
inlineconstexpr |
Dust HLL flux across a face with unit normal n.
Krapp et al. 2024, A Fast second-order solver for stiff multifluid dust and gas hydrodynamics, Appendice E
| FSpec |
| fspec | dust state spec (flux/vn operations, no equation of state) |
| prim_l | left primitive state |
| prim_r | right primitive state |
| n | face unit normal |
Definition at line 35 of file riemann_dust_hll.hpp.
|
inlineconstexpr |
Pressureless (dust) flux across a face of normal n.
n is expected to be a unit vector.
Definition at line 494 of file riemann_common.hpp.
|
inlineconstexpr |
Pressureless (dust) flux across a face of normal n, given a precomputed normal velocity vn = dot(d_prim.vel, n).
n is expected to be a unit vector, and vn is expected to be dot(d_prim.vel, n)
Definition at line 480 of file riemann_common.hpp.
|
inlineconstexpr |
Definition at line 541 of file riemann_common.hpp.
|
inlineconstexpr |
Definition at line 573 of file riemann_common.hpp.
|
inlineconstexpr |
Definition at line 458 of file riemann_common.hpp.
|
inlineconstexpr |
Definition at line 553 of file riemann_common.hpp.
|
inlineconstexpr |
Definition at line 563 of file riemann_common.hpp.
|
inlineconstexpr |
Definition at line 500 of file riemann_common.hpp.
|
inlineconstexpr |
Definition at line 521 of file riemann_common.hpp.
|
inlineconstexpr |
Definition at line 511 of file riemann_common.hpp.
|
inlineconstexpr |
Definition at line 531 of file riemann_common.hpp.
|
inlineconstexpr |
1/(i!)
Definition at line 128 of file matrix_exponential.hpp.
|
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.
| x | point at which to evaluate the derivative |
| dx | spacing between two consecutive points |
| fct | function to evaluate |
Definition at line 87 of file derivatives.hpp.
|
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.
| x | point at which to evaluate the derivative |
| dx | spacing between two consecutive points |
| fct | function to evaluate |
Definition at line 71 of file derivatives.hpp.
|
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.
| x | point at which to evaluate the derivative |
| dx | spacing between two consecutive points |
| fct | function to evaluate |
Definition at line 103 of file derivatives.hpp.
|
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.
| x | point at which to evaluate the derivative |
| dx | spacing between two consecutive points |
| fct | function to evaluate |
Definition at line 55 of file derivatives.hpp.
|
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.
| x | point at which to evaluate the derivative |
| dx | spacing between two consecutive points |
| fct | function to evaluate |
Definition at line 38 of file derivatives.hpp.
|
inline |
Check if two 2D boxes share boundary or overlap.
| T | Component type |
| bmin1 | Minimum bounds of first box |
| bmax1 | Maximum bounds of first box |
| bmin2 | Minimum bounds of second box |
| bmax2 | Maximum bounds of second box |
Definition at line 171 of file intervals.hpp.
|
inline |
Check if two 3D boxes share boundary or overlap.
| T | Component type |
| bmin1 | Minimum bounds of first box |
| bmax1 | Maximum bounds of first box |
| bmin2 | Minimum bounds of second box |
| bmax2 | Maximum bounds of second box |
Definition at line 193 of file intervals.hpp.
|
inline |
Check if two 1D intervals share boundary or overlap.
| T | Scalar type |
| bmin1 | Minimum of first interval |
| bmax1 | Maximum of first interval |
| bmin2 | Minimum of second interval |
| bmax2 | Maximum of second interval |
Definition at line 156 of file intervals.hpp.
|
inline |
Check if two 3D boxes share a common face.
| T | Component type |
| bmin1 | Minimum bounds of first box |
| bmax1 | Maximum bounds of first box |
| bmin2 | Minimum bounds of second box |
| bmax2 | Maximum bounds of second box |
Definition at line 284 of file intervals.hpp.
|
inline |
Check if two 2D boxes have non-empty intersection.
| T | Component type |
| bmin1 | Minimum bounds of first box |
| bmax1 | Maximum bounds of first box |
| bmin2 | Minimum bounds of second box |
| bmax2 | Maximum bounds of second box |
Definition at line 235 of file intervals.hpp.
|
inline |
Check if two 3D boxes have non-empty intersection.
| T | Component type |
| bmin1 | Minimum bounds of first box |
| bmax1 | Maximum bounds of first box |
| bmin2 | Minimum bounds of second box |
| bmax2 | Maximum bounds of second box |
Definition at line 257 of file intervals.hpp.
|
inline |
Check if two 1D intervals have non-empty intersection.
| T | Scalar type |
| bmin1 | Minimum of first interval |
| bmax1 | Maximum of first interval |
| bmin2 | Minimum of second interval |
| bmax2 | Maximum of second interval |
Definition at line 220 of file intervals.hpp.
|
inline |
Estimate the best step size for numerical differentiation of given order.
| order | the order of the numerical differentiation |
Definition at line 114 of file derivatives.hpp.
|
inlineconstexpr |
Euler solving of ODE The ode has the form.
\begin{eqnarray*}u'(x) &=& f(u,x) \\ u(x_0) &=& u_0 \end{eqnarray*}
and will be solved between start and end with step \( \mathrm{d}t \).
| start | Lower bound of integration |
| end | Higher bound of integration |
| step | Step of integration \( \mathrm{d}t \) |
| ode | Ode function \( f \) |
| x0 | Initial coordinate \( x_0 \) |
| u0 | Initial value \( u_0 \) |
Definition at line 51 of file integrator.hpp.
|
inline |
Definition at line 28 of file paving_function.hpp.
|
inline |
Definition at line 47 of file paving_function.hpp.
|
inlineconstexpr |
Read the left/right adiabatic indices a HLLC-style solver should use for a given L/R pair.
If fspec exposes a single state-independent gamma() it is returned for both sides; otherwise fspec is assumed to expose a per-state gamma(prim) and each side reads its own.
Definition at line 114 of file riemann_common.hpp.
|
inlineconstexpr |
HLL flux across a face with unit normal n.
Definition at line 29 of file riemann_hll.hpp.
|
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, using the pressure in the star region estimated through the primitive variable solver (valid for an adiabatic equation of state). Computes the flux across a face with unit normal n.
| FSpec |
| fspec | fluid state spec (adiabatic equation of state + flux/wave-speed operations) |
| prim_l | left primitive state |
| prim_r | right primitive state |
| n | face unit normal |
Definition at line 38 of file riemann_hllc.hpp.
|
inlineconstexpr |
HLLC solver based on section 10.4 from Toro 3rd Edition , Springer 2009, using the Davis (1988) wave speed estimate instead of the pressure based (p*) estimate, i.e. s_l = min(velx_l - cs_l, velx_r - cs_r) s_r = max(velx_l + cs_l, velx_r + cs_r) This estimate does not rely on an adiabatic equation of state for the pressure in the star region and can therefore be used for other equations of state. Computes the flux across a face with unit normal n.
| FSpec |
| fspec | fluid state spec (equation of state + flux/wave-speed operations) |
| prim_l | left primitive state |
| prim_r | right primitive state |
| n | face unit normal |
Definition at line 173 of file riemann_hllc.hpp.
|
inlineconstexpr |
Huang & Bai dust flux across a face with unit normal n.
Huang & Bai, 2022, A Multifluid Dust Module in Athena++: Algorithms and Numerical Tests, Equation (32)
| FSpec |
| fspec | dust state spec (flux/vn operations, no equation of state) |
| prim_l | left primitive state |
| prim_r | right primitive state |
| n | face unit normal |
Definition at line 35 of file riemann_dust_huang_bai.hpp.
|
inlineconstexpr |
Euler flux across a face of normal n.
n is expected to be a unit vector.
Definition at line 279 of file riemann_common.hpp.
|
inlineconstexpr |
Euler flux across a face of normal n, given a precomputed normal velocity vn = dot(prim.vel, n).
n is expected to be a unit vector, and vn is expected to be dot(prim.vel, n)
Definition at line 252 of file riemann_common.hpp.
|
inlineconstexpr |
Definition at line 25 of file integrator.hpp.
|
inlineconstexpr |
Definition at line 336 of file riemann_common.hpp.
|
inline |
Check if value is in [min,max) for 16D vectors.
| T | Component type |
| val | Value to test |
| min | Lower bounds |
| max | Upper bounds |
Definition at line 121 of file intervals.hpp.
|
inline |
Check if value is in [min,max) for 2D vectors.
| T | Component type |
| val | Value to test |
| min | Lower bounds |
| max | Upper bounds |
Definition at line 50 of file intervals.hpp.
|
inline |
Check if value is in [min,max) for 3D vectors.
| T | Component type |
| val | Value to test |
| min | Lower bounds |
| max | Upper bounds |
Definition at line 66 of file intervals.hpp.
|
inline |
Check if value is in [min,max) for 4D vectors.
| T | Component type |
| val | Value to test |
| min | Lower bounds |
| max | Upper bounds |
Definition at line 82 of file intervals.hpp.
|
inline |
Check if value is in [min,max) for 8D vectors.
| T | Component type |
| val | Value to test |
| min | Lower bounds |
| max | Upper bounds |
Definition at line 99 of file intervals.hpp.
|
inline |
return true if val is in [min,max[
| T |
| val | |
| min | |
| max |
Definition at line 36 of file intervals.hpp.
| std::pair< std::vector< T >, T > shammath::least_squares | ( | const Lambda & | f, |
| const std::vector< T > & | X, | ||
| const std::vector< T > & | Y, | ||
| const std::vector< T > & | p0, | ||
| int | maxits = 1000, | ||
| T | tolerance = 1e-9 ) |
This function determines the best fit parameters \( \vec p \) for a given function \( f(\vec p, \mathbf X) \) with least squares.
| f | Function (1d values). Must takes a vector ( \( \vec p \)) and a scalar ( \(x \)) as parameters. |
| X | Data to fit \( x \) |
| Y | Data to fit \( y \) |
| p0 | Initial parameters guessed |
| maxits | Maximum number of iterations in the Levenberg-Marquardt procedure. Default: 1000 |
| tolerance | Convergence condition in the Levenberg-Marquardt procedure. Default: 1e-6 |
The Levenberg-Marquardt method is used. Therefore, the number of observations needs to be greater than the number of parameters. At every iteration, a new parameters array \(\vec p' \) is estimated. The convergence condition is
\[|S(\vec p') - S(\vec p))| < \epsilon \]
where \( S \) is the residual sum of squares and \( \epsilon \) is the tolerance.
Definition at line 70 of file solve.hpp.
|
inline |
This function compute M = alpha*N + beta*M with M,N both matrices.
| alpha | a scalar |
| input | a matrix -> N |
| output | a matrix -> M |
Definition at line 571 of file matrix_op.hpp.
|
inline |
This function compute M = alpha*N + beta*M with M,N both matrices.
| alpha | a scalar |
| input | a matrix -> N |
| beta | a scalar |
| output | a matrix -> M |
Definition at line 539 of file matrix_op.hpp.
|
inline |
Copy a matrix to another matrix.
| input | The matrix to copy |
| output | The matrix to copy to |
This function copies each element of the input matrix to the corresponding element of the output matrix.
Definition at line 151 of file matrix_op.hpp.
|
inline |
matrix scaling-squaring Talylor-based matrix exponential
| K | maximum number of matrix product allow |
| A | input matrix |
| F | output matrix |
| B,I,Id | matrices |
| size_A | size of matrices |
Definition at line 336 of file matrix_exponential.hpp.
|
inline |
This function compute C = alpha*A*B + beta*C with A,B,C are matrices.
| alpha | a scalar |
| input1 | a matrix -> A |
| input2 | a matrix -> B |
| beta | a scalar |
| output | a matrix -> C |
Definition at line 600 of file matrix_op.hpp.
|
inline |
This function performs matrix-vector multiplication as y = a*Mx + b*y.
| alpha | a scalar ->a |
| M | a matrix |
| x | vector |
| beta | a scalar ->b |
| y | a vector |
Definition at line 659 of file matrix_op.hpp.
|
inlineconstexpr |
Returns the identity matrix of size n.
Definition at line 86 of file matrix.hpp.
|
inline |
Compute the inverse of a 3x3 matrix.
| input | The input matrix to invert. |
| output | The 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 373 of file matrix_op.hpp.
|
inline |
compute the L1 norm of a given matrix
| input | The input matrix |
| res | The 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 416 of file matrix_op.hpp.
|
inline |
Multiply a matrix by a scalar value.
| input | The matrix to multiply |
| scalar | The 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 134 of file matrix_op.hpp.
|
inline |
Add two matrices element-wise.
| input1 | The first input matrix. |
| input2 | The second input matrix. |
| output | The 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 187 of file matrix_op.hpp.
|
inline |
Add a matrix to another matrix element-wise and store the result in the first matrix.
| inout | The matrix to be updated with the element-wise addition result. |
| matb | The 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 222 of file matrix_op.hpp.
|
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.
| inout | a matrix -> A |
| beta | a scalar |
Definition at line 632 of file matrix_op.hpp.
|
inline |
Compute the product of two matrices.
| input1 | The first input matrix. |
| input2 | The second input matrix. |
| output | The 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:
Definition at line 338 of file matrix_op.hpp.
|
inline |
Definition at line 53 of file matrix_legacy.hpp.
|
inline |
Set the content of a matrix to the identity matrix.
| input1 | The matrix to set to the identity matrix |
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 115 of file matrix_op.hpp.
|
inline |
Set the content of a matrix to zero.
| input | The matrix to set to the nul matrix |
Definition at line 433 of file matrix_op.hpp.
|
inline |
Set the elements of a matrix according to a user-provided function.
| input | The matrix to set the elements of |
| func | The 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 45 of file matrix_op.hpp.
|
inline |
Subtract two matrices element-wise.
| input1 | The first input matrix. |
| input2 | The second input matrix. |
| output | The 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 258 of file matrix_op.hpp.
|
inline |
Subtract a matrix from another matrix element-wise and store the result in the first matrix.
| inout | The matrix to be updated with the element-wise subtraction result. |
| matb | The 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 294 of file matrix_op.hpp.
|
inline |
This function transposes a matrix.
| input | matrix to transpose |
| output | matrix to store the transposed matrix |
Definition at line 691 of file matrix_op.hpp.
|
inline |
Update the elements of a matrix according to a user-provided function.
| input | The matrix to update the elements of |
| func | The 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 91 of file matrix_op.hpp.
|
inline |
Definition at line 66 of file slopeLimiter.hpp.
| float shammath::newton_rhaphson | ( | std::function< T(T)> && | f, |
| std::function< T(T)> && | df, | ||
| T | epsilon_c, | ||
| T | x_0 ) |
| const ConsState< Tvec > shammath::operator* | ( | const ConsState< Tvec > & | lhs, |
| const typename ConsState< Tvec >::Tscal | factor ) |
Definition at line 190 of file riemann_common.hpp.
| const DustConsState< Tvec > shammath::operator* | ( | const DustConsState< Tvec > & | lhs, |
| const typename DustConsState< Tvec >::Tscal | factor ) |
Definition at line 439 of file riemann_common.hpp.
| T shammath::operator* | ( | const SymTensor3d_1< T > & | a, |
| const SymTensor3d_1< T > & | b ) |
Definition at line 994 of file symtensors.hpp.
| SymTensor3d_1< T > shammath::operator* | ( | const SymTensor3d_1< T > & | a, |
| const SymTensor3d_2< T > & | b ) |
Definition at line 982 of file symtensors.hpp.
| SymTensor3d_2< T > shammath::operator* | ( | const SymTensor3d_1< T > & | a, |
| const SymTensor3d_3< T > & | b ) |
Definition at line 961 of file symtensors.hpp.
|
inline |
Definition at line 928 of file symtensors.hpp.
|
inline |
Definition at line 882 of file symtensors.hpp.
| SymTensor3d_1< T > shammath::operator* | ( | const SymTensor3d_2< T > & | a, |
| const SymTensor3d_1< T > & | b ) |
Definition at line 977 of file symtensors.hpp.
| T shammath::operator* | ( | const SymTensor3d_2< T > & | a, |
| const SymTensor3d_2< T > & | b ) |
Definition at line 972 of file symtensors.hpp.
| SymTensor3d_1< T > shammath::operator* | ( | const SymTensor3d_2< T > & | a, |
| const SymTensor3d_3< T > & | b ) |
Definition at line 957 of file symtensors.hpp.
|
inline |
Definition at line 933 of file symtensors.hpp.
|
inline |
Definition at line 887 of file symtensors.hpp.
| SymTensor3d_2< T > shammath::operator* | ( | const SymTensor3d_3< T > & | a, |
| const SymTensor3d_1< T > & | b ) |
Definition at line 952 of file symtensors.hpp.
| SymTensor3d_1< T > shammath::operator* | ( | const SymTensor3d_3< T > & | a, |
| const SymTensor3d_2< T > & | b ) |
Definition at line 948 of file symtensors.hpp.
| T shammath::operator* | ( | const SymTensor3d_3< T > & | a, |
| const SymTensor3d_3< T > & | b ) |
Definition at line 944 of file symtensors.hpp.
|
inline |
Definition at line 938 of file symtensors.hpp.
|
inline |
Definition at line 892 of file symtensors.hpp.
| SymTensor3d_3< T > shammath::operator* | ( | const SymTensor3d_4< T > & | a, |
| const SymTensor3d_1< T > & | b ) |
Definition at line 918 of file symtensors.hpp.
| SymTensor3d_2< T > shammath::operator* | ( | const SymTensor3d_4< T > & | a, |
| const SymTensor3d_2< T > & | b ) |
Definition at line 913 of file symtensors.hpp.
| SymTensor3d_1< T > shammath::operator* | ( | const SymTensor3d_4< T > & | a, |
| const SymTensor3d_3< T > & | b ) |
Definition at line 908 of file symtensors.hpp.
| T shammath::operator* | ( | const SymTensor3d_4< T > & | a, |
| const SymTensor3d_4< T > & | b ) |
Definition at line 903 of file symtensors.hpp.
|
inline |
Definition at line 897 of file symtensors.hpp.
| SymTensor3d_4< T > shammath::operator* | ( | const SymTensor3d_5< T > & | a, |
| const SymTensor3d_1< T > & | b ) |
Definition at line 872 of file symtensors.hpp.
| SymTensor3d_3< T > shammath::operator* | ( | const SymTensor3d_5< T > & | a, |
| const SymTensor3d_2< T > & | b ) |
Definition at line 867 of file symtensors.hpp.
| SymTensor3d_2< T > shammath::operator* | ( | const SymTensor3d_5< T > & | a, |
| const SymTensor3d_3< T > & | b ) |
Definition at line 862 of file symtensors.hpp.
| SymTensor3d_1< T > shammath::operator* | ( | const SymTensor3d_5< T > & | a, |
| const SymTensor3d_4< T > & | b ) |
Definition at line 857 of file symtensors.hpp.
| T shammath::operator* | ( | const SymTensor3d_5< T > & | a, |
| const SymTensor3d_5< T > & | b ) |
Definition at line 852 of file symtensors.hpp.
| SymTensor3d_1< T > shammath::operator* | ( | const T & | a, |
| const SymTensor3d_1< T > & | b ) |
Definition at line 999 of file symtensors.hpp.
| SymTensor3d_2< T > shammath::operator* | ( | const T & | a, |
| const SymTensor3d_2< T > & | b ) |
Definition at line 987 of file symtensors.hpp.
| SymTensor3d_3< T > shammath::operator* | ( | const T & | a, |
| const SymTensor3d_3< T > & | b ) |
Definition at line 965 of file symtensors.hpp.
| SymTensor3d_4< T > shammath::operator* | ( | const T & | a, |
| const SymTensor3d_4< T > & | b ) |
Definition at line 923 of file symtensors.hpp.
| SymTensor3d_5< T > shammath::operator* | ( | const T & | a, |
| const SymTensor3d_5< T > & | b ) |
Definition at line 877 of file symtensors.hpp.
| const ConsState< Tvec > shammath::operator* | ( | const typename ConsState< Tvec >::Tscal | factor, |
| const ConsState< Tvec > & | rhs ) |
Definition at line 184 of file riemann_common.hpp.
| const DustConsState< Tvec > shammath::operator* | ( | const typename DustConsState< Tvec >::Tscal | factor, |
| const DustConsState< Tvec > & | rhs ) |
Definition at line 445 of file riemann_common.hpp.
| const ConsState< Tvec > shammath::operator+ | ( | const ConsState< Tvec > & | lhs, |
| const ConsState< Tvec > & | rhs ) |
Definition at line 157 of file riemann_common.hpp.
| const DustConsState< Tvec > shammath::operator+ | ( | const DustConsState< Tvec > & | lhs, |
| const DustConsState< Tvec > & | rhs ) |
Definition at line 412 of file riemann_common.hpp.
| const ConsState< Tvec > shammath::operator- | ( | const ConsState< Tvec > & | lhs, |
| const ConsState< Tvec > & | rhs ) |
Definition at line 170 of file riemann_common.hpp.
| const DustConsState< Tvec > shammath::operator- | ( | const DustConsState< Tvec > & | lhs, |
| const DustConsState< Tvec > & | rhs ) |
Definition at line 425 of file riemann_common.hpp.
|
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)
| K | maximum number of matrix product allow |
| seq_mk | precomputed set of Polynomial order |
| seq_theta_mk | precomputed set of parameters |
| A | the matrix |
| size_A | the matrix A size |
| k_star | the optimal number of matrix product during the taylor evaluation step |
| m_star | the Taylor's polynomial order |
| s_star | the optimal scaling factor |
Definition at line 178 of file matrix_exponential.hpp.
|
inlineconstexpr |
Definition at line 373 of file riemann_common.hpp.
|
inlineconstexpr |
Definition at line 212 of file riemann_common.hpp.
|
inlineconstexpr |
Definition at line 351 of file riemann_common.hpp.
|
inlineconstexpr |
Definition at line 362 of file riemann_common.hpp.
|
inlineconstexpr |
Definition at line 204 of file riemann_common.hpp.
|
inlineconstexpr |
Rusanov flux across a face with unit normal n.
Definition at line 29 of file riemann_rusanov.hpp.
|
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.
|
inlineconstexpr |
precomputed optimal sequence based on backward error analysis
Definition at line 111 of file matrix_exponential.hpp.
|
inlineconstexpr |
precomputed optimal Paterson-Stockmeyer intergers (it's used to compute the matrix power)
Definition at line 60 of file matrix_exponential.hpp.
|
inlineconstexpr |
precomputed optimal Paterson-Stockmeyer polynomial degrees
Definition at line 77 of file matrix_exponential.hpp.
|
inlineconstexpr |
precomputed optimal sequence based on backward error analysis
Definition at line 94 of file matrix_exponential.hpp.
|
inlineconstexpr |
Definition at line 286 of file riemann_common.hpp.
|
inline |
This function compute the Taylor polynomial up to order m_star.
| q | Paterson-Stockmeyer interger (it's used to compute the matrix power) |
| r | Paterson-Stockmeyer polynomial degree |
| bi_seq | sequence of coef needed for Paterson-Stockmeyer coefficient B_k |
| size | size of matrices |
| A | input matrix |
| F | output matrix |
| B,I,Id | matrices for intermediate computations |
Definition at line 274 of file matrix_exponential.hpp.
| void shammath::throw_ill_formed | ( | T | lower, |
| T | upper, | ||
| SourceLocation | call, | ||
| SourceLocation | loc = SourceLocation{} ) |
Definition at line 25 of file CoordRange.cpp.
|
inline |
Van leer slope limiter.
\[ \\phi(f,g) = \frac{f g + \vert f g \vert}{f + g + \epsilon} \]
| T |
| f | |
| g |
Definition at line 40 of file slopeLimiter.hpp.
|
inline |
Definition at line 50 of file slopeLimiter.hpp.
|
inline |
This function compute y = alpha*x + y with x,y both vectors.
| alpha | a scalar -> |
| input | a vector ->x |
| output | a vector ->y |
Definition at line 514 of file matrix_op.hpp.
|
inline |
This function compute y = alpha*x + beta*y with x,y both vectors.
| alpha | a scalar -> |
| input | a vector ->x |
| beta | a scalar |
| output | a vector ->y |
Definition at line 485 of file matrix_op.hpp.
|
inline |
Copy the content of one vector in another.
| input | the source vector |
| output | the destination vector |
Definition at line 458 of file matrix_op.hpp.
|
inline |
Set the content of a vector to zero.
| input | the vector to set to zero |
Definition at line 445 of file matrix_op.hpp.
|
inline |
Set the elements of a vector according to a user-provided function.
| input | The vector to update the elements of |
| func | The function to use to update the elements of the matrix. The function must take one argument being the index. |
The function func is called for each element of the vector, and the value returned by the function is used to set the corresponding element of the vector.
Definition at line 68 of file matrix_op.hpp.
|
inlineconstexpr |
Definition at line 303 of file riemann_common.hpp.
|
inlineconstexpr |
Definition at line 325 of file riemann_common.hpp.
|
inlineconstexpr |
Definition at line 292 of file riemann_common.hpp.
|
inlineconstexpr |
Definition at line 314 of file riemann_common.hpp.