From 6dcac5c76e113b5626a1d66911f5b2e7e6fe847c Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Tue, 2 May 2006 15:28:40 +0000 Subject: [PATCH] Final changes and simplifications. Documentation updates. git-svn-id: https://svn.dealii.org/trunk@12966 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/dofs/dof_accessor.h | 861 +++++------------- .../include/dofs/dof_accessor.templates.h | 153 ++-- deal.II/deal.II/include/dofs/dof_levels.h | 137 ++- deal.II/deal.II/include/dofs/hp_dof_levels.h | 139 ++- deal.II/deal.II/source/dofs/dof_levels.cc | 120 +-- deal.II/deal.II/source/dofs/hp_dof_levels.cc | 120 +-- .../source/multigrid/mg_dof_accessor.cc | 60 +- 7 files changed, 673 insertions(+), 917 deletions(-) diff --git a/deal.II/deal.II/include/dofs/dof_accessor.h b/deal.II/deal.II/include/dofs/dof_accessor.h index e1c63110f3..deeb3fd039 100644 --- a/deal.II/deal.II/include/dofs/dof_accessor.h +++ b/deal.II/deal.II/include/dofs/dof_accessor.h @@ -109,6 +109,13 @@ class DoFObjectAccessor_Inheritance * to edges, faces, and cells of a triangulation. The concept is * explained in more detail in connection to @ref Iterators. * + * This class follows mainly the route laid out by the accessor library + * declared in the triangulation library (TriaAccessor). It enables + * the user to access the degrees of freedom on the lines (there are similar + * versions for the DoFs on quads, etc), where the dimension of the underlying + * triangulation does not really matter (i.e. this accessor works with the + * lines in 1D-, 2D-, etc dimensions). + * * The first template argument of this class refers to the structural * dimension of the thing accessed: it is 1 for lines, 2 for quads, or * 3 for hexes. The second argument denotes the type of DoF handler we @@ -123,10 +130,42 @@ class DoFObjectAccessor_Inheritance * in 2d have access to all the mesh aspects of cells, whereas * accessors to quads in 3d can only access things that make sense for * faces. + * + * + *

Usage

+ * + * Usage is best to happen through the typedefs to the various kinds + * of iterators provided by the DoFHandler and hp::DoFHandler classes, + * since they are more secure to changes in the class naming and + * template interface as well as providing easier typing (much less + * complicated names!). * + * + *

Inheritance

+ * + * If the structural dimension given by the first template argument + * equals the dimension of the DoFHandler (given as the second + * template argument), then we are obviously dealing with cells, + * rather than lower-dimensional objects. In that case, inheritance is + * from CellAccessor, to provide access to all the cell specific + * information afforded by that class. Otherwise, i.e. for + * lower-dimensional objects, inheritance is from TriaObjectAccessor. + * + * There are classes DoFObjectAccessor<1>, DoFObjectAccessor<2>, and + * DoFObjectAccessor<3> derived from the present class that provide + * things that are specific to objects of a particular + * dimensionality. For example, DoFObjectAccessor<2> allows access to + * the DoF iterators pointing to the lines that bound that + * quadrilateral, which is obviously something that a line can't + * do. Consequently, these few operations are declared in these + * derived classes. + * + * In addition, there is a DoFCellAccessor class that provides the + * equivalent to the CellAccessor class. + * * @ingroup dofs - * @ingroup Accessors - * @author Wolfgang Bangerth, 1998 + * @ingroup Accessors + * @author Wolfgang Bangerth, 1998, 2006 */ template class DoFAccessor : public DoFObjectAccessor_Inheritance::BaseClass @@ -193,11 +232,10 @@ class DoFAccessor : public DoFObjectAccessor_Inheritance > child (const unsigned int c) const; - - /** - * Set the index of the - * ith degree of freedom - * of this object to @p index. + + /** + * Index of the i degree + * on the @p vertexth vertex. * * The last argument denotes the * finite element index. For the @@ -230,13 +268,13 @@ class DoFAccessor : public DoFObjectAccessor_Inheritancei degree - * on the @p vertexth vertex. + * Set the index of the i degree + * on the @p vertexth vertex to @p index. * * The last argument denotes the * finite element index. For the @@ -269,13 +307,14 @@ class DoFAccessor : public DoFObjectAccessor_Inheritancei degree - * on the @p vertexth vertex to @p index. + * Index of the ith degree + * of freedom of this object. * * The last argument denotes the * finite element index. For the @@ -308,10 +347,48 @@ class DoFAccessor : public DoFObjectAccessor_Inheritanceith degree of freedom + * of this object to @p index. + * + * The last argument denotes the + * finite element index. For the + * standard ::DoFHandler class, + * this value must be equal to + * its default value since that + * class only supports the same + * finite element on all cells + * anyway. + * + * However, for hp objects + * (i.e. the hp::DoFHandler + * class), different finite + * element objects may be used on + * different cells. On faces + * between two cells, as well as + * vertices, there may therefore + * be two sets of degrees of + * freedom, one for each of the + * finite elements used on the + * adjacent cells. In order to + * specify which set of degrees + * of freedom to work on, the + * last argument is used to + * disambiguate. Finally, if this + * function is called for a cell + * object, there can only be a + * single set of degrees of + * freedom, and fe_index has to + * match the result of + * active_fe_index(). + */ + void set_dof_index (const unsigned int i, + const unsigned int index, + const unsigned int fe_index = DH::default_fe_index) const; /** * Exceptions for child classes @@ -383,44 +460,47 @@ class DoFAccessor : public DoFObjectAccessor_Inheritance, @ref - * DoFObjectAccessor<2,DH>, @ref DoFObjectAccessor<3,DH>). 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 @p quad in the - * accessors for lines and quads, etc. - * - * This class follows mainly the route laid out by the accessor library - * declared in the triangulation library (TriaAccessor). It enables - * the user to access the degrees of freedom on the lines (there are similar - * versions for the DoFs on quads, etc), where the dimension of the underlying - * triangulation does not really matter (i.e. this accessor works with the - * lines in 1D-, 2D-, etc dimensions). - * - * - *

Usage

- * - * The DoFDimensionInfo classes inherited by the DoFHandler classes - * declare typedefs to iterators using the accessors declared in this class - * 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!). - * - * - *

Notes about the class hierarchy structure

- * - * See the report on this subject, which is available from the general - * documentation directory. + * Closure class. Unused, but necessary for some template constructs. + * @ingroup dofs + * @ingroup Accessors + */ +template +class DoFObjectAccessor<0, DH> : public DoFAccessor<0, DH> +{ + public: + /** + * Extract dimension from DH. + */ + static const unsigned int dim = DH::dimension; + + typedef void AccessorData; + + /** + * Constructor. Should never be called + * and thus throws an error. + */ + DoFObjectAccessor (Triangulation *, + const int, + const int, + const AccessorData *) + { + Assert (false, ExcInternalError()); + } +}; + + + +/** + * Grant access to those aspects of degrees of freedom located on + * quads that are dimension specific. See the DoFAccessor class for + * more information. * * @ingroup dofs * @ingroup Accessors - * @author Wolfgang Bangerth, 1998; Guido Kanschat, 1999 + * @author Wolfgang Bangerth, 1998, 2006 */ -template -class DoFObjectAccessor : public DoFAccessor +template +class DoFObjectAccessor<1, DH> : public DoFAccessor<1,DH> { public: /** @@ -429,7 +509,9 @@ class DoFObjectAccessor : public DoFAccessor static const unsigned int dim = DH::dimension; /** - * Data type passed by the iterator class. + * Declare the data type that this accessor + * class expects to get passed from the + * iterator classes. */ typedef DH AccessorData; @@ -437,28 +519,50 @@ class DoFObjectAccessor : public DoFAccessor * Declare base class as a local typedef * for simpler access. */ - typedef TriaObjectAccessor BaseClass; - + typedef DoFAccessor<1,DH> BaseClass; /** - * Default constructor. Unused, thus + * Default constructor, unused thus * not implemented. */ DoFObjectAccessor (); - + /** * Constructor. The @p local_data * argument is assumed to be a pointer * to a DoFHandler object. */ - DoFObjectAccessor (const Triangulation *tria, + DoFObjectAccessor (const Triangulation *tria, const int level, const int index, - const AccessorData *local_data); - - /** - * Index of the ith degree - * of freedom of this object. + const AccessorData *local_data); + + /** + * Return the indices of the dofs of this + * object in the standard ordering: dofs + * on vertex 0, dofs on vertex 1, etc, + * dofs on line 0, dofs on line 1, etc, + * dofs on quad 0, etc. + * + * The vector has to have the + * right size before being passed + * to this function. + * + * This function is most often + * used on active objects (edges, + * faces, cells). It can be used + * on non-active objects as well + * (i.e. objects that have + * children), but only if the + * finite element under + * consideration has degrees of + * freedom exclusively on + * vertices. Otherwise, the + * function doesn't make much + * sense, since for example + * inactive edges do not have + * degrees of freedom associated + * with them at all. * * The last argument denotes the * finite element index. For the @@ -490,10 +594,72 @@ class DoFObjectAccessor : public DoFAccessor * freedom, and fe_index has to * match the result of * active_fe_index(). + * + * For cells, there is only a + * single possible finite element + * index (namely the one for that + * cell, returned by + * cell-@>active_fe_index. Consequently, + * the derived DoFCellAccessor + * class has an overloaded + * version of this function that + * calls the present function + * with + * cell-@>active_fe_index + * as last argument. */ - unsigned int dof_index (const unsigned int i, - const unsigned int fe_index = DH::default_fe_index) const; + void get_dof_indices (std::vector &dof_indices, + const unsigned int fe_index = DH::default_fe_index) const; +}; + + +/** + * Grant access to those aspects of degrees of freedom located on + * quads that are dimension specific. See the DoFAccessor class for + * more information. + * + * @ingroup dofs + * @ingroup Accessors + * @author Wolfgang Bangerth, 1998, 2006 + */ +template +class DoFObjectAccessor<2, DH> : public DoFAccessor<2,DH> +{ + public: + /** + * Extract dimension from DH. + */ + static const unsigned int dim = DH::dimension; + + /** + * Declare the data type that this accessor + * class expects to get passed from the + * iterator classes. + */ + typedef DH AccessorData; + + /** + * Declare base class as a local typedef + * for simpler access. + */ + typedef DoFAccessor<2,DH> BaseClass; + + /** + * Default constructor, unused thus + * not implemented. + */ + DoFObjectAccessor (); + /** + * Constructor. The @p local_data + * argument is assumed to be a pointer + * to a DoFHandler object. + */ + DoFObjectAccessor (const Triangulation *tria, + const int level, + const int index, + const AccessorData *local_data); + /** * Return the indices of the dofs of this * object in the standard ordering: dofs @@ -569,487 +735,25 @@ class DoFObjectAccessor : public DoFAccessor const unsigned int fe_index = DH::default_fe_index) const; /** - * Pointer to the ith line - * bounding this Object. + * Return a pointer to the @p ith line + * bounding this @p Quad. */ - TriaIterator > + TriaIterator > line (const unsigned int i) const; - - /** - * Pointer to the ith quad - * bounding this Object. - */ - TriaIterator > - quad (const unsigned int i) const; }; /** - * Closure class. + * Grant access to those aspects of degrees of freedom located on + * hexes that are dimension specific. See the DoFAccessor class for + * more information. + * * @ingroup dofs * @ingroup Accessors + * @author Wolfgang Bangerth, 1998, 2006 */ template -class DoFObjectAccessor<0, DH> : public DoFAccessor<0, DH> -{ - public: - /** - * Extract dimension from DH. - */ - static const unsigned int dim = DH::dimension; - - typedef void AccessorData; - - /** - * Constructor. Should never be called - * and thus throws an error. - */ - DoFObjectAccessor (Triangulation *, - const int, - const int, - const AccessorData *) - { - Assert (false, ExcInternalError()); - } -}; - - -/** - * 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 (TriaAccessor). It enables - * the user to access the degrees of freedom on the lines (there are similar - * versions for the DoFs on quads, etc), where the dimension of the underlying - * triangulation does not really matter (i.e. this accessor works with the - * lines in 1D-, 2D-, etc dimensions). - * - * - *

Usage

- * - * The DoFDimensionInfo classes inherited by the 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 - * are more secure to changes in the class naming and template interface as well - * as they provide easier typing (much less complicated names!). - * - * - *

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 @p 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. - * - * @ingroup dofs - * @ingroup Accessors - * @author Wolfgang Bangerth, 1998 - */ -template -class DoFObjectAccessor<1, DH> : public DoFAccessor<1,DH> -{ - public: - /** - * Extract dimension from DH. - */ - static const unsigned int dim = DH::dimension; - - /** - * Declare the data type that this accessor - * class expects to get passed from the - * iterator classes. - */ - typedef DH AccessorData; - - /** - * Declare base class as a local typedef - * for simpler access. - */ - typedef DoFAccessor<1,DH> BaseClass; - - /** - * Default constructor, unused thus - * not implemented. - */ - DoFObjectAccessor (); - - /** - * Constructor. The @p local_data - * argument is assumed to be a pointer - * to a DoFHandler object. - */ - DoFObjectAccessor (const Triangulation *tria, - const int level, - const int index, - const AccessorData *local_data); - - /** - * Index of the ith degree - * of freedom of this object. - * - * The last argument denotes the - * finite element index. For the - * standard ::DoFHandler class, - * this value must be equal to - * its default value since that - * class only supports the same - * finite element on all cells - * anyway. - * - * However, for hp objects - * (i.e. the hp::DoFHandler - * class), different finite - * element objects may be used on - * different cells. On faces - * between two cells, as well as - * vertices, there may therefore - * be two sets of degrees of - * freedom, one for each of the - * finite elements used on the - * adjacent cells. In order to - * specify which set of degrees - * of freedom to work on, the - * last argument is used to - * disambiguate. Finally, if this - * function is called for a cell - * object, there can only be a - * single set of degrees of - * freedom, and fe_index has to - * match the result of - * active_fe_index(). - */ - unsigned int dof_index (const unsigned int i, - const unsigned int fe_index = DH::default_fe_index) const; - - /** - * Set the index of the - * ith degree of freedom - * of this object to @p index. - * - * The last argument denotes the - * finite element index. For the - * standard ::DoFHandler class, - * this value must be equal to - * its default value since that - * class only supports the same - * finite element on all cells - * anyway. - * - * However, for hp objects - * (i.e. the hp::DoFHandler - * class), different finite - * element objects may be used on - * different cells. On faces - * between two cells, as well as - * vertices, there may therefore - * be two sets of degrees of - * freedom, one for each of the - * finite elements used on the - * adjacent cells. In order to - * specify which set of degrees - * of freedom to work on, the - * last argument is used to - * disambiguate. Finally, if this - * function is called for a cell - * object, there can only be a - * single set of degrees of - * freedom, and fe_index has to - * match the result of - * active_fe_index(). - */ - void set_dof_index (const unsigned int i, - const unsigned int index, - const unsigned int fe_index = DH::default_fe_index) const; - - /** - * Return the indices of the dofs of this - * object in the standard ordering: dofs - * on vertex 0, dofs on vertex 1, etc, - * dofs on line 0, dofs on line 1, etc, - * dofs on quad 0, etc. - * - * The vector has to have the - * right size before being passed - * to this function. - * - * This function is most often - * used on active objects (edges, - * faces, cells). It can be used - * on non-active objects as well - * (i.e. objects that have - * children), but only if the - * finite element under - * consideration has degrees of - * freedom exclusively on - * vertices. Otherwise, the - * function doesn't make much - * sense, since for example - * inactive edges do not have - * degrees of freedom associated - * with them at all. - * - * The last argument denotes the - * finite element index. For the - * standard ::DoFHandler class, - * this value must be equal to - * its default value since that - * class only supports the same - * finite element on all cells - * anyway. - * - * However, for hp objects - * (i.e. the hp::DoFHandler - * class), different finite - * element objects may be used on - * different cells. On faces - * between two cells, as well as - * vertices, there may therefore - * be two sets of degrees of - * freedom, one for each of the - * finite elements used on the - * adjacent cells. In order to - * specify which set of degrees - * of freedom to work on, the - * last argument is used to - * disambiguate. Finally, if this - * function is called for a cell - * object, there can only be a - * single set of degrees of - * freedom, and fe_index has to - * match the result of - * active_fe_index(). - * - * For cells, there is only a - * single possible finite element - * index (namely the one for that - * cell, returned by - * cell-@>active_fe_index. Consequently, - * the derived DoFCellAccessor - * class has an overloaded - * version of this function that - * calls the present function - * with - * cell-@>active_fe_index - * as last argument. - */ - void get_dof_indices (std::vector &dof_indices, - const unsigned int fe_index = DH::default_fe_index) const; -}; - - -/** - * Grant access to the degrees of freedom located on quads. - * - * @ingroup dofs - * @ingroup Accessors - */ -template -class DoFObjectAccessor<2, DH> : public DoFAccessor<2,DH> -{ - public: - /** - * Extract dimension from DH. - */ - static const unsigned int dim = DH::dimension; - - /** - * Declare the data type that this accessor - * class expects to get passed from the - * iterator classes. - */ - typedef DH AccessorData; - - /** - * Declare base class as a local typedef - * for simpler access. - */ - typedef DoFAccessor<2,DH> BaseClass; - - /** - * Default constructor, unused thus - * not implemented. - */ - DoFObjectAccessor (); - - /** - * Constructor. The @p local_data - * argument is assumed to be a pointer - * to a DoFHandler object. - */ - DoFObjectAccessor (const Triangulation *tria, - const int level, - const int index, - const AccessorData *local_data); - - /** - * Index of the ith degree - * of freedom of this object. - * - * The last argument denotes the - * finite element index. For the - * standard ::DoFHandler class, - * this value must be equal to - * its default value since that - * class only supports the same - * finite element on all cells - * anyway. - * - * However, for hp objects - * (i.e. the hp::DoFHandler - * class), different finite - * element objects may be used on - * different cells. On faces - * between two cells, as well as - * vertices, there may therefore - * be two sets of degrees of - * freedom, one for each of the - * finite elements used on the - * adjacent cells. In order to - * specify which set of degrees - * of freedom to work on, the - * last argument is used to - * disambiguate. Finally, if this - * function is called for a cell - * object, there can only be a - * single set of degrees of - * freedom, and fe_index has to - * match the result of - * active_fe_index(). - */ - unsigned int dof_index (const unsigned int i, - const unsigned int fe_index = DH::default_fe_index) const; - - /** - * Set the index of the - * ith degree of freedom - * of this object to @p index. - * - * The last argument denotes the - * finite element index. For the - * standard ::DoFHandler class, - * this value must be equal to - * its default value since that - * class only supports the same - * finite element on all cells - * anyway. - * - * However, for hp objects - * (i.e. the hp::DoFHandler - * class), different finite - * element objects may be used on - * different cells. On faces - * between two cells, as well as - * vertices, there may therefore - * be two sets of degrees of - * freedom, one for each of the - * finite elements used on the - * adjacent cells. In order to - * specify which set of degrees - * of freedom to work on, the - * last argument is used to - * disambiguate. Finally, if this - * function is called for a cell - * object, there can only be a - * single set of degrees of - * freedom, and fe_index has to - * match the result of - * active_fe_index(). - */ - void set_dof_index (const unsigned int i, - const unsigned int index, - const unsigned int fe_index = DH::default_fe_index) const; - - /** - * Return the indices of the dofs of this - * object in the standard ordering: dofs - * on vertex 0, dofs on vertex 1, etc, - * dofs on line 0, dofs on line 1, etc, - * dofs on quad 0, etc. - * - * The vector has to have the - * right size before being passed - * to this function. - * - * This function is most often - * used on active objects (edges, - * faces, cells). It can be used - * on non-active objects as well - * (i.e. objects that have - * children), but only if the - * finite element under - * consideration has degrees of - * freedom exclusively on - * vertices. Otherwise, the - * function doesn't make much - * sense, since for example - * inactive edges do not have - * degrees of freedom associated - * with them at all. - * - * The last argument denotes the - * finite element index. For the - * standard ::DoFHandler class, - * this value must be equal to - * its default value since that - * class only supports the same - * finite element on all cells - * anyway. - * - * However, for hp objects - * (i.e. the hp::DoFHandler - * class), different finite - * element objects may be used on - * different cells. On faces - * between two cells, as well as - * vertices, there may therefore - * be two sets of degrees of - * freedom, one for each of the - * finite elements used on the - * adjacent cells. In order to - * specify which set of degrees - * of freedom to work on, the - * last argument is used to - * disambiguate. Finally, if this - * function is called for a cell - * object, there can only be a - * single set of degrees of - * freedom, and fe_index has to - * match the result of - * active_fe_index(). - * - * For cells, there is only a - * single possible finite element - * index (namely the one for that - * cell, returned by - * cell-@>active_fe_index. Consequently, - * the derived DoFCellAccessor - * class has an overloaded - * version of this function that - * calls the present function - * with - * cell-@>active_fe_index - * as last argument. - */ - void get_dof_indices (std::vector &dof_indices, - const unsigned int fe_index = DH::default_fe_index) const; - - /** - * Return a pointer to the @p ith line - * bounding this @p Quad. - */ - TriaIterator > - line (const unsigned int i) const; -}; - - -/** - * Grant access to the degrees of freedom located on hexes. - * - * @ingroup dofs - * @ingroup Accessors - */ -template -class DoFObjectAccessor<3, DH> : public DoFAccessor<3,DH> +class DoFObjectAccessor<3, DH> : public DoFAccessor<3,DH> { public: /** @@ -1086,85 +790,6 @@ class DoFObjectAccessor<3, DH> : public DoFAccessor<3,DH> const int index, const AccessorData *local_data); - - /** - * Index of the ith degree - * of freedom of this object. - * - * The last argument denotes the - * finite element index. For the - * standard ::DoFHandler class, - * this value must be equal to - * its default value since that - * class only supports the same - * finite element on all cells - * anyway. - * - * However, for hp objects - * (i.e. the hp::DoFHandler - * class), different finite - * element objects may be used on - * different cells. On faces - * between two cells, as well as - * vertices, there may therefore - * be two sets of degrees of - * freedom, one for each of the - * finite elements used on the - * adjacent cells. In order to - * specify which set of degrees - * of freedom to work on, the - * last argument is used to - * disambiguate. Finally, if this - * function is called for a cell - * object, there can only be a - * single set of degrees of - * freedom, and fe_index has to - * match the result of - * active_fe_index(). - */ - unsigned int dof_index (const unsigned int i, - const unsigned int fe_index = DH::default_fe_index) const; - - /** - * Set the index of the - * ith degree of freedom - * of this object to @p index. - * - * The last argument denotes the - * finite element index. For the - * standard ::DoFHandler class, - * this value must be equal to - * its default value since that - * class only supports the same - * finite element on all cells - * anyway. - * - * However, for hp objects - * (i.e. the hp::DoFHandler - * class), different finite - * element objects may be used on - * different cells. On faces - * between two cells, as well as - * vertices, there may therefore - * be two sets of degrees of - * freedom, one for each of the - * finite elements used on the - * adjacent cells. In order to - * specify which set of degrees - * of freedom to work on, the - * last argument is used to - * disambiguate. Finally, if this - * function is called for a cell - * object, there can only be a - * single set of degrees of - * freedom, and fe_index has to - * match the result of - * active_fe_index(). - */ - void set_dof_index (const unsigned int i, - const unsigned int index, - const unsigned int fe_index = DH::default_fe_index) const; - /** * Return the indices of the dofs of this * object in the standard ordering: dofs 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 8946d4ca8a..d55facc66b 100644 --- a/deal.II/deal.II/include/dofs/dof_accessor.templates.h +++ b/deal.II/deal.II/include/dofs/dof_accessor.templates.h @@ -58,6 +58,7 @@ DoFAccessor::DoFAccessor (const Triangulation *tria template +inline void DoFAccessor::set_dof_handler (DH *dh) { @@ -88,6 +89,7 @@ DoFAccessor::operator = (const DoFAccessor &da) template +inline void DoFAccessor::copy_from (const DoFAccessor &a) { @@ -107,6 +109,7 @@ DoFAccessor::operator == (const DoFAccessor &a) cons } + template inline bool @@ -159,10 +162,12 @@ DoFAccessor::vertex_dof_index (const unsigned int vertex, template -void DoFAccessor::set_vertex_dof_index (const unsigned int vertex, - const unsigned int i, - const unsigned int index, - const unsigned int fe_index) const +inline +void +DoFAccessor::set_vertex_dof_index (const unsigned int vertex, + const unsigned int i, + const unsigned int index, + const unsigned int fe_index) const { this->dof_handler->set_vertex_dof_index (this->vertex_index(vertex), fe_index, @@ -172,6 +177,51 @@ void DoFAccessor::set_vertex_dof_index (const unsigned int vertex +template +inline +unsigned int +DoFAccessor::dof_index (const unsigned int i, + const unsigned int fe_index) const +{ + // access the respective DoF. the + // last argument disambiguates + // between the functions of same + // name in the DoFLevel hierarchy, + // to make sure we get at lines, + // quads, or hexes + return this->dof_handler->levels[this->present_level] + ->get_dof_index (*this->dof_handler, + this->present_index, + fe_index, + i, + internal::StructuralDimension()); +} + + + +template +inline +void +DoFAccessor::set_dof_index (const unsigned int i, + const unsigned int index, + const unsigned int fe_index) const +{ + // access the respective DoF. the + // last argument disambiguates + // between the functions of same + // name in the DoFLevel hierarchy, + // to make sure we get at lines, + // quads, or hexes + this->dof_handler->levels[this->present_level] + ->set_dof_index (*this->dof_handler, + this->present_index, + fe_index, + i, + index, + internal::StructuralDimension()); +} + + /*------------------------- Functions: DoFObjectAccessor<1,dim> -----------------------*/ @@ -190,37 +240,6 @@ DoFObjectAccessor (const Triangulation *tria, -template -inline -unsigned int -DoFObjectAccessor<1,DH>::dof_index (const unsigned int i, - const unsigned int fe_index) const -{ - return this->dof_handler->levels[this->present_level] - ->get_line_dof_index (*this->dof_handler, - this->present_index, - fe_index, - i); -} - - - -template -inline -void -DoFObjectAccessor<1,DH>::set_dof_index (const unsigned int i, - const unsigned int index, - const unsigned int fe_index) const -{ - this->dof_handler->levels[this->present_level] - ->set_line_dof_index (*this->dof_handler, - this->present_index, - fe_index, - i, - index); -} - - template inline @@ -298,38 +317,6 @@ DoFObjectAccessor<2,DH>::line (const unsigned int i) const -template -inline -unsigned int -DoFObjectAccessor<2,DH>::dof_index (const unsigned int i, - const unsigned int fe_index) const -{ - return this->dof_handler->levels[this->present_level] - ->get_quad_dof_index (*this->dof_handler, - this->present_index, - fe_index, - i); -} - - - -template -inline -void -DoFObjectAccessor<2,DH>::set_dof_index (const unsigned int i, - const unsigned int index, - const unsigned int fe_index) const -{ - this->dof_handler->levels[this->present_level] - ->set_quad_dof_index (*this->dof_handler, - this->present_index, - fe_index, - i, - index); -} - - - template inline void @@ -426,38 +413,6 @@ DoFObjectAccessor<3,DH>::quad (const unsigned int i) const -template -inline -unsigned int -DoFObjectAccessor<3,DH>::dof_index (const unsigned int i, - const unsigned int fe_index) const -{ - return this->dof_handler->levels[this->present_level] - ->get_hex_dof_index (*this->dof_handler, - this->present_index, - fe_index, - i); -} - - - -template -inline -void -DoFObjectAccessor<3,DH>::set_dof_index (const unsigned int i, - const unsigned int index, - const unsigned int fe_index) const -{ - this->dof_handler->levels[this->present_level] - ->set_hex_dof_index (*this->dof_handler, - this->present_index, - fe_index, - i, - index); -} - - - template inline void diff --git a/deal.II/deal.II/include/dofs/dof_levels.h b/deal.II/deal.II/include/dofs/dof_levels.h index 2bdcb101eb..8ec89df36c 100644 --- a/deal.II/deal.II/include/dofs/dof_levels.h +++ b/deal.II/deal.II/include/dofs/dof_levels.h @@ -23,6 +23,12 @@ template class MGDoFHandler; namespace internal { + + template + struct StructuralDimension + {}; + + /** * A namespace for internal data structures of the DoFHandler group of classes. * @@ -114,11 +120,22 @@ namespace internal * through the DoFAccessor::set_dof_index() and * DoFAccessor::dof_index() functions or similar functions of derived * classes that in turn access the member variables using the - * DoFLevel<1>::get_line_dof_index(), corresponding setter functions, + * DoFLevel<1>::get_dof_index(), corresponding setter functions, * and similar functions in the DoFLevel<2> and DoFLevel<3> * classes. Knowledge of the actual data format is therefore * encapsulated to the present hierarchy of classes as well as the * ::DoFHandler class. + * + * The DoFLevel classes all have functions get_dof_index() and + * set_dof_index(). Since they have the same name, it is necessary to + * disambiguate which one we want to call when accessing line or quad + * DoFs, for example. To this end, they take an additional argument of + * type internal::StructuralDimension where the template argument + * indicates the structural dimension of the object accessed, i.e. 1 + * for lines, 2 for quads, etc. Using this trick, it is possible to + * write the functions DoFAccessor::dof_index() + * completely general, without having to specialize for the space + * dimension or the dimension of the object we access. * * @ingroup dofs * @author Wolfgang Bangerth, 1998, 2006 @@ -211,14 +228,22 @@ namespace internal * share the DoFAccessor * class hierarchy between hp * and non-hp classes. + * + * For the meaning of the + * last argument, see the + * general documentation of + * the + * internal::DoFHandler::DoFLevel + * class. */ template void - set_line_dof_index (const ::DoFHandler &dof_handler, - const unsigned int line_index, - const unsigned int fe_index, - const unsigned int local_index, - const unsigned int global_index); + set_dof_index (const ::DoFHandler &dof_handler, + const unsigned int line_index, + const unsigned int fe_index, + const unsigned int local_index, + const unsigned int global_index, + internal::StructuralDimension<1> dummy); /** * Return the global index of @@ -244,13 +269,21 @@ namespace internal * share the DoFAccessor * class hierarchy between hp * and non-hp classes. + * + * For the meaning of the + * last argument, see the + * general documentation of + * the + * internal::DoFHandler::DoFLevel + * class. */ template unsigned int - get_line_dof_index (const ::DoFHandler &dof_handler, - const unsigned int line_index, - const unsigned int fe_index, - const unsigned int local_index) const; + get_dof_index (const ::DoFHandler &dof_handler, + const unsigned int line_index, + const unsigned int fe_index, + const unsigned int local_index, + internal::StructuralDimension<1> dummy) const; /** * Determine an estimate for the @@ -318,14 +351,22 @@ namespace internal * share the DoFAccessor * class hierarchy between hp * and non-hp classes. + * + * For the meaning of the + * last argument, see the + * general documentation of + * the + * internal::DoFHandler::DoFLevel + * class. */ template void - set_quad_dof_index (const ::DoFHandler &dof_handler, - const unsigned int quad_index, - const unsigned int fe_index, - const unsigned int local_index, - const unsigned int global_index); + set_dof_index (const ::DoFHandler &dof_handler, + const unsigned int quad_index, + const unsigned int fe_index, + const unsigned int local_index, + const unsigned int global_index, + internal::StructuralDimension<2> dummy); /** * Return the global index of @@ -351,13 +392,29 @@ namespace internal * share the DoFAccessor * class hierarchy between hp * and non-hp classes. + * + * For the meaning of the + * last argument, see the + * general documentation of + * the + * internal::DoFHandler::DoFLevel + * class. */ template unsigned int - get_quad_dof_index (const ::DoFHandler &dof_handler, - const unsigned int quad_index, - const unsigned int fe_index, - const unsigned int local_index) const; + get_dof_index (const ::DoFHandler &dof_handler, + const unsigned int quad_index, + const unsigned int fe_index, + const unsigned int local_index, + internal::StructuralDimension<2> dummy) const; + + /** + * Import the respective + * functions from the base + * class. + */ + using DoFLevel<1>::set_dof_index; + using DoFLevel<1>::get_dof_index; /** * Determine an estimate for the @@ -425,14 +482,22 @@ namespace internal * share the DoFAccessor * class hierarchy between hp * and non-hp classes. + * + * For the meaning of the + * last argument, see the + * general documentation of + * the + * internal::DoFHandler::DoFLevel + * class. */ template void - set_hex_dof_index (const ::DoFHandler &dof_handler, - const unsigned int hex_index, - const unsigned int fe_index, - const unsigned int local_index, - const unsigned int global_index); + set_dof_index (const ::DoFHandler &dof_handler, + const unsigned int hex_index, + const unsigned int fe_index, + const unsigned int local_index, + const unsigned int global_index, + internal::StructuralDimension<3> dummy); /** * Return the global index of @@ -458,13 +523,29 @@ namespace internal * share the DoFAccessor * class hierarchy between hp * and non-hp classes. + * + * For the meaning of the + * last argument, see the + * general documentation of + * the + * internal::DoFHandler::DoFLevel + * class. */ template unsigned int - get_hex_dof_index (const ::DoFHandler &dof_handler, - const unsigned int hex_index, - const unsigned int fe_index, - const unsigned int local_index) const; + get_dof_index (const ::DoFHandler &dof_handler, + const unsigned int hex_index, + const unsigned int fe_index, + const unsigned int local_index, + internal::StructuralDimension<3> dummy) const; + + /** + * Import the respective + * functions from the base + * class. + */ + using DoFLevel<2>::set_dof_index; + using DoFLevel<2>::get_dof_index; /** * Determine an estimate for the diff --git a/deal.II/deal.II/include/dofs/hp_dof_levels.h b/deal.II/deal.II/include/dofs/hp_dof_levels.h index 36e4394b7f..6ffe37cdea 100644 --- a/deal.II/deal.II/include/dofs/hp_dof_levels.h +++ b/deal.II/deal.II/include/dofs/hp_dof_levels.h @@ -15,6 +15,7 @@ #include +#include #include #include @@ -40,13 +41,13 @@ namespace internal * * The things we store here is very similar to what is stored in the * internal::DoFHandler::DoFLevel class hierarchy (see there for more - * information, in particular on the layout of the class - * hierarchy). There are two main differences, discussed in the - * following subsections. In addition to the data already stored by - * the internal::DoFHandler::DoFLevel classes, we also have to store - * which finite element each cell uses. This is done in the - * DoFLevel<0> class, where for each cell we have an entry within the - * active_fe_indices field for each cell. + * information, in particular on the layout of the class hierarchy, + * and the use of file names and dummy arguments). There are two main + * differences, discussed in the following subsections. In addition to + * the data already stored by the internal::DoFHandler::DoFLevel + * classes, we also have to store which finite element each cell + * uses. This is done in the DoFLevel<0> class, where for each cell we + * have an entry within the active_fe_indices field for each cell. * * *

Offset computations

@@ -207,14 +208,22 @@ namespace internal * the internal::hp::DoFLevel * class template for more * information. + * + * For the meaning of the + * last argument, see the + * general documentation of + * the + * internal::DoFHandler::DoFLevel + * class. */ template void - set_line_dof_index (const ::hp::DoFHandler &dof_handler, - const unsigned int line_index, - const unsigned int fe_index, - const unsigned int local_index, - const unsigned int global_index); + set_dof_index (const ::hp::DoFHandler &dof_handler, + const unsigned int line_index, + const unsigned int fe_index, + const unsigned int local_index, + const unsigned int global_index, + internal::StructuralDimension<1> dummy); /** * Return the global index of @@ -238,13 +247,21 @@ namespace internal * the internal::hp::DoFLevel * class template for more * information. + * + * For the meaning of the + * last argument, see the + * general documentation of + * the + * internal::DoFHandler::DoFLevel + * class. */ template unsigned int - get_line_dof_index (const ::hp::DoFHandler &dof_handler, - const unsigned int line_index, - const unsigned int fe_index, - const unsigned int local_index) const; + get_dof_index (const ::hp::DoFHandler &dof_handler, + const unsigned int line_index, + const unsigned int fe_index, + const unsigned int local_index, + internal::StructuralDimension<1> dummy) const; /** * Determine an estimate for the @@ -316,14 +333,22 @@ namespace internal * the internal::hp::DoFLevel * class template for more * information. + * + * For the meaning of the + * last argument, see the + * general documentation of + * the + * internal::DoFHandler::DoFLevel + * class. */ template void - set_quad_dof_index (const ::hp::DoFHandler &dof_handler, - const unsigned int quad_index, - const unsigned int fe_index, - const unsigned int local_index, - const unsigned int global_index); + set_dof_index (const ::hp::DoFHandler &dof_handler, + const unsigned int quad_index, + const unsigned int fe_index, + const unsigned int local_index, + const unsigned int global_index, + internal::StructuralDimension<2> dummy); /** * Return the global index of @@ -347,14 +372,30 @@ namespace internal * the internal::hp::DoFLevel * class template for more * information. - */ + * + * For the meaning of the + * last argument, see the + * general documentation of + * the + * internal::DoFHandler::DoFLevel + * class. + */ template unsigned int - get_quad_dof_index (const ::hp::DoFHandler &dof_handler, - const unsigned int quad_index, - const unsigned int fe_index, - const unsigned int local_index) const; - + get_dof_index (const ::hp::DoFHandler &dof_handler, + const unsigned int quad_index, + const unsigned int fe_index, + const unsigned int local_index, + internal::StructuralDimension<2> dummy) const; + + /** + * Import the respective + * functions from the base + * class. + */ + using DoFLevel<1>::set_dof_index; + using DoFLevel<1>::get_dof_index; + /** * Determine an estimate for the * memory consumption (in bytes) @@ -426,14 +467,22 @@ namespace internal * the internal::hp::DoFLevel * class template for more * information. + * + * For the meaning of the + * last argument, see the + * general documentation of + * the + * internal::DoFHandler::DoFLevel + * class. */ template void - set_hex_dof_index (const ::hp::DoFHandler &dof_handler, - const unsigned int hex_index, - const unsigned int fe_index, - const unsigned int local_index, - const unsigned int global_index); + set_dof_index (const ::hp::DoFHandler &dof_handler, + const unsigned int hex_index, + const unsigned int fe_index, + const unsigned int local_index, + const unsigned int global_index, + internal::StructuralDimension<3> dummy); /** * Return the global index of @@ -457,13 +506,29 @@ namespace internal * the internal::hp::DoFLevel * class template for more * information. - */ + * + * For the meaning of the + * last argument, see the + * general documentation of + * the + * internal::DoFHandler::DoFLevel + * class. + */ template unsigned int - get_hex_dof_index (const ::hp::DoFHandler &dof_handler, - const unsigned int hex_index, - const unsigned int fe_index, - const unsigned int local_index) const; + get_dof_index (const ::hp::DoFHandler &dof_handler, + const unsigned int hex_index, + const unsigned int fe_index, + const unsigned int local_index, + internal::StructuralDimension<3> dummy) const; + + /** + * Import the respective + * functions from the base + * classes. + */ + using DoFLevel<2>::set_dof_index; + using DoFLevel<2>::get_dof_index; /** * Determine an estimate for the diff --git a/deal.II/deal.II/source/dofs/dof_levels.cc b/deal.II/deal.II/source/dofs/dof_levels.cc index 1ed76d3259..b54d0f2b46 100644 --- a/deal.II/deal.II/source/dofs/dof_levels.cc +++ b/deal.II/deal.II/source/dofs/dof_levels.cc @@ -26,10 +26,11 @@ namespace internal template unsigned int DoFLevel<1>:: - get_line_dof_index (const ::DoFHandler &dof_handler, - const unsigned int line_index, - const unsigned int fe_index, - const unsigned int local_index) const + get_dof_index (const ::DoFHandler &dof_handler, + const unsigned int line_index, + const unsigned int fe_index, + const unsigned int local_index, + internal::StructuralDimension<1> /*dummy*/) const { Assert (fe_index == ::DoFHandler::default_fe_index, ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects")); @@ -48,11 +49,12 @@ namespace internal template void DoFLevel<1>:: - set_line_dof_index (const ::DoFHandler &dof_handler, - const unsigned int line_index, - const unsigned int fe_index, - const unsigned int local_index, - const unsigned int global_index) + set_dof_index (const ::DoFHandler &dof_handler, + const unsigned int line_index, + const unsigned int fe_index, + const unsigned int local_index, + const unsigned int global_index, + internal::StructuralDimension<1> /*dummy*/) { Assert (fe_index == ::DoFHandler::default_fe_index, ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects")); @@ -71,10 +73,11 @@ namespace internal template unsigned int DoFLevel<2>:: - get_quad_dof_index (const ::DoFHandler &dof_handler, - const unsigned int quad_index, - const unsigned int fe_index, - const unsigned int local_index) const + get_dof_index (const ::DoFHandler &dof_handler, + const unsigned int quad_index, + const unsigned int fe_index, + const unsigned int local_index, + internal::StructuralDimension<2> /*dummy*/) const { Assert (fe_index == ::DoFHandler::default_fe_index, ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects")); @@ -93,11 +96,12 @@ namespace internal template void DoFLevel<2>:: - set_quad_dof_index (const ::DoFHandler &dof_handler, - const unsigned int quad_index, - const unsigned int fe_index, - const unsigned int local_index, - const unsigned int global_index) + set_dof_index (const ::DoFHandler &dof_handler, + const unsigned int quad_index, + const unsigned int fe_index, + const unsigned int local_index, + const unsigned int global_index, + internal::StructuralDimension<2> /*dummy*/) { Assert (fe_index == ::DoFHandler::default_fe_index, ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects")); @@ -116,10 +120,11 @@ namespace internal template unsigned int DoFLevel<3>:: - get_hex_dof_index (const ::DoFHandler &dof_handler, - const unsigned int hex_index, - const unsigned int fe_index, - const unsigned int local_index) const + get_dof_index (const ::DoFHandler &dof_handler, + const unsigned int hex_index, + const unsigned int fe_index, + const unsigned int local_index, + internal::StructuralDimension<3> /*dummy*/) const { Assert (fe_index == ::DoFHandler::default_fe_index, ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects")); @@ -138,11 +143,12 @@ namespace internal template void DoFLevel<3>:: - set_hex_dof_index (const ::DoFHandler &dof_handler, - const unsigned int hex_index, - const unsigned int fe_index, - const unsigned int local_index, - const unsigned int global_index) + set_dof_index (const ::DoFHandler &dof_handler, + const unsigned int hex_index, + const unsigned int fe_index, + const unsigned int local_index, + const unsigned int global_index, + internal::StructuralDimension<3> /*dummy*/) { Assert (fe_index == ::DoFHandler::default_fe_index, ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects")); @@ -162,38 +168,42 @@ namespace internal template unsigned int DoFLevel<1>:: - get_line_dof_index (const ::DoFHandler &dof_handler, - const unsigned int line_index, - const unsigned int fe_index, - const unsigned int local_index) const; + get_dof_index (const ::DoFHandler &dof_handler, + const unsigned int line_index, + const unsigned int fe_index, + const unsigned int local_index, + internal::StructuralDimension<1> dummy) const; template void DoFLevel<1>:: - set_line_dof_index (const ::DoFHandler &dof_handler, - const unsigned int line_index, - const unsigned int fe_index, - const unsigned int local_index, - const unsigned int global_index); + set_dof_index (const ::DoFHandler &dof_handler, + const unsigned int line_index, + const unsigned int fe_index, + const unsigned int local_index, + const unsigned int global_index, + internal::StructuralDimension<1> dummy); #if deal_II_dimension >= 2 template unsigned int DoFLevel<2>:: - get_quad_dof_index (const ::DoFHandler &dof_handler, - const unsigned int quad_index, - const unsigned int fe_index, - const unsigned int local_index) const; + get_dof_index (const ::DoFHandler &dof_handler, + const unsigned int quad_index, + const unsigned int fe_index, + const unsigned int local_index, + internal::StructuralDimension<2> dummy) const; template void DoFLevel<2>:: - set_quad_dof_index (const ::DoFHandler &dof_handler, - const unsigned int quad_index, - const unsigned int fe_index, - const unsigned int local_index, - const unsigned int global_index); + set_dof_index (const ::DoFHandler &dof_handler, + const unsigned int quad_index, + const unsigned int fe_index, + const unsigned int local_index, + const unsigned int global_index, + internal::StructuralDimension<2> dummy); #endif @@ -202,19 +212,21 @@ namespace internal template unsigned int DoFLevel<3>:: - get_hex_dof_index (const ::DoFHandler &dof_handler, - const unsigned int hex_index, - const unsigned int fe_index, - const unsigned int local_index) const; + get_dof_index (const ::DoFHandler &dof_handler, + const unsigned int hex_index, + const unsigned int fe_index, + const unsigned int local_index, + internal::StructuralDimension<3> dummy) const; template void DoFLevel<3>:: - set_hex_dof_index (const ::DoFHandler &dof_handler, - const unsigned int hex_index, - const unsigned int fe_index, - const unsigned int local_index, - const unsigned int global_index); + set_dof_index (const ::DoFHandler &dof_handler, + const unsigned int hex_index, + const unsigned int fe_index, + const unsigned int local_index, + const unsigned int global_index, + internal::StructuralDimension<3> dummy); #endif diff --git a/deal.II/deal.II/source/dofs/hp_dof_levels.cc b/deal.II/deal.II/source/dofs/hp_dof_levels.cc index bd479f97d6..f1df5b1105 100644 --- a/deal.II/deal.II/source/dofs/hp_dof_levels.cc +++ b/deal.II/deal.II/source/dofs/hp_dof_levels.cc @@ -25,10 +25,11 @@ namespace internal template unsigned int DoFLevel<1>:: - get_line_dof_index (const ::hp::DoFHandler &dof_handler, - const unsigned int line_index, - const unsigned int fe_index, - const unsigned int local_index) const + get_dof_index (const ::hp::DoFHandler &dof_handler, + const unsigned int line_index, + const unsigned int fe_index, + const unsigned int local_index, + internal::StructuralDimension<1> /*dummy*/) const { Assert (fe_index != ::hp::DoFHandler::default_fe_index, ExcMessage ("You need to specify a FE index when working " @@ -88,11 +89,12 @@ namespace internal template void DoFLevel<1>:: - set_line_dof_index (const ::hp::DoFHandler &dof_handler, - const unsigned int line_index, - const unsigned int fe_index, - const unsigned int local_index, - const unsigned int global_index) + set_dof_index (const ::hp::DoFHandler &dof_handler, + const unsigned int line_index, + const unsigned int fe_index, + const unsigned int local_index, + const unsigned int global_index, + internal::StructuralDimension<1> /*dummy*/) { Assert (fe_index != ::hp::DoFHandler::default_fe_index, ExcMessage ("You need to specify a FE index when working " @@ -155,10 +157,11 @@ namespace internal template unsigned int DoFLevel<2>:: - get_quad_dof_index (const ::hp::DoFHandler &dof_handler, - const unsigned int quad_index, - const unsigned int fe_index, - const unsigned int local_index) const + get_dof_index (const ::hp::DoFHandler &dof_handler, + const unsigned int quad_index, + const unsigned int fe_index, + const unsigned int local_index, + internal::StructuralDimension<2> /*dummy*/) const { Assert (dim >= 2, ExcMessage ("You can only access quads in 2d or higher")); Assert (fe_index != ::hp::DoFHandler::default_fe_index, @@ -219,11 +222,12 @@ namespace internal template void DoFLevel<2>:: - set_quad_dof_index (const ::hp::DoFHandler &dof_handler, - const unsigned int quad_index, - const unsigned int fe_index, - const unsigned int local_index, - const unsigned int global_index) + set_dof_index (const ::hp::DoFHandler &dof_handler, + const unsigned int quad_index, + const unsigned int fe_index, + const unsigned int local_index, + const unsigned int global_index, + internal::StructuralDimension<2> /*dummy*/) { Assert (dim >= 2, ExcMessage ("You can only access quads in 2d or higher")); Assert (fe_index != ::hp::DoFHandler::default_fe_index, @@ -287,10 +291,11 @@ namespace internal template unsigned int DoFLevel<3>:: - get_hex_dof_index (const ::hp::DoFHandler &dof_handler, - const unsigned int hex_index, - const unsigned int fe_index, - const unsigned int local_index) const + get_dof_index (const ::hp::DoFHandler &dof_handler, + const unsigned int hex_index, + const unsigned int fe_index, + const unsigned int local_index, + internal::StructuralDimension<3> /*dummy*/) const { Assert (dim >= 3, ExcMessage ("You can only access hexs in 3d or higher")); Assert (fe_index != ::hp::DoFHandler::default_fe_index, @@ -351,11 +356,12 @@ namespace internal template void DoFLevel<3>:: - set_hex_dof_index (const ::hp::DoFHandler &dof_handler, - const unsigned int hex_index, - const unsigned int fe_index, - const unsigned int local_index, - const unsigned int global_index) + set_dof_index (const ::hp::DoFHandler &dof_handler, + const unsigned int hex_index, + const unsigned int fe_index, + const unsigned int local_index, + const unsigned int global_index, + internal::StructuralDimension<3> /*dummy*/) { Assert (dim >= 3, ExcMessage ("You can only access hexs in 3d or higher")); Assert (fe_index != ::hp::DoFHandler::default_fe_index, @@ -420,38 +426,42 @@ namespace internal template unsigned int DoFLevel<1>:: - get_line_dof_index (const ::hp::DoFHandler &dof_handler, - const unsigned int line_index, - const unsigned int fe_index, - const unsigned int local_index) const; + get_dof_index (const ::hp::DoFHandler &dof_handler, + const unsigned int line_index, + const unsigned int fe_index, + const unsigned int local_index, + internal::StructuralDimension<1> dummy) const; template void DoFLevel<1>:: - set_line_dof_index (const ::hp::DoFHandler &dof_handler, - const unsigned int line_index, - const unsigned int fe_index, - const unsigned int local_index, - const unsigned int global_index); + set_dof_index (const ::hp::DoFHandler &dof_handler, + const unsigned int line_index, + const unsigned int fe_index, + const unsigned int local_index, + const unsigned int global_index, + internal::StructuralDimension<1> dummy); #if deal_II_dimension >= 2 template unsigned int DoFLevel<2>:: - get_quad_dof_index (const ::hp::DoFHandler &dof_handler, - const unsigned int quad_index, - const unsigned int fe_index, - const unsigned int local_index) const; + get_dof_index (const ::hp::DoFHandler &dof_handler, + const unsigned int quad_index, + const unsigned int fe_index, + const unsigned int local_index, + internal::StructuralDimension<2> dummy) const; template void DoFLevel<2>:: - set_quad_dof_index (const ::hp::DoFHandler &dof_handler, - const unsigned int quad_index, - const unsigned int fe_index, - const unsigned int local_index, - const unsigned int global_index); + set_dof_index (const ::hp::DoFHandler &dof_handler, + const unsigned int quad_index, + const unsigned int fe_index, + const unsigned int local_index, + const unsigned int global_index, + internal::StructuralDimension<2> dummy); #endif @@ -460,19 +470,21 @@ namespace internal template unsigned int DoFLevel<3>:: - get_hex_dof_index (const ::hp::DoFHandler &dof_handler, - const unsigned int hex_index, - const unsigned int fe_index, - const unsigned int local_index) const; + get_dof_index (const ::hp::DoFHandler &dof_handler, + const unsigned int hex_index, + const unsigned int fe_index, + const unsigned int local_index, + internal::StructuralDimension<3> dummy) const; template void DoFLevel<3>:: - set_hex_dof_index (const ::hp::DoFHandler &dof_handler, - const unsigned int hex_index, - const unsigned int fe_index, - const unsigned int local_index, - const unsigned int global_index); + set_dof_index (const ::hp::DoFHandler &dof_handler, + const unsigned int hex_index, + const unsigned int fe_index, + const unsigned int local_index, + const unsigned int global_index, + internal::StructuralDimension<3> dummy); #endif } 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 e9aa7b2322..20e385d980 100644 --- a/deal.II/deal.II/source/multigrid/mg_dof_accessor.cc +++ b/deal.II/deal.II/source/multigrid/mg_dof_accessor.cc @@ -41,10 +41,11 @@ template unsigned int MGDoFObjectAccessor<1, dim>::mg_dof_index (const unsigned int i) const { return this->mg_dof_handler->mg_levels[this->present_level] - ->get_line_dof_index(*this->dof_handler, - this->present_index, - 0, - i); + ->get_dof_index(*this->dof_handler, + this->present_index, + 0, + i, + internal::StructuralDimension<1>()); } @@ -53,11 +54,12 @@ void MGDoFObjectAccessor<1, dim>::set_mg_dof_index (const unsigned int i, const unsigned int index) const { this->mg_dof_handler->mg_levels[this->present_level] - ->set_line_dof_index(*this->dof_handler, - this->present_index, - 0, - i, - index); + ->set_dof_index(*this->dof_handler, + this->present_index, + 0, + i, + index, + internal::StructuralDimension<1>()); } @@ -201,10 +203,11 @@ template unsigned int MGDoFObjectAccessor<2, dim>::mg_dof_index (const unsigned int i) const { return this->mg_dof_handler->mg_levels[this->present_level] - ->get_quad_dof_index(*this->dof_handler, - this->present_index, - 0, - i); + ->get_dof_index(*this->dof_handler, + this->present_index, + 0, + i, + internal::StructuralDimension<2>()); } @@ -213,11 +216,12 @@ void MGDoFObjectAccessor<2, dim>::set_mg_dof_index (const unsigned int i, const unsigned int index) const { this->mg_dof_handler->mg_levels[this->present_level] - ->set_quad_dof_index(*this->dof_handler, - this->present_index, - 0, - i, - index); + ->set_dof_index(*this->dof_handler, + this->present_index, + 0, + i, + index, + internal::StructuralDimension<2>()); } @@ -386,10 +390,11 @@ template unsigned int MGDoFObjectAccessor<3, dim>::mg_dof_index (const unsigned int i) const { return this->mg_dof_handler->mg_levels[this->present_level] - ->get_hex_dof_index(*this->dof_handler, - this->present_index, - 0, - i); + ->get_dof_index(*this->dof_handler, + this->present_index, + 0, + i, + internal::StructuralDimension<3>()); } @@ -398,11 +403,12 @@ void MGDoFObjectAccessor<3, dim>::set_mg_dof_index (const unsigned int i, const unsigned int index) const { this->mg_dof_handler->mg_levels[this->present_level] - ->set_hex_dof_index(*this->dof_handler, - this->present_index, - 0, - i, - index); + ->set_dof_index(*this->dof_handler, + this->present_index, + 0, + i, + index, + internal::StructuralDimension<3>()); } -- 2.39.5