Finding the material (volume) ID using the GMSH C++ API
Hope someone can point me in the right direction. I have (using the GMSH API created a set of volumes and assigned them such as
Volume(1) = {1}; Volume(2) = {2}; etc
I then run gmsh::model::mesh::generate(3);
and it works all fine. I have found i can extract the mesh nodes and elements for a tetrahedron mesh using something like
gmsh::model::mesh::getNodes(Node_tags, nodes, paracoord);
gmsh::model::mesh::getElementsByType(4, Tet_tags, Tets);
But - where do i find the materials (volume) ID. I can 'see' it in the .msh i output
gmsh::write("model.msh");
and in there towards the bottom of the file each 'block' of tetrahedrons has a little heading like this 3 1 4 24 where i understand the 1 is the material ID - and 24 is the number of elements in that volume.
How do I extract that volume number using the API so I can assign materials to the output file.
Edited by Julian Dean