surf2mesh tetgen error

233 views
Skip to first unread message

Taahirah Mangera

unread,
Jul 14, 2014, 2:21:39 AM7/14/14
to iso2mes...@googlegroups.com
Good Day,

I have obtained microCT scan data of 3 mice femora in the form of .stl files. I require a volumetric mesh of these in order to perform a FEA using ANSYS/Abaqus. From what I have understood, .stl files are surface meshes which can be converted to volumetric meshes using Iso2Mesh. I have written the following code to perform this (getMesh):

[F,V] = stlread('CD10.stl'); 
[V, F] = MeshRepair(V, F);
[node2,elem2,face2] = s2m(V,F,1,0.3);
%scale the nodes by the pixel size in the relevant directions
node2 = node2*diag(pixelScale);
%create the abaqus mesh, expect a warning for only having a single element
%set, a 4th col of 1's will be added to elem2
%mesh2abaqus(node2,elem2,[inpName,'.inp']);


however when I attempt to run the file I receive the following error:

>> getMesh
98873 duplicated nodes were removed
generating tetrahedral mesh from closed surfaces ...
creating volumetric mesh from a surface mesh ...

WARNING: the license for "tetgen" is non-free and does not permit commercial use.
Please use the "cgalmesh" or "cgalpoly" options where free-software is desired.
is fix volume=1 maxvol=0.300000  
Opening C:\Users\455841\AppData\Local\Temp\iso2mesh-455841\post_vmesh.poly. 
Constructing Delaunay tetrahedralization. 
  Creating initial tetrahedralization. 
  Incrementally inserting points. 
  366198 Flips (T23 217617, T32 148580, T22 0, T44 1) 
Delaunay seconds:  0.894 
Creating surface mesh. 
  Constructing mapping from indices to points. 
  Constructing mapping from points to tetrahedra. 
  Unifying segments. 
  Constructing mapping from points to subfaces. 
  Merging coplanar facets. 
  Marking acute vertices. 
  Constructing mapping from points to segments. 
  19035 acute vertices. 
Perturbing vertices. 
  0 break points. 
Delaunizing segments. 
  Constructing mapping from points to tetrahedra. 
  Queuing missing segments. 
Error:  Out of memory. 
Error using fscanf
Invalid file identifier.  Use fopen to generate a valid file identifier.

Error in readtetgen (line 27)
[dim,count] = fscanf(fp,'%d',4);

Error in surf2mesh (line 101)
[node,elem,face]=readtetgen(mwpath('post_vmesh.1'));

Error in s2m (line 25)
[node,elem,face]=surf2mesh(v,f,p0,p1,keepratio,maxvol,[],[]);

Error in getMesh (line 27)
[node2,elem2,face2] = s2m(V,F,1,0.3);


I understand the error is from tetgen. I am however using a system with 16GB RAM and do not understand the memory error. The code does not seem to generate the post_vmesh.1.node, .face and .elem files necessary for surf2mesh.

Any assistance would be greatly appreciated. 

Qianqian Fang

unread,
Jul 14, 2014, 11:45:05 AM7/14/14
to iso2mes...@googlegroups.com
On 07/14/2014 02:21 AM, Taahirah Mangera wrote:
Good Day,

I have obtained microCT scan data of 3 mice femora in the form of .stl files. I require a volumetric mesh of these in order to perform a FEA using ANSYS/Abaqus. From what I have understood, .stl files are surface meshes which can be converted to volumetric meshes using Iso2Mesh. I have written the following code to perform this (getMesh):

...
Delaunizing segments. 
  Constructing mapping from points to tetrahedra. 
  Queuing missing segments. 
Error:  Out of memory. 
Error using fscanf
Invalid file identifier.  Use fopen to generate a valid file identifier.

...
I understand the error is from tetgen. I am however using a system with 16GB RAM and do not understand the memory error. The code does not seem to generate the post_vmesh.1.node, .face and .elem files necessary for surf2mesh.

depends on the target mesh density, you can easily fill up
16GB memory when you set the density too high. To lower
the density, increase opt (or opt.radbound) and maxvol.

Qianqian


Any assistance would be greatly appreciated. 
--
You received this message because you are subscribed to the Google Groups "iso2mesh-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iso2mesh-user...@googlegroups.com.
To post to this group, send email to iso2mes...@googlegroups.com.
Visit this group at http://groups.google.com/group/iso2mesh-users.
For more options, visit https://groups.google.com/d/optout.

The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.

Reply all
Reply to author
Forward
0 new messages