From: wolf Date: Fri, 11 Feb 2000 09:50:48 +0000 (+0000) Subject: Make DoF numbers unsigned integers. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0f4d9ffe6826511ec8cda32d155dd7f7fc83f855;p=dealii-svn.git Make DoF numbers unsigned integers. git-svn-id: https://svn.dealii.org/trunk@2383 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/Attic/examples/multigrid/multigrid.cc b/deal.II/deal.II/Attic/examples/multigrid/multigrid.cc index 7769168471..ceed517aea 100644 --- a/deal.II/deal.II/Attic/examples/multigrid/multigrid.cc +++ b/deal.II/deal.II/Attic/examples/multigrid/multigrid.cc @@ -232,16 +232,16 @@ void LaplaceProblem::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 cell_matrix (dofs_per_cell, dofs_per_cell); - Vector cell_rhs (dofs_per_cell); + FullMatrix cell_matrix (dofs_per_cell, dofs_per_cell); + Vector cell_rhs (dofs_per_cell); - vector local_dof_indices (dofs_per_cell); + vector local_dof_indices (dofs_per_cell); // FIX - vector coefficient_values (n_q_points, 1.0); + vector coefficient_values (n_q_points, 1.0); // not only active cells MGDoFHandler::cell_iterator cell = mg_dof_handler.begin(), @@ -309,7 +309,7 @@ void LaplaceProblem::assemble_system () hanging_node_constraints.condense (global_system_matrix); hanging_node_constraints.condense (system_rhs); -// map boundary_values; +// map boundary_values; // VectorTools::interpolate_boundary_values (mg_dof_handler, // 0, // ZeroFunction(), diff --git a/deal.II/deal.II/Attic/examples/step-by-step/step-3/step-3.cc b/deal.II/deal.II/Attic/examples/step-by-step/step-3/step-3.cc index 448bae97f8..990d8e46a4 100644 --- a/deal.II/deal.II/Attic/examples/step-by-step/step-3/step-3.cc +++ b/deal.II/deal.II/Attic/examples/step-by-step/step-3/step-3.cc @@ -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 cell_matrix (dofs_per_cell, dofs_per_cell); - Vector cell_rhs (dofs_per_cell); + FullMatrix cell_matrix (dofs_per_cell, dofs_per_cell); + Vector 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 local_dof_indices (dofs_per_cell); + vector 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 boundary_values; + map boundary_values; VectorTools::interpolate_boundary_values (dof_handler, 0, ZeroFunction<2>(), diff --git a/deal.II/deal.II/Attic/examples/step-by-step/step-4/step-4.cc b/deal.II/deal.II/Attic/examples/step-by-step/step-4/step-4.cc index 805feb5f53..bac3800554 100644 --- a/deal.II/deal.II/Attic/examples/step-by-step/step-4/step-4.cc +++ b/deal.II/deal.II/Attic/examples/step-by-step/step-4/step-4.cc @@ -352,13 +352,13 @@ void LaplaceProblem::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 cell_matrix (dofs_per_cell, dofs_per_cell); - Vector cell_rhs (dofs_per_cell); + FullMatrix cell_matrix (dofs_per_cell, dofs_per_cell); + Vector cell_rhs (dofs_per_cell); - vector local_dof_indices (dofs_per_cell); + vector local_dof_indices (dofs_per_cell); // Note here, that a cell is a // quadrilateral in two space @@ -446,7 +446,7 @@ void LaplaceProblem::assemble_system () // would like to use (i.e. the // BoundaryValues class declared // above): - map boundary_values; + map boundary_values; VectorTools::interpolate_boundary_values (dof_handler, 0, BoundaryValues(), diff --git a/deal.II/deal.II/Attic/examples/step-by-step/step-5/step-5.cc b/deal.II/deal.II/Attic/examples/step-by-step/step-5/step-5.cc index 4f389ee257..3584831dd5 100644 --- a/deal.II/deal.II/Attic/examples/step-by-step/step-5/step-5.cc +++ b/deal.II/deal.II/Attic/examples/step-by-step/step-5/step-5.cc @@ -335,13 +335,13 @@ void LaplaceProblem::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 cell_matrix (dofs_per_cell, dofs_per_cell); - Vector cell_rhs (dofs_per_cell); + FullMatrix cell_matrix (dofs_per_cell, dofs_per_cell); + Vector cell_rhs (dofs_per_cell); - vector local_dof_indices (dofs_per_cell); + vector local_dof_indices (dofs_per_cell); // Below, we will ask the // Coefficient class to compute the @@ -558,7 +558,7 @@ void LaplaceProblem::assemble_system () }; // Again use zero boundary values: - map boundary_values; + map boundary_values; VectorTools::interpolate_boundary_values (dof_handler, 0, ZeroFunction(), diff --git a/deal.II/deal.II/Attic/examples/step-by-step/step-6/step-6.cc b/deal.II/deal.II/Attic/examples/step-by-step/step-6/step-6.cc index 2f33358c23..0629bdc820 100644 --- a/deal.II/deal.II/Attic/examples/step-by-step/step-6/step-6.cc +++ b/deal.II/deal.II/Attic/examples/step-by-step/step-6/step-6.cc @@ -449,15 +449,15 @@ void LaplaceProblem::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 cell_matrix (dofs_per_cell, dofs_per_cell); - Vector cell_rhs (dofs_per_cell); + FullMatrix cell_matrix (dofs_per_cell, dofs_per_cell); + Vector cell_rhs (dofs_per_cell); - vector local_dof_indices (dofs_per_cell); + vector local_dof_indices (dofs_per_cell); - vector coefficient_values (n_q_points); + vector coefficient_values (n_q_points); // We can now go on with assembling // the matrix and right hand @@ -554,7 +554,7 @@ void LaplaceProblem::assemble_system () // from the system of equations // happens *after* the elimination // of hanging nodes. - map boundary_values; + map boundary_values; VectorTools::interpolate_boundary_values (dof_handler, 0, ZeroFunction(), diff --git a/deal.II/deal.II/Attic/examples/step-by-step/step-7/step-7.cc b/deal.II/deal.II/Attic/examples/step-by-step/step-7/step-7.cc index c14b80d9ff..0caa12938f 100644 --- a/deal.II/deal.II/Attic/examples/step-by-step/step-7/step-7.cc +++ b/deal.II/deal.II/Attic/examples/step-by-step/step-7/step-7.cc @@ -230,16 +230,16 @@ void LaplaceProblem::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 right_hand_side; - vector rhs_values (n_q_points); + RightHandSide right_hand_side; + vector rhs_values (n_q_points); - FullMatrix cell_matrix (dofs_per_cell, dofs_per_cell); - Vector cell_rhs (dofs_per_cell); + FullMatrix cell_matrix (dofs_per_cell, dofs_per_cell); + Vector cell_rhs (dofs_per_cell); - vector local_dof_indices (dofs_per_cell); + vector local_dof_indices (dofs_per_cell); DoFHandler::active_cell_iterator cell = dof_handler.begin_active(), endc = dof_handler.end(); @@ -289,7 +289,7 @@ void LaplaceProblem::assemble_system () hanging_node_constraints.condense (system_matrix); hanging_node_constraints.condense (system_rhs); - map boundary_values; + map boundary_values; VectorTools::interpolate_boundary_values (dof_handler, 0, Solution(), diff --git a/deal.II/deal.II/Attic/examples/step-by-step/step-8/step-8.cc b/deal.II/deal.II/Attic/examples/step-by-step/step-8/step-8.cc index 5b03e6e1e3..51f6741f93 100644 --- a/deal.II/deal.II/Attic/examples/step-by-step/step-8/step-8.cc +++ b/deal.II/deal.II/Attic/examples/step-by-step/step-8/step-8.cc @@ -453,13 +453,13 @@ void ElasticProblem::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 cell_matrix (dofs_per_cell, dofs_per_cell); - Vector cell_rhs (dofs_per_cell); + FullMatrix cell_matrix (dofs_per_cell, dofs_per_cell); + Vector cell_rhs (dofs_per_cell); - vector local_dof_indices (dofs_per_cell); + vector local_dof_indices (dofs_per_cell); // As was shown in previous // examples as well, we need a @@ -729,7 +729,7 @@ void ElasticProblem::assemble_system () // we need to pass ``dim'' as // number of components to the zero // function as well. - map boundary_values; + map boundary_values; VectorTools::interpolate_boundary_values (dof_handler, 0, ZeroFunction(dim), diff --git a/deal.II/deal.II/Todo b/deal.II/deal.II/Todo index 830b0ea27b..5bbba11d6f 100644 --- a/deal.II/deal.II/Todo +++ b/deal.II/deal.II/Todo @@ -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?? diff --git a/deal.II/deal.II/include/dofs/dof_accessor.h b/deal.II/deal.II/include/dofs/dof_accessor.h index aba8b4c97b..d80c96fa94 100644 --- a/deal.II/deal.II/include/dofs/dof_accessor.h +++ b/deal.II/deal.II/include/dofs/dof_accessor.h @@ -175,9 +175,14 @@ class DoFObjectAccessor_Inheritance /** - * 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 * * 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 class DoFObjectAccessor : public DoFAccessor, - public TriaObjectAccessor//DoFObjectAccessor_Inheritance::BaseClass + public TriaObjectAccessor { public: /** * Data type passed by the iterator class. @@ -408,6 +411,7 @@ class DoFObjectAccessor<0, dim> : public DoFAccessor, }; + /** * 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, * to a #DoFHandler# object. */ DoFObjectAccessor (Triangulation *tria, - const int level, - const int index, - const AccessorData *local_data) : + const int level, + const int index, + const AccessorData *local_data) : DoFAccessor (local_data), DoFObjectAccessor_Inheritance<1,dim>::BaseClass (tria,level,index) {}; @@ -477,20 +481,21 @@ class DoFObjectAccessor<1, dim> : public DoFAccessor, * 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, */ 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, * It is assumed that the vector already * has the right size beforehand. */ - void get_dof_indices (vector &dof_indices) const; + void get_dof_indices (vector &dof_indices) const; /** * Return the values of the given vector @@ -643,20 +648,21 @@ class DoFObjectAccessor<2, dim> : public DoFAccessor, * 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, */ 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, * It is assumed that the vector already * has the right size beforehand. */ - void get_dof_indices (vector &dof_indices) const; + void get_dof_indices (vector &dof_indices) const; /** * Return the values of the given vector @@ -820,20 +826,21 @@ class DoFObjectAccessor<3, dim> : public DoFAccessor, * 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, */ 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, * It is assumed that the vector already * has the right size beforehand. */ - void get_dof_indices (vector &dof_indices) const; + void get_dof_indices (vector &dof_indices) const; /** * Return the values of the given vector @@ -975,7 +982,8 @@ class DoFObjectAccessor<3, dim> : public DoFAccessor, * @author Wolfgang Bangerth, 1998 */ template -class DoFCellAccessor : public DoFObjectAccessor { +class DoFCellAccessor : public DoFObjectAccessor +{ public: /** * Declare the data type that this accessor diff --git a/deal.II/deal.II/include/dofs/dof_accessor.templates.h b/deal.II/deal.II/include/dofs/dof_accessor.templates.h index d8515f2fc6..be6c92a6f4 100644 --- a/deal.II/deal.II/include/dofs/dof_accessor.templates.h +++ b/deal.II/deal.II/include/dofs/dof_accessor.templates.h @@ -19,7 +19,9 @@ template 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 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 inline void -DoFObjectAccessor<1,dim>::get_dof_indices (vector &dof_indices) const { +DoFObjectAccessor<1,dim>::get_dof_indices (vector &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 &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::iterator next = dof_indices.begin(); + vector::iterator next = dof_indices.begin(); for (unsigned int vertex=0; vertex<2; ++vertex) for (unsigned int d=0; d::get_dof_indices (vector &dof_indices) const { template inline TriaIterator > -DoFObjectAccessor<1,dim>::child (const unsigned int i) const { +DoFObjectAccessor<1,dim>::child (const unsigned int i) const +{ TriaIterator > q (tria, present_level+1, child_index (i), @@ -95,7 +101,8 @@ DoFObjectAccessor<1,dim>::child (const unsigned int i) const { template 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 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 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 inline void -DoFObjectAccessor<2,dim>::get_dof_indices (vector &dof_indices) const { +DoFObjectAccessor<2,dim>::get_dof_indices (vector &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 &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::iterator next = dof_indices.begin(); + vector::iterator next = dof_indices.begin(); for (unsigned int vertex=0; vertex<4; ++vertex) for (unsigned int d=0; d::get_dof_indices (vector &dof_indices) const { template inline TriaIterator > -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 > @@ -186,7 +198,8 @@ DoFObjectAccessor<2,dim>::line (const unsigned int i) const { template inline TriaIterator > -DoFObjectAccessor<2,dim>::child (const unsigned int i) const { +DoFObjectAccessor<2,dim>::child (const unsigned int i) const +{ TriaIterator > q (tria, present_level+1, child_index (i), @@ -204,7 +217,8 @@ DoFObjectAccessor<2,dim>::child (const unsigned int i) const { template 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 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 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 inline void -DoFObjectAccessor<3,dim>::get_dof_indices (vector &dof_indices) const { +DoFObjectAccessor<3,dim>::get_dof_indices (vector &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 &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::iterator next = dof_indices.begin(); + vector::iterator next = dof_indices.begin(); for (unsigned int vertex=0; vertex<8; ++vertex) for (unsigned int d=0; d::get_dof_indices (vector &dof_indices) const { template inline TriaIterator > -DoFObjectAccessor<3,dim>::line (const unsigned int i) const { +DoFObjectAccessor<3,dim>::line (const unsigned int i) const +{ TriaIterator > l = BaseClass::line(i); return TriaIterator > ( @@ -300,7 +320,8 @@ DoFObjectAccessor<3,dim>::line (const unsigned int i) const { template inline TriaIterator > -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 > @@ -317,7 +338,8 @@ DoFObjectAccessor<3,dim>::quad (const unsigned int i) const { template inline TriaIterator > -DoFObjectAccessor<3,dim>::child (const unsigned int i) const { +DoFObjectAccessor<3,dim>::child (const unsigned int i) const +{ TriaIterator > q (tria, present_level+1, child_index (i), @@ -333,7 +355,8 @@ DoFObjectAccessor<3,dim>::child (const unsigned int i) const { template -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 inline TriaIterator > -DoFCellAccessor::neighbor (const unsigned int i) const { +DoFCellAccessor::neighbor (const unsigned int i) const +{ TriaIterator > q (tria, neighbor_level (i), neighbor_index (i), @@ -365,7 +389,8 @@ DoFCellAccessor::neighbor (const unsigned int i) const { template inline TriaIterator > -DoFCellAccessor::child (const unsigned int i) const { +DoFCellAccessor::child (const unsigned int i) const +{ TriaIterator > q (tria, present_level+1, child_index (i), diff --git a/deal.II/deal.II/include/dofs/dof_handler.h b/deal.II/deal.II/include/dofs/dof_handler.h index 775ba3c8ae..c60f517129 100644 --- a/deal.II/deal.II/include/dofs/dof_handler.h +++ b/deal.II/deal.II/include/dofs/dof_handler.h @@ -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)# function is called, which actually + * #renumber_dofs(vector)# 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)# with the array, which converts old + * #renumber_dofs(vector)# 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*> 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(-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 &new_numbers); + void renumber_dofs (const vector &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 &mapping) const; + void map_dof_to_boundary_indices (vector &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 &mapping) const; + void map_dof_to_boundary_indices (const FunctionMap &boundary_indicators, + vector &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 vertex_dofs; + vector vertex_dofs; #if (__GNUC__==2) && (__GNUC_MINOR__ < 95) diff --git a/deal.II/deal.II/include/dofs/dof_levels.h b/deal.II/deal.II/include/dofs/dof_levels.h index e864a533ca..c749c012e8 100644 --- a/deal.II/deal.II/include/dofs/dof_levels.h +++ b/deal.II/deal.II/include/dofs/dof_levels.h @@ -16,7 +16,8 @@ * other types than those explicitely instantiated. */ template -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 line_dofs; + vector line_dofs; }; @@ -96,7 +98,7 @@ class DoFLevel<2> : public DoFLevel<1> { * of freedom. See \Ref{DoFLevel} for * detailed information. */ - vector quad_dofs; + vector quad_dofs; }; @@ -112,7 +114,7 @@ class DoFLevel<3> : public DoFLevel<2> { * of freedom. See \Ref{DoFLevel} for * detailed information. */ - vector hex_dofs; + vector hex_dofs; }; diff --git a/deal.II/deal.II/include/dofs/dof_tools.h b/deal.II/deal.II/include/dofs/dof_tools.h index 07cfc35692..466e2be19f 100644 --- a/deal.II/deal.II/include/dofs/dof_tools.h +++ b/deal.II/deal.II/include/dofs/dof_tools.h @@ -179,9 +179,9 @@ class DoFTools */ template static void - make_boundary_sparsity_pattern (const DoFHandler &dof, - const vector &dof_to_boundary_mapping, - SparsityPattern &sparsity_pattern); + make_boundary_sparsity_pattern (const DoFHandler &dof, + const vector &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& dof, const typename DoFHandler::FunctionMap &boundary_indicators, - const vector &dof_to_boundary_mapping, + const vector &dof_to_boundary_mapping, SparsityPattern &sparsity); /** diff --git a/deal.II/deal.II/include/grid/tria_accessor.templates.h b/deal.II/deal.II/include/grid/tria_accessor.templates.h index d36f8cea2d..569c6664af 100644 --- a/deal.II/deal.II/include/grid/tria_accessor.templates.h +++ b/deal.II/deal.II/include/grid/tria_accessor.templates.h @@ -204,14 +204,14 @@ TriaObjectAccessor<1,dim>::operator ++ () { // the vector? while (present_index >= - (int)tria->levels[present_level]->lines.lines.size()) + static_cast(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(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(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(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(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(tria->levels.size())) { // return with past the end pointer present_level = present_index = -1; @@ -914,13 +914,13 @@ TriaObjectAccessor::operator ++ () { // the vector? while (present_index >= - (int)tria->levels[present_level]->hexes.hexes.size()) + static_cast(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(tria->levels.size())) { // return with past the end pointer present_level = present_index = -1; diff --git a/deal.II/deal.II/include/multigrid/mg_dof_accessor.h b/deal.II/deal.II/include/multigrid/mg_dof_accessor.h index 4b30be0c8a..05f401412e 100644 --- a/deal.II/deal.II/include/multigrid/mg_dof_accessor.h +++ b/deal.II/deal.II/include/multigrid/mg_dof_accessor.h @@ -248,22 +248,23 @@ class MGDoFObjectAccessor<1, dim> : public MGDoFAccessor, * 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, */ 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, * indices refer to the local numbering * for the level this line lives on. */ - void get_mg_dof_indices (vector &dof_indices) const; + void get_mg_dof_indices (vector &dof_indices) const; /** * Return the value of the given vector @@ -367,22 +368,23 @@ class MGDoFObjectAccessor<2, dim> : public MGDoFAccessor, * 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, */ 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, * indices refer to the local numbering * for the level this quad lives on. */ - void get_mg_dof_indices (vector &dof_indices) const; + void get_mg_dof_indices (vector &dof_indices) const; /** * Return the value of the given vector @@ -493,22 +495,23 @@ class MGDoFObjectAccessor<3, dim> : public MGDoFAccessor, * 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, */ 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, * indices refer to the local numbering * for the level this hex lives on. */ - void get_mg_dof_indices (vector &dof_indices) const; + void get_mg_dof_indices (vector &dof_indices) const; /** * Return the value of the given vector diff --git a/deal.II/deal.II/include/multigrid/mg_dof_handler.h b/deal.II/deal.II/include/multigrid/mg_dof_handler.h index 5dda5971b8..48c55b0b80 100644 --- a/deal.II/deal.II/include/multigrid/mg_dof_handler.h +++ b/deal.II/deal.II/include/multigrid/mg_dof_handler.h @@ -198,7 +198,7 @@ class MGDoFHandler : public DoFHandler * order of the old indices. */ void renumber_dofs (const unsigned int level, - const vector &new_numbers); + const vector &new_numbers); /*--------------------------------------*/ @@ -840,9 +840,9 @@ class MGDoFHandler : public DoFHandler * 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 /** * Array holding the indices. */ - int *indices; + unsigned int *indices; }; @@ -990,9 +990,10 @@ void MGDoFHandler::MGVertexDoFs::set_index (const unsigned int level, template inline -int MGDoFHandler::MGVertexDoFs::get_index (const unsigned int level, - const unsigned int dof_number, - const unsigned int dofs_per_vertex) const { +unsigned int +MGDoFHandler::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, diff --git a/deal.II/deal.II/include/multigrid/mg_smoother.h b/deal.II/deal.II/include/multigrid/mg_smoother.h index dce540bdca..49e3688103 100644 --- a/deal.II/deal.II/include/multigrid/mg_smoother.h +++ b/deal.II/deal.II/include/multigrid/mg_smoother.h @@ -181,7 +181,7 @@ class MGSmoother : public MGSmootherBase * These arrays are set by the constructor. * The entries for each level are sorted ascendingly. */ - vector > interior_boundary_dofs; + vector > interior_boundary_dofs; }; diff --git a/deal.II/deal.II/include/multigrid/multigrid.templates.h b/deal.II/deal.II/include/multigrid/multigrid.templates.h index f91ecba29e..38d8050dc6 100644 --- a/deal.II/deal.II/include/multigrid/multigrid.templates.h +++ b/deal.II/deal.II/include/multigrid/multigrid.templates.h @@ -29,9 +29,9 @@ Multigrid::copy_to_mg(const Vector& src) defect.clear(); // constraints->condense(src); - vector global_dof_indices (dofs_per_cell); - vector level_dof_indices (dofs_per_cell); - vector level_face_indices (dofs_per_face); + vector global_dof_indices (dofs_per_cell); + vector level_dof_indices (dofs_per_cell); + vector level_face_indices (dofs_per_face); // initialize the objects with // their correct size @@ -111,8 +111,8 @@ Multigrid::copy_from_mg(Vector &dst) const { const unsigned int dofs_per_cell = mg_dof_handler->get_fe().dofs_per_cell; - vector global_dof_indices (dofs_per_cell); - vector level_dof_indices (dofs_per_cell); + vector global_dof_indices (dofs_per_cell); + vector level_dof_indices (dofs_per_cell); DoFHandler::active_cell_iterator global_cell = mg_dof_handler->DoFHandler::begin_active(); diff --git a/deal.II/deal.II/include/numerics/dof_renumbering.h b/deal.II/deal.II/include/numerics/dof_renumbering.h index 37395e2abe..9c4923f6d5 100644 --- a/deal.II/deal.II/include/numerics/dof_renumbering.h +++ b/deal.II/deal.II/include/numerics/dof_renumbering.h @@ -171,10 +171,10 @@ class DoFRenumbering * different methods. */ template - static void Cuthill_McKee (DoFHandler &dof_handler, - const bool reversed_numbering = false, - const bool use_constraints = false, - const vector &starting_indices = vector()); + static void Cuthill_McKee (DoFHandler &dof_handler, + const bool reversed_numbering = false, + const bool use_constraints = false, + const vector &starting_indices = vector()); /** * Renumber the degrees of freedom @@ -196,10 +196,10 @@ class DoFRenumbering * different methods. */ template - static void Cuthill_McKee (MGDoFHandler &dof_handler, - const unsigned int level, - const bool reversed_numbering = false, - const vector &starting_indices = vector ()); + static void Cuthill_McKee (MGDoFHandler &dof_handler, + const unsigned int level, + const bool reversed_numbering = false, + const vector &starting_indices = vector ()); /** * Sort the degrees of freedom by diff --git a/deal.II/deal.II/include/numerics/matrices.h b/deal.II/deal.II/include/numerics/matrices.h index 0cf81a99b2..3e15f0914c 100644 --- a/deal.II/deal.II/include/numerics/matrices.h +++ b/deal.II/deal.II/include/numerics/matrices.h @@ -267,7 +267,7 @@ class MatrixCreator SparseMatrix &matrix, const FunctionMap &rhs, Vector &rhs_vector, - vector &vec_to_dof_mapping, + vector &vec_to_dof_mapping, const Function *a = 0); /** @@ -411,7 +411,8 @@ class MatrixCreator * @author Wolfgang Bangerth, 1998 */ template -class MatrixTools : public MatrixCreator { +class MatrixTools : public MatrixCreator +{ public: /** * Apply dirichlet boundary conditions @@ -419,7 +420,7 @@ class MatrixTools : public MatrixCreator { * as described in the general * documentation. */ - static void apply_boundary_values (const map &boundary_values, + static void apply_boundary_values (const map &boundary_values, SparseMatrix &matrix, Vector &solution, Vector &right_hand_side); diff --git a/deal.II/deal.II/include/numerics/solution_transfer.h b/deal.II/deal.II/include/numerics/solution_transfer.h index 4b9ba455b6..90dc38aada 100644 --- a/deal.II/deal.II/include/numerics/solution_transfer.h +++ b/deal.II/deal.II/include/numerics/solution_transfer.h @@ -121,13 +121,13 @@ * #vector >vector all_in# includes * all discrete functions to be interpolated onto the new grid. * - * As we need two different kinds of pointers (#vector *# for the Dof + * As we need two different kinds of pointers (#vector *# for the Dof * indices and #vector > *# 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 *# at one time and as + * #void * user_pointer# as #vector *# at one time and as * #vector > *# 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 > indices_on_cell; + vector > 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 indices# (if the cell + * #vector indices# (if the cell * will be refined) or the * #vector dof_values# (if the * children of this cell will be deleted) @@ -370,7 +370,7 @@ class SolutionTransfer * 'multiplied' by this structure. */ struct Pointerstruct { - vector *indices_ptr; + vector *indices_ptr; vector > *dof_values_ptr; }; diff --git a/deal.II/deal.II/include/numerics/vectors.h b/deal.II/deal.II/include/numerics/vectors.h index dbb246e4b4..be4b482896 100644 --- a/deal.II/deal.II/include/numerics/vectors.h +++ b/deal.II/deal.II/include/numerics/vectors.h @@ -397,11 +397,11 @@ class VectorTools * information. */ template - static void interpolate_boundary_values (const DoFHandler &dof, - const unsigned char boundary_component, - const Function &boundary_function, - map &boundary_values, - const vector &component_mask = vector()); + static void interpolate_boundary_values (const DoFHandler &dof, + const unsigned char boundary_component, + const Function &boundary_function, + map &boundary_values, + const vector &component_mask = vector()); //TODO: Update project_boundary_values for more components //TODO: Replace FunctionMap @@ -425,10 +425,10 @@ class VectorTools * class for further information. */ template - static void project_boundary_values (const DoFHandler &dof, + static void project_boundary_values (const DoFHandler &dof, const map*> &boundary_function, - const Quadrature&q, - map &boundary_values); + const Quadrature &q, + map &boundary_values); /** * Compute the error of the finite element solution. diff --git a/deal.II/deal.II/source/dofs/dof_accessor.cc b/deal.II/deal.II/source/dofs/dof_accessor.cc index 3cc5bf2623..20aade1bcd 100644 --- a/deal.II/deal.II/source/dofs/dof_accessor.cc +++ b/deal.II/deal.II/source/dofs/dof_accessor.cc @@ -26,7 +26,8 @@ template 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::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 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 &local_source, const unsigned int n_dofs = local_source.size(); // get indices of dofs - vector dofs (n_dofs); + vector dofs (n_dofs); get_dof_indices (dofs); // distribute cell vector @@ -103,7 +105,7 @@ distribute_local_to_global (const FullMatrix &local_source, const unsigned int n_dofs = local_source.m(); // get indices of dofs - vector dofs (n_dofs); + vector dofs (n_dofs); get_dof_indices (dofs); // distribute cell matrix @@ -181,7 +183,8 @@ DoFObjectAccessor<1,dim>::set_dof_values (const Vector &local_values, template 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 -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 &local_source, const unsigned int n_dofs = local_source.size(); // get indices of dofs - vector dofs (n_dofs); + vector dofs (n_dofs); get_dof_indices (dofs); // distribute cell vector @@ -259,7 +264,7 @@ distribute_local_to_global (const FullMatrix &local_source, const unsigned int n_dofs = local_source.m(); // get indices of dofs - vector dofs (n_dofs); + vector dofs (n_dofs); get_dof_indices (dofs); // distribute cell matrix @@ -348,7 +353,8 @@ DoFObjectAccessor<2,dim>::set_dof_values (const Vector &local_values, template 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 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 &local_source, const unsigned int n_dofs = local_source.size(); // get indices of dofs - vector dofs (n_dofs); + vector dofs (n_dofs); get_dof_indices (dofs); // distribute cell vector @@ -429,7 +436,7 @@ distribute_local_to_global (const FullMatrix &local_source, const unsigned int n_dofs = local_source.m(); // get indices of dofs - vector dofs (n_dofs); + vector dofs (n_dofs); get_dof_indices (dofs); // distribute cell matrix diff --git a/deal.II/deal.II/source/dofs/dof_handler.cc b/deal.II/deal.II/source/dofs/dof_handler.cc index 484cba9128..07246c45d2 100644 --- a/deal.II/deal.II/source/dofs/dof_handler.cc +++ b/deal.II/deal.II/source/dofs/dof_handler.cc @@ -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::n_boundary_dofs () const { set boundary_dofs; const unsigned int dofs_per_face = selected_fe->dofs_per_face; - vector dofs_on_face(dofs_per_face); + vector 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::n_boundary_dofs (const FunctionMap &boundary_indic set boundary_dofs; const unsigned int dofs_per_face = selected_fe->dofs_per_face; - vector dofs_on_face(dofs_per_face); + vector 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; ddofs_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; ddofs_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; ddofs_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; ddofs_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; ddofs_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 &new_numbers) { +void DoFHandler<1>::renumber_dofs (const vector &new_numbers) { Assert (new_numbers.size() == n_dofs(), ExcRenumberingIncomplete()); #ifdef DEBUG // assert that the new indices are // consecutively numbered if (true) { - vector tmp(new_numbers); + vector tmp(new_numbers); sort (tmp.begin(), tmp.end()); - vector::const_iterator p = tmp.begin(); - int i = 0; + vector::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 &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::iterator i=vertex_dofs.begin(); i!=vertex_dofs.end(); ++i) - if (*i != -1) + for (vector::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::iterator i=levels[level]->line_dofs.begin(); + for (vector::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 &new_numbers) { #if deal_II_dimension == 2 template <> -void DoFHandler<2>::renumber_dofs (const vector &new_numbers) { +void DoFHandler<2>::renumber_dofs (const vector &new_numbers) { Assert (new_numbers.size() == n_dofs(), ExcRenumberingIncomplete()); #ifdef DEBUG // assert that the new indices are // consecutively numbered if (true) { - vector tmp(new_numbers); + vector tmp(new_numbers); sort (tmp.begin(), tmp.end()); - vector::const_iterator p = tmp.begin(); - int i = 0; + vector::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 &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::iterator i=vertex_dofs.begin(); i!=vertex_dofs.end(); ++i) - if (*i != -1) + for (vector::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 &new_numbers) { for (unsigned int level=0; level::iterator i=levels[level]->line_dofs.begin(); + for (vector::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::iterator i=levels[level]->quad_dofs.begin(); + for (vector::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 &new_numbers) { #if deal_II_dimension == 3 template <> -void DoFHandler<3>::renumber_dofs (const vector &new_numbers) { +void DoFHandler<3>::renumber_dofs (const vector &new_numbers) { Assert (new_numbers.size() == n_dofs(), ExcRenumberingIncomplete()); #ifdef DEBUG // assert that the new indices are // consecutively numbered if (true) { - vector tmp(new_numbers); + vector tmp(new_numbers); sort (tmp.begin(), tmp.end()); - vector::const_iterator p = tmp.begin(); - int i = 0; + vector::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 &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::iterator i=vertex_dofs.begin(); i!=vertex_dofs.end(); ++i) - if (*i != -1) + for (vector::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 &new_numbers) { for (unsigned int level=0; level::iterator i=levels[level]->line_dofs.begin(); + for (vector::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::iterator i=levels[level]->quad_dofs.begin(); + for (vector::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::iterator i=levels[level]->hex_dofs.begin(); + for (vector::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 &) const { +void DoFHandler<1>::map_dof_to_boundary_indices (vector &) const { Assert (selected_fe != 0, ExcNoFESelected()); Assert (false, ExcNotImplemented()); }; @@ -1869,7 +1869,7 @@ void DoFHandler<1>::map_dof_to_boundary_indices (vector &) const { template <> void DoFHandler<1>::map_dof_to_boundary_indices (const FunctionMap &, - vector &) const { + vector &) const { Assert (selected_fe != 0, ExcNoFESelected()); Assert (false, ExcNotImplemented()); }; @@ -1879,15 +1879,16 @@ void DoFHandler<1>::map_dof_to_boundary_indices (const FunctionMap &, template -void DoFHandler::map_dof_to_boundary_indices (vector &mapping) const { +void DoFHandler::map_dof_to_boundary_indices (vector &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 dofs_on_face(dofs_per_face); - int next_boundary_index = 0; + vector 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::map_dof_to_boundary_indices (vector &mapping) const { { face->get_dof_indices (dofs_on_face); for (unsigned int i=0; i(next_boundary_index) == n_boundary_dofs(), + Assert (next_boundary_index == n_boundary_dofs(), ExcInternalError()); }; template -void DoFHandler::map_dof_to_boundary_indices (const FunctionMap &boundary_indicators, - vector &mapping) const { +void DoFHandler::map_dof_to_boundary_indices (const FunctionMap &boundary_indicators, + vector &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 dofs_on_face(dofs_per_face); - int next_boundary_index = 0; + vector 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::map_dof_to_boundary_indices (const FunctionMap &boundary_i { face->get_dof_indices (dofs_on_face); for (unsigned int i=0; i(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(tria->vertices.size()* - selected_fe->dofs_per_vertex, - -1); + vertex_dofs = vector(tria->vertices.size()* + selected_fe->dofs_per_vertex, + invalid_dof_index); for (unsigned int i=0; in_levels(); ++i) { levels.push_back (new DoFLevel<1>); - levels.back()->line_dofs = vector(tria->levels[i]->lines.lines.size() * - selected_fe->dofs_per_line, - -1); + levels.back()->line_dofs = vector(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(tria->vertices.size()* - selected_fe->dofs_per_vertex, - -1); + vertex_dofs = vector(tria->vertices.size()* + selected_fe->dofs_per_vertex, + invalid_dof_index); for (unsigned int i=0; in_levels(); ++i) { levels.push_back (new DoFLevel<2>); - levels.back()->line_dofs = vector (tria->levels[i]->lines.lines.size() * - selected_fe->dofs_per_line, - -1); - levels.back()->quad_dofs = vector (tria->levels[i]->quads.quads.size() * - selected_fe->dofs_per_quad, - -1); + levels.back()->line_dofs = vector (tria->levels[i]->lines.lines.size() * + selected_fe->dofs_per_line, + invalid_dof_index); + levels.back()->quad_dofs = vector (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(tria->vertices.size()* - selected_fe->dofs_per_vertex, - -1); + vertex_dofs = vector(tria->vertices.size()* + selected_fe->dofs_per_vertex, + invalid_dof_index); for (unsigned int i=0; in_levels(); ++i) { levels.push_back (new DoFLevel<3>); - levels.back()->line_dofs = vector (tria->levels[i]->lines.lines.size() * - selected_fe->dofs_per_line, - -1); - levels.back()->quad_dofs = vector (tria->levels[i]->quads.quads.size() * - selected_fe->dofs_per_quad, - -1); - levels.back()->hex_dofs = vector (tria->levels[i]->hexes.hexes.size() * - selected_fe->dofs_per_hex, - -1); + levels.back()->line_dofs = vector (tria->levels[i]->lines.lines.size() * + selected_fe->dofs_per_line, + invalid_dof_index); + levels.back()->quad_dofs = vector (tria->levels[i]->quads.quads.size() * + selected_fe->dofs_per_quad, + invalid_dof_index); + levels.back()->hex_dofs = vector (tria->levels[i]->hexes.hexes.size() * + selected_fe->dofs_per_hex, + invalid_dof_index); }; }; diff --git a/deal.II/deal.II/source/dofs/dof_renumbering.cc b/deal.II/deal.II/source/dofs/dof_renumbering.cc index afbd6653fc..4cb578d796 100644 --- a/deal.II/deal.II/source/dofs/dof_renumbering.cc +++ b/deal.II/deal.II/source/dofs/dof_renumbering.cc @@ -18,10 +18,11 @@ template -void DoFRenumbering::Cuthill_McKee (DoFHandler &dof_handler, - const bool reversed_numbering, - const bool use_constraints, - const vector &starting_indices) { +void DoFRenumbering::Cuthill_McKee (DoFHandler &dof_handler, + const bool reversed_numbering, + const bool use_constraints, + const vector &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 &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 new_number(sparsity.n_rows(), -1); + vector new_number(sparsity.n_rows(), DoFHandler::invalid_dof_index); // store the indices of the dofs renumbered // in the last round. Default to starting // points - vector last_round_dofs (starting_indices); + vector last_round_dofs (starting_indices); // delete disallowed elements for (unsigned int i=0; i=n_dofs)) - last_round_dofs[i] = -1; + if ((last_round_dofs[i]==DoFHandler::invalid_dof_index) || + (last_round_dofs[i]>=n_dofs)) + last_round_dofs[i] = DoFHandler::invalid_dof_index; remove_if (last_round_dofs.begin(), last_round_dofs.end(), - bind2nd(equal_to(), -1)); + bind2nd(equal_to(), DoFHandler::invalid_dof_index)); // now if no valid points remain: // find dof with lowest coordination @@ -59,9 +61,9 @@ void DoFRenumbering::Cuthill_McKee (DoFHandler &dof_handler, if (last_round_dofs.size() == 0) { - int starting_point = -1; + unsigned int starting_point = DoFHandler::invalid_dof_index; unsigned int min_coordination = n_dofs; - for (int row=0; row &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::invalid_dof_index) starting_point = 0; // initialize the first dof @@ -101,7 +103,7 @@ void DoFRenumbering::Cuthill_McKee (DoFHandler &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 &dof_handler, { // store the indices of the dofs to be // renumbered in the next round - vector next_round_dofs; + vector next_round_dofs; // find all neighbors of the // dofs numbered in the last @@ -132,14 +134,14 @@ void DoFRenumbering::Cuthill_McKee (DoFHandler &dof_handler, sort (next_round_dofs.begin(), next_round_dofs.end()); // delete multiple entries - vector::iterator end_sorted; + vector::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::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 &dof_handler, // find coordination number for // each of these dofs - for (vector::iterator s=next_round_dofs.begin(); + for (vector::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 &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::invalid_dof_index) != new_number.end()) Assert (false, ExcRenumberingIncomplete()); Assert (next_free_number == n_dofs, ExcRenumberingIncomplete()); #endif if (reversed_numbering) - for (vector::iterator i=new_number.begin(); i!=new_number.end(); ++i) + for (vector::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 &dof_handler, template -void DoFRenumbering::Cuthill_McKee (MGDoFHandler &dof_handler, - const unsigned int level, - const bool reversed_numbering, - const vector &starting_indices) { +void DoFRenumbering::Cuthill_McKee (MGDoFHandler &dof_handler, + const unsigned int level, + const bool reversed_numbering, + const vector &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 new_number(n_dofs, -1); + vector new_number(n_dofs, DoFHandler::invalid_dof_index); // store the indices of the dofs renumbered // in the last round. Default to starting // points - vector last_round_dofs (starting_indices); + vector last_round_dofs (starting_indices); // delete disallowed elements for (unsigned int i=0; i=n_dofs)) - last_round_dofs[i] = -1; + if ((last_round_dofs[i]==DoFHandler::invalid_dof_index) || + (last_round_dofs[i]>=n_dofs)) + last_round_dofs[i] = DoFHandler::invalid_dof_index; remove_if (last_round_dofs.begin(), last_round_dofs.end(), - bind2nd(equal_to(), -1)); + bind2nd(equal_to(), DoFHandler::invalid_dof_index)); // now if no valid points remain: // find dof with lowest coordination @@ -241,9 +244,9 @@ void DoFRenumbering::Cuthill_McKee (MGDoFHandler &dof_handler, if (last_round_dofs.size() == 0) { - int starting_point = -1; + unsigned int starting_point = DoFHandler::invalid_dof_index; unsigned int min_coordination = n_dofs; - for (int row=0; row &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 &dof_handler, { // store the indices of the dofs to be // renumbered in the next round - vector next_round_dofs; + vector next_round_dofs; // find all neighbors of the // dofs numbered in the last @@ -296,14 +299,14 @@ void DoFRenumbering::Cuthill_McKee (MGDoFHandler &dof_handler, sort (next_round_dofs.begin(), next_round_dofs.end()); // delete multiple entries - vector::iterator end_sorted; + vector::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::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 &dof_handler, // find coordination number for // each of these dofs - for (vector::iterator s=next_round_dofs.begin(); + for (vector::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 &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::invalid_dof_index) + != + new_number.end()) Assert (false, ExcRenumberingIncomplete()); Assert (next_free_number == n_dofs, ExcRenumberingIncomplete()); #endif if (reversed_numbering) - for (vector::iterator i=new_number.begin(); i!=new_number.end(); ++i) + for (vector::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 &dof_handler, // vector to hold the dof indices on // the cell we visit at a time - vector local_dof_indices(dofs_per_cell); + vector local_dof_indices(dofs_per_cell); // prebuilt list to which component // a given dof on a cell belongs vector component_list (dofs_per_cell); @@ -412,7 +418,7 @@ void DoFRenumbering::component_wise (DoFHandler &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 > component_to_dof_map (dof_handler.get_fe().n_components()); + vector > component_to_dof_map (dof_handler.get_fe().n_components()); for (typename DoFHandler::active_cell_iterator cell=dof_handler.begin_active(); cell!=dof_handler.end(); ++cell) { @@ -443,20 +449,20 @@ void DoFRenumbering::component_wise (DoFHandler &dof_handler, component_to_dof_map[component].end()); }; - int next_free_index = 0; - vector new_indices (dof_handler.n_dofs(), -1); + unsigned int next_free_index = 0; + vector new_indices (dof_handler.n_dofs(), DoFHandler::invalid_dof_index); for (unsigned int component=0; component::const_iterator + const typename vector::const_iterator begin_of_component = component_to_dof_map[component].begin(), end_of_component = component_to_dof_map[component].end(); - for (typename vector::const_iterator dof_index = begin_of_component; + for (typename vector::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(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 &dof_handler, const bool reversed_numbering, const bool use_constraints, - const vector &starting_indices); + const vector &starting_indices); template void DoFRenumbering::Cuthill_McKee (MGDoFHandler &dof_handler, const unsigned int level, const bool reversed_numbering, - const vector &starting_indices); + const vector &starting_indices); template void DoFRenumbering::component_wise (DoFHandler &dof_handler, diff --git a/deal.II/deal.II/source/dofs/dof_tools.cc b/deal.II/deal.II/source/dofs/dof_tools.cc index 05268f83fe..6752441bfe 100644 --- a/deal.II/deal.II/source/dofs/dof_tools.cc +++ b/deal.II/deal.II/source/dofs/dof_tools.cc @@ -30,9 +30,9 @@ DoFTools::make_sparsity_pattern (const DoFHandler &dof, ExcDimensionMismatch (sparsity.n_cols(), n_dofs)); const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell; - vector dofs_on_this_cell(dofs_per_cell); + vector dofs_on_this_cell(dofs_per_cell); DoFHandler::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 &dof, [dof.get_fe().system_to_component_index(j).first]; - vector dofs_on_this_cell(dofs_per_cell); + vector dofs_on_this_cell(dofs_per_cell); DoFHandler::active_cell_iterator cell = dof.begin_active(), endc = dof.end(); for (; cell!=endc; ++cell) @@ -96,7 +96,7 @@ DoFTools::make_sparsity_pattern (const DoFHandler &dof, template <> void DoFTools::make_boundary_sparsity_pattern (const DoFHandler<1>&, - const vector &, + const vector &, SparsityPattern &) { Assert (false, ExcInternalError()); @@ -108,7 +108,7 @@ template <> void DoFTools::make_boundary_sparsity_pattern (const DoFHandler<1>&, const DoFHandler<1>::FunctionMap &, - const vector &, + const vector &, SparsityPattern &) { Assert (false, ExcInternalError()); @@ -121,7 +121,7 @@ DoFTools::make_boundary_sparsity_pattern (const DoFHandler<1>&, template void DoFTools::make_boundary_sparsity_pattern (const DoFHandler& dof, - const vector &dof_to_boundary_mapping, + const vector &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& 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 dofs_on_this_face(dofs_per_face); + vector dofs_on_this_face(dofs_per_face); DoFHandler::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& 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::invalid_dof_index, ExcInternalError()); // make sparsity pattern for this cell @@ -163,7 +163,7 @@ DoFTools::make_boundary_sparsity_pattern (const DoFHandler& dof, template void DoFTools::make_boundary_sparsity_pattern (const DoFHandler& dof, const DoFHandler::FunctionMap &boundary_indicators, - const vector &dof_to_boundary_mapping, + const vector &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& 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::const_iterator i=dof_to_boundary_mapping.begin(); + i!=dof_to_boundary_mapping.end(); ++i) + if ((*i != DoFHandler::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 dofs_on_this_face(dofs_per_face); + vector dofs_on_this_face(dofs_per_face); DoFHandler::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& 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::invalid_dof_index, ExcInternalError()); // make sparsity pattern for this cell for (unsigned int i=0; i &dof, ExcDimensionMismatch (sparsity.n_cols(), n_dofs)); const unsigned int total_dofs = dof.get_fe().dofs_per_cell; - vector dofs_on_this_cell(total_dofs); - vector dofs_on_other_cell(total_dofs); + vector dofs_on_this_cell(total_dofs); + vector dofs_on_other_cell(total_dofs); DoFHandler::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 dofs_on_mother; - vector dofs_on_children; + vector dofs_on_mother; + vector 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 dofs_on_mother; - vector dofs_on_children; + vector dofs_on_mother; + vector 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 &dof_handler endc = dof_handler.end(); unsigned int present_cell = 0; const unsigned int dofs_per_cell = fe.dofs_per_cell; - vector dof_indices (dofs_per_cell); + vector dof_indices (dofs_per_cell); for (; cell!=endc; ++cell, ++present_cell) { @@ -611,7 +621,7 @@ DoFTools::extract_dofs(const DoFHandler &dof, // preset all values by false fill_n (selected_dofs.begin(), dof.n_dofs(), false); - vector indices(fe.dofs_per_cell); + vector indices(fe.dofs_per_cell); DoFHandler::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 indices(fe.dofs_per_cell); + vector indices(fe.dofs_per_cell); MGDoFHandler::cell_iterator c; for (c = dof.begin(level) ; c != dof.end(level) ; ++ c) @@ -669,12 +679,12 @@ DoFTools::make_flux_sparsity_pattern (const DoFHandler& dof, SparsityPattern &sparsity); template void DoFTools::make_boundary_sparsity_pattern (const DoFHandler& dof, - const vector &, + const vector &, SparsityPattern &); template void DoFTools::make_boundary_sparsity_pattern (const DoFHandler& dof, const DoFHandler::FunctionMap &boundary_indicators, - const vector &dof_to_boundary_mapping, + const vector &dof_to_boundary_mapping, SparsityPattern &sparsity); #endif diff --git a/deal.II/deal.II/source/grid/tria.cc b/deal.II/deal.II/source/grid/tria.cc index dae91a404f..cb0b7f0a04 100644 --- a/deal.II/deal.II/source/grid/tria.cc +++ b/deal.II/deal.II/source/grid/tria.cc @@ -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; }; diff --git a/deal.II/deal.II/source/multigrid/mg_dof_accessor.cc b/deal.II/deal.II/source/multigrid/mg_dof_accessor.cc index df234c2e30..c5ba004f22 100644 --- a/deal.II/deal.II/source/multigrid/mg_dof_accessor.cc +++ b/deal.II/deal.II/source/multigrid/mg_dof_accessor.cc @@ -33,7 +33,7 @@ MGDoFObjectAccessor<1, dim>::MGDoFObjectAccessor (Triangulation *tria, template -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::ExcInvalidObject()); Assert (mg_dof_handler != 0, DoFAccessor::ExcInvalidObject()); @@ -53,7 +53,7 @@ int MGDoFObjectAccessor<1, dim>::mg_dof_index (const unsigned int i) const template 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::ExcInvalidObject()); Assert (mg_dof_handler != 0, DoFAccessor::ExcInvalidObject()); @@ -71,8 +71,8 @@ void MGDoFObjectAccessor<1, dim>::set_mg_dof_index (const unsigned int i, template -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::ExcInvalidObject()); Assert (mg_dof_handler != 0, DoFAccessor::ExcInvalidObject()); @@ -90,7 +90,7 @@ int MGDoFObjectAccessor<1, dim>::mg_vertex_dof_index (const unsigned int vertex, template 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::ExcInvalidObject()); Assert (mg_dof_handler != 0, DoFAccessor::ExcInvalidObject()); @@ -107,7 +107,7 @@ void MGDoFObjectAccessor<1, dim>::set_mg_vertex_dof_index (const unsigned int ve template void -MGDoFObjectAccessor<1, dim>::get_mg_dof_indices (vector &dof_indices) const +MGDoFObjectAccessor<1, dim>::get_mg_dof_indices (vector &dof_indices) const { Assert (dof_handler != 0, DoFAccessor::ExcInvalidObject()); Assert (mg_dof_handler != 0, DoFAccessor::ExcInvalidObject()); @@ -118,7 +118,7 @@ MGDoFObjectAccessor<1, dim>::get_mg_dof_indices (vector &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::iterator next = dof_indices.begin(); + vector::iterator next = dof_indices.begin(); for (unsigned int vertex=0; vertex<2; ++vertex) for (unsigned int d=0; d::MGDoFObjectAccessor (Triangulation *tria, template 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::ExcInvalidObject()); Assert (mg_dof_handler != 0, DoFAccessor::ExcInvalidObject()); @@ -222,7 +222,7 @@ int MGDoFObjectAccessor<2, dim>::mg_dof_index (const unsigned int i) const template 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::ExcInvalidObject()); Assert (mg_dof_handler != 0, DoFAccessor::ExcInvalidObject()); @@ -240,8 +240,8 @@ void MGDoFObjectAccessor<2, dim>::set_mg_dof_index (const unsigned int i, template 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::ExcInvalidObject()); Assert (mg_dof_handler != 0, DoFAccessor::ExcInvalidObject()); @@ -259,7 +259,7 @@ int MGDoFObjectAccessor<2, dim>::mg_vertex_dof_index (const unsigned int vertex, template 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::ExcInvalidObject()); Assert (mg_dof_handler != 0, DoFAccessor::ExcInvalidObject()); @@ -276,7 +276,7 @@ void MGDoFObjectAccessor<2, dim>::set_mg_vertex_dof_index (const unsigned int ve template void -MGDoFObjectAccessor<2, dim>::get_mg_dof_indices (vector &dof_indices) const +MGDoFObjectAccessor<2, dim>::get_mg_dof_indices (vector &dof_indices) const { Assert (dof_handler != 0, DoFAccessor::ExcInvalidObject()); Assert (mg_dof_handler != 0, DoFAccessor::ExcInvalidObject()); @@ -289,7 +289,7 @@ MGDoFObjectAccessor<2, dim>::get_mg_dof_indices (vector &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::iterator next = dof_indices.begin(); + vector::iterator next = dof_indices.begin(); for (unsigned int vertex=0; vertex<4; ++vertex) for (unsigned int d=0; d::MGDoFObjectAccessor (Triangulation *tria, template 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::ExcInvalidObject()); Assert (mg_dof_handler != 0, DoFAccessor::ExcInvalidObject()); @@ -417,7 +417,7 @@ int MGDoFObjectAccessor<3, dim>::mg_dof_index (const unsigned int i) const template 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::ExcInvalidObject()); Assert (mg_dof_handler != 0, DoFAccessor::ExcInvalidObject()); @@ -435,8 +435,8 @@ void MGDoFObjectAccessor<3, dim>::set_mg_dof_index (const unsigned int i, template 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::ExcInvalidObject()); Assert (mg_dof_handler != 0, DoFAccessor::ExcInvalidObject()); @@ -454,7 +454,7 @@ int MGDoFObjectAccessor<3, dim>::mg_vertex_dof_index (const unsigned int vertex, template 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::ExcInvalidObject()); Assert (mg_dof_handler != 0, DoFAccessor::ExcInvalidObject()); @@ -471,7 +471,7 @@ void MGDoFObjectAccessor<3, dim>::set_mg_vertex_dof_index (const unsigned int ve template void -MGDoFObjectAccessor<3, dim>::get_mg_dof_indices (vector &dof_indices) const +MGDoFObjectAccessor<3, dim>::get_mg_dof_indices (vector &dof_indices) const { Assert (dof_handler != 0, DoFAccessor::ExcInvalidObject()); Assert (mg_dof_handler != 0, DoFAccessor::ExcInvalidObject()); @@ -486,7 +486,7 @@ MGDoFObjectAccessor<3, dim>::get_mg_dof_indices (vector &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::iterator next = dof_indices.begin(); + vector::iterator next = dof_indices.begin(); for (unsigned int vertex=0; vertex<8; ++vertex) for (unsigned int d=0; d::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::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; ddofs_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; ddofs_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; ddofs_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; ddofs_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; ddofs_per_line; ++d) quad->set_mg_dof_index (d, next_free_dof++); @@ -1543,7 +1543,7 @@ unsigned int MGDoFHandler::n_dofs (const unsigned int level) const { template <> void MGDoFHandler<1>::renumber_dofs (const unsigned int level, - const vector &new_numbers) { + const vector &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::iterator i=mg_levels[level]->line_dofs.begin(); + for (vector::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 &new_numbers) { + const vector &new_numbers) { Assert (new_numbers.size() == n_dofs(level), ExcRenumberingIncomplete()); for (vector::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::iterator i=mg_levels[level]->line_dofs.begin(); + for (vector::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::iterator i=mg_levels[level]->quad_dofs.begin(); + for (vector::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 &new_numbers) { + const vector &new_numbers) { Assert (new_numbers.size() == n_dofs(level), ExcRenumberingIncomplete()); for (vector::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::iterator i=mg_levels[level]->line_dofs.begin(); + for (vector::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::iterator i=mg_levels[level]->quad_dofs.begin(); + for (vector::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::iterator i=mg_levels[level]->hex_dofs.begin(); + for (vector::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(tria->levels[i]->lines.lines.size() * - selected_fe->dofs_per_line, - -1); + mg_levels.back()->line_dofs = vector(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 (tria->levels[i]->lines.lines.size() * - selected_fe->dofs_per_line, - -1); - mg_levels.back()->quad_dofs = vector (tria->levels[i]->quads.quads.size() * - selected_fe->dofs_per_quad, - -1); + mg_levels.back()->line_dofs = vector (tria->levels[i]->lines.lines.size() * + selected_fe->dofs_per_line, + DoFHandler<2>::invalid_dof_index); + mg_levels.back()->quad_dofs = vector (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 (tria->levels[i]->lines.lines.size() * - selected_fe->dofs_per_line, - -1); - mg_levels.back()->quad_dofs = vector (tria->levels[i]->quads.quads.size() * - selected_fe->dofs_per_quad, - -1); - mg_levels.back()->hex_dofs = vector (tria->levels[i]->hexes.hexes.size() * - selected_fe->dofs_per_hex, - -1); + mg_levels.back()->line_dofs = vector (tria->levels[i]->lines.lines.size() * + selected_fe->dofs_per_line, + DoFHandler<3>::invalid_dof_index); + mg_levels.back()->quad_dofs = vector (tria->levels[i]->quads.quads.size() * + selected_fe->dofs_per_quad, + DoFHandler<3>::invalid_dof_index); + mg_levels.back()->hex_dofs = vector (tria->levels[i]->hexes.hexes.size() * + selected_fe->dofs_per_hex, + DoFHandler<3>::invalid_dof_index); }; diff --git a/deal.II/deal.II/source/multigrid/mg_dof_tools.cc b/deal.II/deal.II/source/multigrid/mg_dof_tools.cc index 899113d635..3e16b5da04 100644 --- a/deal.II/deal.II/source/multigrid/mg_dof_tools.cc +++ b/deal.II/deal.II/source/multigrid/mg_dof_tools.cc @@ -20,7 +20,7 @@ void MGDoFTools::make_sparsity_pattern (const MGDoFHandler &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 dofs_on_this_cell(dofs_per_cell); + vector dofs_on_this_cell(dofs_per_cell); MGDoFHandler::cell_iterator cell = mg_dof_handler.begin(level), endc = mg_dof_handler.end(level); for (; cell!=endc; ++cell) diff --git a/deal.II/deal.II/source/multigrid/mg_smoother.cc b/deal.II/deal.II/source/multigrid/mg_smoother.cc index f2f8bd4e40..243c93f2d5 100644 --- a/deal.II/deal.II/source/multigrid/mg_smoother.cc +++ b/deal.II/deal.II/source/multigrid/mg_smoother.cc @@ -64,11 +64,11 @@ MGSmoother::MGSmoother (const MGDoFHandler &mg_dof, unsigned int steps) // to much memory by later copying the // content of this vector to its final // destination - vector boundary_dofs; + vector boundary_dofs; // temporary to hold the dof indices // on a face between to levels - vector dofs_on_face (mg_dof.get_fe().dofs_per_face); + vector dofs_on_face (mg_dof.get_fe().dofs_per_face); for (unsigned int level=1; level::const_iterator p=interior_boundary_dofs[level-1].begin(); + for (vector::const_iterator p=interior_boundary_dofs[level-1].begin(); p!=interior_boundary_dofs[level-1].end(); ++p) u(*p) = 0; }; diff --git a/deal.II/deal.II/source/multigrid/multigrid.cc b/deal.II/deal.II/source/multigrid/multigrid.cc index 99f0ae2bbd..afa6ad4a78 100644 --- a/deal.II/deal.II/source/multigrid/multigrid.cc +++ b/deal.II/deal.II/source/multigrid/multigrid.cc @@ -77,8 +77,8 @@ void MGTransferPrebuilt::build_matrices (const MGDoFHandler &mg_dof) // two fields which will store the // indices of the multigrid dofs // for a cell and one of its children - vector dof_indices_mother (dofs_per_cell); - vector dof_indices_child (dofs_per_cell); + vector dof_indices_mother (dofs_per_cell); + vector dof_indices_child (dofs_per_cell); // for each level: first build the sparsity // pattern of the matrices and then build the diff --git a/deal.II/deal.II/source/numerics/assembler.cc b/deal.II/deal.II/source/numerics/assembler.cc index fa8df868fc..d634123407 100644 --- a/deal.II/deal.II/source/numerics/assembler.cc +++ b/deal.II/deal.II/source/numerics/assembler.cc @@ -84,7 +84,7 @@ void Assembler::assemble (const Equation &equation) { // get indices of dofs - vector dofs (n_dofs); + vector dofs (n_dofs); get_dof_indices (dofs); // one could use the diff --git a/deal.II/deal.II/source/numerics/base.cc b/deal.II/deal.II/source/numerics/base.cc index a393d3bd43..98b0dfb0ea 100644 --- a/deal.II/deal.II/source/numerics/base.cc +++ b/deal.II/deal.II/source/numerics/base.cc @@ -125,7 +125,7 @@ void ProblemBase::assemble (const Equation &equation, // apply Dirichlet bc as described // in the docs - map boundary_value_list; + map boundary_value_list; for (FunctionMap::const_iterator dirichlet = dirichlet_bc.begin() ; dirichlet != dirichlet_bc.end() ; ++dirichlet) diff --git a/deal.II/deal.II/source/numerics/data_io.cc b/deal.II/deal.II/source/numerics/data_io.cc index cf0f8321b6..869efa5cf9 100644 --- a/deal.II/deal.II/source/numerics/data_io.cc +++ b/deal.II/deal.II/source/numerics/data_io.cc @@ -1214,7 +1214,7 @@ void DataOut_Old::write_gmv (ostream &out) const DoFHandler::active_cell_iterator cell; const DoFHandler::active_cell_iterator endc = dofs->end(); - vector dof_to_vertex_map (dofs->n_dofs(), -1); + vector dof_to_vertex_map (dofs->n_dofs(), DoFHandler::invalid_dof_index); unsigned int used_vertices = 0; if (true) { @@ -1225,7 +1225,8 @@ void DataOut_Old::write_gmv (ostream &out) const for (unsigned int vertex=0; vertex::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::invalid_dof_index) { vertices[next_free_vertex] = cell->vertex(vertex); diff --git a/deal.II/deal.II/source/numerics/matrices.cc b/deal.II/deal.II/source/numerics/matrices.cc index e03d7ee116..cc740b8155 100644 --- a/deal.II/deal.II/source/numerics/matrices.cc +++ b/deal.II/deal.II/source/numerics/matrices.cc @@ -84,8 +84,8 @@ void MatrixCreator::create_mass_matrix (const DoFHandler &dof, const unsigned int dofs_per_cell = fe.dofs_per_cell; - FullMatrix local_mass_matrix (dofs_per_cell, dofs_per_cell); - vector dofs_on_this_cell (dofs_per_cell); + FullMatrix local_mass_matrix (dofs_per_cell, dofs_per_cell); + vector dofs_on_this_cell (dofs_per_cell); DoFHandler::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 &, const FunctionMap &, Vector &, - vector &, + vector &, const Function<1> *) { Assert (false, ExcNotImplemented()); }; @@ -126,7 +126,7 @@ void MatrixCreator::create_boundary_mass_matrix (const DoFHandler & SparseMatrix &matrix, const FunctionMap &rhs, Vector &rhs_vector, - vector &dof_to_boundary_mapping, + vector &dof_to_boundary_mapping, const Function *a) { const FiniteElement &fe = dof.get_fe(); const unsigned int n_components = fe.n_components(); @@ -137,12 +137,22 @@ void MatrixCreator::create_boundary_mass_matrix (const DoFHandler & 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::const_iterator i=dof_to_boundary_mapping.begin(); + i!=dof_to_boundary_mapping.end(); ++i) + if ((*i != DoFHandler::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::create_boundary_mass_matrix (const DoFHandler & vector > rhs_values_system (fe_values.n_quadrature_points, Vector(n_components)); - vector dofs (dofs_per_cell); - vector dofs_on_face_vector (dofs_per_face); + vector dofs (dofs_per_cell); + vector dofs_on_face_vector (dofs_per_face); set dofs_on_face; DoFHandler::active_cell_iterator cell = dof.begin_active (), @@ -491,7 +501,7 @@ void MatrixCreator::create_laplace_matrix (const DoFHandler &dof, template -void MatrixTools::apply_boundary_values (const map &boundary_values, +void MatrixTools::apply_boundary_values (const map &boundary_values, SparseMatrix &matrix, Vector &solution, Vector &right_hand_side) { @@ -507,8 +517,8 @@ void MatrixTools::apply_boundary_values (const map &boundary_va return; - map::const_iterator dof = boundary_values.begin(), - endd = boundary_values.end(); + map::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::apply_boundary_values (const map &boundary_va for (; dof != endd; ++dof) { - Assert (dof->first >= 0, ExcInternalError()); + Assert (dof->first <= n_dofs, ExcInternalError()); - const unsigned int dof_number = static_cast(dof->first); + const unsigned int dof_number = dof->first; // for each boundary dof: // set entries of this line diff --git a/deal.II/deal.II/source/numerics/solution_transfer.cc b/deal.II/deal.II/source/numerics/solution_transfer.cc index 09a10eadc4..db66f5519c 100644 --- a/deal.II/deal.II/source/numerics/solution_transfer.cc +++ b/deal.II/deal.II/source/numerics/solution_transfer.cc @@ -58,8 +58,8 @@ void SolutionTransfer::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 > (n_active_cells, - vector (dofs_per_cell)); + indices_on_cell=vector > (n_active_cells, + vector (dofs_per_cell)); DoFHandler::cell_iterator cell = dof_handler->begin(), endc = dof_handler->end(); @@ -104,7 +104,7 @@ SolutionTransfer::refine_interpolate(const Vector &in, DoFHandler::cell_iterator cell = dof_handler->begin(), endc = dof_handler->end(); - vector *indexptr; + vector *indexptr; for (; cell!=endc; ++cell) { @@ -116,7 +116,7 @@ SolutionTransfer::refine_interpolate(const Vector &in, // which is both done by one // function { - indexptr=static_cast *>(cell->user_pointer()); + indexptr=static_cast *>(cell->user_pointer()); for (unsigned int i=0; ioperator[](i)); cell->set_dof_values_by_interpolation(local_values, out); @@ -188,8 +188,8 @@ prepare_for_coarsening_and_refinement(const vector > &all_in) GeometryInfo::children_per_cell; // allocate the needed memory - indices_on_cell = vector > (n_cells_to_stay_or_refine, - vector (dofs_per_cell)); + indices_on_cell = vector > (n_cells_to_stay_or_refine, + vector (dofs_per_cell)); dof_values_on_cell = vector > > (n_coarsen_fathers, vector > (in_size, @@ -294,10 +294,10 @@ interpolate (const vector > &all_in, const unsigned int dofs_per_cell=dof_handler->get_fe().dofs_per_cell; Vector local_values(dofs_per_cell); - vector *indexptr; + vector *indexptr; Pointerstruct *structptr; vector > *valuesptr; - vector dofs(dofs_per_cell); + vector dofs(dofs_per_cell); DoFHandler::cell_iterator cell = dof_handler->begin(), endc = dof_handler->end(); diff --git a/deal.II/deal.II/source/numerics/vectors.cc b/deal.II/deal.II/source/numerics/vectors.cc index ae03cc0216..54ce140680 100644 --- a/deal.II/deal.II/source/numerics/vectors.cc +++ b/deal.II/deal.II/source/numerics/vectors.cc @@ -99,8 +99,8 @@ void VectorTools::interpolate (const DoFHandler &dof, // } // }; -// vector dofs_on_cell (fe.dofs_per_cell); -// vector > support_points (fe.dofs_per_cell); +// vector dofs_on_cell (fe.dofs_per_cell); +// vector > support_points (fe.dofs_per_cell); // vector > rep_points (n_rep_points); // vector > function_values_at_rep_points ( @@ -206,10 +206,10 @@ void VectorTools::interpolate (const DoFHandler &dof, Assert(dofs_of_rep_points.size()==n_rep_points, ExcInternalError()); Assert(dof_to_rep_index_table.size()==fe.dofs_per_cell, ExcInternalError()); - vector dofs_on_cell (fe.dofs_per_cell); - vector > support_points (fe.dofs_per_cell); + vector dofs_on_cell (fe.dofs_per_cell); + vector > support_points (fe.dofs_per_cell); - vector > rep_points (n_rep_points); + vector > 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 &dof_1, Vector cell_data_1(dof_1.get_fe().dofs_per_cell); Vector cell_data_2(dof_2.get_fe().dofs_per_cell); - vector touch_count (dof_2.n_dofs(), 0); - vector local_dof_indices (dof_2.get_fe().dofs_per_cell); + vector touch_count (dof_2.n_dofs(), 0); + vector local_dof_indices (dof_2.get_fe().dofs_per_cell); DoFHandler::active_cell_iterator h = dof_1.begin_active(); DoFHandler::active_cell_iterator l = dof_2.begin_active(); @@ -367,7 +367,7 @@ void VectorTools::project (const DoFHandler &dof, const FiniteElement &fe = dof.get_fe(); // make up boundary values - map boundary_values; + map boundary_values; if (enforce_zero_boundary == true) // no need to project boundary values, but @@ -376,7 +376,7 @@ void VectorTools::project (const DoFHandler &dof, { DoFHandler::active_face_iterator face = dof.begin_active_face(), endf = dof.end_face(); - vector face_dof_indices (fe.dofs_per_face); + vector 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 &dof, template <> void -VectorTools::interpolate_boundary_values (const DoFHandler<1> &dof, - const unsigned char boundary_component, - const Function<1> &boundary_function, - map &boundary_values, - const vector &component_mask_) +VectorTools::interpolate_boundary_values (const DoFHandler<1> &dof, + const unsigned char boundary_component, + const Function<1> &boundary_function, + map &boundary_values, + const vector &component_mask_) { Assert (boundary_component != 255, ExcInvalidBoundaryIndicator()); @@ -577,11 +577,11 @@ VectorTools::interpolate_boundary_values (const DoFHandler<1> &dof, template void -VectorTools::interpolate_boundary_values (const DoFHandler &dof, - const unsigned char boundary_component, - const Function &boundary_function, - map &boundary_values, - const vector &component_mask_) +VectorTools::interpolate_boundary_values (const DoFHandler &dof, + const unsigned char boundary_component, + const Function &boundary_function, + map &boundary_values, + const vector &component_mask_) { Assert (boundary_component != 255, ExcInvalidBoundaryIndicator()); @@ -603,8 +603,8 @@ VectorTools::interpolate_boundary_values (const DoFHandler &dof, ExcComponentMismatch()); // field to store the indices of dofs - vector face_dofs (fe.dofs_per_face, -1); - vector > dof_locations (face_dofs.size(), Point()); + vector face_dofs (fe.dofs_per_face, -1); + vector > dof_locations (face_dofs.size(), Point()); // 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 &dof, const map*> &boundary_functions, const Quadrature &q, - map &boundary_values) + map &boundary_values) { Assert (dof.get_fe().n_components() == boundary_functions.begin()->second->n_components, ExcComponentMismatch()); - vector dof_to_boundary_mapping; + vector 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 &dof, // fill in boundary values for (unsigned int i=0; i::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 &, const map*>&, const Quadrature&, - map &); + map &); template void VectorTools::create_right_hand_side (const DoFHandler &, @@ -1017,7 +1017,7 @@ template void VectorTools::interpolate_boundary_values (const DoFHandler &, const unsigned char, const Function &, - map &, + map &, const vector &); template void VectorTools::project (const DoFHandler &, diff --git a/deal.II/examples/step-3/step-3.cc b/deal.II/examples/step-3/step-3.cc index 448bae97f8..990d8e46a4 100644 --- a/deal.II/examples/step-3/step-3.cc +++ b/deal.II/examples/step-3/step-3.cc @@ -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 cell_matrix (dofs_per_cell, dofs_per_cell); - Vector cell_rhs (dofs_per_cell); + FullMatrix cell_matrix (dofs_per_cell, dofs_per_cell); + Vector 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 local_dof_indices (dofs_per_cell); + vector 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 boundary_values; + map boundary_values; VectorTools::interpolate_boundary_values (dof_handler, 0, ZeroFunction<2>(), diff --git a/deal.II/examples/step-4/step-4.cc b/deal.II/examples/step-4/step-4.cc index 805feb5f53..bac3800554 100644 --- a/deal.II/examples/step-4/step-4.cc +++ b/deal.II/examples/step-4/step-4.cc @@ -352,13 +352,13 @@ void LaplaceProblem::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 cell_matrix (dofs_per_cell, dofs_per_cell); - Vector cell_rhs (dofs_per_cell); + FullMatrix cell_matrix (dofs_per_cell, dofs_per_cell); + Vector cell_rhs (dofs_per_cell); - vector local_dof_indices (dofs_per_cell); + vector local_dof_indices (dofs_per_cell); // Note here, that a cell is a // quadrilateral in two space @@ -446,7 +446,7 @@ void LaplaceProblem::assemble_system () // would like to use (i.e. the // BoundaryValues class declared // above): - map boundary_values; + map boundary_values; VectorTools::interpolate_boundary_values (dof_handler, 0, BoundaryValues(), diff --git a/deal.II/examples/step-5/step-5.cc b/deal.II/examples/step-5/step-5.cc index 4f389ee257..3584831dd5 100644 --- a/deal.II/examples/step-5/step-5.cc +++ b/deal.II/examples/step-5/step-5.cc @@ -335,13 +335,13 @@ void LaplaceProblem::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 cell_matrix (dofs_per_cell, dofs_per_cell); - Vector cell_rhs (dofs_per_cell); + FullMatrix cell_matrix (dofs_per_cell, dofs_per_cell); + Vector cell_rhs (dofs_per_cell); - vector local_dof_indices (dofs_per_cell); + vector local_dof_indices (dofs_per_cell); // Below, we will ask the // Coefficient class to compute the @@ -558,7 +558,7 @@ void LaplaceProblem::assemble_system () }; // Again use zero boundary values: - map boundary_values; + map boundary_values; VectorTools::interpolate_boundary_values (dof_handler, 0, ZeroFunction(), diff --git a/deal.II/examples/step-6/step-6.cc b/deal.II/examples/step-6/step-6.cc index 2f33358c23..0629bdc820 100644 --- a/deal.II/examples/step-6/step-6.cc +++ b/deal.II/examples/step-6/step-6.cc @@ -449,15 +449,15 @@ void LaplaceProblem::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 cell_matrix (dofs_per_cell, dofs_per_cell); - Vector cell_rhs (dofs_per_cell); + FullMatrix cell_matrix (dofs_per_cell, dofs_per_cell); + Vector cell_rhs (dofs_per_cell); - vector local_dof_indices (dofs_per_cell); + vector local_dof_indices (dofs_per_cell); - vector coefficient_values (n_q_points); + vector coefficient_values (n_q_points); // We can now go on with assembling // the matrix and right hand @@ -554,7 +554,7 @@ void LaplaceProblem::assemble_system () // from the system of equations // happens *after* the elimination // of hanging nodes. - map boundary_values; + map boundary_values; VectorTools::interpolate_boundary_values (dof_handler, 0, ZeroFunction(), diff --git a/deal.II/examples/step-7/step-7.cc b/deal.II/examples/step-7/step-7.cc index c14b80d9ff..0caa12938f 100644 --- a/deal.II/examples/step-7/step-7.cc +++ b/deal.II/examples/step-7/step-7.cc @@ -230,16 +230,16 @@ void LaplaceProblem::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 right_hand_side; - vector rhs_values (n_q_points); + RightHandSide right_hand_side; + vector rhs_values (n_q_points); - FullMatrix cell_matrix (dofs_per_cell, dofs_per_cell); - Vector cell_rhs (dofs_per_cell); + FullMatrix cell_matrix (dofs_per_cell, dofs_per_cell); + Vector cell_rhs (dofs_per_cell); - vector local_dof_indices (dofs_per_cell); + vector local_dof_indices (dofs_per_cell); DoFHandler::active_cell_iterator cell = dof_handler.begin_active(), endc = dof_handler.end(); @@ -289,7 +289,7 @@ void LaplaceProblem::assemble_system () hanging_node_constraints.condense (system_matrix); hanging_node_constraints.condense (system_rhs); - map boundary_values; + map boundary_values; VectorTools::interpolate_boundary_values (dof_handler, 0, Solution(), diff --git a/deal.II/examples/step-8/step-8.cc b/deal.II/examples/step-8/step-8.cc index 5b03e6e1e3..51f6741f93 100644 --- a/deal.II/examples/step-8/step-8.cc +++ b/deal.II/examples/step-8/step-8.cc @@ -453,13 +453,13 @@ void ElasticProblem::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 cell_matrix (dofs_per_cell, dofs_per_cell); - Vector cell_rhs (dofs_per_cell); + FullMatrix cell_matrix (dofs_per_cell, dofs_per_cell); + Vector cell_rhs (dofs_per_cell); - vector local_dof_indices (dofs_per_cell); + vector local_dof_indices (dofs_per_cell); // As was shown in previous // examples as well, we need a @@ -729,7 +729,7 @@ void ElasticProblem::assemble_system () // we need to pass ``dim'' as // number of components to the zero // function as well. - map boundary_values; + map boundary_values; VectorTools::interpolate_boundary_values (dof_handler, 0, ZeroFunction(dim), diff --git a/tests/big-tests/multigrid/multigrid.cc b/tests/big-tests/multigrid/multigrid.cc index 7769168471..ceed517aea 100644 --- a/tests/big-tests/multigrid/multigrid.cc +++ b/tests/big-tests/multigrid/multigrid.cc @@ -232,16 +232,16 @@ void LaplaceProblem::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 cell_matrix (dofs_per_cell, dofs_per_cell); - Vector cell_rhs (dofs_per_cell); + FullMatrix cell_matrix (dofs_per_cell, dofs_per_cell); + Vector cell_rhs (dofs_per_cell); - vector local_dof_indices (dofs_per_cell); + vector local_dof_indices (dofs_per_cell); // FIX - vector coefficient_values (n_q_points, 1.0); + vector coefficient_values (n_q_points, 1.0); // not only active cells MGDoFHandler::cell_iterator cell = mg_dof_handler.begin(), @@ -309,7 +309,7 @@ void LaplaceProblem::assemble_system () hanging_node_constraints.condense (global_system_matrix); hanging_node_constraints.condense (system_rhs); -// map boundary_values; +// map boundary_values; // VectorTools::interpolate_boundary_values (mg_dof_handler, // 0, // ZeroFunction(), diff --git a/tests/deal.II/helmholtz1.th b/tests/deal.II/helmholtz1.th index 3f09e4f11d..157e1810b0 100644 --- a/tests/deal.II/helmholtz1.th +++ b/tests/deal.II/helmholtz1.th @@ -15,7 +15,7 @@ Helmholtz::build_all(MATRIX& A, Vector elvec(fe_dofs); FullMatrix elmat(fe_dofs); - vector indices(fe_dofs); + vector indices(fe_dofs); //////////////////////////////////////////////////// // Loop for computing the element matrices diff --git a/tests/deal.II/helmholtz1mg.th b/tests/deal.II/helmholtz1mg.th index 4487979877..4f56eaec1d 100644 --- a/tests/deal.II/helmholtz1mg.th +++ b/tests/deal.II/helmholtz1mg.th @@ -13,7 +13,7 @@ Helmholtz::build_mgmatrix(MGLevelObject& A, Vector elvec(fe_dofs); FullMatrix elmat(fe_dofs); - vector indices(fe_dofs); + vector indices(fe_dofs); //////////////////////////////////////////////////// // Loop for computing the element matrices diff --git a/tests/deal.II/wave-test-3.cc b/tests/deal.II/wave-test-3.cc index 4d8c768d50..b1bb101af8 100644 --- a/tests/deal.II/wave-test-3.cc +++ b/tests/deal.II/wave-test-3.cc @@ -2137,7 +2137,7 @@ void EndEnergy::compute_vectors (const PartOfDomain pod, vector density_values(quadrature->n_quadrature_points); vector stiffness_values(quadrature->n_quadrature_points); - vector cell_dof_indices (dofs_per_cell); + vector cell_dof_indices (dofs_per_cell); for (; cell!=endc; ++cell, ++primal_cell) { @@ -2264,7 +2264,7 @@ void SeismicSignal::compute_functionals (Vector &j1, cell = dof->begin_active(); endc = dof->end(); - vector cell_dof_indices (dofs_per_cell); + vector cell_dof_indices (dofs_per_cell); FEFaceValues fe_face_values (*fe, *quadrature_face, UpdateFlags(update_values | @@ -2334,7 +2334,7 @@ void EarthSurface::compute_functionals (Vector &j1, cell = dof->begin_active(); endc = dof->end(); - vector face_dof_indices (face_dofs); + vector face_dof_indices (face_dofs); for (; cell!=endc; ++cell) for (unsigned int face_no=0; face_no::faces_per_cell; @@ -2398,7 +2398,7 @@ void SplitSignal::compute_functionals (Vector &j1, cell = dof->begin_active(); endc = dof->end(); - vector dof_indices (fe->dofs_per_cell); + vector dof_indices (fe->dofs_per_cell); FEFaceValues 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 &final_u_bar, endc = dof->end (); FEValues fe_values (*fe, *quadrature, UpdateFlags(update_values | update_JxW_values)); - vector cell_dof_indices (dofs_per_cell); + vector cell_dof_indices (dofs_per_cell); for (; cell!=endc; ++cell) { @@ -2518,7 +2518,7 @@ void OneBranch1d::compute_functionals (Vector &j1, cell = dof->begin_active(); endc = dof->end(); - vector dof_indices (fe->dofs_per_cell); + vector dof_indices (fe->dofs_per_cell); FEValues fe_values (*fe, *quadrature, UpdateFlags(update_values | update_JxW_values)); for (; cell!=endc; ++cell) @@ -2567,7 +2567,7 @@ void SecondCrossing::compute_functionals (Vector &j1, cell = dof->begin_active(); endc = dof->end(); - vector dof_indices (fe->dofs_per_cell); + vector dof_indices (fe->dofs_per_cell); FEValues fe_values (*fe, *quadrature, UpdateFlags(update_values | update_JxW_values)); for (; cell!=endc; ++cell) @@ -5533,7 +5533,7 @@ void TimeStep_Wave::create_matrices () // indices of all the dofs on this // cell - vector dof_indices_on_cell (dofs_per_cell); + vector dof_indices_on_cell (dofs_per_cell); FullMatrix cell_mass_matrix (dofs_per_cell, dofs_per_cell); FullMatrix cell_laplace_matrix (dofs_per_cell, dofs_per_cell); @@ -5928,7 +5928,7 @@ void TimeStep_Dual::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 boundary_value_list; + map boundary_value_list; if (dim != 1) { static const ZeroFunction boundary_values; @@ -6210,7 +6210,7 @@ TimeStep_Dual::build_rhs (const DoFHandler::cell_iterator &old_cell, // transfer into the global // right hand side - vector new_dof_indices (dofs_per_cell, -1); + vector new_dof_indices (dofs_per_cell, DoFHandler::invalid_dof_index); new_cell->get_dof_indices (new_dof_indices); for (unsigned int i=0; i::build_rhs (const DoFHandler::cell_iterator &old_cell, // transfer into the global // right hand side - vector new_dof_indices (dofs_per_cell); + vector new_dof_indices (dofs_per_cell); new_cell->get_dof_indices (new_dof_indices); for (unsigned int i=0; i::distribute_to_children (const DoFHandler::cell_iterator // indices of the dofs of a cell on // the new grid - vector new_dof_indices (dofs_per_cell, -1); + vector new_dof_indices (dofs_per_cell, DoFHandler::invalid_dof_index); // loop over the child cells @@ -8263,7 +8263,7 @@ void TimeStep_Primal::do_timestep () parameters.boundary_values_u->set_time (time); parameters.boundary_values_v->set_time (time); - map boundary_value_list; + map boundary_value_list; VectorTools::interpolate_boundary_values (*dof_handler, 0, *(parameters.boundary_values_u), boundary_value_list); @@ -8289,7 +8289,7 @@ void TimeStep_Primal::do_timestep () // at all if (dim != 1) { - map boundary_value_list; + map boundary_value_list; VectorTools::interpolate_boundary_values (*dof_handler, 0, *(parameters.boundary_values_v), boundary_value_list); @@ -8535,7 +8535,7 @@ TimeStep_Primal::build_rhs (const DoFHandler::cell_iterator &old_cell, // transfer into the global // right hand side - vector new_dof_indices (dofs_per_cell, -1); + vector new_dof_indices (dofs_per_cell, DoFHandler::invalid_dof_index); new_cell->get_dof_indices (new_dof_indices); for (unsigned int i=0; i::build_rhs (const DoFHandler::cell_iterator &old_cell, // transfer into the global // right hand side - vector new_dof_indices (dofs_per_cell); + vector new_dof_indices (dofs_per_cell); new_cell->get_dof_indices (new_dof_indices); for (unsigned int i=0; i::distribute_to_children (const DoFHandler::cell_iterat // indices of the dofs of a cell on // the new grid - vector new_dof_indices (dofs_per_cell, -1); + vector new_dof_indices (dofs_per_cell, DoFHandler::invalid_dof_index); // loop over the child cells