Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
shammodels::gsph::SolverConfig< Tvec, SPHKernel > Struct Template Reference

The configuration for a GSPH solver. More...

+ Collaboration diagram for shammodels::gsph::SolverConfig< Tvec, SPHKernel >:

Public Types

using Tscal = shambase::VecComponent< Tvec >
 
using Kernel = SPHKernel< Tscal >
 
using u_morton = u32
 
using RTree = shamtree::CompressedLeafBVH< u_morton, Tvec, 3 >
 
using SolverStatusVar = SolverStatusVar< Tvec >
 
using RiemannConfig = RiemannConfig< Tvec >
 
using ReconstructConfig = ReconstructConfig< Tvec >
 
using EOSConfig = shammodels::EOSConfig< Tvec >
 
using BCConfig = shammodels::sph::BCConfig< Tvec >
 
using ExtForceConfig = shammodels::ExtForceConfig< Tvec >
 

Public Member Functions

void set_units (shamunits::UnitSystem< Tscal > new_sys)
 
Tscal get_constant_G () const
 
void set_time (Tscal t)
 
void set_next_dt (Tscal dt)
 
Tscal get_time () const
 
Tscal get_dt () const
 
void set_riemann_iterative (Tscal tol=Tscal{1e-6}, u32 max_iter=20)
 
void set_riemann_hllc ()
 
void set_reconstruct_piecewise_constant ()
 
void set_reconstruct_muscl (typename ReconstructConfig::Limiter limiter=ReconstructConfig::Limiter::VanLeer)
 
bool requires_gradients () const
 
bool is_eos_adiabatic () const
 
bool is_eos_isothermal () const
 
Tscal get_eos_gamma () const
 Get the adiabatic index (gamma) from the EOS config.
 
void set_eos_adiabatic (Tscal gamma)
 
void set_eos_isothermal (Tscal cs)
 
void set_boundary_free ()
 
void set_boundary_periodic ()
 
void set_boundary_shearing_periodic (i32_3 shear_base, i32_3 shear_dir, Tscal speed)
 Set shearing periodic boundary conditions.
 
void add_ext_force_point_mass (Tscal central_mass, Tscal Racc)
 
void set_tree_reduction_level (u32 level)
 
void set_two_stage_search (bool enable)
 
bool has_field_uint () const
 
void print_status ()
 
void check_config () const
 
void check_config_runtime () const
 
void set_layout (shamrock::patch::PatchDataLayerLayout &pdl)
 
void set_ghost_layout (shamrock::patch::PatchDataLayerLayout &ghost_layout)
 

Public Attributes

Tscal gpart_mass {0}
 The mass of each gas particle (must be set before use)
 
CFLConfig< Tscal > cfl_config
 CFL configuration.
 
PatchSchedulerConfig scheduler_conf = {}
 
std::optional< shamunits::UnitSystem< Tscal > > unit_sys = {}
 
SolverStatusVar time_state
 
RiemannConfig riemann_config
 
ReconstructConfig reconstruct_config
 
EOSConfig eos_config
 
BCConfig boundary_config
 
ExtForceConfig ext_force_config {}
 
u32 tree_reduction_level = 3
 
bool use_two_stage_search = true
 
Tscal htol_up_coarse_cycle = 1.1
 Factor for neighbors search.
 
Tscal htol_up_fine_cycle = 1.1
 Max smoothing length evolution per subcycle.
 
Tscal epsilon_h = 1e-6
 Convergence criteria for smoothing length.
 
u32 h_iter_per_subcycles = 50
 Max iterations per subcycle.
 
u32 h_max_subcycles_count = 100
 Max subcycles before crash.
 

Static Public Attributes

static constexpr u32 dim = shambase::VectorProperties<Tvec>::dimension
 
static constexpr Tscal Rkern = Kernel::Rkern
 

Detailed Description

template<class Tvec, template< class > class SPHKernel>
struct shammodels::gsph::SolverConfig< Tvec, SPHKernel >

The configuration for a GSPH solver.

Template Parameters
Tvecthe type of the vector used to represent the particles
SPHKernelthe type of the SPH kernel

Definition at line 96 of file SolverConfig.hpp.

Member Typedef Documentation

◆ BCConfig

template<class Tvec , template< class > class SPHKernel>
using shammodels::gsph::SolverConfig< Tvec, SPHKernel >::BCConfig = shammodels::sph::BCConfig<Tvec>

Definition at line 235 of file SolverConfig.hpp.

◆ EOSConfig

template<class Tvec , template< class > class SPHKernel>
using shammodels::gsph::SolverConfig< Tvec, SPHKernel >::EOSConfig = shammodels::EOSConfig<Tvec>

Definition at line 194 of file SolverConfig.hpp.

◆ ExtForceConfig

template<class Tvec , template< class > class SPHKernel>
using shammodels::gsph::SolverConfig< Tvec, SPHKernel >::ExtForceConfig = shammodels::ExtForceConfig<Tvec>

Definition at line 263 of file SolverConfig.hpp.

◆ Kernel

template<class Tvec , template< class > class SPHKernel>
using shammodels::gsph::SolverConfig< Tvec, SPHKernel >::Kernel = SPHKernel<Tscal>

Definition at line 100 of file SolverConfig.hpp.

◆ ReconstructConfig

template<class Tvec , template< class > class SPHKernel>
using shammodels::gsph::SolverConfig< Tvec, SPHKernel >::ReconstructConfig = ReconstructConfig<Tvec>

Definition at line 172 of file SolverConfig.hpp.

◆ RiemannConfig

template<class Tvec , template< class > class SPHKernel>
using shammodels::gsph::SolverConfig< Tvec, SPHKernel >::RiemannConfig = RiemannConfig<Tvec>

Definition at line 155 of file SolverConfig.hpp.

◆ RTree

template<class Tvec , template< class > class SPHKernel>
using shammodels::gsph::SolverConfig< Tvec, SPHKernel >::RTree = shamtree::CompressedLeafBVH<u_morton, Tvec, 3>

Definition at line 103 of file SolverConfig.hpp.

◆ SolverStatusVar

template<class Tvec , template< class > class SPHKernel>
using shammodels::gsph::SolverConfig< Tvec, SPHKernel >::SolverStatusVar = SolverStatusVar<Tvec>

Definition at line 139 of file SolverConfig.hpp.

◆ Tscal

template<class Tvec , template< class > class SPHKernel>
using shammodels::gsph::SolverConfig< Tvec, SPHKernel >::Tscal = shambase::VecComponent<Tvec>

Definition at line 98 of file SolverConfig.hpp.

◆ u_morton

template<class Tvec , template< class > class SPHKernel>
using shammodels::gsph::SolverConfig< Tvec, SPHKernel >::u_morton = u32

Definition at line 101 of file SolverConfig.hpp.

Member Function Documentation

◆ add_ext_force_point_mass()

template<class Tvec , template< class > class SPHKernel>
void shammodels::gsph::SolverConfig< Tvec, SPHKernel >::add_ext_force_point_mass ( Tscal  central_mass,
Tscal  Racc 
)
inline

Definition at line 266 of file SolverConfig.hpp.

◆ check_config()

template<class Tvec , template< class > class SPHKernel>
void shammodels::gsph::SolverConfig< Tvec, SPHKernel >::check_config ( ) const
inline

Definition at line 316 of file SolverConfig.hpp.

◆ check_config_runtime()

template<class Tvec , template< class > class SPHKernel>
void shammodels::gsph::SolverConfig< Tvec, SPHKernel >::check_config_runtime ( ) const
inline

Definition at line 324 of file SolverConfig.hpp.

◆ get_constant_G()

template<class Tvec , template< class > class SPHKernel>
Tscal shammodels::gsph::SolverConfig< Tvec, SPHKernel >::get_constant_G ( ) const
inline

Definition at line 121 of file SolverConfig.hpp.

◆ get_dt()

template<class Tvec , template< class > class SPHKernel>
Tscal shammodels::gsph::SolverConfig< Tvec, SPHKernel >::get_dt ( ) const
inline

Definition at line 145 of file SolverConfig.hpp.

◆ get_eos_gamma()

template<class Tvec , template< class > class SPHKernel>
Tscal shammodels::gsph::SolverConfig< Tvec, SPHKernel >::get_eos_gamma ( ) const
inline

Get the adiabatic index (gamma) from the EOS config.

Returns
The adiabatic index from Adiabatic or Polytropic EOS, or 1.4 as default

Definition at line 212 of file SolverConfig.hpp.

◆ get_time()

template<class Tvec , template< class > class SPHKernel>
Tscal shammodels::gsph::SolverConfig< Tvec, SPHKernel >::get_time ( ) const
inline

Definition at line 144 of file SolverConfig.hpp.

◆ has_field_uint()

template<class Tvec , template< class > class SPHKernel>
bool shammodels::gsph::SolverConfig< Tvec, SPHKernel >::has_field_uint ( ) const
inline

Definition at line 302 of file SolverConfig.hpp.

◆ is_eos_adiabatic()

template<class Tvec , template< class > class SPHKernel>
bool shammodels::gsph::SolverConfig< Tvec, SPHKernel >::is_eos_adiabatic ( ) const
inline

Definition at line 197 of file SolverConfig.hpp.

◆ is_eos_isothermal()

template<class Tvec , template< class > class SPHKernel>
bool shammodels::gsph::SolverConfig< Tvec, SPHKernel >::is_eos_isothermal ( ) const
inline

Definition at line 202 of file SolverConfig.hpp.

◆ print_status()

template<class Tvec , template< class > class SPHKernel>
void shammodels::gsph::SolverConfig< Tvec, SPHKernel >::print_status ( )
inline

Definition at line 304 of file SolverConfig.hpp.

◆ requires_gradients()

template<class Tvec , template< class > class SPHKernel>
bool shammodels::gsph::SolverConfig< Tvec, SPHKernel >::requires_gradients ( ) const
inline

Definition at line 184 of file SolverConfig.hpp.

◆ set_boundary_free()

template<class Tvec , template< class > class SPHKernel>
void shammodels::gsph::SolverConfig< Tvec, SPHKernel >::set_boundary_free ( )
inline

Definition at line 238 of file SolverConfig.hpp.

◆ set_boundary_periodic()

template<class Tvec , template< class > class SPHKernel>
void shammodels::gsph::SolverConfig< Tvec, SPHKernel >::set_boundary_periodic ( )
inline

Definition at line 239 of file SolverConfig.hpp.

◆ set_boundary_shearing_periodic()

template<class Tvec , template< class > class SPHKernel>
void shammodels::gsph::SolverConfig< Tvec, SPHKernel >::set_boundary_shearing_periodic ( i32_3  shear_base,
i32_3  shear_dir,
Tscal  speed 
)
inline

Set shearing periodic boundary conditions.

Implements shearing box boundaries (Stone 2010) for simulations of differentially rotating systems (e.g., accretion disks).

Parameters
shear_baseBase vector for shear periodicity count
shear_dirDirection of the shear velocity shift
speedShear velocity magnitude

Definition at line 251 of file SolverConfig.hpp.

◆ set_eos_adiabatic()

template<class Tvec , template< class > class SPHKernel>
void shammodels::gsph::SolverConfig< Tvec, SPHKernel >::set_eos_adiabatic ( Tscal  gamma)
inline

Definition at line 223 of file SolverConfig.hpp.

◆ set_eos_isothermal()

template<class Tvec , template< class > class SPHKernel>
void shammodels::gsph::SolverConfig< Tvec, SPHKernel >::set_eos_isothermal ( Tscal  cs)
inline

Definition at line 225 of file SolverConfig.hpp.

◆ set_ghost_layout()

template<class Tvec , template< class > class SPHKernel>
void shammodels::gsph::SolverConfig< Tvec, SPHKernel >::set_ghost_layout ( shamrock::patch::PatchDataLayerLayout ghost_layout)

Definition at line 52 of file SolverConfig.cpp.

◆ set_layout()

template<class Tvec , template< class > class SPHKernel>
void shammodels::gsph::SolverConfig< Tvec, SPHKernel >::set_layout ( shamrock::patch::PatchDataLayerLayout pdl)

Definition at line 23 of file SolverConfig.cpp.

◆ set_next_dt()

template<class Tvec , template< class > class SPHKernel>
void shammodels::gsph::SolverConfig< Tvec, SPHKernel >::set_next_dt ( Tscal  dt)
inline

Definition at line 143 of file SolverConfig.hpp.

◆ set_reconstruct_muscl()

template<class Tvec , template< class > class SPHKernel>
void shammodels::gsph::SolverConfig< Tvec, SPHKernel >::set_reconstruct_muscl ( typename ReconstructConfig::Limiter  limiter = ReconstructConfig::Limiter::VanLeer)
inline

Definition at line 179 of file SolverConfig.hpp.

◆ set_reconstruct_piecewise_constant()

template<class Tvec , template< class > class SPHKernel>
void shammodels::gsph::SolverConfig< Tvec, SPHKernel >::set_reconstruct_piecewise_constant ( )
inline

Definition at line 175 of file SolverConfig.hpp.

◆ set_riemann_hllc()

template<class Tvec , template< class > class SPHKernel>
void shammodels::gsph::SolverConfig< Tvec, SPHKernel >::set_riemann_hllc ( )
inline

Definition at line 162 of file SolverConfig.hpp.

◆ set_riemann_iterative()

template<class Tvec , template< class > class SPHKernel>
void shammodels::gsph::SolverConfig< Tvec, SPHKernel >::set_riemann_iterative ( Tscal  tol = Tscal{1e-6},
u32  max_iter = 20 
)
inline

Definition at line 158 of file SolverConfig.hpp.

◆ set_time()

template<class Tvec , template< class > class SPHKernel>
void shammodels::gsph::SolverConfig< Tvec, SPHKernel >::set_time ( Tscal  t)
inline

Definition at line 142 of file SolverConfig.hpp.

◆ set_tree_reduction_level()

template<class Tvec , template< class > class SPHKernel>
void shammodels::gsph::SolverConfig< Tvec, SPHKernel >::set_tree_reduction_level ( u32  level)
inline

Definition at line 281 of file SolverConfig.hpp.

◆ set_two_stage_search()

template<class Tvec , template< class > class SPHKernel>
void shammodels::gsph::SolverConfig< Tvec, SPHKernel >::set_two_stage_search ( bool  enable)
inline

Definition at line 282 of file SolverConfig.hpp.

◆ set_units()

template<class Tvec , template< class > class SPHKernel>
void shammodels::gsph::SolverConfig< Tvec, SPHKernel >::set_units ( shamunits::UnitSystem< Tscal >  new_sys)
inline

Definition at line 119 of file SolverConfig.hpp.

Member Data Documentation

◆ boundary_config

template<class Tvec , template< class > class SPHKernel>
BCConfig shammodels::gsph::SolverConfig< Tvec, SPHKernel >::boundary_config

Definition at line 236 of file SolverConfig.hpp.

◆ cfl_config

template<class Tvec , template< class > class SPHKernel>
CFLConfig<Tscal> shammodels::gsph::SolverConfig< Tvec, SPHKernel >::cfl_config

CFL configuration.

Definition at line 109 of file SolverConfig.hpp.

◆ dim

template<class Tvec , template< class > class SPHKernel>
constexpr u32 shammodels::gsph::SolverConfig< Tvec, SPHKernel >::dim = shambase::VectorProperties<Tvec>::dimension
staticconstexpr

Definition at line 99 of file SolverConfig.hpp.

◆ eos_config

template<class Tvec , template< class > class SPHKernel>
EOSConfig shammodels::gsph::SolverConfig< Tvec, SPHKernel >::eos_config

Definition at line 195 of file SolverConfig.hpp.

◆ epsilon_h

template<class Tvec , template< class > class SPHKernel>
Tscal shammodels::gsph::SolverConfig< Tvec, SPHKernel >::epsilon_h = 1e-6

Convergence criteria for smoothing length.

Definition at line 294 of file SolverConfig.hpp.

◆ ext_force_config

template<class Tvec , template< class > class SPHKernel>
ExtForceConfig shammodels::gsph::SolverConfig< Tvec, SPHKernel >::ext_force_config {}

Definition at line 264 of file SolverConfig.hpp.

◆ gpart_mass

template<class Tvec , template< class > class SPHKernel>
Tscal shammodels::gsph::SolverConfig< Tvec, SPHKernel >::gpart_mass {0}

The mass of each gas particle (must be set before use)

Definition at line 107 of file SolverConfig.hpp.

◆ h_iter_per_subcycles

template<class Tvec , template< class > class SPHKernel>
u32 shammodels::gsph::SolverConfig< Tvec, SPHKernel >::h_iter_per_subcycles = 50

Max iterations per subcycle.

Definition at line 295 of file SolverConfig.hpp.

◆ h_max_subcycles_count

template<class Tvec , template< class > class SPHKernel>
u32 shammodels::gsph::SolverConfig< Tvec, SPHKernel >::h_max_subcycles_count = 100

Max subcycles before crash.

Definition at line 296 of file SolverConfig.hpp.

◆ htol_up_coarse_cycle

template<class Tvec , template< class > class SPHKernel>
Tscal shammodels::gsph::SolverConfig< Tvec, SPHKernel >::htol_up_coarse_cycle = 1.1

Factor for neighbors search.

Definition at line 292 of file SolverConfig.hpp.

◆ htol_up_fine_cycle

template<class Tvec , template< class > class SPHKernel>
Tscal shammodels::gsph::SolverConfig< Tvec, SPHKernel >::htol_up_fine_cycle = 1.1

Max smoothing length evolution per subcycle.

Definition at line 293 of file SolverConfig.hpp.

◆ reconstruct_config

template<class Tvec , template< class > class SPHKernel>
ReconstructConfig shammodels::gsph::SolverConfig< Tvec, SPHKernel >::reconstruct_config

Definition at line 173 of file SolverConfig.hpp.

◆ riemann_config

template<class Tvec , template< class > class SPHKernel>
RiemannConfig shammodels::gsph::SolverConfig< Tvec, SPHKernel >::riemann_config

Definition at line 156 of file SolverConfig.hpp.

◆ Rkern

template<class Tvec , template< class > class SPHKernel>
constexpr Tscal shammodels::gsph::SolverConfig< Tvec, SPHKernel >::Rkern = Kernel::Rkern
staticconstexpr

Definition at line 105 of file SolverConfig.hpp.

◆ scheduler_conf

template<class Tvec , template< class > class SPHKernel>
PatchSchedulerConfig shammodels::gsph::SolverConfig< Tvec, SPHKernel >::scheduler_conf = {}

Definition at line 111 of file SolverConfig.hpp.

◆ time_state

template<class Tvec , template< class > class SPHKernel>
SolverStatusVar shammodels::gsph::SolverConfig< Tvec, SPHKernel >::time_state

Definition at line 140 of file SolverConfig.hpp.

◆ tree_reduction_level

template<class Tvec , template< class > class SPHKernel>
u32 shammodels::gsph::SolverConfig< Tvec, SPHKernel >::tree_reduction_level = 3

Definition at line 278 of file SolverConfig.hpp.

◆ unit_sys

template<class Tvec , template< class > class SPHKernel>
std::optional<shamunits::UnitSystem<Tscal> > shammodels::gsph::SolverConfig< Tvec, SPHKernel >::unit_sys = {}

Definition at line 117 of file SolverConfig.hpp.

◆ use_two_stage_search

template<class Tvec , template< class > class SPHKernel>
bool shammodels::gsph::SolverConfig< Tvec, SPHKernel >::use_two_stage_search = true

Definition at line 279 of file SolverConfig.hpp.


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