]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Minor cleanups in the various hp-related classes.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 28 Aug 2013 04:18:10 +0000 (04:18 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 28 Aug 2013 04:18:10 +0000 (04:18 +0000)
git-svn-id: https://svn.dealii.org/trunk@30512 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/hp/dof_handler.h
deal.II/include/deal.II/hp/dof_levels.h
deal.II/source/hp/dof_handler.cc
deal.II/source/hp/dof_levels.cc

index 1baba2752622f46166f2334f8adb1bdd3d4a7059..d4ff6b16f711278f35ae3393c6f2204a7491fcae 100644 (file)
@@ -693,7 +693,7 @@ namespace hp
      *  the active_fe_indices in
      *  the
      *  dealii::internal::hp::DoFLevel. They
-     *  are initialized with the a
+     *  are initialized with a
      *  zero indicator, meaning
      *  that fe[0] is going to be
      *  used by default.  This
@@ -704,7 +704,6 @@ namespace hp
      *  cell has a valid
      *  active_fe_index.
      */
-
     void create_active_fe_table ();
 
     /**
@@ -791,7 +790,8 @@ namespace hp
      * <tt>levels[]</tt> tree of
      * the Triangulation objects.
      */
-    std::vector<dealii::internal::hp::DoFLevel<dim>*>    levels;
+    std::vector<dealii::internal::hp::DoFLevel<dim>*> levels;
+
     /**
      * Space to store the DoF
      * numbers for the faces.
@@ -837,7 +837,7 @@ namespace hp
      * actual data format used to
      * the present class.
      */
-    std::vector<types::global_dof_index>      vertex_dofs;
+    std::vector<types::global_dof_index> vertex_dofs;
 
     /**
      * For each vertex in the
@@ -866,10 +866,10 @@ namespace hp
 
     /**
      * Array to store the
-     * information, if a cell on
+     * information if a cell on
      * some level has children or
      * not. It is used by the
-     * refinement listeners as a
+     * signal slots as a
      * persistent buffer during the
      * refinement, i.e. from between
      * when pre_refinement_action is
index 9bc69d2143b3415d73e743230bd7d60ee05bdf38..19d9f7e33d1b313c2c010ca57239031e5b857400 100644 (file)
@@ -29,22 +29,21 @@ namespace internal
 {
   namespace hp
   {
+    template <int dim>
+    class DoFLevel;
 
     /**
-     * Store the indices of the degrees of freedom which are located on
-     * objects of dimension @p N. We declare this general template
-     * class, but do not actually use it. Rather, only specializations of
-     * this class are used.
+     * Store the indices of the degrees of freedom that are located on
+     * objects of dimension @p structdim.
      *
-     * The things we store here is very similar to what is stored in the
+     * The things we store here are very similar to what is stored in the
      * internal::DoFHandler::DoFLevel class hierarchy (see there for more
      * information, in particular on the layout of the class hierarchy,
      * and the use of file names). There are two main
      * differences, discussed in the following subsections. In addition to
      * the data already stored by the internal::DoFHandler::DoFLevel
      * classes, we also have to store which finite element each cell
-     * uses. This is done in the DoFLevel<0> class, where for each cell we
-     * have an entry within the active_fe_indices field.
+     * uses.
      *
      *
      * <h4>Offset computations</h4>
@@ -105,35 +104,14 @@ namespace internal
      * @ingroup hp
      * @author Wolfgang Bangerth, 1998, 2006, Oliver Kayser-Herold 2003.
      */
-    template <int N>
+    template <int dim>
     class DoFLevel
     {
-    private:
-      /**
-       * Make the constructor private
-       * to avoid that someone uses
-       * this class.
-       */
-      DoFLevel ();
-    };
-
-
-    /**
-     * Storage for degrees of freedom on cells. See the documentation of
-     * the DoFLevel class template for more complete information on the
-     * purpose and layout of this class.
-     *
-     * @ingroup hp
-     * @author Wolfgang Bangerth, 1998, 2006, Oliver Kayser-Herold 2003.
-     */
-    template <>
-    class DoFLevel<0>
-    {
     public:
       /**
        *  Indices specifying the finite
        *  element of hp::FECollection to use
-       *  for the different cells. The
+       *  for the different cells on the current level. The
        *  meaning what a cell is, is
        *  dimension specific, therefore also
        *  the length of this vector depends
@@ -141,35 +119,16 @@ namespace internal
        *  the length of this vector equals
        *  the length of the @p lines vector,
        *  in two dimensions that of the @p
-       *  quads vector, etc.
+       *  quads vector, etc. The vector stores one element per cell
+       *  since the actiev_fe_index is unique for cells.
        */
-
       std::vector<unsigned int> active_fe_indices;
-      /**
-       * Determine an estimate for the
-       * memory consumption (in bytes)
-       * of this object.
-       */
-      std::size_t memory_consumption () const;
-    };
-
 
-    /**
-     * Store the indices of the degrees of freedom which are located on
-     * the lines. See the general template DoFLevel for more information.
-     *
-     * @ingroup hp
-     * @author Wolfgang Bangerth, 1998, 2006, Oliver Kayser-Herold 2003.
-     */
-    template <>
-    class DoFLevel<1> : public DoFLevel<0>
-    {
-    public:
       /**
-       *  store the dof-indices and related functions of
-       *  lines
+       *  Store the dof-indices and related data of
+       *  the cells on the current level corresponding to this object.
        */
-      internal::hp::DoFObjects<1> dof_object;
+      internal::hp::DoFObjects<dim> dof_object;
 
       /**
        * Determine an estimate for the
@@ -178,60 +137,6 @@ namespace internal
        */
       std::size_t memory_consumption () const;
     };
-
-
-    /**
-     * Store the indices of the degrees of freedom which are located on
-     * quads. See the general template DoFLevel for more information.
-     *
-     * @ingroup hp
-     * @author Wolfgang Bangerth, 1998, 2006, Oliver Kayser-Herold 2003.
-     */
-    template <>
-    class DoFLevel<2> : public DoFLevel<0>
-    {
-    public:
-      /**
-       *  store the dof-indices and related functions of
-       *  quads
-       */
-      internal::hp::DoFObjects<2> dof_object;
-
-      /**
-       * Determine an estimate for the
-       * memory consumption (in bytes)
-       * of this object.
-       */
-      std::size_t memory_consumption () const;
-    };
-
-
-
-    /**
-     * Store the indices of the degrees of freedom which are located on
-     * hexhedra. See the general template DoFLevel for more information.
-     *
-     * @ingroup hp
-     * @author Wolfgang Bangerth, 1998, 2006, Oliver Kayser-Herold 2003.
-     */
-    template <>
-    class DoFLevel<3> : public DoFLevel<0>
-    {
-    public:
-      /**
-       *  store the dof-indices and related functions of
-       *  hexes
-       */
-      internal::hp::DoFObjects<3> dof_object;
-
-      /**
-       * Determine an estimate for the
-       * memory consumption (in bytes)
-       * of this object.
-       */
-      std::size_t memory_consumption () const;
-    };
-
   } // namespace hp
 
 } // namespace internal
index 0b4b865540e5cc5c2fccc76ea9250f35c066e5a3..b05e51e69593e0431d6c48850d092ea75820f5b4 100644 (file)
@@ -3119,7 +3119,7 @@ namespace hp
   {
     create_active_fe_table ();
 
-    // Remember if the cells have already
+    // Remember if the cells already have
     // children. That will make the transfer
     // of the active_fe_index to the finer
     // levels easier.
@@ -3148,7 +3148,7 @@ namespace hp
   {
     create_active_fe_table ();
 
-    // Remember if the cells have already
+    // Remember if the cells already have
     // children. That will make the transfer
     // of the active_fe_index to the finer
     // levels easier.
@@ -3309,11 +3309,6 @@ namespace hp
          children_level != has_children.end ();
          ++children_level)
       delete (*children_level);
-    /*
-      for_each (has_children.begin (),
-      has_children.end (),
-      delete());
-    */
     has_children.clear ();
   }
 
index 6ee1b772fd3abff72fb0d22a8d58d3f5af71388a..ff5dc868b1d44b1825c77c50bbfcec099e7e105c 100644 (file)
@@ -23,40 +23,19 @@ namespace internal
 {
   namespace hp
   {
-
-    std::size_t
-    DoFLevel<1>::memory_consumption () const
-    {
-      return (DoFLevel<0>::memory_consumption() +
-              MemoryConsumption::memory_consumption (dof_object));
-    }
-
-
-
-    std::size_t
-    DoFLevel<2>::memory_consumption () const
-    {
-      return (DoFLevel<0>::memory_consumption () +
-              MemoryConsumption::memory_consumption (dof_object));
-    }
-
-
-
+    template <int dim>
     std::size_t
-    DoFLevel<3>::memory_consumption () const
+    DoFLevel<dim>::memory_consumption () const
     {
-      return (DoFLevel<0>::memory_consumption () +
-              MemoryConsumption::memory_consumption (dof_object));
+      return MemoryConsumption::memory_consumption (active_fe_indices) +
+             MemoryConsumption::memory_consumption (dof_object);
     }
 
 
-
-    std::size_t
-    DoFLevel<0>::memory_consumption () const
-    {
-      return MemoryConsumption::memory_consumption (active_fe_indices);
-    }
-
+    // explicit instantiations
+    template std::size_t DoFLevel<1>::memory_consumption () const;
+    template std::size_t DoFLevel<2>::memory_consumption () const;
+    template std::size_t DoFLevel<3>::memory_consumption () const;
   }
 }
 

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.