]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Copy face boundary_id to surface cell material_id in extract_boundary_mesh.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 16 Nov 2010 20:53:04 +0000 (20:53 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 16 Nov 2010 20:53:04 +0000 (20:53 +0000)
git-svn-id: https://svn.dealii.org/trunk@22772 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/grid/grid_tools.cc

index 57e526cefb31c1a42cacb74af6e63202f27036c4..47d29ea58e271301a21cfa420ca38ae8aae421a8 100644 (file)
@@ -1835,11 +1835,6 @@ GridTools::extract_boundary_mesh (const Triangulation<dim,spacedim> &volume_mesh
     mapping;  // temporary map for level==0
 
 
-  typename Triangulation<dim,spacedim>::cell_iterator
-    cell = volume_mesh.begin(0),
-    endc = volume_mesh.end(0);
-  typename Triangulation<dim,spacedim>::face_iterator face;
-
   std::vector< bool >                 touched (volume_mesh.n_vertices(), false);
   std::vector< CellData< boundary_dim > > cells;
   std::vector< Point<spacedim> >      vertices;
@@ -1849,10 +1844,14 @@ GridTools::extract_boundary_mesh (const Triangulation<dim,spacedim> &volume_mesh
   unsigned int v_index;
   CellData< boundary_dim > c_data;
 
-  for (; cell!=endc; ++cell)
+  for (typename Triangulation<dim,spacedim>::cell_iterator
+        cell = volume_mesh.begin(0);
+       cell != volume_mesh.end(0);
+       ++cell)
     for (unsigned int i=0; i < GeometryInfo<dim>::faces_per_cell; ++i)
       {
-       face = cell->face(i);
+       const typename Triangulation<dim,spacedim>::face_iterator
+         face = cell->face(i);
 
        if ( face->at_boundary()
             &&
@@ -1872,7 +1871,7 @@ GridTools::extract_boundary_mesh (const Triangulation<dim,spacedim> &volume_mesh
                  }
 
                c_data.vertices[j] = map_vert_index[v_index];
-               c_data.material_id = 0;
+               c_data.material_id = face->boundary_indicator();
              }
 
            cells.push_back(c_data);

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.