> @Dave : I am using r3510. Could the problem arise from the fact that 
> ex1.C uses the function mesh.read( ) .... is there something special 
> that needs to be done for Gmsh
> meshes?

I did a loop over the elements in the mesh you provided and the element 
subdomain IDs are set correctly, so you should be able to use the mesh 
with no problems in a libmesh program. For example, try reading in the 
mesh, and then doing:

  MeshBase::const_element_iterator       el     = 
mesh.active_local_elements_begin();
  const MeshBase::const_element_iterator end_el = 
mesh.active_local_elements_end();
  for ( ; el != end_el; ++el)
    {
      const Elem* elem = *el;
      const unsigned int sbd_id = elem->subdomain_id();
      std::cout << "Element subdomain id = " << sbd_id << std::endl;
    }

However, I never added any code to write out subdomain IDs when writing 
out a gmsh file from libMesh, so that's why you didn't see the 
appropriate physical information in out.msh. But yes, we should write 
out the subdomain info when writing out .msh files...

- Dave





>
> On Wed, Oct 28, 2009 at 4:56 AM, Roy Stogner <[email protected] 
> <mailto:[email protected]>> wrote:
>
>
>     On Wed, 28 Oct 2009, Arvind Ajoy wrote:
>
>         I am trying to read in a simple mesh created using Gmsh, which has
>         two Physical regions.  I use the example programme ex1.cc to read
>         the .msh file, and write it out as another .msh file, i.e
>         ./ex1 -d 2
>         in.msh out.msh.
>
>         I find that the output of ex1.cc mentions n_subdomains()=1, though
>         there are two physical regions.
>
>
>     Interesting...
>
>     MeshBase::n_subdomains() has been around since 2005, when Ben added
>     it (presumably to Mesh, back then?). MeshBase::set_n_subdomains()
>     appears to be an easy accessor that Derek
>     added earlier this year... but other than a little overloading in the
>     BoundaryInfo::sync() method, I can't find anywhere that subdomain
>     counts are actually getting *set* rather than just copied around!
>
>     I suppose a typical use case is for the user code to set subdomain
>     ids, but we do support them in Exodus, GMSH, Nemesis, and XDR I/O...
>     yet none of that code seems to update the total mesh id count.
>
>     Ben, Derek, anyone else know what I'm missing?  It seems as if
>     updating MeshBase::_n_sbd ought to be a standard part of
>     prepare_for_use(), but isn't...
>     ---
>     Roy
>
>


------------------------------------------------------------------------------
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-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to