Convert results programmatically Windows

Provides a system for patient-specific cardiovascular modeling and simulation.
User avatar
Anastasios Raptis
Posts: 12
Joined: Fri Sep 14, 2018 11:19 am

Convert results programmatically Windows

Post by Anastasios Raptis » Mon Sep 02, 2019 2:13 am

Hi, I am using SimVascular in Windows and I am interested in converting the simulation results programmatically (command prompt or through Python).

I saw in a previous post the following command that I think it only works with the Linux distribution:
//to create multiple files and each of them has data for one time step
svpost -all -indir [sim result folder] -outdir [output folder] -start [start time step] -stop [stop time step] -incr [time step increment] -vtp all_resutls -vtu all_results

Is there a way to do it in Windows?

Best,
Tasos

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

Re: Convert results programmatically Windows

Post by David Parker » Tue Sep 03, 2019 11:20 am

Hi Tasos,

You can run svpost from the command line on Windows 10 by installing Cygwin https://www.cygwin.com/. Cygwin provides a Unix-like shell you can use to execute the bash scripts in C:\Program Files\SimVascular\svSolver\2019-05-26\.

Cheers,
Dave

User avatar
Anastasios Raptis
Posts: 12
Joined: Fri Sep 14, 2018 11:19 am

Re: Convert results programmatically Windows

Post by Anastasios Raptis » Thu Sep 05, 2019 1:32 am

Hi Dave,

Thanks a lot for the tip!

I know this might not be an issue with svpost, but when I run the command from cygwin, it returns error opening the restart file. I start cygwin as administrator nevertheless.

Does it happen that you know what's going wrong?

Cheers,
Tasos

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

Re: Convert results programmatically Windows

Post by David Parker » Thu Sep 05, 2019 10:38 am

Hi Tasos,

It seems that the svpost bash script is not correct on Window, it is setting $SV_HOME=/usr/local/package/svsolver/2019-05-28 which does not exist.

You can execute svpost-bin.exe directly I think, I'm able to do this on other platforms.

Cheers,
Dave

User avatar
Anastasios Raptis
Posts: 12
Joined: Fri Sep 14, 2018 11:19 am

Re: Convert results programmatically Windows

Post by Anastasios Raptis » Fri Sep 06, 2019 4:58 am

Hi Dave,

Basically I am getting the error when running svpost-bin.exe directly as the bash script was indeed pointing to another folder.

The same happens (error opening restart file) with other cases in other folders as well.

Thanks for the help.

Best,
Tasos

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

Re: Convert results programmatically Windows

Post by David Parker » Sat Sep 07, 2019 11:07 am

Hi Tasos,

Could you please show me the list the files in the folder that your results are in and the svpost command you are using?

The folder containing the simulation results should look something like this

Code: Select all

bct.dat
bct.vtp
echo.dat
geombc.dat.1
histor.dat
inflow.flow
mesh-complete/
numstart.dat
restart.0.1
restart.10.1
restart.100.1
restart.110.1
restart.120.1
restart.130.1
restart.140.1
restart.150.1
restart.160.1
restart.170.1
restart.180.1
restart.190.1
restart.20.1
restart.200.1
restart.30.1
restart.40.1
restart.50.1
restart.60.1
restart.70.1
restart.80.1
restart.90.1
solver.inp
steady.svpre
svLS_NS.log
The command to convert the results looks something like this

svpost -all -indir -outdir /SimVascular/CylinderProject/Simulations/steady/output -start 0 -stop 100 -incr 10 -vtp all_resutls -vtu all_results

You must have restart files that match the ranges of values you use for -start and -stop and -incr, e.g. restart.0.1, restart.10.1
restart.100.1. Using -incr 1 would not work because there are no restart.1.1, restart.2.1, etc. files.

Cheers,
Dave

User avatar
Anastasios Raptis
Posts: 12
Joined: Fri Sep 14, 2018 11:19 am

Re: Convert results programmatically Windows

Post by Anastasios Raptis » Mon Sep 09, 2019 3:56 am

Hi Dave,

I attach an image with the list of files in the results folder.
Capture.PNG
Capture.PNG (7.16 KiB) Viewed 544 times
I change the path to /cygdrive/c/'Program Files'/SimVascular/svSolver/2019-05-28 and I am running the following command:

./svpost-bin.exe -all -indir /cygdrive/d/Projects/Hemodynamics/Simulations/250K_C_0002/4-procs_case -outdir /cygdrive/d/Projects/Hemodynamics/Simulations/250K_C_0002/4-procs_case -start 0 -stop 780 -incr 10 -vtp all_results -vtu all_results

The increment value is according to the exported restart files as you said.

Thanks,
Tasos

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

Re: Convert results programmatically Windows

Post by David Parker » Tue Sep 10, 2019 9:08 pm

Hi Tasos,

You do have a restart.780.1, restart.780.2, restart.780.3 and restart.780.4, files yes? I didn't see them listed in the image of the files you attached.

Cheers,
Dave

User avatar
Anastasios Raptis
Posts: 12
Joined: Fri Sep 14, 2018 11:19 am

Re: Convert results programmatically Windows

Post by Anastasios Raptis » Wed Sep 11, 2019 3:57 am

Hi Dave,

Yes, I confirm that there are also restart.780.1, restart.780.2, restart.780.3 and restart.780.4 files in the folder.

Thanks,
Tasos

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

Re: Convert results programmatically Windows

Post by David Parker » Wed Sep 11, 2019 11:40 am

Hi Tasos,

I created a Virtual Machine for WIndows 10 and downloaded some simulation results. I got the same error you did when giving the input directory on the command line. I tried executing svpost-bin.exe in my results directory and that worked. So instead of using

Code: Select all

./svpost-bin.exe -all -indir /cygdrive/d/Projects/Hemodynamics/Simulations/250K_C_0002/4-procs_case -outdir /cygdrive/d/Projects/Hemodynamics/Simulations/250K_C_0002/4-procs_case -start 0 -stop 780 -incr 10 -vtp all_results -vtu all_results
do this

Code: Select all

$ cd /cygdrive/d/Projects/Hemodynamics/Simulations/250K_C_0002/4-procs_case
$ /cygdrive/c/'Program Files'/SimVascular/svSolver/2019-05-28/svpost-bin.exe -all -indir . -outdir . -start 0 -stop 780 -incr 10 -vtp all_results -vtu all_results
It seems that the gzopen() function used to read results is not handling the /cygdrive directory correctly, not sure why.

Cheers,
Dave

POST REPLY