]> https://gitweb.dealii.org/ - dealii.git/commitdiff
DoFHandler fixed
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Tue, 14 Feb 2006 13:06:19 +0000 (13:06 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Tue, 14 Feb 2006 13:06:19 +0000 (13:06 +0000)
git-svn-id: https://svn.dealii.org/trunk@12385 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/grid/tria.h
deal.II/deal.II/source/dofs/dof_handler.cc

index f26e9d7b8736ea5d9905c5ee3ca60633eb6f414e..5f3b71efc1b89aed8066668e52d039e78c119b01 100644 (file)
@@ -2652,6 +2652,12 @@ class Triangulation : public Subscriptor
                                      */
     unsigned int n_used_vertices () const;
 
+                                    /**
+                                     * Return @p true if the vertex
+                                     * with this @p index is used.
+                                     */
+    bool vertex_used (unsigned int index) const;
+    
                                     /**
                                      * Return a constant reference to
                                      * the array of @p bools
@@ -3088,13 +3094,25 @@ class Triangulation : public Subscriptor
     friend class TriaRawIterator<3,CellAccessor<3> >;
     
     friend class hp::DoFHandler<dim>;
-    friend class MGDoFHandler<dim>;
 };
 
 
+#ifndef DOXYGEN
+
+template <int dim>
+inline
+bool
+Triangulation<dim>::vertex_used(const unsigned int index) const
+{
+  Assert (index < vertices_used.size(),
+         ExcIndexRange(index, 0, vertices_used.size()));
+  return vertices_used[index];
+}
+
+
 /* -------------- declaration of explicit specializations ------------- */
 
-#ifndef DOXYGEN
+
 
 template <> Triangulation<1>::cell_iterator Triangulation<1>::begin (const unsigned int level) const;
 template <> Triangulation<1>::raw_cell_iterator Triangulation<1>::end () const;
@@ -3223,6 +3241,8 @@ template <> unsigned int Triangulation<3>::n_cells (const unsigned int level) co
 template <> unsigned int Triangulation<3>::n_active_cells (const unsigned int level) const;
 template <> unsigned int Triangulation<1>::n_quads () const;
 template <> unsigned int Triangulation<1>::n_quads (const unsigned int) const;
+template <> unsigned int Triangulation<1>::n_raw_quads (const unsigned int) const;
+template <> unsigned int Triangulation<1>::n_raw_hexs (const unsigned int) const;
 template <> unsigned int Triangulation<1>::n_active_quads (const unsigned int) const;
 template <> unsigned int Triangulation<1>::n_active_quads () const;
 template <> unsigned int Triangulation<1>::max_adjacent_cells () const;
index ab446993284c22d499ab24ba752500a198508667..048d67d507a905587d780a1d099a1c00956699e2 100644 (file)
@@ -1671,9 +1671,9 @@ void DoFHandler<1>::renumber_dofs (const std::vector<unsigned int> &new_numbers)
     else
                                       // if index is invalid_dof_index: check if this one
                                       // really is unused
-//       Assert (tria->vertices_used[(i-vertex_dofs.begin()) /
-//                              selected_fe->dofs_per_vertex] == false,
-//           ExcInternalError ());
+      Assert (tria->vertex_used((i-vertex_dofs.begin()) /
+                                selected_fe->dofs_per_vertex) == false,
+             ExcInternalError ());
   
   for (unsigned int level=0; level<levels.size(); ++level) 
     for (std::vector<unsigned int>::iterator i=levels[level]->line_dofs.begin();
@@ -1719,9 +1719,9 @@ void DoFHandler<2>::renumber_dofs (const std::vector<unsigned int> &new_numbers)
     else
                                       // if index is invalid_dof_index: check if this one
                                       // really is unused
-//       Assert (tria->vertices_used[(i-vertex_dofs.begin()) /
-//                              selected_fe->dofs_per_vertex] == false,
-//           ExcInternalError ());
+      Assert (tria->vertex_used((i-vertex_dofs.begin()) /
+                                selected_fe->dofs_per_vertex) == false,
+             ExcInternalError ());
   
   for (unsigned int level=0; level<levels.size(); ++level) 
     {
@@ -1773,9 +1773,9 @@ void DoFHandler<3>::renumber_dofs (const std::vector<unsigned int> &new_numbers)
     else
                                       // if index is invalid_dof_index: check if this one
                                       // really is unused
-//       Assert (tria->vertices_used[(i-vertex_dofs.begin()) /
-//                              selected_fe->dofs_per_vertex] == false,
-//           ExcInternalError ());
+      Assert (tria->vertex_used((i-vertex_dofs.begin()) /
+                                selected_fe->dofs_per_vertex) == false,
+             ExcInternalError ());
   
   for (unsigned int level=0; level<levels.size(); ++level) 
     {
@@ -1982,11 +1982,10 @@ void DoFHandler<1>::reserve_space () {
     {
       levels.push_back (new internal::DoFHandler::DoFLevel<1>);
 
-      levels.back()->line_dofs
-       = std::vector<unsigned int>(tria->n_raw_lines(i) *
-                                   selected_fe->dofs_per_line,
-                                   invalid_dof_index);
-    }
+      levels.back()->line_dofs = std::vector<unsigned int>(tria->n_raw_lines(i) *
+                                                          selected_fe->dofs_per_line,
+                                                          invalid_dof_index);
+    };
 }
 
 
@@ -2013,14 +2012,12 @@ void DoFHandler<2>::reserve_space () {
     {
       levels.push_back (new internal::DoFHandler::DoFLevel<2>);
 
-      levels.back()->line_dofs
-       = std::vector<unsigned int> (tria->n_raw_lines(i) *
-                                    selected_fe->dofs_per_line,
-                                    invalid_dof_index);
-      levels.back()->quad_dofs
-       = std::vector<unsigned int> (tria->n_raw_quads(i) *
-                                    selected_fe->dofs_per_quad,
-                                    invalid_dof_index);
+      levels.back()->line_dofs = std::vector<unsigned int> (tria->n_raw_lines(i) *
+                                                           selected_fe->dofs_per_line,
+                                                           invalid_dof_index);
+      levels.back()->quad_dofs = std::vector<unsigned int> (tria->n_raw_quads(i) *
+                                                           selected_fe->dofs_per_quad,
+                                                           invalid_dof_index);
     };
 }
 
@@ -2047,18 +2044,15 @@ void DoFHandler<3>::reserve_space () {
     {
       levels.push_back (new internal::DoFHandler::DoFLevel<3>);
 
-      levels.back()->line_dofs
-       = std::vector<unsigned int> (tria->n_raw_lines(i) *
-                                    selected_fe->dofs_per_line,
-                                    invalid_dof_index);
-      levels.back()->quad_dofs
-       = std::vector<unsigned int> (tria->n_raw_quads(i) *
-                                    selected_fe->dofs_per_quad,
-                                    invalid_dof_index);
-      levels.back()->hex_dofs
-       = std::vector<unsigned int> (tria->n_raw_hexs(i) *
-                                    selected_fe->dofs_per_hex,
-                                    invalid_dof_index);
+      levels.back()->line_dofs = std::vector<unsigned int> (tria->n_raw_lines(i) *
+                                                           selected_fe->dofs_per_line,
+                                                           invalid_dof_index);
+      levels.back()->quad_dofs = std::vector<unsigned int> (tria->n_raw_quads(i) *
+                                                           selected_fe->dofs_per_quad,
+                                                           invalid_dof_index);
+      levels.back()->hex_dofs = std::vector<unsigned int> (tria->n_raw_hexs(i) *
+                                                          selected_fe->dofs_per_hex,
+                                                          invalid_dof_index);
     };
 }
 

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.