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