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