Exporting to vtp
- Hadi Wiputra
- Posts: 13
- Joined: Sat Jul 07, 2018 11:32 pm
Exporting to vtp
Hi all,
I've recently ran my first simvascular code in MSI using SvSolver, and it returns the restart files .
Right now, i need to download and convert the restart files into .vtp files in simvascular GUI. I wonder if there is a fast way to do it, maybe defining the conversion in the .inp file?
Thank you.
Regards,
Hadi
I've recently ran my first simvascular code in MSI using SvSolver, and it returns the restart files .
Right now, i need to download and convert the restart files into .vtp files in simvascular GUI. I wonder if there is a fast way to do it, maybe defining the conversion in the .inp file?
Thank you.
Regards,
Hadi
- David Parker
- Posts: 1757
- Joined: Tue Aug 23, 2005 2:43 pm
Re: Exporting to vtp
Hello Hadi,
The svSolver software has a program called svpost that is used to convert restart files to vtk files. Running svpost -h gives you its command-line options. I typically run it from a shell script like this
svpost does not compute average values at inlets and outlets files though.
Cheers,
Dave
The svSolver software has a program called svpost that is used to convert restart files to vtk files. Running svpost -h gives you its command-line options. I typically run it from a shell script like this
Code: Select all
svpost=/usr/local/sv/svsolver/2019-01-19/bin/svpost
indir=4-procs_case
outdir=export
start=100
stop=500
inc=100
$svpost -all \
-indir ${indir} \
-outdir ${outdir} \
-start ${start} \
-stop ${stop} \
-incr ${inc} \
-vtp all_results \
-vtu all_results
Cheers,
Dave
- Hadi Wiputra
- Posts: 13
- Joined: Sat Jul 07, 2018 11:32 pm
Re: Exporting to vtp
Hi Dave,
Thank you for the reply, it would definitely speed up the post proc. I saw that there is a similar command in SvFSI solver.inp file:
Save results to VTK format: 1
Name prefix of saved VTK files: result
Increment in saving VTK files: 10
Start saving after time step: 1
I wonder why it is not implemented in svSolver, just curious.
Regards,
Hadi
Thank you for the reply, it would definitely speed up the post proc. I saw that there is a similar command in SvFSI solver.inp file:
Save results to VTK format: 1
Name prefix of saved VTK files: result
Increment in saving VTK files: 10
Start saving after time step: 1
I wonder why it is not implemented in svSolver, just curious.
Regards,
Hadi
- David Parker
- Posts: 1757
- Joined: Tue Aug 23, 2005 2:43 pm
Re: Exporting to vtp
Hello Hadi,
The svSolver code has been around for a long time, before VTK, so the VTK conversion was added much later.
Cheers,
Dave
The svSolver code has been around for a long time, before VTK, so the VTK conversion was added much later.
Cheers,
Dave
- Mandar Kulkarni
- Posts: 16
- Joined: Tue Jul 13, 2021 10:38 am
- David Parker
- Posts: 1757
- Joined: Tue Aug 23, 2005 2:43 pm
Re: Exporting to vtp
Hi Mandar,
You can create the flow files using the SV GUI, need to move the restart files to your local computer.
I also wrote a C++ program to create these files. See https://github.com/ktbolt/cardiovascula ... flow-files.
Cheers,
Dave
You can create the flow files using the SV GUI, need to move the restart files to your local computer.
I also wrote a C++ program to create these files. See https://github.com/ktbolt/cardiovascula ... flow-files.
Cheers,
Dave
- Mandar Kulkarni
- Posts: 16
- Joined: Tue Jul 13, 2021 10:38 am
Re: Exporting to vtp
Hi Dave,
This is exactly what I was looking for.. I will give it a try and get back to you.
Thanks much!!
Mandar
This is exactly what I was looking for.. I will give it a try and get back to you.
Thanks much!!
Mandar
- Mandar Kulkarni
- Posts: 16
- Joined: Tue Jul 13, 2021 10:38 am
Re: Exporting to vtp
The C++ program works as intended and all_results-flow.txt, all_results-pressure.txt values match exactly with what the SV GUI outputs.
Also, just to report the success of using svpost, here is how I used svpost to output the vtp, vtu and restart files:
and I get the these output files:
restart.100.0 (because I had the options -ph -laststep),
all_results.vtu (because I had the options -vtu all_results.vtu, followed by -vtkcombo)
all_results.vtp (because I had the options -vtp all_results.vtp, followed by -vtkcombo)
On svpost -h, I saw these options
What does the nonbinary option do and what is the Vis-format?
Thanks,
Mandar
Also, just to report the success of using svpost, here is how I used svpost to output the vtp, vtu and restart files:
Code: Select all
svpost -all -start 0 -stop 100 -incr 50 -ph -laststep -vtu all_results.vtu -vtp all_results.vtp -vtkcombo -indir 16-procs_case -outdir converted-results
restart.100.0 (because I had the options -ph -laststep),
all_results.vtu (because I had the options -vtu all_results.vtu, followed by -vtkcombo)
all_results.vtp (because I had the options -vtp all_results.vtp, followed by -vtkcombo)
On svpost -h, I saw these options
Code: Select all
-nonbinary : Read/Write files in ASCII format
-vis file_prefix : Write Vis-format results file
-vismesh filename : Write Vis-format mesh file
Thanks,
Mandar
- David Parker
- Posts: 1757
- Joined: Tue Aug 23, 2005 2:43 pm
Re: Exporting to vtp
Hi Mandar,
It appears that the -nonbinary option can only be used to read results that have been saved as ascii files. It does not seem to be used to write VTP files in ascii as I thought it would, caused svpost to fail.
The -vis flag is used to write results in an ascii format that was used by a now ancient visualization program. For example
Cheers,
Dave
It appears that the -nonbinary option can only be used to read results that have been saved as ascii files. It does not seem to be used to write VTP files in ascii as I thought it would, caused svpost to fail.
The -vis flag is used to write results in an ascii format that was used by a now ancient visualization program. For example
Code: Select all
region "fluid_region"
time step 1
time 1.0
analysis results "pressure"
number of data 8595
type "nodal"
order "scalar"
length 1
data
-2.870094639730830e+00
3.259296010619859e+00
7.400246868472002e+00
1.658926949158073e+01
.
.
.
analysis results "velocity"
number of data 8595
type "nodal"
order "vector"
number of components 3
components
"x"
"y"
"z"
end components
length 3
data
0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00
0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00
0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00
0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00
.
.
.
Cheers,
Dave
- Mandar Kulkarni
- Posts: 16
- Joined: Tue Jul 13, 2021 10:38 am
Re: Exporting to vtp
That explains it, thanks!
Mandar
Mandar