<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hi Max,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Thanks for the quick response.  I’m not sure how much time you have for debugging but I’ve attached my input files.  The main file is the geo file of course. 
 Goal.png shows what I have so far and what I am trying to do.  I have no error messages with the attached files but it’s only meshing the line loop and I would like it to fill in the surface with a 2D mesh.  Any thoughts?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Thanks,<br>
Aaron<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Max Orok [mailto:morok@mevex.com]
<br>
<b>Sent:</b> Thursday, October 11, 2018 3:03 PM<br>
<b>To:</b> Jensen, Aaron J. [US-US]; gmsh@onelab.info<br>
<b>Subject:</b> Re: [Gmsh] EXTERNAL: Re: Embedded Mesh<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">Hi Aaron, <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I might be mistaken, but it looks like your in-file Line Loop stuff is good.
<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">That might mean the Surface Loop command is giving the warning because the two Line Loops don't match up (i.e. form a closed surface)?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Sincerely, <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Max<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Thu, Oct 11, 2018 at 1:25 PM, Jensen, Aaron J. <<a href="mailto:Aaron.J.Jensen@leidos.com" target="_blank">Aaron.J.Jensen@leidos.com</a>> wrote:<o:p></o:p></p>
<p class="MsoNormal">Christophe,<br>
<br>
Thank you for the fast response.  The latest snapshot works great and fixes the crash.<br>
<br>
I am still setting up the problem incorrectly.  Here is what I have now:<br>
<br>
<br>
Merge "square";<br>
Line Loop(1) = {1};<br>
<br>
squareWidth = 1.5;<br>
halfSquareWidth = squareWidth/2.0;<br>
<br>
lc = 0.3;<br>
Point(1001) = {-halfSquareWidth,-halfSquareWidth,0.0,lc};<br>
Point(1002) = {-halfSquareWidth, halfSquareWidth,0.0,lc};<br>
Point(1003) = { halfSquareWidth, halfSquareWidth,0.0,lc};<br>
Point(1004) = { halfSquareWidth,-halfSquareWidth,0.0,lc};<br>
Line(1001) = {1004,1003};<br>
Line(1002) = {1003,1002};<br>
Line(1003) = {1002,1001};<br>
Line(1004) = {1001,1004};<br>
<br>
Line Loop(1005) = {1002,1003,1004,1001};<br>
<br>
Surface Loop(1006) = {1005, 1};<br>
<br>
<br>
I think it is close to working but I get the warning message: "1D mesh not forming a closed loop".<br>
<br>
Any help would be greatly appreciated.<br>
<br>
Thanks,<br>
Aaron<br>
<br>
-----Original Message-----<br>
From: Christophe Geuzaine [mailto:<a href="mailto:cgeuzaine@uliege.be">cgeuzaine@uliege.be</a>]
<br>
Sent: Thursday, October 11, 2018 8:11 AM<br>
To: Jensen, Aaron J. [US-US]<br>
Cc: <a href="mailto:gmsh@onelab.info">gmsh@onelab.info</a><br>
Subject: EXTERNAL: Re: [Gmsh] Embedded Mesh<br>
<br>
<br>
<br>
> On 10 Oct 2018, at 21:12, Jensen, Aaron J. <<a href="mailto:Aaron.J.Jensen@leidos.com">Aaron.J.Jensen@leidos.com</a>> wrote:<br>
> <br>
> Hello,<br>
>  <br>
> I would like to merge an existing mesh into a geometry and then mesh the unmeshed region using gmsh (something like a boundary mesh around a pre-existing mesh generated externally by another program).  Ideally, this would result in a mesh that was partially
 created in gmsh and partially created externally to gmsh.  Ultimately, I would like to do this in both 2D and 3D but am starting with the following in 2D:<br>
>  <br>
>  <br>
>  <br>
> Merge "square";<br>
>  <br>
> SetFactory("OpenCASCADE");<br>
>  <br>
> Surface Loop(1) = {1};<br>
> //sExternal = news;<br>
> //Rectangle(sExternal) = {0, 0, 0.0, 0.5, 0.5};<br>
>  <br>
> s1 = news;<br>
> Rectangle(s1) = {-0.25, -0.25, 0.0, 1.0, 1.0};<br>
>  <br>
> //BooleanDifference (2000) = { Surface{s1}; Delete; }{ Surface{sExternal}; };<br>
> BooleanDifference (2000) = { Surface{s1}; Delete; }{ Surface{1}; };<br>
>  <br>
<br>
This cannot work: boolean operations can only be applied to CAD entities. It should not crash though - and it does not on my machine. Can you try with the latest snapshot?<br>
<br>
You can still produce a mesh like the one you want. With the built-in engine, simply
<br>
<br>
- load the mesh, which should contain the bounding surface mesh<br>
<br>
- define the exterior "Surface Loop" where the interior surfaces are the bounding surfaces (discrete)<br>
<br>
Christophe<br>
<br>
<br>
>  <br>
>  <br>
> OpenCascade doesn’t recognize surface 1 and BooleanDifference causes gmsh to crash.  I assume I am doing something wrong?  Can gmsh embed an existing mesh into a gmsh geometry or CAD model?<br>
>  <br>
> Thanks,<br>
> Aaron<br>
> <square>_______________________________________________<br>
> gmsh mailing list<br>
> <a href="mailto:gmsh@onelab.info">gmsh@onelab.info</a><br>
> <a href="http://onelab.info/mailman/listinfo/gmsh" target="_blank">http://onelab.info/mailman/listinfo/gmsh</a><br>
<br>
— <br>
Prof. Christophe Geuzaine<br>
University of Liege, Electrical Engineering and Computer Science <br>
<a href="http://www.montefiore.ulg.ac.be/~geuzaine" target="_blank">http://www.montefiore.ulg.ac.be/~geuzaine</a><br>
<br>
Free software: <a href="http://gmsh.info" target="_blank">http://gmsh.info</a> | <a href="http://getdp.info" target="_blank">
http://getdp.info</a> | <a href="http://onelab.info" target="_blank">http://onelab.info</a><br>
<br>
_______________________________________________<br>
gmsh mailing list<br>
<a href="mailto:gmsh@onelab.info">gmsh@onelab.info</a><br>
<a href="http://onelab.info/mailman/listinfo/gmsh" target="_blank">http://onelab.info/mailman/listinfo/gmsh</a><o:p></o:p></p>
</div>
<p class="MsoNormal"><br>
<br clear="all">
<br>
-- <o:p></o:p></p>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal">Max Orok<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Contractor<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><a href="http://www.mevex.com" target="_blank">www.mevex.com</a><br>
<br>
<span style="border:solid windowtext 1.0pt;padding:0in"><img border="0" width="164" height="42" id="_x0000_i1025" src="cid:image001.jpg@01D46173.E941BD80" alt="Image removed by sender."></span><o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>