From 04740343bf85db38ba7888daca4064e25048e00b Mon Sep 17 00:00:00 2001 From: guido Date: Tue, 20 Jul 1999 21:24:16 +0000 Subject: [PATCH] towards unification 3d git-svn-id: https://svn.dealii.org/trunk@1613 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/dofs/dof_accessor.h | 16 +- .../include/dofs/dof_accessor.templates.h | 20 +- deal.II/deal.II/include/dofs/dof_handler.h | 4 +- .../deal.II/include/dofs/mg_dof_accessor.h | 18 +- deal.II/deal.II/include/dofs/mg_dof_handler.h | 4 +- deal.II/deal.II/include/grid/tria.h | 4 +- deal.II/deal.II/include/grid/tria_accessor.h | 382 +++++++++++++++++- .../include/grid/tria_accessor.templates.h | 34 +- .../include/multigrid/mg_dof_accessor.h | 18 +- .../include/multigrid/mg_dof_handler.h | 4 +- deal.II/deal.II/source/dofs/dof_accessor.cc | 16 +- .../deal.II/source/dofs/mg_dof_accessor.cc | 36 +- deal.II/deal.II/source/grid/tria_accessor.cc | 50 +-- .../source/multigrid/mg_dof_accessor.cc | 36 +- 14 files changed, 505 insertions(+), 137 deletions(-) diff --git a/deal.II/deal.II/include/dofs/dof_accessor.h b/deal.II/deal.II/include/dofs/dof_accessor.h index 3a7cb0ca62..ae10947c0a 100644 --- a/deal.II/deal.II/include/dofs/dof_accessor.h +++ b/deal.II/deal.II/include/dofs/dof_accessor.h @@ -413,7 +413,9 @@ class DoFObjectAccessor<2, dim, BaseClass> : public DoFAccessor, * @see DoFLineAccessor */ template -class DoFHexAccessor : public DoFAccessor, public BaseClass { +class DoFObjectAccessor<3, dim, BaseClass> : public DoFAccessor, + public BaseClass +{ public: /** * Declare the data type that this accessor @@ -426,14 +428,14 @@ class DoFHexAccessor : public DoFAccessor, public BaseClass { * Default constructor, unused thus * not implemented. */ - DoFHexAccessor (); + DoFObjectAccessor (); /** * Constructor. The #local_data# * argument is assumed to be a pointer * to a #DoFHandler# object. */ - DoFHexAccessor (Triangulation *tria, + DoFObjectAccessor (Triangulation *tria, const int level, const int index, const AccessorData *local_data) : @@ -500,7 +502,7 @@ class DoFHexAccessor : public DoFAccessor, public BaseClass { * class returns a hex accessor without * access to the DoF data. */ - TriaIterator > child (const unsigned int) const; + TriaIterator > child (const unsigned int) const; /** * Distribute a local (cell based) vector @@ -532,7 +534,7 @@ class DoFHexAccessor : public DoFAccessor, public BaseClass { * Implement the copy operator needed * for the iterator classes. */ - void copy_from (const DoFHexAccessor &a); + void copy_from (const DoFObjectAccessor<3, dim,BaseClass> &a); }; @@ -660,7 +662,7 @@ class DoFSubstructAccessor<2> : public DoFObjectAccessor<2, 2,CellAccessor<2> > * @see DoFSubstructAccessor<1> */ template <> -class DoFSubstructAccessor<3> : public DoFHexAccessor<3,CellAccessor<3> > { +class DoFSubstructAccessor<3> : public DoFObjectAccessor<3, 3,CellAccessor<3> > { public: /** * Declare the data type that this accessor @@ -676,7 +678,7 @@ class DoFSubstructAccessor<3> : public DoFHexAccessor<3,CellAccessor<3> > { const int level, const int index, const AccessorData *local_data) : - DoFHexAccessor<3,CellAccessor<3> > (tria,level,index,local_data) {}; + DoFObjectAccessor<3, 3,CellAccessor<3> > (tria,level,index,local_data) {}; // do this here, since this way the // CellAccessor has the possibility to know // what a face_iterator is. Otherwise 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 b92ec6cb37..0a0f44d483 100644 --- a/deal.II/deal.II/include/dofs/dof_accessor.templates.h +++ b/deal.II/deal.II/include/dofs/dof_accessor.templates.h @@ -216,12 +216,12 @@ DoFObjectAccessor<2, dim,BaseClass>::copy_from (const DoFObjectAccessor<2, dim,B -/*------------------------- Functions: DoFHexAccessor -----------------------*/ +/*------------------------- Functions: DoFObjectAccessor -----------------------*/ template inline -int DoFHexAccessor::dof_index (const unsigned int i) const { +int DoFObjectAccessor<3, dim,BaseClass>::dof_index (const unsigned int i) const { Assert (dof_handler != 0, ExcInvalidObject()); // make sure a FE has been selected // and enough room was reserved @@ -237,7 +237,7 @@ int DoFHexAccessor::dof_index (const unsigned int i) const { template inline -int DoFHexAccessor::vertex_dof_index (const unsigned int vertex, +int DoFObjectAccessor<3, dim,BaseClass>::vertex_dof_index (const unsigned int vertex, const unsigned int i) const { Assert (dof_handler != 0, ExcInvalidObject()); Assert (dof_handler->selected_fe != 0, ExcInvalidObject()); @@ -256,7 +256,7 @@ int DoFHexAccessor::vertex_dof_index (const unsigned int vertex, template inline void -DoFHexAccessor::get_dof_indices (vector &dof_indices) const { +DoFObjectAccessor<3, dim,BaseClass>::get_dof_indices (vector &dof_indices) const { Assert (dof_handler != 0, ExcInvalidObject()); Assert (dof_handler->selected_fe != 0, ExcInvalidObject()); Assert (dof_indices.size() == (8*dof_handler->get_fe().dofs_per_vertex + @@ -288,7 +288,7 @@ DoFHexAccessor::get_dof_indices (vector &dof_indices) const template inline TriaIterator > > -DoFHexAccessor::line (const unsigned int i) const { +DoFObjectAccessor<3, dim,BaseClass>::line (const unsigned int i) const { TriaIterator > l = BaseClass::line(i); return TriaIterator > > ( @@ -304,7 +304,7 @@ DoFHexAccessor::line (const unsigned int i) const { template inline TriaIterator > > -DoFHexAccessor::quad (const unsigned int i) const { +DoFObjectAccessor<3, dim,BaseClass>::quad (const unsigned int i) const { Assert (i<6, ExcIndexRange (i, 0, 6)); return TriaIterator > > @@ -320,9 +320,9 @@ DoFHexAccessor::quad (const unsigned int i) const { template inline -TriaIterator > -DoFHexAccessor::child (const unsigned int i) const { - TriaIterator > q (tria, +TriaIterator > +DoFObjectAccessor<3, dim,BaseClass>::child (const unsigned int i) const { + TriaIterator > q (tria, present_level+1, child_index (i), dof_handler); @@ -337,7 +337,7 @@ DoFHexAccessor::child (const unsigned int i) const { template -void DoFHexAccessor::copy_from (const DoFHexAccessor &a) { +void DoFObjectAccessor<3, dim,BaseClass>::copy_from (const DoFObjectAccessor<3, dim,BaseClass> &a) { BaseClass::copy_from (a); set_dof_handler (a.dof_handler); }; diff --git a/deal.II/deal.II/include/dofs/dof_handler.h b/deal.II/deal.II/include/dofs/dof_handler.h index cc4e054094..bfed4555bd 100644 --- a/deal.II/deal.II/include/dofs/dof_handler.h +++ b/deal.II/deal.II/include/dofs/dof_handler.h @@ -1568,8 +1568,8 @@ class DoFHandler : public Subscriptor, friend class DoFObjectAccessor<1, dim, CellAccessor >; friend class DoFObjectAccessor<2, dim, TriaObjectAccessor<2, dim> >; friend class DoFObjectAccessor<2, dim, CellAccessor >; - friend class DoFHexAccessor >; - friend class DoFHexAccessor >; + friend class DoFObjectAccessor<3, dim, TriaObjectAccessor<3, dim> >; + friend class DoFObjectAccessor<3, dim, CellAccessor >; }; diff --git a/deal.II/deal.II/include/dofs/mg_dof_accessor.h b/deal.II/deal.II/include/dofs/mg_dof_accessor.h index b7fcc566ec..030ea02c76 100644 --- a/deal.II/deal.II/include/dofs/mg_dof_accessor.h +++ b/deal.II/deal.II/include/dofs/mg_dof_accessor.h @@ -338,7 +338,9 @@ class MGDoFObjectAccessor<2, dim, BaseClass> : public MGDoFAccessor, publi * @see DoFLineAccessor */ template -class MGDoFHexAccessor : public MGDoFAccessor, public DoFHexAccessor { +class MGDoFObjectAccessor<3, dim, BaseClass> : public MGDoFAccessor, + public DoFObjectAccessor<3, dim, BaseClass> +{ public: /** * Declare the data type that this accessor @@ -351,14 +353,14 @@ class MGDoFHexAccessor : public MGDoFAccessor, public DoFHexAccessor# object. */ - MGDoFHexAccessor (Triangulation *tria, + MGDoFObjectAccessor (Triangulation *tria, const int level, const int index, const AccessorData *local_data); @@ -429,13 +431,13 @@ class MGDoFHexAccessor : public MGDoFAccessor, public DoFHexAccessor > child (const unsigned int) const; + TriaIterator > child (const unsigned int) const; /** * Implement the copy operator needed * for the iterator classes. */ - void copy_from (const MGDoFHexAccessor &a); + void copy_from (const MGDoFObjectAccessor<3, dim,BaseClass> &a); }; @@ -559,14 +561,14 @@ class MGDoFSubstructAccessor<2> : public MGDoFObjectAccessor<2, 2,CellAccessor<2 * @see MGDoFSubstructAccessor<1> */ template <> -class MGDoFSubstructAccessor<3> : public MGDoFHexAccessor<3,CellAccessor<3> > { +class MGDoFSubstructAccessor<3> : public MGDoFObjectAccessor<3, 3,CellAccessor<3> > { public: /** * Declare the data type that this accessor * class expects to get passed from the * iterator classes. */ - typedef MGDoFHexAccessor<3,CellAccessor<3> >::AccessorData AccessorData; + typedef MGDoFObjectAccessor<3, 3,CellAccessor<3> >::AccessorData AccessorData; /** * Constructor @@ -575,7 +577,7 @@ class MGDoFSubstructAccessor<3> : public MGDoFHexAccessor<3,CellAccessor<3> > { const int level, const int index, const AccessorData *local_data) : - MGDoFHexAccessor<3,CellAccessor<3> > (tria,level,index,local_data) {}; + MGDoFObjectAccessor<3, 3,CellAccessor<3> > (tria,level,index,local_data) {}; // do this here, since this way the // CellAccessor has the possibility to know // what a face_iterator is. Otherwise diff --git a/deal.II/deal.II/include/dofs/mg_dof_handler.h b/deal.II/deal.II/include/dofs/mg_dof_handler.h index cfc826e904..4b15d63172 100644 --- a/deal.II/deal.II/include/dofs/mg_dof_handler.h +++ b/deal.II/deal.II/include/dofs/mg_dof_handler.h @@ -962,8 +962,8 @@ class MGDoFHandler friend class MGDoFObjectAccessor<1, dim, CellAccessor >; friend class MGDoFObjectAccessor<2, dim, TriaObjectAccessor<2, dim> >; friend class MGDoFObjectAccessor<2, dim, CellAccessor >; - friend class MGDoFHexAccessor >; - friend class MGDoFHexAccessor >; + friend class MGDoFObjectAccessor<3, dim, TriaObjectAccessor<3, dim> >; + friend class MGDoFObjectAccessor<3, dim, CellAccessor >; }; diff --git a/deal.II/deal.II/include/grid/tria.h b/deal.II/deal.II/include/grid/tria.h index a729fef2db..43767785a9 100644 --- a/deal.II/deal.II/include/grid/tria.h +++ b/deal.II/deal.II/include/grid/tria.h @@ -3005,7 +3005,7 @@ class Triangulation friend class TriaAccessor; friend class TriaObjectAccessor<1, dim>; friend class TriaObjectAccessor<2, dim>; - friend class HexAccessor; + friend class TriaObjectAccessor<3, dim>; friend class CellAccessor; @@ -3018,7 +3018,7 @@ class Triangulation friend class TriaRawIterator<3,TriaObjectAccessor<1, 3> >; friend class TriaRawIterator<3,TriaObjectAccessor<2, 3> >; - friend class TriaRawIterator<3,HexAccessor<3> >; + friend class TriaRawIterator<3,TriaObjectAccessor<3, 3> >; friend class TriaRawIterator<3,CellAccessor<3> >; friend class DoFHandler; diff --git a/deal.II/deal.II/include/grid/tria_accessor.h b/deal.II/deal.II/include/grid/tria_accessor.h index 500122d15d..e7d15db8e7 100644 --- a/deal.II/deal.II/include/grid/tria_accessor.h +++ b/deal.II/deal.II/include/grid/tria_accessor.h @@ -238,11 +238,372 @@ class TriaAccessor /** * Common template for line, quad, hex. - * @author Guido Kanschat, 1999 + * According to #celldim# objects of this class represent lines, + quadrilaterals, or hexahedra in #dim# space dimensions. + * @author Wolfgang Bangerth, Guido Kanschat, 1999 */ template -class TriaObjectAccessor; +class TriaObjectAccessor : public TriaAccessor +{ + public: + /** + * Constructor. + * By default, an illegal + * accessor is constructed. + */ + TriaObjectAccessor (Triangulation *parent = 0, + const int level = -1, + const int index = -1, + const void *local_data = 0) : + TriaAccessor (parent, level, index, local_data) {}; + + /** + * Copy the data of a line. Only + * implemented for #celldim==1#. + */ + + void set (const Line&) const; + /** + * Copy the data of the given quad. Only + * implemented for #celldim==2#. + */ + void set (const Quad&) const; + /** + * Copy the data of the given hex. Only + * implemented for #celldim==3#. + */ + void set (const Hexahedron&) const; + + /** + * Index of vertex. The convention regarding the + * numbering of vertices is laid down + * in the documentation of the + * #Triangulation# class. + */ + int vertex_index (const unsigned int i) const; + + /** + * Reference (not an iterator!) + * to the #i#th vertex. + */ + Point & vertex (const unsigned int i) const; + + /** + * Pointer to the #i#th line + * bounding this object. + * + * Implemented only for #celldim>1#. + */ + TriaIterator > line (const unsigned int i) const; + + /** + * Line index of the #i#th + * line. The level is naturally + * the same as that of the object. + * + * Implemented only for #celldim>1#. + */ + unsigned int line_index (const unsigned int i) const; + + /** + * Pointer to the #i#th quad + * bounding this object. + * + * Implemented only for #celldim>2#. + */ + TriaIterator > quad (const unsigned int i) const; + /** + * Quad index of the #i#th + * quad. The level is naturally + * the same as that of the object. + * + * Implemented only for #celldim>2#. + */ + unsigned int quad_index (const unsigned int i) const; + + /** + * Test for the element being used + * or not. + */ + bool used () const; + + /** + * Set the #used# flag. You should know + * quite exactly what you are doing of you + * touch this function. It is exclusively + * for internal use in the library. + */ + void set_used_flag () const; + + /** + * Clear the #used# flag. You should know + * quite exactly what you are doing of you + * touch this function. It is exclusively + * for internal use in the library. + */ + void clear_used_flag () const; + + /** + * Read the user flag. + */ + bool user_flag_set () const; + + /** + * Set the user flag. + */ + void set_user_flag () const; + + /** + * Clear the user flag. + */ + void clear_user_flag () const; + + /** + * Set the user flag for this + * and all descendants. + */ + void recursively_set_user_flag () const; + + /** + * Clear the user flag for this + * and all descendants. + */ + void recursively_clear_user_flag () const; + + /** + * Set the user pointer + * to #p#. + */ + void set_user_pointer (void *p) const; + + /** + * Reset the user pointer + * to a #NULL# pointer. + */ + void clear_user_pointer () const; + + /** + * Access the value of the user pointer. It is in the + * responsibility of the user to make + * sure that the pointer points to + * something useful. You should use the + * new style cast operator to maintain + * a minimum of typesafety, e.g. + * #A *a=static_cast(cell->user_pointer());#. + */ + void * user_pointer () const; + + /** + * Pointer to the #i#th + * child. + */ + TriaIterator > child (const unsigned int i) const; + + /** + * Index of the #i#th child. + * The level of the child is one higher + * than that of the present cell. + * If the child does not exist, -1 + * is returned. + */ + int child_index (const unsigned int i) const; + + /** + * Set the child field. Since we + * only store the index of the first + * child (the others follow directly) + * only one child index is to be + * given. The level of the child is + * one level up of the level of the + * cell to which this iterator points. + */ + void set_children (const int index) const; + + /** + * Clear the child field, i.e. set + * it to a value which indicates + * that this cell has no children. + */ + void clear_children () const; + + /** + * Test whether the object has children. + */ + bool has_children () const; + + /** + * Number of times that this + * object is refined. Note that not all + * its children are refined that often + * (which is why we prepend #max_#), + * the returned number is rather the + * maximum number of refinement in + * any branch of children of this object. + */ + unsigned int max_refinement_depth () const; + + /** + * Boundary indicator of this + * object. + * If the return value is 255, then this + * line is in the interior of the domain. + * + * Since boundary data is only useful + * for structures with a dimension less + * than the dimension of a cell, this + * function issues an error if #dim<4#. + */ + unsigned char boundary_indicator () const; + + /** + * Set the boundary indicator. + * The same applies as for the + * #boundary_indicator()# function. + * + * Caution: Never set the + * boundary indicator to 255, unless + * you exactly know what you are doing! + * This value is reserved for + * another purpose and algorithms may + * not work if boundary cells have have + * this boundary indicator or if interior + * cells have boundary indicators other + * than 255. + */ + void set_boundary_indicator (unsigned char) const; + + /** + * Return whether this object is at the + * boundary. This is checked via + * the boundary indicator field, which + * is always 255 if the hex is in the + * interior of the domain. Obviously, + * the use of this function is only + * possible for #dim>celldim#; + * however, for #dim==celldim#, an object is + * a cell and the #CellAccessor# class + * offers another possibility to + * determine whether a cell is at the + * boundary or not. + */ + bool at_boundary () const; + + /** + * Diameter of the object. + * + * The diameter of an object is computed to + * be the largest diagonal. This + * is not necessarily the true + * diameter, but completely + * sufficient for computations. + */ + double diameter () const; + + /** + * Center of the object. The + * center of an object is defined to be + * the average of the vertices, + * which is also where the + * (dim-)linear mapping places the midpoint + * of the unit cell in real space. + * However, this may not be the + * barycenter of the object. + */ + Point center () const; + + /** + * Barycenter of the object. + */ + Point barycenter () const; + + /** + * Volume of the object. + * Here, the volume is defined to + * be confined by the (dim-)linear + * mapping of the unit cell. + * No information + * about the boundary is used. If + * a more sophisticated computation + * is needed, try the volume of an + * appropriate finite element class. + */ + double measure () const; + + /** + * Number of active + * descendants. + * This function only counts the number + * of active descendants, i.e. the number + * of descendants which are not further + * refined. Thus, if all of the eight + * children of a hex are further + * refined exactly once, the returned + * number will be 64, not 80. + * + * If the present cell is not refined, + * one is returned. + */ + unsigned int number_of_children () const; + + private: + /** + * Copy operator. This is normally + * used in a context like + * #iterator a,b; *a=*b;#. Since + * the meaning is to copy the object + * pointed to by #b# to the object + * pointed to by #a# and since + * accessors are not real but + * virtual objects, this operation + * is not useful for iterators on + * triangulations. We declare this + * function here private, thus it may + * not be used from outside. + * Furthermore it is not implemented + * and will give a linker error if + * used anyway. + */ + void operator = (const TriaObjectAccessor<3, dim> &); + + protected: + /**@name Advancement of iterators*/ + /*@{*/ + /** + * This operator advances the iterator to + * the next element. + * + * The next element is next on this + * level if there are more. If the + * present element is the last on + * this level, the first on the + * next level is accessed. + */ + void operator ++ (); + + /** + * This operator moves the iterator to + * the previous element. + * + * The previous element is previous on + * this level if #index>0#. If the + * present element is the first on + * this level, the last on the + * previous level is accessed. + */ + void operator -- (); + /*@}*/ + + /** + * Declare some friends. + */ + template friend class TriaRawIterator; +}; + + +template +class TriaObjectAccessor<0, dim> : public TriaAccessor +{}; @@ -930,12 +1291,13 @@ class TriaObjectAccessor<2, dim> : public TriaAccessor * @author Wolfgang Bangerth, 1998 */ template -class HexAccessor : public TriaAccessor { +class TriaObjectAccessor<3, dim> : public TriaAccessor +{ public: /** * Constructor. */ - HexAccessor (Triangulation *parent = 0, + TriaObjectAccessor (Triangulation *parent = 0, const int level = -1, const int index = -1, const void *local_data = 0) : @@ -1067,7 +1429,7 @@ class HexAccessor : public TriaAccessor { * Return a pointer to the #i#th * child. */ - TriaIterator > child (const unsigned int i) const; + TriaIterator > child (const unsigned int i) const; /** * Return the index of the #i#th child. @@ -1240,7 +1602,7 @@ class HexAccessor : public TriaAccessor { * and will give a linker error if * used anyway. */ - void operator = (const HexAccessor &); + void operator = (const TriaObjectAccessor<3, dim> &); protected: /**@name Advancement of iterators*/ @@ -1301,7 +1663,7 @@ class TriaSubstructAccessor; * \begin{verbatim} * TriaSubstructAccessor<1> := TriaObjectAccessor<1, 1>; * TriaSubstructAccessor<2> := TriaObjectAccessor<2, 2>; - * TriaSubstructAccessor<3> := HexAccessor<3>; + * TriaSubstructAccessor<3> := TriaObjectAccessor<3, 3>; * \end{verbatim} * We do this rather complex (and needless, provided C++ the needed constructs!) * class hierarchy manipulation, since this way we can declare and implement @@ -1380,13 +1742,13 @@ class TriaSubstructAccessor<2> : public TriaObjectAccessor<2, 2> { * @see TriaSubstructAccessor<1> */ template <> -class TriaSubstructAccessor<3> : public HexAccessor<3> { +class TriaSubstructAccessor<3> : public TriaObjectAccessor<3, 3> { public: /** * Propagate the AccessorData type * into the present class. */ - typedef HexAccessor<3>::AccessorData AccessorData; + typedef TriaObjectAccessor<3, 3>::AccessorData AccessorData; /** * Constructor @@ -1395,7 +1757,7 @@ class TriaSubstructAccessor<3> : public HexAccessor<3> { const int level, const int index, const void *local_data) : - HexAccessor<3> (tria,level,index,local_data) {}; + TriaObjectAccessor<3, 3> (tria,level,index,local_data) {}; // do this here, since this way the // CellAccessor has the possibility to know diff --git a/deal.II/deal.II/include/grid/tria_accessor.templates.h b/deal.II/deal.II/include/grid/tria_accessor.templates.h index 6a4dd2b89a..f75682dd43 100644 --- a/deal.II/deal.II/include/grid/tria_accessor.templates.h +++ b/deal.II/deal.II/include/grid/tria_accessor.templates.h @@ -427,14 +427,14 @@ TriaObjectAccessor<2, dim>::operator -- () { -/*------------------------ Functions: HexAccessor ---------------------------*/ +/*------------------------ Functions: TriaObjectAccessor ---------------------------*/ template inline bool -HexAccessor::used () const { +TriaObjectAccessor<3, dim>::used () const { Assert (state() == valid, ExcDereferenceInvalidObject()); return tria->levels[present_level]->hexes.used[present_index]; }; @@ -444,7 +444,7 @@ HexAccessor::used () const { template inline bool -HexAccessor::user_flag_set () const { +TriaObjectAccessor<3, dim>::user_flag_set () const { Assert (used(), ExcCellNotUsed()); return tria->levels[present_level]->hexes.user_flags[present_index]; }; @@ -454,7 +454,7 @@ HexAccessor::user_flag_set () const { template inline void -HexAccessor::set_user_flag () const { +TriaObjectAccessor<3, dim>::set_user_flag () const { Assert (used(), ExcCellNotUsed()); tria->levels[present_level]->hexes.user_flags[present_index] = true; }; @@ -463,7 +463,7 @@ HexAccessor::set_user_flag () const { template inline -void HexAccessor::clear_user_flag () const { +void TriaObjectAccessor<3, dim>::clear_user_flag () const { Assert (used(), ExcCellNotUsed()); tria->levels[present_level]->hexes.user_flags[present_index] = false; }; @@ -474,7 +474,7 @@ void HexAccessor::clear_user_flag () const { template inline TriaIterator > -HexAccessor::line (const unsigned int i) const { +TriaObjectAccessor<3, dim>::line (const unsigned int i) const { Assert (used(), ExcCellNotUsed()); Assert (i<12, ExcIndexRange (i,0,12)); @@ -504,7 +504,7 @@ HexAccessor::line (const unsigned int i) const { template inline TriaIterator > -HexAccessor::quad (const unsigned int i) const { +TriaObjectAccessor<3, dim>::quad (const unsigned int i) const { Assert (used(), ExcCellNotUsed()); return TriaIterator > @@ -520,7 +520,7 @@ HexAccessor::quad (const unsigned int i) const { template inline unsigned int -HexAccessor::line_index (unsigned int i) const { +TriaObjectAccessor<3, dim>::line_index (unsigned int i) const { Assert (i<12, ExcIndexRange(i,0,12)); if (i<4) @@ -549,7 +549,7 @@ HexAccessor::line_index (unsigned int i) const { template inline unsigned int -HexAccessor::quad_index (unsigned int i) const { +TriaObjectAccessor<3, dim>::quad_index (unsigned int i) const { Assert (i<6, ExcIndexRange(i,0,6)); return tria->levels[present_level]->hexes.hexes[present_index].quad(i); @@ -559,11 +559,11 @@ HexAccessor::quad_index (unsigned int i) const { template inline -TriaIterator > -HexAccessor::child (const unsigned int i) const { +TriaIterator > +TriaObjectAccessor<3, dim>::child (const unsigned int i) const { Assert (i<6, ExcIndexRange(i,0,6)); - TriaIterator > q (tria, present_level+1, child_index (i)); + TriaIterator > q (tria, present_level+1, child_index (i)); #ifdef DEBUG if (q.state() != past_the_end) @@ -576,7 +576,7 @@ HexAccessor::child (const unsigned int i) const { template inline -int HexAccessor::child_index (unsigned int i) const { +int TriaObjectAccessor<3, dim>::child_index (unsigned int i) const { Assert (i<8, ExcIndexRange(i,0,8)); return tria->levels[present_level]->hexes.children[present_index]+i; }; @@ -584,7 +584,7 @@ int HexAccessor::child_index (unsigned int i) const { template -bool HexAccessor::has_children () const { +bool TriaObjectAccessor<3, dim>::has_children () const { Assert (state() == valid, ExcDereferenceInvalidObject()); return (tria->levels[present_level]->hexes.children[present_index] != -1); }; @@ -594,7 +594,7 @@ bool HexAccessor::has_children () const { template inline unsigned int -HexAccessor::max_refinement_depth () const +TriaObjectAccessor<3, dim>::max_refinement_depth () const { if (!has_children()) return 0; @@ -618,7 +618,7 @@ HexAccessor::max_refinement_depth () const template inline void -HexAccessor::operator ++ () { +TriaObjectAccessor<3, dim>::operator ++ () { ++present_index; // is index still in the range of // the vector? @@ -644,7 +644,7 @@ HexAccessor::operator ++ () { template inline void -HexAccessor::operator -- () { +TriaObjectAccessor<3, dim>::operator -- () { --present_index; // is index still in the range of // the vector? 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 b7fcc566ec..030ea02c76 100644 --- a/deal.II/deal.II/include/multigrid/mg_dof_accessor.h +++ b/deal.II/deal.II/include/multigrid/mg_dof_accessor.h @@ -338,7 +338,9 @@ class MGDoFObjectAccessor<2, dim, BaseClass> : public MGDoFAccessor, publi * @see DoFLineAccessor */ template -class MGDoFHexAccessor : public MGDoFAccessor, public DoFHexAccessor { +class MGDoFObjectAccessor<3, dim, BaseClass> : public MGDoFAccessor, + public DoFObjectAccessor<3, dim, BaseClass> +{ public: /** * Declare the data type that this accessor @@ -351,14 +353,14 @@ class MGDoFHexAccessor : public MGDoFAccessor, public DoFHexAccessor# object. */ - MGDoFHexAccessor (Triangulation *tria, + MGDoFObjectAccessor (Triangulation *tria, const int level, const int index, const AccessorData *local_data); @@ -429,13 +431,13 @@ class MGDoFHexAccessor : public MGDoFAccessor, public DoFHexAccessor > child (const unsigned int) const; + TriaIterator > child (const unsigned int) const; /** * Implement the copy operator needed * for the iterator classes. */ - void copy_from (const MGDoFHexAccessor &a); + void copy_from (const MGDoFObjectAccessor<3, dim,BaseClass> &a); }; @@ -559,14 +561,14 @@ class MGDoFSubstructAccessor<2> : public MGDoFObjectAccessor<2, 2,CellAccessor<2 * @see MGDoFSubstructAccessor<1> */ template <> -class MGDoFSubstructAccessor<3> : public MGDoFHexAccessor<3,CellAccessor<3> > { +class MGDoFSubstructAccessor<3> : public MGDoFObjectAccessor<3, 3,CellAccessor<3> > { public: /** * Declare the data type that this accessor * class expects to get passed from the * iterator classes. */ - typedef MGDoFHexAccessor<3,CellAccessor<3> >::AccessorData AccessorData; + typedef MGDoFObjectAccessor<3, 3,CellAccessor<3> >::AccessorData AccessorData; /** * Constructor @@ -575,7 +577,7 @@ class MGDoFSubstructAccessor<3> : public MGDoFHexAccessor<3,CellAccessor<3> > { const int level, const int index, const AccessorData *local_data) : - MGDoFHexAccessor<3,CellAccessor<3> > (tria,level,index,local_data) {}; + MGDoFObjectAccessor<3, 3,CellAccessor<3> > (tria,level,index,local_data) {}; // do this here, since this way the // CellAccessor has the possibility to know // what a face_iterator is. Otherwise diff --git a/deal.II/deal.II/include/multigrid/mg_dof_handler.h b/deal.II/deal.II/include/multigrid/mg_dof_handler.h index cfc826e904..4b15d63172 100644 --- a/deal.II/deal.II/include/multigrid/mg_dof_handler.h +++ b/deal.II/deal.II/include/multigrid/mg_dof_handler.h @@ -962,8 +962,8 @@ class MGDoFHandler friend class MGDoFObjectAccessor<1, dim, CellAccessor >; friend class MGDoFObjectAccessor<2, dim, TriaObjectAccessor<2, dim> >; friend class MGDoFObjectAccessor<2, dim, CellAccessor >; - friend class MGDoFHexAccessor >; - friend class MGDoFHexAccessor >; + friend class MGDoFObjectAccessor<3, dim, TriaObjectAccessor<3, dim> >; + friend class MGDoFObjectAccessor<3, dim, CellAccessor >; }; diff --git a/deal.II/deal.II/source/dofs/dof_accessor.cc b/deal.II/deal.II/source/dofs/dof_accessor.cc index 2b0163bd0a..17be9b9261 100644 --- a/deal.II/deal.II/source/dofs/dof_accessor.cc +++ b/deal.II/deal.II/source/dofs/dof_accessor.cc @@ -210,11 +210,11 @@ distribute_local_to_global (const FullMatrix &local_source, -/*------------------------- Functions: DoFHexAccessor -----------------------*/ +/*------------------------- Functions: DoFObjectAccessor -----------------------*/ template -void DoFHexAccessor::set_dof_index (const unsigned int i, +void DoFObjectAccessor<3, dim,BaseClass>::set_dof_index (const unsigned int i, const int index) const { Assert (dof_handler != 0, ExcInvalidObject()); // make sure a FE has been selected @@ -230,7 +230,7 @@ void DoFHexAccessor::set_dof_index (const unsigned int i, template -void DoFHexAccessor::set_vertex_dof_index (const unsigned int vertex, +void DoFObjectAccessor<3, dim,BaseClass>::set_vertex_dof_index (const unsigned int vertex, const unsigned int i, const int index) const { Assert (dof_handler != 0, ExcInvalidObject()); @@ -248,7 +248,7 @@ void DoFHexAccessor::set_vertex_dof_index (const unsigned int ver template -void DoFHexAccessor:: +void DoFObjectAccessor<3, dim,BaseClass>:: distribute_local_to_global (const Vector &local_source, Vector &global_destination) const { Assert (dof_handler != 0, ExcInvalidObject()); @@ -275,7 +275,7 @@ distribute_local_to_global (const Vector &local_source, template -void DoFHexAccessor:: +void DoFObjectAccessor<3, dim,BaseClass>:: distribute_local_to_global (const FullMatrix &local_source, SparseMatrix &global_destination) const { Assert (dof_handler != 0, ExcInvalidObject()); @@ -813,13 +813,13 @@ template class TriaActiveIterator<2,DoFCellAccessor<2> >; #if deal_II_dimension == 3 template class DoFObjectAccessor<1, 3,TriaObjectAccessor<1, 3> >; template class DoFObjectAccessor<2, 3,TriaObjectAccessor<2, 3> >; -template class DoFHexAccessor<3,HexAccessor<3> >; -template class DoFHexAccessor<3,CellAccessor<3> >; +template class DoFObjectAccessor<3, 3,TriaObjectAccessor<3, 3> >; +template class DoFObjectAccessor<3, 3,CellAccessor<3> >; template class DoFCellAccessor<3>; template class TriaRawIterator<3,DoFObjectAccessor<1, 3,TriaObjectAccessor<1, 3> > >; template class TriaRawIterator<3,DoFObjectAccessor<2, 3,TriaObjectAccessor<2, 3> > >; -template class TriaRawIterator<3,DoFHexAccessor<3,HexAccessor<3> > >; +template class TriaRawIterator<3,DoFObjectAccessor<3, 3,TriaObjectAccessor<3, 3> > >; template class TriaRawIterator<3,DoFCellAccessor<3> >; template class TriaIterator<3,DoFObjectAccessor<1, 3,TriaObjectAccessor<1, 3> > >; template class TriaIterator<3,DoFObjectAccessor<2, 3,TriaObjectAccessor<2, 3> > >; diff --git a/deal.II/deal.II/source/dofs/mg_dof_accessor.cc b/deal.II/deal.II/source/dofs/mg_dof_accessor.cc index 97b95bfb6b..69b6055849 100644 --- a/deal.II/deal.II/source/dofs/mg_dof_accessor.cc +++ b/deal.II/deal.II/source/dofs/mg_dof_accessor.cc @@ -301,21 +301,21 @@ MGDoFObjectAccessor<2, dim,BaseClass>::copy_from (const MGDoFObjectAccessor<2, d -/* ------------------------ MGDoFHexAccessor --------------------------- */ +/* ------------------------ MGDoFObjectAccessor --------------------------- */ template -MGDoFHexAccessor::MGDoFHexAccessor (Triangulation *tria, +MGDoFObjectAccessor<3, dim,BaseClass>::MGDoFObjectAccessor (Triangulation *tria, const int level, const int index, const AccessorData *local_data) : MGDoFAccessor (local_data), - DoFHexAccessor(tria,level,index,local_data) {}; + DoFObjectAccessor<3, dim,BaseClass>(tria,level,index,local_data) {}; template inline -int MGDoFHexAccessor::mg_dof_index (const unsigned int i) const { +int MGDoFObjectAccessor<3, dim,BaseClass>::mg_dof_index (const unsigned int i) const { Assert (dof_handler != 0, ExcInvalidObject()); Assert (mg_dof_handler != 0, ExcInvalidObject()); // make sure a FE has been selected @@ -331,7 +331,7 @@ int MGDoFHexAccessor::mg_dof_index (const unsigned int i) const { template -void MGDoFHexAccessor::set_mg_dof_index (const unsigned int i, +void MGDoFObjectAccessor<3, dim,BaseClass>::set_mg_dof_index (const unsigned int i, const int index) const { Assert (dof_handler != 0, ExcInvalidObject()); Assert (mg_dof_handler != 0, ExcInvalidObject()); @@ -349,7 +349,7 @@ void MGDoFHexAccessor::set_mg_dof_index (const unsigned int i, template inline -int MGDoFHexAccessor::mg_vertex_dof_index (const unsigned int vertex, +int MGDoFObjectAccessor<3, dim,BaseClass>::mg_vertex_dof_index (const unsigned int vertex, const unsigned int i) const { Assert (dof_handler != 0, ExcInvalidObject()); Assert (mg_dof_handler != 0, ExcInvalidObject()); @@ -365,7 +365,7 @@ int MGDoFHexAccessor::mg_vertex_dof_index (const unsigned int ver template -void MGDoFHexAccessor::set_mg_vertex_dof_index (const unsigned int vertex, +void MGDoFObjectAccessor<3, dim,BaseClass>::set_mg_vertex_dof_index (const unsigned int vertex, const unsigned int i, const int index) const { Assert (dof_handler != 0, ExcInvalidObject()); @@ -383,7 +383,7 @@ void MGDoFHexAccessor::set_mg_vertex_dof_index (const unsigned in template void -MGDoFHexAccessor::get_mg_dof_indices (vector &dof_indices) const { +MGDoFObjectAccessor<3, dim,BaseClass>::get_mg_dof_indices (vector &dof_indices) const { Assert (dof_handler != 0, ExcInvalidObject()); Assert (mg_dof_handler != 0, ExcInvalidObject()); Assert (&dof_handler->get_fe() != 0, ExcInvalidObject()); @@ -415,7 +415,7 @@ MGDoFHexAccessor::get_mg_dof_indices (vector &dof_indices) c template TriaIterator > > -MGDoFHexAccessor::line (const unsigned int i) const { +MGDoFObjectAccessor<3, dim,BaseClass>::line (const unsigned int i) const { Assert (i<12, ExcIndexRange (i, 0, 12)); return TriaIterator > > @@ -431,7 +431,7 @@ MGDoFHexAccessor::line (const unsigned int i) const { template TriaIterator > > -MGDoFHexAccessor::quad (const unsigned int i) const { +MGDoFObjectAccessor<3, dim,BaseClass>::quad (const unsigned int i) const { Assert (i<12, ExcIndexRange (i, 0, 6)); return TriaIterator > > @@ -446,9 +446,9 @@ MGDoFHexAccessor::quad (const unsigned int i) const { template -TriaIterator > -MGDoFHexAccessor::child (const unsigned int i) const { - TriaIterator > q (tria, +TriaIterator > +MGDoFObjectAccessor<3, dim,BaseClass>::child (const unsigned int i) const { + TriaIterator > q (tria, present_level+1, child_index (i), mg_dof_handler); @@ -464,8 +464,8 @@ MGDoFHexAccessor::child (const unsigned int i) const { template void -MGDoFHexAccessor::copy_from (const MGDoFHexAccessor &a) { - DoFHexAccessor::copy_from (a); +MGDoFObjectAccessor<3, dim,BaseClass>::copy_from (const MGDoFObjectAccessor<3, dim,BaseClass> &a) { + DoFObjectAccessor<3, dim,BaseClass>::copy_from (a); set_mg_dof_handler (a.mg_dof_handler); }; @@ -616,13 +616,13 @@ template class TriaActiveIterator<2,MGDoFCellAccessor<2> >; #if deal_II_dimension == 3 template class MGDoFObjectAccessor<1, 3,TriaObjectAccessor<1, 3> >; template class MGDoFObjectAccessor<2, 3,TriaObjectAccessor<2, 3> >; -template class MGDoFHexAccessor<3,HexAccessor<3> >; -template class MGDoFHexAccessor<3,CellAccessor<3> >; +template class MGDoFObjectAccessor<3, 3,TriaObjectAccessor<3, 3> >; +template class MGDoFObjectAccessor<3, 3,CellAccessor<3> >; template class MGDoFCellAccessor<3>; template class TriaRawIterator<3,MGDoFObjectAccessor<1, 3,TriaObjectAccessor<1, 3> > >; template class TriaRawIterator<3,MGDoFObjectAccessor<2, 3,TriaObjectAccessor<2, 3> > >; -template class TriaRawIterator<3,MGDoFHexAccessor<3,HexAccessor<3> > >; +template class TriaRawIterator<3,MGDoFObjectAccessor<3, 3,TriaObjectAccessor<3, 3> > >; template class TriaRawIterator<3,MGDoFCellAccessor<3> >; template class TriaIterator<3,MGDoFObjectAccessor<1, 3,TriaObjectAccessor<1, 3> > >; template class TriaIterator<3,MGDoFObjectAccessor<2, 3,TriaObjectAccessor<2, 3> > >; diff --git a/deal.II/deal.II/source/grid/tria_accessor.cc b/deal.II/deal.II/source/grid/tria_accessor.cc index 6cfcf9b19d..9b180dd2dd 100644 --- a/deal.II/deal.II/source/grid/tria_accessor.cc +++ b/deal.II/deal.II/source/grid/tria_accessor.cc @@ -567,17 +567,17 @@ unsigned int TriaObjectAccessor<2, dim>::number_of_children () const { -/*------------------------ Functions: HexAccessor ---------------------------*/ +/*------------------------ Functions: TriaObjectAccessor ---------------------------*/ template -void HexAccessor::set (const Hexahedron &hex) const { +void TriaObjectAccessor<3, dim>::set (const Hexahedron &hex) const { tria->levels[present_level]->hexes.hexes[present_index] = hex; }; template -int HexAccessor::vertex_index (const unsigned int corner) const { +int TriaObjectAccessor<3, dim>::vertex_index (const unsigned int corner) const { Assert (corner<8, ExcIndexRange(corner,0,8)); // get the corner indices by asking @@ -593,14 +593,14 @@ int HexAccessor::vertex_index (const unsigned int corner) const { template Point & -HexAccessor::vertex (const unsigned int i) const { +TriaObjectAccessor<3, dim>::vertex (const unsigned int i) const { return tria->vertices[vertex_index(i)]; }; template -void HexAccessor::set_used_flag () const { +void TriaObjectAccessor<3, dim>::set_used_flag () const { Assert (state() == valid, ExcDereferenceInvalidObject()); tria->levels[present_level]->hexes.used[present_index] = true; }; @@ -608,7 +608,7 @@ void HexAccessor::set_used_flag () const { template -void HexAccessor::clear_used_flag () const { +void TriaObjectAccessor<3, dim>::clear_used_flag () const { Assert (state() == valid, ExcDereferenceInvalidObject()); tria->levels[present_level]->hexes.used[present_index] = false; }; @@ -617,7 +617,7 @@ void HexAccessor::clear_used_flag () const { template -void HexAccessor::recursively_set_user_flag () const { +void TriaObjectAccessor<3, dim>::recursively_set_user_flag () const { set_user_flag (); if (has_children()) @@ -628,7 +628,7 @@ void HexAccessor::recursively_set_user_flag () const { template -void HexAccessor::recursively_clear_user_flag () const { +void TriaObjectAccessor<3, dim>::recursively_clear_user_flag () const { clear_user_flag (); if (has_children()) @@ -639,7 +639,7 @@ void HexAccessor::recursively_clear_user_flag () const { template -void HexAccessor::set_user_pointer (void *p) const { +void TriaObjectAccessor<3, dim>::set_user_pointer (void *p) const { Assert (used(), ExcCellNotUsed()); tria->levels[present_level]->hexes.user_pointers[present_index] = p; }; @@ -647,7 +647,7 @@ void HexAccessor::set_user_pointer (void *p) const { template -void HexAccessor::clear_user_pointer () const { +void TriaObjectAccessor<3, dim>::clear_user_pointer () const { Assert (used(), ExcCellNotUsed()); tria->levels[present_level]->hexes.user_pointers[present_index] = 0; }; @@ -655,7 +655,7 @@ void HexAccessor::clear_user_pointer () const { template -void * HexAccessor::user_pointer () const { +void * TriaObjectAccessor<3, dim>::user_pointer () const { Assert (used(), ExcCellNotUsed()); return tria->levels[present_level]->hexes.user_pointers[present_index]; }; @@ -663,7 +663,7 @@ void * HexAccessor::user_pointer () const { template -void HexAccessor::set_children (const int index) const { +void TriaObjectAccessor<3, dim>::set_children (const int index) const { Assert (used(), ExcCellNotUsed()); Assert ((index==-1) || (!has_children() && (index>=0)), ExcCantSetChildren(index)); @@ -674,14 +674,14 @@ void HexAccessor::set_children (const int index) const { template -void HexAccessor::clear_children () const { +void TriaObjectAccessor<3, dim>::clear_children () const { set_children (-1); }; template -unsigned char HexAccessor::boundary_indicator () const { +unsigned char TriaObjectAccessor<3, dim>::boundary_indicator () const { Assert (dim<4, ExcNotUsefulForThisDimension()); Assert (used(), ExcCellNotUsed()); @@ -691,7 +691,7 @@ unsigned char HexAccessor::boundary_indicator () const { template -void HexAccessor::set_boundary_indicator (unsigned char boundary_ind) const { +void TriaObjectAccessor<3, dim>::set_boundary_indicator (unsigned char boundary_ind) const { Assert (dim<4, ExcNotUsefulForThisDimension()); Assert (used(), ExcCellNotUsed()); @@ -701,7 +701,7 @@ void HexAccessor::set_boundary_indicator (unsigned char boundary_ind) const template -bool HexAccessor::at_boundary () const { +bool TriaObjectAccessor<3, dim>::at_boundary () const { // error checking is done // in boundary_indicator() return (boundary_indicator() != 255); @@ -710,7 +710,7 @@ bool HexAccessor::at_boundary () const { template -double HexAccessor::diameter () const { +double TriaObjectAccessor<3, dim>::diameter () const { return sqrt(max( max((vertex(6)-vertex(0)).square(), (vertex(7)-vertex(1)).square()), max((vertex(4)-vertex(2)).square(), @@ -720,7 +720,7 @@ double HexAccessor::diameter () const { template -Point HexAccessor::center () const { +Point TriaObjectAccessor<3, dim>::center () const { return (vertex(0)+vertex(1)+vertex(2)+vertex(3)+ vertex(4)+vertex(5)+vertex(6)+vertex(7))/8.; }; @@ -730,7 +730,7 @@ Point HexAccessor::center () const { #if deal_II_dimension == 3 template <> -Point<3> HexAccessor<3>::barycenter () const { +Point<3> TriaObjectAccessor<3, 3>::barycenter () const { /* Get the computation of the barycenter by this little Maple script. We use the trilinear mapping of the unit hex to the real hex. @@ -1380,7 +1380,7 @@ x[7]*y[3]-z[5]*x[6]*y[4]-z[5]*x[4]*y[1]+z[5]*x[4]*y[6]+x[1]*y[6]*z[2]+x[2]*y[6] template <> -double HexAccessor<3>::measure () const { +double TriaObjectAccessor<3, 3>::measure () const { /* Get the computation of the measure by the same little Maple script as above. */ @@ -1459,7 +1459,7 @@ y[2]*x[3]*z[6]/12.0+s2+s1+x[2]*y[0]*z[3]/12.0; template -unsigned int HexAccessor::number_of_children () const { +unsigned int TriaObjectAccessor<3, dim>::number_of_children () const { if (!has_children()) return 1; else @@ -1632,10 +1632,10 @@ template class TriaActiveIterator= 3 -template class HexAccessor; -template class TriaRawIterator >; -template class TriaIterator >; -template class TriaActiveIterator >; +template class TriaObjectAccessor<3, deal_II_dimension>; +template class TriaRawIterator >; +template class TriaIterator >; +template class TriaActiveIterator >; #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 97b95bfb6b..69b6055849 100644 --- a/deal.II/deal.II/source/multigrid/mg_dof_accessor.cc +++ b/deal.II/deal.II/source/multigrid/mg_dof_accessor.cc @@ -301,21 +301,21 @@ MGDoFObjectAccessor<2, dim,BaseClass>::copy_from (const MGDoFObjectAccessor<2, d -/* ------------------------ MGDoFHexAccessor --------------------------- */ +/* ------------------------ MGDoFObjectAccessor --------------------------- */ template -MGDoFHexAccessor::MGDoFHexAccessor (Triangulation *tria, +MGDoFObjectAccessor<3, dim,BaseClass>::MGDoFObjectAccessor (Triangulation *tria, const int level, const int index, const AccessorData *local_data) : MGDoFAccessor (local_data), - DoFHexAccessor(tria,level,index,local_data) {}; + DoFObjectAccessor<3, dim,BaseClass>(tria,level,index,local_data) {}; template inline -int MGDoFHexAccessor::mg_dof_index (const unsigned int i) const { +int MGDoFObjectAccessor<3, dim,BaseClass>::mg_dof_index (const unsigned int i) const { Assert (dof_handler != 0, ExcInvalidObject()); Assert (mg_dof_handler != 0, ExcInvalidObject()); // make sure a FE has been selected @@ -331,7 +331,7 @@ int MGDoFHexAccessor::mg_dof_index (const unsigned int i) const { template -void MGDoFHexAccessor::set_mg_dof_index (const unsigned int i, +void MGDoFObjectAccessor<3, dim,BaseClass>::set_mg_dof_index (const unsigned int i, const int index) const { Assert (dof_handler != 0, ExcInvalidObject()); Assert (mg_dof_handler != 0, ExcInvalidObject()); @@ -349,7 +349,7 @@ void MGDoFHexAccessor::set_mg_dof_index (const unsigned int i, template inline -int MGDoFHexAccessor::mg_vertex_dof_index (const unsigned int vertex, +int MGDoFObjectAccessor<3, dim,BaseClass>::mg_vertex_dof_index (const unsigned int vertex, const unsigned int i) const { Assert (dof_handler != 0, ExcInvalidObject()); Assert (mg_dof_handler != 0, ExcInvalidObject()); @@ -365,7 +365,7 @@ int MGDoFHexAccessor::mg_vertex_dof_index (const unsigned int ver template -void MGDoFHexAccessor::set_mg_vertex_dof_index (const unsigned int vertex, +void MGDoFObjectAccessor<3, dim,BaseClass>::set_mg_vertex_dof_index (const unsigned int vertex, const unsigned int i, const int index) const { Assert (dof_handler != 0, ExcInvalidObject()); @@ -383,7 +383,7 @@ void MGDoFHexAccessor::set_mg_vertex_dof_index (const unsigned in template void -MGDoFHexAccessor::get_mg_dof_indices (vector &dof_indices) const { +MGDoFObjectAccessor<3, dim,BaseClass>::get_mg_dof_indices (vector &dof_indices) const { Assert (dof_handler != 0, ExcInvalidObject()); Assert (mg_dof_handler != 0, ExcInvalidObject()); Assert (&dof_handler->get_fe() != 0, ExcInvalidObject()); @@ -415,7 +415,7 @@ MGDoFHexAccessor::get_mg_dof_indices (vector &dof_indices) c template TriaIterator > > -MGDoFHexAccessor::line (const unsigned int i) const { +MGDoFObjectAccessor<3, dim,BaseClass>::line (const unsigned int i) const { Assert (i<12, ExcIndexRange (i, 0, 12)); return TriaIterator > > @@ -431,7 +431,7 @@ MGDoFHexAccessor::line (const unsigned int i) const { template TriaIterator > > -MGDoFHexAccessor::quad (const unsigned int i) const { +MGDoFObjectAccessor<3, dim,BaseClass>::quad (const unsigned int i) const { Assert (i<12, ExcIndexRange (i, 0, 6)); return TriaIterator > > @@ -446,9 +446,9 @@ MGDoFHexAccessor::quad (const unsigned int i) const { template -TriaIterator > -MGDoFHexAccessor::child (const unsigned int i) const { - TriaIterator > q (tria, +TriaIterator > +MGDoFObjectAccessor<3, dim,BaseClass>::child (const unsigned int i) const { + TriaIterator > q (tria, present_level+1, child_index (i), mg_dof_handler); @@ -464,8 +464,8 @@ MGDoFHexAccessor::child (const unsigned int i) const { template void -MGDoFHexAccessor::copy_from (const MGDoFHexAccessor &a) { - DoFHexAccessor::copy_from (a); +MGDoFObjectAccessor<3, dim,BaseClass>::copy_from (const MGDoFObjectAccessor<3, dim,BaseClass> &a) { + DoFObjectAccessor<3, dim,BaseClass>::copy_from (a); set_mg_dof_handler (a.mg_dof_handler); }; @@ -616,13 +616,13 @@ template class TriaActiveIterator<2,MGDoFCellAccessor<2> >; #if deal_II_dimension == 3 template class MGDoFObjectAccessor<1, 3,TriaObjectAccessor<1, 3> >; template class MGDoFObjectAccessor<2, 3,TriaObjectAccessor<2, 3> >; -template class MGDoFHexAccessor<3,HexAccessor<3> >; -template class MGDoFHexAccessor<3,CellAccessor<3> >; +template class MGDoFObjectAccessor<3, 3,TriaObjectAccessor<3, 3> >; +template class MGDoFObjectAccessor<3, 3,CellAccessor<3> >; template class MGDoFCellAccessor<3>; template class TriaRawIterator<3,MGDoFObjectAccessor<1, 3,TriaObjectAccessor<1, 3> > >; template class TriaRawIterator<3,MGDoFObjectAccessor<2, 3,TriaObjectAccessor<2, 3> > >; -template class TriaRawIterator<3,MGDoFHexAccessor<3,HexAccessor<3> > >; +template class TriaRawIterator<3,MGDoFObjectAccessor<3, 3,TriaObjectAccessor<3, 3> > >; template class TriaRawIterator<3,MGDoFCellAccessor<3> >; template class TriaIterator<3,MGDoFObjectAccessor<1, 3,TriaObjectAccessor<1, 3> > >; template class TriaIterator<3,MGDoFObjectAccessor<2, 3,TriaObjectAccessor<2, 3> > >; -- 2.39.5