]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Find gcc bug and fix the resulting invalid code.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 18 May 2001 08:37:20 +0000 (08:37 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 18 May 2001 08:37:20 +0000 (08:37 +0000)
git-svn-id: https://svn.dealii.org/trunk@4667 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/dofs/dof_tools.cc
deal.II/doc/news/2001/c-3-1.html

index d43032d5af60f9ac54c4930152786ea9e7c6fad7..b6b5bb4dbe1da035b643b4c18e4c93d47ddcd34c 100644 (file)
@@ -946,7 +946,8 @@ template <>
 void
 DoFTools::extract_boundary_dofs (const DoFHandler<1>      &dof_handler,
                                 const std::vector<bool>  &component_select,
-                                std::vector<bool>        &selected_dofs)
+                                std::vector<bool>        &selected_dofs,
+                                const std::set<unsigned char> &boundary_indicators)
 {
   Assert (component_select.size() == dof_handler.get_fe().n_components(),
          ExcWrongSize (component_select.size(),
@@ -959,23 +960,36 @@ DoFTools::extract_boundary_dofs (const DoFHandler<1>      &dof_handler,
 
   Assert (dof_handler.get_fe().dofs_per_face == dof_handler.get_fe().dofs_per_vertex,
          ExcInternalError());
+
+                                  // let's see whether we have to
+                                  // check for certain boundary
+                                  // indicators or whether we can
+                                  // accept all
+  const bool check_left_vertex  = ((boundary_indicators.size() == 0) ||
+                                  (boundary_indicators.find(0) !=
+                                   boundary_indicators.end()));
+  const bool check_right_vertex = ((boundary_indicators.size() == 0) ||
+                                  (boundary_indicators.find(1) !=
+                                   boundary_indicators.end()));
   
                                   // loop over coarse grid cells
   for (DoFHandler<1>::cell_iterator cell=dof_handler.begin(0);
        cell!=dof_handler.end(0); ++cell)
     {
                                       // check left-most vertex
-      if (cell->neighbor(0) == dof_handler.end())
-       for (unsigned int i=0; i<dof_handler.get_fe().dofs_per_face; ++i)
-         if (component_select[dof_handler.get_fe().
-                             face_system_to_component_index(i).first] == true)
-           selected_dofs[cell->vertex_dof_index(0,i)] = true;
+      if (check_left_vertex)
+       if (cell->neighbor(0) == dof_handler.end())
+         for (unsigned int i=0; i<dof_handler.get_fe().dofs_per_face; ++i)
+           if (component_select[dof_handler.get_fe().
+                               face_system_to_component_index(i).first] == true)
+             selected_dofs[cell->vertex_dof_index(0,i)] = true;
                                       // check right-most vertex
-      if (cell->neighbor(1) == dof_handler.end())
-       for (unsigned int i=0; i<dof_handler.get_fe().dofs_per_face; ++i)
-         if (component_select[dof_handler.get_fe().
-                             face_system_to_component_index(i).first] == true)
-           selected_dofs[cell->vertex_dof_index(1,i)] = true;
+      if (check_right_vertex)
+       if (cell->neighbor(1) == dof_handler.end())
+         for (unsigned int i=0; i<dof_handler.get_fe().dofs_per_face; ++i)
+           if (component_select[dof_handler.get_fe().
+                               face_system_to_component_index(i).first] == true)
+             selected_dofs[cell->vertex_dof_index(1,i)] = true;
     };
 };
 
index 07e1f8eb37868ec0f7e3184c57243abe4c12b731..4948d4a0409f89273e442d80411faa425f77fe0d 100644 (file)
@@ -239,7 +239,6 @@ documentation, etc</a>.
        (GK 2001/03/05)
        </p>
 
-
   <li> <p> Fix: <code class="class">Logstream</code>::<code
        class="member">pop()</code> does not perform anything on empty
        stacks.
@@ -408,6 +407,16 @@ documentation, etc</a>.
 <h3>deal.II</h3>
 
 <ol>
+  <li> <p>
+       Fixed: due to a bug in gcc, the compiler did not check that we
+       did not use the set of given boundary indicators to the
+       <code class="member">DoFTools::extract_boundary_dofs</code>
+       function in 1d. That set was therefore ignored. This is now
+       fixed.
+       <br>
+       (WB 2001/05/18)
+       </p>
+
   <li> <p>
        Changed: the flags which are given to the <code
        class="class">GridOut</code> class to modify the appearance of

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.