Commandline usage of svPost

Provides a system for patient-specific cardiovascular modeling and simulation.
POST REPLY
User avatar
Rok Oblak
Posts: 33
Joined: Sat Jul 02, 2016 7:15 am

Commandline usage of svPost

Post by Rok Oblak » Sat Jul 09, 2016 12:53 pm

Hi,

my intention is the use of SimVascular entirely through the command line, without the GUI. I am able to do the svPre and svSolver successfully (right now trying on the cylinder example), generating the set of restart files. However, I cannot do much with these files alone as I also need to do the svPost to generate the .vtu files.

The problem is that I can't seem to find any documentation documenting the use of svPost command. I managed to figure out it uses the -start, -end and -increment parameters, specifying the step range, but running this command gives no results (no files are generated in the working folder). What command should I use to generate the all_results.vtu (and the all_results_xxxxx.vtu series) files?

Thanks and best regards

User avatar
Hongzhi Lan
Posts: 125
Joined: Mon Aug 04, 2014 3:55 pm

Re: Commandline usage of svPost

Post by Hongzhi Lan » Sun Jul 10, 2016 1:50 pm

Hi Rok,

Glad to know you are able to use SimVascular by command lines. For svPost, you can type the command line "svpost -h" to get the whole list of options with brief explanation for the svpost.

SimVascular Development Team

User avatar
Rok Oblak
Posts: 33
Joined: Sat Jul 02, 2016 7:15 am

Re: Commandline usage of svPost

Post by Rok Oblak » Fri Jul 15, 2016 12:09 pm

Hi,

thank you very much for that info. Using the -h command I was able to generate the .vtu files.

Sample svPost usage in case someone wonders:

svpost -all -vtu filenameofyourresults -start 0 -stop 200 -incr 10 -vtkcombo


all arguments:

COMMAND-LINE ARGUMENT SUMMARY
-h : Display usage and command-line argument summary
-sn stepnumber : Specify single step number to reduce
-start stepnumber : Specify starting step number
-stop stepnumber : Specify stopping step number
-newsn stepnumber : override step number in file
-incr increment : Specify increment between steps
-ph : Write flowsolver-format file restart.<stepnumber>.0
-laststep : Only write last step to file restart.<stepnumber>.0
-vis file_prefix : Write Vis-format results file
-vismesh filename : Write Vis-format mesh file
-vtu prefix or file : Write VTK XML UnstructuredGrid
-vtp prefix or file : Write Surface Only VTK XML PolyData
-vtkcombo : Combine all VTK in single file
-sol : Reduce solution(pressure and velocity)
-traction : Reduce in-plane traction
-disp : Reduce displacements
-wallprop : Reduce wall properties
-rho : Fluid density
-mu : Fluid viscosity
-td : Reduce time-derivative field
-wss : Reduce Wall Shear Stress
-wfilter filename : output wall data only on specified wall
-calcws : Recalculate wall stress on specified wall
-applywd : Apply wall deformation during wall stress calculation
-ybar : Reduce average speed and pressure
-yerror : Reduce speed and pressure errors
-nonbinary : Read/Write files in ASCII format
-all : Reduce all available data
-sim_units_mm : set sim units to mm
-sim_units_cm : set sim units to cm (default)
-indir : directory containing restart files (default .)
-outdir : directory containing output files (default .)
-res : Compares residual profiles on histor.dat files
and writes a report to residualDiff.out
-compare : Compare pressures and velocities in result VTU files
and writes a report to vtuDiff.out




Best regards,

Rok

User avatar
Eileen Hwuang
Posts: 7
Joined: Tue Dec 12, 2017 7:25 am

Re: Commandline usage of svPost

Post by Eileen Hwuang » Fri Jan 18, 2019 9:40 am

Hi,

I have been using the SimVascular GUI to generate the result files and want to migrate to using command line and svPost. I like that the GUI also conveniently outputs text files called "all_results-flows.txt" and "all_results-pressures.txt." I have been able to generate vtu and vtp files with svPost, but not these text files. Does someone know the correct command to get the text files?

Thanks,
Eileen

User avatar
David Parker
Posts: 1629
Joined: Tue Aug 23, 2005 2:43 pm

Re: Commandline usage of svPost

Post by David Parker » Sat Jan 19, 2019 1:40 pm

Hi Eileen,

The all_results-flows.txt and all_results-pressures.txt files are created in SimVascular and not svpost. This functionality should really be in svpost so I will open an Issue for this.

As a temporary solution you can copy the simulation results files locally and convert them using SimVascular Simulation plugin which allows you to give the directory where the restart files are located.

Cheers,
Dave

User avatar
Eileen Hwuang
Posts: 7
Joined: Tue Dec 12, 2017 7:25 am

Re: Commandline usage of svPost

Post by Eileen Hwuang » Tue Jan 29, 2019 12:33 pm

Hi Dave,

Thank you for your response and for filing an Issue for svPost. The underlying reason I was interested in working completely with the command line is because I am trying to construct a numerical optimization framework for running multiple iterations of svsolver simulations to optimize the RCR BCs for a target outlet pressure waveform, i.e. writing a script that would repeatedly call svsolver with different sets of RCR values based on the outlet pressure waveform at each iteration. I have been reading around the forum and have not found anyone mentioning something similar. Do you know if anyone has tried this before and if it can be done currently? In my mind, I don't think this can be done without some way of generating all-results-pressures.txt file without the GUI. Would it be possible to do it from the raw simulation results files like restart.0.1, restart.0.2, etc.?

Thanks,
Eileen

User avatar
David Parker
Posts: 1629
Joined: Tue Aug 23, 2005 2:43 pm

Re: Commandline usage of svPost

Post by David Parker » Wed Jan 30, 2019 12:02 pm

Hi Eileen,

There are people in the Marsden Lab doing this type of thing I believe. Let me try to find out more information about this.

Cheers,
Dave

User avatar
Aekaansh Verma
Posts: 2
Joined: Thu Oct 09, 2014 12:47 am

Re: Commandline usage of svPost

Post by Aekaansh Verma » Wed Jan 30, 2019 2:20 pm

Hi Eileen,

If I understand correctly, you are interested in processing the pressure and flow rates at the outflows of your 3D model which connect to RCR elements, in order to tune your boundary conditions. For simulations with RCR boundary conditions, simvascular generates PHistRCR.dat and QHistRCR.dat within the simulation directory. These files have pressures and flows at each of the outflows in a column format for each time step. The outlets are arranged in the order that you assign them in your presolve step. This should let you avoid using the all-results-pressure/flow files.

A note on using numerical optimization for tuning boundary conditions: If you have a large number of RCR parameters to tune, it may take a large number of simulations to tune each of the values. I would suggest taking a hierarchical approach by tuning for the total resistances (proximal+distal resistance) at each of the outlets to match a desired flow split across all outlets BEFORE moving to a full optimization for matching the waveform. If your model geometry is 'nice' (eg. doesn't have a lot of nonlinear resistance), the former is typically much easier. Once you have matched flow splits, you can also often fix the total resistance for an RCR element as another lower-dimensional step when tuning capacitances.

Aekaansh

User avatar
Eileen Hwuang
Posts: 7
Joined: Tue Dec 12, 2017 7:25 am

Re: Commandline usage of svPost

Post by Eileen Hwuang » Thu Jan 31, 2019 12:18 pm

Thanks Dave.

Hi Aekaansh,

Thank you for pointing me to the PHistRCR.dat and QHistRCR.dat files. Those are just what I need. I also appreciate the helpful hints on designing the numerical optimization framework in hierarchical fashion.

Eileen

POST REPLY