Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
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 RiemannConfig = RiemannConfig<Tvec>
using ReconstructConfig = ReconstructConfig<Tvec>
using ForceFormulationConfig = ForceFormulationConfig<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_riemann_iterative (Tscal tol=Tscal{1e-6}, u32 max_iter=20)
void set_riemann_hllc ()
void set_riemann_exact (Tscal tol=Tscal{1e-8}, u32 max_iter=100)
void set_reconstruct_piecewise_constant ()
void set_reconstruct_muscl (typename ReconstructConfig::Limiter limiter=ReconstructConfig::Limiter::VanLeer)
bool requires_gradients () const
void set_force_cha_whitworth ()
void set_force_inutsuka_v2 ()
bool is_force_inutsuka_v2 () 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, Tvec central_pos=Tvec{})
void set_tree_reduction_level (u32 level)
void set_neigh_cache_strategy (NeighCacheStrategy strategy)
 Setter for the neighbours cache strategy.
void set_two_stage_search (bool enable)
 Setter for the two stage search.
void set_smoothing_length_density_based ()
void set_smoothing_length_density_based_neigh_lim (u32 max_neigh_count)
void set_enable_particle_reordering (bool enable)
void set_particle_reordering_step_freq (u64 freq)
void set_save_dt_to_fields (bool enable)
bool should_save_dt_to_fields () const
void set_show_ghost_zone_graph (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 = {}
RiemannConfig riemann_config
ReconstructConfig reconstruct_config
ForceFormulationConfig force_formulation_config
EOSConfig eos_config
BCConfig boundary_config
ExtForceConfig ext_force_config {}
u32 tree_reduction_level = 3
NeighCacheStrategy neigh_cache_strategy = NeighCacheStrategy::TwoStage
bool combined_dtdiv_divcurlv_compute = false
Tscal htol_up_coarse_cycle = 1.1
Tscal htol_up_fine_cycle = 1.1
 Maximum factor of the smoothing length evolution per subcycles.
Tscal epsilon_h = 1e-6
 Convergence criteria for the smoothing length.
u32 h_iter_per_subcycles = 50
 Maximum number of iterations per subcycle.
u32 h_max_subcycles_count = 100
 Maximum number of subcycles before solver crash.
SmoothingLengthConfig smoothing_length_config
bool enable_particle_reordering = false
u64 particle_reordering_step_freq = 1000
bool save_dt_to_fields = false
bool show_ghost_zone_graph = false

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 102 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 246 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 205 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 274 of file SolverConfig.hpp.

◆ ForceFormulationConfig

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

Definition at line 188 of file SolverConfig.hpp.

◆ Kernel

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

Definition at line 106 of file SolverConfig.hpp.

◆ ReconstructConfig

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

Definition at line 166 of file SolverConfig.hpp.

◆ RiemannConfig

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

Definition at line 145 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 109 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 104 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 107 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,
Tvec central_pos = Tvec{} )
inline

Definition at line 277 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 381 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 397 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 127 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 223 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 366 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 208 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 213 of file SolverConfig.hpp.

◆ is_force_inutsuka_v2()

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

Definition at line 195 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 368 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 178 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 249 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 250 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 262 of file SolverConfig.hpp.

◆ set_enable_particle_reordering()

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

Definition at line 345 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 234 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 236 of file SolverConfig.hpp.

◆ set_force_cha_whitworth()

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

Definition at line 191 of file SolverConfig.hpp.

◆ set_force_inutsuka_v2()

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

Definition at line 193 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_neigh_cache_strategy()

template<class Tvec, template< class > class SPHKernel>
void shammodels::gsph::SolverConfig< Tvec, SPHKernel >::set_neigh_cache_strategy ( NeighCacheStrategy strategy)
inline

Setter for the neighbours cache strategy.

Definition at line 300 of file SolverConfig.hpp.

◆ set_particle_reordering_step_freq()

template<class Tvec, template< class > class SPHKernel>
void shammodels::gsph::SolverConfig< Tvec, SPHKernel >::set_particle_reordering_step_freq ( u64 freq)
inline

Definition at line 347 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 173 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 169 of file SolverConfig.hpp.

◆ set_riemann_exact()

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

Definition at line 154 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 152 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 148 of file SolverConfig.hpp.

◆ set_save_dt_to_fields()

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

Definition at line 356 of file SolverConfig.hpp.

◆ set_show_ghost_zone_graph()

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

Definition at line 360 of file SolverConfig.hpp.

◆ set_smoothing_length_density_based()

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

Definition at line 337 of file SolverConfig.hpp.

◆ set_smoothing_length_density_based_neigh_lim()

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

Definition at line 340 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 297 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

Setter for the two stage search.

Deprecated
Use set_neigh_cache_strategy instead

Definition at line 308 of file SolverConfig.hpp.

Here is the call graph for this function:

◆ 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 125 of file SolverConfig.hpp.

◆ should_save_dt_to_fields()

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

Definition at line 357 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 247 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 115 of file SolverConfig.hpp.

◆ combined_dtdiv_divcurlv_compute

template<class Tvec, template< class > class SPHKernel>
bool shammodels::gsph::SolverConfig< Tvec, SPHKernel >::combined_dtdiv_divcurlv_compute = false

Use the combined dtdivv and divcurlv compute

Definition at line 325 of file SolverConfig.hpp.

◆ dim

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

Definition at line 105 of file SolverConfig.hpp.

◆ enable_particle_reordering

template<class Tvec, template< class > class SPHKernel>
bool shammodels::gsph::SolverConfig< Tvec, SPHKernel >::enable_particle_reordering = false

Definition at line 344 of file SolverConfig.hpp.

◆ eos_config

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

Definition at line 206 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 the smoothing length.

Definition at line 331 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 275 of file SolverConfig.hpp.

◆ force_formulation_config

template<class Tvec, template< class > class SPHKernel>
ForceFormulationConfig shammodels::gsph::SolverConfig< Tvec, SPHKernel >::force_formulation_config

Definition at line 189 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 113 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

Maximum number of iterations per subcycle.

Definition at line 332 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

Maximum number of subcycles before solver crash.

Definition at line 333 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 applied to the smoothing length for neighbors search (and ghost zone size)

Note
This value must be larger or equal to htol_up_fine_cycle Factor for neighbors search

Definition at line 328 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

Maximum factor of the smoothing length evolution per subcycles.

Definition at line 330 of file SolverConfig.hpp.

◆ neigh_cache_strategy

template<class Tvec, template< class > class SPHKernel>
NeighCacheStrategy shammodels::gsph::SolverConfig< Tvec, SPHKernel >::neigh_cache_strategy = NeighCacheStrategy::TwoStage

Strategy used to build the neighbours cache out of the tree traversal

Note
The GSPH solver only implements the single stage traversal for now, this is carried in the config (and dumped to json) for parity with the SPH solver.

Definition at line 295 of file SolverConfig.hpp.

◆ particle_reordering_step_freq

template<class Tvec, template< class > class SPHKernel>
u64 shammodels::gsph::SolverConfig< Tvec, SPHKernel >::particle_reordering_step_freq = 1000

Definition at line 346 of file SolverConfig.hpp.

◆ reconstruct_config

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

Definition at line 167 of file SolverConfig.hpp.

◆ riemann_config

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

Definition at line 146 of file SolverConfig.hpp.

◆ Rkern

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

Definition at line 111 of file SolverConfig.hpp.

◆ save_dt_to_fields

template<class Tvec, template< class > class SPHKernel>
bool shammodels::gsph::SolverConfig< Tvec, SPHKernel >::save_dt_to_fields = false

Definition at line 355 of file SolverConfig.hpp.

◆ scheduler_conf

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

Definition at line 117 of file SolverConfig.hpp.

◆ show_ghost_zone_graph

template<class Tvec, template< class > class SPHKernel>
bool shammodels::gsph::SolverConfig< Tvec, SPHKernel >::show_ghost_zone_graph = false

Definition at line 359 of file SolverConfig.hpp.

◆ smoothing_length_config

template<class Tvec, template< class > class SPHKernel>
SmoothingLengthConfig shammodels::gsph::SolverConfig< Tvec, SPHKernel >::smoothing_length_config

Definition at line 335 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 290 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 123 of file SolverConfig.hpp.


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