From 873748f2b9268ccc577e3885234bb8343d5a1be8 Mon Sep 17 00:00:00 2001 From: David Wells Date: Sun, 22 Nov 2015 19:41:27 -0500 Subject: [PATCH] Prefer DoFHandlerType to DH. --- doc/doxygen/headers/iterators.h | 8 +- .../deal.II/distributed/solution_transfer.h | 6 +- include/deal.II/dofs/dof_accessor.h | 212 +++--- include/deal.II/dofs/dof_accessor.templates.h | 619 +++++++++--------- include/deal.II/dofs/dof_iterator_selector.h | 24 +- include/deal.II/dofs/dof_renumbering.h | 248 +++---- include/deal.II/dofs/dof_tools.h | 300 ++++----- include/deal.II/fe/fe_tools.h | 34 +- include/deal.II/fe/fe_values.h | 16 +- include/deal.II/fe/mapping_fe_field.h | 16 +- include/deal.II/hp/fe_values.h | 36 +- include/deal.II/matrix_free/fe_evaluation.h | 8 +- include/deal.II/matrix_free/matrix_free.h | 68 +- include/deal.II/multigrid/mg_tools.h | 10 +- include/deal.II/multigrid/mg_transfer.h | 16 +- .../multigrid/sparse_matrix_collection.h | 8 +- include/deal.II/numerics/data_out.h | 25 +- include/deal.II/numerics/data_out_dof_data.h | 90 +-- include/deal.II/numerics/data_out_faces.h | 14 +- include/deal.II/numerics/data_out_rotation.h | 12 +- include/deal.II/numerics/data_out_stack.h | 6 +- .../numerics/derivative_approximation.h | 80 +-- include/deal.II/numerics/error_estimator.h | 400 +++++------ .../numerics/error_estimator.templates.h | 401 ++++++------ include/deal.II/numerics/fe_field_function.h | 29 +- .../numerics/fe_field_function.templates.h | 140 ++-- include/deal.II/numerics/solution_transfer.h | 7 +- include/deal.II/numerics/vector_tools.h | 254 +++---- .../deal.II/numerics/vector_tools.templates.h | 491 +++++++------- source/distributed/solution_transfer.cc | 66 +- source/dofs/dof_accessor.cc | 26 +- source/dofs/dof_accessor_get.cc | 12 +- source/dofs/dof_accessor_set.cc | 12 +- source/dofs/dof_renumbering.cc | 347 +++++----- source/dofs/dof_tools.cc | 473 +++++++------ source/dofs/dof_tools_constraints.cc | 124 ++-- source/dofs/dof_tools_sparsity.cc | 146 +++-- source/fe/fe_tools_interpolate.cc | 46 +- source/fe/fe_values.cc | 33 +- source/fe/mapping_fe_field.cc | 193 +++--- source/hp/fe_values.cc | 12 +- source/multigrid/mg_tools.cc | 28 +- source/numerics/data_out.cc | 105 +-- source/numerics/data_out_dof_data.cc | 344 +++++----- source/numerics/data_out_faces.cc | 34 +- source/numerics/data_out_rotation.cc | 24 +- source/numerics/data_out_stack.cc | 68 +- source/numerics/derivative_approximation.cc | 142 ++-- source/numerics/error_estimator_1d.cc | 164 ++--- source/numerics/matrix_tools.cc | 20 +- source/numerics/solution_transfer.cc | 73 ++- tests/arpack/step-36_parpack.cc | 4 +- tests/arpack/step-36_parpack_trilinos.cc | 4 +- tests/bits/data_out_08.cc | 2 +- tests/dofs/accessor_01.cc | 8 +- tests/dofs/accessor_02.cc | 8 +- tests/mpi/derivative_approximation_01.cc | 2 +- tests/numerics/no_flux_08.cc | 2 +- tests/numerics/no_flux_12.cc | 2 +- 59 files changed, 3144 insertions(+), 2958 deletions(-) diff --git a/doc/doxygen/headers/iterators.h b/doc/doxygen/headers/iterators.h index d8a27561e3..d6a0d6e25a 100644 --- a/doc/doxygen/headers/iterators.h +++ b/doc/doxygen/headers/iterators.h @@ -1,6 +1,6 @@ // --------------------------------------------------------------------- // -// Copyright (C) 2013, 2014 by the deal.II authors +// Copyright (C) 2013, 2015 by the deal.II authors // // This file is part of the deal.II library. // @@ -397,9 +397,9 @@ stated in the internal::Triangulation::Iterators<3,spacedim> classes for Triangulation iterators, -- internal::DoFHandler::Iterators >, - internal::DoFHandler::Iterators >, and - internal::DoFHandler::Iterators > classes for DoFHandler +- internal::DoFHandler::Iterators >, + internal::DoFHandler::Iterators >, and + internal::DoFHandler::Iterators > classes for DoFHandler and hp::DoFHandler iterators, diff --git a/include/deal.II/distributed/solution_transfer.h b/include/deal.II/distributed/solution_transfer.h index 407fab5483..c87db10408 100644 --- a/include/deal.II/distributed/solution_transfer.h +++ b/include/deal.II/distributed/solution_transfer.h @@ -112,14 +112,14 @@ namespace parallel * @ingroup distributed * @author Timo Heister, 2009-2011 */ - template > + template > class SolutionTransfer { public: /** * Constructor, takes the current DoFHandler as argument. */ - SolutionTransfer(const DH &dof); + SolutionTransfer(const DoFHandlerType &dof); /** * Destructor. */ @@ -200,7 +200,7 @@ namespace parallel /** * Pointer to the degree of freedom handler to work with. */ - SmartPointer > dof_handler; + SmartPointer > dof_handler; /** * A vector that stores pointers to all the vectors we are supposed to diff --git a/include/deal.II/dofs/dof_accessor.h b/include/deal.II/dofs/dof_accessor.h index 07ed50a94b..a4acb25b5d 100644 --- a/include/deal.II/dofs/dof_accessor.h +++ b/include/deal.II/dofs/dof_accessor.h @@ -181,8 +181,8 @@ namespace internal * @author Wolfgang Bangerth, 1998, 2006, 2008, Timo Heister, Guido Kanschat, * 2012, 2013 */ -template -class DoFAccessor : public dealii::internal::DoFAccessor::Inheritance::BaseClass +template +class DoFAccessor : public dealii::internal::DoFAccessor::Inheritance::BaseClass { public: @@ -190,13 +190,13 @@ public: * A static variable that allows users of this class to discover the value * of the second template argument. */ - static const unsigned int dimension=DH::dimension; + static const unsigned int dimension=DoFHandlerType::dimension; /** * A static variable that allows users of this class to discover the value * of the third template argument. */ - static const unsigned int space_dimension=DH::space_dimension; + static const unsigned int space_dimension=DoFHandlerType::space_dimension; /** * Declare a typedef to the base class to make accessing some of the @@ -209,7 +209,7 @@ public: /** * Data type passed by the iterator class. */ - typedef DH AccessorData; + typedef DoFHandlerType AccessorData; /** * @name Constructors @@ -226,10 +226,10 @@ public: /** * Constructor */ - DoFAccessor (const Triangulation *tria, - const int level, - const int index, - const DH *local_data); + DoFAccessor (const Triangulation *tria, + const int level, + const int index, + const DoFHandlerType *local_data); /** * Conversion constructor. This constructor exists to make certain @@ -250,14 +250,14 @@ public: * Another conversion operator between objects that don't make sense, just * like the previous one. */ - template - DoFAccessor (const DoFAccessor &); + template + DoFAccessor (const DoFAccessor &); /** * Copy constructor allowing to switch level access and active access. */ template - DoFAccessor(const DoFAccessor &); + DoFAccessor(const DoFAccessor &); /** * @} */ @@ -265,20 +265,20 @@ public: /** * Return a handle on the DoFHandler object which we are using. */ - const DH & + const DoFHandlerType & get_dof_handler () const; /** * Implement the copy operator needed for the iterator classes. */ template - void copy_from (const DoFAccessor &a); + void copy_from (const DoFAccessor &a); /** * Copy operator used by the iterator class. Keeps the previously set dof * handler, but sets the object coordinates of the TriaAccessor. */ - void copy_from (const TriaAccessorBase &da); + void copy_from (const TriaAccessorBase &da); /** * Tell the caller whether get_active_or_mg_dof_indices() accesses active or @@ -296,7 +296,7 @@ public: /** * Return an iterator pointing to the @p c-th child. */ - TriaIterator > + TriaIterator > child (const unsigned int c) const; /** @@ -304,7 +304,7 @@ public: * a line itself, then the only valid index is @p i equals to zero, and the * function returns an iterator to itself. */ - typename dealii::internal::DoFHandler::Iterators::line_iterator + typename dealii::internal::DoFHandler::Iterators::line_iterator line (const unsigned int i) const; /** @@ -312,7 +312,7 @@ public: * a quad itself, then the only valid index is @p i equals to zero, and the * function returns an iterator to itself. */ - typename dealii::internal::DoFHandler::Iterators::quad_iterator + typename dealii::internal::DoFHandler::Iterators::quad_iterator quad (const unsigned int i) const; /** @@ -361,7 +361,7 @@ public: * */ void get_dof_indices (std::vector &dof_indices, - const unsigned int fe_index = DH::default_fe_index) const; + const unsigned int fe_index = DoFHandlerType::default_fe_index) const; /** * Return the global multilevel indices of the degrees of freedom that live @@ -371,14 +371,14 @@ public: */ void get_mg_dof_indices (const int level, std::vector &dof_indices, - const unsigned int fe_index = DH::default_fe_index) const; + const unsigned int fe_index = DoFHandlerType::default_fe_index) const; /** * Sets the level DoF indices that are returned by get_mg_dof_indices. */ void set_mg_dof_indices (const int level, const std::vector &dof_indices, - const unsigned int fe_index = DH::default_fe_index); + const unsigned int fe_index = DoFHandlerType::default_fe_index); /** * Global DoF index of the i degree associated with the @p vertexth @@ -397,19 +397,21 @@ public: * a cell object, there can only be a single set of degrees of freedom, and * fe_index has to match the result of active_fe_index(). */ - types::global_dof_index vertex_dof_index (const unsigned int vertex, - const unsigned int i, - const unsigned int fe_index = DH::default_fe_index) const; + types::global_dof_index vertex_dof_index + (const unsigned int vertex, + const unsigned int i, + const unsigned int fe_index = DoFHandlerType::default_fe_index) const; /** * Returns the global DoF index of the ith degree of freedom * associated with the vertexth vertex on level @p level. Also * see vertex_dof_index(). */ - types::global_dof_index mg_vertex_dof_index (const int level, - const unsigned int vertex, - const unsigned int i, - const unsigned int fe_index = DH::default_fe_index) const; + types::global_dof_index mg_vertex_dof_index + (const int level, + const unsigned int vertex, + const unsigned int i, + const unsigned int fe_index = DoFHandlerType::default_fe_index) const; /** * Index of the ith degree of freedom of this object. @@ -438,8 +440,9 @@ public: * produce an exception because no degrees are defined in the interior of * the face. */ - types::global_dof_index dof_index (const unsigned int i, - const unsigned int fe_index = DH::default_fe_index) const; + types::global_dof_index dof_index + (const unsigned int i, + const unsigned int fe_index = DoFHandlerType::default_fe_index) const; /** * Returns the dof_index on the given level. Also see dof_index. @@ -496,7 +499,7 @@ public: * given @p fe_index. @p fe_index must be used on this object, i.e. * fe_index_is_active(fe_index) must return true. */ - const FiniteElement & + const FiniteElement & get_fe (const unsigned int fe_index) const; /** @@ -547,7 +550,7 @@ protected: /** * Store the address of the DoFHandler object to be accessed. */ - DH *dof_handler; + DoFHandlerType *dof_handler; public: /** * Compare for equality. Return true if the two accessors refer to @@ -562,19 +565,19 @@ public: * an iterator with level access can be equal to one with access to the * active degrees of freedom. */ - template - bool operator == (const DoFAccessor &) const; + template + bool operator == (const DoFAccessor &) const; /** * Compare for inequality. The boolean not of operator==(). */ - template - bool operator != (const DoFAccessor &) const; + template + bool operator != (const DoFAccessor &) const; protected: /** * Reset the DoF handler pointer. */ - void set_dof_handler (DH *dh); + void set_dof_handler (DoFHandlerType *dh); /** * Set the index of the ith degree of freedom of this object to @p @@ -593,9 +596,10 @@ protected: * a cell object, there can only be a single set of degrees of freedom, and * fe_index has to match the result of active_fe_index(). */ - void set_dof_index (const unsigned int i, - const types::global_dof_index index, - const unsigned int fe_index = DH::default_fe_index) const; + void set_dof_index + (const unsigned int i, + const types::global_dof_index index, + const unsigned int fe_index = DoFHandlerType::default_fe_index) const; void set_mg_dof_index (const int level, const unsigned int i, const types::global_dof_index index) const; @@ -616,12 +620,18 @@ protected: * a cell object, there can only be a single set of degrees of freedom, and * fe_index has to match the result of active_fe_index(). */ - void set_vertex_dof_index (const unsigned int vertex, - const unsigned int i, - const types::global_dof_index index, - const unsigned int fe_index = DH::default_fe_index) const; + void set_vertex_dof_index + (const unsigned int vertex, + const unsigned int i, + const types::global_dof_index index, + const unsigned int fe_index = DoFHandlerType::default_fe_index) const; - void set_mg_vertex_dof_index (const int level, const unsigned int vertex, const unsigned int i, const types::global_dof_index index, const unsigned int fe_index = DH::default_fe_index) const; + void set_mg_vertex_dof_index + (const int level, + const unsigned int vertex, + const unsigned int i, + const types::global_dof_index index, + const unsigned int fe_index = DoFHandlerType::default_fe_index) const; /** * Iterator classes need to be friends because they need to access @@ -641,8 +651,8 @@ private: * Furthermore it is not implemented and will give a linker error if used * anyway. */ - DoFAccessor & - operator = (const DoFAccessor &da); + DoFAccessor & + operator = (const DoFAccessor &da); /** * Make the DoFHandler class a friend so that it can call the set_xxx() @@ -669,8 +679,8 @@ private: * * @author Wolfgang Bangerth, 2010 */ -template