From: wolf Date: Mon, 1 May 2006 20:23:17 +0000 (+0000) Subject: Re-organize the inheritance structure of DoF accessor classes and unify some of the... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f91b839e8bf6b140dc6ceec5fb4e79654b1f49d;p=dealii-svn.git Re-organize the inheritance structure of DoF accessor classes and unify some of the code found in these classes. git-svn-id: https://svn.dealii.org/trunk@12943 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/dofs/dof_accessor.h b/deal.II/deal.II/include/dofs/dof_accessor.h index 9ab0ab2d12..45563660f7 100644 --- a/deal.II/deal.II/include/dofs/dof_accessor.h +++ b/deal.II/deal.II/include/dofs/dof_accessor.h @@ -43,41 +43,124 @@ template class TriaRawIterator; // inlining and thus faster code. +/** + * This is a switch class which only declares a @p typedef. It is meant to + * determine which class a DoFObjectAccessor class is to be derived + * from. By default, DoFObjectAccessor derives from + * the @p typedef in the general DoFObjectAccessor_Inheritance + * class, which is TriaObjectAccessor, + * but if celldim==dim, then the specialization DoFObjectAccessor_Inheritance + * is used which declares its local type to be CellAccessor. Therefore, + * the inheritance is automatically chosen to be from CellAccessor if the + * object under consideration has full dimension, i.e. constitutes a cell. + * + * @ingroup dofs + * @ingroup Accessors + * @author Wolfgang Bangerth, 1999 + */ +template +class DoFObjectAccessor_Inheritance +{ + public: + /** + * Declaration of the @p typedef. + * See the full documentation for + * more information. + */ + typedef TriaObjectAccessor BaseClass; +}; + + +/** + * This is a switch class which only declares a @p typedef. It is meant to + * determine which class a DoFObjectAccessor class is to be derived + * from. By default, DoFObjectAccessor derives from + * the @p typedef in the general DoFObjectAccessor_Inheritance + * class, which is TriaObjectAccessor, + * but if celldim==dim, then the specialization DoFObjectAccessor_Inheritance + * is used which declares its local type to be CellAccessor. Therefore, + * the inheritance is automatically chosen to be from CellAccessor if the + * object under consideration has full dimension, i.e. constitutes a cell. + * + * @ingroup dofs + * @ingroup Accessors + * @author Wolfgang Bangerth, 1999 + */ +template +class DoFObjectAccessor_Inheritance +{ + public: + /** + * Declaration of the @p typedef. + * See the full documentation for + * more information. + */ + typedef CellAccessor BaseClass; +}; + + +/* -------------------------------------------------------------------------- */ + + + /** * Define the base class for accessors to the degrees of * freedom. Accessors are used to, well, access the data that pertains * to edges, faces, and cells of a triangulation. The concept is * explained in more detail in connection to @ref Iterators. * - * The template argument of this class refers to the type of DoF - * handler we should work on. It can either be ::DoFHandler or + * 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 + * should work on. It can either be ::DoFHandler or * hp::DoFHandler. The space dimension of the object we are to * work on is automatically extracted from the DH template argument. * + * Depending on whether the structural dimension of the object + * accessed equals the space dimension on which the DoF handler object + * operates, this class is derived from CellAccessor or + * TriaObjectAccessor. This means that, for example accessors to quads + * 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. + * * @ingroup dofs * @ingroup Accessors * @author Wolfgang Bangerth, 1998 */ -template -class DoFAccessor +template +class DoFAccessor : public DoFObjectAccessor_Inheritance::BaseClass { public: /** - * Constructor + * Declare a typedef to the base + * class to make accessing some + * of the exception classes + * simpler. */ - DoFAccessor (); + typedef + typename DoFObjectAccessor_Inheritance::BaseClass + BaseClass; + + /** + * Data type passed by the iterator class. + */ + typedef DH AccessorData; /** - * This should be the default constructor. - * We cast away the constness of the - * pointer which clearly is EVIL but - * we can't help without making all - * functions which could somehow use - * iterators (directly or indirectly) make - * non-const, even if they preserve - * constness. + * Default constructor. Provides + * an accessor that can't be + * used. + */ + DoFAccessor (); + + /** + * Constructor */ - DoFAccessor (const DH *dof_handler); + DoFAccessor (const Triangulation *tria, + const int level, + const int index, + const DH *local_data); /** * Reset the DoF handler pointer. @@ -95,8 +178,14 @@ class DoFAccessor /** * Copy operator. */ - DoFAccessor & - operator = (const DoFAccessor &da); + DoFAccessor & + operator = (const DoFAccessor &da); + + /** + * Implement the copy operator needed + * for the iterator classes. + */ + void copy_from (const DoFAccessor &a); /** * Exception for child classes @@ -138,80 +227,29 @@ class DoFAccessor DeclException0 (ExcCantCompareIterators); protected: - /** - * Compare for equality. - */ - bool operator == (const DoFAccessor &) const; - - /** - * Compare for inequality. - */ - bool operator != (const DoFAccessor &) const; - protected: /** * Store the address of the DoFHandler object * to be accessed. */ - DH *dof_handler; -}; - + DH *dof_handler; -/* -------------------------------------------------------------------------- */ - -/** - * This is a switch class which only declares a @p typedef. It is meant to - * determine which class a DoFObjectAccessor class is to be derived - * from. By default, DoFObjectAccessor derives from - * the @p typedef in the general DoFObjectAccessor_Inheritance - * class, which is TriaObjectAccessor, - * but if celldim==dim, then the specialization DoFObjectAccessor_Inheritance - * is used which declares its local type to be CellAccessor. Therefore, - * the inheritance is automatically chosen to be from CellAccessor if the - * object under consideration has full dimension, i.e. constitutes a cell. - * - * @ingroup dofs - * @ingroup Accessors - * @author Wolfgang Bangerth, 1999 - */ -template -class DoFObjectAccessor_Inheritance -{ - public: /** - * Declaration of the @p typedef. - * See the full documentation for - * more information. + * Compare for equality. */ - typedef TriaObjectAccessor BaseClass; -}; - - -/** - * This is a switch class which only declares a @p typedef. It is meant to - * determine which class a DoFObjectAccessor class is to be derived - * from. By default, DoFObjectAccessor derives from - * the @p typedef in the general DoFObjectAccessor_Inheritance - * class, which is TriaObjectAccessor, - * but if celldim==dim, then the specialization DoFObjectAccessor_Inheritance - * is used which declares its local type to be CellAccessor. Therefore, - * the inheritance is automatically chosen to be from CellAccessor if the - * object under consideration has full dimension, i.e. constitutes a cell. - * - * @ingroup dofs - * @ingroup Accessors - * @author Wolfgang Bangerth, 1999 - */ -template -class DoFObjectAccessor_Inheritance -{ - public: + bool operator == (const DoFAccessor &) const; + /** - * Declaration of the @p typedef. - * See the full documentation for - * more information. + * Compare for inequality. */ - typedef CellAccessor BaseClass; + bool operator != (const DoFAccessor &) const; + + /** + * Iterator classes need to be friends + * because they need to access operator== + * and operator!=. + */ + template friend class TriaRawIterator; }; @@ -256,8 +294,7 @@ class DoFObjectAccessor_Inheritance * @author Wolfgang Bangerth, 1998; Guido Kanschat, 1999 */ template -class DoFObjectAccessor : public DoFAccessor, - public TriaObjectAccessor +class DoFObjectAccessor : public DoFAccessor { public: /** @@ -546,31 +583,6 @@ class DoFObjectAccessor : public DoFAccessor, * access to the DoF data. */ TriaIterator > child (const unsigned int) const; - - /** - * Implement the copy operator needed - * for the iterator classes. - */ - void copy_from (const DoFObjectAccessor &a); - - protected: - /** - * Compare for equality. - */ - bool operator == (const DoFObjectAccessor &) const; - - /** - * Compare for inequality. - */ - bool operator != (const DoFObjectAccessor &) const; - - - /** - * Iterator classes need to be friends - * because they need to access operator== - * and operator!=. - */ - template friend class TriaRawIterator; }; @@ -580,8 +592,7 @@ class DoFObjectAccessor : public DoFAccessor, * @ingroup Accessors */ template -class DoFObjectAccessor<0, DH> : public DoFAccessor, - public DoFObjectAccessor_Inheritance<0,DH::dimension>::BaseClass +class DoFObjectAccessor<0, DH> : public DoFAccessor<0, DH> { public: /** @@ -637,9 +648,7 @@ class DoFObjectAccessor<0, DH> : public DoFAccessor, * @author Wolfgang Bangerth, 1998 */ template -class DoFObjectAccessor<1, DH> : - public DoFAccessor, - public DoFObjectAccessor_Inheritance<1,DH::dimension>::BaseClass +class DoFObjectAccessor<1, DH> : public DoFAccessor<1,DH> { public: /** @@ -658,7 +667,7 @@ class DoFObjectAccessor<1, DH> : * Declare base class as a local typedef * for simpler access. */ - typedef typename DoFObjectAccessor_Inheritance<1,dim>::BaseClass BaseClass; + typedef DoFAccessor<1,DH> BaseClass; /** * Default constructor, unused thus @@ -915,31 +924,6 @@ class DoFObjectAccessor<1, DH> : * access to the DoF data. */ TriaIterator > child (const unsigned int) const; - - /** - * Implement the copy operator needed - * for the iterator classes. - */ - void copy_from (const DoFObjectAccessor<1,DH> &a); - - protected: - /** - * Compare for equality. - */ - bool operator == (const DoFObjectAccessor<1,DH> &) const; - - /** - * Compare for inequality. - */ - bool operator != (const DoFObjectAccessor<1,DH> &) const; - - - /** - * Iterator classes need to be friends - * because they need to access operator== - * and operator!=. - */ - template friend class TriaRawIterator; }; @@ -950,9 +934,7 @@ class DoFObjectAccessor<1, DH> : * @ingroup Accessors */ template -class DoFObjectAccessor<2, DH> : - public DoFAccessor, - public DoFObjectAccessor_Inheritance<2,DH::dimension>::BaseClass +class DoFObjectAccessor<2, DH> : public DoFAccessor<2,DH> { public: /** @@ -971,7 +953,7 @@ class DoFObjectAccessor<2, DH> : * Declare base class as a local typedef * for simpler access. */ - typedef typename DoFObjectAccessor_Inheritance<2,dim>::BaseClass BaseClass; + typedef DoFAccessor<2,DH> BaseClass; /** * Default constructor, unused thus @@ -1236,31 +1218,6 @@ class DoFObjectAccessor<2, DH> : */ TriaIterator > child (const unsigned int) const; - - /** - * Implement the copy operator needed - * for the iterator classes. - */ - void copy_from (const DoFObjectAccessor<2, DH> &a); - - protected: - /** - * Compare for equality. - */ - bool operator == (const DoFObjectAccessor<2,DH> &) const; - - /** - * Compare for inequality. - */ - bool operator != (const DoFObjectAccessor<2,DH> &) const; - - - /** - * Iterator classes need to be friends - * because they need to access operator== - * and operator!=. - */ - template friend class TriaRawIterator; }; @@ -1271,9 +1228,7 @@ class DoFObjectAccessor<2, DH> : * @ingroup Accessors */ template -class DoFObjectAccessor<3, DH> : - public DoFAccessor, - public DoFObjectAccessor_Inheritance<3,DH::dimension>::BaseClass +class DoFObjectAccessor<3, DH> : public DoFAccessor<3,DH> { public: /** @@ -1292,7 +1247,7 @@ class DoFObjectAccessor<3, DH> : * Declare base class as a local typedef * for simpler access. */ - typedef typename DoFObjectAccessor_Inheritance<3,dim>::BaseClass BaseClass; + typedef DoFAccessor<1,DH> BaseClass; /** * Default constructor, unused thus @@ -1564,31 +1519,6 @@ class DoFObjectAccessor<3, DH> : * access to the DoF data. */ TriaIterator > child (const unsigned int) const; - - /** - * Implement the copy operator needed - * for the iterator classes. - */ - void copy_from (const DoFObjectAccessor<3, DH> &a); - - protected: - /** - * Compare for equality. - */ - bool operator == (const DoFObjectAccessor<3,DH> &) const; - - /** - * Compare for inequality. - */ - bool operator != (const DoFObjectAccessor<3,DH> &) const; - - - /** - * Iterator classes need to be friends - * because they need to access operator== - * and operator!=. - */ - template friend class TriaRawIterator; }; @@ -1629,6 +1559,14 @@ class DoFCellAccessor : public DoFObjectAccessor * classes. */ typedef typename DoFObjectAccessor::AccessorData AccessorData; + + /** + * Declare a typedef to the base + * class to make accessing some + * of the exception classes + * simpler. + */ + typedef DoFObjectAccessor BaseClass; /** * Constructor 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 b8810ca8cd..b88f02b6c7 100644 --- a/deal.II/deal.II/include/dofs/dof_accessor.templates.h +++ b/deal.II/deal.II/include/dofs/dof_accessor.templates.h @@ -29,9 +29,12 @@ /*------------------------- Functions: DoFAccessor ---------------------------*/ -template -DoFAccessor::DoFAccessor () +template +DoFAccessor::DoFAccessor () : + DoFObjectAccessor_Inheritance::BaseClass (0, + deal_II_numbers::invalid_unsigned_int, + deal_II_numbers::invalid_unsigned_int), dof_handler(0) { Assert (false, ExcInvalidObject()); @@ -39,18 +42,24 @@ DoFAccessor::DoFAccessor () -template +template inline -DoFAccessor::DoFAccessor (const DH *dof_handler) +DoFAccessor::DoFAccessor (const Triangulation *tria, + const int level, + const int index, + const DH *dof_handler) : - dof_handler(const_cast(dof_handler)) + DoFObjectAccessor_Inheritance::BaseClass (tria, + level, + index), + dof_handler(const_cast(dof_handler)) {} -template +template void -DoFAccessor::set_dof_handler (DH *dh) +DoFAccessor::set_dof_handler (DH *dh) { Assert (dh != 0, ExcInvalidObject()); this->dof_handler = dh; @@ -58,19 +67,19 @@ DoFAccessor::set_dof_handler (DH *dh) -template +template inline const DH & -DoFAccessor::get_dof_handler () const +DoFAccessor::get_dof_handler () const { return *this->dof_handler; } -template +template inline -DoFAccessor & -DoFAccessor::operator = (const DoFAccessor &da) +DoFAccessor & +DoFAccessor::operator = (const DoFAccessor &da) { this->set_dof_handler (da.dof_handler); return *this; @@ -78,35 +87,33 @@ DoFAccessor::operator = (const DoFAccessor &da) -template +template +void +DoFAccessor::copy_from (const DoFAccessor &a) +{ + BaseClass::copy_from (a); + set_dof_handler (a.dof_handler); +} + + + +template inline bool -DoFAccessor::operator == (const DoFAccessor &a) const +DoFAccessor::operator == (const DoFAccessor &a) const { Assert (this->dof_handler == a.dof_handler, ExcCantCompareIterators()); - - // there is no real data to compare, except - // to make sure that the this->dof_handler - // objects in use are the same - return true; + return (BaseClass::operator == (a)); } - -template +template inline bool -DoFAccessor::operator != (const DoFAccessor &a) const +DoFAccessor::operator != (const DoFAccessor &a) const { Assert (this->dof_handler == a.dof_handler, ExcCantCompareIterators()); - - // there is no real data to compare, except - // to make sure that the this->dof_handler - // objects in use are the same. this is - // checked above, and apart from this there - // is no reason for us to believe that the - // two accessors are different - return false; + return (BaseClass::operator != (a)); } @@ -123,10 +130,7 @@ DoFObjectAccessor (const Triangulation *tria, const int index, const AccessorData *local_data) : - DoFAccessor (local_data), - DoFObjectAccessor_Inheritance<1,DH::dimension>::BaseClass (tria, - level, - index) + DoFAccessor<1,DH> (tria, level, index, local_data) {} @@ -153,38 +157,6 @@ DoFObjectAccessor<1,DH>::child (const unsigned int i) const -template -inline -void -DoFObjectAccessor<1,DH>::copy_from (const DoFObjectAccessor<1,DH> &a) -{ - BaseClass::copy_from (a); - this->set_dof_handler (a.dof_handler); -} - - - -template -inline -bool -DoFObjectAccessor<1,DH>::operator == (const DoFObjectAccessor<1,DH> &a) const -{ - return (TriaObjectAccessor<1,dim>::operator == (a) - && - DoFAccessor::operator == (a)); -} - - -template -inline -bool -DoFObjectAccessor<1,DH>::operator != (const DoFObjectAccessor<1,DH> &a) const -{ - return (TriaObjectAccessor<1,dim>::operator != (a) - || - DoFAccessor::operator != (a)); -} - /*------------------------- Functions: DoFObjectAccessor<2,dim> -----------------------*/ @@ -195,10 +167,7 @@ DoFObjectAccessor (const Triangulation *tria, const int index, const AccessorData *local_data) : - DoFAccessor (local_data), - DoFObjectAccessor_Inheritance<2,dim>::BaseClass (tria, - level, - index) + DoFAccessor<2,DH> (tria, level, index, local_data) {} @@ -245,40 +214,6 @@ DoFObjectAccessor<2,DH>::child (const unsigned int i) const -template -inline -void -DoFObjectAccessor<2,DH>::copy_from (const DoFObjectAccessor<2,DH> &a) -{ - BaseClass::copy_from (a); - this->set_dof_handler (a.dof_handler); -} - - - -template -inline -bool -DoFObjectAccessor<2,DH>::operator == (const DoFObjectAccessor<2,DH> &a) const -{ - return (TriaObjectAccessor<2,dim>::operator == (a) - && - DoFAccessor::operator == (a)); -} - - -template -inline -bool -DoFObjectAccessor<2,DH>::operator != (const DoFObjectAccessor<2,DH> &a) const -{ - return (TriaObjectAccessor<2,dim>::operator != (a) - || - DoFAccessor::operator != (a)); -} - - - /*------------------------- Functions: DoFObjectAccessor<3,dim> -----------------------*/ template @@ -289,10 +224,7 @@ DoFObjectAccessor (const Triangulation *tria, const int index, const AccessorData *local_data) : - DoFAccessor (local_data), - DoFObjectAccessor_Inheritance<3,dim>::BaseClass (tria, - level, - index) + DoFAccessor<3,DH> (tria, level, index, local_data) {} @@ -302,7 +234,7 @@ inline TriaIterator > DoFObjectAccessor<3,DH>::line (const unsigned int i) const { - TriaIterator > l = BaseClass::line(i); + TriaIterator > l = TriaObjectAccessor<3,DH::dimension>::line(i); return TriaIterator > ( this->tria, @@ -348,37 +280,6 @@ DoFObjectAccessor<3,DH>::child (const unsigned int i) const } -template -void DoFObjectAccessor<3,DH>::copy_from (const DoFObjectAccessor<3,DH> &a) -{ - BaseClass::copy_from (a); - this->set_dof_handler (a.dof_handler); -} - - - -template -inline -bool -DoFObjectAccessor<3,DH>::operator == (const DoFObjectAccessor<3,DH> &a) const -{ - return (TriaObjectAccessor<3,dim>::operator == (a) - && - DoFAccessor::operator == (a)); -} - - -template -inline -bool -DoFObjectAccessor<3,DH>::operator != (const DoFObjectAccessor<3,DH> &a) const -{ - return (TriaObjectAccessor<3,dim>::operator != (a) - || - DoFAccessor::operator != (a)); -} - - /*--------------- Functions: DoFObjectAccessor<1,DoFHandler> -----------*/ @@ -393,10 +294,10 @@ DoFObjectAccessor<1,DoFHandler<1> >::dof_index (const unsigned int i, Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("DoFHandler not initialized")); - Assert (this->dof_handler != 0, DoFAccessor >::ExcInvalidObject()); + Assert (this->dof_handler != 0, BaseClass::ExcInvalidObject()); // make sure a FE has been selected // and enough room was reserved - Assert (&this->dof_handler->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); + Assert (&this->dof_handler->get_fe() != 0, BaseClass::ExcInvalidObject()); Assert (idof_handler->get_fe().dofs_per_line, ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_line)); @@ -418,8 +319,8 @@ DoFObjectAccessor<1,DoFHandler<1> >::vertex_dof_index (const unsigned int vertex Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("DoFHandler not initialized")); - Assert (this->dof_handler != 0, DoFAccessor >::ExcInvalidObject()); - Assert (&this->dof_handler->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); + Assert (this->dof_handler != 0, BaseClass::ExcInvalidObject()); + Assert (&this->dof_handler->get_fe() != 0, BaseClass::ExcInvalidObject()); Assert (vertex<2, ExcIndexRange (i,0,2)); Assert (idof_handler->get_fe().dofs_per_vertex, ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_vertex)); @@ -443,11 +344,11 @@ DoFObjectAccessor<1,DoFHandler<1> >::get_dof_indices (std::vector Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("DoFHandler not initialized")); - Assert (this->dof_handler != 0, DoFAccessor >::ExcInvalidObject()); - Assert (&this->dof_handler->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); + Assert (this->dof_handler != 0, BaseClass::ExcInvalidObject()); + Assert (&this->dof_handler->get_fe() != 0, BaseClass::ExcInvalidObject()); Assert (dof_indices.size() == (2*this->dof_handler->get_fe().dofs_per_vertex + this->dof_handler->get_fe().dofs_per_line), - DoFAccessor >::ExcVectorDoesNotMatch()); + BaseClass::ExcVectorDoesNotMatch()); // this function really only makes // sense on non-active objects if @@ -460,7 +361,7 @@ DoFObjectAccessor<1,DoFHandler<1> >::get_dof_indices (std::vector Assert (!this->has_children() || (this->dof_handler->get_fe().dofs_per_cell == 2*this->dof_handler->get_fe().dofs_per_vertex), - DoFAccessor >::ExcNotActive()); + BaseClass::ExcNotActive()); const unsigned int dofs_per_vertex = this->dof_handler->get_fe().dofs_per_vertex, dofs_per_line = this->dof_handler->get_fe().dofs_per_line; @@ -485,10 +386,10 @@ DoFObjectAccessor<1,DoFHandler<2> >::dof_index (const unsigned int i, Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("DoFHandler not initialized")); - Assert (this->dof_handler != 0, DoFAccessor >::ExcInvalidObject()); + Assert (this->dof_handler != 0, BaseClass::ExcInvalidObject()); // make sure a FE has been selected // and enough room was reserved - Assert (&this->dof_handler->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); + Assert (&this->dof_handler->get_fe() != 0, BaseClass::ExcInvalidObject()); Assert (idof_handler->get_fe().dofs_per_line, ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_line)); @@ -510,8 +411,8 @@ DoFObjectAccessor<1,DoFHandler<2> >::vertex_dof_index (const unsigned int vertex Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("DoFHandler not initialized")); - Assert (this->dof_handler != 0, DoFAccessor >::ExcInvalidObject()); - Assert (&this->dof_handler->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); + Assert (this->dof_handler != 0, BaseClass::ExcInvalidObject()); + Assert (&this->dof_handler->get_fe() != 0, BaseClass::ExcInvalidObject()); Assert (vertex<2, ExcIndexRange (i,0,2)); Assert (idof_handler->get_fe().dofs_per_vertex, ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_vertex)); @@ -535,11 +436,11 @@ DoFObjectAccessor<1,DoFHandler<2> >::get_dof_indices (std::vector Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("DoFHandler not initialized")); - Assert (this->dof_handler != 0, DoFAccessor >::ExcInvalidObject()); - Assert (&this->dof_handler->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); + Assert (this->dof_handler != 0, BaseClass::ExcInvalidObject()); + Assert (&this->dof_handler->get_fe() != 0, BaseClass::ExcInvalidObject()); Assert (dof_indices.size() == (2*this->dof_handler->get_fe().dofs_per_vertex + this->dof_handler->get_fe().dofs_per_line), - DoFAccessor >::ExcVectorDoesNotMatch()); + BaseClass::ExcVectorDoesNotMatch()); // this function really only makes // sense on non-active objects if @@ -552,7 +453,7 @@ DoFObjectAccessor<1,DoFHandler<2> >::get_dof_indices (std::vector Assert (!this->has_children() || (this->dof_handler->get_fe().dofs_per_cell == 2*this->dof_handler->get_fe().dofs_per_vertex), - DoFAccessor >::ExcNotActive()); + BaseClass::ExcNotActive()); const unsigned int dofs_per_vertex = this->dof_handler->get_fe().dofs_per_vertex, dofs_per_line = this->dof_handler->get_fe().dofs_per_line; @@ -577,10 +478,10 @@ DoFObjectAccessor<1,DoFHandler<3> >::dof_index (const unsigned int i, Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("DoFHandler not initialized")); - Assert (this->dof_handler != 0, DoFAccessor >::ExcInvalidObject()); + Assert (this->dof_handler != 0, BaseClass::ExcInvalidObject()); // make sure a FE has been selected // and enough room was reserved - Assert (&this->dof_handler->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); + Assert (&this->dof_handler->get_fe() != 0, BaseClass::ExcInvalidObject()); Assert (idof_handler->get_fe().dofs_per_line, ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_line)); @@ -602,8 +503,8 @@ DoFObjectAccessor<1,DoFHandler<3> >::vertex_dof_index (const unsigned int vertex Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("DoFHandler not initialized")); - Assert (this->dof_handler != 0, DoFAccessor >::ExcInvalidObject()); - Assert (&this->dof_handler->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); + Assert (this->dof_handler != 0, BaseClass::ExcInvalidObject()); + Assert (&this->dof_handler->get_fe() != 0, BaseClass::ExcInvalidObject()); Assert (vertex<2, ExcIndexRange (i,0,2)); Assert (idof_handler->get_fe().dofs_per_vertex, ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_vertex)); @@ -627,11 +528,11 @@ DoFObjectAccessor<1,DoFHandler<3> >::get_dof_indices (std::vector Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("DoFHandler not initialized")); - Assert (this->dof_handler != 0, DoFAccessor >::ExcInvalidObject()); - Assert (&this->dof_handler->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); + Assert (this->dof_handler != 0, BaseClass::ExcInvalidObject()); + Assert (&this->dof_handler->get_fe() != 0, BaseClass::ExcInvalidObject()); Assert (dof_indices.size() == (2*this->dof_handler->get_fe().dofs_per_vertex + this->dof_handler->get_fe().dofs_per_line), - DoFAccessor >::ExcVectorDoesNotMatch()); + BaseClass::ExcVectorDoesNotMatch()); // this function really only makes // sense on non-active objects if @@ -644,7 +545,7 @@ DoFObjectAccessor<1,DoFHandler<3> >::get_dof_indices (std::vector Assert (!this->has_children() || (this->dof_handler->get_fe().dofs_per_cell == 2*this->dof_handler->get_fe().dofs_per_vertex), - DoFAccessor >::ExcNotActive()); + BaseClass::ExcNotActive()); const unsigned int dofs_per_vertex = this->dof_handler->get_fe().dofs_per_vertex, dofs_per_line = this->dof_handler->get_fe().dofs_per_line; @@ -669,11 +570,11 @@ DoFObjectAccessor<2,DoFHandler<2> >::dof_index (const unsigned int i, Assert (fe_index == DoFHandler<2>::default_fe_index, ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects")); Assert (this->dof_handler != 0, - DoFAccessor >::ExcInvalidObject()); + BaseClass::ExcInvalidObject()); // make sure a FE has been selected // and enough room was reserved Assert (&this->dof_handler->get_fe() != 0, - DoFAccessor >::ExcInvalidObject()); + BaseClass::ExcInvalidObject()); Assert (idof_handler->get_fe().dofs_per_quad, ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_quad)); Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), @@ -695,9 +596,9 @@ DoFObjectAccessor<2,DoFHandler<2> >::vertex_dof_index (const unsigned int vertex Assert (fe_index == DoFHandler<2>::default_fe_index, ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects")); Assert (this->dof_handler != 0, - DoFAccessor >::ExcInvalidObject()); + BaseClass::ExcInvalidObject()); Assert (&this->dof_handler->get_fe() != 0, - DoFAccessor >::ExcInvalidObject()); + BaseClass::ExcInvalidObject()); Assert (vertex<4, ExcIndexRange (i,0,4)); Assert (idof_handler->get_fe().dofs_per_vertex, ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_vertex)); @@ -721,13 +622,13 @@ DoFObjectAccessor<2,DoFHandler<2> >::get_dof_indices (std::vector Assert (fe_index == DoFHandler<2>::default_fe_index, ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects")); Assert (this->dof_handler != 0, - DoFAccessor >::ExcInvalidObject()); + BaseClass::ExcInvalidObject()); Assert (&this->dof_handler->get_fe() != 0, - DoFAccessor >::ExcInvalidObject()); + BaseClass::ExcInvalidObject()); Assert (dof_indices.size() == (4*this->dof_handler->get_fe().dofs_per_vertex + 4*this->dof_handler->get_fe().dofs_per_line + this->dof_handler->get_fe().dofs_per_quad), - DoFAccessor >::ExcVectorDoesNotMatch()); + BaseClass::ExcVectorDoesNotMatch()); // this function really only makes // sense on non-active objects if @@ -740,7 +641,7 @@ DoFObjectAccessor<2,DoFHandler<2> >::get_dof_indices (std::vector Assert (!this->has_children() || (this->dof_handler->get_fe().dofs_per_cell == 4*this->dof_handler->get_fe().dofs_per_vertex), - DoFAccessor >::ExcNotActive()); + BaseClass::ExcNotActive()); Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("DoFHandler not initialized")); @@ -770,11 +671,11 @@ DoFObjectAccessor<2,DoFHandler<3> >::dof_index (const unsigned int i, Assert (fe_index == DoFHandler<3>::default_fe_index, ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects")); Assert (this->dof_handler != 0, - DoFAccessor >::ExcInvalidObject()); + BaseClass::ExcInvalidObject()); // make sure a FE has been selected // and enough room was reserved Assert (&this->dof_handler->get_fe() != 0, - DoFAccessor >::ExcInvalidObject()); + BaseClass::ExcInvalidObject()); Assert (idof_handler->get_fe().dofs_per_quad, ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_quad)); Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), @@ -796,9 +697,9 @@ DoFObjectAccessor<2,DoFHandler<3> >::vertex_dof_index (const unsigned int vertex Assert (fe_index == DoFHandler<3>::default_fe_index, ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects")); Assert (this->dof_handler != 0, - DoFAccessor >::ExcInvalidObject()); + BaseClass::ExcInvalidObject()); Assert (&this->dof_handler->get_fe() != 0, - DoFAccessor >::ExcInvalidObject()); + BaseClass::ExcInvalidObject()); Assert (vertex<4, ExcIndexRange (i,0,4)); Assert (idof_handler->get_fe().dofs_per_vertex, ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_vertex)); @@ -822,13 +723,13 @@ DoFObjectAccessor<2,DoFHandler<3> >::get_dof_indices (std::vector Assert (fe_index == DoFHandler<3>::default_fe_index, ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects")); Assert (this->dof_handler != 0, - DoFAccessor >::ExcInvalidObject()); + BaseClass::ExcInvalidObject()); Assert (&this->dof_handler->get_fe() != 0, - DoFAccessor >::ExcInvalidObject()); + BaseClass::ExcInvalidObject()); Assert (dof_indices.size() == (4*this->dof_handler->get_fe().dofs_per_vertex + 4*this->dof_handler->get_fe().dofs_per_line + this->dof_handler->get_fe().dofs_per_quad), - DoFAccessor >::ExcVectorDoesNotMatch()); + BaseClass::ExcVectorDoesNotMatch()); // this function really only makes // sense on non-active objects if @@ -841,7 +742,7 @@ DoFObjectAccessor<2,DoFHandler<3> >::get_dof_indices (std::vector Assert (!this->has_children() || (this->dof_handler->get_fe().dofs_per_cell == 4*this->dof_handler->get_fe().dofs_per_vertex), - DoFAccessor >::ExcNotActive()); + BaseClass::ExcNotActive()); Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("DoFHandler not initialized")); @@ -876,11 +777,11 @@ DoFObjectAccessor<3,DoFHandler<3> >::dof_index (const unsigned int i, Assert (fe_index == DoFHandler<3>::default_fe_index, ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects")); Assert (this->dof_handler != 0, - DoFAccessor >::ExcInvalidObject()); + BaseClass::ExcInvalidObject()); // make sure a FE has been selected // and enough room was reserved Assert (&this->dof_handler->get_fe() != 0, - DoFAccessor >::ExcInvalidObject()); + BaseClass::ExcInvalidObject()); Assert (idof_handler->get_fe().dofs_per_hex, ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_hex)); Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), @@ -902,9 +803,9 @@ DoFObjectAccessor<3,DoFHandler<3> >::vertex_dof_index (const unsigned int vertex Assert (fe_index == DoFHandler<3>::default_fe_index, ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects")); Assert (this->dof_handler != 0, - DoFAccessor >::ExcInvalidObject()); + BaseClass::ExcInvalidObject()); Assert (&this->dof_handler->get_fe() != 0, - DoFAccessor >::ExcInvalidObject()); + BaseClass::ExcInvalidObject()); Assert (vertex<8, ExcIndexRange (i,0,8)); Assert (idof_handler->get_fe().dofs_per_vertex, ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_vertex)); @@ -928,14 +829,14 @@ DoFObjectAccessor<3,DoFHandler<3> >::get_dof_indices (std::vector Assert (fe_index == DoFHandler<3>::default_fe_index, ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects")); Assert (this->dof_handler != 0, - DoFAccessor >::ExcInvalidObject()); + BaseClass::ExcInvalidObject()); Assert (&this->dof_handler->get_fe() != 0, - DoFAccessor >::ExcInvalidObject()); + BaseClass::ExcInvalidObject()); Assert (dof_indices.size() == (8*this->dof_handler->get_fe().dofs_per_vertex + 12*this->dof_handler->get_fe().dofs_per_line + 6*this->dof_handler->get_fe().dofs_per_quad + this->dof_handler->get_fe().dofs_per_hex), - DoFAccessor >::ExcVectorDoesNotMatch()); + BaseClass::ExcVectorDoesNotMatch()); Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("DoFHandler not initialized")); @@ -950,7 +851,7 @@ DoFObjectAccessor<3,DoFHandler<3> >::get_dof_indices (std::vector Assert (!this->has_children() || (this->dof_handler->get_fe().dofs_per_cell == 8*this->dof_handler->get_fe().dofs_per_vertex), - DoFAccessor >::ExcNotActive()); + BaseClass::ExcNotActive()); Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("DoFHandler not initialized")); @@ -1095,11 +996,11 @@ DoFObjectAccessor<1,hp::DoFHandler<1> >::get_dof_indices (std::vector(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("DoFHandler not initialized")); - Assert (this->dof_handler != 0, DoFAccessor >::ExcInvalidObject()); - Assert (&this->dof_handler->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); + Assert (this->dof_handler != 0, BaseClass::ExcInvalidObject()); + Assert (&this->dof_handler->get_fe() != 0, BaseClass::ExcInvalidObject()); Assert (dof_indices.size() == (2*this->dof_handler->get_fe()[fe_index].dofs_per_vertex + this->dof_handler->get_fe()[fe_index].dofs_per_line), - DoFAccessor >::ExcVectorDoesNotMatch()); + BaseClass::ExcVectorDoesNotMatch()); // this function really only makes // sense on non-active objects if @@ -1112,7 +1013,7 @@ DoFObjectAccessor<1,hp::DoFHandler<1> >::get_dof_indices (std::vectorhas_children() || (this->dof_handler->get_fe()[fe_index].dofs_per_cell == 2*this->dof_handler->get_fe()[fe_index].dofs_per_vertex), - DoFAccessor >::ExcNotActive()); + BaseClass::ExcNotActive()); const unsigned int dofs_per_vertex = this->dof_handler->get_fe()[fe_index].dofs_per_vertex, dofs_per_line = this->dof_handler->get_fe()[fe_index].dofs_per_line; @@ -1150,11 +1051,11 @@ DoFObjectAccessor<1,hp::DoFHandler<2> >::get_dof_indices (std::vector(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("DoFHandler not initialized")); - Assert (this->dof_handler != 0, DoFAccessor >::ExcInvalidObject()); - Assert (&this->dof_handler->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); + Assert (this->dof_handler != 0, BaseClass::ExcInvalidObject()); + Assert (&this->dof_handler->get_fe() != 0, BaseClass::ExcInvalidObject()); Assert (dof_indices.size() == (2*this->dof_handler->get_fe()[fe_index].dofs_per_vertex + this->dof_handler->get_fe()[fe_index].dofs_per_line), - DoFAccessor >::ExcVectorDoesNotMatch()); + BaseClass::ExcVectorDoesNotMatch()); // this function really only makes // sense on non-active objects if @@ -1167,7 +1068,7 @@ DoFObjectAccessor<1,hp::DoFHandler<2> >::get_dof_indices (std::vectorhas_children() || (this->dof_handler->get_fe()[fe_index].dofs_per_cell == 2*this->dof_handler->get_fe()[fe_index].dofs_per_vertex), - DoFAccessor >::ExcNotActive()); + BaseClass::ExcNotActive()); const unsigned int dofs_per_vertex = this->dof_handler->get_fe()[fe_index].dofs_per_vertex, dofs_per_line = this->dof_handler->get_fe()[fe_index].dofs_per_line; @@ -1205,11 +1106,11 @@ DoFObjectAccessor<1,hp::DoFHandler<3> >::get_dof_indices (std::vector(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("DoFHandler not initialized")); - Assert (this->dof_handler != 0, DoFAccessor >::ExcInvalidObject()); - Assert (&this->dof_handler->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); + Assert (this->dof_handler != 0, BaseClass::ExcInvalidObject()); + Assert (&this->dof_handler->get_fe() != 0, BaseClass::ExcInvalidObject()); Assert (dof_indices.size() == (2*this->dof_handler->get_fe()[fe_index].dofs_per_vertex + this->dof_handler->get_fe()[fe_index].dofs_per_line), - DoFAccessor >::ExcVectorDoesNotMatch()); + BaseClass::ExcVectorDoesNotMatch()); // this function really only makes // sense on non-active objects if @@ -1222,7 +1123,7 @@ DoFObjectAccessor<1,hp::DoFHandler<3> >::get_dof_indices (std::vectorhas_children() || (this->dof_handler->get_fe()[fe_index].dofs_per_cell == 2*this->dof_handler->get_fe()[fe_index].dofs_per_vertex), - DoFAccessor >::ExcNotActive()); + BaseClass::ExcNotActive()); const unsigned int dofs_per_vertex = this->dof_handler->get_fe()[fe_index].dofs_per_vertex, dofs_per_line = this->dof_handler->get_fe()[fe_index].dofs_per_line; @@ -1359,13 +1260,13 @@ DoFObjectAccessor<2,hp::DoFHandler<2> >::get_dof_indices (std::vectordof_handler != 0, - DoFAccessor >::ExcInvalidObject()); + BaseClass::ExcInvalidObject()); Assert (&this->dof_handler->get_fe() != 0, - DoFAccessor >::ExcInvalidObject()); + BaseClass::ExcInvalidObject()); Assert (dof_indices.size() == (4*this->dof_handler->get_fe()[fe_index].dofs_per_vertex + 4*this->dof_handler->get_fe()[fe_index].dofs_per_line + this->dof_handler->get_fe()[fe_index].dofs_per_quad), - DoFAccessor >::ExcVectorDoesNotMatch()); + BaseClass::ExcVectorDoesNotMatch()); // this function really only makes // sense on non-active objects if @@ -1378,7 +1279,7 @@ DoFObjectAccessor<2,hp::DoFHandler<2> >::get_dof_indices (std::vectorhas_children() || (this->dof_handler->get_fe()[fe_index].dofs_per_cell == 4*this->dof_handler->get_fe()[fe_index].dofs_per_vertex), - DoFAccessor >::ExcNotActive()); + BaseClass::ExcNotActive()); Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("DoFHandler not initialized")); @@ -1406,13 +1307,13 @@ DoFObjectAccessor<2,hp::DoFHandler<3> >::get_dof_indices (std::vectordof_handler != 0, - DoFAccessor >::ExcInvalidObject()); + BaseClass::ExcInvalidObject()); Assert (&this->dof_handler->get_fe() != 0, - DoFAccessor >::ExcInvalidObject()); + BaseClass::ExcInvalidObject()); Assert (dof_indices.size() == (4*this->dof_handler->get_fe()[fe_index].dofs_per_vertex + 4*this->dof_handler->get_fe()[fe_index].dofs_per_line + this->dof_handler->get_fe()[fe_index].dofs_per_quad), - DoFAccessor >::ExcVectorDoesNotMatch()); + BaseClass::ExcVectorDoesNotMatch()); // this function really only makes // sense on non-active objects if @@ -1425,7 +1326,7 @@ DoFObjectAccessor<2,hp::DoFHandler<3> >::get_dof_indices (std::vectorhas_children() || (this->dof_handler->get_fe()[fe_index].dofs_per_cell == 4*this->dof_handler->get_fe()[fe_index].dofs_per_vertex), - DoFAccessor >::ExcNotActive()); + BaseClass::ExcNotActive()); Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("DoFHandler not initialized")); @@ -1489,14 +1390,14 @@ DoFObjectAccessor<3,hp::DoFHandler<3> >::get_dof_indices (std::vectordof_handler != 0, - DoFAccessor >::ExcInvalidObject()); + BaseClass::ExcInvalidObject()); Assert (&this->dof_handler->get_fe() != 0, - DoFAccessor >::ExcInvalidObject()); + BaseClass::ExcInvalidObject()); Assert (dof_indices.size() == (8*this->dof_handler->get_fe()[fe_index].dofs_per_vertex + 12*this->dof_handler->get_fe()[fe_index].dofs_per_line + 6*this->dof_handler->get_fe()[fe_index].dofs_per_quad + this->dof_handler->get_fe()[fe_index].dofs_per_hex), - DoFAccessor >::ExcVectorDoesNotMatch()); + BaseClass::ExcVectorDoesNotMatch()); Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("DoFHandler not initialized")); @@ -1511,7 +1412,7 @@ DoFObjectAccessor<3,hp::DoFHandler<3> >::get_dof_indices (std::vectorhas_children() || (this->dof_handler->get_fe()[fe_index].dofs_per_cell == 8*this->dof_handler->get_fe()[fe_index].dofs_per_vertex), - DoFAccessor >::ExcNotActive()); + BaseClass::ExcNotActive()); Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("DoFHandler not initialized")); @@ -1761,7 +1662,7 @@ inline void DoFCellAccessor::set_active_fe_index (const unsigned int i) { - Assert (i == 0, typename DoFAccessor::ExcInvalidObject()); + Assert (i == 0, typename BaseClass::BaseClass::ExcInvalidObject()); } @@ -1855,7 +1756,7 @@ void DoFCellAccessor >::set_active_fe_index (const unsigned int i) { Assert (this->dof_handler != 0, - DoFAccessor >::ExcInvalidObject()); + BaseClass::ExcInvalidObject()); Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("DoFHandler not initialized")); @@ -1877,7 +1778,7 @@ void DoFCellAccessor >::set_active_fe_index (const unsigned int i) { Assert (this->dof_handler != 0, - DoFAccessor >::ExcInvalidObject()); + BaseClass::ExcInvalidObject()); Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("DoFHandler not initialized")); @@ -1899,7 +1800,7 @@ void DoFCellAccessor >::set_active_fe_index (const unsigned int i) { Assert (this->dof_handler != 0, - DoFAccessor >::ExcInvalidObject()); + BaseClass::ExcInvalidObject()); Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("DoFHandler not initialized")); @@ -1923,17 +1824,6 @@ DoFCellAccessor:: distribute_local_to_global (const Vector &local_source, OutputVector &global_destination) const { - // since the exception classes are - // from a template dependent base - // class, we have to fully qualify - // them. to work around more - // trouble, typedef the template - // dependent base class to a - // non-template dependent name and - // use that to specify the - // qualified exception names - typedef DoFAccessor BaseClass; - Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject()); Assert (&this->get_fe() != 0, @@ -1966,17 +1856,6 @@ DoFCellAccessor:: distribute_local_to_global (const FullMatrix &local_source, OutputMatrix &global_destination) const { - // since the exception classes are - // from a template dependent base - // class, we have to fully qualify - // them. to work around more - // trouble, typedef the template - // dependent base class to a - // non-template dependent name and - // use that to specify the - // qualified exception names - typedef DoFAccessor BaseClass; - Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject()); Assert (&this->get_fe() != 0, diff --git a/deal.II/deal.II/include/dofs/dof_handler.h b/deal.II/deal.II/include/dofs/dof_handler.h index d509fc5800..8353b7df5b 100644 --- a/deal.II/deal.II/include/dofs/dof_handler.h +++ b/deal.II/deal.II/include/dofs/dof_handler.h @@ -1071,7 +1071,7 @@ class DoFHandler : public Subscriptor /* * Make accessor objects friends. */ - template friend class DoFAccessor; + template friend class DoFAccessor; /* * Make accessor objects friends. diff --git a/deal.II/deal.II/include/dofs/dof_iterator_selector.h b/deal.II/deal.II/include/dofs/dof_iterator_selector.h index d4e825a1fa..7e02a53831 100644 --- a/deal.II/deal.II/include/dofs/dof_iterator_selector.h +++ b/deal.II/deal.II/include/dofs/dof_iterator_selector.h @@ -13,7 +13,7 @@ #ifndef __deal2__dof_iterator_selector_h #define __deal2__dof_iterator_selector_h -template class DoFAccessor; +template class DoFAccessor; template class DoFCellAccessor; template class DoFObjectAccessor; template class FiniteElement; 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 434ce79820..54125e9195 100644 --- a/deal.II/deal.II/include/multigrid/mg_dof_accessor.h +++ b/deal.II/deal.II/include/multigrid/mg_dof_accessor.h @@ -80,7 +80,7 @@ class MGDoFAccessor { * Reset the DoF handler pointer. */ void set_mg_dof_handler (MGDoFHandler *dh) { - typedef DoFAccessor > BaseClass; + typedef DoFAccessor > BaseClass; Assert (dh != 0, typename BaseClass::ExcInvalidObject()); mg_dof_handler = dh; }; @@ -235,6 +235,16 @@ class MGDoFObjectAccessor<1, dim> : public MGDoFAccessor, public MGDoFObjectAccessor_Inheritance<1, dim>::BaseClass { public: + /** + * Declare a typedef to the base + * class to make accessing some + * of the exception classes + * simpler. + */ + typedef + typename MGDoFObjectAccessor_Inheritance<1, dim>::BaseClass + BaseClass; + /** * Declare the data type that this accessor * class expects to get passed from the @@ -351,6 +361,16 @@ class MGDoFObjectAccessor<2, dim> : public MGDoFAccessor, public MGDoFObjectAccessor_Inheritance<2, dim>::BaseClass { public: + /** + * Declare a typedef to the base + * class to make accessing some + * of the exception classes + * simpler. + */ + typedef + typename MGDoFObjectAccessor_Inheritance<2, dim>::BaseClass + BaseClass; + /** * Declare the data type that this accessor * class expects to get passed from the @@ -476,6 +496,17 @@ class MGDoFObjectAccessor<3, dim> : public MGDoFAccessor, public MGDoFObjectAccessor_Inheritance<3, dim>::BaseClass { public: + /** + * Declare a typedef to the base + * class to make accessing some + * of the exception classes + * simpler. + */ + typedef + typename MGDoFObjectAccessor_Inheritance<3, dim>::BaseClass + BaseClass; + + /** * Declare the data type that this accessor * class expects to get passed from the diff --git a/deal.II/deal.II/source/dofs/dof_accessor.cc b/deal.II/deal.II/source/dofs/dof_accessor.cc index ea20d141f2..c95bf0490b 100644 --- a/deal.II/deal.II/source/dofs/dof_accessor.cc +++ b/deal.II/deal.II/source/dofs/dof_accessor.cc @@ -41,8 +41,6 @@ void DoFObjectAccessor<1, DH>::set_dof_index (const unsigned int i, { Assert (fe_index == DoFHandler<1>::default_fe_index, ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects")); - typedef DoFAccessor BaseClass; - Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject()); // make sure a FE has been selected @@ -70,17 +68,6 @@ void DoFObjectAccessor<1, DH>::set_vertex_dof_index (const unsigned int vertex, { Assert (fe_index == DoFHandler<1>::default_fe_index, ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects")); - // since the exception classes are - // from a template dependent base - // class, we have to fully qualify - // them. to work around more - // trouble, typedef the template - // dependent base class to a - // non-template dependent name and - // use that to specify the - // qualified exception names - typedef DoFAccessor BaseClass; - Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject()); Assert (&this->dof_handler->get_fe() != 0, @@ -107,8 +94,6 @@ void DoFObjectAccessor<2, DH>::set_dof_index (const unsigned int i, { Assert (fe_index == DoFHandler<1>::default_fe_index, ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects")); - typedef DoFAccessor BaseClass; - Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject()); // make sure a FE has been selected @@ -133,8 +118,6 @@ DoFObjectAccessor<2, DH>::set_vertex_dof_index (const unsigned int vertex, { Assert (fe_index == DoFHandler<1>::default_fe_index, ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects")); - typedef DoFAccessor BaseClass; - Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject()); Assert (&this->dof_handler->get_fe() != 0, @@ -161,8 +144,6 @@ void DoFObjectAccessor<3, DH>::set_dof_index (const unsigned int i, { Assert (fe_index == DoFHandler<1>::default_fe_index, ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects")); - typedef DoFAccessor BaseClass; - Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject()); // make sure a FE has been selected @@ -186,8 +167,6 @@ void DoFObjectAccessor<3, DH>::set_vertex_dof_index (const unsigned int vertex, { Assert (fe_index == DoFHandler<1>::default_fe_index, ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects")); - typedef DoFAccessor BaseClass; - Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject()); Assert (&this->dof_handler->get_fe() != 0, @@ -336,8 +315,8 @@ DoFCellAccessor >::update_cell_dof_indices_cache () const Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("DoFHandler not initialized")); - Assert (this->dof_handler != 0, DoFAccessor >::ExcInvalidObject()); - Assert (&this->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); + Assert (this->dof_handler != 0, BaseClass::ExcInvalidObject()); + Assert (&this->get_fe() != 0, BaseClass::ExcInvalidObject()); // check as in documentation that // cell is either active, or dofs @@ -413,8 +392,8 @@ DoFCellAccessor >::update_cell_dof_indices_cache () const Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("DoFHandler not initialized")); - Assert (this->dof_handler != 0, DoFAccessor >::ExcInvalidObject()); - Assert (&this->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); + Assert (this->dof_handler != 0, BaseClass::ExcInvalidObject()); + Assert (&this->get_fe() != 0, BaseClass::ExcInvalidObject()); // check as in documentation that // cell is either active, or dofs @@ -493,8 +472,8 @@ DoFCellAccessor >::update_cell_dof_indices_cache () const Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("DoFHandler not initialized")); - Assert (this->dof_handler != 0, DoFAccessor >::ExcInvalidObject()); - Assert (&this->get_fe() != 0, DoFAccessor >::ExcInvalidObject()); + Assert (this->dof_handler != 0, BaseClass::ExcInvalidObject()); + Assert (&this->get_fe() != 0, BaseClass::ExcInvalidObject()); // check as in documentation that // cell is either active, or dofs @@ -622,8 +601,6 @@ get_interpolated_dof_values (const InputVector &values, const FiniteElement &fe = this->get_fe(); const unsigned int dofs_per_cell = fe.dofs_per_cell; - typedef DoFAccessor BaseClass; - Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject()); Assert (&fe != 0, @@ -740,8 +717,7 @@ set_dof_values_by_interpolation (const Vector &local_values, OutputVector &values) const { const unsigned int dofs_per_cell = this->get_fe().dofs_per_cell; - typedef DoFAccessor BaseClass; - + Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject()); Assert (&this->get_fe() != 0, @@ -1026,13 +1002,15 @@ set_dof_values_by_interpolation #endif -template class DoFAccessor >; - #if deal_II_dimension == 1 +template class DoFAccessor<1, DoFHandler<1> >; template class DoFObjectAccessor<1, DoFHandler<1> >; #endif #if deal_II_dimension == 2 +template class DoFAccessor<1, DoFHandler<2> >; +template class DoFAccessor<2, DoFHandler<2> >; + template class DoFObjectAccessor<1, DoFHandler<2> >; template class DoFObjectAccessor<2, DoFHandler<2> >; @@ -1042,6 +1020,10 @@ template class TriaActiveIterator<2,DoFObjectAccessor<1, DoFHandler<2> > >; #endif #if deal_II_dimension == 3 +template class DoFAccessor<1, DoFHandler<3> >; +template class DoFAccessor<2, DoFHandler<3> >; +template class DoFAccessor<3, DoFHandler<3> >; + template class DoFObjectAccessor<1, DoFHandler<3> >; template class DoFObjectAccessor<2, DoFHandler<3> >; template class DoFObjectAccessor<3, DoFHandler<3> >; @@ -1311,13 +1293,15 @@ set_dof_values_by_interpolation #endif -template class DoFAccessor >; - #if deal_II_dimension == 1 +template class DoFAccessor<1, hp::DoFHandler<1> >; template class DoFObjectAccessor<1, hp::DoFHandler<1> >; #endif #if deal_II_dimension == 2 +template class DoFAccessor<1, hp::DoFHandler<2> >; +template class DoFAccessor<2, hp::DoFHandler<2> >; + template class DoFObjectAccessor<1, hp::DoFHandler<2> >; template class DoFObjectAccessor<2, hp::DoFHandler<2> >; @@ -1328,6 +1312,10 @@ template class TriaActiveIterator<2,DoFObjectAccessor<1, hp::DoFHandler<2> > >; #if deal_II_dimension == 3 +template class DoFAccessor<1, hp::DoFHandler<3> >; +template class DoFAccessor<2, hp::DoFHandler<3> >; +template class DoFAccessor<3, hp::DoFHandler<3> >; + template class DoFObjectAccessor<1, hp::DoFHandler<3> >; template class DoFObjectAccessor<2, hp::DoFHandler<3> >; template class DoFObjectAccessor<3, hp::DoFHandler<3> >; 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 2ce43ab85c..51b2ff6a9e 100644 --- a/deal.II/deal.II/source/multigrid/mg_dof_accessor.cc +++ b/deal.II/deal.II/source/multigrid/mg_dof_accessor.cc @@ -40,8 +40,6 @@ MGDoFObjectAccessor<1, dim>::MGDoFObjectAccessor (const Triangulation *tria template unsigned int MGDoFObjectAccessor<1, dim>::mg_dof_index (const unsigned int i) const { - typedef DoFAccessor > BaseClass; - Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject()); Assert (this->mg_dof_handler != 0, @@ -62,8 +60,6 @@ template void MGDoFObjectAccessor<1, dim>::set_mg_dof_index (const unsigned int i, const unsigned int index) const { - typedef DoFAccessor > BaseClass; - Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject()); Assert (this->mg_dof_handler != 0, @@ -84,8 +80,6 @@ template unsigned int MGDoFObjectAccessor<1, dim>::mg_vertex_dof_index (const unsigned int vertex, const unsigned int i) const { - typedef DoFAccessor > BaseClass; - Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject()); Assert (this->mg_dof_handler != 0, @@ -106,8 +100,6 @@ void MGDoFObjectAccessor<1, dim>::set_mg_vertex_dof_index (const unsigned int ve const unsigned int i, const unsigned int index) const { - typedef DoFAccessor > BaseClass; - Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject()); Assert (this->mg_dof_handler != 0, @@ -127,8 +119,6 @@ template void MGDoFObjectAccessor<1, dim>::get_mg_dof_indices (std::vector &dof_indices) const { - typedef DoFAccessor > BaseClass; - Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject()); Assert (this->mg_dof_handler != 0, @@ -159,8 +149,6 @@ void MGDoFObjectAccessor<1,dim>::get_mg_dof_values (const Vector &values, Vector &dof_values) const { - typedef DoFAccessor > BaseClass; - Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject()); Assert (this->mg_dof_handler != 0, @@ -227,8 +215,6 @@ MGDoFObjectAccessor<2, dim>::MGDoFObjectAccessor (const Triangulation *tria template unsigned int MGDoFObjectAccessor<2, dim>::mg_dof_index (const unsigned int i) const { - typedef DoFAccessor > BaseClass; - Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject()); Assert (this->mg_dof_handler != 0, @@ -249,8 +235,6 @@ template void MGDoFObjectAccessor<2, dim>::set_mg_dof_index (const unsigned int i, const unsigned int index) const { - typedef DoFAccessor > BaseClass; - Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject()); Assert (this->mg_dof_handler != 0, @@ -271,8 +255,6 @@ template unsigned int MGDoFObjectAccessor<2, dim>::mg_vertex_dof_index (const unsigned int vertex, const unsigned int i) const { - typedef DoFAccessor > BaseClass; - Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject()); Assert (this->mg_dof_handler != 0, @@ -293,8 +275,6 @@ void MGDoFObjectAccessor<2, dim>::set_mg_vertex_dof_index (const unsigned int ve const unsigned int i, const unsigned int index) const { - typedef DoFAccessor > BaseClass; - Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject()); Assert (this->mg_dof_handler != 0, @@ -314,9 +294,6 @@ template void MGDoFObjectAccessor<2, dim>::get_mg_dof_indices (std::vector &dof_indices) const { - typedef DoFAccessor > BaseClass; - typedef DoFAccessor > BaseClass2D; - Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject()); Assert (this->mg_dof_handler != 0, @@ -326,7 +303,7 @@ MGDoFObjectAccessor<2, dim>::get_mg_dof_indices (std::vector &dof_ Assert (dof_indices.size() == (4*this->dof_handler->get_fe().dofs_per_vertex + 4*this->dof_handler->get_fe().dofs_per_line + this->dof_handler->get_fe().dofs_per_quad), - typename BaseClass2D::ExcVectorDoesNotMatch()); + typename BaseClass::ExcVectorDoesNotMatch()); const unsigned int dofs_per_vertex = this->dof_handler->get_fe().dofs_per_vertex, dofs_per_line = this->dof_handler->get_fe().dofs_per_line, @@ -352,8 +329,6 @@ void MGDoFObjectAccessor<2,dim>::get_mg_dof_values (const Vector &values, Vector &dof_values) const { - typedef DoFAccessor > BaseClass; - Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject()); Assert (this->mg_dof_handler != 0, @@ -440,8 +415,6 @@ MGDoFObjectAccessor<3, dim>::MGDoFObjectAccessor (const Triangulation *tria template unsigned int MGDoFObjectAccessor<3, dim>::mg_dof_index (const unsigned int i) const { - typedef DoFAccessor > BaseClass; - Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject()); Assert (this->mg_dof_handler != 0, @@ -462,8 +435,6 @@ template void MGDoFObjectAccessor<3, dim>::set_mg_dof_index (const unsigned int i, const unsigned int index) const { - typedef DoFAccessor > BaseClass; - Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject()); Assert (this->mg_dof_handler != 0, @@ -484,8 +455,6 @@ template unsigned int MGDoFObjectAccessor<3, dim>::mg_vertex_dof_index (const unsigned int vertex, const unsigned int i) const { - typedef DoFAccessor > BaseClass; - Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject()); Assert (this->mg_dof_handler != 0, @@ -506,8 +475,6 @@ void MGDoFObjectAccessor<3, dim>::set_mg_vertex_dof_index (const unsigned int ve const unsigned int i, const unsigned int index) const { - typedef DoFAccessor > BaseClass; - Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject()); Assert (this->mg_dof_handler != 0, @@ -527,9 +494,6 @@ template void MGDoFObjectAccessor<3, dim>::get_mg_dof_indices (std::vector &dof_indices) const { - typedef DoFAccessor > BaseClass; - typedef DoFAccessor > BaseClass3D; - Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject()); Assert (this->mg_dof_handler != 0, @@ -540,7 +504,7 @@ MGDoFObjectAccessor<3, dim>::get_mg_dof_indices (std::vector &dof_ 12*this->dof_handler->get_fe().dofs_per_line + 6*this->dof_handler->get_fe().dofs_per_quad + this->dof_handler->get_fe().dofs_per_hex), - typename BaseClass3D::ExcVectorDoesNotMatch()); + typename BaseClass::ExcVectorDoesNotMatch()); const unsigned int dofs_per_vertex = this->dof_handler->get_fe().dofs_per_vertex, dofs_per_line = this->dof_handler->get_fe().dofs_per_line, @@ -570,8 +534,6 @@ void MGDoFObjectAccessor<3,dim>::get_mg_dof_values (const Vector &values, Vector &dof_values) const { - typedef DoFAccessor > BaseClass; - Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject()); Assert (this->mg_dof_handler != 0,