<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=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<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:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
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;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.EmailStyle18
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:70.85pt 56.7pt 56.7pt 56.7pt;}
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="DE-AT" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">To merge nodes, use the following command:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Geometry.Tolerance = 1e-3; // adjust value here for correct merge result<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Coherence Mesh;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">By default, the nodes in the surface with lower surface/volume number will survive. If you want the opposite, you can either assign different numbers to them or apply this change which reverses the
order. I had to do this once.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New";color:#1F497D">Index: Geo/GModel.cpp<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New";color:#1F497D">===================================================================<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New";color:#1F497D">--- Geo/GModel.cpp (revision 18255)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New";color:#1F497D">+++ Geo/GModel.cpp (working copy)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New";color:#1F497D">@@ -1556,14 +1556,21 @@<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New";color:#1F497D"> double eps = lc * tolerance;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New";color:#1F497D"> std::vector<GEntity*> entities;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New";color:#1F497D">- getEntities(entities);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New";color:#1F497D">+ getEntities(entities); // list of msh groups (tags)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New";color:#1F497D"> std::vector<MVertex*> vertices;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New";color:#1F497D">- for(unsigned int i = 0; i < entities.size(); i++)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New";color:#1F497D">- for(unsigned int j = 0; j < entities[i]->mesh_vertices.size(); j++){<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New";color:#1F497D">- MVertex *v = entities[i]->mesh_vertices[j];<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New";color:#1F497D">+ unsigned int esize (entities.size());<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New";color:#1F497D">+ for(unsigned int i = 0; i < esize; i++) { // using inverse ordering to avoid moving vertices.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New";color:#1F497D">+ for(unsigned int j = 0; j < entities[esize-1-i]->mesh_vertices.size(); j++){<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New";color:#1F497D">+ MVertex *v = entities[esize-1-i]->mesh_vertices[j];<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New";color:#1F497D"> vertices.push_back(new MVertex(v->x(), v->y(), v->z()));<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New";color:#1F497D"> }<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New";color:#1F497D">+ }<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New";color:#1F497D"> MVertexPositionSet pos(vertices);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New";color:#1F497D"> for(unsigned int i = 0; i < vertices.size(); i++)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New";color:#1F497D"> pos.find(vertices[i]->x(), vertices[i]->y(), vertices[i]->z(), eps);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif";mso-fareast-language:DE-AT">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif";mso-fareast-language:DE-AT"> gmsh [mailto:gmsh-bounces@ace20.montefiore.ulg.ac.be]
<b>On Behalf Of </b>Prof. Antonello Uva<br>
<b>Sent:</b> 19 September, 2014 12:37<br>
<b>To:</b> gmsh@geuz.org<br>
<b>Subject:</b> [Gmsh] Removing duplicates<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="IT">Dear All,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I need to mesh 2 volumes (to be filled with two materials) sharing a surface boundary: “pieno” and “vuoto”<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I modeled the geometry in an external CAD and imported them in Gmsh as two .step volumes.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I meshed everything correctly, but I have duplicated nodes (because of duplicate geometry) on the interface (boundary surface).<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Is there a way to remove duplicates (which are numerically concident) from script? Either remove duplicates on the geometry or in the mesh will work.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Here I attach my script and step files:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="IT">Merge "pieno.step";<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="IT">Merge "vuoto.step";<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Mesh.CharacteristicLengthExtendFromBoundary = 0;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Mesh.CharacteristicLengthFactor = 0.5;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Mesh.CharacteristicLengthMin = 0.4;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Mesh.CharacteristicLengthMax = 20;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Mesh.CharacteristicLengthFromCurvature = 0;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Mesh.CharacteristicLengthFromPoints = 1;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Coherence;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Physical Volume("pieno") = {1};<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Physical Volume("vuoto") = {2};<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Thank you again for support and for the possibility to use this program.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="IT" style="color:#1F497D;mso-fareast-language:IT"><o:p> </o:p></span></p>
</div>
</body>
</html>