[Gmsh] connecting structured to unstructured meshed volumes in 3D

Trevor Strickler trevor.strickler at gmail.com
Tue Sep 10 00:20:08 CEST 2013


Hi Max,

The errors you encountered can be fixed.

First step:  Download the latest nightly build or code snapshot of gmsh and
install that.  Part of your trouble is that the QuadTri algorithms
previously did not work with toroidal extrusions (when you extrude around
onto the original source surface).  Now QuadTri works with toroidal
extrusions, but only as of last week.

Warning though: The keyword 'QuadTriSngl' must become 'QuadTriNoNewVerts'
in the new version.  'QuadTriDbl' must be changed to 'QuadTriAddVerts' in
the new one.  QuadTriAddVerts does NOT have the 'double layer' restriction
that 'QuadTriDbl' did.


Now, after getting the new Gmsh version, there are still problems with your
.geo file.  When you define skin_coil[], you are including the source
surfaces of the coil extrusion, AND the extruded 'top' surfaces that are
also inside the coils.  You should define the skin_coil[] list with ONLY
the extruded lateral surfaces.  Maybe use the line:

skin_coil[] += tmp[{2:5}];

after each Extrude command.  I tried that and got the entire mesh to
generate without errors.

Also, the coils are very close to one side of the unstructured box.  You
might want to give a little more space for the unstructured algorithm to
work.

Regards,

Trevor



> Dear gmsh Team,
>
> I have a problem to mesh the attached geometry including structured and
> unstructured volumes. I tried to use the instruction which I found here:
> http://www.geuz.org/pipermail/gmsh/2012/007011.html
>
> but I recieve the follwoing errors:
>
> Error   : In IsValidQuadToTriRegion(), could not find top face of region
> 20.
> Error   : In IsValidQuadToTriRegion(), found unstructured lateral in
> QuadToTri region 20.
> Error   : Mesh of QuadToTri region 20 likely has errors.
> Error   : In QuadToTriEdgeGenerator(), invalid top surface for region 20.
> Error   : In meshQuadToTriRegion(), failed to create edges for QuadToTri
> region 20.
> Error   : Cannot tetrahedralize volume with quadrangles on boundary
>
> Could you help me to solve this problem?
>
> Thanks in advance
>
> Max
> /* #######################################################
> ####################### parameter ########################
> ########################################################*/
>
>
> lc = 0.01; // Mesh characteristic length
> lc2 = 0.03;
> lc3 = 0;
> front3d = 1; // Set to 1 if Frontal 3D mesh algorithm is used
> nn = (1./lc); // Mesh subdivisions per turn, used with Frontal 3D
>
> If(front3d == 1)
> Mesh.Algorithm3D = 4; // Frontal 3D
> EndIf
>
> DefineConstant
> [
>  layer =  {1, Min 1, Step 1, Label "Number of coil layers"},
>  turns = {5, Label "Number of coil turns"},
>  d = {0.001, Label "Distance between the turns"},
>  r = {0.15, Label "Coil radius"},
>  rh = {0.01, Label "radial height"},
>  ah = {0.02, Label "axial height"},
>  hc = {turns*(ah+d)-d, Label "Coil height"},
>  ch = {0.12, Label "Channel height"},
>  dk = {0.1, Label "Distance Channel-Inductor"},
>  lh = {2*r+dk, Min r, Step 0.01, Label "loop height"},
>  lb = {1.75, Label "Infinite box width"},
>  rc =  {0.125, Step 0.01},
>  ht =  {hc+0.02, Step 0.01}
>  ds=(ah)/2
> ];
>
> rk = hc/2+rh+r+dk;
> Inductor = 20000;
> Skin_Inductor = 20001;
> Channel = 10000;
> Skin_Channel = 10001;
> Air = 30000;
> Inf = 30001;
> IN = 21000;
> OUT =222000;
> Core=40000;
> Skin_Core=40001;
> CutPlane=9999;
> SYM=6000;
> /* #####################################################
> ####################### inductor #######################
> ######################################################*/
>
> vol_coil[] = {};
>
>
>
> For h In {0:layer-1}
> For i In {0:turns-1}
> ds=(ah)/2;
> dd=i*(ah+d);
> ld=h*(0.002+rh);
>
> p_ind = newp;
> Point(p_ind+1)={d/2+dd, -r+ld, -hc/2, lc};
> Point(p_ind+2)={d/2+rh+dd, -r+ld, -hc/2, lc};
> Point(p_ind+3)={d/2+dd, -r+rh+ld, -hc/2, lc};
> Point(p_ind+4)={d/2+rh+dd, -r+rh+ld, -hc/2,lc};
>
> l = newl;
> Line(l) = {p_ind+1,p_ind+2};
> Transfinite Line{l}=6 Using Progression 1.5;
> Line(l+1) = {p_ind+3,p_ind+4};
> Transfinite Line{l+1}=6 Using Progression 1.5;
> Line(l+2) = {p_ind+1,p_ind+3};
> Transfinite Line{l+2}=6;
> Line(l+3) = {p_ind+2,p_ind+4};
> Transfinite Line(l+3) = 6;
> ll = newll;
> Line Loop(ll) = {l,l+3,-(l+1),-(l+2)};
>
> s = news;
> Plane Surface(s+i) = {ll};
> Transfinite Surface(s+i) = {p_ind+1,p_ind+2,p_ind+3,p_ind+4};
> Recombine Surface(s+i);
>
> tmp[] = {s+i};
>
> in[] = {};
> out[] = {};
> windung[]={};
>
> in[i+1]=tmp[0];
> tmp[] = Extrude { {0,0,0}, {1,0,0} , {0,0,0} , Pi/2}{ Surface {tmp[0]};
> Layers {10}; Recombine; QuadTriSngl Recomblaterals;};
> out[i+1]=tmp[0];
> windung[i+1]+=tmp[1];
>
> For j In {1:3}
> tmp[] = Extrude { {0,0,0}, {1,0,0} , {0,0,0} , Pi/2}{Surface {tmp[0]};
> Layers {10}; QuadTriDbl; Recombine; };
> vol_coil[] += tmp[1];
> windung[i+1]+=tmp[1];
> EndFor
> EndFor
> EndFor
>
>
>
> /* #################################################
> ######################## box #######################
> ##################################################*/
>
>
> p = 1000000;
> Point(p) = {0,-lb/2,-lb/2, lc3};
> Point(p+1) = {0,lb/2,-lb/2, lc3};
> Point(p+2) = {0,-lb/2,lb/2, lc3};
> Point(p+3) = {0,lb/2,lb/2, lc3};
>
> Point(p+4) = {lb/3,-lb/2,-lb/2, lc3};
> Point(p+5) = {lb/3,lb/2,-lb/2, lc3};
> Point(p+6) = {lb/3,-lb/2,lb/2, lc3};
> Point(p+7) = {lb/3,lb/2,lb/2, lc3};
>
> l = 1000000;
> Line(l) = {p,p+1};
> Line(l+1) = {p+1,p+3};
> Line(l+2) = {p+2,p+3};
> Line(l+3) = {p+2,p};
> Line(l+4) = {p+1,p+5};
> Line(l+5) = {p+5,p+7};
> Line(l+6) = {p+7,p+3};
> Line(l+7) = {p+5,p+4};
> Line(l+8) = {p+4, p};
> Line(l+9) = {p+4, p+6};
> Line(l+10) = {p+6, p+2};
> Line(l+11) = {p+7, p+6};
>
>
> ll = newll;
> Line Loop(ll)={l,l+1,-(l+2),(l+3)};
> Line Loop(ll+1)={l+4,l+5,l+6,-(l+1)};
> Line Loop(ll+2)={l+4,l+7,l+8,l};
> Line Loop(ll+3)={l+9,l+10,l+3,-(l+8)};
> Line Loop(ll+4)={l+11,l+10,l+2,-(l+6)};
> Line Loop(ll+5)={l+7,l+9,-(l+11),-(l+5)};
>
>
> s=news;
> Plane Surface(s) = {ll};//, llc+1,llc+3};
> Plane Surface(s+1)={ll+1};
> Plane Surface(s+2)={ll+2};
> Plane Surface(s+3)={ll+3};
> Plane Surface(s+4)={ll+4};
> Plane Surface(s+5)={ll+5};
>
> skin_coil[] ={};
> skin_coil[] = CombinedBoundary{ Volume{vol_coil[]}; };
>
> // skin_channel[] = CombinedBoundary{ Volume{vol_channel[]}; };
> // skin_channel[] -= {chin};
> sl=newsl;
>
> Surface Loop(sl) = {s:s+5};
> // Surface Loop(sl+1) =  {skin_channel[]};
> // Surface Loop(sl+2) = {sc+1};
> Surface Loop(sl+3) = {skin_coil[]};
> // Surface Loop(sl+4) = {skin_core[]};
> v = newv;
> Volume(v) = {sl, sl+3}; //, sl+1, sl+2, sl+4 };
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20130909/eac33221/attachment.html>