19#include "nlohmann/json.hpp"
27 using Tscal = shambase::VecComponent<Tvec>;
32 Tvec sph_acceleration;
33 Tvec ext_acceleration;
35 Tvec angular_momentum;
36 Tscal accretion_radius;
43 using json = nlohmann::json;
47 {
"velocity", p.velocity},
48 {
"sph_acceleration", p.sph_acceleration},
49 {
"ext_acceleration", p.ext_acceleration},
51 {
"angular_momentum", p.angular_momentum},
52 {
"accretion_radius", p.accretion_radius},
57 inline void from_json(
const nlohmann::json &j, SinkParticle<Tvec> &p) {
59 using json = nlohmann::json;
61 j.at(
"pos").get_to(p.pos);
62 j.at(
"velocity").get_to(p.velocity);
63 j.at(
"sph_acceleration").get_to(p.sph_acceleration);
64 j.at(
"ext_acceleration").get_to(p.ext_acceleration);
65 j.at(
"mass").get_to(p.mass);
66 j.at(
"angular_momentum").get_to(p.angular_momentum);
67 j.at(
"accretion_radius").get_to(p.accretion_radius);
std::uint32_t u32
32 bit unsigned integer
namespace for the sph model
void to_json(nlohmann::json &j, const EOSConfig< Tvec > &p)
Serialize EOSConfig to json.
void from_json(const nlohmann::json &j, EOSConfig< Tvec > &p)
Deserializes an EOSConfig<Tvec> from a JSON object.