![]() |
Shamrock 2025.10.0
Astrophysical Code
|
namespace for models More...
Namespaces | |
| namespace | basegodunov |
| namespace for the basegodunov model | |
| namespace | sph |
| namespace for the sph model | |
| namespace | zeus |
| namespace for the zeus model | |
Classes | |
| struct | EOSConfig |
| Configuration struct for the equation of state used in the hydrodynamic models. More... | |
| struct | ExtForceVariant |
| struct | ExtForceConfig |
| 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... | |
Enumerations | |
| enum | NeighCacheStrategy { SingleStage = 0 , TwoStage = 1 } |
| Strategy used to build the neighbour cache out of the tree traversal. More... | |
Functions | |
| template<typename BasicJsonType> | |
| void | to_json (BasicJsonType &j, const NeighCacheStrategy &e) |
| template<typename BasicJsonType> | |
| void | from_json (const BasicJsonType &j, NeighCacheStrategy &e) |
| NeighCacheStrategy | neigh_cache_strategy_from_two_stage_search (bool use_two_stage_search) |
| Map the legacy use_two_stage_search boolean onto the strategy enum. | |
| void | get_to_neigh_cache_strategy (const nlohmann::json &j, NeighCacheStrategy &value, const std::string &log_ctx, bool &has_used_defaults, bool &has_updated_config) |
| Deserialize the neighbour cache strategy, falling back on the legacy boolean key. | |
| template<class Tvec> | |
| void | to_json (nlohmann::json &j, const EOSConfig< Tvec > &p) |
| Serialize EOSConfig to json. | |
| template<class Tvec> | |
| void | from_json (const nlohmann::json &j, EOSConfig< Tvec > &p) |
| Deserializes an EOSConfig<Tvec> from a JSON object. | |
| template<class Tvec> | |
| void | to_json (nlohmann::json &j, const ExtForceVariant< Tvec > &p) |
| template<class Tvec> | |
| void | from_json (const nlohmann::json &j, ExtForceVariant< Tvec > &p) |
| 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) |
| std::string | report_perf_timestep (f64 rate, u64 nobj, u64 npatch, f64 tcompute, f64 mpi_timer, f64 alloc_time_device, f64 alloc_time_host, size_t max_mem_device, size_t max_mem_host, shamsys::SystemMetrics system_metrics={}, bool report_power_usage=false) |
| template void | to_json< f64_3 > (nlohmann::json &j, const EOSConfig< f64_3 > &p) |
| template void | from_json< f64_3 > (const nlohmann::json &j, EOSConfig< f64_3 > &p) |
Variables | |
| constexpr const char * | neigh_cache_strategy_json_key = "neigh_cache_strategy" |
| Json key holding the neighbour cache strategy. | |
| constexpr const char * | neigh_cache_strategy_legacy_json_key = "use_two_stage_search" |
| Legacy json key, which used to hold the strategy as a boolean. | |
namespace for models
Strategy used to build the neighbour cache out of the tree traversal.
| Enumerator | |
|---|---|
| SingleStage | Single tree traversal per particle. |
| TwoStage | Two stage neighbours search (see shamrock paper). |
Definition at line 31 of file enum_NeighCacheStrategy.hpp.
|
inline |
Definition at line 39 of file enum_NeighCacheStrategy.hpp.
| void shammodels::from_json | ( | const nlohmann::json & | j, |
| EOSConfig< Tvec > & | p ) |
Deserializes an EOSConfig<Tvec> from a JSON object.
| Tvec | The vector type of the EOSConfig<Tvec> |
| j | The JSON object to deserialize |
| p | The EOSConfig<Tvec> to deserialize to |
Throws an std::runtime_error if the JSON object is not in the expected format
Definition at line 121 of file EOSConfig.cpp.
|
inline |
Definition at line 285 of file ExtForceConfig.hpp.
|
inline |
Definition at line 218 of file ExtForceConfig.hpp.
|
inline |
Deserialize the neighbour cache strategy, falling back on the legacy boolean key.
Reads neigh_cache_strategy if the json object has it. Otherwise the legacy use_two_stage_search boolean is mapped onto the enum, so that configs dumped before the strategy became an enum can still be loaded. If neither key is there the value is left as is.
| j | The json object to deserialize from |
| value | The strategy to populate |
| log_ctx | Logger context used for the key update message |
| has_used_defaults | Set to true if no key was found |
| has_updated_config | Set to true if the legacy key was used |
Definition at line 68 of file enum_NeighCacheStrategy.hpp.
|
inline |
Map the legacy use_two_stage_search boolean onto the strategy enum.
Definition at line 48 of file enum_NeighCacheStrategy.hpp.
| std::string shammodels::report_perf_timestep | ( | f64 | rate, |
| u64 | nobj, | ||
| u64 | npatch, | ||
| f64 | tcompute, | ||
| f64 | mpi_timer, | ||
| f64 | alloc_time_device, | ||
| f64 | alloc_time_host, | ||
| size_t | max_mem_device, | ||
| size_t | max_mem_host, | ||
| shamsys::SystemMetrics | system_metrics = {}, | ||
| bool | report_power_usage = false ) |
Definition at line 34 of file timestep_report.cpp.
|
inline |
Definition at line 39 of file enum_NeighCacheStrategy.hpp.
| void shammodels::to_json | ( | nlohmann::json & | j, |
| const EOSConfig< Tvec > & | p ) |
Serialize EOSConfig to json.
This function serializes an EOSConfig to a json object with the following format:
| j | json object |
| p | EOSConfig to serialize |
Definition at line 43 of file EOSConfig.cpp.
|
inline |
Definition at line 278 of file ExtForceConfig.hpp.
|
inline |
Definition at line 163 of file ExtForceConfig.hpp.
|
inlineconstexpr |
Json key holding the neighbour cache strategy.
Definition at line 42 of file enum_NeighCacheStrategy.hpp.
|
inlineconstexpr |
Legacy json key, which used to hold the strategy as a boolean.
Definition at line 45 of file enum_NeighCacheStrategy.hpp.