1D Modeling VTK Export Option
- Sohrab Tehrani
- Posts: 17
- Joined: Sun May 03, 2020 4:53 pm
1D Modeling VTK Export Option
Dear SimVascular Team,
I have a question regarding the exportation of the 1D modeling outputs as .VTK files. I know that we can change this option directly from solver.in file and the solver will automatically write the modeling outputs as VTK format which can be subsequently used in paraview for animation creation.
Now, assume that we have solved the 1D governing equations for the same geometry, with the same boundary conditions and material properties, but with some other solver. Now we have Area, Flow, and Pressure as a function of x,t for all segments as text files and I would like to convert those results to VTK format and visualize my results in paraview using the SimVascular VTK export option. Is that possible to do so?
I appreciate your help in advance
Sohrab
I have a question regarding the exportation of the 1D modeling outputs as .VTK files. I know that we can change this option directly from solver.in file and the solver will automatically write the modeling outputs as VTK format which can be subsequently used in paraview for animation creation.
Now, assume that we have solved the 1D governing equations for the same geometry, with the same boundary conditions and material properties, but with some other solver. Now we have Area, Flow, and Pressure as a function of x,t for all segments as text files and I would like to convert those results to VTK format and visualize my results in paraview using the SimVascular VTK export option. Is that possible to do so?
I appreciate your help in advance
Sohrab
- Martin Pfaller
- Posts: 60
- Joined: Tue Oct 01, 2019 10:23 am
Re: 1D Modeling VTK Export Option
Hi Sohrab,
Unfortunately, the conversion you're talking about happens inside svOneDSolver, so it won't work with your solver.
I'm currently including a method to export 1D results to the centerline .vtp. You can check it out in my fork of SimVascular:
https://github.com/mrp089/SimVascular/b ... ts/post.py
If that suits your purpose, you could take my code and include a small function to read your results in the same format to do the same export.
Let me know if you have more questions!
Out of curiosity, what 1D solver are you using?
Martin
Unfortunately, the conversion you're talking about happens inside svOneDSolver, so it won't work with your solver.
I'm currently including a method to export 1D results to the centerline .vtp. You can check it out in my fork of SimVascular:
https://github.com/mrp089/SimVascular/b ... ts/post.py
If that suits your purpose, you could take my code and include a small function to read your results in the same format to do the same export.
Let me know if you have more questions!
Out of curiosity, what 1D solver are you using?
Martin
- Sohrab Tehrani
- Posts: 17
- Joined: Sun May 03, 2020 4:53 pm
Re: 1D Modeling VTK Export Option
Hello Martin,
Thanks for your response. I'll look at your code and will let you know if I could run it. I use Nektar1D solver. Another question:
In the "solver.in" file that SimVascular automatically generates to run the 1D solver, we need to specify the inlet and outlet area of each segment in the SEGMENT CARD. However, assume that for one of the segments in our arterial tree, I need to specify the cross-sectional areas at each spatial position x during that segment (instead of just specifying the inlet and outlet areas). In other words, I need to specify the shape of the vessel. How I can do this inside SimVascular and how should I modify the "solver.in" file to take that into account?
Thanks so much for your response.
Sohrab
Thanks for your response. I'll look at your code and will let you know if I could run it. I use Nektar1D solver. Another question:
In the "solver.in" file that SimVascular automatically generates to run the 1D solver, we need to specify the inlet and outlet area of each segment in the SEGMENT CARD. However, assume that for one of the segments in our arterial tree, I need to specify the cross-sectional areas at each spatial position x during that segment (instead of just specifying the inlet and outlet areas). In other words, I need to specify the shape of the vessel. How I can do this inside SimVascular and how should I modify the "solver.in" file to take that into account?
Thanks so much for your response.
Sohrab
- Martin Pfaller
- Posts: 60
- Joined: Tue Oct 01, 2019 10:23 am
Re: 1D Modeling VTK Export Option
Hi Sohrab,
You can specify the number of sampling points within a branch in SimVascular. That will sample the area at points inside the branch and not just at the inlet and outlet. This will translate to several 1D segments per vessel branch
If you're using the GUI, inside the "SV 1D Simulation" plugin you can set the option "Number of segments per branch" to >1.
If you're using the Python, you can set the parameters seg_min_num (Min number of sub-segments in a vessel master-segment) and seg_size (Sub-segment size in a vessel-master segment). If you set seg_min_num = -1 you get a 1D segment for every segment of the centerline (very fine).
Best
Martin
You can specify the number of sampling points within a branch in SimVascular. That will sample the area at points inside the branch and not just at the inlet and outlet. This will translate to several 1D segments per vessel branch
If you're using the GUI, inside the "SV 1D Simulation" plugin you can set the option "Number of segments per branch" to >1.
If you're using the Python, you can set the parameters seg_min_num (Min number of sub-segments in a vessel master-segment) and seg_size (Sub-segment size in a vessel-master segment). If you set seg_min_num = -1 you get a 1D segment for every segment of the centerline (very fine).
Best
Martin
- Sohrab Tehrani
- Posts: 17
- Joined: Sun May 03, 2020 4:53 pm
Re: 1D Modeling VTK Export Option
Hello Martin
Thanks for your response. Unfortunately, I cannot find the option "Number of segments per branch" inside the "SV 1D Simulation" plugin. Should I update my SimVasular?
Best,
Sohrab
Thanks for your response. Unfortunately, I cannot find the option "Number of segments per branch" inside the "SV 1D Simulation" plugin. Should I update my SimVasular?
Best,
Sohrab
- Martin Pfaller
- Posts: 60
- Joined: Tue Oct 01, 2019 10:23 am
- Mohammad Sarabian
- Posts: 4
- Joined: Mon Mar 23, 2020 3:48 pm
Re: 1D Modeling VTK Export Option
Thanks Martin,
It worked. I have another question regarding the exportation of the 1D modeling outputs as .VTK files. Currently, if we set to export the data files as .VTK file, SimVascular maps the flow variables on the straight tubes. In other words, it maps the 1D simulation outputs on an arterial network that consists of several straight tubes and doesn't map them on the actual centerlines that have curvature and tortuosity. How can I change that to map them on the centerlines with curvature rather than straight tubes. This is important for me for the flow visualization.
Thanks so much for your response in advance.
Best,
Sohrab
It worked. I have another question regarding the exportation of the 1D modeling outputs as .VTK files. Currently, if we set to export the data files as .VTK file, SimVascular maps the flow variables on the straight tubes. In other words, it maps the 1D simulation outputs on an arterial network that consists of several straight tubes and doesn't map them on the actual centerlines that have curvature and tortuosity. How can I change that to map them on the centerlines with curvature rather than straight tubes. This is important for me for the flow visualization.
Thanks so much for your response in advance.
Best,
Sohrab
- Martin Pfaller
- Posts: 60
- Joined: Tue Oct 01, 2019 10:23 am
Re: 1D Modeling VTK Export Option
Hi Sohrab,
I'm glad it worked! We are currently implementing what you're looking for. I'll let you know once we have merged that feature into SimVascular!
Martin
I'm glad it worked! We are currently implementing what you're looking for. I'll let you know once we have merged that feature into SimVascular!
Martin
- Martin Pfaller
- Posts: 60
- Joined: Tue Oct 01, 2019 10:23 am
Re: 1D Modeling VTK Export Option
We now included your feature in SimVascular. We're still experimenting it, but you can go ahead and pull the current master. Please let us know how it works!