[Gmsh] Mesh issue: surface and volume edges differ

Vanegas Acosta, J.C. J.C.Vanegas.Acosta at tue.nl
Tue Aug 27 18:01:37 CEST 2013


Dear all,

I have a (maybe) trivial problem using a 3D mesh.

My geometry is an sphere inside another sphere, representing the case of a biological cell with its nucleus. I want the mesh to be finer along the principal planes (X,Y,Z) and coarse elsewhere (say on the boundary lines of both nucleus and cell itself).

Since the spheres (nucleus and cytoplasm) are not necessarily concentric, I managed to draw individually each one of the eight octets of the total volume. Using only one octet and using "Transfinite Line" I get the mesh that I expect.

However, when I include the eight octets at once (taking care of not including the shared (inner) faces to avoid problems in the creation of the total volume), I lose the mesh divisions along the principal planes. This principal planes are represented as lines inside the external sphere (cytoplasm).

I noticed that when I use the complete volume the surface and volume edges are not the same. What I mean is that apparently the surfaces (2D) are correctly meshed, but for some reason when meshing the volume some of those divisions are no longer considered.

Can someone help me to figure out what's going on here?
Below I attached the code I am using.

Thank you in advance,

Juan Carlos Vanegas
Eindhoven University of Technology
The Netherlands

**************************
ncell = 1;
a = 1;
b = 3;
coordx[] = {1.6e-005};
coordy[] = {2.5e-005};
coordz[] = {2.5e-005};
// Radii of cells (both cytoplasm and nucleus)
cytopl[] = {1e-005};
nuclei[] = {2.5e-006};

For w In {0:ncell-1}
x = coordx[w];
y = coordy[w];
z = coordz[w];

//  Drawing cell nucleus
               r = nuclei[w];

//  Points to draw nucleus
               p1 = newp; Point(p1) = {x,  y,  z,  ln} ;
               p2 = newp; Point(p2) = {x+r,y,  z,  ln} ;
               p3 = newp; Point(p3) = {x,  y+r,z,  ln} ;
               p4 = newp; Point(p4) = {x,  y,  z+r, ln} ;
               p5 = newp; Point(p5) = {x-r,y,  z,   ln} ;
               p6 = newp; Point(p6) = {x,  y-r,z,   ln} ;
               p7 = newp; Point(p7) = {x,  y,  z-r, ln} ;

//  Contour lines for nucleus
               c1 = newreg; Circle(c1) = {p2,p1,p7};
               c2 = newreg; Circle(c2) = {p7,p1,p5};
               c3 = newreg; Circle(c3) = {p5,p1,p4};
               c4 = newreg; Circle(c4) = {p4,p1,p2};
               c5 = newreg; Circle(c5) = {p2,p1,p3};
               c6 = newreg; Circle(c6) = {p3,p1,p5};
               c7 = newreg; Circle(c7) = {p5,p1,p6};
               c8 = newreg; Circle(c8) = {p6,p1,p2};
               c9 = newreg; Circle(c9) = {p7,p1,p3};
               c10 = newreg; Circle(c10) = {p3,p1,p4};
               c11 = newreg; Circle(c11) = {p4,p1,p6};
               c12 = newreg; Circle(c12) = {p6,p1,p7};

//  Drawing cell cytoplasm
               r = cytopl[w];

//  Points to draw cytoplasm (notice point 1 correspond to cell center - not repeated here)
               p8 = newp; Point(p8) = {x+r,y,  z,   lc} ;
               p9 = newp; Point(p9) = {x,  y+r,z,   lc} ;
               p10 = newp; Point(p10) = {x,  y,  z+r, lc} ;
               p11 = newp; Point(p11) = {x-r,y,  z,   lc} ;
               p12 = newp; Point(p12) = {x,  y-r,z,   lc} ;
               p13 = newp; Point(p13) = {x,  y,  z-r, lc} ;

//  Contour lines for cytoplasm
               c13 = newreg; Circle(c13) = {p8,p1,p13};
               c14 = newreg; Circle(c14) = {p13,p1,p11};
               c15 = newreg; Circle(c15) = {p11,p1,p10};
               c16 = newreg; Circle(c16) = {p10,p1,p8};
               c17 = newreg; Circle(c17) = {p8,p1,p9};
               c18 = newreg; Circle(c18) = {p9,p1,p11};
               c19 = newreg; Circle(c19) = {p11,p1,p12};
               c20 = newreg; Circle(c20) = {p12,p1,p8};
               c21 = newreg; Circle(c21) = {p13,p1,p9};
               c22 = newreg; Circle(c22) = {p9,p1,p10};
               c23 = newreg; Circle(c23) = {p10,p1,p12};
               c24 = newreg; Circle(c24) = {p12,p1,p13};

// Plane lines inside cytoplasm
    c25 = newreg; Line(c25) = {p8,p2};
               c26 = newreg; Line(c26) = {p9,p3};
               c27 = newreg; Line(c27) = {p10,p4};
               c28 = newreg; Line(c28) = {p11,p5};
               c29 = newreg; Line(c29) = {p12,p6};
               c30 = newreg; Line(c30) = {p13,p7};

// Loops delimiting the octet #1
               l1 = newreg; Line Loop(l1) = {c9,-c5,c1};
               l2 = newreg; Line Loop(l2) = {c1,-c30,-c13,c25};
               l3 = newreg; Line Loop(l3) = {c5,-c26,-c17,c25};
               l4 = newreg; Line Loop(l4) = {c9,-c26,-c21,c30};
               l5 = newreg; Line Loop(l5) = {c21,-c17, c13};

// Surfaces delimiting the octet #1
               s1 = newreg; Ruled Surface(s1) = {l1};
               s2 = newreg; Ruled Surface(s2) = {l2};
               s3 = newreg; Ruled Surface(s3) = {l3};
               s4 = newreg; Ruled Surface(s4) = {l4};
               s5 = newreg; Ruled Surface(s5) = {l5};

// Loops delimiting the octet #2
               l6 = newreg; Line Loop(l6) = {c10,c4,c5};
               l7 = newreg; Line Loop(l7) = {c5,-c26,-c17,c25};
               l8 = newreg; Line Loop(l8) = {-c4,-c27,c16,c25};
               l9 = newreg; Line Loop(l9) = {c10,-c27,-c22,c26};
               l10 = newreg; Line Loop(l10) = {c22,c16,c17};

// Surfaces delimiting the octet #2
               s6 = newreg; Ruled Surface(s6) = {l6};
               s7 = newreg; Ruled Surface(s7) = {l7};
               s8 = newreg; Ruled Surface(s8) = {l8};
               s9 = newreg; Ruled Surface(s9) = {l9};
               s10 = newreg; Ruled Surface(s10) = {l10};

// Loops delimiting the octet #3
               l11 = newreg; Line Loop(l11) = {c11,c8,-c4};
               l12 = newreg; Line Loop(l12) = {-c4,-c27,c16,c25};
               l13 = newreg; Line Loop(l13) = {-c8,-c29,c20,c25};
               l14 = newreg; Line Loop(l14) = {c11,-c29,-c23,c27};
               l15 = newreg; Line Loop(l15) = {c23,c20,-c16};

// Surfaces delimiting the octet #3
               s11 = newreg; Ruled Surface(s11) = {l11};
               s12 = newreg; Ruled Surface(s12) = {l12};
               s13 = newreg; Ruled Surface(s13) = {l13};
               s14 = newreg; Ruled Surface(s14) = {l14};
               s15 = newreg; Ruled Surface(s15) = {l15};

// Loops delimiting the octet #4
               l16 = newreg; Line Loop(l16) = {c12,-c1,-c8};
               l17 = newreg; Line Loop(l17) = {-c8,-c29,c20,c25};
               l18 = newreg; Line Loop(l18) = {c1,-c30,-c13,c25};
               l19 = newreg; Line Loop(l19) = {c12,-c30,-c24,c29};
               l20 = newreg; Line Loop(l20) = {c24,-c13,-c20};

// Surfaces delimiting the octet #4
               s16 = newreg; Ruled Surface(s16) = {l16};
               s17 = newreg; Ruled Surface(s17) = {l17};
               s18 = newreg; Ruled Surface(s18) = {l18};
               s19 = newreg; Ruled Surface(s19) = {l19};
               s20 = newreg; Ruled Surface(s20) = {l20};

// Loops delimiting the octet #5
               l21 = newreg; Line Loop(l21) = {-c9,c2,-c6};
               l22 = newreg; Line Loop(l22) = {-c6,-c26,c18,c28};
               l23 = newreg; Line Loop(l23) = {-c2,-c30,c14,c28};
               l24 = newreg; Line Loop(l24) = {-c9,-c30,c21,c26};
               l25 = newreg; Line Loop(l25) = {-c21,c14,-c18};

// Surfaces delimiting the octet #5
               s21 = newreg; Ruled Surface(s21) = {l21};
               s22 = newreg; Ruled Surface(s22) = {l22};
               s23 = newreg; Ruled Surface(s23) = {l23};
               s24 = newreg; Ruled Surface(s24) = {l24};
               s25 = newreg; Ruled Surface(s25) = {l25};

// Loops delimiting the octet #6
               l26 = newreg; Line Loop(l26) = {-c12,-c7,-c2};
               l27 = newreg; Line Loop(l27) = {-c2,-c30,c14,c28};
               l28 = newreg; Line Loop(l28) = {c7,-c29,-c19,c28};
               l29 = newreg; Line Loop(l29) = {-c12,-c29,c24,c30};
               l30 = newreg; Line Loop(l30) = {-c24,-c19,-c14};

// Surfaces delimiting the octet #6
               s26 = newreg; Ruled Surface(s26) = {l26};
               s27 = newreg; Ruled Surface(s27) = {l27};
               s28 = newreg; Ruled Surface(s28) = {l28};
               s29 = newreg; Ruled Surface(s29) = {l29};
               s30 = newreg; Ruled Surface(s30) = {l30};

// Loops delimiting the octet #7
               l31 = newreg; Line Loop(l31) = {-c11,-c3,c7};
               l32 = newreg; Line Loop(l32) = {c7,-c29,-c19,c28};
               l33 = newreg; Line Loop(l33) = {c3,-c27,-c15,c28};
               l34 = newreg; Line Loop(l34) = {-c11,-c27,c23,c29};
               l35 = newreg; Line Loop(l35) = {-c23,-c15, c19};

// Surfaces delimiting the octet #7
               s31 = newreg; Ruled Surface(s31) = {l31};
               s32 = newreg; Ruled Surface(s32) = {l32};
               s33 = newreg; Ruled Surface(s33) = {l33};
               s34 = newreg; Ruled Surface(s34) = {l34};
               s35 = newreg; Ruled Surface(s35) = {l35};

// Loops delimiting the octet #8
               l36 = newreg; Line Loop(l36) = {-c10,c6,c3};
               l37 = newreg; Line Loop(l37) = {c3,-c27,-c15,c28};
               l38 = newreg; Line Loop(l38) = {-c6,-c26,c18,c28};
               l39 = newreg; Line Loop(l39) = {-c10,-c26,c22,c27};
               l40 = newreg; Line Loop(l40) = {-c22,c18,c15};

// Surfaces delimiting the octet #8
               s36 = newreg; Ruled Surface(s36) = {l36};
               s37 = newreg; Ruled Surface(s37) = {l37};
               s38 = newreg; Ruled Surface(s38) = {l38};
               s39 = newreg; Ruled Surface(s39) = {l39};
               s40 = newreg; Ruled Surface(s40) = {l40};

//  Partitioning nucleus boundary lines accordingly
               Transfinite Line {c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12}  = a Using Progression 1.0;

//  Partitioning cytoplasm boundary lines accordingly
               Transfinite Line {c13,c14,c15,c16,c17,c18,c19,c20,c21,c22,c23,c24} = b Using Progression 1.0;

//  Partitioning cytoplasm inner plane lines accordingly
               Transfinite Line {c25,c26,c27,c28,c29,c30} = b Using Progression 1.0;

//  Cytoplasmatic hemispheres (used for sanity check)
//            b2 = newreg; Surface Loop(b2) = {s1,s4,s5,s6,s9,s10,s11,s14,s15,s16,s19,s20};
//            b3 = newreg; Surface Loop(b3) = {s21,s24,s25,s26,s29,s30,s31,s34,s35,s36,s39,s40};

//  Nuclear surface & volume
               b1 = newreg; Surface Loop(b1) = {s1,s6,s11,s16,s21,s26,s31,s36};
               v1 = newreg; Volume(v1) = {b1};

//  Cytoplasmatic surface & volume
               b2 = newreg; Surface Loop(b2) = {s1,s5,s6,s10,s11,s15,s16,s20,s21,s25,s26,s30,s31,s35,s36,s40};
               v2 = newreg; Volume(v2) = {b2};

EndFor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20130827/2bc74def/attachment.html>