Expose water diagnostics through public APIs
This commit is contained in:
@@ -50,6 +50,20 @@ struct ParticleState {
|
||||
std::vector<double> h;
|
||||
};
|
||||
|
||||
struct WaterSummary {
|
||||
double mass;
|
||||
double momentum[3];
|
||||
double max_pressure;
|
||||
double min_density;
|
||||
double max_density;
|
||||
};
|
||||
|
||||
struct WaterDtLimits {
|
||||
double cfl;
|
||||
double acceleration;
|
||||
double viscous;
|
||||
};
|
||||
|
||||
class Error : public std::runtime_error {
|
||||
public:
|
||||
explicit Error(const std::string &message) : std::runtime_error(message) {}
|
||||
@@ -137,6 +151,22 @@ inline ParticleState particle_state()
|
||||
return state;
|
||||
}
|
||||
|
||||
inline WaterSummary water_summary()
|
||||
{
|
||||
WaterSummary summary = {0.0, {0.0, 0.0, 0.0}, 0.0, 0.0, 0.0};
|
||||
check(sphlite_get_water_summary(&summary.mass, summary.momentum,
|
||||
&summary.max_pressure, &summary.min_density, &summary.max_density));
|
||||
return summary;
|
||||
}
|
||||
|
||||
inline WaterDtLimits water_dt_limits()
|
||||
{
|
||||
WaterDtLimits limits = {0.0, 0.0, 0.0};
|
||||
check(sphlite_get_water_dt_limits(
|
||||
&limits.cfl, &limits.acceleration, &limits.viscous));
|
||||
return limits;
|
||||
}
|
||||
|
||||
inline void set_output_directory(const std::string &path)
|
||||
{
|
||||
check(sphlite_set_output_directory(path.c_str()));
|
||||
|
||||
Reference in New Issue
Block a user