Surf2mesh: define maxvol

246 views
Skip to first unread message

Nerea Mangado

unread,
Dec 5, 2014, 10:24:57 AM12/5/14
to iso2mes...@googlegroups.com
Dear all,

I was wondering if it is possible to define different "maxvol" for each regions the surf2mesh function, like it is defined in vol2meshlabel1=size1:label2=size2:...).

I was trying it with this simple code. If I use the following definition :  label1=size1:label2=size2:..., it doesn't appear an error itself, but it always create the same mesh for any parameter that I specify.

p0=[-5 -5 -5];
p1=[5 5 5];
[nbox,fbox]=meshabox(p0,p1,1,1);

p0=[-1 -1 -1];
p1=[1 1 1];
[nbox2,fbox2]=meshabox(p0,p1,1,1);
[node,face]=mergemesh(nbox,fbox,nbox2,fbox2);

[nodev,elemv,facev]=surf2mesh(node,face,[],[],1,'1=0.5:2=0.1',[0 0 0;4 4 4],[],[]);


Has anyone dealt with this before or has some  hint of how to do it?

Best regards,
Nerea



Qianqian Fang

unread,
Dec 5, 2014, 12:44:02 PM12/5/14
to iso2mes...@googlegroups.com
hi Nerea

surf2mesh calls tetgen for the 3D mesh generation, while
vol2mesh(label=size) requires CGAL 3D mesher. So, the label=size
definition is not accepted by surf2mesh.

However, surf2mesh/tetgen accepts a more flexible element
size specification. You can define a "sizing-field" through the
4th column of the node input. please checkout this example

http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?Doc/AdaptiveMesh

which is the same as sample/demo_refine_spherebox_mesh.m script
in your iso2mesh package.

let me know if this achieves what you want.

Qianqian


Best regards,
Nerea



--
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.

Nerea Mangado

unread,
Dec 9, 2014, 4:42:27 AM12/9/14
to iso2mes...@googlegroups.com

Dear Qianqian,

 Thank you for your reply. I've just checked it out, but unfortunatly it doesn''t work with my current model. 
 I guees that it is due to its complex geometry. 

This is the two output errors that I got :
File I/O Error:  Cannot access file /tmp/iso2mesh-nerea/post_vmesh.b.node.
Internalerror in findedge():  Unable to find an edge in subface.

Best regards,
Nerea 

Qianqian Fang

unread,
Dec 9, 2014, 11:43:01 AM12/9/14
to iso2mes...@googlegroups.com
On 12/09/2014 04:42 AM, Nerea Mangado wrote:

Dear Qianqian,

 Thank you for your reply. I've just checked it out, but unfortunatly it doesn''t work with my current model. 
 I guees that it is due to its complex geometry.

hi Nerea

both messages were given by tetgen.



This is the two output errors that I got :
File I/O Error:  Cannot access file /tmp/iso2mesh-nerea/post_vmesh.b.node.

the above message was actually a warning. It is shown everytime
you specifies a 4th column in the node input. But tetgen/s2m will
proceed fine.


Internalerror in findedge():  Unable to find an edge in subface.

this was the culprit. this error typically means your input mesh contains
self-intersecting elements.

If your input mesh is a single-component closed surface, you may use
meshcheckrepair(no,fc,'meshfix') to repair the surface first, and then
use the fixed surface as the input to s2m.

Nerea Mangado

unread,
Dec 10, 2014, 4:13:12 AM12/10/14
to iso2mes...@googlegroups.com
Dear Qianqian,

The input mesh is single component (closed and repaired) mesh. I though that maybe the problem may lied in the control points definition, but I checked them
according to the example, and there is still the internal error that I mentioned (Duplicating background mesh.
Internalerror in findedge():  Unable to find an edge in subface.)

I will keep trying it, but it seems that it's not so straightforward working with my current mesh surface.

Thank you for your help.

Best regards,

Nerea

El dimarts 9 de desembre de 2014 17:43:01 UTC+1, Qianqian Fang va escriure:

Qianqian Fang

unread,
Dec 10, 2014, 12:49:28 PM12/10/14
to iso2mes...@googlegroups.com
On 12/10/2014 04:13 AM, Nerea Mangado wrote:
Dear Qianqian,

The input mesh is single component (closed and repaired) mesh. I though that maybe the problem may lied in the control points definition, but I checked them
according to the example, and there is still the internal error that I mentioned (Duplicating background mesh.
Internalerror in findedge():  Unable to find an edge in subface.)

I will keep trying it, but it seems that it's not so straightforward working with my current mesh surface.

all right, let's first make sure you are able to generate a volumetric
mesh without the control points. Can you try that with s2m?

then, add to your node list the control points, but do not add the
4th column (sizing field), see if s2m can proceed.

I vaguely remember a control point can only be located at the
interior of the surface. If you put it exactly on the surface, you
may have problems.

feel free to send me your sample data and script so I can debug.

Qianqian

Nerea Mangado

unread,
Dec 23, 2014, 7:37:43 AM12/23/14
to iso2mes...@googlegroups.com
Dear Qianqian, 

I'm sorry for my late answer. I've tested what you mentioned ( generate the volume without the control points, and later without the 4th column, but with the control points). 
It works perfect ( I've considered points no located on the surface, just in case)

However, when I add the 4th, the sizing fields, it appears the error : 
Unexpected end of file in /tmp/iso2mesh-nerea/post_vmesh.mtr.
 
Consequently, even if the volume mesh is created properly , it doesn't consider the sizes specified.

Thank you for your continuous help and support.

Best regards,

Nerea 


P.D.: Merry Christmas!!


Reply all
Reply to author
Forward
0 new messages