![]() |
Shamrock 2025.10.0
Astrophysical Code
|
namespace for the basegodunov model More...
Namespaces | |
| namespace | modules |
| namespace for the basegodunov model modules | |
Classes | |
| struct | AMRStencilCache |
| struct | CoolingConfig |
| Cooling of the gas, applied on top of the (adiabatic) equation of state. More... | |
| struct | ExtForceConfig |
| List of the external forces applied to the gas. More... | |
| class | GhostZonesData |
| Class to hold information related to ghost zones. More... | |
| class | Model |
| class | SolverStorage |
| class | Solver |
| struct | DragConfig |
| alphas is the dust collision rate (the inverse of the stopping time) More... | |
| struct | DustConfig |
| struct | PassiveScalarGasConfig |
| Npscal_gas is the number of gas passive scalars. More... | |
| struct | GravityConfig |
| struct | AMRMode |
| struct | EOSConfig |
| Equation of state of the gas, each alternative maps to a shammath FluidStateSpec. More... | |
| struct | BCConfig |
| struct | SolverConfig |
Typedefs | |
| using | Direction = shammodels::basegodunov::modules::Direction |
| template<class T> | |
| using | Component = shambase::StorageComponent<T> |
Enumerations | |
| enum | AMRInterpMode { FIRST_ORDER = 0 , SECOND_ORDER = 1 } |
| enum | DragSolverMode { NoDrag = 0 , IRK1 = 1 , IRK2 = 2 , EXPO = 3 } |
| enum | DustRiemannSolverMode { NoDust = 0 , DHLL = 1 , HB = 2 } |
| Dust Riemann solver mode enum. More... | |
| enum | ExtForceCoupling { Midpoint = 0 , Trapezoidal = 1 } |
| Time quadrature used to couple the external forces source term to the solver. More... | |
| enum | GravityMode { NoGravity = 0 , CG = 1 , PCG = 2 , BICGSTAB = 3 , MULTIGRID = 4 } |
| enum | RiemannSolverMode { Rusanov = 0 , HLL = 1 , HLLC_PVRS = 2 , HLLC_Davis = 3 , HLLC_RAMSES = 4 } |
| Gas Riemann solver used by the Ramses (Godunov) model. More... | |
| enum | SlopeMode { None = 0 , VanLeer_f = 1 , VanLeer_std = 2 , VanLeer_sym = 3 , Minmod = 4 } |
| Slope limiter modes. More... | |
Functions | |
| template<class Tvec> | |
| void | to_json (nlohmann::json &j, const CoolingConfig< Tvec > &p) |
| template<class Tvec> | |
| void | from_json (const nlohmann::json &j, CoolingConfig< Tvec > &p) |
| SHAMROCK_JSON_SERIALIZE_ENUM (AMRInterpMode, {{AMRInterpMode::FIRST_ORDER, "amr_first_order"}, {AMRInterpMode::SECOND_ORDER, "amr_second_order"}}) | |
| SHAMROCK_JSON_SERIALIZE_ENUM (DragSolverMode, {{DragSolverMode::NoDrag, "no_drag"}, {DragSolverMode::IRK1, "irk1"}, {DragSolverMode::IRK2, "irk2"}, {DragSolverMode::EXPO, "expo"}}) | |
| SHAMROCK_JSON_SERIALIZE_ENUM (DustRiemannSolverMode, {{DustRiemannSolverMode::NoDust, "no_dust"}, {DustRiemannSolverMode::DHLL, "dhll"}, {DustRiemannSolverMode::HB, "hb"}}) | |
| SHAMROCK_JSON_SERIALIZE_ENUM (ExtForceCoupling, {{ExtForceCoupling::Midpoint, "midpoint"}, {ExtForceCoupling::Trapezoidal, "trapezoidal"}}) | |
| SHAMROCK_JSON_SERIALIZE_ENUM (GravityMode, {{GravityMode::NoGravity, "no_gravity"}, {GravityMode::CG, "cg"}, {GravityMode::PCG, "pcg"}, {GravityMode::BICGSTAB, "bicgstab"}, {GravityMode::MULTIGRID, "multigrid"}}) | |
| SHAMROCK_JSON_SERIALIZE_ENUM (RiemannSolverMode, {{RiemannSolverMode::Rusanov, "rusanov"}, {RiemannSolverMode::HLL, "hll"}, {RiemannSolverMode::HLLC_PVRS, "hllc_pvrs"}, {RiemannSolverMode::HLLC_Davis, "hllc_davis"}, {RiemannSolverMode::HLLC_RAMSES, "hllc_ramses"}, {RiemannSolverMode::HLLC_PVRS, "hllc"}}) | |
| SHAMROCK_JSON_SERIALIZE_ENUM (SlopeMode, {{SlopeMode::None, "none"}, {SlopeMode::VanLeer_f, "vanleer_f"}, {SlopeMode::VanLeer_std, "vanleer_std"}, {SlopeMode::VanLeer_sym, "vanleer_sym"}, {SlopeMode::Minmod, "minmod"}}) | |
| template<class Tvec> | |
| void | to_json (nlohmann::json &j, const ExtForceConfig< Tvec > &p) |
| template<class Tvec> | |
| void | from_json (const nlohmann::json &j, ExtForceConfig< Tvec > &p) |
| template<class T, class Tvec, class ACCField> | |
| T | laplacian_7pt_with_Aii (const shambase::VecComponent< Tvec > *cell_sizes, const u32 block_size, const u32 cell_global_id, const AMRGraphLinkiterator &graph_iter_xp, const AMRGraphLinkiterator &graph_iter_xm, const AMRGraphLinkiterator &graph_iter_yp, const AMRGraphLinkiterator &graph_iter_ym, const AMRGraphLinkiterator &graph_iter_zp, const AMRGraphLinkiterator &graph_iter_zm, ACCField &&field_access, T &Aii) |
| Get the discretized (finite volume) Laplacian, and the diagonal coefficient of the associated matrix. | |
| template<class T, class Tvec, class ACCField> | |
| T | laplacian_7pt (const shambase::VecComponent< Tvec > *cell_sizes, const u32 block_size, const u32 cell_global_id, const AMRGraphLinkiterator &graph_iter_xp, const AMRGraphLinkiterator &graph_iter_xm, const AMRGraphLinkiterator &graph_iter_yp, const AMRGraphLinkiterator &graph_iter_ym, const AMRGraphLinkiterator &graph_iter_zp, const AMRGraphLinkiterator &graph_iter_zm, ACCField &&field_access) |
| Get the discretized (finite volume) Laplacian. | |
| template<class T, class Tvec> | |
| T | jacobi_weight_7pt (const shambase::VecComponent< Tvec > *cell_sizes, const u32 block_size, const u32 cell_global_id, const AMRGraphLinkiterator &graph_iter_xp, const AMRGraphLinkiterator &graph_iter_xm, const AMRGraphLinkiterator &graph_iter_yp, const AMRGraphLinkiterator &graph_iter_ym, const AMRGraphLinkiterator &graph_iter_zp, const AMRGraphLinkiterator &graph_iter_zm) |
| Get the weight of the Jacobi preconditioner of the 7-point Laplacian. | |
| void | to_json (nlohmann::json &j, const BCConfig::GhostType &e) |
| void | from_json (const nlohmann::json &j, BCConfig::GhostType &e) |
| void | to_json (nlohmann::json &j, const BCConfig &p) |
| void | from_json (const nlohmann::json &j, BCConfig &p) |
| void | to_json (nlohmann::json &j, const DragConfig &p) |
| void | from_json (const nlohmann::json &j, DragConfig &p) |
| template<class Tvec, class TgridVec> | |
| void | amr_config_to_json (nlohmann::json &j, const AMRMode< Tvec, TgridVec > &p) |
| template<class Tvec, class TgridVec> | |
| void | amr_config_from_json (const nlohmann::json &j, AMRMode< Tvec, TgridVec > &p) |
| template<class Tvec> | |
| void | to_json (nlohmann::json &j, const EOSConfig< Tvec > &p) |
| template<class Tvec> | |
| void | from_json (const nlohmann::json &j, EOSConfig< Tvec > &p) |
| template<class Tvec, class TgridVec> | |
| void | to_json (nlohmann::json &j, const AMRMode< Tvec, TgridVec > &p) |
| template<class Tvec, class TgridVec> | |
| void | from_json (const nlohmann::json &j, AMRMode< Tvec, TgridVec > &p) |
| template<class Tvec, class TgridVec> | |
| void | to_json (nlohmann::json &j, const SolverConfig< Tvec, TgridVec > &p) |
| Serialize a SolverConfig to a JSON object. | |
| template<class Tvec, class TgridVec> | |
| void | from_json (const nlohmann::json &j, SolverConfig< Tvec, TgridVec > &p) |
| Deserializes a SolverConfig object from a JSON object. | |
| template<class Tvec, class TgridVec> | |
| void | add_instance (py::module &m, std::string name_config, std::string name_model) |
| template void | to_json< f64_3, i64_3 > (nlohmann::json &j, const SolverConfig< f64_3, i64_3 > &p) |
| template void | from_json< f64_3, i64_3 > (const nlohmann::json &j, SolverConfig< f64_3, i64_3 > &p) |
namespace for the basegodunov model
| using shammodels::basegodunov::Component = shambase::StorageComponent<T> |
Definition at line 59 of file SolverStorage.hpp.
| using shammodels::basegodunov::Direction = shammodels::basegodunov::modules::Direction |
Definition at line 28 of file CGLaplacianStencil.hpp.
| enum shammodels::basegodunov::AMRInterpMode |
Definition at line 26 of file enum_AMRInterpMode.hpp.
| enum shammodels::basegodunov::DragSolverMode |
Definition at line 26 of file enum_DragSolverMode.hpp.
Dust Riemann solver mode enum.
Definition at line 27 of file enum_DustRiemannSolverMode.hpp.
Time quadrature used to couple the external forces source term to the solver.
Both are second order in time.
Definition at line 30 of file enum_ExtForceCoupling.hpp.
| enum shammodels::basegodunov::GravityMode |
Definition at line 25 of file enum_GravityMode.hpp.
Gas Riemann solver used by the Ramses (Godunov) model.
Definition at line 37 of file enum_RiemannSolverMode.hpp.
Slope limiter modes.
Definition at line 25 of file enum_SlopeMode.hpp.
| void shammodels::basegodunov::add_instance | ( | py::module & | m, |
| std::string | name_config, | ||
| std::string | name_model ) |
Definition at line 55 of file pyRamsesModel.cpp.
|
inline |
Definition at line 538 of file SolverConfig.hpp.
|
inline |
Definition at line 516 of file SolverConfig.hpp.
|
inline |
Definition at line 610 of file SolverConfig.hpp.
|
inline |
Definition at line 496 of file SolverConfig.hpp.
|
inline |
Definition at line 475 of file SolverConfig.hpp.
|
inline |
Definition at line 105 of file CoolingConfig.hpp.
|
inline |
Definition at line 509 of file SolverConfig.hpp.
|
inline |
Definition at line 579 of file SolverConfig.hpp.
|
inline |
Definition at line 112 of file ExtForceConfig.hpp.
| void shammodels::basegodunov::from_json | ( | const nlohmann::json & | j, |
| SolverConfig< Tvec, TgridVec > & | p ) |
Deserializes a SolverConfig object from a JSON object.
| j | The JSON object to deserialize from. |
| p | The SolverConfig object to populate. |
Definition at line 85 of file SolverConfig.cpp.
|
inline |
Get the weight of the Jacobi preconditioner of the 7-point Laplacian.
Sum over the directions having at least one neighbour of \( \Delta x^2 / d \), \( d \) being the distance between the cell centers used in laplacian_7pt_with_Aii ( \( 6 \Delta x \) on a uniform grid).
TODO: (kept from new_amr_plus_grav) unlike the Aii output of laplacian_7pt_with_Aii (used by CGInit for z_0), a direction without neighbour does not contribute here, so the two differ on the cells missing a neighbour (outer ghost cells, non periodic boundaries).
| T | field type |
| Tvec | vector type |
| cell_sizes | cell size per block |
| block_size | number of cells per block |
| cell_global_id | id of the cell |
| graph_iter_xp | neighbour graph accessor in the +x direction |
| graph_iter_xm | neighbour graph accessor in the -x direction |
| graph_iter_yp | neighbour graph accessor in the +y direction |
| graph_iter_ym | neighbour graph accessor in the -y direction |
| graph_iter_zp | neighbour graph accessor in the +z direction |
| graph_iter_zm | neighbour graph accessor in the -z direction |
Definition at line 203 of file CGLaplacianStencil.hpp.
|
inline |
Get the discretized (finite volume) Laplacian.
Same as laplacian_7pt_with_Aii (see it for the details of the discretization), without the diagonal coefficient.
| T | field type |
| Tvec | vector type |
| ACCField | field accessor type, T(u32 cell_id) |
| cell_sizes | cell size per block |
| block_size | number of cells per block |
| cell_global_id | id of the cell |
| graph_iter_xp | neighbour graph accessor in the +x direction |
| graph_iter_xm | neighbour graph accessor in the -x direction |
| graph_iter_yp | neighbour graph accessor in the +y direction |
| graph_iter_ym | neighbour graph accessor in the -y direction |
| graph_iter_zp | neighbour graph accessor in the +z direction |
| graph_iter_zm | neighbour graph accessor in the -z direction |
| field_access | field accessor |
Definition at line 152 of file CGLaplacianStencil.hpp.
|
inline |
Get the discretized (finite volume) Laplacian, and the diagonal coefficient of the associated matrix.
The Laplacian is written in flux form: for each direction the gradient across the interface is the mean over the neighbours of \( (W_b - W_i) / d \), \( d \) being the distance between the cell centers ( \( \Delta x \) for a neighbour of the same level, \( 3 \Delta x / 2 \) for a coarser one and \( 3 \Delta x / 4 \) for a finer one, assuming a 2:1 refinement). The fluxes are then multiplied by the face surface \( \Delta x^2 \), so that the result is \( -\Delta x^3 \Delta W \) (the volume integral of \( -\Delta W \) over the cell). A direction without any neighbour contributes a zero flux.
The matrix is symmetric, including across level jumps (the coarse/fine coupling is \( \Delta x_{\rm coarse} / 3 \) from both sides). The scheme is second order on a uniform grid, but at a level jump the two-point flux ignores the lateral offset between the cell centers: the pointwise truncation error is O(1) there and the scheme is first order in the weak sense (see NodeSpMVPoisson3DTests.cpp).
The minus sign makes the matrix positive. With it we solve \( -\Delta \phi = -4 \pi G (\rho - \bar{\rho}) \) (multiplied by the cell volume).
| T | field type |
| Tvec | vector type |
| ACCField | field accessor type, T(u32 cell_id) |
| cell_sizes | cell size per block |
| block_size | number of cells per block |
| cell_global_id | id of the cell |
| graph_iter_xp | neighbour graph accessor in the +x direction |
| graph_iter_xm | neighbour graph accessor in the -x direction |
| graph_iter_yp | neighbour graph accessor in the +y direction |
| graph_iter_ym | neighbour graph accessor in the -y direction |
| graph_iter_zp | neighbour graph accessor in the +z direction |
| graph_iter_zm | neighbour graph accessor in the -z direction |
| field_access | field accessor |
| Aii | diagonal coefficient of the matrix for this cell (output) |
Definition at line 69 of file CGLaplacianStencil.hpp.
|
inline |
Definition at line 603 of file SolverConfig.hpp.
|
inline |
Definition at line 489 of file SolverConfig.hpp.
|
inline |
Definition at line 464 of file SolverConfig.hpp.
|
inline |
Definition at line 85 of file CoolingConfig.hpp.
|
inline |
Definition at line 502 of file SolverConfig.hpp.
|
inline |
Definition at line 559 of file SolverConfig.hpp.
|
inline |
Definition at line 85 of file ExtForceConfig.hpp.
| void shammodels::basegodunov::to_json | ( | nlohmann::json & | j, |
| const SolverConfig< Tvec, TgridVec > & | p ) |
Serialize a SolverConfig to a JSON object.
| [out] | j | The JSON object to write to |
| [in] | p | The SolverConfig to serialize |
Definition at line 57 of file SolverConfig.cpp.