<div dir="ltr"><div><div>Hi gmsh community,<br><br></div>I'm trying to make a multi-region mesh that consists of a few concentric spheres, plus what are pipes leading into one of the spheres. This is intended to eventually be a coolant channel. Around some fuel for a space reactor design.<br><br></div>The CSG functionality is great for this, but seems to get caught in an infinite loop after reading the last line of this input:<br><br>////////////////////////////<br>SetFactory("OpenCASCADE");<br><br>// Dimensions from core optimization<br>rfuel = .0505;<br>rvess = .0555;<br>rcool  = .06135;<br>rsteel = .06635;<br>rrefl = .19705;<br><br>// These pipes could have their radii varied to get different effects<br>rpipetop = 5.229/2.0; <br>rpipebot = 5.229/2.0; <br>pipeWallThick = 0.005;<br><br>// z coordinates of bottom of cylinder to make it match with spherical vessel<br>hcyltop = Sqrt(rcool*rcool-rpipetop*rpipetop);<br>hcylbot = Sqrt(rcool*rcool-rpipebot*rpipebot);<br><br>// Length of pipe at top and bottom to capture any recirculations<br>topdevelopLength = .03;<br>botdevelopLength= .03;<br><br>// "jawbreaker"<br>Sphere(1) = {0.0, 0.0, 0.0, rfuel};<br>p() = PointsOf{ Volume{1}; };<br>Characteristic Length{p()} = rfuel/4.0;<br>Physical Volume("fuel") = {1};<br><br>// vessel<br>Sphere(2) = {0.0, 0.0, 0.0, rvess};<br>BooleanDifference(3) = {Volume{2}; Delete;}{Volume{1};};<br>p() = PointsOf{ Volume{3}; };<br>Characteristic Length{p()} = (rvess-rfuel)/2.0;<br>Physical Volume("tantaloy") = {3};<br><br>// sodium<br>Sphere(4) = {0.0, 0.0, 0.0, rcool};<br>BooleanDifference(5) = {Volume{4};}{Volume{3,1};};<br>Cylinder(6) = {0.0, 0.0, hcyltop, 0.0, 0.0, hcyltop+topdevelopLength, rpipetop};<br>BooleanDifference(7) = {Volume{6}; Delete;}{Volume{4}; Delete;};<br clear="all"><div><div><div>//////////////////////////////////////////<br><br></div><div>I'm trying to cut a sphere out of the bottom of a cylinder for that (7) entity. If it helps the developers at all, here's what the stack looks like in the infinite loop.<br><br>#0  0x00007fffefdbb8c4 in __memset_avx2_unaligned_erms () from /usr/lib/libc.so.6<br>#1  0x00007fffefce711b in calloc () from /usr/lib/libc.so.6<br>#2  0x00007ffff120ad31 in Standard_MMgrRaw::Allocate(unsigned long) ()<br>   from /opt/opencascade/lib/libTKernel.so.0<br>#3  0x00007ffff257ace7 in TopExp_Explorer::TopExp_Explorer() ()<br>   from /opt/opencascade/lib/libTKBRep.so.0<br>#4  0x00007ffff2f47c2c in BRepClass3d_SolidExplorer::FindAPointInTheFace(TopoDS_Face const&, gp_Pnt&, double&, double&, double&, gp_Vec&, gp_Vec&) ()<br>   from /opt/opencascade/lib/libTKTopAlgo.so.0<br>#5  0x00007ffff2f48cd6 in BRepClass3d_SolidExplorer::PointInTheFace(TopoDS_Face const&, gp_Pnt&, double&, double&, double&, int&, Handle_BRepAdaptor_HSurface const&, double, double, double, double, gp_Vec&, gp_Vec&) const () from /opt/opencascade/lib/libTKTopAlgo.so.0<br>#6  0x00007ffff2f49a3f in BRepClass3d_SolidExplorer::OtherSegment(gp_Pnt const&, gp_Lin&, double&) () from /opt/opencascade/lib/libTKTopAlgo.so.0<br>#7  0x00007ffff2f45dbf in BRepClass3d_SClassifier::Perform(BRepClass3d_SolidExplorer&, gp_Pnt const&, double) () from /opt/opencascade/lib/libTKTopAlgo.so.0<br>#8  0x00007ffff353b77c in void OSD_Parallel::For<BOPCol_ContextFunctor<BOPAlgo_VertexSolid, BOPCol_NCVector<BOPAlgo_VertexSolid>, Handle_IntTools_Context, IntTools_Context> >(int, int, BOPCol_ContextFunctor<BOPAlgo_VertexSolid, BOPCol_NCVector<BOPAlgo_VertexSolid>, Handle_IntTools_Context, IntTools_Context> const&, unsigned int) () from /opt/opencascade/lib/libTKBO.so.0<br>#9  0x00007ffff3539d07 in BOPAlgo_PaveFiller::PerformVZ() ()<br>   from /opt/opencascade/lib/libTKBO.so.0<br>#10 0x00007ffff3536f20 in BOPAlgo_PaveFiller::PerformInternal() ()<br>   from /opt/opencascade/lib/libTKBO.so.0<br>#11 0x00007ffff3536cef in BOPAlgo_PaveFiller::Perform() ()<br>   from /opt/opencascade/lib/libTKBO.so.0<br>#12 0x00007ffff35c37d5 in BRepAlgoAPI_BooleanOperation::Build() ()<br>   from /opt/opencascade/lib/libTKBO.so.0<br>#13 0x0000555555a5ed08 in OCC_Internals::booleanOperator (this=0x555556ae5330, tag=7, <br>    op=OCC_Internals::Difference, objectDimTags=std::vector of length 1, capacity 1 = {...}, <br>    toolDimTags=std::vector of length 1, capacity 1 = {...}, <br>    outDimTags=std::vector of length 0, capacity 0, <br>    outDimTagsMap=std::vector of length 0, capacity 0, removeObject=true, removeTool=true)<br>    at /home/gavin/code/gmsh/Geo/GModelIO_OCC.cpp:2421<br>#14 0x0000555555eef8ee in gmsh_yyparse () at Gmsh.y:4081<br>#15 0x00005555558c4465 in ParseFile (fileName="pulsr.geo", close=close@entry=true, <br>    warnIfMissing=warnIfMissing@entry=false) at /home/gavin/code/gmsh/Common/OpenFile.cpp:199<br>#16 0x0000555555a014fd in GModel::readGEO (name="pulsr.geo")<br>    at /home/gavin/code/gmsh/Geo/GModel.cpp:2716<br>#17 0x00005555558c42b3 in MergeFile (fileName="pulsr.geo", <br>    warnIfMissing=warnIfMissing@entry=false, setBoundingBox=setBoundingBox@entry=true, <br>    importPhysicalsInOnelab=importPhysicalsInOnelab@entry=true)<br>    at /home/gavin/code/gmsh/Common/OpenFile.cpp:508<br>#18 0x00005555558c58d7 in OpenProject (fileName="pulsr.geo")<br>    at /home/gavin/code/gmsh/Common/OpenFile.cpp:716<br>#19 0x000055555586e6eb in GmshBatch () at /home/gavin/code/gmsh/Common/GmshGlobal.cpp:266<br>#20 0x0000555555861dc7 in main (argc=7, argv=0x7fffffffda08)<br><br></div><div>So, is this user, or code error? Any advice would be greatly appreciated.<br><br></div><div>-- <br><div class="gmail_signature"><div dir="ltr">Thanks,<div>Gavin Ridley</div></div></div>
</div></div></div></div>