From: bangerth Date: Wed, 28 Aug 2013 04:18:10 +0000 (+0000) Subject: Minor cleanups in the various hp-related classes. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=680e0bb2589b5cd14070e3ca622459545479132a;p=dealii-svn.git Minor cleanups in the various hp-related classes. git-svn-id: https://svn.dealii.org/trunk@30512 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/hp/dof_handler.h b/deal.II/include/deal.II/hp/dof_handler.h index 1baba27526..d4ff6b16f7 100644 --- a/deal.II/include/deal.II/hp/dof_handler.h +++ b/deal.II/include/deal.II/hp/dof_handler.h @@ -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 * levels[] tree of * the Triangulation objects. */ - std::vector*> levels; + std::vector*> 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 vertex_dofs; + std::vector 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 diff --git a/deal.II/include/deal.II/hp/dof_levels.h b/deal.II/include/deal.II/hp/dof_levels.h index 9bc69d2143..19d9f7e33d 100644 --- a/deal.II/include/deal.II/hp/dof_levels.h +++ b/deal.II/include/deal.II/hp/dof_levels.h @@ -29,22 +29,21 @@ namespace internal { namespace hp { + template + 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. * * *

Offset computations

@@ -105,35 +104,14 @@ namespace internal * @ingroup hp * @author Wolfgang Bangerth, 1998, 2006, Oliver Kayser-Herold 2003. */ - template + template 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 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 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 diff --git a/deal.II/source/hp/dof_handler.cc b/deal.II/source/hp/dof_handler.cc index 0b4b865540..b05e51e695 100644 --- a/deal.II/source/hp/dof_handler.cc +++ b/deal.II/source/hp/dof_handler.cc @@ -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 (); } diff --git a/deal.II/source/hp/dof_levels.cc b/deal.II/source/hp/dof_levels.cc index 6ee1b772fd..ff5dc868b1 100644 --- a/deal.II/source/hp/dof_levels.cc +++ b/deal.II/source/hp/dof_levels.cc @@ -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 std::size_t - DoFLevel<3>::memory_consumption () const + DoFLevel::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; } }