]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
..DoFSubstructAccessor removed
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 21 Jul 1999 18:03:43 +0000 (18:03 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 21 Jul 1999 18:03:43 +0000 (18:03 +0000)
git-svn-id: https://svn.dealii.org/trunk@1617 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/dofs/dof_accessor.h
deal.II/deal.II/include/dofs/mg_dof_accessor.h
deal.II/deal.II/include/grid/tria_accessor.h
deal.II/deal.II/include/grid/tria_accessor.templates.h
deal.II/deal.II/include/multigrid/mg_dof_accessor.h
deal.II/deal.II/source/dofs/dof_accessor.cc
deal.II/deal.II/source/dofs/mg_dof_accessor.cc
deal.II/deal.II/source/multigrid/mg_dof_accessor.cc

index ae10947c0afd6b796047a42db5ecc564c8fe8384..ed1e0ab732df734504d88e46aacdebc41d7543f1 100644 (file)
@@ -111,12 +111,32 @@ class DoFAccessor {
 
 /**
  * Common template for line, quad, hex.
+ *
+ * Internal: inheritance is necessary for the general template due to
+ * a compiler error.
+ * @author Guido Kanschat, 1999
  */
 template<int celldim, int dim, typename BaseClass>
-class DoFObjectAccessor;
-
+class DoFObjectAccessor : public DoFAccessor<dim>,
+                         public BaseClass
+{};
 
 
+/**
+ * Closure class.
+ */
+template<int dim, typename BaseClass>
+class DoFObjectAccessor<0, dim, BaseClass> : public DoFAccessor<dim>,
+                                            public BaseClass
+{
+  public:
+    typedef void* AccessorData;
+    DoFObjectAccessor (Triangulation<dim> *,
+                    const int,
+                    const int,
+                    const AccessorData *)
+      {}
+};
 
 
 /**
@@ -539,157 +559,6 @@ class DoFObjectAccessor<3, dim, BaseClass> :  public DoFAccessor<dim>,
 
 
 
-
-
-
-
-/**
- * Intermediate, "typedef"-class, not for public use.
- *
- * Rationale for the declaration of members for this class: gcc 2.8 has a bug
- * when deriving from explicitely specialized classes which materializes in
- * the calculation of wrong addresses of member variables. By declaring the
- * general template of #DoFSubstructAccessor# to have the same object layout as
- * the specialized versions (using the same base classes), we fool the compiler,
- * which still looks in the wrong place for the addresses but finds the
- * right information. This way, at least ot works.
- *
- * Insert a guard, however, in the constructor to avoid that anyone (including
- * the compiler) happens to use this class.
- */
-template <int dim>
-class DoFSubstructAccessor : public DoFAccessor<dim>,
-                            public TriaAccessor<dim> {
-  public:
-    DoFSubstructAccessor () {
-      Assert (false, ExcInternalError());
-    };
-
-    DeclException0 (ExcInternalError);
-};
-
-
-
-
-/**
- * Intermediate, "typedef"-class, not for public use.
- *
- * \subsection{Rationale}
- *
- * This class is only a wrapper class used to do kind of a typedef
- * with template parameters. This class and #DoFSubstructAccessor<2>#
- * wrap the following names:
- * \begin{verbatim}
- *   DoFSubstructAccessor<1> := DoFObjectAccessor<1, 1,CellAccessor<1> >;
- *   DoFSubstructAccessor<2> := DoFObjectAccessor<2, 2,CellAccessor<2> >;
- * \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
- * the \Ref{DoFCellAccessor} dimension independent as an inheritance from
- * #DoFSubstructAccessor<dim>#. If we had not declared these
- * types, we would have to write two class declarations, one for
- * #DoFCellAccessor<1>#, derived from #DoFObjectAccessor<1, 1,CellAccessor<1> >#
- * and one for #DoFCellAccessor<2>#, derived from
- * #DoFObjectAccessor<2, 2,CellAccessor<2> >#.
- */
-template <>
-class DoFSubstructAccessor<1> :  public DoFObjectAccessor<1, 1,CellAccessor<1> > {
-  public:
-                                    /**
-                                     * Declare the data type that this accessor
-                                     * class expects to get passed from the
-                                     * iterator classes.
-                                     */
-    typedef DoFObjectAccessor<1, 1,CellAccessor<1> >::AccessorData AccessorData;
-    
-                                    /**
-                                     * Constructor
-                                     */
-    DoFSubstructAccessor (Triangulation<1> *tria,
-                         const int         level,
-                         const int         index,
-                         const AccessorData *local_data) :
-                   DoFObjectAccessor<1, 1,CellAccessor<1> > (tria,level,index,local_data) {};
-                                    // do this here, since this way the
-                                    // CellAccessor has the possibility to know
-                                    // what a face_iterator is. Otherwise
-                                    // it would have to ask the DoFHandler<dim>
-                                    // which would need another big include
-                                    // file and maybe cyclic interdependence
-    typedef void * face_iterator;
-};
-
-
-
-/**
- * Intermediate, "typedef"-class, not for public use.
- *
- * @see DoFSubstructAccessor<1>
- */
-template <>
-class DoFSubstructAccessor<2> : public DoFObjectAccessor<2, 2,CellAccessor<2> > {
-  public:
-                                    /**
-                                     * Declare the data type that this accessor
-                                     * class expects to get passed from the
-                                     * iterator classes.
-                                     */
-    typedef DoFObjectAccessor<2, 2,CellAccessor<2> >::AccessorData AccessorData;
-    
-                                    /**
-                                     * Constructor
-                                     */
-    DoFSubstructAccessor (Triangulation<2> *tria,
-                         const int         level,
-                         const int         index,
-                         const AccessorData *local_data) :
-                   DoFObjectAccessor<2, 2,CellAccessor<2> > (tria,level,index,local_data) {};
-                                    // do this here, since this way the
-                                    // CellAccessor has the possibility to know
-                                    // what a face_iterator is. Otherwise
-                                    // it would have to ask the DoFHandler<dim>
-                                    // which would need another big include
-                                    // file and maybe cyclic interdependence
-    typedef TriaIterator<2,DoFObjectAccessor<1, 2,TriaObjectAccessor<1, 2> > > face_iterator;
-};
-
-
-
-
-/**
- * Intermediate, "typedef"-class, not for public use.
- *
- * @see DoFSubstructAccessor<1>
- */
-template <>
-class DoFSubstructAccessor<3> : public DoFObjectAccessor<3, 3,CellAccessor<3> > {
-  public:
-                                    /**
-                                     * Declare the data type that this accessor
-                                     * class expects to get passed from the
-                                     * iterator classes.
-                                     */
-    typedef DoFObjectAccessor<2, 3,CellAccessor<3> >::AccessorData AccessorData;
-    
-                                    /**
-                                     * Constructor
-                                     */
-    DoFSubstructAccessor (Triangulation<3> *tria,
-                         const int         level,
-                         const int         index,
-                         const AccessorData *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
-                                    // it would have to ask the DoFHandler<dim>
-                                    // which would need another big include
-                                    // file and maybe cyclic interdependence
-    typedef TriaIterator<3,DoFObjectAccessor<2, 3,TriaObjectAccessor<2, 3> > > face_iterator;
-};
-
-
-
 /**
  * Grant access to the degrees of freedom on a cell. In fact, since all
  * access to the degrees of freedom has been enabled by the classes
@@ -704,14 +573,21 @@ class DoFSubstructAccessor<3> : public DoFObjectAccessor<3, 3,CellAccessor<3> >
  * @author Wolfgang Bangerth, 1998
  */
 template <int dim>
-class DoFCellAccessor :  public DoFSubstructAccessor<dim> {
+class DoFCellAccessor :  public DoFObjectAccessor<dim, dim, CellAccessor<dim> > {
   public:
+                                    /**
+                                     * Type of faces.
+                                     */
+    typedef
+    TriaIterator<dim, DoFObjectAccessor<dim-1, dim,TriaObjectAccessor<dim-1, dim> > >
+    face_iterator;
+
                                     /**
                                      * Declare the data type that this accessor
                                      * class expects to get passed from the
                                      * iterator classes.
                                      */
-    typedef typename DoFSubstructAccessor<dim>::AccessorData AccessorData;
+    typedef typename DoFObjectAccessor<dim, dim, CellAccessor<dim> >::AccessorData AccessorData;
     
                                     /**
                                      * Constructor
@@ -720,7 +596,7 @@ class DoFCellAccessor :  public DoFSubstructAccessor<dim> {
                     const int           level,
                     const int           index,
                     const AccessorData *local_data) :
-                    DoFSubstructAccessor<dim> (tria,level,index,local_data) {};
+                    DoFObjectAccessor<dim, dim, CellAccessor<dim> > (tria,level,index,local_data) {};
 
                                     /**
                                      * Return the #i#th neighbor as a DoF cell
@@ -747,7 +623,7 @@ class DoFCellAccessor :  public DoFSubstructAccessor<dim> {
                                      * This function is not implemented in 1D,
                                      * and maps to DoFObjectAccessor<2, dim>::line in 2D.
                                      */
-    typename DoFSubstructAccessor<dim>::face_iterator
+    face_iterator
     face (const unsigned int i) const;
 
                                     /**
index 030ea02c76809d22928af9cd1dc1d2f05bd23ca4..8c4233effea8a6712d757079d873603fb6e73a9d 100644 (file)
@@ -85,7 +85,26 @@ class MGDoFAccessor {
 
 
 template <int celldim, int dim, typename BaseClass>
-class MGDoFObjectAccessor;
+class MGDoFObjectAccessor :  public MGDoFAccessor<dim>,
+                            public DoFObjectAccessor<celldim, dim, BaseClass>
+{};
+
+
+/**
+ * Closure class.
+ */
+template<int dim, typename BaseClass>
+class MGDoFObjectAccessor<0, dim, BaseClass>
+{
+  public:
+    typedef void* AccessorData;
+    MGDoFObjectAccessor (Triangulation<dim> *,
+                      const int,
+                      const int,
+                      const AccessorData *)
+      {}
+};
+
 
 
 /**
@@ -442,156 +461,6 @@ class MGDoFObjectAccessor<3, dim, BaseClass> :  public MGDoFAccessor<dim>,
 
 
 
-
-
-/**
- * Intermediate, "typedef"-class, not for public use.
- *
- * Rationale for the declaration of members for this class: gcc 2.8 has a bug
- * when deriving from explicitely specialized classes which materializes in
- * the calculation of wrong addresses of member variables. By declaring the
- * general template of #DoFSubstructAccessor# to have the same object layout as
- * the specialized versions (using the same base classes), we fool the compiler,
- * which still looks in the wrong place for the addresses but finds the
- * right information. This way, at least ot works.
- *
- * Insert a guard, however, in the constructor to avoid that anyone (including
- * the compiler) happens to use this class.
- */
-template <int dim>
-class MGDoFSubstructAccessor : public MGDoFObjectAccessor<1, 1,CellAccessor<1> > {
-  public:
-    MGDoFSubstructAccessor () {
-      Assert (false, ExcInternalError());
-    };
-
-    DeclException0 (ExcInternalError);
-};
-
-
-
-
-/**
- * Intermediate, "typedef"-class, not for public use.
- *
- * \subsection{Rationale}
- *
- * This class is only a wrapper class used to do kind of a typedef
- * with template parameters. This class and #DoFSubstructAccessor<2>#
- * wrap the following names:
- * \begin{verbatim}
- *   MGDoFSubstructAccessor<1> := MGDoFObjectAccessor<1, 1,CellAccessor<1> >;
- *   MGDoFSubstructAccessor<2> := MGDoFObjectAccessor<2, 2,CellAccessor<2> >;
- * \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
- * the \Ref{DoFCellAccessor} dimension independent as an inheritance from
- * #DoFSubstructAccessor<dim>#. If we had not declared these
- * types, we would have to write two class declarations, one for
- * #DoFCellAccessor<1>#, derived from #DoFObjectAccessor<1, 1,CellAccessor<1> >#
- * and one for #DoFCellAccessor<2>#, derived from
- * #DoFObjectAccessor<2, 2,CellAccessor<2> >#.
- */
-template <>
-class MGDoFSubstructAccessor<1> :  public MGDoFObjectAccessor<1, 1,CellAccessor<1> > {
-  public:
-                                    /**
-                                     * Declare the data type that this accessor
-                                     * class expects to get passed from the
-                                     * iterator classes.
-                                     */
-    typedef MGDoFObjectAccessor<1, 1,CellAccessor<1> >::AccessorData AccessorData;
-
-                                    /**
-                                     * Constructor
-                                     */
-    MGDoFSubstructAccessor (Triangulation<1> *tria,
-                           const int         level,
-                           const int         index,
-                           const AccessorData *local_data) :
-                   MGDoFObjectAccessor<1, 1,CellAccessor<1> > (tria,level,index,local_data) {};
-                                    // do this here, since this way the
-                                    // CellAccessor has the possibility to know
-                                    // what a face_iterator is. Otherwise
-                                    // it would have to ask the MGDoFHandler<dim>
-                                    // which would need another big include
-                                    // file and maybe cyclic interdependence
-    typedef void * face_iterator;
-};
-
-
-
-/**
- * Intermediate, "typedef"-class, not for public use.
- *
- * @see MGDoFSubstructAccessor<1>
- */
-template <>
-class MGDoFSubstructAccessor<2> : public MGDoFObjectAccessor<2, 2,CellAccessor<2> > {
-  public:
-                                    /**
-                                     * Declare the data type that this accessor
-                                     * class expects to get passed from the
-                                     * iterator classes.
-                                     */
-    typedef MGDoFObjectAccessor<2, 2,CellAccessor<2> >::AccessorData AccessorData;
-    
-                                    /**
-                                     * Constructor
-                                     */
-    MGDoFSubstructAccessor (Triangulation<2> *tria,
-                           const int         level,
-                           const int         index,
-                           const AccessorData *local_data) :
-                   MGDoFObjectAccessor<2, 2,CellAccessor<2> > (tria,level,index,local_data) {};
-                                    // do this here, since this way the
-                                    // CellAccessor has the possibility to know
-                                    // what a face_iterator is. Otherwise
-                                    // it would have to ask the DoFHandler<dim>
-                                    // which would need another big include
-                                    // file and maybe cyclic interdependence
-    typedef TriaIterator<2,MGDoFObjectAccessor<1, 2,TriaObjectAccessor<1, 2> > > face_iterator;
-};
-
-
-
-/**
- * Intermediate, "typedef"-class, not for public use.
- *
- * @see MGDoFSubstructAccessor<1>
- */
-template <>
-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 MGDoFObjectAccessor<3, 3,CellAccessor<3> >::AccessorData AccessorData;
-    
-                                    /**
-                                     * Constructor
-                                     */
-    MGDoFSubstructAccessor (Triangulation<3> *tria,
-                           const int         level,
-                           const int         index,
-                           const AccessorData *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
-                                    // it would have to ask the DoFHandler<dim>
-                                    // which would need another big include
-                                    // file and maybe cyclic interdependence
-    typedef TriaIterator<3,MGDoFObjectAccessor<2, 3,TriaObjectAccessor<2, 3> > > face_iterator;
-};
-
-
-
-
-
-
 /**
  * Grant access to the degrees of freedom on a cell. In fact, since all
  * access to the degrees of freedom has been enabled by the classes
@@ -606,14 +475,22 @@ class MGDoFSubstructAccessor<3> : public MGDoFObjectAccessor<3, 3,CellAccessor<3
  * @author Wolfgang Bangerth, 1998
  */
 template <int dim>
-class MGDoFCellAccessor :  public MGDoFSubstructAccessor<dim> {
+class MGDoFCellAccessor :  public MGDoFObjectAccessor<dim, dim, CellAccessor<dim> > {
   public:
+                                    /**
+                                     * Type of faces.
+                                     */
+    typedef
+    TriaIterator<dim, MGDoFObjectAccessor<dim-1, dim,TriaObjectAccessor<dim-1, dim> > >
+    face_iterator;
                                     /**
                                      * Declare the data type that this accessor
                                      * class expects to get passed from the
                                      * iterator classes.
                                      */
-    typedef typename MGDoFSubstructAccessor<dim>::AccessorData AccessorData;
+    typedef typename
+    MGDoFObjectAccessor<dim, dim, CellAccessor<dim> >::AccessorData
+    AccessorData;
     
                                     /**
                                      * Constructor
@@ -622,7 +499,7 @@ class MGDoFCellAccessor :  public MGDoFSubstructAccessor<dim> {
                       const int           level,
                       const int           index,
                       const AccessorData *local_data) :
-                   MGDoFSubstructAccessor<dim> (tria,level,index,local_data) {};
+                   MGDoFObjectAccessor<dim, dim, CellAccessor<dim> > (tria,level,index,local_data) {};
 
                                     /**
                                      * Return the #i#th neighbor as a MGDoF cell
@@ -649,7 +526,7 @@ class MGDoFCellAccessor :  public MGDoFSubstructAccessor<dim> {
                                      * This function is not implemented in 1D,
                                      * and maps to MGDoFObjectAccessor<2, dim>::line in 2D.
                                      */
-    typename MGDoFSubstructAccessor<dim>::face_iterator
+    face_iterator
     face (const unsigned int i) const;
 
                                     /**
index e7d15db8e71c5e76bfe1a896c77ee2ce3086cd24..299936ce73f96bbecf23fd3dd2d21052b4622bc6 100644 (file)
@@ -398,7 +398,8 @@ class TriaObjectAccessor :  public TriaAccessor<dim>
                                      *  Pointer to the #i#th
                                      *  child.
                                      */
-    TriaIterator<dim,TriaObjectAccessor<3, dim> > child (const unsigned int i) const;
+    TriaIterator<dim,TriaObjectAccessor<celldim, dim> >
+    child (const unsigned int i) const;
 
                                     /**
                                      *  Index of the #i#th child.
@@ -600,7 +601,9 @@ class TriaObjectAccessor :  public TriaAccessor<dim>
     template <int anydim, typename AnyAccessor> friend class TriaRawIterator;
 };
 
-
+/**
+ * Closure class.
+ */
 template<int dim>
 class TriaObjectAccessor<0, dim> : public TriaAccessor<dim>
 {};
index f75682dd438b635818dc1f386634b27ea4fe23ae..f13c09455a9fbaea0457020d95d04f6b7f2ae1ac 100644 (file)
@@ -427,7 +427,7 @@ TriaObjectAccessor<2, dim>::operator -- () {
 
 
 
-/*------------------------ Functions: TriaObjectAccessor ---------------------------*/
+/*------------------------ Functions: HexAccessor ---------------------------*/
 
 
 
@@ -667,6 +667,289 @@ TriaObjectAccessor<3, dim>::operator -- () {
 
 
 
+/*------------------------ Functions: TriaObjectAccessor ---------------------------*/
+
+
+
+template <int celldim, int dim>
+inline
+bool
+TriaObjectAccessor<celldim, dim>::used () const
+{
+  Assert (state() == valid, ExcDereferenceInvalidObject());
+  return tria->levels[present_level]->hexes.used[present_index];
+};
+
+
+
+template<int celldim, int dim>
+inline
+bool
+TriaObjectAccessor<celldim, dim>::user_flag_set () const
+{
+  Assert (used(), ExcCellNotUsed());
+  return tria->levels[present_level]->hexes.user_flags[present_index];
+};
+
+
+
+template<int celldim, int dim>
+inline
+void
+TriaObjectAccessor<celldim, dim>::set_user_flag () const
+{
+  Assert (used(), ExcCellNotUsed());
+  tria->levels[present_level]->hexes.user_flags[present_index] = true;
+};
+
+
+
+template<int celldim, int dim>
+inline
+void TriaObjectAccessor<celldim, dim>::clear_user_flag () const
+{
+  Assert (used(), ExcCellNotUsed());
+  tria->levels[present_level]->hexes.user_flags[present_index] = false;
+};
+
+
+
+
+template<int celldim, int dim>
+inline
+TriaIterator<dim,TriaObjectAccessor<1, dim> >
+TriaObjectAccessor<celldim, dim>::line (const unsigned int i) const
+{
+  Assert (used(), ExcCellNotUsed());
+  Assert (i < GeometryInfo<celldim>::lines_per_cell,
+         ExcIndexRange(i,0,GeometryInfo<celldim>::lines_per_cell));
+
+  switch(celldim)
+    {
+      case 2:
+           return
+             TriaIterator<dim,TriaObjectAccessor<1, dim> >
+             (
+               tria,
+               present_level,
+               line_index (i)
+             );
+      case 3:
+           if (i<4)
+             return quad(0)->line(i);
+           else
+             if (i<8)
+      return quad(1)->line(i-4);
+             else
+               switch (i) 
+                 {
+                   case 8:
+                         return quad(2)->line(3);
+                   case 9:
+                         return quad(2)->line(1);
+                   case 10:
+                         return quad(4)->line(1);
+                   case 11:
+                         return quad(4)->line(3);
+                 }
+           break;
+      default:
+           Assert(false, ExcNotImplemented());
+    }
+  
+  return TriaIterator<dim,TriaObjectAccessor<1, dim> >(tria, -1, -1, 0);
+};
+
+
+
+template<int celldim, int dim>
+inline
+TriaIterator<dim,TriaObjectAccessor<2, dim> >
+TriaObjectAccessor<celldim, dim>::quad (const unsigned int i) const
+{
+  Assert (used(), ExcCellNotUsed());
+  Assert (i < GeometryInfo<celldim>::quads_per_cell,
+         ExcIndexRange(i,0,GeometryInfo<celldim>::quads_per_cell));
+  return
+    TriaIterator<dim,TriaObjectAccessor<2, dim> >
+    (
+      tria,
+      present_level,
+      quad_index (i)
+    );
+};
+
+
+
+template<int celldim, int dim>
+inline
+unsigned int
+TriaObjectAccessor<celldim, dim>::line_index (unsigned int i) const
+{
+  Assert (i < GeometryInfo<celldim>::lines_per_cell,
+         ExcIndexRange(i,0,GeometryInfo<celldim>::lines_per_cell));
+
+  switch(celldim)
+    {
+      case 2:
+           return tria->levels[present_level]
+             ->quads.quads[present_index].line(i);
+      case 3:
+           if (i<4)
+             return quad(0)->line_index(i);
+           else
+             if (i<8)
+               return quad(1)->line_index(i-4);
+             else
+               switch (i) 
+                 {
+                   case 8:
+                         return quad(2)->line_index(3);
+                   case 9:
+                         return quad(2)->line_index(1);
+                   case 10:
+                         return quad(4)->line_index(1);
+                   case 11:
+                         return quad(4)->line_index(3);
+                 };
+           break;
+      default:
+           Assert(false, ExcNotImplemented());
+    }    
+  return 0;
+};
+
+
+
+template<int celldim, int dim>
+inline
+unsigned int
+TriaObjectAccessor<celldim, dim>::quad_index (unsigned int i) const
+{
+  Assert (i < GeometryInfo<celldim>::quads_per_cell,
+         ExcIndexRange(i,0,GeometryInfo<celldim>::quads_per_cell));
+
+  return tria->levels[present_level]->hexes.hexes[present_index].quad(i);
+};
+
+
+
+template<int celldim, int dim>
+inline
+TriaIterator<dim,TriaObjectAccessor<celldim, dim> >
+TriaObjectAccessor<celldim, dim>::child (const unsigned int i) const
+{
+  Assert (i < GeometryInfo<celldim>::children_per_cell,
+         ExcIndexRange(i,0,GeometryInfo<celldim>::children_per_cell));
+  
+  TriaIterator<dim,TriaObjectAccessor<celldim, dim> > q (tria, present_level+1, child_index (i));
+  
+#ifdef DEBUG
+  if (q.state() != past_the_end)
+    Assert (q->used(), ExcUnusedCellAsChild());
+#endif
+  return q;
+};
+
+
+
+template<int celldim, int dim>
+inline
+int TriaObjectAccessor<celldim, dim>::child_index (unsigned int i) const
+{
+  Assert (i < GeometryInfo<celldim>::children_per_cell,
+         ExcIndexRange(i,0,GeometryInfo<celldim>::children_per_cell));
+  return tria->levels[present_level]->hexes.children[present_index]+i;
+};
+
+
+
+template<int celldim, int dim>
+bool TriaObjectAccessor<celldim, dim>::has_children () const
+{
+  Assert (state() == valid, ExcDereferenceInvalidObject());
+  return (tria->levels[present_level]->hexes.children[present_index] != -1);
+};
+
+
+
+template<int celldim, int dim>
+inline
+unsigned int
+TriaObjectAccessor<celldim, dim>::max_refinement_depth () const
+{
+  if (!has_children())
+    return 0;
+
+  const unsigned int depths[8] = { child(0)->max_refinement_depth() + 1,
+                                  child(1)->max_refinement_depth() + 1,
+                                  child(2)->max_refinement_depth() + 1,
+                                  child(3)->max_refinement_depth() + 1,
+                                  child(4)->max_refinement_depth() + 1,
+                                  child(5)->max_refinement_depth() + 1,
+                                  child(6)->max_refinement_depth() + 1,
+                                  child(7)->max_refinement_depth() + 1  };
+  return max (max (max (depths[0], depths[1]),
+                  max (depths[2], depths[3])),
+             max (max (depths[4], depths[5]),
+                  max (depths[6], depths[7])));
+};
+
+
+
+template<int celldim, int dim>
+inline
+void
+TriaObjectAccessor<celldim, dim>::operator ++ () {
+  ++present_index;
+                                  // is index still in the range of
+                                  // the vector?
+  while (present_index
+        >=
+        (int)tria->levels[present_level]->hexes.hexes.size()) 
+    {
+                                      // no -> go one level up
+      ++present_level;
+      present_index = 0;
+                                      // highest level reached?
+      if (present_level >= (int)tria->levels.size()) 
+       {
+                                          // return with past the end pointer
+         present_level = present_index = -1;
+         return;
+       };
+    };
+};
+
+
+
+template<int celldim, int dim>
+inline
+void
+TriaObjectAccessor<celldim, dim>::operator -- ()
+{
+  --present_index;
+                                  // is index still in the range of
+                                  // the vector?
+  while (present_index < 0) 
+    {
+                                      // no -> go one level down
+      --present_level;
+                                      // lowest level reached?
+      if (present_level == -1) 
+       {
+                                          // return with past the end pointer
+         present_level = present_index = -1;
+         return;
+       };
+                                      // else
+      present_index = tria->levels[present_level]->hexes.hexes.size()-1;
+    };
+};
+
+
+
+
 /*------------------------ Functions: CellAccessor<dim> -----------------------*/
 
 
index 030ea02c76809d22928af9cd1dc1d2f05bd23ca4..8c4233effea8a6712d757079d873603fb6e73a9d 100644 (file)
@@ -85,7 +85,26 @@ class MGDoFAccessor {
 
 
 template <int celldim, int dim, typename BaseClass>
-class MGDoFObjectAccessor;
+class MGDoFObjectAccessor :  public MGDoFAccessor<dim>,
+                            public DoFObjectAccessor<celldim, dim, BaseClass>
+{};
+
+
+/**
+ * Closure class.
+ */
+template<int dim, typename BaseClass>
+class MGDoFObjectAccessor<0, dim, BaseClass>
+{
+  public:
+    typedef void* AccessorData;
+    MGDoFObjectAccessor (Triangulation<dim> *,
+                      const int,
+                      const int,
+                      const AccessorData *)
+      {}
+};
+
 
 
 /**
@@ -442,156 +461,6 @@ class MGDoFObjectAccessor<3, dim, BaseClass> :  public MGDoFAccessor<dim>,
 
 
 
-
-
-/**
- * Intermediate, "typedef"-class, not for public use.
- *
- * Rationale for the declaration of members for this class: gcc 2.8 has a bug
- * when deriving from explicitely specialized classes which materializes in
- * the calculation of wrong addresses of member variables. By declaring the
- * general template of #DoFSubstructAccessor# to have the same object layout as
- * the specialized versions (using the same base classes), we fool the compiler,
- * which still looks in the wrong place for the addresses but finds the
- * right information. This way, at least ot works.
- *
- * Insert a guard, however, in the constructor to avoid that anyone (including
- * the compiler) happens to use this class.
- */
-template <int dim>
-class MGDoFSubstructAccessor : public MGDoFObjectAccessor<1, 1,CellAccessor<1> > {
-  public:
-    MGDoFSubstructAccessor () {
-      Assert (false, ExcInternalError());
-    };
-
-    DeclException0 (ExcInternalError);
-};
-
-
-
-
-/**
- * Intermediate, "typedef"-class, not for public use.
- *
- * \subsection{Rationale}
- *
- * This class is only a wrapper class used to do kind of a typedef
- * with template parameters. This class and #DoFSubstructAccessor<2>#
- * wrap the following names:
- * \begin{verbatim}
- *   MGDoFSubstructAccessor<1> := MGDoFObjectAccessor<1, 1,CellAccessor<1> >;
- *   MGDoFSubstructAccessor<2> := MGDoFObjectAccessor<2, 2,CellAccessor<2> >;
- * \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
- * the \Ref{DoFCellAccessor} dimension independent as an inheritance from
- * #DoFSubstructAccessor<dim>#. If we had not declared these
- * types, we would have to write two class declarations, one for
- * #DoFCellAccessor<1>#, derived from #DoFObjectAccessor<1, 1,CellAccessor<1> >#
- * and one for #DoFCellAccessor<2>#, derived from
- * #DoFObjectAccessor<2, 2,CellAccessor<2> >#.
- */
-template <>
-class MGDoFSubstructAccessor<1> :  public MGDoFObjectAccessor<1, 1,CellAccessor<1> > {
-  public:
-                                    /**
-                                     * Declare the data type that this accessor
-                                     * class expects to get passed from the
-                                     * iterator classes.
-                                     */
-    typedef MGDoFObjectAccessor<1, 1,CellAccessor<1> >::AccessorData AccessorData;
-
-                                    /**
-                                     * Constructor
-                                     */
-    MGDoFSubstructAccessor (Triangulation<1> *tria,
-                           const int         level,
-                           const int         index,
-                           const AccessorData *local_data) :
-                   MGDoFObjectAccessor<1, 1,CellAccessor<1> > (tria,level,index,local_data) {};
-                                    // do this here, since this way the
-                                    // CellAccessor has the possibility to know
-                                    // what a face_iterator is. Otherwise
-                                    // it would have to ask the MGDoFHandler<dim>
-                                    // which would need another big include
-                                    // file and maybe cyclic interdependence
-    typedef void * face_iterator;
-};
-
-
-
-/**
- * Intermediate, "typedef"-class, not for public use.
- *
- * @see MGDoFSubstructAccessor<1>
- */
-template <>
-class MGDoFSubstructAccessor<2> : public MGDoFObjectAccessor<2, 2,CellAccessor<2> > {
-  public:
-                                    /**
-                                     * Declare the data type that this accessor
-                                     * class expects to get passed from the
-                                     * iterator classes.
-                                     */
-    typedef MGDoFObjectAccessor<2, 2,CellAccessor<2> >::AccessorData AccessorData;
-    
-                                    /**
-                                     * Constructor
-                                     */
-    MGDoFSubstructAccessor (Triangulation<2> *tria,
-                           const int         level,
-                           const int         index,
-                           const AccessorData *local_data) :
-                   MGDoFObjectAccessor<2, 2,CellAccessor<2> > (tria,level,index,local_data) {};
-                                    // do this here, since this way the
-                                    // CellAccessor has the possibility to know
-                                    // what a face_iterator is. Otherwise
-                                    // it would have to ask the DoFHandler<dim>
-                                    // which would need another big include
-                                    // file and maybe cyclic interdependence
-    typedef TriaIterator<2,MGDoFObjectAccessor<1, 2,TriaObjectAccessor<1, 2> > > face_iterator;
-};
-
-
-
-/**
- * Intermediate, "typedef"-class, not for public use.
- *
- * @see MGDoFSubstructAccessor<1>
- */
-template <>
-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 MGDoFObjectAccessor<3, 3,CellAccessor<3> >::AccessorData AccessorData;
-    
-                                    /**
-                                     * Constructor
-                                     */
-    MGDoFSubstructAccessor (Triangulation<3> *tria,
-                           const int         level,
-                           const int         index,
-                           const AccessorData *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
-                                    // it would have to ask the DoFHandler<dim>
-                                    // which would need another big include
-                                    // file and maybe cyclic interdependence
-    typedef TriaIterator<3,MGDoFObjectAccessor<2, 3,TriaObjectAccessor<2, 3> > > face_iterator;
-};
-
-
-
-
-
-
 /**
  * Grant access to the degrees of freedom on a cell. In fact, since all
  * access to the degrees of freedom has been enabled by the classes
@@ -606,14 +475,22 @@ class MGDoFSubstructAccessor<3> : public MGDoFObjectAccessor<3, 3,CellAccessor<3
  * @author Wolfgang Bangerth, 1998
  */
 template <int dim>
-class MGDoFCellAccessor :  public MGDoFSubstructAccessor<dim> {
+class MGDoFCellAccessor :  public MGDoFObjectAccessor<dim, dim, CellAccessor<dim> > {
   public:
+                                    /**
+                                     * Type of faces.
+                                     */
+    typedef
+    TriaIterator<dim, MGDoFObjectAccessor<dim-1, dim,TriaObjectAccessor<dim-1, dim> > >
+    face_iterator;
                                     /**
                                      * Declare the data type that this accessor
                                      * class expects to get passed from the
                                      * iterator classes.
                                      */
-    typedef typename MGDoFSubstructAccessor<dim>::AccessorData AccessorData;
+    typedef typename
+    MGDoFObjectAccessor<dim, dim, CellAccessor<dim> >::AccessorData
+    AccessorData;
     
                                     /**
                                      * Constructor
@@ -622,7 +499,7 @@ class MGDoFCellAccessor :  public MGDoFSubstructAccessor<dim> {
                       const int           level,
                       const int           index,
                       const AccessorData *local_data) :
-                   MGDoFSubstructAccessor<dim> (tria,level,index,local_data) {};
+                   MGDoFObjectAccessor<dim, dim, CellAccessor<dim> > (tria,level,index,local_data) {};
 
                                     /**
                                      * Return the #i#th neighbor as a MGDoF cell
@@ -649,7 +526,7 @@ class MGDoFCellAccessor :  public MGDoFSubstructAccessor<dim> {
                                      * This function is not implemented in 1D,
                                      * and maps to MGDoFObjectAccessor<2, dim>::line in 2D.
                                      */
-    typename MGDoFSubstructAccessor<dim>::face_iterator
+    face_iterator
     face (const unsigned int i) const;
 
                                     /**
index 17be9b9261613e59eccdead4f500f24b9ec3c926..b02207d5cff82ba16dd434b8ac09cbbca1435e85 100644 (file)
 template <int dim, typename BaseClass>
 void DoFObjectAccessor<1, dim,BaseClass>::set_dof_index (const unsigned int i,
                                                    const int index) const {
-  Assert (dof_handler != 0, ExcInvalidObject());
+  Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
                                   // make sure a FE has been selected
                                   // and enough room was reserved
-  Assert (dof_handler->selected_fe != 0, ExcInvalidObject());
+  Assert (dof_handler->selected_fe != 0, DoFAccessor<dim>::ExcInvalidObject());
   Assert (i<dof_handler->selected_fe->dofs_per_line,
          ExcIndexRange (i, 0, dof_handler->selected_fe->dofs_per_line));
 
@@ -316,10 +316,11 @@ distribute_local_to_global (const FullMatrix<double> &local_source,
 #if deal_II_dimension == 1
 
 template <>
-DoFSubstructAccessor<1>::face_iterator
-DoFCellAccessor<1>::face (const unsigned int) const {
+DoFCellAccessor<1>::face_iterator
+DoFCellAccessor<1>::face (const unsigned int) const
+{
   Assert (false, ExcNotUsefulForThisDimension());
-  return 0;
+  return face_iterator();
 };
 
 
@@ -344,14 +345,14 @@ template <typename number>
 void
 DoFCellAccessor<dim>::get_dof_values (const Vector<number> &values,
                                      Vector<number>       &local_values) const {
-  Assert (dim==1, ::ExcInternalError());
+  Assert (dim==1, ExcInternalError());
   
-  Assert (dof_handler != 0, ExcInvalidObject());
-  Assert (&dof_handler->get_fe() != 0, ExcInvalidObject());
+  Assert (dof_handler != 0, DoFAccessor<1>::ExcInvalidObject());
+  Assert (&dof_handler->get_fe() != 0, DoFAccessor<1>::ExcInvalidObject());
   Assert (local_values.size() == dof_handler->get_fe().total_dofs,
-         ExcVectorDoesNotMatch());
+         DoFAccessor<1>::ExcVectorDoesNotMatch());
   Assert (values.size() == dof_handler->n_dofs(),
-         ExcVectorDoesNotMatch());
+         DoFAccessor<1>::ExcVectorDoesNotMatch());
   Assert (active(), ExcNotActive());
   
   const unsigned int dofs_per_vertex = dof_handler->get_fe().dofs_per_vertex,
@@ -389,14 +390,14 @@ template <typename number>
 void
 DoFCellAccessor<dim>::set_dof_values (const Vector<number> &local_values,
                                      Vector<number>       &values) const {
-  Assert (dim==1, ::ExcInternalError());
+  Assert (dim==1, ExcInternalError());
   
-  Assert (dof_handler != 0, ExcInvalidObject());
-  Assert (&dof_handler->get_fe() != 0, ExcInvalidObject());
+  Assert (dof_handler != 0, DoFAccessor<1>::ExcInvalidObject());
+  Assert (&dof_handler->get_fe() != 0, DoFAccessor<1>::ExcInvalidObject());
   Assert (local_values.size() == dof_handler->get_fe().total_dofs,
-         ExcVectorDoesNotMatch());
+         DoFAccessor<1>::ExcVectorDoesNotMatch());
   Assert (values.size() == dof_handler->n_dofs(),
-         ExcVectorDoesNotMatch());
+         DoFAccessor<1>::ExcVectorDoesNotMatch());
   Assert (active(), ExcNotActive());
   
   const unsigned int dofs_per_vertex = dof_handler->get_fe().dofs_per_vertex,
@@ -421,8 +422,9 @@ DoFCellAccessor<dim>::set_dof_values (const Vector<number> &local_values,
 #if deal_II_dimension == 2
 
 template <>
-DoFSubstructAccessor<2>::face_iterator
-DoFCellAccessor<2>::face (const unsigned int i) const {
+DoFCellAccessor<2>::face_iterator
+DoFCellAccessor<2>::face (const unsigned int i) const
+{
   return line(i);
 };
 
@@ -447,15 +449,16 @@ template <int dim>
 template <typename number>
 void
 DoFCellAccessor<dim>::get_dof_values (const Vector<number> &values,
-                                   Vector<number>       &local_values) const {
-  Assert (dim==2, ::ExcInternalError());
+                                   Vector<number>       &local_values) const
+{
+  Assert (dim==2, ExcInternalError());
   
-  Assert (dof_handler != 0, ExcInvalidObject());
-  Assert (&dof_handler->get_fe() != 0, ExcInvalidObject());
+  Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
+  Assert (&dof_handler->get_fe() != 0, DoFAccessor<dim>::ExcInvalidObject());
   Assert (local_values.size() == dof_handler->get_fe().total_dofs,
-         ExcVectorDoesNotMatch());
+         DoFAccessor<dim>::ExcVectorDoesNotMatch());
   Assert (values.size() == dof_handler->n_dofs(),
-         ExcVectorDoesNotMatch());
+         DoFAccessor<dim>::ExcVectorDoesNotMatch());
   Assert (active(), ExcNotActive());
   
   const unsigned int dofs_per_vertex = dof_handler->get_fe().dofs_per_vertex,
@@ -497,14 +500,14 @@ template <typename number>
 void
 DoFCellAccessor<dim>::set_dof_values (const Vector<number> &local_values,
                                      Vector<number>       &values) const {
-  Assert (dim==2, ::ExcInternalError());
+  Assert (dim==2, ExcInternalError());
   
-  Assert (dof_handler != 0, ExcInvalidObject());
-  Assert (&dof_handler->get_fe() != 0, ExcInvalidObject());
+  Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
+  Assert (&dof_handler->get_fe() != 0, DoFAccessor<dim>::ExcInvalidObject());
   Assert (local_values.size() == dof_handler->get_fe().total_dofs,
-         ExcVectorDoesNotMatch());
+         DoFAccessor<dim>::ExcVectorDoesNotMatch());
   Assert (values.size() == dof_handler->n_dofs(),
-         ExcVectorDoesNotMatch());
+         DoFAccessor<dim>::ExcVectorDoesNotMatch());
   Assert (active(), ExcNotActive());
   
   const unsigned int dofs_per_vertex = dof_handler->get_fe().dofs_per_vertex,
@@ -532,8 +535,9 @@ DoFCellAccessor<dim>::set_dof_values (const Vector<number> &local_values,
 #if deal_II_dimension == 3
 
 template <>
-DoFSubstructAccessor<3>::face_iterator
-DoFCellAccessor<3>::face (const unsigned int i) const {
+DoFCellAccessor<3>::face_iterator
+DoFCellAccessor<3>::face (const unsigned int i) const
+{
   return quad(i);
 };
 
@@ -559,14 +563,14 @@ template <typename number>
 void
 DoFCellAccessor<dim>::get_dof_values (const Vector<number> &values,
                                      Vector<number>       &local_values) const {
-  Assert (dim==3, ::ExcInternalError());
+  Assert (dim==3, ExcInternalError());
 
-  Assert (dof_handler != 0, ExcInvalidObject());
-  Assert (&dof_handler->get_fe() != 0, ExcInvalidObject());
+  Assert (dof_handler != 0, DoFAccessor<3>::ExcInvalidObject());
+  Assert (&dof_handler->get_fe() != 0, DoFAccessor<3>::ExcInvalidObject());
   Assert (local_values.size() == dof_handler->get_fe().total_dofs,
-         ExcVectorDoesNotMatch());
+         DoFAccessor<3>::ExcVectorDoesNotMatch());
   Assert (values.size() == dof_handler->n_dofs(),
-         ExcVectorDoesNotMatch());
+         DoFAccessor<3>::ExcVectorDoesNotMatch());
   Assert (active(), ExcNotActive());
   
   const unsigned int dofs_per_vertex = dof_handler->get_fe().dofs_per_vertex,
@@ -612,14 +616,14 @@ template <typename number>
 void
 DoFCellAccessor<dim>::set_dof_values (const Vector<number> &local_values,
                                      Vector<number>       &values) const {
-  Assert (dim==3, ::ExcInternalError());
+  Assert (dim==3, ExcInternalError());
 
-  Assert (dof_handler != 0, ExcInvalidObject());
-  Assert (&dof_handler->get_fe() != 0, ExcInvalidObject());
+  Assert (dof_handler != 0, DoFAccessor<3>::ExcInvalidObject());
+  Assert (&dof_handler->get_fe() != 0, DoFAccessor<3>::ExcInvalidObject());
   Assert (local_values.size() == dof_handler->get_fe().total_dofs,
-         ExcVectorDoesNotMatch());
+         DoFAccessor<3>::ExcVectorDoesNotMatch());
   Assert (values.size() == dof_handler->n_dofs(),
-         ExcVectorDoesNotMatch());
+         DoFAccessor<3>::ExcVectorDoesNotMatch());
   Assert (active(), ExcNotActive());
   
   const unsigned int dofs_per_vertex = dof_handler->get_fe().dofs_per_vertex,
@@ -657,12 +661,12 @@ DoFCellAccessor<dim>::get_interpolated_dof_values (const Vector<number> &values,
                                                   Vector<number>       &interpolated_values) const {
   const unsigned int total_dofs = dof_handler->get_fe().total_dofs;
   
-  Assert (dof_handler != 0, ExcInvalidObject());
-  Assert (&dof_handler->get_fe() != 0, ExcInvalidObject());
+  Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
+  Assert (&dof_handler->get_fe() != 0, DoFAccessor<dim>::ExcInvalidObject());
   Assert (interpolated_values.size() == total_dofs,
-         ExcVectorDoesNotMatch());
+         DoFAccessor<dim>::ExcVectorDoesNotMatch());
   Assert (values.size() == dof_handler->n_dofs(),
-         ExcVectorDoesNotMatch());
+         DoFAccessor<dim>::ExcVectorDoesNotMatch());
 
   if (!has_children())
                                     // if this cell has no children: simply
@@ -711,12 +715,12 @@ DoFCellAccessor<dim>::set_dof_values_by_interpolation (const Vector<number> &loc
                                                       Vector<number>       &values) const {
   const unsigned int total_dofs = dof_handler->get_fe().total_dofs;
   
-  Assert (dof_handler != 0, ExcInvalidObject());
-  Assert (&dof_handler->get_fe() != 0, ExcInvalidObject());
+  Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
+  Assert (&dof_handler->get_fe() != 0, DoFAccessor<dim>::ExcInvalidObject());
   Assert (local_values.size() == total_dofs,
-         ExcVectorDoesNotMatch());
+         DoFAccessor<dim>::ExcVectorDoesNotMatch());
   Assert (values.size() == dof_handler->n_dofs(),
-         ExcVectorDoesNotMatch());
+         DoFAccessor<dim>::ExcVectorDoesNotMatch());
 
   if (!has_children())
                                     // if this cell has no children: simply
index 69b605584992139434ea1d58197238c400628462..147b6926b202638165a9b12a3c9b8c3b26e38fea 100644 (file)
@@ -301,7 +301,7 @@ MGDoFObjectAccessor<2, dim,BaseClass>::copy_from (const MGDoFObjectAccessor<2, d
 
 
 
-/* ------------------------ MGDoFObjectAccessor --------------------------- */
+/* ------------------------ MGDoFHexAccessor --------------------------- */
 
 template <int dim, typename BaseClass>
 MGDoFObjectAccessor<3, dim,BaseClass>::MGDoFObjectAccessor (Triangulation<dim> *tria,
@@ -512,10 +512,11 @@ MGDoFCellAccessor<dim>::child (const unsigned int i) const {
 #if deal_II_dimension == 1
 
 template <>
-MGDoFSubstructAccessor<1>::face_iterator
-MGDoFCellAccessor<1>::face (const unsigned int) const {
+MGDoFCellAccessor<1>::face_iterator
+MGDoFCellAccessor<1>::face (const unsigned int) const
+{
   Assert (false, ExcNotUsefulForThisDimension());
-  return 0;
+  return face_iterator();
 };
 
 
@@ -549,8 +550,9 @@ MGDoFCellAccessor<1>::get_mg_dof_values (const Vector<double> &values,
 #if deal_II_dimension == 2
 
 template <>
-MGDoFSubstructAccessor<2>::face_iterator
-MGDoFCellAccessor<2>::face (const unsigned int i) const {
+MGDoFCellAccessor<2>::face_iterator
+MGDoFCellAccessor<2>::face (const unsigned int i) const
+{
   return line(i);
 };
 
index 69b605584992139434ea1d58197238c400628462..147b6926b202638165a9b12a3c9b8c3b26e38fea 100644 (file)
@@ -301,7 +301,7 @@ MGDoFObjectAccessor<2, dim,BaseClass>::copy_from (const MGDoFObjectAccessor<2, d
 
 
 
-/* ------------------------ MGDoFObjectAccessor --------------------------- */
+/* ------------------------ MGDoFHexAccessor --------------------------- */
 
 template <int dim, typename BaseClass>
 MGDoFObjectAccessor<3, dim,BaseClass>::MGDoFObjectAccessor (Triangulation<dim> *tria,
@@ -512,10 +512,11 @@ MGDoFCellAccessor<dim>::child (const unsigned int i) const {
 #if deal_II_dimension == 1
 
 template <>
-MGDoFSubstructAccessor<1>::face_iterator
-MGDoFCellAccessor<1>::face (const unsigned int) const {
+MGDoFCellAccessor<1>::face_iterator
+MGDoFCellAccessor<1>::face (const unsigned int) const
+{
   Assert (false, ExcNotUsefulForThisDimension());
-  return 0;
+  return face_iterator();
 };
 
 
@@ -549,8 +550,9 @@ MGDoFCellAccessor<1>::get_mg_dof_values (const Vector<double> &values,
 #if deal_II_dimension == 2
 
 template <>
-MGDoFSubstructAccessor<2>::face_iterator
-MGDoFCellAccessor<2>::face (const unsigned int i) const {
+MGDoFCellAccessor<2>::face_iterator
+MGDoFCellAccessor<2>::face (const unsigned int i) const
+{
   return line(i);
 };
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.