]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
towards unification 3d
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 20 Jul 1999 21:24:16 +0000 (21:24 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 20 Jul 1999 21:24:16 +0000 (21:24 +0000)
git-svn-id: https://svn.dealii.org/trunk@1613 0785d39b-7218-0410-832d-ea1e28bc413d

14 files changed:
deal.II/deal.II/include/dofs/dof_accessor.h
deal.II/deal.II/include/dofs/dof_accessor.templates.h
deal.II/deal.II/include/dofs/dof_handler.h
deal.II/deal.II/include/dofs/mg_dof_accessor.h
deal.II/deal.II/include/dofs/mg_dof_handler.h
deal.II/deal.II/include/grid/tria.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/include/multigrid/mg_dof_handler.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/grid/tria_accessor.cc
deal.II/deal.II/source/multigrid/mg_dof_accessor.cc

index 3a7cb0ca62389f8df75abda96c969cf0a74fc50d..ae10947c0afd6b796047a42db5ecc564c8fe8384 100644 (file)
@@ -413,7 +413,9 @@ class DoFObjectAccessor<2, dim, BaseClass> :  public DoFAccessor<dim>,
  * @see DoFLineAccessor
  */
 template <int dim, typename BaseClass>
-class DoFHexAccessor :  public DoFAccessor<dim>, public BaseClass {
+class DoFObjectAccessor<3, dim, BaseClass> :  public DoFAccessor<dim>,
+                                             public BaseClass
+{
   public:
                                     /**
                                      * Declare the data type that this accessor
@@ -426,14 +428,14 @@ class DoFHexAccessor :  public DoFAccessor<dim>, public BaseClass {
                                      * Default constructor, unused thus
                                      * not implemented.
                                      */
-    DoFHexAccessor ();
+    DoFObjectAccessor ();
 
                                     /**
                                      * Constructor. The #local_data#
                                      * argument is assumed to be a pointer
                                      * to a #DoFHandler<dim># object.
                                      */
-    DoFHexAccessor (Triangulation<dim> *tria,
+    DoFObjectAccessor (Triangulation<dim> *tria,
                    const int           level,
                    const int           index,
                    const AccessorData *local_data) :
@@ -500,7 +502,7 @@ class DoFHexAccessor :  public DoFAccessor<dim>, public BaseClass {
                                      * class returns a hex accessor without
                                      * access to the DoF data.
                                      */
-    TriaIterator<dim,DoFHexAccessor<dim,BaseClass> > child (const unsigned int) const;
+    TriaIterator<dim,DoFObjectAccessor<3, dim,BaseClass> > child (const unsigned int) const;
 
                                     /**
                                      * Distribute a local (cell based) vector
@@ -532,7 +534,7 @@ class DoFHexAccessor :  public DoFAccessor<dim>, public BaseClass {
                                      * Implement the copy operator needed
                                      * for the iterator classes.
                                      */
-    void copy_from (const DoFHexAccessor<dim,BaseClass> &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
index b92ec6cb37782299c6b42ff2b2b71abe5d0341c9..0a0f44d483cc1eb0b83a2fb33d7b34802943bbc4 100644 (file)
@@ -216,12 +216,12 @@ DoFObjectAccessor<2, dim,BaseClass>::copy_from (const DoFObjectAccessor<2, dim,B
 
 
 
-/*------------------------- Functions: DoFHexAccessor -----------------------*/
+/*------------------------- Functions: DoFObjectAccessor -----------------------*/
 
 
 template <int dim, typename BaseClass>
 inline
-int DoFHexAccessor<dim,BaseClass>::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<dim,BaseClass>::dof_index (const unsigned int i) const {
 
 template <int dim, typename BaseClass>
 inline
-int DoFHexAccessor<dim,BaseClass>::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<dim,BaseClass>::vertex_dof_index (const unsigned int vertex,
 template <int dim, typename BaseClass>
 inline
 void
-DoFHexAccessor<dim,BaseClass>::get_dof_indices (vector<int> &dof_indices) const {
+DoFObjectAccessor<3, dim,BaseClass>::get_dof_indices (vector<int> &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<dim,BaseClass>::get_dof_indices (vector<int> &dof_indices) const
 template <int dim, typename BaseClass>
 inline
 TriaIterator<dim,DoFObjectAccessor<1, dim,TriaObjectAccessor<1, dim> > >
-DoFHexAccessor<dim,BaseClass>::line (const unsigned int i) const {
+DoFObjectAccessor<3, dim,BaseClass>::line (const unsigned int i) const {
   TriaIterator<dim,TriaObjectAccessor<1, dim> > l = BaseClass::line(i);
   return TriaIterator<dim,DoFObjectAccessor<1, dim,TriaObjectAccessor<1, dim> > >
     (
@@ -304,7 +304,7 @@ DoFHexAccessor<dim,BaseClass>::line (const unsigned int i) const {
 template <int dim, typename BaseClass>
 inline
 TriaIterator<dim,DoFObjectAccessor<2, dim,TriaObjectAccessor<2, dim> > >
-DoFHexAccessor<dim,BaseClass>::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<dim,DoFObjectAccessor<2, dim,TriaObjectAccessor<2, dim> > >
@@ -320,9 +320,9 @@ DoFHexAccessor<dim,BaseClass>::quad (const unsigned int i) const {
 
 template <int dim, typename BaseClass>
 inline
-TriaIterator<dim,DoFHexAccessor<dim,BaseClass> >
-DoFHexAccessor<dim,BaseClass>::child (const unsigned int i) const {
-  TriaIterator<dim,DoFHexAccessor<dim,BaseClass> > q (tria,
+TriaIterator<dim,DoFObjectAccessor<3, dim,BaseClass> >
+DoFObjectAccessor<3, dim,BaseClass>::child (const unsigned int i) const {
+  TriaIterator<dim,DoFObjectAccessor<3, dim,BaseClass> > q (tria,
                                                      present_level+1,
                                                      child_index (i),
                                                      dof_handler);
@@ -337,7 +337,7 @@ DoFHexAccessor<dim,BaseClass>::child (const unsigned int i) const {
 
 
 template <int dim, typename BaseClass>
-void DoFHexAccessor<dim,BaseClass>::copy_from (const DoFHexAccessor<dim,BaseClass> &a) {
+void DoFObjectAccessor<3, dim,BaseClass>::copy_from (const DoFObjectAccessor<3, dim,BaseClass> &a) {
   BaseClass::copy_from (a);
   set_dof_handler (a.dof_handler);
 };
index cc4e054094470bbb9f974733522c9992465666cf..bfed4555bd8e351fcb5e4fb82db9da8cbf5fb776 100644 (file)
@@ -1568,8 +1568,8 @@ class DoFHandler  :  public Subscriptor,
     friend class DoFObjectAccessor<1, dim, CellAccessor<dim> >;
     friend class DoFObjectAccessor<2, dim, TriaObjectAccessor<2, dim> >;
     friend class DoFObjectAccessor<2, dim, CellAccessor<dim> >;
-    friend class DoFHexAccessor<dim, HexAccessor<dim> >;
-    friend class DoFHexAccessor<dim, CellAccessor<dim> >;
+    friend class DoFObjectAccessor<3, dim, TriaObjectAccessor<3, dim> >;
+    friend class DoFObjectAccessor<3, dim, CellAccessor<dim> >;
 };
 
 
index b7fcc566ecc5e541e9898668823151d21f85eba1..030ea02c76809d22928af9cd1dc1d2f05bd23ca4 100644 (file)
@@ -338,7 +338,9 @@ class MGDoFObjectAccessor<2, dim, BaseClass> :  public MGDoFAccessor<dim>, publi
  * @see DoFLineAccessor
  */
 template <int dim, typename BaseClass>
-class MGDoFHexAccessor :  public MGDoFAccessor<dim>, public DoFHexAccessor<dim, BaseClass> {
+class MGDoFObjectAccessor<3, dim, BaseClass> :  public MGDoFAccessor<dim>,
+                                               public DoFObjectAccessor<3, dim, BaseClass>
+{
   public:
                                     /**
                                      * Declare the data type that this accessor
@@ -351,14 +353,14 @@ class MGDoFHexAccessor :  public MGDoFAccessor<dim>, public DoFHexAccessor<dim,
                                      * Default constructor, unused thus
                                      * not implemented.
                                      */
-    MGDoFHexAccessor ();
+    MGDoFObjectAccessor ();
 
                                     /**
                                      * Constructor. The #local_data#
                                      * argument is assumed to be a pointer
                                      * to a #DoFHandler<dim># object.
                                      */
-    MGDoFHexAccessor (Triangulation<dim> *tria,
+    MGDoFObjectAccessor (Triangulation<dim> *tria,
                      const int           level,
                      const int           index,
                      const AccessorData *local_data);
@@ -429,13 +431,13 @@ class MGDoFHexAccessor :  public MGDoFAccessor<dim>, public DoFHexAccessor<dim,
                                      * class returns a hex accessor without
                                      * access to the DoF data.
                                      */
-    TriaIterator<dim,MGDoFHexAccessor<dim,BaseClass> > child (const unsigned int) const;
+    TriaIterator<dim,MGDoFObjectAccessor<3, dim,BaseClass> > child (const unsigned int) const;
     
                                     /**
                                      * Implement the copy operator needed
                                      * for the iterator classes.
                                      */
-    void copy_from (const MGDoFHexAccessor<dim,BaseClass> &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
index cfc826e904f9ae31664df7905e9c4fbed5bbb7a5..4b15d63172f3386f831f5a4d4d5c29b1ee1fdf88 100644 (file)
@@ -962,8 +962,8 @@ class MGDoFHandler
     friend class MGDoFObjectAccessor<1, dim, CellAccessor<dim> >;
     friend class MGDoFObjectAccessor<2, dim, TriaObjectAccessor<2, dim> >;
     friend class MGDoFObjectAccessor<2, dim, CellAccessor<dim> >;
-    friend class MGDoFHexAccessor<dim, HexAccessor<dim> >;
-    friend class MGDoFHexAccessor<dim, CellAccessor<dim> >;
+    friend class MGDoFObjectAccessor<3, dim, TriaObjectAccessor<3, dim> >;
+    friend class MGDoFObjectAccessor<3, dim, CellAccessor<dim> >;
 };
 
     
index a729fef2db36ad92b186add8151d317aa23df5e0..43767785a93bb45b3d0eb91d74c79e526b4d517f 100644 (file)
@@ -3005,7 +3005,7 @@ class Triangulation
     friend class TriaAccessor<dim>;
     friend class TriaObjectAccessor<1, dim>;
     friend class TriaObjectAccessor<2, dim>;
-    friend class HexAccessor<dim>;
+    friend class TriaObjectAccessor<3, dim>;
 
     friend class CellAccessor<dim>;
     
@@ -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<dim>;
index 500122d15d21b0b19e0931a7c0bc6768cba4b255..e7d15db8e71c5e76bfe1a896c77ee2ce3086cd24 100644 (file)
@@ -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<int celldim, int dim>
-class TriaObjectAccessor;
+class TriaObjectAccessor :  public TriaAccessor<dim>
+{
+  public:
+                                    /**
+                                     * Constructor.
+                                     * By default, an illegal
+                                     * accessor is constructed.
+                                     */
+    TriaObjectAccessor (Triangulation<dim> *parent     = 0,
+                const int           level      = -1,
+                const int           index      = -1,
+                const void         *local_data = 0) :
+                   TriaAccessor<dim> (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<dim> & vertex (const unsigned int i) const;
+
+                                    /**
+                                     *  Pointer to the #i#th line
+                                     *  bounding this object.
+                                     *
+                                     * Implemented only for #celldim>1#.
+                                     */
+    TriaIterator<dim,TriaObjectAccessor<1, dim> > 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<dim,TriaObjectAccessor<2, dim> > 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<A*>(cell->user_pointer());#.
+                                     */
+    void * user_pointer () const;
+
+                                    /**
+                                     *  Pointer to the #i#th
+                                     *  child.
+                                     */
+    TriaIterator<dim,TriaObjectAccessor<3, dim> > 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<dim> center () const;
+
+                                    /**
+                                     * Barycenter of the object.
+                                     */
+    Point<dim> 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 <int anydim, typename AnyAccessor> friend class TriaRawIterator;
+};
+
+
+template<int dim>
+class TriaObjectAccessor<0, dim> : public TriaAccessor<dim>
+{};
 
 
 
@@ -930,12 +1291,13 @@ class TriaObjectAccessor<2, dim> :  public TriaAccessor<dim>
  *   @author Wolfgang Bangerth, 1998
  */
 template <int dim>
-class HexAccessor :  public TriaAccessor<dim> {
+class TriaObjectAccessor<3, dim> :  public TriaAccessor<dim>
+{
   public:
                                     /**
                                      *  Constructor.
                                      */
-    HexAccessor (Triangulation<dim> *parent     = 0,
+    TriaObjectAccessor (Triangulation<dim> *parent     = 0,
                 const int           level      = -1,
                 const int           index      = -1,
                 const void         *local_data = 0) :
@@ -1067,7 +1429,7 @@ class HexAccessor :  public TriaAccessor<dim> {
                                      *  Return a pointer to the #i#th
                                      *  child.
                                      */
-    TriaIterator<dim,HexAccessor<dim> > child (const unsigned int i) const;
+    TriaIterator<dim,TriaObjectAccessor<3, dim> > child (const unsigned int i) const;
 
                                     /**
                                      *  Return the index of the #i#th child.
@@ -1240,7 +1602,7 @@ class HexAccessor :  public TriaAccessor<dim> {
                                      *  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
index 6a4dd2b89a29af626f19412ca51ff5bbb5656c9e..f75682dd438b635818dc1f386634b27ea4fe23ae 100644 (file)
@@ -427,14 +427,14 @@ TriaObjectAccessor<2, dim>::operator -- () {
 
 
 
-/*------------------------ Functions: HexAccessor ---------------------------*/
+/*------------------------ Functions: TriaObjectAccessor ---------------------------*/
 
 
 
 template <int dim>
 inline
 bool
-HexAccessor<dim>::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<dim>::used () const {
 template <int dim>
 inline
 bool
-HexAccessor<dim>::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<dim>::user_flag_set () const {
 template <int dim>
 inline
 void
-HexAccessor<dim>::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<dim>::set_user_flag () const {
 
 template <int dim>
 inline
-void HexAccessor<dim>::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<dim>::clear_user_flag () const {
 template <int dim>
 inline
 TriaIterator<dim,TriaObjectAccessor<1, dim> >
-HexAccessor<dim>::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<dim>::line (const unsigned int i) const {
 template <int dim>
 inline
 TriaIterator<dim,TriaObjectAccessor<2, dim> >
-HexAccessor<dim>::quad (const unsigned int i) const {
+TriaObjectAccessor<3, dim>::quad (const unsigned int i) const {
   Assert (used(), ExcCellNotUsed());
   return
     TriaIterator<dim,TriaObjectAccessor<2, dim> >
@@ -520,7 +520,7 @@ HexAccessor<dim>::quad (const unsigned int i) const {
 template <int dim>
 inline
 unsigned int
-HexAccessor<dim>::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<dim>::line_index (unsigned int i) const {
 template <int dim>
 inline
 unsigned int
-HexAccessor<dim>::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<dim>::quad_index (unsigned int i) const {
 
 template <int dim>
 inline
-TriaIterator<dim,HexAccessor<dim> >
-HexAccessor<dim>::child (const unsigned int i) const {
+TriaIterator<dim,TriaObjectAccessor<3, dim> >
+TriaObjectAccessor<3, dim>::child (const unsigned int i) const {
   Assert (i<6, ExcIndexRange(i,0,6));
   
-  TriaIterator<dim,HexAccessor<dim> > q (tria, present_level+1, child_index (i));
+  TriaIterator<dim,TriaObjectAccessor<3, dim> > q (tria, present_level+1, child_index (i));
   
 #ifdef DEBUG
   if (q.state() != past_the_end)
@@ -576,7 +576,7 @@ HexAccessor<dim>::child (const unsigned int i) const {
 
 template <int dim>
 inline
-int HexAccessor<dim>::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<dim>::child_index (unsigned int i) const {
 
 
 template <int dim>
-bool HexAccessor<dim>::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<dim>::has_children () const {
 template <int dim>
 inline
 unsigned int
-HexAccessor<dim>::max_refinement_depth () const
+TriaObjectAccessor<3, dim>::max_refinement_depth () const
 {
   if (!has_children())
     return 0;
@@ -618,7 +618,7 @@ HexAccessor<dim>::max_refinement_depth () const
 template <int dim>
 inline
 void
-HexAccessor<dim>::operator ++ () {
+TriaObjectAccessor<3, dim>::operator ++ () {
   ++present_index;
                                   // is index still in the range of
                                   // the vector?
@@ -644,7 +644,7 @@ HexAccessor<dim>::operator ++ () {
 template <int dim>
 inline
 void
-HexAccessor<dim>::operator -- () {
+TriaObjectAccessor<3, dim>::operator -- () {
   --present_index;
                                   // is index still in the range of
                                   // the vector?
index b7fcc566ecc5e541e9898668823151d21f85eba1..030ea02c76809d22928af9cd1dc1d2f05bd23ca4 100644 (file)
@@ -338,7 +338,9 @@ class MGDoFObjectAccessor<2, dim, BaseClass> :  public MGDoFAccessor<dim>, publi
  * @see DoFLineAccessor
  */
 template <int dim, typename BaseClass>
-class MGDoFHexAccessor :  public MGDoFAccessor<dim>, public DoFHexAccessor<dim, BaseClass> {
+class MGDoFObjectAccessor<3, dim, BaseClass> :  public MGDoFAccessor<dim>,
+                                               public DoFObjectAccessor<3, dim, BaseClass>
+{
   public:
                                     /**
                                      * Declare the data type that this accessor
@@ -351,14 +353,14 @@ class MGDoFHexAccessor :  public MGDoFAccessor<dim>, public DoFHexAccessor<dim,
                                      * Default constructor, unused thus
                                      * not implemented.
                                      */
-    MGDoFHexAccessor ();
+    MGDoFObjectAccessor ();
 
                                     /**
                                      * Constructor. The #local_data#
                                      * argument is assumed to be a pointer
                                      * to a #DoFHandler<dim># object.
                                      */
-    MGDoFHexAccessor (Triangulation<dim> *tria,
+    MGDoFObjectAccessor (Triangulation<dim> *tria,
                      const int           level,
                      const int           index,
                      const AccessorData *local_data);
@@ -429,13 +431,13 @@ class MGDoFHexAccessor :  public MGDoFAccessor<dim>, public DoFHexAccessor<dim,
                                      * class returns a hex accessor without
                                      * access to the DoF data.
                                      */
-    TriaIterator<dim,MGDoFHexAccessor<dim,BaseClass> > child (const unsigned int) const;
+    TriaIterator<dim,MGDoFObjectAccessor<3, dim,BaseClass> > child (const unsigned int) const;
     
                                     /**
                                      * Implement the copy operator needed
                                      * for the iterator classes.
                                      */
-    void copy_from (const MGDoFHexAccessor<dim,BaseClass> &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
index cfc826e904f9ae31664df7905e9c4fbed5bbb7a5..4b15d63172f3386f831f5a4d4d5c29b1ee1fdf88 100644 (file)
@@ -962,8 +962,8 @@ class MGDoFHandler
     friend class MGDoFObjectAccessor<1, dim, CellAccessor<dim> >;
     friend class MGDoFObjectAccessor<2, dim, TriaObjectAccessor<2, dim> >;
     friend class MGDoFObjectAccessor<2, dim, CellAccessor<dim> >;
-    friend class MGDoFHexAccessor<dim, HexAccessor<dim> >;
-    friend class MGDoFHexAccessor<dim, CellAccessor<dim> >;
+    friend class MGDoFObjectAccessor<3, dim, TriaObjectAccessor<3, dim> >;
+    friend class MGDoFObjectAccessor<3, dim, CellAccessor<dim> >;
 };
 
     
index 2b0163bd0ada2e7a8894f7b922b6fe75dcc45f2d..17be9b9261613e59eccdead4f500f24b9ec3c926 100644 (file)
@@ -210,11 +210,11 @@ distribute_local_to_global (const FullMatrix<double> &local_source,
 
 
 
-/*------------------------- Functions: DoFHexAccessor -----------------------*/
+/*------------------------- Functions: DoFObjectAccessor -----------------------*/
 
 
 template <int dim, typename BaseClass>
-void DoFHexAccessor<dim,BaseClass>::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<dim,BaseClass>::set_dof_index (const unsigned int i,
 
 
 template <int dim, typename BaseClass>
-void DoFHexAccessor<dim,BaseClass>::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<dim,BaseClass>::set_vertex_dof_index (const unsigned int ver
 
 
 template <int dim, typename BaseClass>
-void DoFHexAccessor<dim,BaseClass>::
+void DoFObjectAccessor<3, dim,BaseClass>::
 distribute_local_to_global (const Vector<double> &local_source,
                            Vector<double>       &global_destination) const {
   Assert (dof_handler != 0, ExcInvalidObject());
@@ -275,7 +275,7 @@ distribute_local_to_global (const Vector<double> &local_source,
 
 
 template <int dim, typename BaseClass>
-void DoFHexAccessor<dim,BaseClass>::
+void DoFObjectAccessor<3, dim,BaseClass>::
 distribute_local_to_global (const FullMatrix<double> &local_source,
                            SparseMatrix<double>     &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> > >;
index 97b95bfb6b5ed54f6a9c7c39f2041a05e503dcaa..69b605584992139434ea1d58197238c400628462 100644 (file)
@@ -301,21 +301,21 @@ MGDoFObjectAccessor<2, dim,BaseClass>::copy_from (const MGDoFObjectAccessor<2, d
 
 
 
-/* ------------------------ MGDoFHexAccessor --------------------------- */
+/* ------------------------ MGDoFObjectAccessor --------------------------- */
 
 template <int dim, typename BaseClass>
-MGDoFHexAccessor<dim,BaseClass>::MGDoFHexAccessor (Triangulation<dim> *tria,
+MGDoFObjectAccessor<3, dim,BaseClass>::MGDoFObjectAccessor (Triangulation<dim> *tria,
                                                   const int           level,
                                                   const int           index,
                                                   const AccessorData *local_data) :
                MGDoFAccessor<dim> (local_data),
-               DoFHexAccessor<dim,BaseClass>(tria,level,index,local_data) {};
+               DoFObjectAccessor<3, dim,BaseClass>(tria,level,index,local_data) {};
 
 
 
 template <int dim, typename BaseClass>
 inline
-int MGDoFHexAccessor<dim,BaseClass>::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<dim,BaseClass>::mg_dof_index (const unsigned int i) const {
 
 
 template <int dim, typename BaseClass>
-void MGDoFHexAccessor<dim,BaseClass>::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<dim,BaseClass>::set_mg_dof_index (const unsigned int i,
 
 template <int dim, typename BaseClass>
 inline
-int MGDoFHexAccessor<dim,BaseClass>::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<dim,BaseClass>::mg_vertex_dof_index (const unsigned int ver
 
   
 template <int dim, typename BaseClass>
-void MGDoFHexAccessor<dim,BaseClass>::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<dim,BaseClass>::set_mg_vertex_dof_index (const unsigned in
 
 template <int dim, typename BaseClass>
 void
-MGDoFHexAccessor<dim,BaseClass>::get_mg_dof_indices (vector<int> &dof_indices) const {
+MGDoFObjectAccessor<3, dim,BaseClass>::get_mg_dof_indices (vector<int> &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<dim,BaseClass>::get_mg_dof_indices (vector<int> &dof_indices) c
 
 template <int dim, typename BaseClass>
 TriaIterator<dim,MGDoFObjectAccessor<1, dim,TriaObjectAccessor<1, dim> > >
-MGDoFHexAccessor<dim,BaseClass>::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<dim,MGDoFObjectAccessor<1, dim,TriaObjectAccessor<1, dim> > >
@@ -431,7 +431,7 @@ MGDoFHexAccessor<dim,BaseClass>::line (const unsigned int i) const {
 
 template <int dim, typename BaseClass>
 TriaIterator<dim,MGDoFObjectAccessor<2, dim,TriaObjectAccessor<2, dim> > >
-MGDoFHexAccessor<dim,BaseClass>::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<dim,MGDoFObjectAccessor<2, dim,TriaObjectAccessor<2, dim> > >
@@ -446,9 +446,9 @@ MGDoFHexAccessor<dim,BaseClass>::quad (const unsigned int i) const {
 
 
 template <int dim, typename BaseClass>
-TriaIterator<dim,MGDoFHexAccessor<dim,BaseClass> >
-MGDoFHexAccessor<dim,BaseClass>::child (const unsigned int i) const {
-  TriaIterator<dim,MGDoFHexAccessor<dim,BaseClass> > q (tria,
+TriaIterator<dim,MGDoFObjectAccessor<3, dim,BaseClass> >
+MGDoFObjectAccessor<3, dim,BaseClass>::child (const unsigned int i) const {
+  TriaIterator<dim,MGDoFObjectAccessor<3, dim,BaseClass> > q (tria,
                                                        present_level+1,
                                                        child_index (i),
                                                        mg_dof_handler);
@@ -464,8 +464,8 @@ MGDoFHexAccessor<dim,BaseClass>::child (const unsigned int i) const {
 
 template <int dim, typename BaseClass>
 void
-MGDoFHexAccessor<dim,BaseClass>::copy_from (const MGDoFHexAccessor<dim,BaseClass> &a) {
-  DoFHexAccessor<dim,BaseClass>::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> > >;
index 6cfcf9b19d9826fbcd6be4ca6b766509f715be83..9b180dd2dd751ef36df4181b3025bcc3240003bd 100644 (file)
@@ -567,17 +567,17 @@ unsigned int TriaObjectAccessor<2, dim>::number_of_children () const {
 
 
 
-/*------------------------ Functions: HexAccessor ---------------------------*/
+/*------------------------ Functions: TriaObjectAccessor ---------------------------*/
 
 template <int dim>
-void HexAccessor<dim>::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 dim>
-int HexAccessor<dim>::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<dim>::vertex_index (const unsigned int corner) const {
 
 template <int dim>
 Point<dim> &
-HexAccessor<dim>::vertex (const unsigned int i) const {
+TriaObjectAccessor<3, dim>::vertex (const unsigned int i) const {
   return tria->vertices[vertex_index(i)];
 };
 
 
 
 template <int dim>
-void HexAccessor<dim>::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<dim>::set_used_flag () const {
 
 
 template <int dim>
-void HexAccessor<dim>::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<dim>::clear_used_flag () const {
 
 
 template <int dim>
-void HexAccessor<dim>::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<dim>::recursively_set_user_flag () const {
 
 
 template <int dim>
-void HexAccessor<dim>::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<dim>::recursively_clear_user_flag () const {
 
 
 template <int dim>
-void HexAccessor<dim>::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<dim>::set_user_pointer (void *p) const {
 
 
 template <int dim>
-void HexAccessor<dim>::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<dim>::clear_user_pointer () const {
 
 
 template <int dim>
-void * HexAccessor<dim>::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<dim>::user_pointer () const {
 
 
 template <int dim>
-void HexAccessor<dim>::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<dim>::set_children (const int index) const {
 
 
 template <int dim>
-void HexAccessor<dim>::clear_children () const {
+void TriaObjectAccessor<3, dim>::clear_children () const {
   set_children (-1);
 };
 
 
 
 template <int dim>
-unsigned char HexAccessor<dim>::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<dim>::boundary_indicator () const {
 
 
 template <int dim>
-void HexAccessor<dim>::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<dim>::set_boundary_indicator (unsigned char boundary_ind) const
 
 
 template <int dim>
-bool HexAccessor<dim>::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<dim>::at_boundary () const {
 
 
 template <int dim>
-double HexAccessor<dim>::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<dim>::diameter () const {
 
 
 template <int dim>
-Point<dim> HexAccessor<dim>::center () const {
+Point<dim> 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<dim> HexAccessor<dim>::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 <int dim>
-unsigned int HexAccessor<dim>::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<deal_II_dimension,TriaObjectAccessor<2, deal_I
 #endif
 
 #if deal_II_dimension >= 3
-template class HexAccessor<deal_II_dimension>;
-template class TriaRawIterator<deal_II_dimension,HexAccessor<deal_II_dimension> >;
-template class TriaIterator<deal_II_dimension,HexAccessor<deal_II_dimension> >;
-template class TriaActiveIterator<deal_II_dimension,HexAccessor<deal_II_dimension> >;
+template class TriaObjectAccessor<3, deal_II_dimension>;
+template class TriaRawIterator<deal_II_dimension,TriaObjectAccessor<3, deal_II_dimension> >;
+template class TriaIterator<deal_II_dimension,TriaObjectAccessor<3, deal_II_dimension> >;
+template class TriaActiveIterator<deal_II_dimension,TriaObjectAccessor<3, deal_II_dimension> >;
 #endif
 
 
index 97b95bfb6b5ed54f6a9c7c39f2041a05e503dcaa..69b605584992139434ea1d58197238c400628462 100644 (file)
@@ -301,21 +301,21 @@ MGDoFObjectAccessor<2, dim,BaseClass>::copy_from (const MGDoFObjectAccessor<2, d
 
 
 
-/* ------------------------ MGDoFHexAccessor --------------------------- */
+/* ------------------------ MGDoFObjectAccessor --------------------------- */
 
 template <int dim, typename BaseClass>
-MGDoFHexAccessor<dim,BaseClass>::MGDoFHexAccessor (Triangulation<dim> *tria,
+MGDoFObjectAccessor<3, dim,BaseClass>::MGDoFObjectAccessor (Triangulation<dim> *tria,
                                                   const int           level,
                                                   const int           index,
                                                   const AccessorData *local_data) :
                MGDoFAccessor<dim> (local_data),
-               DoFHexAccessor<dim,BaseClass>(tria,level,index,local_data) {};
+               DoFObjectAccessor<3, dim,BaseClass>(tria,level,index,local_data) {};
 
 
 
 template <int dim, typename BaseClass>
 inline
-int MGDoFHexAccessor<dim,BaseClass>::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<dim,BaseClass>::mg_dof_index (const unsigned int i) const {
 
 
 template <int dim, typename BaseClass>
-void MGDoFHexAccessor<dim,BaseClass>::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<dim,BaseClass>::set_mg_dof_index (const unsigned int i,
 
 template <int dim, typename BaseClass>
 inline
-int MGDoFHexAccessor<dim,BaseClass>::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<dim,BaseClass>::mg_vertex_dof_index (const unsigned int ver
 
   
 template <int dim, typename BaseClass>
-void MGDoFHexAccessor<dim,BaseClass>::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<dim,BaseClass>::set_mg_vertex_dof_index (const unsigned in
 
 template <int dim, typename BaseClass>
 void
-MGDoFHexAccessor<dim,BaseClass>::get_mg_dof_indices (vector<int> &dof_indices) const {
+MGDoFObjectAccessor<3, dim,BaseClass>::get_mg_dof_indices (vector<int> &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<dim,BaseClass>::get_mg_dof_indices (vector<int> &dof_indices) c
 
 template <int dim, typename BaseClass>
 TriaIterator<dim,MGDoFObjectAccessor<1, dim,TriaObjectAccessor<1, dim> > >
-MGDoFHexAccessor<dim,BaseClass>::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<dim,MGDoFObjectAccessor<1, dim,TriaObjectAccessor<1, dim> > >
@@ -431,7 +431,7 @@ MGDoFHexAccessor<dim,BaseClass>::line (const unsigned int i) const {
 
 template <int dim, typename BaseClass>
 TriaIterator<dim,MGDoFObjectAccessor<2, dim,TriaObjectAccessor<2, dim> > >
-MGDoFHexAccessor<dim,BaseClass>::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<dim,MGDoFObjectAccessor<2, dim,TriaObjectAccessor<2, dim> > >
@@ -446,9 +446,9 @@ MGDoFHexAccessor<dim,BaseClass>::quad (const unsigned int i) const {
 
 
 template <int dim, typename BaseClass>
-TriaIterator<dim,MGDoFHexAccessor<dim,BaseClass> >
-MGDoFHexAccessor<dim,BaseClass>::child (const unsigned int i) const {
-  TriaIterator<dim,MGDoFHexAccessor<dim,BaseClass> > q (tria,
+TriaIterator<dim,MGDoFObjectAccessor<3, dim,BaseClass> >
+MGDoFObjectAccessor<3, dim,BaseClass>::child (const unsigned int i) const {
+  TriaIterator<dim,MGDoFObjectAccessor<3, dim,BaseClass> > q (tria,
                                                        present_level+1,
                                                        child_index (i),
                                                        mg_dof_handler);
@@ -464,8 +464,8 @@ MGDoFHexAccessor<dim,BaseClass>::child (const unsigned int i) const {
 
 template <int dim, typename BaseClass>
 void
-MGDoFHexAccessor<dim,BaseClass>::copy_from (const MGDoFHexAccessor<dim,BaseClass> &a) {
-  DoFHexAccessor<dim,BaseClass>::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> > >;

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.