Hi,
I am trying to find the right syntax to get the average outflow for individual. I can get the inflow using solver.get_single_result_avg("flow:INFLOW:branch0_seg0") but how would I get the outflow average for different branches? I've tried a couple different passes and keep getting a "map::at" error.
Thanks,
Ricardo
How to get branch outflows from svzerodsolver
- Ricardo Roopnarinesingh
- Posts: 15
- Joined: Fri Sep 17, 2021 9:56 am
- David Parker
- Posts: 1730
- Joined: Tue Aug 23, 2005 2:43 pm
Re: How to get branch outflows from svzerodsolver
Hi Ricardo,
The svZeroDSolver documentation states
It's not clear to me what a dof actually is. There is a section in the JSON input file named y: that has data like what you mentioned so maybe you could try flow:branch0_seg0:OUT.
Cheers,
Dave
The svZeroDSolver documentation states
Code: Select all
get_single_result_avg()
double Solver::get_single_result_avg ( const std::string & dof_name ) const
Get the result of a single DOF averaged over time.
Parameters
dof_name Name of the degree-of-freedom
Returns
double Result
Cheers,
Dave
- Ricardo Roopnarinesingh
- Posts: 15
- Joined: Fri Sep 17, 2021 9:56 am
Re: How to get branch outflows from svzerodsolver
I am getting the same map::at error using that syntax. The only flow I can get is the branch0_seg0 flow.
- Martin Pfaller
- Posts: 60
- Joined: Tue Oct 01, 2019 10:23 am
Re: How to get branch outflows from svzerodsolver
Have a look at the documentation:
https://simvascular.github.io/svZeroDSolver/
You could call solver.get_full_result(), which returns a pandas dataframe from which you can pick the results you'd like. You can see some post-processing in use when looking at the test framework:
https://github.com/SimVascular/svZeroDS ... s/utils.py
https://simvascular.github.io/svZeroDSolver/
You could call solver.get_full_result(), which returns a pandas dataframe from which you can pick the results you'd like. You can see some post-processing in use when looking at the test framework:
https://github.com/SimVascular/svZeroDS ... s/utils.py
- Ricardo Roopnarinesingh
- Posts: 15
- Joined: Fri Sep 17, 2021 9:56 am
Re: How to get branch outflows from svzerodsolver
I get a Segmentation Fault when I try to use the get_full_result() function. Here is the .json file I am using https://drive.google.com/file/d/1Bgy_eR ... sp=sharing. This file does work with the archived version of the 0d solver.
- Martin Pfaller
- Posts: 60
- Joined: Tue Oct 01, 2019 10:23 am
Re: How to get branch outflows from svzerodsolver
Can you open an issue for the seg fault (uploading the input file on GitHub)? Thank you!
For the outlets, you can use keys like "flow:branch18_seg2:RESISTANCE_10" or "flow:branch17_seg0:RESISTANCE_9". Make sure the branch/segment is connected to the respective outlet.
For the outlets, you can use keys like "flow:branch18_seg2:RESISTANCE_10" or "flow:branch17_seg0:RESISTANCE_9". Make sure the branch/segment is connected to the respective outlet.