Error generating Mesh

Provides a system for patient-specific cardiovascular modeling and simulation.
POST REPLY
User avatar
Sohrab Tehrani
Posts: 17
Joined: Sun May 03, 2020 4:53 pm

Error generating Mesh

Post by Sohrab Tehrani » Wed May 06, 2020 11:02 pm

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!
Last edited by Sohrab Tehrani on Thu May 21, 2020 12:28 pm, edited 1 time in total.

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

Re: Error generating Mesh

Post by David Parker » Thu May 07, 2020 9:39 am

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

User avatar
Sohrab Tehrani
Posts: 17
Joined: Sun May 03, 2020 4:53 pm

Re: Error generating Mesh

Post by Sohrab Tehrani » Thu May 07, 2020 10:42 am

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

User avatar
Sohrab Tehrani
Posts: 17
Joined: Sun May 03, 2020 4:53 pm

Re: Error generating Mesh

Post by Sohrab Tehrani » Thu May 07, 2020 10:44 am

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

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

Re: Error generating Mesh

Post by David Parker » Thu May 07, 2020 1:56 pm

Got it!

Thanks,
Dave

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

Re: Error generating Mesh

Post by David Parker » Mon May 11, 2020 10:09 am

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

User avatar
Sohrab Tehrani
Posts: 17
Joined: Sun May 03, 2020 4:53 pm

Re: Error generating Mesh

Post by Sohrab Tehrani » Thu May 14, 2020 11:12 am

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

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

Re: Error generating Mesh

Post by David Parker » Fri May 15, 2020 11:44 am

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

User avatar
Sohrab Tehrani
Posts: 17
Joined: Sun May 03, 2020 4:53 pm

Re: Error generating Mesh

Post by Sohrab Tehrani » Mon May 18, 2020 11:47 am

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
Attachments
Capture.PNG
Capture.PNG (5.59 KiB) Viewed 426 times

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

Re: Error generating Mesh

Post by David Parker » Mon May 18, 2020 12:45 pm

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

POST REPLY