]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Make DoF numbers unsigned integers.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 11 Feb 2000 09:50:48 +0000 (09:50 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 11 Feb 2000 09:50:48 +0000 (09:50 +0000)
git-svn-id: https://svn.dealii.org/trunk@2383 0785d39b-7218-0410-832d-ea1e28bc413d

48 files changed:
deal.II/deal.II/Attic/examples/multigrid/multigrid.cc
deal.II/deal.II/Attic/examples/step-by-step/step-3/step-3.cc
deal.II/deal.II/Attic/examples/step-by-step/step-4/step-4.cc
deal.II/deal.II/Attic/examples/step-by-step/step-5/step-5.cc
deal.II/deal.II/Attic/examples/step-by-step/step-6/step-6.cc
deal.II/deal.II/Attic/examples/step-by-step/step-7/step-7.cc
deal.II/deal.II/Attic/examples/step-by-step/step-8/step-8.cc
deal.II/deal.II/Todo
deal.II/deal.II/include/dofs/dof_accessor.h
deal.II/deal.II/include/dofs/dof_accessor.templates.h
deal.II/deal.II/include/dofs/dof_handler.h
deal.II/deal.II/include/dofs/dof_levels.h
deal.II/deal.II/include/dofs/dof_tools.h
deal.II/deal.II/include/grid/tria_accessor.templates.h
deal.II/deal.II/include/multigrid/mg_dof_accessor.h
deal.II/deal.II/include/multigrid/mg_dof_handler.h
deal.II/deal.II/include/multigrid/mg_smoother.h
deal.II/deal.II/include/multigrid/multigrid.templates.h
deal.II/deal.II/include/numerics/dof_renumbering.h
deal.II/deal.II/include/numerics/matrices.h
deal.II/deal.II/include/numerics/solution_transfer.h
deal.II/deal.II/include/numerics/vectors.h
deal.II/deal.II/source/dofs/dof_accessor.cc
deal.II/deal.II/source/dofs/dof_handler.cc
deal.II/deal.II/source/dofs/dof_renumbering.cc
deal.II/deal.II/source/dofs/dof_tools.cc
deal.II/deal.II/source/grid/tria.cc
deal.II/deal.II/source/multigrid/mg_dof_accessor.cc
deal.II/deal.II/source/multigrid/mg_dof_handler.cc
deal.II/deal.II/source/multigrid/mg_dof_tools.cc
deal.II/deal.II/source/multigrid/mg_smoother.cc
deal.II/deal.II/source/multigrid/multigrid.cc
deal.II/deal.II/source/numerics/assembler.cc
deal.II/deal.II/source/numerics/base.cc
deal.II/deal.II/source/numerics/data_io.cc
deal.II/deal.II/source/numerics/matrices.cc
deal.II/deal.II/source/numerics/solution_transfer.cc
deal.II/deal.II/source/numerics/vectors.cc
deal.II/examples/step-3/step-3.cc
deal.II/examples/step-4/step-4.cc
deal.II/examples/step-5/step-5.cc
deal.II/examples/step-6/step-6.cc
deal.II/examples/step-7/step-7.cc
deal.II/examples/step-8/step-8.cc
tests/big-tests/multigrid/multigrid.cc
tests/deal.II/helmholtz1.th
tests/deal.II/helmholtz1mg.th
tests/deal.II/wave-test-3.cc

index 77691684719d5f0ddd1f9edba528c43229c7454e..ceed517aeaf964d076fa496d81cdb94fabc02b07 100644 (file)
@@ -232,16 +232,16 @@ void LaplaceProblem<dim>::assemble_system ()
                                       update_q_points  |
                                       update_JxW_values));
 
-  const unsigned int dofs_per_cell = fe.dofs_per_cell;
-  const unsigned int n_q_points    = quadrature_formula.n_quadrature_points;
+  const unsigned int   dofs_per_cell = fe.dofs_per_cell;
+  const unsigned int   n_q_points    = quadrature_formula.n_quadrature_points;
 
-  FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
-  Vector<double>     cell_rhs (dofs_per_cell);
+  FullMatrix<double>   cell_matrix (dofs_per_cell, dofs_per_cell);
+  Vector<double>       cell_rhs (dofs_per_cell);
 
-  vector<int>        local_dof_indices (dofs_per_cell);
+  vector<unsigned int> local_dof_indices (dofs_per_cell);
 
                                   // FIX
-  vector<double>     coefficient_values (n_q_points, 1.0);
+  vector<double>       coefficient_values (n_q_points, 1.0);
 
                                   // not only active cells
   MGDoFHandler<dim>::cell_iterator cell = mg_dof_handler.begin(),
@@ -309,7 +309,7 @@ void LaplaceProblem<dim>::assemble_system ()
   hanging_node_constraints.condense (global_system_matrix);
   hanging_node_constraints.condense (system_rhs);
 
-//    map<int,double> boundary_values;
+//    map<unsigned int,double> boundary_values;
 //    VectorTools::interpolate_boundary_values (mg_dof_handler,
 //                                         0,
 //                                         ZeroFunction<dim>(),
index 448bae97f8fbda25e9c0b40b83be2e93c01afdb9..990d8e46a434e6ca74f1709ea5a265e49ffcf4ba 100644 (file)
@@ -387,8 +387,8 @@ void LaplaceProblem::assemble_system ()
                                   // `dofs_per_cell' and `n_q_points'
                                   // are more or less standard names
                                   // for these purposes.
-  const unsigned int dofs_per_cell = fe.dofs_per_cell;
-  const unsigned int n_q_points    = quadrature_formula.n_quadrature_points;
+  const unsigned int   dofs_per_cell = fe.dofs_per_cell;
+  const unsigned int   n_q_points    = quadrature_formula.n_quadrature_points;
 
                                   // Now, we said that we wanted to
                                   // assemble the global matrix and
@@ -408,8 +408,8 @@ void LaplaceProblem::assemble_system ()
                                   // for the right hand side vector,
                                   // although access times are not so
                                   // problematic for them.
-  FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
-  Vector<double>     cell_rhs (dofs_per_cell);
+  FullMatrix<double>   cell_matrix (dofs_per_cell, dofs_per_cell);
+  Vector<double>       cell_rhs (dofs_per_cell);
 
                                   // When assembling the
                                   // contributions of each cell, we
@@ -424,7 +424,7 @@ void LaplaceProblem::assemble_system ()
                                   // degrees of freedom. When we get
                                   // them, we need a scratch array
                                   // for these numbers:
-  vector<int>        local_dof_indices (dofs_per_cell);
+  vector<unsigned int> local_dof_indices (dofs_per_cell);
 
                                   // Now for th loop over all
                                   // cells. You have seen before how
@@ -638,7 +638,7 @@ void LaplaceProblem::assemble_system ()
                                   // mapping of DoF numbers to
                                   // boundary values is done by the
                                   // `map' class.
-  map<int,double> boundary_values;
+  map<unsigned int,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
                                            0,
                                            ZeroFunction<2>(),
index 805feb5f533bf1eec706660da21055da8f246d58..bac38005541d09965e325d5293c681524132e3c7 100644 (file)
@@ -352,13 +352,13 @@ void LaplaceProblem<dim>::assemble_system ()
                                   // all the necessary work for you
                                   // and you don't have to care about
                                   // the dimension dependent parts:
-  const unsigned int dofs_per_cell = fe.dofs_per_cell;
-  const unsigned int n_q_points    = quadrature_formula.n_quadrature_points;
+  const unsigned int   dofs_per_cell = fe.dofs_per_cell;
+  const unsigned int   n_q_points    = quadrature_formula.n_quadrature_points;
 
-  FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
-  Vector<double>     cell_rhs (dofs_per_cell);
+  FullMatrix<double>   cell_matrix (dofs_per_cell, dofs_per_cell);
+  Vector<double>       cell_rhs (dofs_per_cell);
 
-  vector<int>        local_dof_indices (dofs_per_cell);
+  vector<unsigned int> local_dof_indices (dofs_per_cell);
 
                                   // Note here, that a cell is a
                                   // quadrilateral in two space
@@ -446,7 +446,7 @@ void LaplaceProblem<dim>::assemble_system ()
                                   // would like to use (i.e. the
                                   // BoundaryValues class declared
                                   // above):
-  map<int,double> boundary_values;
+  map<unsigned int,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
                                            0,
                                            BoundaryValues<dim>(),
index 4f389ee25744a0b49a5fde2575230006cfc39b6f..3584831dd5f7355fa300b65065a99b1d22671f57 100644 (file)
@@ -335,13 +335,13 @@ void LaplaceProblem<dim>::assemble_system ()
                                       update_q_points  |
                                       update_JxW_values));
 
-  const unsigned int dofs_per_cell = fe.dofs_per_cell;
-  const unsigned int n_q_points    = quadrature_formula.n_quadrature_points;
+  const unsigned int   dofs_per_cell = fe.dofs_per_cell;
+  const unsigned int   n_q_points    = quadrature_formula.n_quadrature_points;
 
-  FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
-  Vector<double>     cell_rhs (dofs_per_cell);
+  FullMatrix<double>   cell_matrix (dofs_per_cell, dofs_per_cell);
+  Vector<double>       cell_rhs (dofs_per_cell);
 
-  vector<int>        local_dof_indices (dofs_per_cell);
+  vector<unsigned int> local_dof_indices (dofs_per_cell);
 
                                   // Below, we will ask the
                                   // Coefficient class to compute the
@@ -558,7 +558,7 @@ void LaplaceProblem<dim>::assemble_system ()
     };
 
                                   // Again use zero boundary values:
-  map<int,double> boundary_values;
+  map<unsigned int,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
                                            0,
                                            ZeroFunction<dim>(),
index 2f33358c239c267a6f7f0eb3475b7ea4648b0fa4..0629bdc820f8e02342080ea36fdba799f555199d 100644 (file)
@@ -449,15 +449,15 @@ void LaplaceProblem<dim>::assemble_system ()
                                   // per cell before: the following
                                   // value will be set to 9 (in 2D)
                                   // now, where it was 4 before.
-  const unsigned int dofs_per_cell = fe.dofs_per_cell;
-  const unsigned int n_q_points    = quadrature_formula.n_quadrature_points;
+  const unsigned int   dofs_per_cell = fe.dofs_per_cell;
+  const unsigned int   n_q_points    = quadrature_formula.n_quadrature_points;
 
-  FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
-  Vector<double>     cell_rhs (dofs_per_cell);
+  FullMatrix<double>   cell_matrix (dofs_per_cell, dofs_per_cell);
+  Vector<double>       cell_rhs (dofs_per_cell);
 
-  vector<int>        local_dof_indices (dofs_per_cell);
+  vector<unsigned int> local_dof_indices (dofs_per_cell);
 
-  vector<double>     coefficient_values (n_q_points);
+  vector<double>       coefficient_values (n_q_points);
 
                                   // We can now go on with assembling
                                   // the matrix and right hand
@@ -554,7 +554,7 @@ void LaplaceProblem<dim>::assemble_system ()
                                   // from the system of equations
                                   // happens *after* the elimination
                                   // of hanging nodes.
-  map<int,double> boundary_values;
+  map<unsigned int,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
                                            0,
                                            ZeroFunction<dim>(),
index c14b80d9ffddd6f5d8acf282163a9c71234925dc..0caa12938f6e8b5e127ee82ffd02a9f95fead1dd 100644 (file)
@@ -230,16 +230,16 @@ void LaplaceProblem<dim>::assemble_system ()
                                       update_q_points  |
                                       update_JxW_values));
 
-  const unsigned int dofs_per_cell = fe->dofs_per_cell;
-  const unsigned int n_q_points    = quadrature_formula.n_quadrature_points;
+  const unsigned int   dofs_per_cell = fe->dofs_per_cell;
+  const unsigned int   n_q_points    = quadrature_formula.n_quadrature_points;
 
-  RightHandSide<dim> right_hand_side;
-  vector<double>     rhs_values (n_q_points);
+  RightHandSide<dim>   right_hand_side;
+  vector<double>       rhs_values (n_q_points);
 
-  FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
-  Vector<double>     cell_rhs (dofs_per_cell);
+  FullMatrix<double>   cell_matrix (dofs_per_cell, dofs_per_cell);
+  Vector<double>       cell_rhs (dofs_per_cell);
 
-  vector<int>        local_dof_indices (dofs_per_cell);
+  vector<unsigned int> local_dof_indices (dofs_per_cell);
 
   DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active(),
                                        endc = dof_handler.end();
@@ -289,7 +289,7 @@ void LaplaceProblem<dim>::assemble_system ()
   hanging_node_constraints.condense (system_matrix);
   hanging_node_constraints.condense (system_rhs);
 
-  map<int,double> boundary_values;
+  map<unsigned int,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
                                            0,
                                            Solution<dim>(),
index 5b03e6e1e3151016895a0322a86dc92699c7fcc3..51f6741f93922f245e32d2a66d82d1079879befa 100644 (file)
@@ -453,13 +453,13 @@ void ElasticProblem<dim>::assemble_system ()
                                   // degrees of freedom per cell of
                                   // the Q1 element, but this is not
                                   // something we need to care about.
-  const unsigned int dofs_per_cell = fe.dofs_per_cell;
-  const unsigned int n_q_points    = quadrature_formula.n_quadrature_points;
+  const unsigned int   dofs_per_cell = fe.dofs_per_cell;
+  const unsigned int   n_q_points    = quadrature_formula.n_quadrature_points;
 
-  FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
-  Vector<double>     cell_rhs (dofs_per_cell);
+  FullMatrix<double>   cell_matrix (dofs_per_cell, dofs_per_cell);
+  Vector<double>       cell_rhs (dofs_per_cell);
 
-  vector<int>        local_dof_indices (dofs_per_cell);
+  vector<unsigned int> local_dof_indices (dofs_per_cell);
 
                                   // As was shown in previous
                                   // examples as well, we need a
@@ -729,7 +729,7 @@ void ElasticProblem<dim>::assemble_system ()
                                   // we need to pass ``dim'' as
                                   // number of components to the zero
                                   // function as well.
-  map<int,double> boundary_values;
+  map<unsigned int,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
                                            0,
                                            ZeroFunction<dim>(dim),
index 830b0ea27b8a8c71b43e369f7870f08ad37c8a08..5bbba11d6f97a53d4fd91b77f5dbf1a5f52f7cc9 100644 (file)
@@ -142,3 +142,5 @@ Use a correct strategy to output the reduction rate for adaptively
   refined grids in examples/error-estimation
 
 
+Why is dof_renumbering.h in include/numerics, but dof_renumbering.cc
+  in source/dofs??
index aba8b4c97b6a2d85bda8eca056456324e03e11c7..d80c96fa9419986d6b4bf3ea38e48986a2ba5a22 100644 (file)
@@ -175,9 +175,14 @@ class DoFObjectAccessor_Inheritance<dim,dim>
 
 
 /**
- * Common template for line, quad, hex.
+ * Common template for access to the data on a line, quad, hex. Note
+ * that this class is only here for documentation purposes, the actual
+ * implementation of functions is in classes with specialized template
+ * parameters. In this class here, we only collect all functions which
+ * are in the specialized classes for simpler reference. Some
+ * functions, however, might be missing in the specialized classes,
+ * such as #quad# in the accessors for lines and quads, etc.
  *
- * Access to the degrees of freedom located on lines.
  * This class follows mainly the route laid out by the accessor library
  * declared in the triangulation library (\Ref{TriaAccessor}). It enables
  * the user to access the degrees of freedom on the lines (there are similar
@@ -190,27 +195,25 @@ class DoFObjectAccessor_Inheritance<dim,dim>
  *
  * The \Ref{DoFDimensionInfo} classes inherited by the \Ref{DoFHandler} classes
  * declare typedefs to iterators using the accessors declared in this class
- * hierarchy tree. Usage is best to happens through these typedefs, since they
+ * hierarchy tree. Usage is best to happen through these typedefs, since they
  * are more secure to changes in the class naming and template interface as well
  * as they provide easier typing (much less complicated names!).
  * 
  * 
  * \subsection{Notes about the class hierarchy structure}
  *
- * Inheritance from #DoFObjectAccessor_Inheritance<1,dim>::BaseClass# yields
- * inheritance from #CellAccessor<1># if #dim==1# and from
- * #TriaObjectAccessor<1,dim># for all other #dim# values. Thus, an object
- * of this class shares all features of cells in one dimension, but behaves
- * like an ordinary line in all other cases.
+ * See the report on this subject, which is available from the general
+ * documentation directory.
  *
- * @author Wolfgang Bangerth, 1998
- * Internal: inheritance is necessary for the general template due to
- * a compiler error.
- * @author Guido Kanschat, 1999
+ *
+ * @author Wolfgang Bangerth, 1998; Guido Kanschat, 1999
+ * 
+ * (Internal: inheritance is necessary for the general template due to
+ * a compiler error.)
  */
 template<int celldim, int dim>
 class DoFObjectAccessor : public DoFAccessor<dim>,
-                         public TriaObjectAccessor<celldim,dim>//DoFObjectAccessor_Inheritance<celldim,dim>::BaseClass
+                         public TriaObjectAccessor<celldim,dim>
 {  public:
                                     /**
                                      * Data type  passed by the iterator class.
@@ -408,6 +411,7 @@ class DoFObjectAccessor<0, dim> : public DoFAccessor<dim>,
 };
 
 
+
 /**
  * Access to the degrees of freedom located on lines.
  * This class follows mainly the route laid out by the accessor library
@@ -467,9 +471,9 @@ class DoFObjectAccessor<1, dim> :  public DoFAccessor<dim>,
                                      * to a #DoFHandler<dim># object.
                                      */
     DoFObjectAccessor (Triangulation<dim> *tria,
-                    const int           level,
-                    const int           index,
-                    const AccessorData *local_data) :
+                      const int           level,
+                      const int           index,
+                      const AccessorData *local_data) :
                    DoFAccessor<dim> (local_data),
                    DoFObjectAccessor_Inheritance<1,dim>::BaseClass (tria,level,index) {};
     
@@ -477,20 +481,21 @@ class DoFObjectAccessor<1, dim> :  public DoFAccessor<dim>,
                                      * Return the index of the #i#th degree
                                      * of freedom of this line.
                                      */
-    int dof_index (const unsigned int i) const;
+    unsigned int dof_index (const unsigned int i) const;
 
                                     /**
                                      * Set the index of the #i#th degree
                                      * of freedom of this line to #index#.
                                      */
-    void set_dof_index (const unsigned int i, const int index) const;
+    void set_dof_index (const unsigned int i,
+                       const unsigned int index) const;
 
                                     /**
                                      * Return the index of the #i#th degree
                                      * on the #vertex#th vertex.
                                      */
-    int vertex_dof_index (const unsigned int vertex,
-                         const unsigned int i) const;
+    unsigned int vertex_dof_index (const unsigned int vertex,
+                                  const unsigned int i) const;
 
                                     /**
                                      * Set the index of the #i#th degree
@@ -498,7 +503,7 @@ class DoFObjectAccessor<1, dim> :  public DoFAccessor<dim>,
                                      */
     void set_vertex_dof_index (const unsigned int vertex,
                               const unsigned int i,
-                              const int          index) const;
+                              const unsigned int index) const;
 
                                     /**
                                      * Return the indices of the dofs of this
@@ -509,7 +514,7 @@ class DoFObjectAccessor<1, dim> :  public DoFAccessor<dim>,
                                      * It is assumed that the vector already
                                      * has the right size beforehand.
                                      */
-    void get_dof_indices (vector<int> &dof_indices) const;
+    void get_dof_indices (vector<unsigned int> &dof_indices) const;
 
                                     /**
                                      * Return the values of the given vector
@@ -643,20 +648,21 @@ class DoFObjectAccessor<2, dim> :  public DoFAccessor<dim>,
                                      * Return the index of the #i#th degree
                                      * of freedom of this quad.
                                      */
-    int dof_index (const unsigned int i) const;
+    unsigned int dof_index (const unsigned int i) const;
 
                                     /**
                                      * Set the index of the #i#th degree
                                      * of freedom of this quad to #index#.
                                      */
-    void set_dof_index (const unsigned int i, const int index) const;
+    void set_dof_index (const unsigned int i,
+                       const unsigned int index) const;
 
                                     /**
                                      * Return the index of the #i#th degree
                                      * on the #vertex#th vertex.
                                      */
-    int vertex_dof_index (const unsigned int vertex,
-                         const unsigned int i) const;
+    unsigned int vertex_dof_index (const unsigned int vertex,
+                                  const unsigned int i) const;
 
                                     /**
                                      * Set the index of the #i#th degree
@@ -664,7 +670,7 @@ class DoFObjectAccessor<2, dim> :  public DoFAccessor<dim>,
                                      */
     void set_vertex_dof_index (const unsigned int vertex,
                               const unsigned int i,
-                              const int          index) const;
+                              const unsigned int index) const;
 
                                     /**
                                      * Return the indices of the dofs of this
@@ -676,7 +682,7 @@ class DoFObjectAccessor<2, dim> :  public DoFAccessor<dim>,
                                      * It is assumed that the vector already
                                      * has the right size beforehand.
                                      */
-    void get_dof_indices (vector<int> &dof_indices) const;
+    void get_dof_indices (vector<unsigned int> &dof_indices) const;
 
                                     /**
                                      * Return the values of the given vector
@@ -820,20 +826,21 @@ class DoFObjectAccessor<3, dim> :  public DoFAccessor<dim>,
                                      * Return the index of the #i#th degree
                                      * of freedom of this hex.
                                      */
-    int dof_index (const unsigned int i) const;
+    unsigned int dof_index (const unsigned int i) const;
 
                                     /**
                                      * Set the index of the #i#th degree
                                      * of freedom of this hex to #index#.
                                      */
-    void set_dof_index (const unsigned int i, const int index) const;
+    void set_dof_index (const unsigned int i,
+                       const unsigned int index) const;
 
                                     /**
                                      * Return the index of the #i#th degree
                                      * on the #vertex#th vertex.
                                      */
-    int vertex_dof_index (const unsigned int vertex,
-                         const unsigned int i) const;
+    unsigned int vertex_dof_index (const unsigned int vertex,
+                                  const unsigned int i) const;
 
                                     /**
                                      * Set the index of the #i#th degree
@@ -841,7 +848,7 @@ class DoFObjectAccessor<3, dim> :  public DoFAccessor<dim>,
                                      */
     void set_vertex_dof_index (const unsigned int vertex,
                               const unsigned int i,
-                              const int          index) const;
+                              const unsigned int index) const;
 
                                     /**
                                      * Return the indices of the dofs of this
@@ -853,7 +860,7 @@ class DoFObjectAccessor<3, dim> :  public DoFAccessor<dim>,
                                      * It is assumed that the vector already
                                      * has the right size beforehand.
                                      */
-    void get_dof_indices (vector<int> &dof_indices) const;
+    void get_dof_indices (vector<unsigned int> &dof_indices) const;
 
                                     /**
                                      * Return the values of the given vector
@@ -975,7 +982,8 @@ class DoFObjectAccessor<3, dim> :  public DoFAccessor<dim>,
  * @author Wolfgang Bangerth, 1998
  */
 template <int dim>
-class DoFCellAccessor :  public DoFObjectAccessor<dim, dim> {
+class DoFCellAccessor :  public DoFObjectAccessor<dim, dim>
+{
   public:
                                     /**
                                      * Declare the data type that this accessor
index d8515f2fc6ca259d6b74a286f2d6b237b52f458a..be6c92a6f426b8c73853066487959186526cdb94 100644 (file)
@@ -19,7 +19,9 @@
 
 template <int dim>
 inline
-int DoFObjectAccessor<1,dim>::dof_index (const unsigned int i) const {
+unsigned int
+DoFObjectAccessor<1,dim>::dof_index (const unsigned int i) const
+{
   Assert (dof_handler != 0, ExcInvalidObject());
                                   // make sure a FE has been selected
                                   // and enough room was reserved
@@ -36,8 +38,10 @@ int DoFObjectAccessor<1,dim>::dof_index (const unsigned int i) const {
 
 template <int dim>
 inline
-int DoFObjectAccessor<1,dim>::vertex_dof_index (const unsigned int vertex,
-                                                     const unsigned int i) const {
+unsigned int
+DoFObjectAccessor<1,dim>::vertex_dof_index (const unsigned int vertex,
+                                           const unsigned int i) const
+{
   Assert (dof_handler != 0, ExcInvalidObject());
   Assert (dof_handler->selected_fe != 0, ExcInvalidObject());
   Assert (vertex<2, ExcIndexRange (i,0,2));
@@ -55,7 +59,8 @@ int DoFObjectAccessor<1,dim>::vertex_dof_index (const unsigned int vertex,
 template <int dim>
 inline
 void
-DoFObjectAccessor<1,dim>::get_dof_indices (vector<int> &dof_indices) const {
+DoFObjectAccessor<1,dim>::get_dof_indices (vector<unsigned int> &dof_indices) const
+{
   Assert (dof_handler != 0, ExcInvalidObject());
   Assert (dof_handler->selected_fe != 0, ExcInvalidObject());
   Assert (dof_indices.size() == (2*dof_handler->get_fe().dofs_per_vertex +
@@ -64,7 +69,7 @@ DoFObjectAccessor<1,dim>::get_dof_indices (vector<int> &dof_indices) const {
 
   const unsigned int dofs_per_vertex = dof_handler->get_fe().dofs_per_vertex,
                     dofs_per_line   = dof_handler->get_fe().dofs_per_line;
-  vector<int>::iterator next = dof_indices.begin();
+  vector<unsigned int>::iterator next = dof_indices.begin();
   for (unsigned int vertex=0; vertex<2; ++vertex)
     for (unsigned int d=0; d<dofs_per_vertex; ++d)
       *next++ = vertex_dof_index(vertex,d);
@@ -77,7 +82,8 @@ DoFObjectAccessor<1,dim>::get_dof_indices (vector<int> &dof_indices) const {
 template <int dim>
 inline
 TriaIterator<dim,DoFObjectAccessor<1,dim> >
-DoFObjectAccessor<1,dim>::child (const unsigned int i) const {
+DoFObjectAccessor<1,dim>::child (const unsigned int i) const
+{
   TriaIterator<dim,DoFObjectAccessor<1,dim> > q (tria,
                                                       present_level+1,
                                                       child_index (i),
@@ -95,7 +101,8 @@ DoFObjectAccessor<1,dim>::child (const unsigned int i) const {
 template <int dim>
 inline
 void
-DoFObjectAccessor<1,dim>::copy_from (const DoFObjectAccessor<1,dim> &a) {
+DoFObjectAccessor<1,dim>::copy_from (const DoFObjectAccessor<1,dim> &a)
+{
   BaseClass::copy_from (a);
   set_dof_handler (a.dof_handler);
 };
@@ -107,7 +114,8 @@ DoFObjectAccessor<1,dim>::copy_from (const DoFObjectAccessor<1,dim> &a) {
 
 template <int dim>
 inline
-int DoFObjectAccessor<2,dim>::dof_index (const unsigned int i) const {
+unsigned int DoFObjectAccessor<2,dim>::dof_index (const unsigned int i) const
+{
   Assert (dof_handler != 0, ExcInvalidObject());
                                   // make sure a FE has been selected
                                   // and enough room was reserved
@@ -123,8 +131,10 @@ int DoFObjectAccessor<2,dim>::dof_index (const unsigned int i) const {
 
 template <int dim>
 inline
-int DoFObjectAccessor<2,dim>::vertex_dof_index (const unsigned int vertex,
-                                                     const unsigned int i) const {
+unsigned int
+DoFObjectAccessor<2,dim>::vertex_dof_index (const unsigned int vertex,
+                                           const unsigned int i) const
+{
   Assert (dof_handler != 0, ExcInvalidObject());
   Assert (dof_handler->selected_fe != 0, ExcInvalidObject());
   Assert (vertex<4, ExcIndexRange (i,0,4));
@@ -142,7 +152,8 @@ int DoFObjectAccessor<2,dim>::vertex_dof_index (const unsigned int vertex,
 template <int dim>
 inline
 void
-DoFObjectAccessor<2,dim>::get_dof_indices (vector<int> &dof_indices) const {
+DoFObjectAccessor<2,dim>::get_dof_indices (vector<unsigned int> &dof_indices) const
+{
   Assert (dof_handler != 0, ExcInvalidObject());
   Assert (dof_handler->selected_fe != 0, ExcInvalidObject());
   Assert (dof_indices.size() == (4*dof_handler->get_fe().dofs_per_vertex +
@@ -153,7 +164,7 @@ DoFObjectAccessor<2,dim>::get_dof_indices (vector<int> &dof_indices) const {
   const unsigned int dofs_per_vertex = dof_handler->get_fe().dofs_per_vertex,
                     dofs_per_line   = dof_handler->get_fe().dofs_per_line,
                     dofs_per_quad   = dof_handler->get_fe().dofs_per_quad;
-  vector<int>::iterator next = dof_indices.begin();
+  vector<unsigned int>::iterator next = dof_indices.begin();
   for (unsigned int vertex=0; vertex<4; ++vertex)
     for (unsigned int d=0; d<dofs_per_vertex; ++d)
       *next++ = vertex_dof_index(vertex,d);
@@ -169,7 +180,8 @@ DoFObjectAccessor<2,dim>::get_dof_indices (vector<int> &dof_indices) const {
 template <int dim>
 inline
 TriaIterator<dim,DoFObjectAccessor<1,dim> >
-DoFObjectAccessor<2,dim>::line (const unsigned int i) const {
+DoFObjectAccessor<2,dim>::line (const unsigned int i) const
+{
   Assert (i<4, ExcIndexRange (i, 0, 4));
 
   return TriaIterator<dim,DoFObjectAccessor<1,dim> >
@@ -186,7 +198,8 @@ DoFObjectAccessor<2,dim>::line (const unsigned int i) const {
 template <int dim>
 inline
 TriaIterator<dim,DoFObjectAccessor<2,dim> >
-DoFObjectAccessor<2,dim>::child (const unsigned int i) const {
+DoFObjectAccessor<2,dim>::child (const unsigned int i) const
+{
   TriaIterator<dim,DoFObjectAccessor<2,dim> > q (tria,
                                                  present_level+1,
                                                  child_index (i),
@@ -204,7 +217,8 @@ DoFObjectAccessor<2,dim>::child (const unsigned int i) const {
 template <int dim>
 inline
 void
-DoFObjectAccessor<2,dim>::copy_from (const DoFObjectAccessor<2,dim> &a) {
+DoFObjectAccessor<2,dim>::copy_from (const DoFObjectAccessor<2,dim> &a)
+{
   BaseClass::copy_from (a);
   set_dof_handler (a.dof_handler);
 };
@@ -212,12 +226,14 @@ DoFObjectAccessor<2,dim>::copy_from (const DoFObjectAccessor<2,dim> &a) {
 
 
 
-/*------------------------- Functions: DoFObjectAccessor -----------------------*/
+/*------------------------- Functions: DoFObjectAccessor<2,dim> -----------------------*/
 
 
 template <int dim>
 inline
-int DoFObjectAccessor<3,dim>::dof_index (const unsigned int i) const {
+unsigned int
+DoFObjectAccessor<3,dim>::dof_index (const unsigned int i) const
+{
   Assert (dof_handler != 0, ExcInvalidObject());
                                   // make sure a FE has been selected
                                   // and enough room was reserved
@@ -233,8 +249,10 @@ int DoFObjectAccessor<3,dim>::dof_index (const unsigned int i) const {
 
 template <int dim>
 inline
-int DoFObjectAccessor<3,dim>::vertex_dof_index (const unsigned int vertex,
-                                                     const unsigned int i) const {
+unsigned int
+DoFObjectAccessor<3,dim>::vertex_dof_index (const unsigned int vertex,
+                                           const unsigned int i) const
+{
   Assert (dof_handler != 0, ExcInvalidObject());
   Assert (dof_handler->selected_fe != 0, ExcInvalidObject());
   Assert (vertex<8, ExcIndexRange (i,0,8));
@@ -252,7 +270,8 @@ int DoFObjectAccessor<3,dim>::vertex_dof_index (const unsigned int vertex,
 template <int dim>
 inline
 void
-DoFObjectAccessor<3,dim>::get_dof_indices (vector<int> &dof_indices) const {
+DoFObjectAccessor<3,dim>::get_dof_indices (vector<unsigned int> &dof_indices) const
+{
   Assert (dof_handler != 0, ExcInvalidObject());
   Assert (dof_handler->selected_fe != 0, ExcInvalidObject());
   Assert (dof_indices.size() == (8*dof_handler->get_fe().dofs_per_vertex +
@@ -265,7 +284,7 @@ DoFObjectAccessor<3,dim>::get_dof_indices (vector<int> &dof_indices) const {
                     dofs_per_line   = dof_handler->get_fe().dofs_per_line,
                     dofs_per_quad   = dof_handler->get_fe().dofs_per_quad,
                     dofs_per_hex    = dof_handler->get_fe().dofs_per_hex;
-  vector<int>::iterator next = dof_indices.begin();
+  vector<unsigned int>::iterator next = dof_indices.begin();
   for (unsigned int vertex=0; vertex<8; ++vertex)
     for (unsigned int d=0; d<dofs_per_vertex; ++d)
       *next++ = vertex_dof_index(vertex,d);
@@ -284,7 +303,8 @@ DoFObjectAccessor<3,dim>::get_dof_indices (vector<int> &dof_indices) const {
 template <int dim>
 inline
 TriaIterator<dim,DoFObjectAccessor<1,dim> >
-DoFObjectAccessor<3,dim>::line (const unsigned int i) const {
+DoFObjectAccessor<3,dim>::line (const unsigned int i) const
+{
   TriaIterator<dim,TriaObjectAccessor<1,dim> > l = BaseClass::line(i);
   return TriaIterator<dim,DoFObjectAccessor<1,dim> >
     (
@@ -300,7 +320,8 @@ DoFObjectAccessor<3,dim>::line (const unsigned int i) const {
 template <int dim>
 inline
 TriaIterator<dim,DoFObjectAccessor<2,dim> >
-DoFObjectAccessor<3,dim>::quad (const unsigned int i) const {
+DoFObjectAccessor<3,dim>::quad (const unsigned int i) const
+{
   Assert (i<6, ExcIndexRange (i, 0, 6));
 
   return TriaIterator<dim,DoFObjectAccessor<2,dim> >
@@ -317,7 +338,8 @@ DoFObjectAccessor<3,dim>::quad (const unsigned int i) const {
 template <int dim>
 inline
 TriaIterator<dim,DoFObjectAccessor<3,dim> >
-DoFObjectAccessor<3,dim>::child (const unsigned int i) const {
+DoFObjectAccessor<3,dim>::child (const unsigned int i) const
+{
   TriaIterator<dim,DoFObjectAccessor<3,dim> > q (tria,
                                                  present_level+1,
                                                  child_index (i),
@@ -333,7 +355,8 @@ DoFObjectAccessor<3,dim>::child (const unsigned int i) const {
 
 
 template <int dim>
-void DoFObjectAccessor<3,dim>::copy_from (const DoFObjectAccessor<3,dim> &a) {
+void DoFObjectAccessor<3,dim>::copy_from (const DoFObjectAccessor<3,dim> &a)
+{
   BaseClass::copy_from (a);
   set_dof_handler (a.dof_handler);
 };
@@ -347,7 +370,8 @@ void DoFObjectAccessor<3,dim>::copy_from (const DoFObjectAccessor<3,dim> &a) {
 template <int dim>
 inline
 TriaIterator<dim,DoFCellAccessor<dim> >
-DoFCellAccessor<dim>::neighbor (const unsigned int i) const {
+DoFCellAccessor<dim>::neighbor (const unsigned int i) const
+{
   TriaIterator<dim,DoFCellAccessor<dim> > q (tria,
                                             neighbor_level (i),
                                             neighbor_index (i),
@@ -365,7 +389,8 @@ DoFCellAccessor<dim>::neighbor (const unsigned int i) const {
 template <int dim>
 inline
 TriaIterator<dim,DoFCellAccessor<dim> >
-DoFCellAccessor<dim>::child (const unsigned int i) const {
+DoFCellAccessor<dim>::child (const unsigned int i) const
+{
   TriaIterator<dim,DoFCellAccessor<dim> > q (tria,
                                             present_level+1,
                                             child_index (i),
index 775ba3c8ae7effb36021d92f320a966829dc44fe..c60f51712952483a251582f1103da3f46ea3687c 100644 (file)
@@ -186,7 +186,7 @@ class DoFDimensionInfo<3> {
  * schemes like the Cuthill-McKey scheme. Basically, the function sets
  * up an array in which for each degree of freedom the index is stored
  * which is to be assigned by the renumbering. Using this array, the
- * #renumber_dofs(vector<int>)# function is called, which actually
+ * #renumber_dofs(vector<unsigned int>)# function is called, which actually
  * does the change from old DoF indices to the ones given in the
  * array. In some cases, however, a user may want to compute her own
  * renumbering order; in this case, allocate an array with one element
@@ -194,7 +194,7 @@ class DoFDimensionInfo<3> {
  * respective degree of freedom shall be assigned. This number may,
  * for example, be obtained by sorting the support points of the
  * degrees of freedom in downwind direction.  Then call the
- * #renumber_dofs(vector<int>)# with the array, which converts old
+ * #renumber_dofs(vector<unsigned int>)# with the array, which converts old
  * into new degree of freedom indices.
  *
  *
@@ -236,11 +236,11 @@ class DoFDimensionInfo<3> {
  * boundary parts are continuous, i.e. the indices of degrees of freedom on
  * different parts may be intermixed.
  *
- * Degrees of freedom on the boundary but not on one of the specified boundary
- * parts are given the index #-1#, as if they were in the interior. If no
- * boundary indicator was given or if no face of a cell has a boundary indicator
- * contained in the given list, the vector of new indices consists solely of
- * #-1#s.
+ * Degrees of freedom on the boundary but not on one of the specified
+ * boundary parts are given the index #invalid_dof_index#, as if they
+ * were in the interior. If no boundary indicator was given or if no
+ * face of a cell has a boundary indicator contained in the given
+ * list, the vector of new indices consists solely of #invalid_dof_index#s.
  *
  * The question what a degree of freedom on the boundary is, is not so easy.
  * It should really be a degree of freedom of which the respective basis
@@ -300,6 +300,22 @@ class DoFHandler  :  public Subscriptor,
                                      */
     typedef map<unsigned char,const Function<dim>*> FunctionMap;
 
+                                    /**
+                                     * When the arrays holding the
+                                     * DoF indices are set up, but
+                                     * before they are filled with
+                                     * actual values, they are set to
+                                     * an invalid value, in order to
+                                     * monitor possible
+                                     * problems. This invalid value
+                                     * is the constant defined here.
+                                     *
+                                     * Please note that you should
+                                     * not rely on it having a
+                                     * certain value, but rather take
+                                     * its symbolic name.
+                                     */
+    static const unsigned int invalid_dof_index = static_cast<unsigned int>(-1);
     
                                     /**
                                      * Constructor. Take #tria# as the
@@ -379,7 +395,7 @@ class DoFHandler  :  public Subscriptor,
                                      * wants to implement an ordering scheme
                                      * herself, for example downwind numbering.
                                      */
-    void renumber_dofs (const vector<int> &new_numbers);
+    void renumber_dofs (const vector<unsigned int> &new_numbers);
 
                                     /**
                                      * Return the maximum number of
@@ -419,22 +435,28 @@ class DoFHandler  :  public Subscriptor,
     unsigned int max_couplings_between_boundary_dofs () const;
 
                                     /**
-                                     * Create a mapping from degree of freedom
-                                     * indices to the index of that degree
-                                     * of freedom on the boundary. After this
-                                     * operation, #mapping[dof]# gives the
-                                     * index of the the degree of freedom with
-                                     * global number #dof# in the list of
-                                     * degrees of freedom on the boundary.
-                                     * If the degree of freedom requested is
-                                     * not on the boundary, the value of
-                                     * #mapping[dof]# is #-1#. This function is
-                                     * mainly used when setting up matrices and
-                                     * vectors on the boundary from the trial
-                                     * functions, which have global numbers,
-                                     * while the matrices and vectors use
-                                     * numbers of the trial functions local
-                                     * to the boundary.
+                                     * Create a mapping from degree
+                                     * of freedom indices to the
+                                     * index of that degree of
+                                     * freedom on the boundary. After
+                                     * this operation, #mapping[dof]#
+                                     * gives the index of the the
+                                     * degree of freedom with global
+                                     * number #dof# in the list of
+                                     * degrees of freedom on the
+                                     * boundary.  If the degree of
+                                     * freedom requested is not on
+                                     * the boundary, the value of
+                                     * #mapping[dof]# is
+                                     * #invalid_dof_index#. This
+                                     * function is mainly used when
+                                     * setting up matrices and
+                                     * vectors on the boundary from
+                                     * the trial functions, which
+                                     * have global numbers, while the
+                                     * matrices and vectors use
+                                     * numbers of the trial functions
+                                     * local to the boundary.
                                      *
                                      * Prior content of #mapping# is deleted.
                                      *
@@ -443,7 +465,7 @@ class DoFHandler  :  public Subscriptor,
                                      * for more information on boundary
                                      * treatment.
                                      */
-    void map_dof_to_boundary_indices (vector<int> &mapping) const;
+    void map_dof_to_boundary_indices (vector<unsigned int> &mapping) const;
 
                                     /**
                                      * Same as the previous function, except
@@ -453,8 +475,8 @@ class DoFHandler  :  public Subscriptor,
                                      * See the general doc of this class for
                                      * more information.
                                      */
-    void map_dof_to_boundary_indices (const FunctionMap &boundary_indicators,
-                                     vector<int> &mapping) const;
+    void map_dof_to_boundary_indices (const FunctionMap    &boundary_indicators,
+                                     vector<unsigned int> &mapping) const;
 
                                     /**
                                      *  @name Cell iterator functions
@@ -1182,7 +1204,7 @@ class DoFHandler  :  public Subscriptor,
                                      * Array to store the indices for degrees
                                      * of freedom located at vertices.
                                      */
-    vector<int>               vertex_dofs;
+    vector<unsigned int>      vertex_dofs;
     
     
 #if (__GNUC__==2) && (__GNUC_MINOR__ < 95)
index e864a533ca1a9fd49a3cdf23f00630c5c16cac71..c749c012e8c17a257dd36db59a728ece58d596f3 100644 (file)
@@ -16,7 +16,8 @@
  * other types than those explicitely instantiated.
  */
 template <int N>
-class DoFLevel {
+class DoFLevel
+{
   private:
                                     /**
                                      * Make the constructor private to avoid
@@ -72,14 +73,15 @@ class DoFLevel {
  * different treatment in multigrid environments. If no multigrid is used, the
  * indices are stored in the #vertex_dofs# array of the #DoFHandler# class.
  */
-class DoFLevel<1> {
+class DoFLevel<1>
+{
   public:
                                     /**
                                      * Store the global indices of the degrees
                                      * of freedom. See \Ref{DoFLevel} for
                                      * detailed information.
                                      */
-    vector<int> line_dofs;
+    vector<unsigned int> line_dofs;
 };
 
 
@@ -96,7 +98,7 @@ class DoFLevel<2> : public DoFLevel<1> {
                                      * of freedom. See \Ref{DoFLevel} for
                                      * detailed information.
                                      */
-    vector<int> quad_dofs;
+    vector<unsigned int> quad_dofs;
 };
 
 
@@ -112,7 +114,7 @@ class DoFLevel<3> : public DoFLevel<2> {
                                      * of freedom. See \Ref{DoFLevel} for
                                      * detailed information.
                                      */
-    vector<int> hex_dofs;
+    vector<unsigned int> hex_dofs;
 };
 
 
index 07cfc35692f00c25a150eade5775997f9506d496..466e2be19fde372192c89d0a61b439072408c042 100644 (file)
@@ -179,9 +179,9 @@ class DoFTools
                                      */
     template<int dim>
     static void
-    make_boundary_sparsity_pattern (const DoFHandler<dim> &dof,
-                                   const vector<int>     &dof_to_boundary_mapping,
-                                   SparsityPattern       &sparsity_pattern); 
+    make_boundary_sparsity_pattern (const DoFHandler<dim>      &dof,
+                                   const vector<unsigned int> &dof_to_boundary_mapping,
+                                   SparsityPattern            &sparsity_pattern); 
 
                                     /**
                                      * Write the sparsity structure of the
@@ -218,7 +218,7 @@ class DoFTools
     static void
     make_boundary_sparsity_pattern (const DoFHandler<dim>& dof,
                                    const typename DoFHandler<dim>::FunctionMap &boundary_indicators,
-                                   const vector<int>  &dof_to_boundary_mapping,
+                                   const vector<unsigned int>  &dof_to_boundary_mapping,
                                    SparsityPattern    &sparsity); 
 
                                     /**
index d36f8cea2db81d258390c7c8894bd51d9f691a98..569c6664af3b9abf4927b5a2a9fad13706ea9ffa 100644 (file)
@@ -204,14 +204,14 @@ TriaObjectAccessor<1,dim>::operator ++ () {
                                   // the vector?
   while (present_index
         >=
-        (int)tria->levels[present_level]->lines.lines.size())
+        static_cast<int>(tria->levels[present_level]->lines.lines.size()))
     {
                                       // no -> go one level up until we find
                                       // one with more than zero cells
       ++present_level;
       present_index = 0;
                                       // highest level reached?
-      if (present_level >= (int)tria->levels.size()) 
+      if (present_level >= static_cast<int>(tria->levels.size()))
        {
                                           // return with past the end pointer
          present_level = present_index = -1;
@@ -384,13 +384,13 @@ TriaObjectAccessor<2,dim>::operator ++ () {
                                   // the vector?
   while (present_index
         >=
-        (int)tria->levels[present_level]->quads.quads.size()) 
+        static_cast<int>(tria->levels[present_level]->quads.quads.size()))
     {
                                       // no -> go one level up
       ++present_level;
       present_index = 0;
                                       // highest level reached?
-      if (present_level >= (int)tria->levels.size()) 
+      if (present_level >= static_cast<int>(tria->levels.size()))
        {
                                           // return with past the end pointer
          present_level = present_index = -1;
@@ -632,13 +632,13 @@ TriaObjectAccessor<3,dim>::operator ++ () {
                                   // the vector?
   while (present_index
         >=
-        (int)tria->levels[present_level]->hexes.hexes.size()) 
+        static_cast<int>(tria->levels[present_level]->hexes.hexes.size()))
     {
                                       // no -> go one level up
       ++present_level;
       present_index = 0;
                                       // highest level reached?
-      if (present_level >= (int)tria->levels.size()) 
+      if (present_level >= static_cast<int>(tria->levels.size()))
        {
                                           // return with past the end pointer
          present_level = present_index = -1;
@@ -914,13 +914,13 @@ TriaObjectAccessor<celldim,dim>::operator ++ () {
                                   // the vector?
   while (present_index
         >=
-        (int)tria->levels[present_level]->hexes.hexes.size()) 
+        static_cast<int>(tria->levels[present_level]->hexes.hexes.size()))
     {
                                       // no -> go one level up
       ++present_level;
       present_index = 0;
                                       // highest level reached?
-      if (present_level >= (int)tria->levels.size()) 
+      if (present_level >= static_cast<int>(tria->levels.size()))
        {
                                           // return with past the end pointer
          present_level = present_index = -1;
index 4b30be0c8a28209f758e5b071cb003f7f6ecb279..05f401412ef943685ba8ce2b5d597c1cf58b9100 100644 (file)
@@ -248,22 +248,23 @@ class MGDoFObjectAccessor<1, dim> :  public MGDoFAccessor<dim>,
                                      * of freedom of this line on the level
                                      * this line lives on.
                                      */
-    int mg_dof_index (const unsigned int i) const;
+    unsigned int mg_dof_index (const unsigned int i) const;
 
                                     /**
                                      * Set the index of the #i#th degree
                                      * of freedom of this line on the
                                      * level this line lives on to #index#.
                                      */
-    void set_mg_dof_index (const unsigned int i, const int index) const;
+    void set_mg_dof_index (const unsigned int i,
+                          const unsigned int index) const;
 
                                     /**
                                      * Return the index of the #i#th degree
                                      * on the #vertex#th vertex for the
                                      * level this line lives on.
                                      */
-    int mg_vertex_dof_index (const unsigned int vertex,
-                            const unsigned int i) const;
+    unsigned int mg_vertex_dof_index (const unsigned int vertex,
+                                     const unsigned int i) const;
 
                                     /**
                                      * Set the index of the #i#th degree
@@ -272,7 +273,7 @@ class MGDoFObjectAccessor<1, dim> :  public MGDoFAccessor<dim>,
                                      */
     void set_mg_vertex_dof_index (const unsigned int vertex,
                                  const unsigned int i,
-                                 const int          index) const;
+                                 const unsigned int index) const;
 
                                     /**
                                      * Return the indices of the dofs of this
@@ -285,7 +286,7 @@ class MGDoFObjectAccessor<1, dim> :  public MGDoFAccessor<dim>,
                                      * indices refer to the local numbering
                                      * for the level this line lives on.
                                      */
-    void get_mg_dof_indices (vector<int> &dof_indices) const;
+    void get_mg_dof_indices (vector<unsigned int> &dof_indices) const;
 
                                     /**
                                      * Return the value of the given vector
@@ -367,22 +368,23 @@ class MGDoFObjectAccessor<2, dim> :  public MGDoFAccessor<dim>,
                                      * of freedom of this quad on the level
                                      * this quad lives on.
                                      */
-    int mg_dof_index (const unsigned int i) const;
+    unsigned int mg_dof_index (const unsigned int i) const;
 
                                     /**
                                      * Set the index of the #i#th degree
                                      * of freedom of this quad on the
                                      * level this quad lives on to #index#.
                                      */
-    void set_mg_dof_index (const unsigned int i, const int index) const;
+    void set_mg_dof_index (const unsigned int i,
+                          const unsigned int index) const;
 
                                     /**
                                      * Return the index of the #i#th degree
                                      * on the #vertex#th vertex for the level
                                      * this quad lives on.
                                      */
-    int mg_vertex_dof_index (const unsigned int vertex,
-                            const unsigned int i) const;
+    unsigned int mg_vertex_dof_index (const unsigned int vertex,
+                                     const unsigned int i) const;
 
                                     /**
                                      * Set the index of the #i#th degree
@@ -391,7 +393,7 @@ class MGDoFObjectAccessor<2, dim> :  public MGDoFAccessor<dim>,
                                      */
     void set_mg_vertex_dof_index (const unsigned int vertex,
                                  const unsigned int i,
-                                 const int          index) const;
+                                 const unsigned int index) const;
 
                                     /**
                                      * Return the indices of the dofs of this
@@ -405,7 +407,7 @@ class MGDoFObjectAccessor<2, dim> :  public MGDoFAccessor<dim>,
                                      * indices refer to the local numbering
                                      * for the level this quad lives on.
                                      */
-    void get_mg_dof_indices (vector<int> &dof_indices) const;
+    void get_mg_dof_indices (vector<unsigned int> &dof_indices) const;
  
                                     /**
                                      * Return the value of the given vector
@@ -493,22 +495,23 @@ class MGDoFObjectAccessor<3, dim> :  public MGDoFAccessor<dim>,
                                      * of freedom of this hex on the level
                                      * this quad lives on.
                                      */
-    int mg_dof_index (const unsigned int i) const;
+    unsigned int mg_dof_index (const unsigned int i) const;
 
                                     /**
                                      * Set the index of the #i#th degree
                                      * of freedom of this hex on the
                                      * level this hex lives on to #index#.
                                      */
-    void set_mg_dof_index (const unsigned int i, const int index) const;
+    void set_mg_dof_index (const unsigned int i,
+                          const unsigned int index) const;
 
                                     /**
                                      * Return the index of the #i#th degree
                                      * on the #vertex#th vertex for the level
                                      * this hex lives on.
                                      */
-    int mg_vertex_dof_index (const unsigned int vertex,
-                            const unsigned int i) const;
+    unsigned int mg_vertex_dof_index (const unsigned int vertex,
+                                     const unsigned int i) const;
 
                                     /**
                                      * Set the index of the #i#th degree
@@ -517,7 +520,7 @@ class MGDoFObjectAccessor<3, dim> :  public MGDoFAccessor<dim>,
                                      */
     void set_mg_vertex_dof_index (const unsigned int vertex,
                                  const unsigned int i,
-                                 const int          index) const;
+                                 const unsigned int index) const;
 
                                     /**
                                      * Return the indices of the dofs of this
@@ -531,7 +534,7 @@ class MGDoFObjectAccessor<3, dim> :  public MGDoFAccessor<dim>,
                                      * indices refer to the local numbering
                                      * for the level this hex lives on.
                                      */
-    void get_mg_dof_indices (vector<int> &dof_indices) const;
+    void get_mg_dof_indices (vector<unsigned int> &dof_indices) const;
 
                                     /**
                                      * Return the value of the given vector
index 5dda5971b8a7fa4f542c544d85bdc9d1bc4a289b..48c55b0b80da06a7d06a1544efbfb5259c648e38 100644 (file)
@@ -198,7 +198,7 @@ class MGDoFHandler : public DoFHandler<dim>
                                      * order of the old indices.
                                      */
     void renumber_dofs (const unsigned int level,
-                       const vector<int> &new_numbers);
+                       const vector<unsigned int> &new_numbers);
 
                                     /*--------------------------------------*/
     
@@ -840,9 +840,9 @@ class MGDoFHandler : public DoFHandler<dim>
                                          * The function is inline, so should
                                          * be reasonably fast.
                                          */
-       int get_index (const unsigned int level,
-                      const unsigned int dof_number,
-                      const unsigned int dofs_per_vertex) const;
+       unsigned int get_index (const unsigned int level,
+                               const unsigned int dof_number,
+                               const unsigned int dofs_per_vertex) const;
 
                                         /**
                                          * Return the index of the coarsest
@@ -892,7 +892,7 @@ class MGDoFHandler : public DoFHandler<dim>
                                         /**
                                          * Array holding the indices.
                                          */
-       int         *indices;
+       unsigned int *indices;
     };
 
 
@@ -990,9 +990,10 @@ void MGDoFHandler<dim>::MGVertexDoFs::set_index  (const unsigned int level,
 
 template <int dim>
 inline
-int MGDoFHandler<dim>::MGVertexDoFs::get_index  (const unsigned int level,
-                                                const unsigned int dof_number,
-                                                const unsigned int dofs_per_vertex) const {
+unsigned int
+MGDoFHandler<dim>::MGVertexDoFs::get_index  (const unsigned int level,
+                                            const unsigned int dof_number,
+                                            const unsigned int dofs_per_vertex) const {
   Assert ((level >= coarsest_level) && (level <= finest_level),
          ExcInvalidLevel(level));
   Assert (dof_number < dofs_per_vertex,
index dce540bdca5f9dc3b45bfbdcfcb9b7df9361cebf..49e36881035d636c4d5c61bf9fd0214a98c5a322 100644 (file)
@@ -181,7 +181,7 @@ class MGSmoother : public MGSmootherBase
                                      * These arrays are set by the constructor.
                                      * The entries for each level are sorted ascendingly.
                                      */
-    vector<vector<int> > interior_boundary_dofs;
+    vector<vector<unsigned int> > interior_boundary_dofs;
 };
 
 
index f91ecba29e573b0a4d3f59ddb0921ee868e50d6c..38d8050dc6dfd7cdf3aa72f54fec0bffc4e2d1af 100644 (file)
@@ -29,9 +29,9 @@ Multigrid<dim>::copy_to_mg(const Vector<number>& src)
   defect.clear();
 //  constraints->condense(src);
   
-  vector<int> global_dof_indices (dofs_per_cell);
-  vector<int> level_dof_indices  (dofs_per_cell);
-  vector<int> level_face_indices (dofs_per_face);
+  vector<unsigned int> global_dof_indices (dofs_per_cell);
+  vector<unsigned int> level_dof_indices  (dofs_per_cell);
+  vector<unsigned int> level_face_indices (dofs_per_face);
 
                                   // initialize the objects with
                                   // their correct size
@@ -111,8 +111,8 @@ Multigrid<dim>::copy_from_mg(Vector<number> &dst) const
 {
   const unsigned int dofs_per_cell = mg_dof_handler->get_fe().dofs_per_cell;
 
-  vector<int> global_dof_indices (dofs_per_cell);
-  vector<int> level_dof_indices (dofs_per_cell);
+  vector<unsigned int> global_dof_indices (dofs_per_cell);
+  vector<unsigned int> level_dof_indices (dofs_per_cell);
 
   DoFHandler<dim>::active_cell_iterator
     global_cell = mg_dof_handler->DoFHandler<dim>::begin_active();
index 37395e2abefc0311f054c4df6ad527e220f4e5f1..9c4923f6d5138cec1b4ccf709f823015289df78f 100644 (file)
@@ -171,10 +171,10 @@ class DoFRenumbering
                                      * different methods.
                                      */
     template <int dim>
-    static void Cuthill_McKee (DoFHandler<dim>   &dof_handler,
-                              const bool         reversed_numbering = false,
-                              const bool         use_constraints    = false,
-                              const vector<int> &starting_indices   = vector<int>());
+    static void Cuthill_McKee (DoFHandler<dim>            &dof_handler,
+                              const bool                  reversed_numbering = false,
+                              const bool                  use_constraints    = false,
+                              const vector<unsigned int> &starting_indices   = vector<unsigned int>());
 
                                     /**
                                      * Renumber the degrees of freedom
@@ -196,10 +196,10 @@ class DoFRenumbering
                                      * different methods.
                                      */
     template <int dim>
-    static void Cuthill_McKee (MGDoFHandler<dim> &dof_handler,
-                              const unsigned int level,
-                              const bool         reversed_numbering = false,
-                              const vector<int> &starting_indices   = vector<int> ());
+    static void Cuthill_McKee (MGDoFHandler<dim>          &dof_handler,
+                              const unsigned int          level,
+                              const bool                  reversed_numbering = false,
+                              const vector<unsigned int> &starting_indices   = vector<unsigned int> ());
 
                                     /**
                                      * Sort the degrees of freedom by
index 0cf81a99b2065ff67744819c0a7c71400a8446e5..3e15f0914c55f373c9103dbce385d570a6ac4eea 100644 (file)
@@ -267,7 +267,7 @@ class MatrixCreator
                                             SparseMatrix<double>     &matrix,
                                             const FunctionMap        &rhs,
                                             Vector<double>           &rhs_vector,
-                                            vector<int>              &vec_to_dof_mapping,
+                                            vector<unsigned int>     &vec_to_dof_mapping,
                                             const Function<dim>      *a = 0);
 
                                     /**
@@ -411,7 +411,8 @@ class MatrixCreator
  * @author Wolfgang Bangerth, 1998
  */
 template <int dim>
-class MatrixTools : public MatrixCreator<dim> {
+class MatrixTools : public MatrixCreator<dim>
+{
   public:
                                     /**
                                      * Apply dirichlet boundary conditions
@@ -419,7 +420,7 @@ class MatrixTools : public MatrixCreator<dim> {
                                      * as described in the general
                                      * documentation.
                                      */
-    static void apply_boundary_values (const map<int,double> &boundary_values,
+    static void apply_boundary_values (const map<unsigned int,double> &boundary_values,
                                       SparseMatrix<double>  &matrix,
                                       Vector<double>        &solution,
                                       Vector<double>        &right_hand_side);
index 4b9ba455b69ae4563bec10dc44aa4e312d58c207..90dc38aadaeef709dd8c4b00b00bc846a18fb262 100644 (file)
  * #vector<Vector<number> >vector all_in# includes
  * all discrete functions to be interpolated onto the new grid.
  *
- * As we need two different kinds of pointers (#vector<int> *# for the Dof
+ * As we need two different kinds of pointers (#vector<unsigned int> *# for the Dof
  * indices and #vector<Vector<number> > *# for the interpolated DoF values)
  * we use the #Pointerstruct# that includes both of these pointers and
  * the #user_pointer# of each cell points to these #Pointerstructs#. 
  * On each cell only one of the two different pointers is used at one time 
  * hence we could use the
- * #void * user_pointer# as #vector<int> *# at one time and as 
+ * #void * user_pointer# as #vector<unsigned int> *# at one time and as 
  * #vector<Vector<number> > *# at the other but using this #Pointerstruct#
  * in between makes the use of these pointers more safe and gives better
  * possibility to expand their usage.
@@ -348,7 +348,7 @@ class SolutionTransfer
                                      * and stores all dof indices
                                      * of the cells that'll be refined
                                      */
-    vector<vector<int> > indices_on_cell;
+    vector<vector<unsigned int> > indices_on_cell;
 
                                     /**
                                      * All cell data (the dof indices and
@@ -359,7 +359,7 @@ class SolutionTransfer
                                      * data need to be packetized in a structure.
                                      * Note that in our case on each cell
                                      * either the
-                                     * #vector<int> indices# (if the cell
+                                     * #vector<unsigned int> indices# (if the cell
                                      * will be refined) or the
                                      * #vector<double> dof_values# (if the
                                      * children of this cell will be deleted)
@@ -370,7 +370,7 @@ class SolutionTransfer
                                      * 'multiplied' by this structure.
                                      */
     struct Pointerstruct {
-       vector<int> *indices_ptr;
+       vector<unsigned int>    *indices_ptr;
        vector<Vector<number> > *dof_values_ptr;
     };
 
index dbb246e4b417c0a5219d0046a80555c3c967d9bb..be4b48289655cd32b33ad08b9e0c659c60b2b62c 100644 (file)
@@ -397,11 +397,11 @@ class VectorTools
                                      * information.
                                      */
     template <int dim>
-    static void interpolate_boundary_values (const DoFHandler<dim> &dof,
-                                            const unsigned char    boundary_component,
-                                            const Function<dim>   &boundary_function,
-                                            map<int,double>       &boundary_values,
-                                            const vector<bool>    &component_mask = vector<bool>());
+    static void interpolate_boundary_values (const DoFHandler<dim>    &dof,
+                                            const unsigned char       boundary_component,
+                                            const Function<dim>      &boundary_function,
+                                            map<unsigned int,double> &boundary_values,
+                                            const vector<bool>       &component_mask = vector<bool>());
 
 //TODO: Update project_boundary_values for more components
 //TODO: Replace FunctionMap
@@ -425,10 +425,10 @@ class VectorTools
                                      * class for further information.
                                      */
     template <int dim>
-    static void project_boundary_values (const DoFHandler<dim>  &dof,
+    static void project_boundary_values (const DoFHandler<dim>    &dof,
                                         const map<unsigned char,const Function<dim>*> &boundary_function,
-                                        const Quadrature<dim-1>&q,
-                                        map<int,double>        &boundary_values);
+                                        const Quadrature<dim-1>  &q,
+                                        map<unsigned int,double> &boundary_values);
     
                                     /**
                                      * Compute the error of the finite element solution.
index 3cc5bf2623a8338c1f43eb5ca201769242e7a8be..20aade1bcde7540024fd10a85242ed2f9a6cf7f5 100644 (file)
@@ -26,7 +26,8 @@
 
 template <int dim>
 void DoFObjectAccessor<1, dim>::set_dof_index (const unsigned int i,
-                                              const int index) const {
+                                              const unsigned int index) const
+{
   Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
                                   // make sure a FE has been selected
                                   // and enough room was reserved
@@ -44,7 +45,8 @@ void DoFObjectAccessor<1, dim>::set_dof_index (const unsigned int i,
 template <int dim>
 void DoFObjectAccessor<1, dim>::set_vertex_dof_index (const unsigned int vertex,
                                                      const unsigned int i,
-                                                     const int index) const {
+                                                     const unsigned int index) const
+{
   Assert (dof_handler != 0, ExcInvalidObject());
   Assert (dof_handler->selected_fe != 0, ExcInvalidObject());
   Assert (vertex<2, ExcIndexRange (i,0,2));
@@ -74,7 +76,7 @@ distribute_local_to_global (const Vector<double> &local_source,
   const unsigned int n_dofs = local_source.size();
   
                                   // get indices of dofs
-  vector<int> dofs (n_dofs);
+  vector<unsigned int> dofs (n_dofs);
   get_dof_indices (dofs);
   
                                   // distribute cell vector
@@ -103,7 +105,7 @@ distribute_local_to_global (const FullMatrix<double> &local_source,
   const unsigned int n_dofs = local_source.m();
 
                                   // get indices of dofs
-  vector<int> dofs (n_dofs);
+  vector<unsigned int> dofs (n_dofs);
   get_dof_indices (dofs);
   
                                   // distribute cell matrix
@@ -181,7 +183,8 @@ DoFObjectAccessor<1,dim>::set_dof_values (const Vector<number> &local_values,
 
 template <int dim>
 void DoFObjectAccessor<2, dim>::set_dof_index (const unsigned int i,
-                                              const int index) const {
+                                              const unsigned int index) const
+{
   Assert (dof_handler != 0, ExcInvalidObject());
                                   // make sure a FE has been selected
                                   // and enough room was reserved
@@ -196,9 +199,11 @@ void DoFObjectAccessor<2, dim>::set_dof_index (const unsigned int i,
 
 
 template <int dim>
-void DoFObjectAccessor<2, dim>::set_vertex_dof_index (const unsigned int vertex,
-                                                          const unsigned int i,
-                                                          const int index) const {
+void
+DoFObjectAccessor<2, dim>::set_vertex_dof_index (const unsigned int vertex,
+                                                const unsigned int i,
+                                                const unsigned int index) const
+{
   Assert (dof_handler != 0, ExcInvalidObject());
   Assert (dof_handler->selected_fe != 0, ExcInvalidObject());
   Assert (vertex<4, ExcIndexRange (i,0,4));
@@ -229,7 +234,7 @@ distribute_local_to_global (const Vector<double> &local_source,
   const unsigned int n_dofs = local_source.size();
 
                                   // get indices of dofs
-  vector<int> dofs (n_dofs);
+  vector<unsigned int> dofs (n_dofs);
   get_dof_indices (dofs);
   
                                   // distribute cell vector
@@ -259,7 +264,7 @@ distribute_local_to_global (const FullMatrix<double> &local_source,
   const unsigned int n_dofs = local_source.m();
 
                                   // get indices of dofs
-  vector<int> dofs (n_dofs);
+  vector<unsigned int> dofs (n_dofs);
   get_dof_indices (dofs);
   
                                   // distribute cell matrix
@@ -348,7 +353,8 @@ DoFObjectAccessor<2,dim>::set_dof_values (const Vector<number> &local_values,
 
 template <int dim>
 void DoFObjectAccessor<3, dim>::set_dof_index (const unsigned int i,
-                                              const int index) const {
+                                              const unsigned int index) const
+{
   Assert (dof_handler != 0, ExcInvalidObject());
                                   // make sure a FE has been selected
                                   // and enough room was reserved
@@ -365,7 +371,8 @@ void DoFObjectAccessor<3, dim>::set_dof_index (const unsigned int i,
 template <int dim>
 void DoFObjectAccessor<3, dim>::set_vertex_dof_index (const unsigned int vertex,
                                                      const unsigned int i,
-                                                     const int index) const {
+                                                     const unsigned int index) const
+{
   Assert (dof_handler != 0, ExcInvalidObject());
   Assert (dof_handler->selected_fe != 0, ExcInvalidObject());
   Assert (vertex<8, ExcIndexRange (i,0,8));
@@ -397,7 +404,7 @@ distribute_local_to_global (const Vector<double> &local_source,
   const unsigned int n_dofs = local_source.size();
 
                                   // get indices of dofs
-  vector<int> dofs (n_dofs);
+  vector<unsigned int> dofs (n_dofs);
   get_dof_indices (dofs);
   
                                   // distribute cell vector
@@ -429,7 +436,7 @@ distribute_local_to_global (const FullMatrix<double> &local_source,
   const unsigned int n_dofs = local_source.m();
 
                                   // get indices of dofs
-  vector<int> dofs (n_dofs);
+  vector<unsigned int> dofs (n_dofs);
   get_dof_indices (dofs);
   
                                   // distribute cell matrix
index 484cba91289194d8bfe59079d8baef1502857d5e..07246c45d21072e9308e8cda63edc6430b40084f 100644 (file)
@@ -298,7 +298,7 @@ DoFHandler<1>::last_active_quad () const {
 
 template <>
 DoFHandler<1>::raw_hex_iterator
-DoFHandler<1>::begin_raw_hex (unsigned int) const {
+DoFHandler<1>::begin_raw_hex (const unsigned int) const {
   Assert (false, ExcNotImplemented());
   return 0;
 };
@@ -307,7 +307,7 @@ DoFHandler<1>::begin_raw_hex (unsigned int) const {
 
 template <>
 DoFHandler<1>::hex_iterator
-DoFHandler<1>::begin_hex (unsigned int) const {
+DoFHandler<1>::begin_hex (const unsigned int) const {
   Assert (false, ExcNotImplemented());
   return 0;
 };
@@ -316,7 +316,7 @@ DoFHandler<1>::begin_hex (unsigned int) const {
 
 template <>
 DoFHandler<1>::active_hex_iterator
-DoFHandler<1>::begin_active_hex (unsigned int) const {
+DoFHandler<1>::begin_active_hex (const unsigned int) const {
   Assert (false, ExcNotImplemented());
   return 0;
 };
@@ -550,7 +550,7 @@ DoFHandler<2>::last_active_face (const unsigned int level) const {
 
 template <>
 DoFHandler<2>::raw_hex_iterator
-DoFHandler<2>::begin_raw_hex (unsigned int) const {
+DoFHandler<2>::begin_raw_hex (const unsigned int) const {
   Assert (false, ExcNotImplemented());
   return 0;
 };
@@ -559,7 +559,7 @@ DoFHandler<2>::begin_raw_hex (unsigned int) const {
 
 template <>
 DoFHandler<2>::hex_iterator
-DoFHandler<2>::begin_hex (unsigned int) const {
+DoFHandler<2>::begin_hex (const unsigned int) const {
   Assert (false, ExcNotImplemented());
   return 0;
 };
@@ -568,7 +568,7 @@ DoFHandler<2>::begin_hex (unsigned int) const {
 
 template <>
 DoFHandler<2>::active_hex_iterator
-DoFHandler<2>::begin_active_hex (unsigned int) const {
+DoFHandler<2>::begin_active_hex (const unsigned int) const {
   Assert (false, ExcNotImplemented());
   return 0;
 };
@@ -1304,7 +1304,7 @@ unsigned int DoFHandler<dim>::n_boundary_dofs () const {
   set<int> boundary_dofs;
 
   const unsigned int dofs_per_face = selected_fe->dofs_per_face;
-  vector<int> dofs_on_face(dofs_per_face);
+  vector<unsigned int> dofs_on_face(dofs_per_face);
   active_face_iterator face = begin_active_face (),
                       endf = end_face();
   for (; face!=endf; ++face)
@@ -1328,7 +1328,7 @@ unsigned int DoFHandler<dim>::n_boundary_dofs (const FunctionMap &boundary_indic
   set<int> boundary_dofs;
 
   const unsigned int dofs_per_face = selected_fe->dofs_per_face;
-  vector<int> dofs_on_face(dofs_per_face);
+  vector<unsigned int> dofs_on_face(dofs_per_face);
   active_face_iterator face = begin_active_face (),
                       endf = end_face();
   for (; face!=endf; ++face)
@@ -1454,7 +1454,7 @@ unsigned int DoFHandler<2>::distribute_dofs_on_cell (active_cell_iterator &cell,
                                       // check whether dofs for this
                                       // vertex have been distributed
                                       // (only check the first dof)
-      if (cell->vertex_dof_index(vertex, 0) == -1)
+      if (cell->vertex_dof_index(vertex, 0) == invalid_dof_index)
        for (unsigned int d=0; d<selected_fe->dofs_per_vertex; ++d)
          cell->set_vertex_dof_index (vertex, d, next_free_dof++);
     
@@ -1467,7 +1467,7 @@ unsigned int DoFHandler<2>::distribute_dofs_on_cell (active_cell_iterator &cell,
                                         // distribute dofs if necessary:
                                         // check whether line dof is already
                                         // numbered (check only first dof)
-       if (line->dof_index(0) == -1)
+       if (line->dof_index(0) == invalid_dof_index)
                                           // if not: distribute dofs
          for (unsigned int d=0; d<selected_fe->dofs_per_line; ++d)
            line->set_dof_index (d, next_free_dof++);       
@@ -1501,7 +1501,7 @@ unsigned int DoFHandler<3>::distribute_dofs_on_cell (active_cell_iterator &cell,
                                       // check whether dofs for this
                                       // vertex have been distributed
                                       // (only check the first dof)
-      if (cell->vertex_dof_index(vertex, 0) == -1)
+      if (cell->vertex_dof_index(vertex, 0) == invalid_dof_index)
        for (unsigned int d=0; d<selected_fe->dofs_per_vertex; ++d)
          cell->set_vertex_dof_index (vertex, d, next_free_dof++);
     
@@ -1514,7 +1514,7 @@ unsigned int DoFHandler<3>::distribute_dofs_on_cell (active_cell_iterator &cell,
                                         // distribute dofs if necessary:
                                         // check whether line dof is already
                                         // numbered (check only first dof)
-       if (line->dof_index(0) == -1)
+       if (line->dof_index(0) == invalid_dof_index)
                                           // if not: distribute dofs
          for (unsigned int d=0; d<selected_fe->dofs_per_line; ++d)
            line->set_dof_index (d, next_free_dof++);       
@@ -1529,7 +1529,7 @@ unsigned int DoFHandler<3>::distribute_dofs_on_cell (active_cell_iterator &cell,
                                         // distribute dofs if necessary:
                                         // check whether quad dof is already
                                         // numbered (check only first dof)
-       if (quad->dof_index(0) == -1)
+       if (quad->dof_index(0) == invalid_dof_index)
                                           // if not: distribute dofs
          for (unsigned int d=0; d<selected_fe->dofs_per_quad; ++d)
            quad->set_dof_index (d, next_free_dof++);       
@@ -1555,17 +1555,17 @@ unsigned int DoFHandler<3>::distribute_dofs_on_cell (active_cell_iterator &cell,
 #if deal_II_dimension == 1
 
 template <>
-void DoFHandler<1>::renumber_dofs (const vector<int> &new_numbers) {
+void DoFHandler<1>::renumber_dofs (const vector<unsigned int> &new_numbers) {
   Assert (new_numbers.size() == n_dofs(), ExcRenumberingIncomplete());
 #ifdef DEBUG
                                   // assert that the new indices are
                                   // consecutively numbered
   if (true)
     {
-      vector<int> tmp(new_numbers);
+      vector<unsigned int> tmp(new_numbers);
       sort (tmp.begin(), tmp.end());
-      vector<int>::const_iterator p = tmp.begin();
-      int                         i = 0;
+      vector<unsigned int>::const_iterator p = tmp.begin();
+      unsigned int                         i = 0;
       for (; p!=tmp.end(); ++p, ++i)
        Assert (*p == i, ExcNewNumbersNotConsecutive(i));
     };
@@ -1577,22 +1577,22 @@ void DoFHandler<1>::renumber_dofs (const vector<int> &new_numbers) {
                                   // two cells more than once. Anyway, this
                                   // way it's not only more correct but also
                                   // faster; note, however, that dof numbers
-                                  // may be -1, namely when the appropriate
+                                  // may be invalid_dof_index, namely when the appropriate
                                   // vertex/line/etc is unused
-  for (vector<int>::iterator i=vertex_dofs.begin(); i!=vertex_dofs.end(); ++i)
-    if (*i != -1)
+  for (vector<unsigned int>::iterator i=vertex_dofs.begin(); i!=vertex_dofs.end(); ++i)
+    if (*i != invalid_dof_index)
       *i = new_numbers[*i];
     else
-                                      // if index is -1: check if this one
+                                      // 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 ());
   
   for (unsigned int level=0; level<levels.size(); ++level) 
-    for (vector<int>::iterator i=levels[level]->line_dofs.begin();
+    for (vector<unsigned int>::iterator i=levels[level]->line_dofs.begin();
         i!=levels[level]->line_dofs.end(); ++i)
-      if (*i != -1)
+      if (*i != invalid_dof_index)
        *i = new_numbers[*i];
 };
 
@@ -1602,17 +1602,17 @@ void DoFHandler<1>::renumber_dofs (const vector<int> &new_numbers) {
 #if deal_II_dimension == 2
 
 template <>
-void DoFHandler<2>::renumber_dofs (const vector<int> &new_numbers) {
+void DoFHandler<2>::renumber_dofs (const vector<unsigned int> &new_numbers) {
   Assert (new_numbers.size() == n_dofs(), ExcRenumberingIncomplete());
 #ifdef DEBUG
                                   // assert that the new indices are
                                   // consecutively numbered
   if (true)
     {
-      vector<int> tmp(new_numbers);
+      vector<unsigned int> tmp(new_numbers);
       sort (tmp.begin(), tmp.end());
-      vector<int>::const_iterator p = tmp.begin();
-      int                         i = 0;
+      vector<unsigned int>::const_iterator p = tmp.begin();
+      unsigned int                         i = 0;
       for (; p!=tmp.end(); ++p, ++i)
        Assert (*p == i, ExcNewNumbersNotConsecutive(i));
     };
@@ -1624,13 +1624,13 @@ void DoFHandler<2>::renumber_dofs (const vector<int> &new_numbers) {
                                   // two cells more than once. Anyway, this
                                   // way it's not only more correct but also
                                   // faster; note, however, that dof numbers
-                                  // may be -1, namely when the appropriate
+                                  // may be invalid_dof_index, namely when the appropriate
                                   // vertex/line/etc is unused
-  for (vector<int>::iterator i=vertex_dofs.begin(); i!=vertex_dofs.end(); ++i)
-    if (*i != -1)
+  for (vector<unsigned int>::iterator i=vertex_dofs.begin(); i!=vertex_dofs.end(); ++i)
+    if (*i != invalid_dof_index)
       *i = new_numbers[*i];
     else
-                                      // if index is -1: check if this one
+                                      // 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,
@@ -1638,13 +1638,13 @@ void DoFHandler<2>::renumber_dofs (const vector<int> &new_numbers) {
   
   for (unsigned int level=0; level<levels.size(); ++level) 
     {
-      for (vector<int>::iterator i=levels[level]->line_dofs.begin();
+      for (vector<unsigned int>::iterator i=levels[level]->line_dofs.begin();
           i!=levels[level]->line_dofs.end(); ++i)
-       if (*i != -1)
+       if (*i != invalid_dof_index)
          *i = new_numbers[*i];
-      for (vector<int>::iterator i=levels[level]->quad_dofs.begin();
+      for (vector<unsigned int>::iterator i=levels[level]->quad_dofs.begin();
           i!=levels[level]->quad_dofs.end(); ++i)
-       if (*i != -1)
+       if (*i != invalid_dof_index)
          *i = new_numbers[*i];
     };
 };
@@ -1655,17 +1655,17 @@ void DoFHandler<2>::renumber_dofs (const vector<int> &new_numbers) {
 #if deal_II_dimension == 3
 
 template <>
-void DoFHandler<3>::renumber_dofs (const vector<int> &new_numbers) {
+void DoFHandler<3>::renumber_dofs (const vector<unsigned int> &new_numbers) {
   Assert (new_numbers.size() == n_dofs(), ExcRenumberingIncomplete());
 #ifdef DEBUG
                                   // assert that the new indices are
                                   // consecutively numbered
   if (true)
     {
-      vector<int> tmp(new_numbers);
+      vector<unsigned int> tmp(new_numbers);
       sort (tmp.begin(), tmp.end());
-      vector<int>::const_iterator p = tmp.begin();
-      int                         i = 0;
+      vector<unsigned int>::const_iterator p = tmp.begin();
+      unsigned int                         i = 0;
       for (; p!=tmp.end(); ++p, ++i)
        Assert (*p == i, ExcNewNumbersNotConsecutive(i));
     };
@@ -1677,13 +1677,13 @@ void DoFHandler<3>::renumber_dofs (const vector<int> &new_numbers) {
                                   // two cells more than once. Anyway, this
                                   // way it's not only more correct but also
                                   // faster; note, however, that dof numbers
-                                  // may be -1, namely when the appropriate
+                                  // may be invalid_dof_index, namely when the appropriate
                                   // vertex/line/etc is unused
-  for (vector<int>::iterator i=vertex_dofs.begin(); i!=vertex_dofs.end(); ++i)
-    if (*i != -1)
+  for (vector<unsigned int>::iterator i=vertex_dofs.begin(); i!=vertex_dofs.end(); ++i)
+    if (*i != invalid_dof_index)
       *i = new_numbers[*i];
     else
-                                      // if index is -1: check if this one
+                                      // 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,
@@ -1691,17 +1691,17 @@ void DoFHandler<3>::renumber_dofs (const vector<int> &new_numbers) {
   
   for (unsigned int level=0; level<levels.size(); ++level) 
     {
-      for (vector<int>::iterator i=levels[level]->line_dofs.begin();
+      for (vector<unsigned int>::iterator i=levels[level]->line_dofs.begin();
           i!=levels[level]->line_dofs.end(); ++i)
-       if (*i != -1)
+       if (*i != invalid_dof_index)
          *i = new_numbers[*i];
-      for (vector<int>::iterator i=levels[level]->quad_dofs.begin();
+      for (vector<unsigned int>::iterator i=levels[level]->quad_dofs.begin();
           i!=levels[level]->quad_dofs.end(); ++i)
-       if (*i != -1)
+       if (*i != invalid_dof_index)
          *i = new_numbers[*i];
-      for (vector<int>::iterator i=levels[level]->hex_dofs.begin();
+      for (vector<unsigned int>::iterator i=levels[level]->hex_dofs.begin();
           i!=levels[level]->hex_dofs.end(); ++i)
-       if (*i != -1)
+       if (*i != invalid_dof_index)
          *i = new_numbers[*i];
     };
 };
@@ -1860,7 +1860,7 @@ unsigned int DoFHandler<3>::max_couplings_between_boundary_dofs () const {
 #if deal_II_dimension == 1
 
 template <>
-void DoFHandler<1>::map_dof_to_boundary_indices (vector<int> &) const {
+void DoFHandler<1>::map_dof_to_boundary_indices (vector<unsigned int> &) const {
   Assert (selected_fe != 0, ExcNoFESelected());
   Assert (false, ExcNotImplemented());
 };
@@ -1869,7 +1869,7 @@ void DoFHandler<1>::map_dof_to_boundary_indices (vector<int> &) const {
 
 template <>
 void DoFHandler<1>::map_dof_to_boundary_indices (const FunctionMap &,
-                                                vector<int> &) const {
+                                                vector<unsigned int> &) const {
   Assert (selected_fe != 0, ExcNoFESelected());
   Assert (false, ExcNotImplemented());
 };
@@ -1879,15 +1879,16 @@ void DoFHandler<1>::map_dof_to_boundary_indices (const FunctionMap &,
 
 
 template <int dim>
-void DoFHandler<dim>::map_dof_to_boundary_indices (vector<int> &mapping) const {
+void DoFHandler<dim>::map_dof_to_boundary_indices (vector<unsigned int> &mapping) const
+{
   Assert (selected_fe != 0, ExcNoFESelected());
 
   mapping.clear ();
-  mapping.insert (mapping.end(), n_dofs(), -1);
+  mapping.insert (mapping.end(), n_dofs(), invalid_dof_index);
   
   const unsigned int dofs_per_face = selected_fe->dofs_per_face;
-  vector<int> dofs_on_face(dofs_per_face);
-  int next_boundary_index = 0;
+  vector<unsigned int> dofs_on_face(dofs_per_face);
+  unsigned int next_boundary_index = 0;
   
   active_face_iterator face = begin_active_face(),
                       endf = end_face();
@@ -1896,33 +1897,34 @@ void DoFHandler<dim>::map_dof_to_boundary_indices (vector<int> &mapping) const {
       {
        face->get_dof_indices (dofs_on_face);
        for (unsigned int i=0; i<dofs_per_face; ++i)
-         if (mapping[dofs_on_face[i]] == -1)
+         if (mapping[dofs_on_face[i]] == invalid_dof_index)
            mapping[dofs_on_face[i]] = next_boundary_index++;
       };
 
-  Assert (static_cast<unsigned int>(next_boundary_index) == n_boundary_dofs(),
+  Assert (next_boundary_index == n_boundary_dofs(),
          ExcInternalError());
 };
 
 
 
 template <int dim>
-void DoFHandler<dim>::map_dof_to_boundary_indices (const FunctionMap &boundary_indicators,
-                                                  vector<int> &mapping) const {
+void DoFHandler<dim>::map_dof_to_boundary_indices (const FunctionMap    &boundary_indicators,
+                                                  vector<unsigned int> &mapping) const
+{
   Assert (selected_fe != 0, ExcNoFESelected());
   Assert (boundary_indicators.find(255) == boundary_indicators.end(),
          ExcInvalidBoundaryIndicator());
 
   mapping.clear ();
-  mapping.insert (mapping.end(), n_dofs(), -1);
+  mapping.insert (mapping.end(), n_dofs(), invalid_dof_index);
 
                                   // return if there is nothing to do
   if (boundary_indicators.size() == 0)
     return;
   
   const unsigned int dofs_per_face = selected_fe->dofs_per_face;
-  vector<int> dofs_on_face(dofs_per_face);
-  int next_boundary_index = 0;
+  vector<unsigned int> dofs_on_face(dofs_per_face);
+  unsigned int next_boundary_index = 0;
   
   active_face_iterator face = begin_active_face(),
                       endf = end_face();
@@ -1932,12 +1934,11 @@ void DoFHandler<dim>::map_dof_to_boundary_indices (const FunctionMap &boundary_i
       {
        face->get_dof_indices (dofs_on_face);
        for (unsigned int i=0; i<dofs_per_face; ++i)
-         if (mapping[dofs_on_face[i]] == -1)
+         if (mapping[dofs_on_face[i]] == invalid_dof_index)
            mapping[dofs_on_face[i]] = next_boundary_index++;
       };
 
-  Assert (static_cast<unsigned int>(next_boundary_index)
-         == n_boundary_dofs(boundary_indicators),
+  Assert (next_boundary_index == n_boundary_dofs(boundary_indicators),
          ExcInternalError());
 };
 
@@ -1955,17 +1956,17 @@ void DoFHandler<1>::reserve_space () {
                                    // their size
   clear_space ();
   
-  vertex_dofs = vector<int>(tria->vertices.size()*
-                           selected_fe->dofs_per_vertex,
-                           -1);
+  vertex_dofs = vector<unsigned int>(tria->vertices.size()*
+                                    selected_fe->dofs_per_vertex,
+                                    invalid_dof_index);
     
   for (unsigned int i=0; i<tria->n_levels(); ++i) 
     {
       levels.push_back (new DoFLevel<1>);
 
-      levels.back()->line_dofs = vector<int>(tria->levels[i]->lines.lines.size() *
-                                            selected_fe->dofs_per_line,
-                                            -1);
+      levels.back()->line_dofs = vector<unsigned int>(tria->levels[i]->lines.lines.size() *
+                                                     selected_fe->dofs_per_line,
+                                                     invalid_dof_index);
     };
 };
 
@@ -1986,19 +1987,19 @@ void DoFHandler<2>::reserve_space () {
                                    // their size
   clear_space ();
   
-  vertex_dofs = vector<int>(tria->vertices.size()*
-                           selected_fe->dofs_per_vertex,
-                           -1);
+  vertex_dofs = vector<unsigned int>(tria->vertices.size()*
+                                    selected_fe->dofs_per_vertex,
+                                    invalid_dof_index);
   for (unsigned int i=0; i<tria->n_levels(); ++i) 
     {
       levels.push_back (new DoFLevel<2>);
 
-      levels.back()->line_dofs = vector<int> (tria->levels[i]->lines.lines.size() *
-                                             selected_fe->dofs_per_line,
-                                             -1);
-      levels.back()->quad_dofs = vector<int> (tria->levels[i]->quads.quads.size() *
-                                             selected_fe->dofs_per_quad,
-                                             -1);
+      levels.back()->line_dofs = vector<unsigned int> (tria->levels[i]->lines.lines.size() *
+                                                      selected_fe->dofs_per_line,
+                                                      invalid_dof_index);
+      levels.back()->quad_dofs = vector<unsigned int> (tria->levels[i]->quads.quads.size() *
+                                                      selected_fe->dofs_per_quad,
+                                                      invalid_dof_index);
     };
 };
 
@@ -2018,22 +2019,22 @@ void DoFHandler<3>::reserve_space () {
                                    // their size
   clear_space ();
   
-  vertex_dofs = vector<int>(tria->vertices.size()*
-                           selected_fe->dofs_per_vertex,
-                           -1);
+  vertex_dofs = vector<unsigned int>(tria->vertices.size()*
+                                    selected_fe->dofs_per_vertex,
+                                    invalid_dof_index);
   for (unsigned int i=0; i<tria->n_levels(); ++i) 
     {
       levels.push_back (new DoFLevel<3>);
 
-      levels.back()->line_dofs = vector<int> (tria->levels[i]->lines.lines.size() *
-                                             selected_fe->dofs_per_line,
-                                             -1);
-      levels.back()->quad_dofs = vector<int> (tria->levels[i]->quads.quads.size() *
-                                             selected_fe->dofs_per_quad,
-                                             -1);
-      levels.back()->hex_dofs = vector<int> (tria->levels[i]->hexes.hexes.size() *
-                                            selected_fe->dofs_per_hex,
-                                            -1);
+      levels.back()->line_dofs = vector<unsigned int> (tria->levels[i]->lines.lines.size() *
+                                                      selected_fe->dofs_per_line,
+                                                      invalid_dof_index);
+      levels.back()->quad_dofs = vector<unsigned int> (tria->levels[i]->quads.quads.size() *
+                                                      selected_fe->dofs_per_quad,
+                                                      invalid_dof_index);
+      levels.back()->hex_dofs = vector<unsigned int> (tria->levels[i]->hexes.hexes.size() *
+                                                     selected_fe->dofs_per_hex,
+                                                     invalid_dof_index);
     };
 };
 
index afbd6653fc0ac6cee80775ae9ef0bd679278318c..4cb578d7960b8bcd2c52f6dedf6d7e620aeaff08 100644 (file)
 
 
 template <int dim>
-void DoFRenumbering::Cuthill_McKee (DoFHandler<dim>   &dof_handler,
-                                   const bool         reversed_numbering,
-                                   const bool         use_constraints,
-                                   const vector<int> &starting_indices) {
+void DoFRenumbering::Cuthill_McKee (DoFHandler<dim>            &dof_handler,
+                                   const bool                  reversed_numbering,
+                                   const bool                  use_constraints,
+                                   const vector<unsigned int> &starting_indices)
+{
                                   // make the connection graph
   SparsityPattern sparsity (dof_handler.n_dofs(),
                            dof_handler.max_couplings_between_dofs());
@@ -35,23 +36,24 @@ void DoFRenumbering::Cuthill_McKee (DoFHandler<dim>   &dof_handler,
       constraints.condense (sparsity);
     };
     
-  const int n_dofs = sparsity.n_rows();
-                                  // store the new dof numbers; -1 means
+  const unsigned int n_dofs = sparsity.n_rows();
+                                  // store the new dof numbers; invalid_dof_index means
                                   // that no new number was chosen yet
-  vector<int> new_number(sparsity.n_rows(), -1);
+  vector<unsigned int> new_number(sparsity.n_rows(), DoFHandler<dim>::invalid_dof_index);
   
                                   // store the indices of the dofs renumbered
                                   // in the last round. Default to starting
                                   // points
-  vector<int> last_round_dofs (starting_indices);
+  vector<unsigned int> last_round_dofs (starting_indices);
   
                                   // delete disallowed elements
   for (unsigned int i=0; i<last_round_dofs.size(); ++i)
-    if ((last_round_dofs[i]<0) || (last_round_dofs[i]>=n_dofs))
-      last_round_dofs[i] = -1;
+    if ((last_round_dofs[i]==DoFHandler<dim>::invalid_dof_index) ||
+       (last_round_dofs[i]>=n_dofs))
+      last_round_dofs[i] = DoFHandler<dim>::invalid_dof_index;
   
   remove_if (last_round_dofs.begin(), last_round_dofs.end(),
-            bind2nd(equal_to<int>(), -1));
+            bind2nd(equal_to<unsigned int>(), DoFHandler<dim>::invalid_dof_index));
   
                                   // now if no valid points remain:
                                   // find dof with lowest coordination
@@ -59,9 +61,9 @@ void DoFRenumbering::Cuthill_McKee (DoFHandler<dim>   &dof_handler,
   
   if (last_round_dofs.size() == 0)
     {
-      int          starting_point   = -1;
+      unsigned int starting_point   = DoFHandler<dim>::invalid_dof_index;
       unsigned int min_coordination = n_dofs;
-      for (int row=0; row<n_dofs; ++row) 
+      for (unsigned int row=0; row<n_dofs; ++row) 
        {
          unsigned int j;
 
@@ -92,7 +94,7 @@ void DoFRenumbering::Cuthill_McKee (DoFHandler<dim>   &dof_handler,
                                       // if that should be the case, we can
                                       // chose an arbitrary dof as starting
                                       // point, e.g. the one with number zero
-      if (starting_point == -1)
+      if (starting_point == DoFHandler<dim>::invalid_dof_index)
        starting_point = 0;
       
                                       // initialize the first dof
@@ -101,7 +103,7 @@ void DoFRenumbering::Cuthill_McKee (DoFHandler<dim>   &dof_handler,
   
 
                                   // store next free dof index
-  int         next_free_number = 0;
+  unsigned int next_free_number = 0;
 
                                   // enumerate the first round dofs
   for (unsigned int i=0; i!=last_round_dofs.size(); ++i)
@@ -115,7 +117,7 @@ void DoFRenumbering::Cuthill_McKee (DoFHandler<dim>   &dof_handler,
     {
                                       // store the indices of the dofs to be
                                       // renumbered in the next round
-      vector<int> next_round_dofs;
+      vector<unsigned int> next_round_dofs;
 
                                       // find all neighbors of the
                                       // dofs numbered in the last
@@ -132,14 +134,14 @@ void DoFRenumbering::Cuthill_McKee (DoFHandler<dim>   &dof_handler,
       sort (next_round_dofs.begin(), next_round_dofs.end());
 
                                       // delete multiple entries
-      vector<int>::iterator end_sorted;
+      vector<unsigned int>::iterator end_sorted;
       end_sorted = unique (next_round_dofs.begin(), next_round_dofs.end());
       next_round_dofs.erase (end_sorted, next_round_dofs.end());
 
                                       // eliminate dofs which are
                                       // already numbered
       for (int s=next_round_dofs.size()-1; s>=0; --s)
-       if (new_number[next_round_dofs[s]] != -1)
+       if (new_number[next_round_dofs[s]] != DoFHandler<dim>::invalid_dof_index)
          next_round_dofs.erase (&next_round_dofs[s]);
 
                                       // check whether there are any new
@@ -157,7 +159,7 @@ void DoFRenumbering::Cuthill_McKee (DoFHandler<dim>   &dof_handler,
       
                                       // find coordination number for
                                       // each of these dofs
-      for (vector<int>::iterator s=next_round_dofs.begin();
+      for (vector<unsigned int>::iterator s=next_round_dofs.begin();
           s!=next_round_dofs.end(); ++s) 
        {
          unsigned int coordination = 0;
@@ -188,14 +190,14 @@ void DoFRenumbering::Cuthill_McKee (DoFHandler<dim>   &dof_handler,
 
 #ifdef DEBUG
                                   //  test for all indices numbered
-  if (find (new_number.begin(), new_number.end(), -1) != new_number.end())
+  if (find (new_number.begin(), new_number.end(), DoFHandler<dim>::invalid_dof_index) != new_number.end())
     Assert (false, ExcRenumberingIncomplete());
   Assert (next_free_number == n_dofs,
          ExcRenumberingIncomplete());
 #endif
 
   if (reversed_numbering)
-    for (vector<int>::iterator i=new_number.begin(); i!=new_number.end(); ++i)
+    for (vector<unsigned int>::iterator i=new_number.begin(); i!=new_number.end(); ++i)
       *i = n_dofs-*i;
 
                                   // actually perform renumbering;
@@ -208,32 +210,33 @@ void DoFRenumbering::Cuthill_McKee (DoFHandler<dim>   &dof_handler,
 
 
 template <int dim>
-void DoFRenumbering::Cuthill_McKee (MGDoFHandler<dim>      &dof_handler,
-                                   const unsigned int      level,
-                                   const bool              reversed_numbering,
-                                   const vector<int>      &starting_indices) {
+void DoFRenumbering::Cuthill_McKee (MGDoFHandler<dim>          &dof_handler,
+                                   const unsigned int          level,
+                                   const bool                  reversed_numbering,
+                                   const vector<unsigned int> &starting_indices) {
                                   // make the connection graph
   SparsityPattern sparsity (dof_handler.n_dofs(level),
                            dof_handler.max_couplings_between_dofs());
   MGDoFTools::make_sparsity_pattern (dof_handler, level, sparsity);
     
-  const int n_dofs = sparsity.n_rows();
-                                  // store the new dof numbers; -1 means
+  const unsigned int n_dofs = sparsity.n_rows();
+                                  // store the new dof numbers; invalid_dof_index means
                                   // that no new number was chosen yet
-  vector<int> new_number(n_dofs, -1);
+  vector<unsigned int> new_number(n_dofs, DoFHandler<dim>::invalid_dof_index);
   
                                   // store the indices of the dofs renumbered
                                   // in the last round. Default to starting
                                   // points
-  vector<int> last_round_dofs (starting_indices);
+  vector<unsigned int> last_round_dofs (starting_indices);
   
                                   // delete disallowed elements
   for (unsigned int i=0; i<last_round_dofs.size(); ++i)
-    if ((last_round_dofs[i]<0) || (last_round_dofs[i]>=n_dofs))
-      last_round_dofs[i] = -1;
+    if ((last_round_dofs[i]==DoFHandler<dim>::invalid_dof_index) ||
+       (last_round_dofs[i]>=n_dofs))
+      last_round_dofs[i] = DoFHandler<dim>::invalid_dof_index;
   
   remove_if (last_round_dofs.begin(), last_round_dofs.end(),
-            bind2nd(equal_to<int>(), -1));
+            bind2nd(equal_to<unsigned int>(), DoFHandler<dim>::invalid_dof_index));
   
                                   // now if no valid points remain:
                                   // find dof with lowest coordination
@@ -241,9 +244,9 @@ void DoFRenumbering::Cuthill_McKee (MGDoFHandler<dim>      &dof_handler,
   
   if (last_round_dofs.size() == 0)
     {
-      int          starting_point   = -1;
+      unsigned int starting_point   = DoFHandler<dim>::invalid_dof_index;
       unsigned int min_coordination = n_dofs;
-      for (int row=0; row<n_dofs; ++row) 
+      for (unsigned int row=0; row<n_dofs; ++row) 
        {
          unsigned int j;
          for (j=sparsity.get_rowstart_indices()[row];
@@ -265,7 +268,7 @@ void DoFRenumbering::Cuthill_McKee (MGDoFHandler<dim>      &dof_handler,
   
 
                                   // store next free dof index
-  int         next_free_number = 0;
+  unsigned int next_free_number = 0;
 
                                   // enumerate the first round dofs
   for (unsigned int i=0; i!=last_round_dofs.size(); ++i)
@@ -279,7 +282,7 @@ void DoFRenumbering::Cuthill_McKee (MGDoFHandler<dim>      &dof_handler,
     {
                                       // store the indices of the dofs to be
                                       // renumbered in the next round
-      vector<int> next_round_dofs;
+      vector<unsigned int> next_round_dofs;
 
                                       // find all neighbors of the
                                       // dofs numbered in the last
@@ -296,14 +299,14 @@ void DoFRenumbering::Cuthill_McKee (MGDoFHandler<dim>      &dof_handler,
       sort (next_round_dofs.begin(), next_round_dofs.end());
 
                                       // delete multiple entries
-      vector<int>::iterator end_sorted;
+      vector<unsigned int>::iterator end_sorted;
       end_sorted = unique (next_round_dofs.begin(), next_round_dofs.end());
       next_round_dofs.erase (end_sorted, next_round_dofs.end());
 
                                       // eliminate dofs which are
                                       // already numbered
       for (int s=next_round_dofs.size()-1; s>=0; --s)
-       if (new_number[next_round_dofs[s]] != -1)
+       if (new_number[next_round_dofs[s]] != DoFHandler<dim>::invalid_dof_index)
          next_round_dofs.erase (&next_round_dofs[s]);
 
                                       // check whether there are any new
@@ -321,7 +324,7 @@ void DoFRenumbering::Cuthill_McKee (MGDoFHandler<dim>      &dof_handler,
       
                                       // find coordination number for
                                       // each of these dofs
-      for (vector<int>::iterator s=next_round_dofs.begin();
+      for (vector<unsigned int>::iterator s=next_round_dofs.begin();
           s!=next_round_dofs.end(); ++s) 
        {
          unsigned int coordination = 0;
@@ -350,14 +353,17 @@ void DoFRenumbering::Cuthill_McKee (MGDoFHandler<dim>      &dof_handler,
 
 #ifdef DEBUG
                                   //  test for all indices numbered
-  if (find (new_number.begin(), new_number.end(), -1) != new_number.end())
+  if (find (new_number.begin(), new_number.end(),
+           DoFHandler<dim>::invalid_dof_index)
+      !=
+      new_number.end())
     Assert (false, ExcRenumberingIncomplete());
   Assert (next_free_number == n_dofs,
          ExcRenumberingIncomplete());
 #endif
 
   if (reversed_numbering)
-    for (vector<int>::iterator i=new_number.begin(); i!=new_number.end(); ++i)
+    for (vector<unsigned int>::iterator i=new_number.begin(); i!=new_number.end(); ++i)
       *i = n_dofs-*i;
 
                                   // actually perform renumbering;
@@ -396,7 +402,7 @@ void DoFRenumbering::component_wise (DoFHandler<dim>            &dof_handler,
 
                                   // vector to hold the dof indices on
                                   // the cell we visit at a time
-  vector<int> local_dof_indices(dofs_per_cell);
+  vector<unsigned int> local_dof_indices(dofs_per_cell);
                                   // prebuilt list to which component
                                   // a given dof on a cell belongs
   vector<unsigned int> component_list (dofs_per_cell);
@@ -412,7 +418,7 @@ void DoFRenumbering::component_wise (DoFHandler<dim>            &dof_handler,
                                   // sorted by dof index. note also that some
                                   // dof indices are entered multiply, so we
                                   // will have to take care of that
-  vector<vector<int> > component_to_dof_map (dof_handler.get_fe().n_components());
+  vector<vector<unsigned int> > component_to_dof_map (dof_handler.get_fe().n_components());
   for (typename DoFHandler<dim>::active_cell_iterator cell=dof_handler.begin_active();
        cell!=dof_handler.end(); ++cell)
     {
@@ -443,20 +449,20 @@ void DoFRenumbering::component_wise (DoFHandler<dim>            &dof_handler,
                                             component_to_dof_map[component].end());
     };
   
-  int next_free_index = 0;
-  vector<int> new_indices (dof_handler.n_dofs(), -1);
+  unsigned int next_free_index = 0;
+  vector<unsigned int> new_indices (dof_handler.n_dofs(), DoFHandler<dim>::invalid_dof_index);
   for (unsigned int component=0; component<dof_handler.get_fe().n_components(); ++component)
     {
-      const typename vector<int>::const_iterator
+      const typename vector<unsigned int>::const_iterator
        begin_of_component = component_to_dof_map[component].begin(),
        end_of_component   = component_to_dof_map[component].end();
             
-      for (typename vector<int>::const_iterator dof_index = begin_of_component;
+      for (typename vector<unsigned int>::const_iterator dof_index = begin_of_component;
           dof_index != end_of_component; ++dof_index)
        new_indices[*dof_index] = next_free_index++;
     };
 
-  Assert (next_free_index == static_cast<int>(dof_handler.n_dofs()),
+  Assert (next_free_index == dof_handler.n_dofs(),
          ExcInternalError());
 
   dof_handler.renumber_dofs (new_indices);
@@ -472,13 +478,13 @@ template
 void DoFRenumbering::Cuthill_McKee (DoFHandler<deal_II_dimension> &dof_handler,
                                    const bool                     reversed_numbering,
                                    const bool                     use_constraints,
-                                   const vector<int>             &starting_indices);
+                                   const vector<unsigned int>    &starting_indices);
 
 template
 void DoFRenumbering::Cuthill_McKee (MGDoFHandler<deal_II_dimension> &dof_handler,
                                    const unsigned int               level,
                                    const bool                       reversed_numbering,
-                                   const vector<int>               &starting_indices);
+                                   const vector<unsigned int>      &starting_indices);
 
 template
 void DoFRenumbering::component_wise (DoFHandler<deal_II_dimension> &dof_handler,
index 05268f83fe059103fe37224c9deffaa06df62e9c..6752441bfeba3dc352c359f192b8de69a05acb71 100644 (file)
@@ -30,9 +30,9 @@ DoFTools::make_sparsity_pattern (const DoFHandler<dim> &dof,
          ExcDimensionMismatch (sparsity.n_cols(), n_dofs));
 
   const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell;
-  vector<int> dofs_on_this_cell(dofs_per_cell);
+  vector<unsigned int> dofs_on_this_cell(dofs_per_cell);
   DoFHandler<dim>::active_cell_iterator cell = dof.begin_active(),
-                      endc = dof.end();
+                                       endc = dof.end();
   for (; cell!=endc; ++cell) 
     {
       cell->get_dof_indices (dofs_on_this_cell);
@@ -76,7 +76,7 @@ DoFTools::make_sparsity_pattern (const DoFHandler<dim>       &dof,
                       [dof.get_fe().system_to_component_index(j).first];
   
   
-  vector<int> dofs_on_this_cell(dofs_per_cell);
+  vector<unsigned int> dofs_on_this_cell(dofs_per_cell);
   DoFHandler<dim>::active_cell_iterator cell = dof.begin_active(),
                       endc = dof.end();
   for (; cell!=endc; ++cell) 
@@ -96,7 +96,7 @@ DoFTools::make_sparsity_pattern (const DoFHandler<dim>       &dof,
 
 template <>
 void DoFTools::make_boundary_sparsity_pattern (const DoFHandler<1>&,
-                                              const vector<int>  &,
+                                              const vector<unsigned int>  &,
                                               SparsityPattern    &)
 {
     Assert (false, ExcInternalError());
@@ -108,7 +108,7 @@ template <>
 void
 DoFTools::make_boundary_sparsity_pattern (const DoFHandler<1>&,
                                          const DoFHandler<1>::FunctionMap  &,
-                                         const vector<int>  &,
+                                         const vector<unsigned int>  &,
                                          SparsityPattern    &)
 {
   Assert (false, ExcInternalError());
@@ -121,7 +121,7 @@ DoFTools::make_boundary_sparsity_pattern (const DoFHandler<1>&,
 template <int dim>
 void
 DoFTools::make_boundary_sparsity_pattern (const DoFHandler<dim>& dof,
-                                         const vector<int>  &dof_to_boundary_mapping,
+                                         const vector<unsigned int>  &dof_to_boundary_mapping,
                                          SparsityPattern    &sparsity)
 {
   const unsigned int n_dofs = dof.n_dofs();
@@ -132,11 +132,11 @@ DoFTools::make_boundary_sparsity_pattern (const DoFHandler<dim>& dof,
   Assert (sparsity.n_cols() == dof.n_boundary_dofs(),
          ExcDimensionMismatch (sparsity.n_cols(), dof.n_boundary_dofs()));
   Assert (*max_element(dof_to_boundary_mapping.begin(),
-                      dof_to_boundary_mapping.end()) == (signed int)sparsity.n_rows()-1,
+                      dof_to_boundary_mapping.end()) == sparsity.n_rows()-1,
          ExcInternalError());
 
   const unsigned int dofs_per_face = dof.get_fe().dofs_per_face;
-  vector<int> dofs_on_this_face(dofs_per_face);
+  vector<unsigned int> dofs_on_this_face(dofs_per_face);
   DoFHandler<dim>::active_face_iterator face = dof.begin_active_face(),
                       endf = dof.end_face();
   for (; face!=endf; ++face)
@@ -147,7 +147,7 @@ DoFTools::make_boundary_sparsity_pattern (const DoFHandler<dim>& dof,
                                         // make sure all dof indices have a
                                         // boundary index
        Assert (*min_element(dofs_on_this_face.begin(),
-                            dofs_on_this_face.end()) >=0,
+                            dofs_on_this_face.end()) != DoFHandler<dim>::invalid_dof_index,
                ExcInternalError());
        
                                         // make sparsity pattern for this cell
@@ -163,7 +163,7 @@ DoFTools::make_boundary_sparsity_pattern (const DoFHandler<dim>& dof,
 template <int dim>
 void DoFTools::make_boundary_sparsity_pattern (const DoFHandler<dim>& dof,
                                               const DoFHandler<dim>::FunctionMap  &boundary_indicators,
-                                              const vector<int>  &dof_to_boundary_mapping,
+                                              const vector<unsigned int>  &dof_to_boundary_mapping,
                                               SparsityPattern    &sparsity)
 {
   const unsigned int n_dofs = dof.n_dofs();
@@ -175,12 +175,22 @@ void DoFTools::make_boundary_sparsity_pattern (const DoFHandler<dim>& dof,
          ExcDimensionMismatch (sparsity.n_rows(), dof.n_boundary_dofs(boundary_indicators)));
   Assert (sparsity.n_cols() == dof.n_boundary_dofs(boundary_indicators),
          ExcDimensionMismatch (sparsity.n_cols(), dof.n_boundary_dofs(boundary_indicators)));
-  Assert (*max_element(dof_to_boundary_mapping.begin(),
-                      dof_to_boundary_mapping.end()) == (signed int)sparsity.n_rows()-1,
-         ExcInternalError());
+#ifdef DEBUG
+  if (true)
+    {
+      unsigned int max_element = 0;
+      for (vector<unsigned int>::const_iterator i=dof_to_boundary_mapping.begin();
+          i!=dof_to_boundary_mapping.end(); ++i)
+       if ((*i != DoFHandler<dim>::invalid_dof_index) &&
+           (*i > max_element))
+         max_element = *i;
+      Assert (max_element  == sparsity.n_rows()-1,
+             ExcInternalError());
+    };
+#endif
 
   const unsigned int dofs_per_face = dof.get_fe().dofs_per_face;
-  vector<int> dofs_on_this_face(dofs_per_face);
+  vector<unsigned int> dofs_on_this_face(dofs_per_face);
   DoFHandler<dim>::active_face_iterator face = dof.begin_active_face(),
                       endf = dof.end_face();
   for (; face!=endf; ++face)
@@ -192,7 +202,7 @@ void DoFTools::make_boundary_sparsity_pattern (const DoFHandler<dim>& dof,
                                         // make sure all dof indices have a
                                         // boundary index
        Assert (*min_element(dofs_on_this_face.begin(),
-                            dofs_on_this_face.end()) >=0,
+                            dofs_on_this_face.end()) != DoFHandler<dim>::invalid_dof_index,
                ExcInternalError());
                                         // make sparsity pattern for this cell
        for (unsigned int i=0; i<dofs_per_face; ++i)
@@ -220,8 +230,8 @@ DoFTools::make_flux_sparsity_pattern (const DoFHandler<dim> &dof,
          ExcDimensionMismatch (sparsity.n_cols(), n_dofs));
 
   const unsigned int total_dofs = dof.get_fe().dofs_per_cell;
-  vector<int> dofs_on_this_cell(total_dofs);
-  vector<int> dofs_on_other_cell(total_dofs);
+  vector<unsigned int> dofs_on_this_cell(total_dofs);
+  vector<unsigned int> dofs_on_other_cell(total_dofs);
   DoFHandler<dim>::active_cell_iterator cell = dof.begin_active(),
                                        endc = dof.end();
   for (; cell!=endc; ++cell)
@@ -317,8 +327,8 @@ void DoFTools::make_hanging_node_constraints (const DoFHandler<2> &dof_handler,
                                         // get them when we need them,
                                         // but it seems easier to gather
                                         // them only once.
-       vector<int> dofs_on_mother;
-       vector<int> dofs_on_children;
+       vector<unsigned int> dofs_on_mother;
+       vector<unsigned int> dofs_on_children;
        dofs_on_mother.reserve (2*fe.dofs_per_vertex+
                                fe.dofs_per_line);
        dofs_on_children.reserve (fe.dofs_per_vertex+
@@ -409,8 +419,8 @@ void DoFTools::make_hanging_node_constraints (const DoFHandler<3> &dof_handler,
                                         // get them when we need them,
                                         // but it seems easier to gather
                                         // them only once.
-       vector<int> dofs_on_mother;
-       vector<int> dofs_on_children;
+       vector<unsigned int> dofs_on_mother;
+       vector<unsigned int> dofs_on_children;
        dofs_on_mother.reserve (4*fe.dofs_per_vertex+
                                4*fe.dofs_per_line+
                                fe.dofs_per_quad);
@@ -556,7 +566,7 @@ void DoFTools::distribute_cell_to_dof_vector (const DoFHandler<dim> &dof_handler
                                        endc = dof_handler.end();
   unsigned int present_cell = 0;
   const unsigned int dofs_per_cell = fe.dofs_per_cell;
-  vector<int> dof_indices (dofs_per_cell);
+  vector<unsigned int> dof_indices (dofs_per_cell);
 
   for (; cell!=endc; ++cell, ++present_cell) 
     {
@@ -611,7 +621,7 @@ DoFTools::extract_dofs(const DoFHandler<dim> &dof,
                                   // preset all values by false
   fill_n (selected_dofs.begin(), dof.n_dofs(), false);
   
-  vector<int> indices(fe.dofs_per_cell);
+  vector<unsigned int> indices(fe.dofs_per_cell);
   
   DoFHandler<dim>::active_cell_iterator c;
   for (c = dof.begin_active() ; c != dof.end() ; ++ c)
@@ -645,7 +655,7 @@ DoFTools::extract_level_dofs(const unsigned int       level,
                                   // preset all values by false
   fill_n (selected_dofs.begin(), dof.n_dofs(level), false);
 
-  vector<int> indices(fe.dofs_per_cell);
+  vector<unsigned int> indices(fe.dofs_per_cell);
   
   MGDoFHandler<dim>::cell_iterator c;
   for (c = dof.begin(level) ; c != dof.end(level) ; ++ c)
@@ -669,12 +679,12 @@ DoFTools::make_flux_sparsity_pattern (const DoFHandler<deal_II_dimension>& dof,
                                      SparsityPattern    &sparsity);
 template void
 DoFTools::make_boundary_sparsity_pattern (const DoFHandler<deal_II_dimension>& dof,
-                                         const vector<int>  &,
+                                         const vector<unsigned int>  &,
                                          SparsityPattern    &);
 template void
 DoFTools::make_boundary_sparsity_pattern (const DoFHandler<deal_II_dimension>& dof,
                                          const DoFHandler<deal_II_dimension>::FunctionMap  &boundary_indicators,
-                                         const vector<int>  &dof_to_boundary_mapping,
+                                         const vector<unsigned int>  &dof_to_boundary_mapping,
                                          SparsityPattern    &sparsity);
 #endif
 
index dae91a404f5a7afdc31ce5fe0ec0815cc68c5f56..cb0b7f0a04b0dd64b346147b51a97e521e8e14d6 100644 (file)
@@ -2020,7 +2020,7 @@ Triangulation<1>::last_active_face (const unsigned int) const {
 
 template <>
 TriaDimensionInfo<1>::raw_quad_iterator
-Triangulation<1>::begin_raw_quad (unsigned int) const {
+Triangulation<1>::begin_raw_quad (const unsigned int) const {
   Assert (false, ExcFunctionNotUseful());
   return 0;
 };
@@ -2029,7 +2029,7 @@ Triangulation<1>::begin_raw_quad (unsigned int) const {
 
 template <>
 TriaDimensionInfo<1>::quad_iterator
-Triangulation<1>::begin_quad (unsigned int) const {
+Triangulation<1>::begin_quad (const unsigned int) const {
   Assert (false, ExcFunctionNotUseful());
   return 0;
 };
@@ -2038,7 +2038,7 @@ Triangulation<1>::begin_quad (unsigned int) const {
 
 template <>
 TriaDimensionInfo<1>::active_quad_iterator
-Triangulation<1>::begin_active_quad (unsigned int) const {
+Triangulation<1>::begin_active_quad (const unsigned int) const {
   Assert (false, ExcFunctionNotUseful());
   return 0;
 };
@@ -2110,7 +2110,7 @@ Triangulation<1>::last_active_quad () const {
 
 template <>
 TriaDimensionInfo<1>::raw_hex_iterator
-Triangulation<1>::begin_raw_hex (unsigned int) const {
+Triangulation<1>::begin_raw_hex (const unsigned int) const {
   Assert (false, ExcFunctionNotUseful());
   return 0;
 };
@@ -2119,7 +2119,7 @@ Triangulation<1>::begin_raw_hex (unsigned int) const {
 
 template <>
 TriaDimensionInfo<1>::hex_iterator
-Triangulation<1>::begin_hex (unsigned int) const {
+Triangulation<1>::begin_hex (const unsigned int) const {
   Assert (false, ExcFunctionNotUseful());
   return 0;
 };
@@ -2128,7 +2128,7 @@ Triangulation<1>::begin_hex (unsigned int) const {
 
 template <>
 TriaDimensionInfo<1>::active_hex_iterator
-Triangulation<1>::begin_active_hex (unsigned int) const {
+Triangulation<1>::begin_active_hex (const unsigned int) const {
   Assert (false, ExcFunctionNotUseful());
   return 0;
 };
@@ -2352,7 +2352,7 @@ Triangulation<2>::last_active_face (const unsigned int level) const {
 
 template <>
 TriaDimensionInfo<2>::raw_hex_iterator
-Triangulation<2>::begin_raw_hex (unsigned int) const {
+Triangulation<2>::begin_raw_hex (const unsigned int) const {
   Assert (false, ExcFunctionNotUseful());
   return 0;
 };
@@ -2361,7 +2361,7 @@ Triangulation<2>::begin_raw_hex (unsigned int) const {
 
 template <>
 TriaDimensionInfo<2>::hex_iterator
-Triangulation<2>::begin_hex (unsigned int) const {
+Triangulation<2>::begin_hex (const unsigned int) const {
   Assert (false, ExcFunctionNotUseful());
   return 0;
 };
@@ -2370,7 +2370,7 @@ Triangulation<2>::begin_hex (unsigned int) const {
 
 template <>
 TriaDimensionInfo<2>::active_hex_iterator
-Triangulation<2>::begin_active_hex (unsigned int) const {
+Triangulation<2>::begin_active_hex (const unsigned int) const {
   Assert (false, ExcFunctionNotUseful());
   return 0;
 };
index df234c2e30b639b4451280b2f468ba43c0453099..c5ba004f22cf22e4a746ea114ce83474e9e418c8 100644 (file)
@@ -33,7 +33,7 @@ MGDoFObjectAccessor<1, dim>::MGDoFObjectAccessor (Triangulation<dim> *tria,
 
 
 template <int dim>
-int MGDoFObjectAccessor<1, dim>::mg_dof_index (const unsigned int i) const
+unsigned int MGDoFObjectAccessor<1, dim>::mg_dof_index (const unsigned int i) const
 {
   Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
   Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
@@ -53,7 +53,7 @@ int MGDoFObjectAccessor<1, dim>::mg_dof_index (const unsigned int i) const
 
 template <int dim>
 void MGDoFObjectAccessor<1, dim>::set_mg_dof_index (const unsigned int i,
-                                                   const int index) const
+                                                   const unsigned int index) const
 {
   Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
   Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
@@ -71,8 +71,8 @@ void MGDoFObjectAccessor<1, dim>::set_mg_dof_index (const unsigned int i,
 
 
 template <int dim>
-int MGDoFObjectAccessor<1, dim>::mg_vertex_dof_index (const unsigned int vertex,
-                                                     const unsigned int i) const
+unsigned int MGDoFObjectAccessor<1, dim>::mg_vertex_dof_index (const unsigned int vertex,
+                                                              const unsigned int i) const
 {
   Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
   Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
@@ -90,7 +90,7 @@ int MGDoFObjectAccessor<1, dim>::mg_vertex_dof_index (const unsigned int vertex,
 template <int dim>
 void MGDoFObjectAccessor<1, dim>::set_mg_vertex_dof_index (const unsigned int vertex,
                                                           const unsigned int i,
-                                                          const int index) const
+                                                          const unsigned int index) const
 {
   Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
   Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
@@ -107,7 +107,7 @@ void MGDoFObjectAccessor<1, dim>::set_mg_vertex_dof_index (const unsigned int ve
 
 template <int dim>
 void
-MGDoFObjectAccessor<1, dim>::get_mg_dof_indices (vector<int> &dof_indices) const
+MGDoFObjectAccessor<1, dim>::get_mg_dof_indices (vector<unsigned int> &dof_indices) const
 {
   Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
   Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
@@ -118,7 +118,7 @@ MGDoFObjectAccessor<1, dim>::get_mg_dof_indices (vector<int> &dof_indices) const
 
   const unsigned int dofs_per_vertex = dof_handler->get_fe().dofs_per_vertex,
                     dofs_per_line   = dof_handler->get_fe().dofs_per_line;
-  vector<int>::iterator next = dof_indices.begin();
+  vector<unsigned int>::iterator next = dof_indices.begin();
   for (unsigned int vertex=0; vertex<2; ++vertex)
     for (unsigned int d=0; d<dofs_per_vertex; ++d)
       *next++ = mg_vertex_dof_index(vertex,d);
@@ -204,7 +204,7 @@ MGDoFObjectAccessor<2, dim>::MGDoFObjectAccessor (Triangulation<dim> *tria,
 
 template <int dim>
 inline
-int MGDoFObjectAccessor<2, dim>::mg_dof_index (const unsigned int i) const
+unsigned int MGDoFObjectAccessor<2, dim>::mg_dof_index (const unsigned int i) const
 {
   Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
   Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
@@ -222,7 +222,7 @@ int MGDoFObjectAccessor<2, dim>::mg_dof_index (const unsigned int i) const
 
 template <int dim>
 void MGDoFObjectAccessor<2, dim>::set_mg_dof_index (const unsigned int i,
-                                                   const int index) const
+                                                   const unsigned int index) const
 {
   Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
   Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
@@ -240,8 +240,8 @@ void MGDoFObjectAccessor<2, dim>::set_mg_dof_index (const unsigned int i,
 
 template <int dim>
 inline
-int MGDoFObjectAccessor<2, dim>::mg_vertex_dof_index (const unsigned int vertex,
-                                                     const unsigned int i) const
+unsigned int MGDoFObjectAccessor<2, dim>::mg_vertex_dof_index (const unsigned int vertex,
+                                                              const unsigned int i) const
 {
   Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
   Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
@@ -259,7 +259,7 @@ int MGDoFObjectAccessor<2, dim>::mg_vertex_dof_index (const unsigned int vertex,
 template <int dim>
 void MGDoFObjectAccessor<2, dim>::set_mg_vertex_dof_index (const unsigned int vertex,
                                                           const unsigned int i,
-                                                          const int index) const
+                                                          const unsigned int index) const
 {
   Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
   Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
@@ -276,7 +276,7 @@ void MGDoFObjectAccessor<2, dim>::set_mg_vertex_dof_index (const unsigned int ve
 
 template <int dim>
 void
-MGDoFObjectAccessor<2, dim>::get_mg_dof_indices (vector<int> &dof_indices) const
+MGDoFObjectAccessor<2, dim>::get_mg_dof_indices (vector<unsigned int> &dof_indices) const
 {
   Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
   Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
@@ -289,7 +289,7 @@ MGDoFObjectAccessor<2, dim>::get_mg_dof_indices (vector<int> &dof_indices) const
   const unsigned int dofs_per_vertex = dof_handler->get_fe().dofs_per_vertex,
                     dofs_per_line   = dof_handler->get_fe().dofs_per_line,
                     dofs_per_quad   = dof_handler->get_fe().dofs_per_quad;
-  vector<int>::iterator next = dof_indices.begin();
+  vector<unsigned int>::iterator next = dof_indices.begin();
   for (unsigned int vertex=0; vertex<4; ++vertex)
     for (unsigned int d=0; d<dofs_per_vertex; ++d)
       *next++ = mg_vertex_dof_index(vertex,d);
@@ -399,7 +399,7 @@ MGDoFObjectAccessor<3, dim>::MGDoFObjectAccessor (Triangulation<dim> *tria,
 
 template <int dim>
 inline
-int MGDoFObjectAccessor<3, dim>::mg_dof_index (const unsigned int i) const
+unsigned int MGDoFObjectAccessor<3, dim>::mg_dof_index (const unsigned int i) const
 {
   Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
   Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
@@ -417,7 +417,7 @@ int MGDoFObjectAccessor<3, dim>::mg_dof_index (const unsigned int i) const
 
 template <int dim>
 void MGDoFObjectAccessor<3, dim>::set_mg_dof_index (const unsigned int i,
-                                                   const int index) const
+                                                   const unsigned int index) const
 {
   Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
   Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
@@ -435,8 +435,8 @@ void MGDoFObjectAccessor<3, dim>::set_mg_dof_index (const unsigned int i,
 
 template <int dim>
 inline
-int MGDoFObjectAccessor<3, dim>::mg_vertex_dof_index (const unsigned int vertex,
-                                                     const unsigned int i) const
+unsigned int MGDoFObjectAccessor<3, dim>::mg_vertex_dof_index (const unsigned int vertex,
+                                                              const unsigned int i) const
 {
   Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
   Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
@@ -454,7 +454,7 @@ int MGDoFObjectAccessor<3, dim>::mg_vertex_dof_index (const unsigned int vertex,
 template <int dim>
 void MGDoFObjectAccessor<3, dim>::set_mg_vertex_dof_index (const unsigned int vertex,
                                                           const unsigned int i,
-                                                          const int index) const
+                                                          const unsigned int index) const
 {
   Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
   Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
@@ -471,7 +471,7 @@ void MGDoFObjectAccessor<3, dim>::set_mg_vertex_dof_index (const unsigned int ve
 
 template <int dim>
 void
-MGDoFObjectAccessor<3, dim>::get_mg_dof_indices (vector<int> &dof_indices) const
+MGDoFObjectAccessor<3, dim>::get_mg_dof_indices (vector<unsigned int> &dof_indices) const
 {
   Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
   Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
@@ -486,7 +486,7 @@ MGDoFObjectAccessor<3, dim>::get_mg_dof_indices (vector<int> &dof_indices) const
                     dofs_per_line   = dof_handler->get_fe().dofs_per_line,
                     dofs_per_quad   = dof_handler->get_fe().dofs_per_quad,
                     dofs_per_hex    = dof_handler->get_fe().dofs_per_hex;
-  vector<int>::iterator next = dof_indices.begin();
+  vector<unsigned int>::iterator next = dof_indices.begin();
   for (unsigned int vertex=0; vertex<8; ++vertex)
     for (unsigned int d=0; d<dofs_per_vertex; ++d)
       *next++ = mg_vertex_dof_index(vertex,d);
index 937ef0b0e15a81321fa114675e3b75da6f94c184..9d0df564e1e997d3ac88d6b108beb1afffd5c1ee 100644 (file)
@@ -40,11 +40,11 @@ void MGDoFHandler<dim>::MGVertexDoFs::init (const unsigned int cl,
 
   const unsigned int n_levels = finest_level-coarsest_level + 1;
   
-  indices = new int[n_levels * dofs_per_vertex];
+  indices = new unsigned int[n_levels * dofs_per_vertex];
   Assert (indices != 0, ExcNoMemory ());
 
   for (unsigned int i=0; i<n_levels*dofs_per_vertex; ++i)
-    indices[i] = -1;
+    indices[i] = DoFHandler<dim>::invalid_dof_index;
 };
 
 
@@ -1430,7 +1430,7 @@ MGDoFHandler<2>::distribute_dofs_on_cell (cell_iterator &cell,
                                       // check whether dofs for this
                                       // vertex have been distributed
                                       // (only check the first dof)
-      if (cell->mg_vertex_dof_index(vertex, 0) == -1)
+      if (cell->mg_vertex_dof_index(vertex, 0) == DoFHandler<2>::invalid_dof_index)
        for (unsigned int d=0; d<selected_fe->dofs_per_vertex; ++d)
          cell->set_mg_vertex_dof_index (vertex, d, next_free_dof++);
     
@@ -1443,7 +1443,7 @@ MGDoFHandler<2>::distribute_dofs_on_cell (cell_iterator &cell,
                                         // distribute dofs if necessary:
                                         // check whether line dof is already
                                         // numbered (check only first dof)
-       if (line->mg_dof_index(0) == -1)
+       if (line->mg_dof_index(0) == DoFHandler<2>::invalid_dof_index)
                                           // if not: distribute dofs
          for (unsigned int d=0; d<selected_fe->dofs_per_line; ++d)
            line->set_mg_dof_index (d, next_free_dof++);            
@@ -1478,7 +1478,7 @@ MGDoFHandler<3>::distribute_dofs_on_cell (cell_iterator &cell,
                                       // check whether dofs for this
                                       // vertex have been distributed
                                       // (only check the first dof)
-      if (cell->mg_vertex_dof_index(vertex, 0) == -1)
+      if (cell->mg_vertex_dof_index(vertex, 0) == DoFHandler<3>::invalid_dof_index)
        for (unsigned int d=0; d<selected_fe->dofs_per_vertex; ++d)
          cell->set_mg_vertex_dof_index (vertex, d, next_free_dof++);
     
@@ -1491,7 +1491,7 @@ MGDoFHandler<3>::distribute_dofs_on_cell (cell_iterator &cell,
                                         // distribute dofs if necessary:
                                         // check whether line dof is already
                                         // numbered (check only first dof)
-       if (line->mg_dof_index(0) == -1)
+       if (line->mg_dof_index(0) == DoFHandler<3>::invalid_dof_index)
                                           // if not: distribute dofs
          for (unsigned int d=0; d<selected_fe->dofs_per_line; ++d)
            line->set_mg_dof_index (d, next_free_dof++);            
@@ -1506,7 +1506,7 @@ MGDoFHandler<3>::distribute_dofs_on_cell (cell_iterator &cell,
                                         // distribute dofs if necessary:
                                         // check whether line dof is already
                                         // numbered (check only first dof)
-       if (quad->mg_dof_index(0) == -1)
+       if (quad->mg_dof_index(0) == DoFHandler<3>::invalid_dof_index)
                                           // if not: distribute dofs
          for (unsigned int d=0; d<selected_fe->dofs_per_line; ++d)
            quad->set_mg_dof_index (d, next_free_dof++);            
@@ -1543,7 +1543,7 @@ unsigned int MGDoFHandler<dim>::n_dofs (const unsigned int level) const {
 
 template <>
 void MGDoFHandler<1>::renumber_dofs (const unsigned int level,
-                                    const vector<int> &new_numbers) {
+                                    const vector<unsigned int> &new_numbers) {
   Assert (new_numbers.size() == n_dofs(level), ExcRenumberingIncomplete());
   
                                   // note that we can not use cell iterators
@@ -1563,10 +1563,10 @@ void MGDoFHandler<1>::renumber_dofs (const unsigned int level,
                      new_numbers[i->get_index (level, d,
                                                selected_fe->dofs_per_vertex)]);
 
-  for (vector<int>::iterator i=mg_levels[level]->line_dofs.begin();
+  for (vector<unsigned int>::iterator i=mg_levels[level]->line_dofs.begin();
        i!=mg_levels[level]->line_dofs.end(); ++i) 
     {
-      Assert (*i != -1, ExcInternalError());
+      Assert (*i != DoFHandler<1>::invalid_dof_index, ExcInternalError());
       *i = new_numbers[*i];
     };
 };
@@ -1580,7 +1580,7 @@ void MGDoFHandler<1>::renumber_dofs (const unsigned int level,
 
 template <>
 void MGDoFHandler<2>::renumber_dofs (const unsigned int  level,
-                                    const vector<int>  &new_numbers) {
+                                    const vector<unsigned int>  &new_numbers) {
   Assert (new_numbers.size() == n_dofs(level), ExcRenumberingIncomplete());
   
   for (vector<MGVertexDoFs>::iterator i=mg_vertex_dofs.begin();
@@ -1594,17 +1594,17 @@ void MGDoFHandler<2>::renumber_dofs (const unsigned int  level,
                      new_numbers[i->get_index (level, d,
                                                selected_fe->dofs_per_vertex)]);
   
-  for (vector<int>::iterator i=mg_levels[level]->line_dofs.begin();
+  for (vector<unsigned int>::iterator i=mg_levels[level]->line_dofs.begin();
        i!=mg_levels[level]->line_dofs.end(); ++i)
     {
-      Assert (*i != -1, ExcInternalError());
+      Assert (*i != DoFHandler<2>::invalid_dof_index, ExcInternalError());
       *i = new_numbers[*i];
     };
 
-  for (vector<int>::iterator i=mg_levels[level]->quad_dofs.begin();
+  for (vector<unsigned int>::iterator i=mg_levels[level]->quad_dofs.begin();
        i!=mg_levels[level]->quad_dofs.end(); ++i)
     {
-      Assert (*i != -1, ExcInternalError());
+      Assert (*i != DoFHandler<2>::invalid_dof_index, ExcInternalError());
       *i = new_numbers[*i];
     };
 };
@@ -1617,7 +1617,7 @@ void MGDoFHandler<2>::renumber_dofs (const unsigned int  level,
 
 template <>
 void MGDoFHandler<3>::renumber_dofs (const unsigned int  level,
-                                    const vector<int>  &new_numbers) {
+                                    const vector<unsigned int>  &new_numbers) {
   Assert (new_numbers.size() == n_dofs(level), ExcRenumberingIncomplete());
   
   for (vector<MGVertexDoFs>::iterator i=mg_vertex_dofs.begin();
@@ -1631,24 +1631,24 @@ void MGDoFHandler<3>::renumber_dofs (const unsigned int  level,
                      new_numbers[i->get_index (level, d,
                                                selected_fe->dofs_per_vertex)]);
   
-  for (vector<int>::iterator i=mg_levels[level]->line_dofs.begin();
+  for (vector<unsigned int>::iterator i=mg_levels[level]->line_dofs.begin();
        i!=mg_levels[level]->line_dofs.end(); ++i)
     {
-      Assert (*i != -1, ExcInternalError());
+      Assert (*i != DoFHandler<3>::invalid_dof_index, ExcInternalError());
       *i = new_numbers[*i];
     };
 
-  for (vector<int>::iterator i=mg_levels[level]->quad_dofs.begin();
+  for (vector<unsigned int>::iterator i=mg_levels[level]->quad_dofs.begin();
        i!=mg_levels[level]->quad_dofs.end(); ++i)
     {
-      Assert (*i != -1, ExcInternalError());
+      Assert (*i != DoFHandler<3>::invalid_dof_index, ExcInternalError());
       *i = new_numbers[*i];
     };
 
-  for (vector<int>::iterator i=mg_levels[level]->hex_dofs.begin();
+  for (vector<unsigned int>::iterator i=mg_levels[level]->hex_dofs.begin();
        i!=mg_levels[level]->hex_dofs.end(); ++i)
     {
-      Assert (*i != -1, ExcInternalError());
+      Assert (*i != DoFHandler<3>::invalid_dof_index, ExcInternalError());
       *i = new_numbers[*i];
     };
 };
@@ -1692,9 +1692,9 @@ void MGDoFHandler<1>::reserve_space () {
     {
       mg_levels.push_back (new DoFLevel<1>);
 
-      mg_levels.back()->line_dofs = vector<int>(tria->levels[i]->lines.lines.size() *
-                                               selected_fe->dofs_per_line,
-                                               -1);
+      mg_levels.back()->line_dofs = vector<unsigned int>(tria->levels[i]->lines.lines.size() *
+                                                        selected_fe->dofs_per_line,
+                                                        DoFHandler<1>::invalid_dof_index);
     };
 
                                   // now allocate space for the
@@ -1778,12 +1778,12 @@ void MGDoFHandler<2>::reserve_space () {
     {
       mg_levels.push_back (new DoFLevel<2>);
 
-      mg_levels.back()->line_dofs = vector<int> (tria->levels[i]->lines.lines.size() *
-                                                selected_fe->dofs_per_line,
-                                                -1);
-      mg_levels.back()->quad_dofs = vector<int> (tria->levels[i]->quads.quads.size() *
-                                                selected_fe->dofs_per_quad,
-                                                -1);
+      mg_levels.back()->line_dofs = vector<unsigned int> (tria->levels[i]->lines.lines.size() *
+                                                         selected_fe->dofs_per_line,
+                                                         DoFHandler<2>::invalid_dof_index);
+      mg_levels.back()->quad_dofs = vector<unsigned int> (tria->levels[i]->quads.quads.size() *
+                                                         selected_fe->dofs_per_quad,
+                                                         DoFHandler<2>::invalid_dof_index);
     };
 
   
@@ -1870,15 +1870,15 @@ void MGDoFHandler<3>::reserve_space () {
     {
       mg_levels.push_back (new DoFLevel<3>);
 
-      mg_levels.back()->line_dofs = vector<int> (tria->levels[i]->lines.lines.size() *
-                                                selected_fe->dofs_per_line,
-                                                -1);
-      mg_levels.back()->quad_dofs = vector<int> (tria->levels[i]->quads.quads.size() *
-                                                selected_fe->dofs_per_quad,
-                                                -1);
-      mg_levels.back()->hex_dofs = vector<int> (tria->levels[i]->hexes.hexes.size() *
-                                               selected_fe->dofs_per_hex,
-                                               -1);
+      mg_levels.back()->line_dofs = vector<unsigned int> (tria->levels[i]->lines.lines.size() *
+                                                         selected_fe->dofs_per_line,
+                                                         DoFHandler<3>::invalid_dof_index);
+      mg_levels.back()->quad_dofs = vector<unsigned int> (tria->levels[i]->quads.quads.size() *
+                                                         selected_fe->dofs_per_quad,
+                                                         DoFHandler<3>::invalid_dof_index);
+      mg_levels.back()->hex_dofs = vector<unsigned int> (tria->levels[i]->hexes.hexes.size() *
+                                                        selected_fe->dofs_per_hex,
+                                                        DoFHandler<3>::invalid_dof_index);
     };
 
   
index 899113d63571e4f721868a5015da88c1db2ffa21..3e16b5da0400cd580ba486d4ac88bafef1df22af 100644 (file)
@@ -20,7 +20,7 @@ void MGDoFTools::make_sparsity_pattern (const MGDoFHandler<dim> &mg_dof_handler,
          ExcDimensionMismatch (sparsity.n_cols(), mg_dof_handler.n_dofs(level)));
 
   const unsigned int dofs_per_cell = mg_dof_handler.get_fe().dofs_per_cell;
-  vector<int> dofs_on_this_cell(dofs_per_cell);
+  vector<unsigned int> dofs_on_this_cell(dofs_per_cell);
   MGDoFHandler<dim>::cell_iterator cell = mg_dof_handler.begin(level),
                                   endc = mg_dof_handler.end(level);
   for (; cell!=endc; ++cell) 
index f2f8bd4e407e17344106033a10c93cb33c0eea21..243c93f2d5d5d5cf206c018e7424fb40978917cf 100644 (file)
@@ -64,11 +64,11 @@ MGSmoother::MGSmoother (const MGDoFHandler<dim> &mg_dof, unsigned int steps)
                                   // to much memory by later copying the
                                   // content of this vector to its final
                                   // destination
-  vector<int> boundary_dofs;
+  vector<unsigned int> boundary_dofs;
 
                                   // temporary to hold the dof indices
                                   // on a face between to levels
-  vector<int> dofs_on_face (mg_dof.get_fe().dofs_per_face);
+  vector<unsigned int> dofs_on_face (mg_dof.get_fe().dofs_per_face);
 
   for (unsigned int level=1; level<n_levels; ++level)
     {
@@ -119,7 +119,7 @@ MGSmoother::set_zero_interior_boundary (const unsigned int  level,
   if (level==0)
     return;
   else
-    for (vector<int>::const_iterator p=interior_boundary_dofs[level-1].begin();
+    for (vector<unsigned int>::const_iterator p=interior_boundary_dofs[level-1].begin();
         p!=interior_boundary_dofs[level-1].end(); ++p)
       u(*p) = 0;
 };
index 99f0ae2bbd616f7f8a1682d0cda56a74c0b8bc86..afa6ad4a780300cdb48b786d88244befee01c20c 100644 (file)
@@ -77,8 +77,8 @@ void MGTransferPrebuilt::build_matrices (const MGDoFHandler<dim> &mg_dof)
                                   // two fields which will store the
                                   // indices of the multigrid dofs
                                   // for a cell and one of its children
-  vector<int> dof_indices_mother (dofs_per_cell);
-  vector<int> dof_indices_child (dofs_per_cell);
+  vector<unsigned int> dof_indices_mother (dofs_per_cell);
+  vector<unsigned int> dof_indices_child (dofs_per_cell);
   
                                   // for each level: first build the sparsity
                                   // pattern of the matrices and then build the
index fa8df868fc75da09fa5895e756f61734c14c741b..d634123407735b78bacd0995050a9823de10234d 100644 (file)
@@ -84,7 +84,7 @@ void Assembler<dim>::assemble (const Equation<dim> &equation) {
 
 
                                   // get indices of dofs
-  vector<int> dofs (n_dofs);
+  vector<unsigned int> dofs (n_dofs);
   get_dof_indices (dofs);
 
                                   // one could use the
index a393d3bd43b979b138d1e89f79f9a56346b5870e..98b0dfb0ea105ece69d11be80b00ada3bab63974 100644 (file)
@@ -125,7 +125,7 @@ void ProblemBase<dim>::assemble (const Equation<dim>      &equation,
 
                                   // apply Dirichlet bc as described
                                   // in the docs
-  map<int, double> boundary_value_list;
+  map<unsigned int, double> boundary_value_list;
 
   for (FunctionMap::const_iterator dirichlet = dirichlet_bc.begin() ;
        dirichlet != dirichlet_bc.end() ; ++dirichlet)
index cf0f8321b60867430504c3a07f1f1f8b6de76ee2..869efa5cf9af455d9a556d21709aa7623e4f14e0 100644 (file)
@@ -1214,7 +1214,7 @@ void DataOut_Old<dim>::write_gmv (ostream &out) const
   DoFHandler<dim>::active_cell_iterator       cell;
   const DoFHandler<dim>::active_cell_iterator endc = dofs->end();
   
-  vector<int> dof_to_vertex_map (dofs->n_dofs(), -1);
+  vector<unsigned int> dof_to_vertex_map (dofs->n_dofs(), DoFHandler<dim>::invalid_dof_index);
   unsigned int used_vertices = 0;
   if (true)
     {
@@ -1225,7 +1225,8 @@ void DataOut_Old<dim>::write_gmv (ostream &out) const
        for (unsigned int vertex=0; vertex<GeometryInfo<dim>::vertices_per_cell; ++vertex)
                                           // check whether we
                                           // already treated this vertex
-         if (dof_to_vertex_map[cell->vertex_dof_index(vertex,0)] == -1)
+         if (dof_to_vertex_map[cell->vertex_dof_index(vertex,0)] ==
+             DoFHandler<dim>::invalid_dof_index)
            {
              vertices[next_free_vertex] = cell->vertex(vertex);
 
index e03d7ee116d1f662c2db9daed98b12bd3b9f0b12..cc740b8155a36887ea11e880ac5796504bb68e0b 100644 (file)
@@ -84,8 +84,8 @@ void MatrixCreator<dim>::create_mass_matrix (const DoFHandler<dim>    &dof,
 
   const unsigned int dofs_per_cell = fe.dofs_per_cell;
   
-  FullMatrix<double>  local_mass_matrix (dofs_per_cell, dofs_per_cell);
-  vector<int>         dofs_on_this_cell (dofs_per_cell);
+  FullMatrix<double>   local_mass_matrix (dofs_per_cell, dofs_per_cell);
+  vector<unsigned int> dofs_on_this_cell (dofs_per_cell);
   
   DoFHandler<dim>::active_cell_iterator cell = dof.begin_active(),
                                        endc = dof.end();
@@ -111,7 +111,7 @@ void MatrixCreator<1>::create_boundary_mass_matrix (const DoFHandler<1>    &,
                                                    SparseMatrix<double>   &,
                                                    const FunctionMap      &,
                                                    Vector<double>         &,
-                                                   vector<int>            &,
+                                                   vector<unsigned int>   &,
                                                    const Function<1>      *) {
   Assert (false, ExcNotImplemented());
 };
@@ -126,7 +126,7 @@ void MatrixCreator<dim>::create_boundary_mass_matrix (const DoFHandler<dim>    &
                                                      SparseMatrix<double>     &matrix,
                                                      const FunctionMap        &rhs,
                                                      Vector<double>           &rhs_vector,
-                                                     vector<int>              &dof_to_boundary_mapping,
+                                                     vector<unsigned int>     &dof_to_boundary_mapping,
                                                      const Function<dim>      *a) {
   const FiniteElement<dim> &fe = dof.get_fe();
   const unsigned int n_components  = fe.n_components();
@@ -137,12 +137,22 @@ void MatrixCreator<dim>::create_boundary_mass_matrix (const DoFHandler<dim>    &
   Assert (matrix.n() == rhs_vector.size(), ExcInternalError());
   Assert (rhs.size() != 0, ExcInternalError());
   Assert (dof.get_fe() == fe, ExcInternalError());
-  Assert (dof_to_boundary_mapping.size() == dof.n_dofs(), ExcInternalError());
-  Assert (*max_element(dof_to_boundary_mapping.begin(),dof_to_boundary_mapping.end()) ==
-         (signed int)matrix.n()-1,
+  Assert (dof_to_boundary_mapping.size() == dof.n_dofs(),
          ExcInternalError());
   Assert (n_components == rhs.begin()->second->n_components,
          ExcComponentMismatch());
+#ifdef DEBUG
+  if (true)
+    {
+      unsigned int max_element = 0;
+      for (vector<unsigned int>::const_iterator i=dof_to_boundary_mapping.begin();
+          i!=dof_to_boundary_mapping.end(); ++i)
+       if ((*i != DoFHandler<dim>::invalid_dof_index) &&
+           (*i > max_element))
+         max_element = *i;
+      Assert (max_element  == matrix.n()-1, ExcInternalError());
+    };
+#endif
   
   const unsigned int dofs_per_cell = fe.dofs_per_cell,
                     dofs_per_face = fe.dofs_per_face;
@@ -167,8 +177,8 @@ void MatrixCreator<dim>::create_boundary_mass_matrix (const DoFHandler<dim>    &
   vector<Vector<double> > rhs_values_system (fe_values.n_quadrature_points,
                                             Vector<double>(n_components));
 
-  vector<int> dofs (dofs_per_cell);
-  vector<int> dofs_on_face_vector (dofs_per_face);
+  vector<unsigned int> dofs (dofs_per_cell);
+  vector<unsigned int> dofs_on_face_vector (dofs_per_face);
   set<int> dofs_on_face;
 
   DoFHandler<dim>::active_cell_iterator cell = dof.begin_active (),
@@ -491,7 +501,7 @@ void MatrixCreator<dim>::create_laplace_matrix (const DoFHandler<dim>    &dof,
 
 
 template <int dim>
-void MatrixTools<dim>::apply_boundary_values (const map<int,double> &boundary_values,
+void MatrixTools<dim>::apply_boundary_values (const map<unsigned int,double> &boundary_values,
                                              SparseMatrix<double>  &matrix,
                                              Vector<double>   &solution,
                                              Vector<double>   &right_hand_side) {
@@ -507,8 +517,8 @@ void MatrixTools<dim>::apply_boundary_values (const map<int,double> &boundary_va
     return;
   
   
-  map<int,double>::const_iterator  dof  = boundary_values.begin(),
-                                  endd = boundary_values.end();
+  map<unsigned int,double>::const_iterator  dof  = boundary_values.begin(),
+                                           endd = boundary_values.end();
   const unsigned int n_dofs             = matrix.m();
   const SparsityPattern    &sparsity    = matrix.get_sparsity_pattern();
   const unsigned int *sparsity_rowstart = sparsity.get_rowstart_indices();
@@ -516,9 +526,9 @@ void MatrixTools<dim>::apply_boundary_values (const map<int,double> &boundary_va
 
   for (; dof != endd; ++dof)
     {
-      Assert (dof->first >= 0, ExcInternalError());
+      Assert (dof->first <= n_dofs, ExcInternalError());
       
-      const unsigned int dof_number = static_cast<unsigned int>(dof->first);
+      const unsigned int dof_number = dof->first;
                                       // for each boundary dof:
       
                                       // set entries of this line
index 09a10eadc4460c139bcba09e33bc8c835a764e49..db66f5519ccaf10ad4e419210983badbd46e9aef 100644 (file)
@@ -58,8 +58,8 @@ void SolutionTransfer<dim, number>::prepare_for_pure_refinement()
   const unsigned int dofs_per_cell  = dof_handler->get_fe().dofs_per_cell;
   n_dofs_old=dof_handler->n_dofs();
 
-  indices_on_cell=vector<vector<int> > (n_active_cells,
-                                       vector<int> (dofs_per_cell));
+  indices_on_cell=vector<vector<unsigned int> > (n_active_cells,
+                                                vector<unsigned int> (dofs_per_cell));
 
   DoFHandler<dim>::cell_iterator cell = dof_handler->begin(),
                                 endc = dof_handler->end();
@@ -104,7 +104,7 @@ SolutionTransfer<dim, number>::refine_interpolate(const Vector<number> &in,
   DoFHandler<dim>::cell_iterator cell = dof_handler->begin(),
                                 endc = dof_handler->end();
 
-  vector<int> *indexptr;  
+  vector<unsigned int> *indexptr;  
 
   for (; cell!=endc; ++cell) 
     {
@@ -116,7 +116,7 @@ SolutionTransfer<dim, number>::refine_interpolate(const Vector<number> &in,
                                         // which is both done by one
                                         // function
        {
-         indexptr=static_cast<vector<int> *>(cell->user_pointer());
+         indexptr=static_cast<vector<unsigned int> *>(cell->user_pointer());
          for (unsigned int i=0; i<dofs_per_cell; ++i)
            local_values(i)=in(indexptr->operator[](i));
          cell->set_dof_values_by_interpolation(local_values, out);
@@ -188,8 +188,8 @@ prepare_for_coarsening_and_refinement(const vector<Vector<number> > &all_in)
                                         GeometryInfo<dim>::children_per_cell;
 
                                   // allocate the needed memory
-  indices_on_cell    = vector<vector<int> > (n_cells_to_stay_or_refine,
-                                           vector<int> (dofs_per_cell));
+  indices_on_cell    = vector<vector<unsigned int> > (n_cells_to_stay_or_refine,
+                                                     vector<unsigned int> (dofs_per_cell));
   dof_values_on_cell
     = vector<vector<Vector<number> > > (n_coarsen_fathers,
                                        vector<Vector<number> > (in_size,
@@ -294,10 +294,10 @@ interpolate (const vector<Vector<number> > &all_in,
   const unsigned int dofs_per_cell=dof_handler->get_fe().dofs_per_cell;  
   Vector<number> local_values(dofs_per_cell);
 
-  vector<int>             *indexptr;
+  vector<unsigned int>    *indexptr;
   Pointerstruct           *structptr;
   vector<Vector<number> > *valuesptr;
-  vector<int>              dofs(dofs_per_cell);
+  vector<unsigned int>     dofs(dofs_per_cell);
 
   DoFHandler<dim>::cell_iterator cell = dof_handler->begin(),
                                 endc = dof_handler->end();
index ae03cc021682a05a27f26a7308c9c77dad97b702..54ce1406806e83a284459d0b3af7587e8d3ff3fe 100644 (file)
@@ -99,8 +99,8 @@ void VectorTools::interpolate (const DoFHandler<dim> &dof,
 //     }
 //    };
 
-//   vector<int>         dofs_on_cell (fe.dofs_per_cell);
-//   vector<Point<dim> > support_points (fe.dofs_per_cell);
+//   vector<unsigned int> dofs_on_cell (fe.dofs_per_cell);
+//   vector<Point<dim> >  support_points (fe.dofs_per_cell);
 
 //   vector<Point<dim> > rep_points (n_rep_points);
 //   vector<Vector<double> > function_values_at_rep_points (
@@ -206,10 +206,10 @@ void VectorTools::interpolate (const DoFHandler<dim> &dof,
   Assert(dofs_of_rep_points.size()==n_rep_points, ExcInternalError());
   Assert(dof_to_rep_index_table.size()==fe.dofs_per_cell, ExcInternalError());
 
-  vector<int>         dofs_on_cell (fe.dofs_per_cell);
-  vector<Point<dim> > support_points (fe.dofs_per_cell);
+  vector<unsigned int> dofs_on_cell (fe.dofs_per_cell);
+  vector<Point<dim> >  support_points (fe.dofs_per_cell);
 
-  vector<Point<dim> > rep_points (n_rep_points);
+  vector<Point<dim> >  rep_points (n_rep_points);
 
                                   // get space for the values of the
                                   // function at the rep support points.
@@ -285,8 +285,8 @@ VectorTools::interpolate (const DoFHandler<dim>           &dof_1,
   Vector<double> cell_data_1(dof_1.get_fe().dofs_per_cell);
   Vector<double> cell_data_2(dof_2.get_fe().dofs_per_cell);
 
-  vector <short unsigned int> touch_count (dof_2.n_dofs(), 0);
-  vector <int> local_dof_indices (dof_2.get_fe().dofs_per_cell);
+  vector<short unsigned int> touch_count (dof_2.n_dofs(), 0);
+  vector<unsigned int>       local_dof_indices (dof_2.get_fe().dofs_per_cell);
   
   DoFHandler<dim>::active_cell_iterator h = dof_1.begin_active();
   DoFHandler<dim>::active_cell_iterator l = dof_2.begin_active();
@@ -367,7 +367,7 @@ void VectorTools::project (const DoFHandler<dim>    &dof,
   const FiniteElement<dim> &fe = dof.get_fe();
 
                                   // make up boundary values
-  map<int,double> boundary_values;
+  map<unsigned int,double> boundary_values;
 
   if (enforce_zero_boundary == true) 
                                     // no need to project boundary values, but
@@ -376,7 +376,7 @@ void VectorTools::project (const DoFHandler<dim>    &dof,
     {
       DoFHandler<dim>::active_face_iterator face = dof.begin_active_face(),
                                            endf = dof.end_face();
-      vector<int> face_dof_indices (fe.dofs_per_face);
+      vector<unsigned int> face_dof_indices (fe.dofs_per_face);
       for (; face!=endf; ++face)
        if (face->at_boundary())
          {
@@ -494,11 +494,11 @@ void VectorTools::create_right_hand_side (const DoFHandler<dim>    &dof,
 
 template <>
 void
-VectorTools::interpolate_boundary_values (const DoFHandler<1> &dof,
-                                         const unsigned char  boundary_component,
-                                         const Function<1>   &boundary_function,
-                                         map<int,double>     &boundary_values,
-                                         const vector<bool>  &component_mask_)
+VectorTools::interpolate_boundary_values (const DoFHandler<1>      &dof,
+                                         const unsigned char       boundary_component,
+                                         const Function<1>        &boundary_function,
+                                         map<unsigned int,double> &boundary_values,
+                                         const vector<bool>       &component_mask_)
 {
   Assert (boundary_component != 255,
          ExcInvalidBoundaryIndicator());
@@ -577,11 +577,11 @@ VectorTools::interpolate_boundary_values (const DoFHandler<1> &dof,
 
 template <int dim>
 void
-VectorTools::interpolate_boundary_values (const DoFHandler<dim> &dof,
-                                         const unsigned char    boundary_component,
-                                         const Function<dim>   &boundary_function,
-                                         map<int,double>       &boundary_values,
-                                         const vector<bool>    &component_mask_)
+VectorTools::interpolate_boundary_values (const DoFHandler<dim>    &dof,
+                                         const unsigned char       boundary_component,
+                                         const Function<dim>      &boundary_function,
+                                         map<unsigned int,double> &boundary_values,
+                                         const vector<bool>       &component_mask_)
 {
   Assert (boundary_component != 255,
          ExcInvalidBoundaryIndicator());
@@ -603,8 +603,8 @@ VectorTools::interpolate_boundary_values (const DoFHandler<dim> &dof,
          ExcComponentMismatch());
 
                                   // field to store the indices of dofs
-  vector<int>         face_dofs (fe.dofs_per_face, -1);
-  vector<Point<dim> > dof_locations (face_dofs.size(), Point<dim>());
+  vector<unsigned int> face_dofs (fe.dofs_per_face, -1);
+  vector<Point<dim> >  dof_locations (face_dofs.size(), Point<dim>());
                                   // array to store the values of
                                   // the boundary function at the
                                   // boundary points. have to arrays
@@ -663,12 +663,12 @@ void
 VectorTools::project_boundary_values (const DoFHandler<dim>    &dof,
                                      const map<unsigned char,const Function<dim>*>        &boundary_functions,
                                      const Quadrature<dim-1>  &q,
-                                     map<int,double>          &boundary_values)
+                                     map<unsigned int,double> &boundary_values)
 {
   Assert (dof.get_fe().n_components() == boundary_functions.begin()->second->n_components,
          ExcComponentMismatch());
   
-  vector<int>    dof_to_boundary_mapping;
+  vector<unsigned int> dof_to_boundary_mapping;
   dof.map_dof_to_boundary_indices (boundary_functions, dof_to_boundary_mapping);
   
                                   // set up sparsity structure
@@ -728,7 +728,7 @@ VectorTools::project_boundary_values (const DoFHandler<dim>    &dof,
 
                                   // fill in boundary values
   for (unsigned int i=0; i<dof_to_boundary_mapping.size(); ++i)
-    if (dof_to_boundary_mapping[i] != -1)
+    if (dof_to_boundary_mapping[i] != DoFHandler<dim>::invalid_dof_index)
                                       // this dof is on one of the
                                       // interesting boundary parts
                                       //
@@ -992,7 +992,7 @@ template
 void VectorTools::project_boundary_values (const DoFHandler<deal_II_dimension>  &,
                                           const map<unsigned char,const Function<deal_II_dimension>*>&,
                                           const Quadrature<deal_II_dimension-1>&,
-                                          map<int,double>        &);
+                                          map<unsigned int,double>        &);
 
 template
 void VectorTools::create_right_hand_side (const DoFHandler<deal_II_dimension> &,
@@ -1017,7 +1017,7 @@ template
 void VectorTools::interpolate_boundary_values (const DoFHandler<deal_II_dimension> &,
                                               const unsigned char,
                                               const Function<deal_II_dimension>   &,
-                                              map<int,double>       &,
+                                              map<unsigned int,double>       &,
                                               const vector<bool>    &);
 template
 void VectorTools::project (const DoFHandler<deal_II_dimension>   &,
index 448bae97f8fbda25e9c0b40b83be2e93c01afdb9..990d8e46a434e6ca74f1709ea5a265e49ffcf4ba 100644 (file)
@@ -387,8 +387,8 @@ void LaplaceProblem::assemble_system ()
                                   // `dofs_per_cell' and `n_q_points'
                                   // are more or less standard names
                                   // for these purposes.
-  const unsigned int dofs_per_cell = fe.dofs_per_cell;
-  const unsigned int n_q_points    = quadrature_formula.n_quadrature_points;
+  const unsigned int   dofs_per_cell = fe.dofs_per_cell;
+  const unsigned int   n_q_points    = quadrature_formula.n_quadrature_points;
 
                                   // Now, we said that we wanted to
                                   // assemble the global matrix and
@@ -408,8 +408,8 @@ void LaplaceProblem::assemble_system ()
                                   // for the right hand side vector,
                                   // although access times are not so
                                   // problematic for them.
-  FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
-  Vector<double>     cell_rhs (dofs_per_cell);
+  FullMatrix<double>   cell_matrix (dofs_per_cell, dofs_per_cell);
+  Vector<double>       cell_rhs (dofs_per_cell);
 
                                   // When assembling the
                                   // contributions of each cell, we
@@ -424,7 +424,7 @@ void LaplaceProblem::assemble_system ()
                                   // degrees of freedom. When we get
                                   // them, we need a scratch array
                                   // for these numbers:
-  vector<int>        local_dof_indices (dofs_per_cell);
+  vector<unsigned int> local_dof_indices (dofs_per_cell);
 
                                   // Now for th loop over all
                                   // cells. You have seen before how
@@ -638,7 +638,7 @@ void LaplaceProblem::assemble_system ()
                                   // mapping of DoF numbers to
                                   // boundary values is done by the
                                   // `map' class.
-  map<int,double> boundary_values;
+  map<unsigned int,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
                                            0,
                                            ZeroFunction<2>(),
index 805feb5f533bf1eec706660da21055da8f246d58..bac38005541d09965e325d5293c681524132e3c7 100644 (file)
@@ -352,13 +352,13 @@ void LaplaceProblem<dim>::assemble_system ()
                                   // all the necessary work for you
                                   // and you don't have to care about
                                   // the dimension dependent parts:
-  const unsigned int dofs_per_cell = fe.dofs_per_cell;
-  const unsigned int n_q_points    = quadrature_formula.n_quadrature_points;
+  const unsigned int   dofs_per_cell = fe.dofs_per_cell;
+  const unsigned int   n_q_points    = quadrature_formula.n_quadrature_points;
 
-  FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
-  Vector<double>     cell_rhs (dofs_per_cell);
+  FullMatrix<double>   cell_matrix (dofs_per_cell, dofs_per_cell);
+  Vector<double>       cell_rhs (dofs_per_cell);
 
-  vector<int>        local_dof_indices (dofs_per_cell);
+  vector<unsigned int> local_dof_indices (dofs_per_cell);
 
                                   // Note here, that a cell is a
                                   // quadrilateral in two space
@@ -446,7 +446,7 @@ void LaplaceProblem<dim>::assemble_system ()
                                   // would like to use (i.e. the
                                   // BoundaryValues class declared
                                   // above):
-  map<int,double> boundary_values;
+  map<unsigned int,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
                                            0,
                                            BoundaryValues<dim>(),
index 4f389ee25744a0b49a5fde2575230006cfc39b6f..3584831dd5f7355fa300b65065a99b1d22671f57 100644 (file)
@@ -335,13 +335,13 @@ void LaplaceProblem<dim>::assemble_system ()
                                       update_q_points  |
                                       update_JxW_values));
 
-  const unsigned int dofs_per_cell = fe.dofs_per_cell;
-  const unsigned int n_q_points    = quadrature_formula.n_quadrature_points;
+  const unsigned int   dofs_per_cell = fe.dofs_per_cell;
+  const unsigned int   n_q_points    = quadrature_formula.n_quadrature_points;
 
-  FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
-  Vector<double>     cell_rhs (dofs_per_cell);
+  FullMatrix<double>   cell_matrix (dofs_per_cell, dofs_per_cell);
+  Vector<double>       cell_rhs (dofs_per_cell);
 
-  vector<int>        local_dof_indices (dofs_per_cell);
+  vector<unsigned int> local_dof_indices (dofs_per_cell);
 
                                   // Below, we will ask the
                                   // Coefficient class to compute the
@@ -558,7 +558,7 @@ void LaplaceProblem<dim>::assemble_system ()
     };
 
                                   // Again use zero boundary values:
-  map<int,double> boundary_values;
+  map<unsigned int,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
                                            0,
                                            ZeroFunction<dim>(),
index 2f33358c239c267a6f7f0eb3475b7ea4648b0fa4..0629bdc820f8e02342080ea36fdba799f555199d 100644 (file)
@@ -449,15 +449,15 @@ void LaplaceProblem<dim>::assemble_system ()
                                   // per cell before: the following
                                   // value will be set to 9 (in 2D)
                                   // now, where it was 4 before.
-  const unsigned int dofs_per_cell = fe.dofs_per_cell;
-  const unsigned int n_q_points    = quadrature_formula.n_quadrature_points;
+  const unsigned int   dofs_per_cell = fe.dofs_per_cell;
+  const unsigned int   n_q_points    = quadrature_formula.n_quadrature_points;
 
-  FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
-  Vector<double>     cell_rhs (dofs_per_cell);
+  FullMatrix<double>   cell_matrix (dofs_per_cell, dofs_per_cell);
+  Vector<double>       cell_rhs (dofs_per_cell);
 
-  vector<int>        local_dof_indices (dofs_per_cell);
+  vector<unsigned int> local_dof_indices (dofs_per_cell);
 
-  vector<double>     coefficient_values (n_q_points);
+  vector<double>       coefficient_values (n_q_points);
 
                                   // We can now go on with assembling
                                   // the matrix and right hand
@@ -554,7 +554,7 @@ void LaplaceProblem<dim>::assemble_system ()
                                   // from the system of equations
                                   // happens *after* the elimination
                                   // of hanging nodes.
-  map<int,double> boundary_values;
+  map<unsigned int,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
                                            0,
                                            ZeroFunction<dim>(),
index c14b80d9ffddd6f5d8acf282163a9c71234925dc..0caa12938f6e8b5e127ee82ffd02a9f95fead1dd 100644 (file)
@@ -230,16 +230,16 @@ void LaplaceProblem<dim>::assemble_system ()
                                       update_q_points  |
                                       update_JxW_values));
 
-  const unsigned int dofs_per_cell = fe->dofs_per_cell;
-  const unsigned int n_q_points    = quadrature_formula.n_quadrature_points;
+  const unsigned int   dofs_per_cell = fe->dofs_per_cell;
+  const unsigned int   n_q_points    = quadrature_formula.n_quadrature_points;
 
-  RightHandSide<dim> right_hand_side;
-  vector<double>     rhs_values (n_q_points);
+  RightHandSide<dim>   right_hand_side;
+  vector<double>       rhs_values (n_q_points);
 
-  FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
-  Vector<double>     cell_rhs (dofs_per_cell);
+  FullMatrix<double>   cell_matrix (dofs_per_cell, dofs_per_cell);
+  Vector<double>       cell_rhs (dofs_per_cell);
 
-  vector<int>        local_dof_indices (dofs_per_cell);
+  vector<unsigned int> local_dof_indices (dofs_per_cell);
 
   DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active(),
                                        endc = dof_handler.end();
@@ -289,7 +289,7 @@ void LaplaceProblem<dim>::assemble_system ()
   hanging_node_constraints.condense (system_matrix);
   hanging_node_constraints.condense (system_rhs);
 
-  map<int,double> boundary_values;
+  map<unsigned int,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
                                            0,
                                            Solution<dim>(),
index 5b03e6e1e3151016895a0322a86dc92699c7fcc3..51f6741f93922f245e32d2a66d82d1079879befa 100644 (file)
@@ -453,13 +453,13 @@ void ElasticProblem<dim>::assemble_system ()
                                   // degrees of freedom per cell of
                                   // the Q1 element, but this is not
                                   // something we need to care about.
-  const unsigned int dofs_per_cell = fe.dofs_per_cell;
-  const unsigned int n_q_points    = quadrature_formula.n_quadrature_points;
+  const unsigned int   dofs_per_cell = fe.dofs_per_cell;
+  const unsigned int   n_q_points    = quadrature_formula.n_quadrature_points;
 
-  FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
-  Vector<double>     cell_rhs (dofs_per_cell);
+  FullMatrix<double>   cell_matrix (dofs_per_cell, dofs_per_cell);
+  Vector<double>       cell_rhs (dofs_per_cell);
 
-  vector<int>        local_dof_indices (dofs_per_cell);
+  vector<unsigned int> local_dof_indices (dofs_per_cell);
 
                                   // As was shown in previous
                                   // examples as well, we need a
@@ -729,7 +729,7 @@ void ElasticProblem<dim>::assemble_system ()
                                   // we need to pass ``dim'' as
                                   // number of components to the zero
                                   // function as well.
-  map<int,double> boundary_values;
+  map<unsigned int,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
                                            0,
                                            ZeroFunction<dim>(dim),
index 77691684719d5f0ddd1f9edba528c43229c7454e..ceed517aeaf964d076fa496d81cdb94fabc02b07 100644 (file)
@@ -232,16 +232,16 @@ void LaplaceProblem<dim>::assemble_system ()
                                       update_q_points  |
                                       update_JxW_values));
 
-  const unsigned int dofs_per_cell = fe.dofs_per_cell;
-  const unsigned int n_q_points    = quadrature_formula.n_quadrature_points;
+  const unsigned int   dofs_per_cell = fe.dofs_per_cell;
+  const unsigned int   n_q_points    = quadrature_formula.n_quadrature_points;
 
-  FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
-  Vector<double>     cell_rhs (dofs_per_cell);
+  FullMatrix<double>   cell_matrix (dofs_per_cell, dofs_per_cell);
+  Vector<double>       cell_rhs (dofs_per_cell);
 
-  vector<int>        local_dof_indices (dofs_per_cell);
+  vector<unsigned int> local_dof_indices (dofs_per_cell);
 
                                   // FIX
-  vector<double>     coefficient_values (n_q_points, 1.0);
+  vector<double>       coefficient_values (n_q_points, 1.0);
 
                                   // not only active cells
   MGDoFHandler<dim>::cell_iterator cell = mg_dof_handler.begin(),
@@ -309,7 +309,7 @@ void LaplaceProblem<dim>::assemble_system ()
   hanging_node_constraints.condense (global_system_matrix);
   hanging_node_constraints.condense (system_rhs);
 
-//    map<int,double> boundary_values;
+//    map<unsigned int,double> boundary_values;
 //    VectorTools::interpolate_boundary_values (mg_dof_handler,
 //                                         0,
 //                                         ZeroFunction<dim>(),
index 3f09e4f11d6240363901bd7b71486df6499b2503..157e1810b0b9e903d525ff1d47138733e351af89 100644 (file)
@@ -15,7 +15,7 @@ Helmholtz::build_all(MATRIX& A,
   
   Vector<double> elvec(fe_dofs);
   FullMatrix<double> elmat(fe_dofs);
-  vector<int> indices(fe_dofs);
+  vector<unsigned int> indices(fe_dofs);
 
 ////////////////////////////////////////////////////
 // Loop for computing the element matrices
index 448797987733e07fda1f097323ff63a7e0be45e9..4f56eaec1de59b7de1967281399e083cc2d053e6 100644 (file)
@@ -13,7 +13,7 @@ Helmholtz::build_mgmatrix(MGLevelObject<MATRIX>& A,
   
   Vector<double> elvec(fe_dofs);
   FullMatrix<double> elmat(fe_dofs);
-  vector<int> indices(fe_dofs);
+  vector<unsigned int> indices(fe_dofs);
 
 ////////////////////////////////////////////////////
 // Loop for computing the element matrices
index 4d8c768d5043b715b159c8655350abba0880613c..b1bb101af8da2f5ef83fca264d2b9e16a15ab5e7 100644 (file)
@@ -2137,7 +2137,7 @@ void EndEnergy<dim>::compute_vectors (const PartOfDomain pod,
   vector<double> density_values(quadrature->n_quadrature_points);
   vector<double> stiffness_values(quadrature->n_quadrature_points);
 
-  vector<int> cell_dof_indices (dofs_per_cell);
+  vector<unsigned int> cell_dof_indices (dofs_per_cell);
 
   for (; cell!=endc; ++cell, ++primal_cell)
     {
@@ -2264,7 +2264,7 @@ void SeismicSignal<dim>::compute_functionals (Vector<double> &j1,
   cell = dof->begin_active();
   endc = dof->end();
 
-  vector<int> cell_dof_indices (dofs_per_cell);
+  vector<unsigned int> cell_dof_indices (dofs_per_cell);
 
   FEFaceValues<dim> fe_face_values (*fe, *quadrature_face,
                                    UpdateFlags(update_values         |
@@ -2334,7 +2334,7 @@ void EarthSurface<dim>::compute_functionals (Vector<double> &j1,
   cell = dof->begin_active();
   endc = dof->end();
 
-  vector<int> face_dof_indices (face_dofs);
+  vector<unsigned int> face_dof_indices (face_dofs);
 
   for (; cell!=endc; ++cell)
     for (unsigned int face_no=0; face_no<GeometryInfo<dim>::faces_per_cell;
@@ -2398,7 +2398,7 @@ void SplitSignal<dim>::compute_functionals (Vector<double> &j1,
   cell = dof->begin_active();
   endc = dof->end();
 
-  vector<int> dof_indices (fe->dofs_per_cell);
+  vector<unsigned int> dof_indices (fe->dofs_per_cell);
   FEFaceValues<dim> fe_face_values (*fe, *quadrature_face, UpdateFlags(update_values | update_JxW_values));
   
   for (; cell!=endc; ++cell)
@@ -2468,7 +2468,7 @@ void SplitLine<1>::compute_endtime_vectors (Vector<double> &final_u_bar,
                                        endc = dof->end ();
 
   FEValues<dim> fe_values (*fe, *quadrature, UpdateFlags(update_values | update_JxW_values));
-  vector<int> cell_dof_indices (dofs_per_cell);
+  vector<unsigned int> cell_dof_indices (dofs_per_cell);
 
   for (; cell!=endc; ++cell)
     {
@@ -2518,7 +2518,7 @@ void OneBranch1d<dim>::compute_functionals (Vector<double> &j1,
   cell = dof->begin_active();
   endc = dof->end();
 
-  vector<int> dof_indices (fe->dofs_per_cell);
+  vector<unsigned int> dof_indices (fe->dofs_per_cell);
   FEValues<dim> fe_values (*fe, *quadrature, UpdateFlags(update_values | update_JxW_values));
   
   for (; cell!=endc; ++cell)
@@ -2567,7 +2567,7 @@ void SecondCrossing<dim>::compute_functionals (Vector<double> &j1,
   cell = dof->begin_active();
   endc = dof->end();
 
-  vector<int> dof_indices (fe->dofs_per_cell);
+  vector<unsigned int> dof_indices (fe->dofs_per_cell);
   FEValues<dim> fe_values (*fe, *quadrature, UpdateFlags(update_values | update_JxW_values));
   
   for (; cell!=endc; ++cell)
@@ -5533,7 +5533,7 @@ void TimeStep_Wave<dim>::create_matrices ()
 
                                   // indices of all the dofs on this
                                   // cell
-  vector<int>    dof_indices_on_cell (dofs_per_cell);
+  vector<unsigned int>    dof_indices_on_cell (dofs_per_cell);
   FullMatrix<double> cell_mass_matrix (dofs_per_cell, dofs_per_cell);
   FullMatrix<double> cell_laplace_matrix (dofs_per_cell, dofs_per_cell);
 
@@ -5928,7 +5928,7 @@ void TimeStep_Dual<dim>::do_timestep ()
                                   // zero. we re-use them later, and because
                                   // zero is such a universal constant, we
                                   // don't even need to recompute the values!
-  map<int,double> boundary_value_list;
+  map<unsigned int,double> boundary_value_list;
   if (dim != 1)
     {
       static const ZeroFunction<dim> boundary_values;
@@ -6210,7 +6210,7 @@ TimeStep_Dual<dim>::build_rhs (const DoFHandler<dim>::cell_iterator &old_cell,
 
                                       // transfer into the global
                                       // right hand side
-      vector<int> new_dof_indices (dofs_per_cell, -1);
+      vector<unsigned int> new_dof_indices (dofs_per_cell, DoFHandler<dim>::invalid_dof_index);
       new_cell->get_dof_indices (new_dof_indices);
       for (unsigned int i=0; i<dofs_per_cell; ++i)
        {
@@ -6245,7 +6245,7 @@ TimeStep_Dual<dim>::build_rhs (const DoFHandler<dim>::cell_iterator &old_cell,
       
                                       // transfer into the global
                                       // right hand side
-      vector<int> new_dof_indices (dofs_per_cell);
+      vector<unsigned int> new_dof_indices (dofs_per_cell);
       new_cell->get_dof_indices (new_dof_indices);
       for (unsigned int i=0; i<dofs_per_cell; ++i) 
        {
@@ -6461,7 +6461,7 @@ TimeStep_Dual<dim>::distribute_to_children (const DoFHandler<dim>::cell_iterator
            
                                   // indices of the dofs of a cell on
                                   // the new grid
-  vector<int> new_dof_indices (dofs_per_cell, -1);
+  vector<unsigned int> new_dof_indices (dofs_per_cell, DoFHandler<dim>::invalid_dof_index);
 
       
                                       // loop over the child cells
@@ -8263,7 +8263,7 @@ void TimeStep_Primal<dim>::do_timestep ()
       parameters.boundary_values_u->set_time (time);
       parameters.boundary_values_v->set_time (time);
       
-      map<int,double> boundary_value_list;
+      map<unsigned int,double> boundary_value_list;
       VectorTools::interpolate_boundary_values (*dof_handler, 0,
                                                     *(parameters.boundary_values_u),
                                                     boundary_value_list);
@@ -8289,7 +8289,7 @@ void TimeStep_Primal<dim>::do_timestep ()
                                   // at all
   if (dim != 1)
     {
-      map<int,double> boundary_value_list;
+      map<unsigned int,double> boundary_value_list;
       VectorTools::interpolate_boundary_values (*dof_handler, 0,
                                                     *(parameters.boundary_values_v),
                                                     boundary_value_list);
@@ -8535,7 +8535,7 @@ TimeStep_Primal<dim>::build_rhs (const DoFHandler<dim>::cell_iterator &old_cell,
 
                                       // transfer into the global
                                       // right hand side
-      vector<int> new_dof_indices (dofs_per_cell, -1);
+      vector<unsigned int> new_dof_indices (dofs_per_cell, DoFHandler<dim>::invalid_dof_index);
       new_cell->get_dof_indices (new_dof_indices);
       for (unsigned int i=0; i<dofs_per_cell; ++i)
        {
@@ -8571,7 +8571,7 @@ TimeStep_Primal<dim>::build_rhs (const DoFHandler<dim>::cell_iterator &old_cell,
 
                                       // transfer into the global
                                       // right hand side
-      vector<int> new_dof_indices (dofs_per_cell);
+      vector<unsigned int> new_dof_indices (dofs_per_cell);
       new_cell->get_dof_indices (new_dof_indices);
       for (unsigned int i=0; i<dofs_per_cell; ++i) 
        {
@@ -8791,7 +8791,7 @@ TimeStep_Primal<dim>::distribute_to_children (const DoFHandler<dim>::cell_iterat
            
                                   // indices of the dofs of a cell on
                                   // the new grid
-  vector<int> new_dof_indices (dofs_per_cell, -1);
+  vector<unsigned int> new_dof_indices (dofs_per_cell, DoFHandler<dim>::invalid_dof_index);
 
       
                                       // loop over the child cells

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.