41#ifndef SVZERODSOLVER_SOLVE_SOLVER_HPP_
42#define SVZERODSOLVER_SOLVE_SOLVER_HPP_
59 Solver(
const nlohmann::json& config);
104 const std::vector<double>& new_params);
123 std::shared_ptr<Model> model;
125 std::vector<State> states;
126 std::vector<double> times;
129 void sanity_checks();
138 std::vector<std::pair<int, int>> get_vessel_caps_dof_indices();
151 bool check_vessel_cap_convergence(
152 const std::vector<State>& states_last_two_cycles,
153 const std::vector<std::pair<int, int>>& vessel_caps_dof_indices);
167 std::pair<double, double> get_cycle_to_cycle_errors_in_flow_and_pressure(
168 const std::vector<State>& states_last_two_cycles,
169 const std::pair<int, int>& dof_indices);
Source file to read simulation configuration.
Class for running 0D simulations.
Definition Solver.h:52
std::vector< double > read_block_params(const std::string &block_name)
Read the parameters of a block.
Definition Solver.cpp:364
void run()
Run the simulation.
Definition Solver.cpp:40
Solver(const nlohmann::json &config)
Construct a new Solver object.
Definition Solver.cpp:5
void update_block_params(const std::string &block_name, const std::vector< double > &new_params)
Update the parameters of a block.
Definition Solver.cpp:340
double get_single_result_avg(const std::string &dof_name) const
Get the result of a single DOF averaged over time.
Definition Solver.cpp:328
std::vector< double > get_times() const
Get the time steps of the result.
Definition Solver.cpp:297
Eigen::VectorXd get_single_result(const std::string &dof_name) const
Get the result of a single DOF over time.
Definition Solver.cpp:316
void write_result_to_csv(const std::string &filename) const
Write the result to a csv file.
Definition Solver.cpp:383
std::string get_full_result() const
Get the full result as a csv encoded string.
Definition Solver.cpp:299
State of the system.
Definition State.h:46
Simulation parameters.
Definition SimulationParameters.h:50