### Install svZeroDSolver package Source: https://simvascular.github.io/svZeroDSolver/dir_93df0772b4c11809d264133600b0552f.html Install the package from the repository root before running examples. ```bash pip install -e . ``` -------------------------------- ### Install and build with uv sync Source: https://simvascular.github.io/svZeroDSolver/developer_guide.html Creates a virtual environment in .venv, installs all dependencies including development tooling, and builds the current source. Useful for continuously running integration tests during development. The build is self-contained: uv supplies a compatible Python interpreter (pinned in .python-version) and the CMake/Ninja build tools, so no system-wide installation of those is required. ```bash uv sync ``` -------------------------------- ### Install with pip as an alternative Source: https://simvascular.github.io/svZeroDSolver/developer_guide.html The project still builds with pip install -e . The development dependencies live in a dependency group, so install them with pip install -e . --group dev (pip >= 25.1). ```bash pip install -e . ``` ```bash pip install -e . --group dev ``` -------------------------------- ### Install optional dependency groups with uv sync --group Source: https://simvascular.github.io/svZeroDSolver/developer_guide.html Installs application-specific dependencies. Use uv sync --group gui for the svZeroDGUI application and uv sync --group viz for the svZeroDVisualization application. ```bash uv sync --group gui ``` ```bash uv sync --group viz ``` -------------------------------- ### Install Doxygen Source: https://simvascular.github.io/svZeroDSolver/developer_guide.html Commands to install Doxygen on macOS or Linux systems. ```bash brew install doxygen ``` ```bash sudo apt-get install doxygen ``` -------------------------------- ### JSON configuration example for ResistanceBC Source: https://simvascular.github.io/svZeroDSolver/_resistance_b_c_8h_source.html Example JSON configuration snippet showing how to define a resistance boundary condition in the boundary_conditions array, with bc_name, bc_type, and bc_values containing R and Pd. ```json "boundary_conditions": [ { "bc_name": "OUT", "bc_type": "RESISTANCE", "bc_values": { "R": 100.0, "Pd": 1000.0 } } ] ``` -------------------------------- ### Install Python dependencies only with uv sync --no-install-project Source: https://simvascular.github.io/svZeroDSolver/developer_guide.html Installs only the Python dependencies without building the C++ extension. Use when working on visualization or GUI tooling. ```bash uv sync --no-install-project ``` -------------------------------- ### Sensitivity Configuration Schema Source: https://simvascular.github.io/svZeroDSolver/tuner_configuration.html Example YAML configuration for performing sensitivity analysis, defining model parameters and quantities of interest. ```yaml model: config_file: "model.json" parameters: - name: "LV.Emax" bounds: [1e8, 5e8] quantities_of_interest: - name: Systemic arterial max pressure expression: np.max(pressure:AV:AR_SYS) sensitivity: n_samples: 256 output: directory: "sensitivity_results" save_plots: true ``` -------------------------------- ### Solver::setup_initial() Source: https://simvascular.github.io/svZeroDSolver/_solver_8h_source.html Sets up and initializes the simulation parameters and model. ```APIDOC ## Solver::setup_initial() ### Description Sets up and initializes the simulation parameters and model. ``` -------------------------------- ### Solver::setup_initial() Source: https://simvascular.github.io/svZeroDSolver/_solver_8h_source.html Sets up and initializes the simulation parameters and model. ```APIDOC ## Solver::setup_initial() ### Description Sets up and initializes the simulation parameters and model. ### Method void ### Parameters None ### Returns void ``` -------------------------------- ### setup_initial() Source: https://simvascular.github.io/svZeroDSolver/class_solver.html Sets up and initializes the simulation parameters and model. ```APIDOC ## setup_initial() ### Description Set up and initialize the simulation parameters and model. ### Method setup_initial ### Signature void Solver::setup_initial() ``` -------------------------------- ### double get(double time) Source: https://simvascular.github.io/svZeroDSolver/class_parameter.html Gets the parameter value at the specified time. ```APIDOC ## double get(double time) ### Description Gets the parameter value at the specified time. ### Method get ### Parameters - **time** (double) - Required - Time at which to evaluate the parameter. ### Returns double - The parameter value at the given time. ``` -------------------------------- ### JSON Configuration Example for ClosedLoopHeartAndPulmonary Source: https://simvascular.github.io/svZeroDSolver/_closed_loop_heart_pulmonary_8h_source.html Example JSON configuration for the closed_loop_blocks array, specifying outlet blocks, closed_loop_type, cardiac_cycle_period, and parameters for the heart and pulmonary model. ```json "closed_loop_blocks": [ { "outlet_blocks": [ "branch0_seg0" ], "closed_loop_type": "ClosedLoopHeartAndPulmonary", "cardiac_cycle_period": 1.0169, "parameters": { "Tsa": 0.40742, "tpwave": 8.976868, "Erv_s": 2.125279, "Elv_s": 3.125202, "iml": 0.509365, "imr": 0.806369, "Lrv_a": 0.000186865, "Rrv_a": 0.035061704, "Lra_v": 0.000217032, "Rra_v": 0.007887459, "Lla_v": 0.000351787, "Rla_v": 0.005310825, "Rlv_ao": 0.034320234, "Llv_a": 0.000110776, "Vrv_u": 9.424629, "Vlv_u": 5.606007, "Rpd": 0.098865401, "Cp": 1.090989, "Cpa": 0.556854, "Kxp_ra": 9.22244, "Kxv_ra": 0.004837, "Emax_ra": 0.208858, "Vaso_ra": 4.848742, "Kxp_la": 9.194992, "Kxv_la": 0.008067, "Emax_la": 0.303119, "Vaso_la": 9.355754 } } ], "initial_condition": { "V_RA:CLH": 38.43, "V_RV:CLH": 96.07, "V_LA:CLH": 38.43, "V_LV:CLH": 96.07, "P_pul:CLH": 8.0 } ``` -------------------------------- ### setup_integrator() Source: https://simvascular.github.io/svZeroDSolver/class_solver.html Sets up the integrator. ```APIDOC ## setup_integrator() ### Description Set up integrator. ### Method setup_integrator ### Signature void Solver::setup_integrator() ``` -------------------------------- ### Solver::setup_integrator() Source: https://simvascular.github.io/svZeroDSolver/_solver_8h_source.html Sets up the integrator for the simulation. ```APIDOC ## Solver::setup_integrator() ### Description Sets up the integrator. ### Method void ### Parameters None ### Returns void ``` -------------------------------- ### Solver::setup_integrator() Source: https://simvascular.github.io/svZeroDSolver/_solver_8h_source.html Sets up the integrator for time discretization. ```APIDOC ## Solver::setup_integrator() ### Description Sets up the integrator for time discretization. ``` -------------------------------- ### get_num_triplets() Source: https://simvascular.github.io/svZeroDSolver/class_block.html Get number of triplets of element. ```APIDOC ## get_num_triplets() ### Description Get number of triplets of element. Number of triplets that the element contributes to the global system (relevant for sparse memory reservation). ### Method Virtual member function ### Signature `TripletsContributions Block::get_num_triplets()` ### Returns - `TripletsContributions` - Number of triplets of element ``` -------------------------------- ### Python: SV0DTuner(config_file) Source: https://simvascular.github.io/svZeroDSolver/tuner_api.html Primary optimization API class. Initializes the tuner with a configuration file. ```APIDOC ## [Python] SV0DTuner(config_file: str) ### Description Initializes the primary optimization API with a configuration file. ### Constructor Parameters - **config_file** (str) - Required - Path to the tuning YAML configuration file. ``` -------------------------------- ### Python: SensitivityAnalyzer.run() Source: https://simvascular.github.io/svZeroDSolver/tuner_api.html Runs the sensitivity analysis and returns a dictionary keyed by QoI name. ```APIDOC ## [Python] SensitivityAnalyzer.run() -> Dict ### Description Runs the sensitivity analysis and returns a dictionary keyed by QoI name. ### Returns - **Dict** - Sensitivity results keyed by QoI name, each containing: first_order (Dict[str, float]), total_order (Dict[str, float]), mean, std, min, max (float). ``` -------------------------------- ### get_num_triplets() const Source: https://simvascular.github.io/svZeroDSolver/class_model.html Get number of triplets all elements. ```APIDOC ## get_num_triplets() const ### Description Get number of triplets all elements. ### Method Member function ### Signature TripletsContributions get_num_triplets() const ### Returns - **TripletsContributions** - The number of triplets. ``` -------------------------------- ### Model::get_parameter_value Source: https://simvascular.github.io/svZeroDSolver/_model_8h_source.html Gets the current value of a parameter. ```APIDOC ## Model::get_parameter_value ### Description Gets the current value of a parameter. ### Method double get_parameter_value(int param_id) const ### Parameters - **param_id** (int) - Required - Identifier of the parameter. ### Returns - **double** - Current value of the parameter. ``` -------------------------------- ### Optimization Configuration Schema Source: https://simvascular.github.io/svZeroDSolver/tuner_configuration.html Example YAML configuration for setting up an optimization task, including model path, parameter bounds, target objectives, and algorithm settings. ```yaml model: config_file: "model.json" parameters: - name: "LV.Emax" bounds: [1e7, 1e9] scaling: log targets: - name: Systemic arterial max pressure type: scalar expression: np.max(pressure:AV:AR_SYS) target_value: 13065 relative_bounds: 5% weight: 1.0 objective: norm: L1 optimization: algorithm: "differential_evolution" terminate_at_zero: true maxiter: 200 output: directory: "optimization_results" save_history: true save_plots: true save_final_config: true ``` -------------------------------- ### get_parameter(int param_id) Source: https://simvascular.github.io/svZeroDSolver/class_model.html Get a parameter by its global ID. ```APIDOC ## get_parameter(int param_id) ### Description Get a parameter by its global ID. ### Method Member function ### Signature Parameter* get_parameter(int param_id) ### Parameters - **param_id** (int) - Required - The global ID of the parameter. ### Returns - **Parameter*** - Pointer to the parameter. ``` -------------------------------- ### Build Documentation Locally Source: https://simvascular.github.io/svZeroDSolver/developer_guide.html Command to trigger the Doxygen build process for local documentation generation. ```bash doxygen docs/Doxyfile ``` -------------------------------- ### Run optimization Source: https://simvascular.github.io/svZeroDSolver/dir_93df0772b4c11809d264133600b0552f.html Execute the optimization process using the specified tuning configuration file. ```bash svzerodtuner optimize tuning_nelder_mead.yaml ``` -------------------------------- ### Solver::get_times() const Source: https://simvascular.github.io/svZeroDSolver/_solver_8h_source.html Gets the time steps of the result. ```APIDOC ## Solver::get_times() const ### Description Gets the time steps of the result. ### Method std::vector ### Parameters None ### Returns std::vector - The time steps. ``` -------------------------------- ### get_num_blocks(bool internal=false) const Source: https://simvascular.github.io/svZeroDSolver/class_model.html Get the number of blocks in the model. ```APIDOC ## get_num_blocks(bool internal=false) const ### Description Get the number of blocks in the model. ### Method Member function ### Signature int get_num_blocks(bool internal=false) const ### Parameters - **internal** (bool) - Optional - Whether to include internal blocks. Default is false. ### Returns - **int** - The number of blocks. ``` -------------------------------- ### Python: SensitivityAnalyzer(config_file) Source: https://simvascular.github.io/svZeroDSolver/tuner_api.html Primary sensitivity analysis API class. Initializes the analyzer with a configuration file. ```APIDOC ## [Python] SensitivityAnalyzer(config_file: str) ### Description Initializes the primary sensitivity analysis API with a configuration file. ### Constructor Parameters - **config_file** (str) - Required - Path to the tuning YAML configuration file. ``` -------------------------------- ### get_parameter_value(int param_id) const Source: https://simvascular.github.io/svZeroDSolver/class_model.html Get the current value of a parameter. ```APIDOC ## get_parameter_value(int param_id) const ### Description Get the current value of a parameter. ### Method Member function ### Signature double get_parameter_value(int param_id) const ### Parameters - **param_id** (int) - Required - The ID of the parameter. ### Returns - **double** - The current value of the parameter. ``` -------------------------------- ### setup_dofs function call Source: https://simvascular.github.io/svZeroDSolver/add_block.html The setup_dofs function typically only calls Block::setup_dofs_ with the number of equations and internal variable names. ```cpp Block::setup_dofs_(DOFHandler &dofhandler, int num_equations, const std::list &internal_var_names) ``` -------------------------------- ### get_node_name(int node_id) const Source: https://simvascular.github.io/svZeroDSolver/class_model.html Get the name of a node by its ID. ```APIDOC ## get_node_name(int node_id) const ### Description Get the name of a node by its ID. ### Method Member function ### Signature std::string get_node_name(int node_id) const ### Parameters - **node_id** (int) - Required - The ID of the node. ### Returns - **std::string** - The name of the node. ``` -------------------------------- ### Model::setup_initial_state_dependent_parameters Source: https://simvascular.github.io/svZeroDSolver/_model_8h_source.html Sets up model parameters that depend on the initial state. ```APIDOC ## Model::setup_initial_state_dependent_parameters ### Description Sets up model parameters that depend on the initial state. ### Method void setup_initial_state_dependent_parameters(State initial_state) ### Parameters - **initial_state** (State) - Required - The initial state vector. ``` -------------------------------- ### get_block_name(int block_id) const Source: https://simvascular.github.io/svZeroDSolver/class_model.html Get the name of a block by its ID. ```APIDOC ## get_block_name(int block_id) const ### Description Get the name of a block by its ID. ### Method Member function ### Signature std::string get_block_name(int block_id) const ### Parameters - **block_id** (int) - Required - The ID of the block. ### Returns - **std::string** - The name of the block. ``` -------------------------------- ### get_block(int block_id) const Source: https://simvascular.github.io/svZeroDSolver/class_model.html Get a block by its global ID. ```APIDOC ## get_block(int block_id) const ### Description Get a block by its global ID. ### Method Member function ### Signature Block* get_block(int block_id) const ### Parameters - **block_id** (int) - Required - The global ID of the block. ### Returns - **Block*** - Pointer to the block with the given ID. ``` -------------------------------- ### Run tuning with svzerodtuner optimize Source: https://simvascular.github.io/svZeroDSolver/dir_af714cb40d7a7d9dc52f0362415ea8fd.html Run one of the tuning configurations with the CLI. Two configs are provided: tuning_nelder_mead.yaml and tuning_differential_evolution.yaml. Nelder-Mead has produced more stable convergence for this model. ```bash svzerodtuner optimize tuning_nelder_mead.yaml ``` ```bash svzerodtuner optimize tuning_differential_evolution.yaml ``` -------------------------------- ### Model::get_largest_windkessel_time_constant Source: https://simvascular.github.io/svZeroDSolver/_model_8h_source.html Gets the largest Windkessel time constant in the model. ```APIDOC ## Model::get_largest_windkessel_time_constant ### Description Gets the largest Windkessel time constant in the model. ### Method double get_largest_windkessel_time_constant() ### Returns - **double** - Largest Windkessel time constant of the model. ```