<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I guess that's a problem with the order of your commands and coherence.<div>The coherence is active by default, so if you duplicate a volume that shares surfaces with another volume, you can loose them, I mean the numbering changes.</div><div><br></div><div>What you can do is setting the Coherence to 0, when extruding and duplicating and then put it back to 1. That is:</div><div><br></div><div>Geometry.AutoCoherence=0;</div><div>====</div><div>your code</div><div>===</div><div>Coherence;</div><div><br></div><div><br></div><div>Ruth </div><div><br></div><div><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>--</div><div>Dr. Ir. Ruth V. Sabariego</div><div>University of Liege, Electrical Engineering & Computer Science, </div><div>Applied & Computational Electromagnetics (ACE),</div><div>phone: +32-4-3663737 - fax: +32-4-3662910 - <a href="http://ace.montefiore.ulg.ac.be/">http://ace.montefiore.ulg.ac.be/</a></div><br class="Apple-interchange-newline"><br></div></span></div></span></span>
</div>
<br><div><div>On 05 Jul 2012, at 17:21, Joseph Frippiat wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hello,<br><br>I try to duplicate a volume and 2 surfaces programmatically and I cann't.<br>I can duplicate the volume OR the surfaces but not both of them.<br><br>Thanks for any help.<br><br>Here is my code (the problematic part of it)  :<br><br>/// l'inducteur 2 (le plus en arrière)<br>//pind2 = point arrière inducteur 2<br>pind2[]+=newp; Point(newp) = { 0, 0,                      -e1-e2+isol, lcgros}; // 1<br>pind2[]+=newp; Point(newp) = { (r1+isol)*Sin[angle/2], (r1+isol)*Cos[angle/2], -e1-e2+isol, lcgros}; // 2<br>pind2[]+=newp; Point(newp) = { (r2-isol)*Sin[angle/2], (r2-isol)*Cos[angle/2], -e1-e2+isol, lcgros}; // 3<br>pind2[]+=newp; Point(newp) = {-(r2-isol)*Sin[angle/2], (r2-isol)*Cos[angle/2], -e1-e2+isol, lcgros}; // 4<br>pind2[]+=newp; Point(newp) = {-(r1+isol)*Sin[angle/2], (r1+isol)*Cos[angle/2], -e1-e2+isol, lcgros}; // 5<br><br>//lind2 = ligne arrière inducteur 2<br>lind2[]+=newl; Line(newl)   = {pind2[1], pind2[2]};<br>lind2[]+=newl; Circle(newl) = {pind2[2], pind2[0], pind2[3]};<br>lind2[]+=newl; Line(newl)   = {pind2[3], pind2[4]};<br>lind2[]+=newl; Circle(newl) = {pind2[4], pind2[0], pind2[1]};<br><br>//llind2 = line loop arrière inducteur 2<br>llind2=newll; Line Loop(newll) = {lind2[]};<br><br>//surfind2 = surface arrière inducteur 2<br>surfind2=news; Plane Surface(news) = {llind2};<br><br>//volind2 = volume inducteur 2<br>out[] = Extrude {0, 0, e2-2*isol} { Surface{surfind2}; };<br>volind2=out[1];<br>surfdind2=out[2]; // surface droite inducteur 2<br>surfgind2=out[4]; // surface gauche inducteur 2<br>Delete out;<br><br>/// L'inducteur 1 (le plus en avant, identique à l'inducteur 2)<br>//volind1 = volume inducteur 1<br>//volind1 = Translate {0, 0, e2+2*e1} { Duplicata{ Volume{volind2};} };<br>//surfdind1 = Translate {0, 0, e2+2*e1} { Duplicata{ Surface{surfdind2}; } };<br>//surfgind1 = Translate {0, 0, e2+2*e1} { Duplicata{ Surface{surfgind2}; } };<br>out[] = Translate {0, 0, e2+2*e1} { Duplicata{ Volume{volind2}; Surface{surfdind2,surfgind2};} };<br>volind1=out[0];<br>surfdind1=out[1];<br>surfgind1=out[2];<br>Delete out;<br><br><br>_______________________________________________<br>gmsh mailing list<br><a href="mailto:gmsh@geuz.org">gmsh@geuz.org</a><br>http://www.geuz.org/mailman/listinfo/gmsh<br></div></blockquote></div><br></div></body></html>