Vijay S. Mahadevan wrote:
Arvind, If you are interested in storing the surface/volume ids for
each element, you need to create additional data in Elem class. This
would be very similar to the subdomain_id() method. And you could also
set the partition while reading the mesh but I do not know how this
would affect the mesh topology or partitioning that internally goes on
through ParMetis interface. Hence, I've commented these out but it
should be easy to add/change this in read_mesh().
For others who are not interested in using this extra memory, may be
we can make this as a configurable option ? If not, whoever needs this
functionality can add it themselves as and when a need occurs.
Roy, I've attached the patch for the GmshIO.C file. I removed all
references to mesh_data and so this should not intervene if you decide
to pull this class out of the library later. If any of the additional
changes do not follow libmesh coding patterns, feel free to change
them.
And do test the code with a ".msh" file using example 1. Let me know
if you have any questions.
Vijay
Arvind, Vijay: I've checked in the attached patch for GmshIO.C --- now
libMesh element subdomain IDs are written out to .msh files. In light of
the discussions on the n_subdomains functionality, I didn't check in any
of the subdomain vector stuff in your patch, Vijay. Sound OK?
- Dave
Index: src/mesh/gmsh_io.C
===================================================================
--- src/mesh/gmsh_io.C (revision 3513)
+++ src/mesh/gmsh_io.C (working copy)
@@ -487,7 +487,7 @@
}
// Finally, set the subdomain ID to physical
- elem->subdomain_id() = physical;
+ elem->subdomain_id() = static_cast<subdomain_id_type>(physical);
} // if element.dim == dim
// if this is a boundary
else if (eletype.dim == dim-1)
@@ -681,12 +681,12 @@
out << eletype.exptype;
// write the number of tags and
- // tag1 (physical entity), and tag2 (geometric entity)
- out << " 3 1 1 ";
+ // tag1 (physical entity), tag2 (geometric entity), and tag3 (partition entity)
+ out << " 3 "
+ << (unsigned int)(elem->subdomain_id())
+ << " 1 "
+ << (elem->processor_id()+1) << " ";
- // write the partition the element belongs to
- out << elem->processor_id()+1 << " ";
-
// if there is a node translation table, use it
if (eletype.nodes.size() > 0)
for (unsigned int i=0; i < elem->n_nodes(); i++)
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Libmesh-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-devel