issues with mesh resample

700 views
Skip to first unread message

Arun Prakash

unread,
Mar 30, 2016, 4:50:13 PM3/30/16
to iso2mesh-users

Dear Dr. Fang,


I am trying to create a 3D tetrahedral mesh from a surface mesh. Since my surface is very finely meshed, I tried to resample/coarsen it in a first step. The resample function fails to perform due to "Cost computation constraints". I get the following output:


octave:76> FVcoarse=stlread('Cutout_coarseMesh_withPlane_ForFEmesh.obj.stl');

octave:77> trisurf(FVcoarse.faces,FVcoarse.vertices(:,1),FVcoarse.vertices(:,2),FVcoarse.vertices(:,3)) #For verification/display purposes only

octave:78> [FVCno,FVCel]=meshresample(FVcoarse.vertices(:,1:3),FVcoarse.faces(:,1:3),keepratio);

= Surface Mesh Simplification Utility (Based on CGAL 3.4) =

(modified for iso2mesh by Qianqian Fang)

http://iso2mesh.sf.net


max face ratio=0.000001

edge index number 301992

mesh simplificaton in progress ...



Edges collected: 150996

Edges proccessed: 150996

Edges collapsed: 0


Edges not collapsed due to topological constrians: 0

Edge not collapsed due to cost computation constrians: 150996

Edge not collapsed due to placement computation constrians: 0


Finished...

0 edges removed.

150996 final edges.


As an alternative, I tried to remesh the surface. Unfortunately, this did not work either:


octave:79> [FVCno,FVCel]=remeshsurf(FVcoarse.vertices(:,1:3),FVcoarse.faces(:,1:3),keepratio);

warning: /data/prakash/src/iso2mesh/remeshsurf.m: possible Matlab-style short-circuit operator at line 46, column 17

converting a closed surface to a volumetric binary image ...

error: out of memory or dimension too large for Octave's index type

error: called from:

error:   /data/prakash/src/iso2mesh/surf2volz.m at line 22, column 4

error:   /data/prakash/src/iso2mesh/surf2vol.m at line 22, column 4

error:   /data/prakash/src/iso2mesh/remeshsurf.m at line 41, column 4


Could you tell me what I might be doing wrong? Or perhaps suggest a workaround to my problem.


Thanks in advance,

Arun Prakash

PS: I am trying this the third time - hope this time I am successful in posting

Qianqian Fang

unread,
Mar 31, 2016, 5:31:41 PM3/31/16
to iso2mes...@googlegroups.com
On 03/30/2016 04:13 PM, Arun Prakash wrote:

Dear Dr. Fang,


I am trying to create a 3D tetrahedral mesh from a surface mesh. Since my surface is very finely meshed, I tried to resample/coarsen it in a first step. The resample function fails to perform due to "Cost computation constraints". I get the following output:



hi Arun

meshresample() is a function to down-sample a surface mesh.
It does require the input surface mesh to be topologically correct.
If you mesh has topological defects, such as non-manifold vertices,
it will refuse to proceed.

to safely use this function, you need to call meshcheckrepair() first.
This will correct the topological defects.

[no,fc]=meshcheckrepair(FVcoarse.vertices(:,1:3),FVcoarse.faces(:,1:3),'deep');
[FVCno,FVCel]=meshresample(no,fc,keepratio);




octave:76> FVcoarse=stlread('Cutout_coarseMesh_withPlane_ForFEmesh.obj.stl');

octave:77> trisurf(FVcoarse.faces,FVcoarse.vertices(:,1),FVcoarse.vertices(:,2),FVcoarse.vertices(:,3)) #For verification/display purposes only

octave:78> [FVCno,FVCel]=meshresample(FVcoarse.vertices(:,1:3),FVcoarse.faces(:,1:3),keepratio);

...

As an alternative, I tried to remesh the surface. Unfortunately, this did not work either:


remeshsurf() is another valid option for solving this problem. comparing
to meshresample(), it does not perform the operation by node decimation,
but by rasterizing a closed mesh to a volume and then extract a new surface.
the output from remeshsurf() is guaranteed to be self-intersecting element
free, but meshresample can not guarantee this.

here, octave complained about out of memory. You use used a very
fine grid for rasterization. The rasterization density is controlled by
the 3rd input (opt). Notice that opt here is not the same as keepratio
in meshresample.

if your mesh nodes is bounded by a box 0-100 mm in x/y/z, if you
define opt as 1, it will re-rasterize your mesh with a grid roughly
100x100x100 array. if you define opt as 0.01, you will need a
10000x10000x10000 grid to rasterize your mesh. This is not
realistic (and necessary) on most computers.

please run help remeshsurf to find out more about this. I also
provided a built in example to show how to use remeshsurf

https://github.com/fangq/iso2mesh/blob/master/sample/demo_remesh_surface.m

let me know if this helps.

octave:79> [FVCno,FVCel]=remeshsurf(FVcoarse.vertices(:,1:3),FVcoarse.faces(:,1:3),keepratio);

warning: /data/prakash/src/iso2mesh/remeshsurf.m: possible Matlab-style short-circuit operator at line 46, column 17

converting a closed surface to a volumetric binary image ...

error: out of memory or dimension too large for Octave's index type

....

Could you tell me what I might be doing wrong? Or perhaps suggest a workaround to my problem.

Thanks in advance,

Arun Prakash

PS: I am trying this the third time - hope this time I am successful in posting



just FYI, to prevent spams, the iso2mesh-users mailing list is managed
by a moderator (myself). anyone makes the first post must be approved
by the moderator. Sorry for the frustration.

Qianqian


--
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 https://groups.google.com/group/iso2mesh-users.
For more options, visit https://groups.google.com/d/optout.

Arun Prakash

unread,
Apr 20, 2016, 1:59:40 PM4/20/16
to iso2mesh-users
Hi QianQian,

Thanks  for the instructions. I have now been able to successfully generate a tetrahedral mesh. I do have a problem with the mesh quality, though.

Using the mesh generated by iso2mesh, I tried to perform simulations with Abaqus. The simulation aborted due to the following error:

 Error in job APTrecons_GGp_importedMesh: The volume of 60 elements is zero, small, or negative. Check coordinates or node numbering, or modify the mesh seed. In the case of a tetrahedron this error may indicate that all nodes are located very nearly in a plane. The elements have been identified in element set ErrElemVolSmallNegZero.
Job APTrecons_GGp_importedMesh: Analysis Input File Processor aborted due to errors.
Error in job APTrecons_GGp_importedMesh: Analysis Input File Processor exited with an error.

Furthermore, I have quite a few elements that are distorted.

Is there a way to correct these elements - perhaps a cleaning function that I need to call before I use saveabaqus?

Cheers,
Arun

Qianqian Fang

unread,
Apr 24, 2016, 9:03:29 PM4/24/16
to iso2mes...@googlegroups.com
On 4/20/2016 1:59 PM, Arun Prakash wrote:
Hi QianQian,

Thanks  for the instructions. I have now been able to successfully generate a tetrahedral mesh. I do have a problem with the mesh quality, though.

Using the mesh generated by iso2mesh, I tried to perform simulations with Abaqus. The simulation aborted due to the following error:

 Error in job APTrecons_GGp_importedMesh: The volume of 60 elements is zero, small, or negative. Check coordinates or node numbering, or modify the mesh seed. In the case of a tetrahedron this error may indicate that all nodes are located very nearly in a plane. The elements have been identified in element set ErrElemVolSmallNegZero.
Job APTrecons_GGp_importedMesh: Analysis Input File Processor aborted due to errors.
Error in job APTrecons_GGp_importedMesh: Analysis Input File Processor exited with an error.

hi Arun

sorry for the delay in getting back to you.

you can check a few things. first, you can calculate the element
volume by using the elemvolume() function.

if the output volume output contains both positive and negative
numbers, that means your elements are not oriented the same way.
You can fix them by calling meshreorient().



Furthermore, I have quite a few elements that are distorted.

you said there were zero volume elements, plus the "distorted"
ones, that make me worried. iso2mesh generally does not generate
"distorted elements" or zero-volume elements because it is
quality-criteria based - if there were poorly quality elements,
iso2mesh would have continued to refine until the quality criteria
are met.

I think likely you had some problem exporting your mesh. A typical
mistake was to include the 5th column of elem or 4th column of
node because those are labels, and are not part of the topology.

can you double check this as well?

Qianqian


Is there a way to correct these elements - perhaps a cleaning function that I need to call before I use saveabaqus?

Cheers,
Arun
Reply all
Reply to author
Forward
0 new messages