Questions on "Invalid PLC" error and representing different phases

688 views
Skip to first unread message

Stephen Thomas

unread,
Jul 2, 2014, 3:15:15 PM7/2/14
to iso2mes...@googlegroups.com
Hi All,

I am trying to simulate an irregular particle embedded in a matrix (cubic box). I created an off file to represent this (extrudingBox.off). When I tried to create a mesh out of this off using s2m I get an "Invalid PLC" error as shown below:

Constructing Delaunay tetrahedralization.
Delaunay seconds:  0.166
Creating surface mesh.
Perturbing vertices.
Delaunizing segments.
Constraining facets.
Error:  Invalid PLC.
  Two subfaces (3163, 2859, 2) and (3161, 1503, 3126)
  are found intersecting each other.
  Hint:  Use -d switch to find all intersecting facets.
Error using fscanf
Invalid file identifier.  Use fopen to generate a valid file identifier.

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

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

Error in demo_extrudingParticleInBox (line 18)
[node,elem,face]=surf2mesh(n,e,[1 1 1],[20 20 20],0.8,50);


The code I use is:

%% load the sample data
[n,e]=readoff('extrudingBox.off');

%% perform mesh generation
[node,elem,face]=surf2mesh(n,e,[1 1 1],[20 20 20],0.8,50);


However, I am able to generate the mesh when the particles embedded in the matrix (cube) do not extrude out.
Could anyone guide me with how to go forward with the mesh generation for the extruding particle? The questions I have are:
1) How do I get around the error with extruding particles?
2) I would like the matrix and the particle to be represented as two different phases so that I can assign different material properties to them later. How can this be achieved?


Thank you,
Stephen Thomas.
extrudingBox.off

Qianqian Fang

unread,
Jul 8, 2014, 6:52:32 PM7/8/14
to iso2mes...@googlegroups.com
On 07/02/2014 03:15 PM, Stephen Thomas wrote:
Hi All,

I am trying to simulate an irregular particle embedded in a matrix (cubic box). I created an off file to represent this (extrudingBox.off). When I tried to create a mesh out of this off using s2m I get an "Invalid PLC" error as shown below:

However, I am able to generate the mesh when the particles embedded in the matrix (cube) do not extrude out.
Could anyone guide me with how to go forward with the mesh generation for the extruding particle? The questions I have are:
1) How do I get around the error with extruding particles?
2) I would like the matrix and the particle to be represented as two different phases so that I can assign different material properties to them later. How can this be achieved?


hi Stephen

this is the #1 asked question (thus, stays #1 in the FAQ list since
the beginning), and is still the major limitation of the current software

http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?Doc/FAQ#I_am_getting_a_Two_subfaces_are_found_intersecting_each_other_error_what_should_I_do

a few alternatives exist, but so far, there is not a "perfect" solution.

Method #1: This is the most robust, but may be the slowest, and
is the least accurate. You rasterize each individual surface using
surf2vol() on the same grid (define the same xi/yi/zi), and then merge
them together to form a multi-label volume, and then run v2m('cgalmesh')
to create the volumetric mesh. To get good results, your grid has to be fine.

Method#2: if you have only two intersecting surfaces, you can run
mergesurf/surfboolean() with 'all' operator. This will call bin/gtsset to split the
intersecting elements into triangles, and, hopefully fix the problem.
however, I noticed that gtsset does not work reliably, and sometime
may crash.

Method#3, you may run the bin/meshfix.* utility to "decouple" two intersecting
shells, but for some reason, I was not able to get this feature working.
more info can be found on meshfix's website

https://code.google.com/p/meshfix/

I know meshfix likes enclosed surfaces, I don't know if it is general
enough to handle arbitrary surfaces. I really wish there is a tool that
fix intersections in a mesh robustly, but so far I haven't found one yet.

Qianqian


Thank you,
Stephen Thomas.
--
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.

Stephen Thomas

unread,
Jul 9, 2014, 12:59:26 PM7/9/14
to iso2mes...@googlegroups.com
Dear Dr. Fang,

Thanks a lot for the response. I will try the workarounds you suggested for the intersecting meshes.

About the question #2:
1) I am trying to create a mesh to represent particles embedded in a matrix (box). This is to represent different classes of aggregates in concrete mix. Here the matrix should be assigned a unique label, and each class of particles should have a common and unique label. This is intended to represent different sized particles in the concrete mix. I am able to do this by assigning common region attribute to particles in a particle class in the "post_vmesh.poly" file saved in savesurfpoly function. However, due to a particular limitation of this strategy, I am attempting another method to achieve this:

 step1: create separate surface mesh(.off format) for matrix, particle class1 and particle class 2.
 step2: use s2m to create separate tetrahedral mesh for matrix, particle class1 and particle class2.
 step3: use surfboolean to merge these meshes into a single mesh and hope that each mesh gets assigned a different region attribute.

Could you please tell me if this is the right strategy? When I attempted doing it, I am getting an error from surfboolean function. This is blocking me right now. Infact this error is reproducible with simple shapes too:
For e.g.
  [node1,face1,elem1]=meshabox([0 0 0],[10 10 10],1,1);
  [node2,face2,elem2]=meshasphere([5 5 5],3,0.3,3);
  [newnode,newelem]=surfboolean(node1,elem1,'all',node2,elem2);
  plotmesh(newnode,newelem,'x>5');

The error is :
Error using surfboolean (line 122)
surface boolean command failed:
cd "C:\Users\STEPHE~1\AppData\Local\Temp\iso2mesh-stephenthomas1\" &&
"E:\iso2mesh\bin\gtsset.exe" all
"C:\Users\STEPHE~1\AppData\Local\Temp\iso2mesh-stephenthomas1\pre_surfbool1.gts"
"C:\Users\STEPHE~1\AppData\Local\Temp\iso2mesh-stephenthomas1\pre_surfbool2.gts" -v
> "C:\Users\STEPHE~1\AppData\Local\Temp\iso2mesh-stephenthomas1\post_surfbool.off"
ERROR:
(gtsset.exe:7904): Gts-examples-WARNING **: cannot set locale to POSIX
set: surface
`C:\Users\STEPHE~1\AppData\Local\Temp\iso2mesh-stephenthomas1\pre_surfbool1.gts' is
not an orientable manifold


Could you please guide me with this problem?

Thank you,
Stephen Thomas.

Qianqian Fang

unread,
Jul 10, 2014, 2:18:20 PM7/10/14
to iso2mes...@googlegroups.com
On 07/09/2014 12:59 PM, Stephen Thomas wrote:
ERROR:
(gtsset.exe:7904): Gts-examples-WARNING **: cannot set locale to POSIX
set: surface
`C:\Users\STEPHE~1\AppData\Local\Temp\iso2mesh-stephenthomas1\pre_surfbool1.gts' is
not an orientable manifold


Could you please guide me with this problem?

This is exactly the "may crash" bit I mentioned. Interestingly, running
the same command on Linux (64bit Ubuntu) went smoothly without
any error. I emailed a GTS developer about this years ago, no reply
has been received so far.

Oren Ka

unread,
Apr 4, 2016, 11:09:03 AM4/4/16
to iso2mesh-users
Hi Dr. Fang

I'm getting the same error. If I move one of the mesh a little, it won't happen.
Do you know what causes this issue (so I could recognize it before I call the function and maybe move my meshes accordingly)?

Thank you very much
Oren

Oren Ka

unread,
Apr 4, 2016, 2:14:39 PM4/4/16
to iso2mesh-users
Following question. 
Is there a way to catch this error (try-catch) without getting the error message "gtsset.exe has stopped working...".
This way I can try multiple location.
Thanks you
Reply all
Reply to author
Forward
0 new messages