[Gmsh] Mesh export question

Peter Johnston p.johnston at griffith.edu.au
Mon Mar 18 04:34:31 CET 2019


Dear Christophe,

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:


Mesh 3;


// create volumes for blood mass

Physical Volume("tissue") = {norm_tiss};

Physical Volume("ischaemic") = {isch_vol[1]};

Physical Volume("lv_blood") = {lv_bl};

Physical Volume("rv_blood") = {rv_bl_fin};


Save "isch1-vent-wb.msh";

Delete Physicals;

// create volues for exporting - always export normal and ischaemic tissue

Physical Volume("tissue") = {norm_tiss};

Physical Volume("ischaemic") = {isch_vol[1]};


// create surfaces for getting fibre directions

Physical Surface("base") = {tiss_surf[9],tiss_surf[10]};

Physical Surface("epicardium") = {tiss_surf[7],tiss_surf[8]};

Physical Surface("rv_endo") = {tiss_surf[11],tiss_surf[12]};

Physical Surface("lv_endo") = {tiss_surf[0]};


Save "isch1-vent-nb.msh”;

Please note that I saved the files in version 2.2 format (for use with fenics).

The first few lines of the exported file "isch1-vent-wb.msh" look like this:


$MeshFormat

2.2 0 8

$EndMeshFormat

$PhysicalNames

4

3 1 "tissue"

3 2 "ischaemic"

3 3 "lv_blood"

3 4 "rv_blood"

$EndPhysicalNames

$Nodes

which is fine, but the first few lines of "isch-vent-nb.msh" are:


$MeshFormat

2.2 0 8

$EndMeshFormat

$PhysicalNames

8

2 7 "base"

2 8 "epicardium"

2 9 "rv_endo"

2 10 "lv_endo"

3 1 "tissue"

3 2 "ischaemic"

3 3 "lv_blood"

3 4 "rv_blood"

$EndPhysicalNames

$Nodes

This seems to have the unneccesary volumes "lv_blood" and "rv_blood".

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.

I hope this makes sense.

Thanks,

Peter.

---------------------------------------------------------------------

Associate Professor Peter Johnston (FAustMS, FIMA)
School of Environment and Science
Griffith University | Nathan | QLD 4111 | Technology (N44) Room 3.19
T +61 7 373 57748| F +61 7 373 57656 Email p.johnston at griffith.edu.au
On 13 Mar 2019, 10:42 PM +1000, Christophe Geuzaine <cgeuzaine at uliege.be>, wrote:


> On 13 Mar 2019, at 07:25, Peter Johnston <p.johnston at griffith.edu.au> wrote:
>
> Hello,
>
> 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?
>

You can achieve this with physical groups. See the attached .geo example (you can also do the same with the API):



> Thanks very much,
>
> Peter.
>
> ---------------------------------------------------------------------
>
> Associate Professor Peter Johnston (FAustMS, FIMA)
> School of Environment and Science
> Griffith University | Nathan | QLD 4111 | Technology (N44) Room 3.19
> T +61 7 373 57748| F +61 7 373 57656 Email p.johnston at griffith.edu.au
> _______________________________________________
> gmsh mailing list
> gmsh at onelab.info
> http://onelab.info/mailman/listinfo/gmsh

—
Prof. Christophe Geuzaine
University of Liege, Electrical Engineering and Computer Science
http://www.montefiore.ulg.ac.be/~geuzaine



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://onelab.info/pipermail/gmsh/attachments/20190318/97efc710/attachment.html>


More information about the gmsh mailing list