Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
Namespaces | Classes | Typedefs | Functions
shammodels::sph Namespace Reference

namespace for the sph model More...

Namespaces

namespace  modules
 namespace for the sph model modules
 

Classes

struct  AVConfig
 Configuration for the Artificial Viscosity (AV) More...
 
struct  AVConfig_Constant
 Constant artificial viscosity: \( \alpha = cte\). More...
 
struct  AVConfig_ConstantDisc
 Constant artificial viscosity for alpha disc viscosity. More...
 
struct  AVConfig_None
 No artificial viscosity: \( q^a_ab = 0\). More...
 
struct  AVConfig_VaryingCD10
 Cullen & Dehnen 2010. More...
 
struct  AVConfig_VaryingMM97
 Morris & Monaghan 1997. More...
 
class  BasicSPHGhostHandler
 
struct  BasicSPHGhostHandlerConfig
 
struct  BCConfig
 Boundary conditions configuration. More...
 
struct  CFLConfig
 The configuration for the CFL condition. More...
 
struct  Debug_ph_dump
 
struct  DustConfig
 
struct  MHDConfig
 
class  Model
 The shamrock SPH model. More...
 
struct  ParticleKillingConfig
 
struct  PhantomDump
 Class representing a Phantom dump file. More...
 
struct  PhantomDumpBlock
 A class to represent a single block of data in a Phantom dump. More...
 
struct  PhantomDumpBlockArray
 A helper class to represent a single block of data in a Phantom dump. More...
 
struct  PhantomDumpTableHeader
 Phantom dump table header for a specific type. More...
 
struct  SelfGravConfig
 
struct  SinkParticle
 
struct  SmoothingLengthConfig
 
class  Solver
 The shamrock SPH model. More...
 
struct  SolverConfig
 The configuration for a sph solver. More...
 
struct  SolverLog
 Class holding the logs of the solver /todo add a variable to keep only a definite number of steps in the step_logs. More...
 
struct  SolverStatusVar
 Solver status variables. More...
 
class  SolverStorage
 
class  SPHTreeUtilities
 
class  SPHUtilities
 handle basic utilities dealing with SPH More...
 
struct  TimestepLog
 

Typedefs

template<class T >
using Component = shambase::StorageComponent< T >
 

Functions

template<class Tscal >
void to_json (nlohmann::json &j, const AVConfig_None< Tscal > &p)
 
template<class Tscal >
void from_json (const nlohmann::json &j, AVConfig_None< Tscal > &p)
 
template<class Tscal >
void to_json (nlohmann::json &j, const AVConfig_Constant< Tscal > &p)
 
template<class Tscal >
void from_json (const nlohmann::json &j, AVConfig_Constant< Tscal > &p)
 
template<class Tscal >
void to_json (nlohmann::json &j, const AVConfig_VaryingMM97< Tscal > &p)
 
template<class Tscal >
void from_json (const nlohmann::json &j, AVConfig_VaryingMM97< Tscal > &p)
 
template<class Tscal >
void to_json (nlohmann::json &j, const AVConfig_VaryingCD10< Tscal > &p)
 
template<class Tscal >
void from_json (const nlohmann::json &j, AVConfig_VaryingCD10< Tscal > &p)
 
template<class Tscal >
void to_json (nlohmann::json &j, const AVConfig_ConstantDisc< Tscal > &p)
 
template<class Tscal >
void from_json (const nlohmann::json &j, AVConfig_ConstantDisc< Tscal > &p)
 
template<class Tvec >
void to_json (nlohmann::json &j, const AVConfig< Tvec > &p)
 Convert an AVConfig to a json object.
 
template<class Tvec >
void from_json (const nlohmann::json &j, AVConfig< Tvec > &p)
 Convert a json object to an AVConfig.
 
template<class Tvec >
void to_json (nlohmann::json &j, const BCConfig< Tvec > &p)
 Serialize a BCConfig to a JSON object.
 
template<class Tvec >
void from_json (const nlohmann::json &j, BCConfig< Tvec > &p)
 Deserialize a JSON object into a BCConfig.
 
template<class Tvec >
void to_json (nlohmann::json &j, const MHDConfig< Tvec > &p)
 Serialize a MHDConfig to a JSON object.
 
template<class Tvec >
void from_json (const nlohmann::json &j, MHDConfig< Tvec > &p)
 Deserialize a JSON object into a MHDConfig.
 
template<class Tvec >
EOSConfig< Tvec > get_shamrock_eosconfig (PhantomDump &phdump, bool bypass_error)
 Generate a Shamrock EOS configuration from a PhantomDump object.
 
template<class Tvec >
void write_shamrock_eos_in_phantom_dump (EOSConfig< Tvec > &cfg, PhantomDump &dump, bool bypass_error)
 Write the eos config to th phantom dump header.
 
template<class Tvec >
AVConfig< Tvec > get_shamrock_avconfig (PhantomDump &phdump)
 Generate an Shamrock artificial viscosity configuration from a PhantomDump object.
 
template<class Tscal >
shamunits::UnitSystem< Tscal > get_shamrock_units (PhantomDump &phdump)
 Get the shamrock units object.
 
template<class Tscal >
void write_shamrock_units_in_phantom_dump (std::optional< shamunits::UnitSystem< Tscal > > &units, PhantomDump &dump, bool bypass_error)
 Write shamrock units config into the phantom dump.
 
template<class Tvec >
BCConfig< Tvec > get_shamrock_boundary_config (PhantomDump &phdump)
 Generate an Shamrock boundary configuration from a PhantomDump object.
 
template<class Tvec >
void write_shamrock_boundaries_in_phantom_dump (BCConfig< Tvec > &cfg, std::tuple< Tvec, Tvec > box_size, PhantomDump &dump, bool bypass_error)
 
bool compare_phantom_dumps (PhantomDump &dump1, PhantomDump &dump2)
 Compare two phantom dumps and report offenses.
 
template<class Tvec >
void to_json (nlohmann::json &j, const SinkParticle< Tvec > &p)
 
template<class Tvec >
void from_json (const nlohmann::json &j, SinkParticle< Tvec > &p)
 
template<class Tscal >
void to_json (nlohmann::json &j, const CFLConfig< Tscal > &p)
 Converts a CFLConfig object to a JSON object.
 
template<class Tscal >
void from_json (const nlohmann::json &j, CFLConfig< Tscal > &p)
 Deserializes a CFLConfig object from a JSON object.
 
template<class Tvec >
void to_json (nlohmann::json &j, const SolverStatusVar< Tvec > &p)
 Converts a SolverStatusVar object to a JSON object.
 
template<class Tvec >
void from_json (const nlohmann::json &j, SolverStatusVar< Tvec > &p)
 Deserializes a SolverStatusVar object from a JSON object.
 
template<class Tvec >
void to_json (nlohmann::json &j, const ParticleKillingConfig< Tvec > &p)
 
template<class Tvec >
void from_json (const nlohmann::json &j, ParticleKillingConfig< Tvec > &p)
 
void to_json (nlohmann::json &j, const SmoothingLengthConfig &p)
 
void from_json (const nlohmann::json &j, SmoothingLengthConfig &p)
 
void to_json (nlohmann::json &j, const SelfGravConfig &p)
 JSON serialization for SelfGravConfig.
 
void from_json (const nlohmann::json &j, SelfGravConfig &p)
 JSON deserialization for SelfGravConfig.
 
template<class Tvec , template< class > class SPHKernel>
void to_json (nlohmann::json &j, const SolverConfig< Tvec, SPHKernel > &p)
 Serializes a SolverConfig object to a JSON object.
 
template<class Tvec , template< class > class SPHKernel>
void from_json (const nlohmann::json &j, SolverConfig< Tvec, SPHKernel > &p)
 Deserializes a SolverConfig object from a JSON object.
 
template EOSConfig< f32_3 > get_shamrock_eosconfig< f32_3 > (PhantomDump &phdump, bool bypass_error)
 explicit instanciation for f32_3
 
template EOSConfig< f64_3 > get_shamrock_eosconfig< f64_3 > (PhantomDump &phdump, bool bypass_error)
 explicit instanciation for f64_3
 
template void write_shamrock_eos_in_phantom_dump< f32_3 > (EOSConfig< f32_3 > &cfg, PhantomDump &dump, bool bypass_error)
 explicit instanciation for f32_3
 
template void write_shamrock_eos_in_phantom_dump< f64_3 > (EOSConfig< f64_3 > &cfg, PhantomDump &dump, bool bypass_error)
 explicit instanciation for f64_3
 
template AVConfig< f32_3 > get_shamrock_avconfig< f32_3 > (PhantomDump &phdump)
 explicit instanciation for f32_3
 
template AVConfig< f64_3 > get_shamrock_avconfig< f64_3 > (PhantomDump &phdump)
 explicit instanciation for f64_3
 
template shamunits::UnitSystem< f32get_shamrock_units< f32 > (PhantomDump &phdump)
 explicit instanciation for f32_3
 
template shamunits::UnitSystem< f64get_shamrock_units< f64 > (PhantomDump &phdump)
 explicit instanciation for f64_3
 
template void write_shamrock_units_in_phantom_dump< f64 > (std::optional< shamunits::UnitSystem< f64 > > &units, PhantomDump &dump, bool bypass_error)
 
template BCConfig< f32_3 > get_shamrock_boundary_config< f32_3 > (PhantomDump &phdump)
 explicit instanciation for f32_3
 
template BCConfig< f64_3 > get_shamrock_boundary_config< f64_3 > (PhantomDump &phdump)
 explicit instanciation for f64_3
 
template void write_shamrock_boundaries_in_phantom_dump< f32_3 > (BCConfig< f32_3 > &cfg, std::tuple< f32_3, f32_3 > box_size, PhantomDump &dump, bool bypass_error)
 explicit instanciation for f32_3
 
template void write_shamrock_boundaries_in_phantom_dump< f64_3 > (BCConfig< f64_3 > &cfg, std::tuple< f64_3, f64_3 > box_size, PhantomDump &dump, bool bypass_error)
 explicit instanciation for f64_3
 
template<class Tvec >
void fill_blocks (PhantomDumpBlock &block, Debug_ph_dump< Tvec > &info)
 
template<class Tvec >
shammodels::sph::PhantomDump make_interface_debug_phantom_dump (Debug_ph_dump< Tvec > info)
 

Detailed Description

namespace for the sph model

Typedef Documentation

◆ Component

template<class T >
using shammodels::sph::Component = typedef shambase::StorageComponent<T>

Definition at line 45 of file SolverStorage.hpp.

Function Documentation

◆ compare_phantom_dumps()

bool shammodels::sph::compare_phantom_dumps ( PhantomDump dump1,
PhantomDump dump2 
)

Compare two phantom dumps and report offenses.

Definition at line 397 of file PhantomDump.cpp.

+ Here is the call graph for this function:

◆ fill_blocks()

template<class Tvec >
void shammodels::sph::fill_blocks ( PhantomDumpBlock block,
Debug_ph_dump< Tvec > &  info 
)

Definition at line 582 of file Solver.cpp.

◆ from_json() [1/15]

template<class Tvec >
void shammodels::sph::from_json ( const nlohmann::json &  j,
AVConfig< Tvec > &  p 
)
inline

Convert a json object to an AVConfig.

Parameters
jthe json object to be used
pthe AVConfig object to be filled

Definition at line 370 of file AVConfig.hpp.

+ Here is the call graph for this function:

◆ from_json() [2/15]

template<class Tscal >
void shammodels::sph::from_json ( const nlohmann::json &  j,
AVConfig_Constant< Tscal > &  p 
)
inline

Definition at line 67 of file AVConfig.hpp.

◆ from_json() [3/15]

template<class Tscal >
void shammodels::sph::from_json ( const nlohmann::json &  j,
AVConfig_ConstantDisc< Tscal > &  p 
)
inline

Definition at line 165 of file AVConfig.hpp.

◆ from_json() [4/15]

template<class Tscal >
void shammodels::sph::from_json ( const nlohmann::json &  j,
AVConfig_None< Tscal > &  p 
)
inline

Definition at line 41 of file AVConfig.hpp.

◆ from_json() [5/15]

template<class Tscal >
void shammodels::sph::from_json ( const nlohmann::json &  j,
AVConfig_VaryingCD10< Tscal > &  p 
)
inline

Definition at line 135 of file AVConfig.hpp.

◆ from_json() [6/15]

template<class Tscal >
void shammodels::sph::from_json ( const nlohmann::json &  j,
AVConfig_VaryingMM97< Tscal > &  p 
)
inline

Definition at line 100 of file AVConfig.hpp.

◆ from_json() [7/15]

template<class Tvec >
void shammodels::sph::from_json ( const nlohmann::json &  j,
BCConfig< Tvec > &  p 
)
inline

Deserialize a JSON object into a BCConfig.

Parameters
[in]jThe JSON object to read from
[out]pThe BCConfig to deserialize

Definition at line 188 of file BCConfig.hpp.

+ Here is the call graph for this function:

◆ from_json() [8/15]

template<class Tscal >
void shammodels::sph::from_json ( const nlohmann::json &  j,
CFLConfig< Tscal > &  p 
)
inline

Deserializes a CFLConfig object from a JSON object.

Parameters
jThe JSON object to deserialize from.
pThe CFLConfig object to populate.

Definition at line 922 of file SolverConfig.hpp.

+ Here is the call graph for this function:

◆ from_json() [9/15]

template<class Tvec >
void shammodels::sph::from_json ( const nlohmann::json &  j,
MHDConfig< Tvec > &  p 
)
inline

Deserialize a JSON object into a MHDConfig.

Parameters
[in]jThe JSON object to read from
[out]pThe MHDConfig to deserialize

Definition at line 155 of file MHDConfig.hpp.

+ Here is the call graph for this function:

◆ from_json() [10/15]

template<class Tvec >
void shammodels::sph::from_json ( const nlohmann::json &  j,
ParticleKillingConfig< Tvec > &  p 
)
inline

Definition at line 977 of file SolverConfig.hpp.

◆ from_json() [11/15]

void shammodels::sph::from_json ( const nlohmann::json &  j,
SelfGravConfig p 
)
inline

JSON deserialization for SelfGravConfig.

Definition at line 1070 of file SolverConfig.hpp.

+ Here is the call graph for this function:

◆ from_json() [12/15]

template<class Tvec >
void shammodels::sph::from_json ( const nlohmann::json &  j,
SinkParticle< Tvec > &  p 
)
inline

Definition at line 57 of file SinkPartStruct.hpp.

◆ from_json() [13/15]

void shammodels::sph::from_json ( const nlohmann::json &  j,
SmoothingLengthConfig p 
)
inline

Definition at line 1012 of file SolverConfig.hpp.

◆ from_json() [14/15]

template<class Tvec , template< class > class SPHKernel>
void shammodels::sph::from_json ( const nlohmann::json &  j,
SolverConfig< Tvec, SPHKernel > &  p 
)
inline

Deserializes a SolverConfig object from a JSON object.

Parameters
jThe JSON object to deserialize from.
pThe SolverConfig object to populate.

Definition at line 1176 of file SolverConfig.hpp.

+ Here is the call graph for this function:

◆ from_json() [15/15]

template<class Tvec >
void shammodels::sph::from_json ( const nlohmann::json &  j,
SolverStatusVar< Tvec > &  p 
)
inline

Deserializes a SolverStatusVar object from a JSON object.

Parameters
jThe JSON object to deserialize from.
pThe SolverStatusVar object to populate.

Definition at line 955 of file SolverConfig.hpp.

+ Here is the call graph for this function:

◆ get_shamrock_avconfig()

template<class Tvec >
AVConfig< Tvec > shammodels::sph::get_shamrock_avconfig ( PhantomDump phdump)

Generate an Shamrock artificial viscosity configuration from a PhantomDump object.

Parameters
phdumpReference to the PhantomDump object.
Returns
The artificial viscosity configuration corresponding to the given PhantomDump object.

Definition at line 133 of file Phantom2Shamrock.cpp.

+ Here is the call graph for this function:

◆ get_shamrock_boundary_config()

template<class Tvec >
BCConfig< Tvec > shammodels::sph::get_shamrock_boundary_config ( PhantomDump phdump)

Generate an Shamrock boundary configuration from a PhantomDump object.

Parameters
phdumpReference to the PhantomDump object.
Returns
The boundary configuration corresponding to the given PhantomDump object.

Definition at line 204 of file Phantom2Shamrock.cpp.

+ Here is the call graph for this function:

◆ get_shamrock_eosconfig()

template<class Tvec >
EOSConfig< Tvec > shammodels::sph::get_shamrock_eosconfig ( PhantomDump phdump,
bool  bypass_error 
)

Generate a Shamrock EOS configuration from a PhantomDump object.

Parameters
phdumpReference to the PhantomDump object.
bypass_errorFlag to bypass error handling.
Returns
The EOS configuration corresponding to the given PhantomDump object.
Exceptions
std::runtime_errorIf an error occurs during configuration retrieval.

Definition at line 26 of file Phantom2Shamrock.cpp.

+ Here is the call graph for this function:

◆ get_shamrock_units()

template<class Tscal >
shamunits::UnitSystem< Tscal > shammodels::sph::get_shamrock_units ( PhantomDump phdump)

Get the shamrock units object.

Todo:
load also magfd
Template Parameters
Tscal
Parameters
phdump
Returns
shamunits::UnitSystem<Tscal>

Definition at line 147 of file Phantom2Shamrock.cpp.

+ Here is the call graph for this function:

◆ make_interface_debug_phantom_dump()

template<class Tvec >
shammodels::sph::PhantomDump shammodels::sph::make_interface_debug_phantom_dump ( Debug_ph_dump< Tvec >  info)

Definition at line 619 of file Solver.cpp.

◆ to_json() [1/15]

template<class Tvec >
void shammodels::sph::to_json ( nlohmann::json &  j,
const AVConfig< Tvec > &  p 
)
inline

Convert an AVConfig to a json object.

Parameters
jthe json object to be filled
pthe AVConfig object

Definition at line 355 of file AVConfig.hpp.

+ Here is the call graph for this function:

◆ to_json() [2/15]

template<class Tscal >
void shammodels::sph::to_json ( nlohmann::json &  j,
const AVConfig_Constant< Tscal > &  p 
)
inline

Definition at line 58 of file AVConfig.hpp.

◆ to_json() [3/15]

template<class Tscal >
void shammodels::sph::to_json ( nlohmann::json &  j,
const AVConfig_ConstantDisc< Tscal > &  p 
)
inline

Definition at line 156 of file AVConfig.hpp.

◆ to_json() [4/15]

template<class Tscal >
void shammodels::sph::to_json ( nlohmann::json &  j,
const AVConfig_None< Tscal > &  p 
)
inline

Definition at line 38 of file AVConfig.hpp.

◆ to_json() [5/15]

template<class Tscal >
void shammodels::sph::to_json ( nlohmann::json &  j,
const AVConfig_VaryingCD10< Tscal > &  p 
)
inline

Definition at line 124 of file AVConfig.hpp.

◆ to_json() [6/15]

template<class Tscal >
void shammodels::sph::to_json ( nlohmann::json &  j,
const AVConfig_VaryingMM97< Tscal > &  p 
)
inline

Definition at line 89 of file AVConfig.hpp.

◆ to_json() [7/15]

template<class Tvec >
void shammodels::sph::to_json ( nlohmann::json &  j,
const BCConfig< Tvec > &  p 
)
inline

Serialize a BCConfig to a JSON object.

Parameters
[out]jThe JSON object to write to
[in]pThe BCConfig to serialize

Definition at line 152 of file BCConfig.hpp.

+ Here is the call graph for this function:

◆ to_json() [8/15]

template<class Tscal >
void shammodels::sph::to_json ( nlohmann::json &  j,
const CFLConfig< Tscal > &  p 
)
inline

Converts a CFLConfig object to a JSON object.

Parameters
jThe JSON object to be populated.
pThe CFLConfig object to be converted.

Definition at line 907 of file SolverConfig.hpp.

+ Here is the call graph for this function:

◆ to_json() [9/15]

template<class Tvec >
void shammodels::sph::to_json ( nlohmann::json &  j,
const MHDConfig< Tvec > &  p 
)
inline

Serialize a MHDConfig to a JSON object.

Parameters
[out]jThe JSON object to write to
[in]pThe MHDConfig to serialize

Definition at line 118 of file MHDConfig.hpp.

+ Here is the call graph for this function:

◆ to_json() [10/15]

template<class Tvec >
void shammodels::sph::to_json ( nlohmann::json &  j,
const ParticleKillingConfig< Tvec > &  p 
)
inline

Definition at line 964 of file SolverConfig.hpp.

◆ to_json() [11/15]

void shammodels::sph::to_json ( nlohmann::json &  j,
const SelfGravConfig p 
)
inline

JSON serialization for SelfGravConfig.

Definition at line 1024 of file SolverConfig.hpp.

+ Here is the call graph for this function:

◆ to_json() [12/15]

template<class Tvec >
void shammodels::sph::to_json ( nlohmann::json &  j,
const SinkParticle< Tvec > &  p 
)
inline

Definition at line 40 of file SinkPartStruct.hpp.

◆ to_json() [13/15]

void shammodels::sph::to_json ( nlohmann::json &  j,
const SmoothingLengthConfig p 
)
inline

Definition at line 992 of file SolverConfig.hpp.

◆ to_json() [14/15]

template<class Tvec , template< class > class SPHKernel>
void shammodels::sph::to_json ( nlohmann::json &  j,
const SolverConfig< Tvec, SPHKernel > &  p 
)
inline

Serializes a SolverConfig object to a JSON object.

Parameters
jThe JSON object to serialize to.
pThe SolverConfig object to serialize.

Definition at line 1115 of file SolverConfig.hpp.

+ Here is the call graph for this function:

◆ to_json() [15/15]

template<class Tvec >
void shammodels::sph::to_json ( nlohmann::json &  j,
const SolverStatusVar< Tvec > &  p 
)
inline

Converts a SolverStatusVar object to a JSON object.

Parameters
jThe JSON object to be populated.
pThe SolverStatusVar object to be converted.

Definition at line 943 of file SolverConfig.hpp.

+ Here is the call graph for this function:

◆ write_shamrock_boundaries_in_phantom_dump()

template<class Tvec >
void shammodels::sph::write_shamrock_boundaries_in_phantom_dump ( BCConfig< Tvec > &  cfg,
std::tuple< Tvec, Tvec >  box_size,
PhantomDump dump,
bool  bypass_error 
)

Definition at line 218 of file Phantom2Shamrock.cpp.

◆ write_shamrock_eos_in_phantom_dump()

template<class Tvec >
void shammodels::sph::write_shamrock_eos_in_phantom_dump ( EOSConfig< Tvec > &  cfg,
PhantomDump dump,
bool  bypass_error 
)

Write the eos config to th phantom dump header.

Definition at line 69 of file Phantom2Shamrock.cpp.

+ Here is the call graph for this function:

◆ write_shamrock_units_in_phantom_dump()

template<class Tscal >
void shammodels::sph::write_shamrock_units_in_phantom_dump ( std::optional< shamunits::UnitSystem< Tscal > > &  units,
PhantomDump dump,
bool  bypass_error 
)

Write shamrock units config into the phantom dump.

Definition at line 164 of file Phantom2Shamrock.cpp.

+ Here is the call graph for this function: