Page 1 of 2
Convert results programmatically Windows
Posted: Mon Sep 02, 2019 2:13 am
by raptistasos
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
Re: Convert results programmatically Windows
Posted: Tue Sep 03, 2019 11:20 am
by davep
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
Re: Convert results programmatically Windows
Posted: Thu Sep 05, 2019 1:32 am
by raptistasos
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
Re: Convert results programmatically Windows
Posted: Thu Sep 05, 2019 10:38 am
by davep
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
Re: Convert results programmatically Windows
Posted: Fri Sep 06, 2019 4:58 am
by raptistasos
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
Re: Convert results programmatically Windows
Posted: Sat Sep 07, 2019 11:07 am
by davep
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
Re: Convert results programmatically Windows
Posted: Mon Sep 09, 2019 3:56 am
by raptistasos
Hi Dave,
I attach an image with the list of files in the results folder.
- Capture.PNG (7.16 KiB) Viewed 543 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
Re: Convert results programmatically Windows
Posted: Tue Sep 10, 2019 9:08 pm
by davep
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
Re: Convert results programmatically Windows
Posted: Wed Sep 11, 2019 3:57 am
by raptistasos
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
Re: Convert results programmatically Windows
Posted: Wed Sep 11, 2019 11:40 am
by davep
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