<div dir="ltr">Hi Prof. Geuzaine,<div><br></div><div>Thanks a lot for your quick reply. Yes, getElements() works well for me.</div><div><br></div><div>Thanks</div><div>Xin</div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Oct 15, 2018 at 4:42 PM Christophe Geuzaine <<a href="mailto:cgeuzaine@uliege.be">cgeuzaine@uliege.be</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
> On 15 Oct 2018, at 21:47, Xin Liu <<a href="mailto:lambert8809@gmail.com" target="_blank">lambert8809@gmail.com</a>> wrote:<br>
> <br>
> Dear Developers,<br>
> <br>
> I am trying to use the new Gmsh API with SDK to build applications, and I found it is very handy. Thank you for providing such a good tool. Now, I am working on mechanics of composite materials, and very often, I need to get information about the physical group of each element as different materials are assigned to different regions. I notice the V4 mesh format arranges the elements in order of the physical groups, but how can I get such information using API? I also notice the current API provides "getNodesForPhysicalGroup", so I would expect some functions like "getElementsForPhysicalGroup"<br>
<br>
<br>
Use getEntitiesForPhysicalGroup(), then getElements()<br>
<br>
<br>
> or better "getPhysicalGroupForElements" which takes input elementID and returns PhysicalGroupID.<br>
<br>
That would be quite inefficient, as querying elements individually is slow.<br>
<br>
Christophe<br>
<br>
> <br>
> Thanks<br>
> <br>
> -- <br>
> ======================================<br>
> Xin Liu<br>
> PhD Candidate, Graduate Research Assistant<br>
> Multiscale Structural Mechanics Group<br>
> School of Aeronautics & Astronautics<br>
> Purdue University<br>
> ======================================<br>
> _______________________________________________<br>
> gmsh mailing list<br>
> <a href="mailto:gmsh@onelab.info" target="_blank">gmsh@onelab.info</a><br>
> <a href="http://onelab.info/mailman/listinfo/gmsh" rel="noreferrer" 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" rel="noreferrer" target="_blank">http://www.montefiore.ulg.ac.be/~geuzaine</a><br>
<br>
Free software: <a href="http://gmsh.info" rel="noreferrer" target="_blank">http://gmsh.info</a> | <a href="http://getdp.info" rel="noreferrer" target="_blank">http://getdp.info</a> | <a href="http://onelab.info" rel="noreferrer" target="_blank">http://onelab.info</a><br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><span style="font-size:12pt"><div style="color:rgb(0,0,0)"><font size="2"><span style="font-family:georgia,serif"><span style="font-family:georgia,serif"><span style="font-family:georgia,serif"><span style="font-family:georgia,serif"><span style="font-family:georgia,serif">======================================</span></span></span></span></span></font></div><font size="2">
</font><div style="color:rgb(0,0,0)"><font size="4"><span style="font-family:"arial black",arial,helvetica,sans-serif"><span style="font-family:"arial black",arial,helvetica,sans-serif"><span style="font-family:"arial black",arial,helvetica,sans-serif"><span style="font-family:"arial black",arial,helvetica,sans-serif"><span style="font-family:"arial black",arial,helvetica,sans-serif"><span style="font-family:"arial black",arial,helvetica,sans-serif">Xin
Liu</span></span></span></span></span></span></font></div><font size="2">
</font><div style="color:rgb(0,0,0)"><span style="font-family:georgia,serif"><span style="font-family:georgia,serif"><span style="font-family:georgia,serif"><span style="font-family:georgia,serif"><span style="font-family:georgia,serif">
<div style="margin-top:0px;margin-bottom:0px"><font size="2"><span style="font-family:georgia,serif;background-color:rgb(255,255,255)"><span style="font-family:georgia,serif"><span style="font-family:georgia,serif"><span style="font-family:georgia,serif"><span style="font-family:georgia,serif">PhD
Candidate, Graduate Research Assistant</span></span></span></span></span></font></div><font size="2">
</font><div style="margin-top:0px;margin-bottom:0px"><span><span style="color:rgb(33,33,33);font-family:georgia,serif;background-color:rgb(255,255,255)"><span style="font-family:georgia,serif"><span style="font-family:georgia,serif"><span style="font-family:georgia,serif"><span style="font-family:georgia,serif">Multiscale
Structural Mechanics Group</span></span></span></span></span><br style="font-family:georgia,serif">
</span></div><font size="2">
</font><div style="margin-top:0px;margin-bottom:0px"><span><span style="font-family:georgia,serif"></span><span style="font-family:georgia,serif"><span style="font-family:georgia,serif"><span style="font-family:georgia,serif"><span style="font-family:georgia,serif"><a href="https://cdmhub.org/members/1776" target="_blank">https://cdmhub.org/members/1776</a></span></span></span></span><br style="font-family:georgia,serif">
</span></div><font size="2">
</font><div style="margin-top:0px;margin-bottom:0px"><span><span style="font-family:georgia,serif"><span style="font-family:georgia,serif"><span style="font-family:georgia,serif"><span style="font-family:georgia,serif">School of Aeronautics
& Astronautics</span></span></span></span><br style="font-family:georgia,serif">
</span></div><font size="2">
</font><div style="margin-top:0px;margin-bottom:0px"><span style="font-family:georgia,serif"><span style="font-family:georgia,serif"><span style="font-family:georgia,serif"><span style="font-family:georgia,serif">Pu<span style="color:rgb(0,0,0)">rdue
University</span></span></span></span></span></div><font size="2">
</font><div style="margin-top:0px;margin-bottom:0px"><span style="font-family:georgia,serif;color:rgb(0,0,0)"><span style="font-family:georgia,serif;color:rgb(0,0,0)"><span style="font-family:georgia,serif;color:rgb(0,0,0)"><span style="font-family:georgia,serif;color:rgb(0,0,0)"><span style="color:rgb(0,0,0)">Neil
Armstrong Hall of Engineering</span></span></span></span></span></div><font size="2">
</font><div style="margin-top:0px;margin-bottom:0px"><span style="font-family:georgia,serif;color:rgb(0,0,0)"><span style="font-family:georgia,serif;color:rgb(0,0,0)"><span style="font-family:georgia,serif;color:rgb(0,0,0)"><span style="font-family:georgia,serif;color:rgb(0,0,0)"><span style="font-family:georgia,serif;color:rgb(0,0,0)"><span style="font-family:georgia,serif;color:rgb(0,0,0)"><span style="font-family:georgia,serif;color:rgb(0,0,0)"><span style="color:rgb(0,0,0)">701
W. Stadium Ave.</span></span></span></span></span></span></span></span></div><font size="2">
</font><div style="margin-top:0px;margin-bottom:0px"><span style="font-family:georgia,serif;color:rgb(0,0,0)"><span style="font-family:georgia,serif;color:rgb(0,0,0)"><span style="font-family:georgia,serif;color:rgb(0,0,0)"><span style="font-family:georgia,serif;color:rgb(0,0,0)"><span style="font-family:georgia,serif;color:rgb(0,0,0)"><span style="font-family:georgia,serif;color:rgb(0,0,0)"><span style="font-family:georgia,serif;color:rgb(0,0,0)"><span style="color:rgb(0,0,0)">West
Lafayette, Indiana 47907-2045</span></span></span></span></span></span></span></span></div>
</span></span></span></span></span></div><font size="2">
</font><div style="color:rgb(0,0,0)"><span style="font-family:georgia,serif"><span style="font-family:georgia,serif"><span style="font-family:georgia,serif"><span style="font-family:georgia,serif"><span style="font-family:georgia,serif">======================================</span></span></span></span></span></div>
</span></div></div></div></div>