<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
</head>
<body>
<div name="messageBodySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
Dear Christophe,
<div><br>
</div>
<div>Thank you for your solution. It seemed to work fine, I think. However, I am not sure about how it works with “named” physicals. Here is the code (based on your code) that I attached to end of my geo file:</div>
<div><br>
</div>
<div>
<p style="margin: 0.0px 0.0px 0.0px 0.0px;color: #000000;background-color: #ffffa8;">
Mesh 3;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px;color: #000000;background-color: #ffffa8;">
<br>
</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px;color: #000000;background-color: #ffffa8;">
// create volumes for blood mass</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px;color: #000000;background-color: #ffffa8;">
Physical Volume("tissue") = {norm_tiss};</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px;color: #000000;background-color: #ffffa8;">
Physical Volume("ischaemic") = {isch_vol[1]};</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px;color: #000000;background-color: #ffffa8;">
Physical Volume("lv_blood") = {lv_bl};</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px;color: #000000;background-color: #ffffa8;">
Physical Volume("rv_blood") = {rv_bl_fin};</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px;color: #000000;background-color: #ffffa8;">
<br>
</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px;color: #000000;background-color: #ffffa8;">
Save "isch1-vent-wb.msh";</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px;color: #000000;background-color: #ffffa8;">
Delete Physicals;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px;color: #000000;background-color: #ffffa8;">
// create volues for exporting - always export normal and ischaemic tissue</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px;color: #000000;background-color: #ffffa8;">
Physical Volume("tissue") = {norm_tiss};</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px;color: #000000;background-color: #ffffa8;">
Physical Volume("ischaemic") = {isch_vol[1]};</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px;color: #000000;background-color: #ffffa8;">
<br>
</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px;color: #000000;background-color: #ffffa8;">
// create surfaces for getting fibre directions</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px;color: #000000;background-color: #ffffa8;">
Physical Surface("base") = {tiss_surf[9],tiss_surf[10]};</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px;color: #000000;background-color: #ffffa8;">
Physical Surface("epicardium") = {tiss_surf[7],tiss_surf[8]};</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px;color: #000000;background-color: #ffffa8;">
Physical Surface("rv_endo") = {tiss_surf[11],tiss_surf[12]};</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px;color: #000000;background-color: #ffffa8;">
Physical Surface("lv_endo") = {tiss_surf[0]};</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px;color: #000000;background-color: #ffffa8;">
<br>
</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px;color: #000000;background-color: #ffffa8;">
Save "isch1-vent-nb.msh”;</p>
</div>
</div>
<div name="messageSignatureSection"><br>
<div class="matchFont">Please note that I saved the files in version 2.2 format (for use with fenics). </div>
<div class="matchFont"><br style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
</div>
<div class="matchFont">The first few lines of the exported file "isch1-vent-wb.msh" look like this:</div>
<div class="matchFont"><br style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
</div>
<div class="matchFont">
<p style="margin: 0px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 168); font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
$MeshFormat</p>
<p style="margin: 0px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 168); font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
2.2 0 8</p>
<p style="margin: 0px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 168); font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
$EndMeshFormat</p>
<p style="margin: 0px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 168); font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
$PhysicalNames</p>
<p style="margin: 0px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 168); font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
4</p>
<p style="margin: 0px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 168); font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
3 1 "tissue"</p>
<p style="margin: 0px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 168); font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
3 2 "ischaemic"</p>
<p style="margin: 0px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 168); font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
3 3 "lv_blood"</p>
<p style="margin: 0px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 168); font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
3 4 "rv_blood"</p>
<p style="margin: 0px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 168); font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
$EndPhysicalNames</p>
<p style="margin: 0px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 168); font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
$Nodes</p>
</div>
<div class="matchFont"><br style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
</div>
<div class="matchFont">which is fine, but the first few lines of "isch-vent-nb.msh" are:</div>
<div class="matchFont"><br style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
</div>
<div class="matchFont">
<p style="margin: 0px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 168); font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
$MeshFormat</p>
<p style="margin: 0px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 168); font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
2.2 0 8</p>
<p style="margin: 0px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 168); font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
$EndMeshFormat</p>
<p style="margin: 0px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 168); font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
$PhysicalNames</p>
<p style="margin: 0px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 168); font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
8</p>
<p style="margin: 0px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 168); font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
2 7 "base"</p>
<p style="margin: 0px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 168); font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
2 8 "epicardium"</p>
<p style="margin: 0px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 168); font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
2 9 "rv_endo"</p>
<p style="margin: 0px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 168); font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
2 10 "lv_endo"</p>
<p style="margin: 0px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 168); font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
3 1 "tissue"</p>
<p style="margin: 0px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 168); font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
3 2 "ischaemic"</p>
<p style="margin: 0px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 168); font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
3 3 "lv_blood"</p>
<p style="margin: 0px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 168); font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
3 4 "rv_blood"</p>
<p style="margin: 0px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 168); font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
$EndPhysicalNames</p>
<p style="margin: 0px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 168); font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
$Nodes</p>
</div>
<div class="matchFont"><br style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
</div>
<div class="matchFont">This seems to have the unneccesary volumes "lv_blood" and "rv_blood".</div>
<div class="matchFont"><br style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
</div>
<div class="matchFont">I was wondering if there was something I am missing? Perhaps it is not important? The dolfin-convert program for converting msh files to xml files does not complain.</div>
<div class="matchFont"><br style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
</div>
<div class="matchFont">I hope this makes sense.</div>
<div class="matchFont"><br style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
</div>
<div class="matchFont">Thanks,</div>
<div class="matchFont"><br style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
</div>
<div class="matchFont">Peter.</div>
<div class="matchFont"><br style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
</div>
<div class="matchFont">---------------------------------------------------------------------<br style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
<br style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
Associate Professor Peter Johnston (FAustMS, FIMA)<br style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
School of Environment and Science<br style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
Griffith University | Nathan | QLD 4111 | Technology (N44) Room 3.19<br style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
T +61 7 373 57748| F +61 7 373 57656 Email p.johnston@griffith.edu.au</div>
</div>
<div name="messageReplySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
On 13 Mar 2019, 10:42 PM +1000, Christophe Geuzaine <cgeuzaine@uliege.be>, wrote:<br>
<blockquote type="cite" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #1abc9c;">
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;"></span></font>
<div class="PlainText"><font size="2"><span style="font-size:11pt;"><br>
<br>
> On 13 Mar 2019, at 07:25, Peter Johnston <p.johnston@griffith.edu.au> wrote:<br>
><br>
> Hello,<br>
><br>
> I was wondering if it was possible to create a mesh in gmsh and export it in two different ways. For example, I have created a complex mesh of heart tissue and blood volumes and I wish to export this as one mesh. I would also like to export just the heart
tissue and its bounding surfaces into another mesh file. Is this possible without going back and starting at the beginning and remeshing the entire structure?<br>
><br>
<br>
You can achieve this with physical groups. See the attached .geo example (you can also do the same with the API):<br>
<br>
</span></font></div>
<font size="2"><span style="font-size:11pt;"></span></font></div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;"></span></font>
<div class="PlainText"><font size="2"><span style="font-size:11pt;"><br>
<br>
> Thanks very much,<br>
><br>
> Peter.<br>
><br>
> ---------------------------------------------------------------------<br>
><br>
> Associate Professor Peter Johnston (FAustMS, FIMA)<br>
> School of Environment and Science<br>
> Griffith University | Nathan | QLD 4111 | Technology (N44) Room 3.19<br>
> T +61 7 373 57748| F +61 7 373 57656 Email p.johnston@griffith.edu.au<br>
> _______________________________________________<br>
> gmsh mailing list<br>
> gmsh@onelab.info<br>
> <a href="http://onelab.info/mailman/listinfo/gmsh">
https://protect-au.mimecast.com/s/kHanCE8krZHR1j56CNeh7H?domain=onelab.info</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">http://www.montefiore.ulg.ac.be/~geuzaine</a><br>
<br>
<br>
<br>
</span></font></div>
<font size="2"><span style="font-size:11pt;"></span></font></div>
</blockquote>
</div>
</body>
</html>