<div dir="ltr"><div>It is necessary to define physical groups for surfaces in order to apply boundary conditions. The Boundary function returns the surfaces for a given geometry, but after a boolean operation, the surface entities change and the surface is lost. Here is an example:</div><div><br></div><div>SetFactory("OpenCASCADE");<br><br></div><div>box1 = newreg;<br>Box(box1) = {-2,-2,-2, 4,4,4};<br></div><div>// The box1 will be deleted in the boolean operation and the boundary is invalid<br></div><div>// box1_boundary() = Boundary{ Volume{box1}; };<br></div><div>// Physical Surface("box1_surface") = { box1_boundary() };<br><br>box2 = newreg;<br>Box(box2) = {-1,-1,-1, 2,2,2};<br><br>case = newreg;<br>BooleanDifference(case) = { Volume{box1}; Delete; }{ Volume{box2}; };<br><br>Physical Volume("case") = {case};<br>Physical Volume("box2") = {box2};<br><br>// The boundary return also the internal surface<br>case_boundary() = Boundary{ Volume{case}; };<br>Physical Surface("case_surface") = { case_boundary() };<br></div><div><br></div><div>// Recover the surfaces using BoundingBox, but it's cumbersome and works only for specific simple geometries...</div><div>tol = 1e-3;<br>s1() = Surface In BoundingBox { -2-tol,-2-tol,-2-tol, 4+tol, 4+tol, -2+tol };<br>Physical Surface("Back") = s1();<br><br></div>I would be curious if there is better way to obtain the outer surfaces of a volume after a boolean operation?<div><br></div><div><div>Thanks!<br></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Francis</div></div></div></div>