SimVascular / svZeroDSolver

A C++ lumped-parameter solver for blood flow and pressure in hemodynamic networks
https://simvascular.github.io/documentation/rom_simulation.html#0d-solver
Other
7 stars 18 forks source link

Function input feature for time-dependent boundary conditions #108

Open kharold23 opened 5 months ago

kharold23 commented 5 months ago

Current situation

Closes #89

Release Notes

Documentation

Time-dependent boundary conditions can now be input using a function passed in as a string. The function is of the variable t, or time. For example: "bc_values": { "fn": "2.0 * (4*atan(1.)) * COS(2.0 * (4*atan(1.)) * t)" }

Testing

Test case test_time_dependent_block added to test_io.py, which runs json files timeDep_Flow.json and timeDep_Pressure.json.

Code of Conduct & Contributing Guidelines

ktbolt commented 5 months ago

I ran the pulsatileFlow_CStenosis_steadyPressure case on Ubuntu 22 and got the following exception

terminate called after throwing an instance of 'std::runtime_error'
  what():  Maximum number of non-linear iterations reached.

You need to add catching exceptions in the Python testing code.

ktbolt commented 5 months ago

We don't want to mix external software with our source code so the exprtk.hpp file should not be in svZeroDSolver/src/. We need to add a ThirdParty directory and put the exprtk.hpp file in a sub-directory of it.

ktbolt commented 5 months ago

Also I see that there is Docker container file in svZeroDSolver/container/profiling for Ubuntu 22, you can use this to test I think.

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 74.69880% with 21 lines in your changes missing coverage. Please review.

Project coverage is 25.12%. Comparing base (688cece) to head (e6760c6).

Files Patch % Lines
src/solve/SimulationParameters.cpp 73.80% 11 Missing :warning:
src/model/Parameter.cpp 65.51% 10 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #108 +/- ## =========================================== - Coverage 79.25% 25.12% -54.14% =========================================== Files 52 53 +1 Lines 2179 15401 +13222 Branches 278 1405 +1127 =========================================== + Hits 1727 3869 +2142 - Misses 452 11532 +11080 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.