Error generating Mesh
- Sohrab Tehrani
- Posts: 17
- Joined: Sun May 03, 2020 4:53 pm
Error generating Mesh
Hello,
I tried to generate mesh on my Circle of Willis model that I import it as an .stl file, but I constantly get the following error message:
"ERROR: TetGen quit and returned error code 3".
Note that in the .stl file I just tried to generate mesh on the left part and I delete all the faces corresponding to the right part of the model.
I am taking the following steps:
1. Select models -> import solid model
2. Select my stl file and name it
3. Use face extraction with face separation angle of 30deg
4. Select create mesh, use tetgen and our model
6. I review the face list and select entries as walls and caps as necessary. There is one walls surface, 1 cap for the inlet and 2 caps for the outlets.
7. I select fill holes with IDs which makes another entry in the face list (this does not seem to correspond to any geometry in the 3D model viewer).
8. Estimate size reports 0.0259
9. I run the mesher, which ultimately fails, where the following appears in the terminal upon failure:
Checking surface mesh
Regions: 1
Number of Free Edges on Surface: 2151
Number of Non-Manifold Edges on Surface: 0
Got Volume Mesh Func!
untangle procedure..
Iteration 1/10
Iteration 2/10
Iteration 3/10
Iteration 4/10
Iteration 5/10
Iteration 6/10
Iteration 7/10
Iteration 8/10
Iteration 9/10
Iteration 10/10
Final mesh improvement
Got Volume Mesh Func!
Converting to TetGen...
Converting Points...
Converting Faces...
Adding mesh sizing metric...
TetGen Meshing Started...
Delaunizing vertices...
Delaunay seconds: 2.0377
Creating surface mesh ...
Found two overlapping facets.
1st: [245286, 245287, 370706] #1
2nd: [245286, 245287, 370706] #0
ERROR: TetGen quit and returned error code 3
Please advise, and thank you
PS:I cannot attach my .stl file directly here in the forums because the file is too large. Please message or email me and I can share the file with you!
I tried to generate mesh on my Circle of Willis model that I import it as an .stl file, but I constantly get the following error message:
"ERROR: TetGen quit and returned error code 3".
Note that in the .stl file I just tried to generate mesh on the left part and I delete all the faces corresponding to the right part of the model.
I am taking the following steps:
1. Select models -> import solid model
2. Select my stl file and name it
3. Use face extraction with face separation angle of 30deg
4. Select create mesh, use tetgen and our model
6. I review the face list and select entries as walls and caps as necessary. There is one walls surface, 1 cap for the inlet and 2 caps for the outlets.
7. I select fill holes with IDs which makes another entry in the face list (this does not seem to correspond to any geometry in the 3D model viewer).
8. Estimate size reports 0.0259
9. I run the mesher, which ultimately fails, where the following appears in the terminal upon failure:
Checking surface mesh
Regions: 1
Number of Free Edges on Surface: 2151
Number of Non-Manifold Edges on Surface: 0
Got Volume Mesh Func!
untangle procedure..
Iteration 1/10
Iteration 2/10
Iteration 3/10
Iteration 4/10
Iteration 5/10
Iteration 6/10
Iteration 7/10
Iteration 8/10
Iteration 9/10
Iteration 10/10
Final mesh improvement
Got Volume Mesh Func!
Converting to TetGen...
Converting Points...
Converting Faces...
Adding mesh sizing metric...
TetGen Meshing Started...
Delaunizing vertices...
Delaunay seconds: 2.0377
Creating surface mesh ...
Found two overlapping facets.
1st: [245286, 245287, 370706] #1
2nd: [245286, 245287, 370706] #0
ERROR: TetGen quit and returned error code 3
Please advise, and thank you
PS:I cannot attach my .stl file directly here in the forums because the file is too large. Please message or email me and I can share the file with you!
Last edited by Sohrab Tehrani on Thu May 21, 2020 12:28 pm, edited 1 time in total.
- David Parker
- Posts: 1716
- Joined: Tue Aug 23, 2005 2:43 pm
Re: Error generating Mesh
Hi Sohrab,
Building a good model from STL can sometimes be challenging. Depending on the source the geometry may not be well-defined (i.e. gaps in the model).
If the model is well-defined then you should only need to extract faces to define the inlet and outlet faces. If filling a hole created a new face then I think there is something wrong with the geometry.
If you upload the STL file someplace I can download it then I'll have a look.
Cheers,
Dave
Building a good model from STL can sometimes be challenging. Depending on the source the geometry may not be well-defined (i.e. gaps in the model).
If the model is well-defined then you should only need to extract faces to define the inlet and outlet faces. If filling a hole created a new face then I think there is something wrong with the geometry.
If you upload the STL file someplace I can download it then I'll have a look.
Cheers,
Dave
- Sohrab Tehrani
- Posts: 17
- Joined: Sun May 03, 2020 4:53 pm
Re: Error generating Mesh
Dear David,
Thanks for your response. Please download the .stl file (CoW.stl) from the following link:
https://catmailohio-my.sharepoint.com/: ... 1&e=cdzIav
Please note that I want to do the simulation of the left and right part separately. So, I delete the faces of one side and keep the faces of the other side. Also my first goal was to do the 1D simulation, but with this geometry SimVascular fails to compute the centerlines correctly. For example, it may compute only one branch and misses the other branches. So, I think you're right and there is something wrong with the geometry. If that is the case, could you please help me to fix the geometry? What should I do to fix it?
Thanks again,
Sohrab
Thanks for your response. Please download the .stl file (CoW.stl) from the following link:
https://catmailohio-my.sharepoint.com/: ... 1&e=cdzIav
Please note that I want to do the simulation of the left and right part separately. So, I delete the faces of one side and keep the faces of the other side. Also my first goal was to do the 1D simulation, but with this geometry SimVascular fails to compute the centerlines correctly. For example, it may compute only one branch and misses the other branches. So, I think you're right and there is something wrong with the geometry. If that is the case, could you please help me to fix the geometry? What should I do to fix it?
Thanks again,
Sohrab
- Sohrab Tehrani
- Posts: 17
- Joined: Sun May 03, 2020 4:53 pm
Re: Error generating Mesh
If you couldn't download the file from the previous link, please try this link:
https://www.dropbox.com/sh/7g22qmrlc4xg ... MtUta?dl=0
Thanks
https://www.dropbox.com/sh/7g22qmrlc4xg ... MtUta?dl=0
Thanks
- David Parker
- Posts: 1716
- Joined: Tue Aug 23, 2005 2:43 pm
Re: Error generating Mesh
Got it!
Thanks,
Dave
Thanks,
Dave
- David Parker
- Posts: 1716
- Joined: Tue Aug 23, 2005 2:43 pm
Re: Error generating Mesh
Hi Sohrab,
I had a look at the CoW.stl file.
The primary problem with the geometry is that some of the ends of some vessels do not terminate with a well-defined planar cross-section perpendicular to the vessel's surface (see attached image), this is required to correctly extract faces and apply BCs.
The geometry also has small, thin features (see image). This will make it difficult to mesh.
I was wondering how you created this geometry, from an isosurface?
It is typically better to use the SV model building pipeline to create models from imaging data
1) Read image data
2) Create paths representing vessel centerlines
3) Segment vessels from paths
4) Create lofter models from segmentations
This will usually generate models that SV can mesh.
Cheers,
Dave
I had a look at the CoW.stl file.
The primary problem with the geometry is that some of the ends of some vessels do not terminate with a well-defined planar cross-section perpendicular to the vessel's surface (see attached image), this is required to correctly extract faces and apply BCs.
The geometry also has small, thin features (see image). This will make it difficult to mesh.
I was wondering how you created this geometry, from an isosurface?
It is typically better to use the SV model building pipeline to create models from imaging data
1) Read image data
2) Create paths representing vessel centerlines
3) Segment vessels from paths
4) Create lofter models from segmentations
This will usually generate models that SV can mesh.
Cheers,
Dave
- Sohrab Tehrani
- Posts: 17
- Joined: Sun May 03, 2020 4:53 pm
Re: Error generating Mesh
Dear David,
Thanks for your response. I somehow managed to fix the problem. I have another question. Could you please share your experience on how to install the SimVascular on HPC system from user's or root's level? as I need to run my simulation on cluster.
Thanks
Sohrab
Thanks for your response. I somehow managed to fix the problem. I have another question. Could you please share your experience on how to install the SimVascular on HPC system from user's or root's level? as I need to run my simulation on cluster.
Thanks
Sohrab
- David Parker
- Posts: 1716
- Joined: Tue Aug 23, 2005 2:43 pm
Re: Error generating Mesh
Hi Sohrab,
I'm glad to hear you fixed the model! Modeling and meshing is tricky, I hope to improve the process in SV some day.
Users typically use svSolver for rigid wall simulations. There is an installer for Ubuntu. For other platforms you can build it from source (see https://github.com/SimVascular/svSolver).
Cheers,
Dave
I'm glad to hear you fixed the model! Modeling and meshing is tricky, I hope to improve the process in SV some day.
Users typically use svSolver for rigid wall simulations. There is an installer for Ubuntu. For other platforms you can build it from source (see https://github.com/SimVascular/svSolver).
Cheers,
Dave
- Sohrab Tehrani
- Posts: 17
- Joined: Sun May 03, 2020 4:53 pm
Re: Error generating Mesh
Hi David,
Thanks for your response. I have another question. So, I'm trying to do 1D simulation and in my model that I built with SimVascular, I have 2 inlets and 4 outlet. Consequently, I have provided two data files of the volume flow rate waveforms for the two inlets and I set 4 RCR boundary conditions for the outlets. However, I receive an error message that says "There must be one prescribed velocity boundary condition"!. Why, I have two inlets and I need to define the 2 inlet boundary conditions. Please see the attached image which is a screenshot of the error message.
Thanks for your help in advance,
Best,
Sohrab
Thanks for your response. I have another question. So, I'm trying to do 1D simulation and in my model that I built with SimVascular, I have 2 inlets and 4 outlet. Consequently, I have provided two data files of the volume flow rate waveforms for the two inlets and I set 4 RCR boundary conditions for the outlets. However, I receive an error message that says "There must be one prescribed velocity boundary condition"!. Why, I have two inlets and I need to define the 2 inlet boundary conditions. Please see the attached image which is a screenshot of the error message.
Thanks for your help in advance,
Best,
Sohrab
- Attachments
-
- Capture.PNG (5.59 KiB) Viewed 604 times
- David Parker
- Posts: 1716
- Joined: Tue Aug 23, 2005 2:43 pm
Re: Error generating Mesh
Hi Sohrab,
The current 1D solver implementation only allows a single inlet BC. You might could create an artificial inlet bifurcating to the actual inlets, depends on what your two flow profiles look like.
Cheers,
Dave
The current 1D solver implementation only allows a single inlet BC. You might could create an artificial inlet bifurcating to the actual inlets, depends on what your two flow profiles look like.
Cheers,
Dave