From 93d80d55e2a4b827eeaf3fa6fbe6dec13b50586e Mon Sep 17 00:00:00 2001 From: Marc Fehling Date: Thu, 29 Oct 2020 18:30:34 -0600 Subject: [PATCH] Hide hp_capability_enabled parameter. --- examples/step-27/doc/intro.dox | 14 +- examples/step-27/step-27.cc | 25 ++- examples/step-46/doc/intro.dox | 27 ++-- examples/step-46/step-46.cc | 12 +- include/deal.II/dofs/dof_handler.h | 37 +++-- .../matrix_free/matrix_free.templates.h | 2 +- .../vector_tools_point_gradient.templates.h | 4 +- .../vector_tools_point_value.templates.h | 8 +- source/distributed/solution_transfer.cc | 6 +- source/dofs/block_info.cc | 4 +- source/dofs/dof_handler.cc | 151 +++++++++--------- source/dofs/dof_tools.cc | 2 +- source/dofs/dof_tools_constraints.cc | 8 +- source/dofs/dof_tools_sparsity.cc | 2 +- source/hp/dof_handler.cc | 4 +- source/numerics/solution_transfer.cc | 2 +- tests/grid/accessor_04.cc | 2 +- .../solution_transfer_06.cc} | 2 +- ...ansfer_06.with_p4est=true.mpirun=1.output} | 0 tests/multigrid/mg_level_object_args_01.cc | 4 +- 20 files changed, 161 insertions(+), 155 deletions(-) rename tests/{hp/distributed_solution_transfer_01.cc => mpi/solution_transfer_06.cc} (98%) rename tests/{hp/distributed_solution_transfer_01.mpirun=1.output => mpi/solution_transfer_06.with_p4est=true.mpirun=1.output} (100%) diff --git a/examples/step-27/doc/intro.dox b/examples/step-27/doc/intro.dox index 150654dbbf..c28a7f1463 100644 --- a/examples/step-27/doc/intro.dox +++ b/examples/step-27/doc/intro.dox @@ -118,7 +118,7 @@ used elements can then be created as follows: -

The hp::DoFHandler class, associating cells with finite elements, and constraints

+

The DoFHandler class in hp-mode, associating cells with finite elements, and constraints

The next task we have to consider is what to do with the list of finite element objects we want to use. In previous tutorial programs, @@ -134,11 +134,11 @@ elements on different cells. We therefore need two things: (i) a version of the DoFHandler class that can deal with this situation, and (ii) a way to tell the DoF handler which element to use on which cell. -The first of these two things is implemented in the hp::DoFHandler -class: rather than associating it with a triangulation and a single -finite element object, it is associated with a triangulation and a -finite element collection. The second part is achieved by a loop over -all cells of this hp::DoFHandler and for each cell setting the index +The first of these two things is implemented in the hp-mode of +the DoFHandler class: rather than associating it with a triangulation +and a single finite element object, it is associated with a triangulation +and a finite element collection. The second part is achieved by a loop +over all cells of this DoFHandler and for each cell setting the index of the finite element within the collection that shall be used on this cell. We call the index of the finite element object within the collection that shall be used on a cell the cell's active FE @@ -147,7 +147,7 @@ on this cell, whereas all the other elements of the collection are inactive on it. The general outline of this reads like this: @code - hp::DoFHandler dof_handler(triangulation); + DoFHandler dof_handler(triangulation); for (auto &cell: dof_handler.active_cell_iterators()) cell->set_active_fe_index(...); dof_handler.distribute_dofs(fe_collection); diff --git a/examples/step-27/step-27.cc b/examples/step-27/step-27.cc index 911b8f23e7..f01c7d8e53 100644 --- a/examples/step-27/step-27.cc +++ b/examples/step-27/step-27.cc @@ -47,11 +47,11 @@ #include #include -// These are the new files we need. The first and second provide hp -// versions of the DoFHandler and FEValues classes as described in the -// introduction of this program. The last one provides Fourier transformation -// class on the unit cell. -#include +// These are the new files we need. The first and second provide the +// FECollection and the hp version of the FEValues class as described in +// the introduction of this program. The last one provides Fourier +// transformation class on the unit cell. +#include #include #include @@ -79,8 +79,7 @@ namespace Step27 // computes this estimated smoothness, as discussed in the introduction. // // As far as member variables are concerned, we use the same structure as - // already used in step-6, but instead of a regular DoFHandler we use an - // object of type hp::DoFHandler, and we need collections instead of + // already used in step-6, but we need collections instead of // individual finite element, quadrature, and face quadrature objects. We // will fill these collections in the constructor of the class. The last // variable, max_degree, indicates the maximal polynomial @@ -158,7 +157,7 @@ namespace Step27 // @sect4{LaplaceProblem::LaplaceProblem constructor} // The constructor of this class is fairly straightforward. It associates - // the hp::DoFHandler object with the triangulation, and then sets the + // the DoFHandler object with the triangulation, and then sets the // maximal polynomial degree to 7 (in 1d and 2d) or 5 (in 3d and higher). We // do so because using higher order polynomial degrees becomes prohibitively // expensive, especially in higher space dimensions. @@ -186,7 +185,7 @@ namespace Step27 template LaplaceProblem::LaplaceProblem() - : dof_handler(triangulation, /*enable_hp_capability */ true) + : dof_handler(triangulation) , max_degree(dim <= 2 ? 7 : 5) { for (unsigned int degree = 2; degree <= max_degree; ++degree) @@ -442,12 +441,8 @@ namespace Step27 // With now all data vectors available -- solution, estimated errors and // smoothness indicators, and finite element degrees --, we create a - // DataOut object for graphical output and attach all data. Note that - // the DataOut class has a second template argument (which defaults to - // DoFHandler@, which is why we have never seen it in previous - // tutorial programs) that indicates the type of DoF handler to be - // used. Here, we have to use the hp::DoFHandler class: - DataOut> data_out; + // DataOut object for graphical output and attach all data: + DataOut data_out; data_out.attach_dof_handler(dof_handler); data_out.add_data_vector(solution, "solution"); diff --git a/examples/step-46/doc/intro.dox b/examples/step-46/doc/intro.dox index 95b93a515a..ce6e9af3b8 100644 --- a/examples/step-46/doc/intro.dox +++ b/examples/step-46/doc/intro.dox @@ -251,7 +251,7 @@ is exactly what we are going to do here: we are going to (ab)use the classes and facilities of the hp namespace to assign different elements to different cells. In other words, we will use collect the two finite elements in an hp::FECollection, will integrate with an appropriate hp::QCollection using an -hp::FEValues object, and our DoF handler will be of type hp::DoFHandler. You +hp::FEValues object, and our DoFHandler will be in hp-mode. You may wish to take a look at step-27 for an overview of all of these concepts. Before going on describing the testcase, let us clarify a bit why this @@ -580,15 +580,16 @@ alternative: we define an enum with symbolic names for material_id numbers and will use them to identify which part of the domain a cell is on. -Secondly, we use an object of type hp::DoFHandler. This class needs to know -which cells will use the Stokes and which the elasticity finite element. At -the beginning of each refinement cycle we will therefore have to walk over -all cells and set the (in hp parlance) active FE index to whatever is -appropriate in the current situation. While we can use symbolic names for the -material id, the active FE index is in fact a number that will frequently be -used to index into collections of objects (e.g. of type hp::FECollection and -hp::QCollection); that means that the active FE index actually has to have -value zero for the fluid and one for the elastic part of the domain. +Secondly, we use an object of type DoFHandler operating in hp-mode. This +class needs to know which cells will use the Stokes and which the elasticity +finite element. At the beginning of each refinement cycle we will therefore +have to walk over all cells and set the (in hp parlance) active FE index to +whatever is appropriate in the current situation. While we can use symbolic +names for the material id, the active FE index is in fact a number that will +frequently be used to index into collections of objects (e.g. of type +hp::FECollection and hp::QCollection); that means that the active FE index +actually has to have value zero for the fluid and one for the elastic part of +the domain.

Linear solvers

@@ -656,9 +657,9 @@ the jump in the solution's gradient around the faces of each cell. This jump is likely to be very large at the locations where the solution is discontinuous and extended by zero; it also doesn't become smaller as the mesh is refined. The KellyErrorEstimator class can't just ignore the interface -because it essentially only sees an hp::DoFHandler where the element type -changes from one cell to another — precisely the thing that the -hp::DoFHandler was designed for, the interface in the current program looks no +because it essentially only sees a DoFHandler in hp-mode where the element +type changes from one cell to another — precisely the thing that the +hp-mode was designed for, the interface in the current program looks no different than the interfaces in step-27, for example, and certainly no less legitimate. Be that as it may, the end results is that there is a layer of cells on both sides of the interface between the two subdomains where error diff --git a/examples/step-46/step-46.cc b/examples/step-46/step-46.cc index 05c1d0118a..f33a9890c4 100644 --- a/examples/step-46/step-46.cc +++ b/examples/step-46/step-46.cc @@ -50,7 +50,6 @@ #include #include -#include #include #include @@ -70,7 +69,7 @@ namespace Step46 // This is the main class. It is, if you want, a combination of step-8 and // step-22 in that it has member variables that either address the global - // problem (the Triangulation and hp::DoFHandler objects, as well as the + // problem (the Triangulation and DoFHandler objects, as well as the // hp::FECollection and various linear algebra objects) or that pertain to // either the elasticity or Stokes sub-problems. The general structure of // the class, however, is like that of most of the other programs @@ -236,7 +235,7 @@ namespace Step46 1, FE_Q(elasticity_degree), dim) - , dof_handler(triangulation, /*enable_hp_capability */ true) + , dof_handler(triangulation) , viscosity(2) , lambda(1) , mu(1) @@ -840,8 +839,7 @@ namespace Step46 // Generating graphical output is rather trivial here: all we have to do is // identify which components of the solution vector belong to scalars and/or // vectors (see, for example, step-22 for a previous example), and then pass - // it all on to the DataOut class (with the second template argument equal - // to hp::DoFHandler instead of the usual default DoFHandler): + // it all on to the DataOut class: template void FluidStructureProblem::output_results( const unsigned int refinement_cycle) const @@ -860,12 +858,12 @@ namespace Step46 data_component_interpretation.push_back( DataComponentInterpretation::component_is_part_of_vector); - DataOut> data_out; + DataOut data_out; data_out.attach_dof_handler(dof_handler); data_out.add_data_vector(solution, solution_names, - DataOut>::type_dof_data, + DataOut::type_dof_data, data_component_interpretation); data_out.build_patches(); diff --git a/include/deal.II/dofs/dof_handler.h b/include/deal.II/dofs/dof_handler.h index f727ef1e27..6cb329aa62 100644 --- a/include/deal.II/dofs/dof_handler.h +++ b/include/deal.II/dofs/dof_handler.h @@ -418,12 +418,6 @@ public: */ static const unsigned int space_dimension = spacedim; - /** - * Boolean indicating whether or not the current DoFHander has hp - * capabilities. - */ - const bool hp_capability_enabled; - /** * The default index of the finite element to be used on a given cell. */ @@ -456,13 +450,12 @@ public: * object with this constructor, use initialize() to make a valid * DoFHandler. */ - DoFHandler(const bool hp_capability_enabled = false); + DoFHandler(); /** * Constructor. Take @p tria as the triangulation to work on. */ - DoFHandler(const Triangulation &tria, - const bool hp_capability_enabled = false); + DoFHandler(const Triangulation &tria); /** * Copy constructor. DoFHandler objects are large and expensive. @@ -592,6 +585,12 @@ public: void distribute_mg_dofs(); + /** + * Returns whether this DoFHandler has hp capabilities. + */ + bool + has_hp_capabilities() const; + /** * This function returns whether this DoFHandler has DoFs distributed on * each multigrid level or in other words if distribute_mg_dofs() has been @@ -1408,6 +1407,12 @@ private: */ BlockInfo block_info_object; + /** + * Boolean indicating whether or not the current DoFHandler has hp + * capabilities. + */ + bool hp_capability_enabled; + /** * Address of the triangulation to work on. */ @@ -1575,10 +1580,11 @@ private: setup_policy(); /** - * Setup DoFHandler policy and listeners (in the hp-context). + * Setup connections to refinement signals of the underlying triangulation. + * Necessary for the hp-mode. */ void - setup_policy_and_listeners(); + connect_to_triangulation_signals(); /** * Create default tables for the active_fe_indices. @@ -1698,6 +1704,15 @@ private: */ +template +inline bool +DoFHandler::has_hp_capabilities() const +{ + return hp_capability_enabled; +} + + + template inline bool DoFHandler::has_level_dofs() const diff --git a/include/deal.II/matrix_free/matrix_free.templates.h b/include/deal.II/matrix_free/matrix_free.templates.h index 95a08c5d8e..86b8cdff40 100644 --- a/include/deal.II/matrix_free/matrix_free.templates.h +++ b/include/deal.II/matrix_free/matrix_free.templates.h @@ -427,7 +427,7 @@ MatrixFree::internal_reinit( dof_handler[0]->get_triangulation(), cell_level_index, face_info, - dof_handler[0]->hp_capability_enabled ? + dof_handler[0]->has_hp_capabilities() ? dof_info[0].cell_active_fe_index : std::vector(), mapping, diff --git a/include/deal.II/numerics/vector_tools_point_gradient.templates.h b/include/deal.II/numerics/vector_tools_point_gradient.templates.h index fd849ee71f..f9e373ed1b 100644 --- a/include/deal.II/numerics/vector_tools_point_gradient.templates.h +++ b/include/deal.II/numerics/vector_tools_point_gradient.templates.h @@ -48,7 +48,7 @@ namespace VectorTools std::vector> &gradients) { - if (dof.hp_capability_enabled == false) + if (dof.has_hp_capabilities() == false) point_gradient(StaticMappingQ1::mapping, dof, fe_function, @@ -69,7 +69,7 @@ namespace VectorTools const VectorType & fe_function, const Point & point) { - if (dof.hp_capability_enabled == false) + if (dof.has_hp_capabilities() == false) return point_gradient(StaticMappingQ1::mapping, dof, fe_function, diff --git a/include/deal.II/numerics/vector_tools_point_value.templates.h b/include/deal.II/numerics/vector_tools_point_value.templates.h index 5c4da1c075..7ed44a6b4e 100644 --- a/include/deal.II/numerics/vector_tools_point_value.templates.h +++ b/include/deal.II/numerics/vector_tools_point_value.templates.h @@ -47,7 +47,7 @@ namespace VectorTools const Point & point, Vector &value) { - if (dof.hp_capability_enabled == false) + if (dof.has_hp_capabilities() == false) point_value(StaticMappingQ1::mapping, dof, fe_function, @@ -68,7 +68,7 @@ namespace VectorTools const VectorType & fe_function, const Point & point) { - if (dof.hp_capability_enabled == false) + if (dof.has_hp_capabilities() == false) return point_value(StaticMappingQ1::mapping, dof, fe_function, @@ -316,7 +316,7 @@ namespace VectorTools const Point & p, Vector & rhs_vector) { - if (dof_handler.hp_capability_enabled) + if (dof_handler.has_hp_capabilities()) create_point_source_vector(hp::StaticMappingQ1::mapping_collection, dof_handler, p, @@ -420,7 +420,7 @@ namespace VectorTools const Point & orientation, Vector & rhs_vector) { - if (dof_handler.hp_capability_enabled) + if (dof_handler.has_hp_capabilities()) create_point_source_vector(hp::StaticMappingQ1::mapping_collection, dof_handler, p, diff --git a/source/distributed/solution_transfer.cc b/source/distributed/solution_transfer.cc index c1862d0126..b255be2780 100644 --- a/source/distributed/solution_transfer.cc +++ b/source/distributed/solution_transfer.cc @@ -161,7 +161,7 @@ namespace parallel cell_iterator &cell_, const typename Triangulation:: CellStatus status) { return this->pack_callback(cell_, status); }, - /*returns_variable_size_data=*/dof_handler->hp_capability_enabled); + /*returns_variable_size_data=*/dof_handler->has_hp_capabilities()); } @@ -289,7 +289,7 @@ namespace parallel input_vectors.size()); unsigned int fe_index = 0; - if (dof_handler->hp_capability_enabled) + if (dof_handler->has_hp_capabilities()) { switch (status) { @@ -363,7 +363,7 @@ namespace parallel typename DoFHandlerType::cell_iterator cell(*cell_, dof_handler); unsigned int fe_index = 0; - if (dof_handler->hp_capability_enabled) + if (dof_handler->has_hp_capabilities()) { switch (status) { diff --git a/source/dofs/block_info.cc b/source/dofs/block_info.cc index b6617a2c51..841264442a 100644 --- a/source/dofs/block_info.cc +++ b/source/dofs/block_info.cc @@ -31,7 +31,7 @@ BlockInfo::initialize(const DoFHandler &dof, bool levels_only, bool active_only) { - Assert(dof.hp_capability_enabled == false, + Assert(dof.has_hp_capabilities() == false, (typename DoFHandler::ExcNotImplementedWithHP())); if (!levels_only && dof.has_active_dofs()) @@ -61,7 +61,7 @@ template void BlockInfo::initialize_local(const DoFHandler &dof) { - Assert(dof.hp_capability_enabled == false, + Assert(dof.has_hp_capabilities() == false, (typename DoFHandler::ExcNotImplementedWithHP())); const FiniteElement & fe = dof.get_fe(); diff --git a/source/dofs/dof_handler.cc b/source/dofs/dof_handler.cc index 9f75ec85c4..bf02ac40c6 100644 --- a/source/dofs/dof_handler.cc +++ b/source/dofs/dof_handler.cc @@ -1998,8 +1998,8 @@ namespace internal template -DoFHandler::DoFHandler(const bool hp_capability_enabled) - : hp_capability_enabled(hp_capability_enabled) +DoFHandler::DoFHandler() + : hp_capability_enabled(true) , tria(nullptr, typeid(*this).name()) , mg_faces(nullptr) {} @@ -2007,53 +2007,39 @@ DoFHandler::DoFHandler(const bool hp_capability_enabled) template -DoFHandler::DoFHandler(const Triangulation &tria, - const bool hp_capability_enabled) - : hp_capability_enabled(hp_capability_enabled) +DoFHandler::DoFHandler(const Triangulation &tria) + : hp_capability_enabled(true) , tria(&tria, typeid(*this).name()) , mg_faces(nullptr) { - if (hp_capability_enabled) - { - this->setup_policy_and_listeners(); - this->create_active_fe_table(); - } - else - { - this->setup_policy(); - } + this->setup_policy(); + + // provide all hp functionalities before finite elements are registered + this->connect_to_triangulation_signals(); + this->create_active_fe_table(); } + + template DoFHandler::~DoFHandler() { - if (hp_capability_enabled) - { - // unsubscribe as a listener to refinement of the underlying - // triangulation - for (auto &connection : this->tria_listeners) - connection.disconnect(); - this->tria_listeners.clear(); - - // ...and release allocated memory - // virtual functions called in constructors and destructors never use the - // override in a derived class - // for clarity be explicit on which function is called - DoFHandler::clear(); - } - else - { - // release allocated memory - // virtual functions called in constructors and destructors never use the - // override in a derived class - // for clarity be explicit on which function is called - DoFHandler::clear(); - - // also release the policy. this needs to happen before the - // current object disappears because the policy objects - // store references to the DoFhandler object they work on - this->policy.reset(); - } + // unsubscribe all attachments to refinement signals of the underlying + // triangulation + for (auto &connection : this->tria_listeners) + connection.disconnect(); + this->tria_listeners.clear(); + + // release allocated memory + // virtual functions called in constructors and destructors never use the + // override in a derived class + // for clarity be explicit on which function is called + DoFHandler::clear(); + + // also release the policy. this needs to happen before the + // current object disappears because the policy objects + // store references to the DoFhandler object they work on + this->policy.reset(); } @@ -2079,29 +2065,31 @@ DoFHandler::initialize(const Triangulation &tria, if (this->tria != &tria) { + // remove association with old triangulation for (auto &connection : this->tria_listeners) connection.disconnect(); this->tria_listeners.clear(); - - this->tria = &tria; - - this->setup_policy_and_listeners(); } - - this->create_active_fe_table(); - - this->distribute_dofs(fe); } else { - this->tria = &tria; // this->faces = nullptr; this->number_cache.n_global_dofs = 0; + } + if (this->tria != &tria) + { + // establish connection to new triangulation + this->tria = &tria; this->setup_policy(); - this->distribute_dofs(fe); + // start in hp-mode and let distribute_dofs toggle it if necessary + hp_capability_enabled = true; + this->connect_to_triangulation_signals(); + this->create_active_fe_table(); } + + this->distribute_dofs(fe); } @@ -2453,13 +2441,39 @@ DoFHandler::set_fe(const hp::FECollection &ff) // don't create a new object if the one we have is already appropriate if (this->fe_collection != ff) - this->fe_collection = hp::FECollection(ff); + { + this->fe_collection = hp::FECollection(ff); + + const bool contains_multiple_fes = (this->fe_collection.size() > 1); + + // disable hp-mode if only a single finite element has been registered + if (hp_capability_enabled && !contains_multiple_fes) + { + hp_capability_enabled = false; + + // unsubscribe connections to signals + for (auto &connection : this->tria_listeners) + connection.disconnect(); + this->tria_listeners.clear(); + + // release active and future finite element tables + this->hp_cell_active_fe_indices.clear(); + this->hp_cell_active_fe_indices.shrink_to_fit(); + this->hp_cell_future_fe_indices.clear(); + this->hp_cell_future_fe_indices.shrink_to_fit(); + } + + // re-enabling hp-mode is not permitted since the active and future fe + // tables are no longer available + AssertThrow( + hp_capability_enabled || !contains_multiple_fes, + ExcMessage( + "You cannot re-enable hp capabilities after you registered a single " + "finite element. Please create a new DoFHandler object instead.")); + } if (hp_capability_enabled) { - // ensure that the active_fe_indices vectors are initialized correctly - this->create_active_fe_table(); - // make sure every processor knows the active_fe_indices // on both its own cells and all ghost cells dealii::internal::hp::DoFHandlerImplementation::Implementation:: @@ -2492,16 +2506,14 @@ void DoFHandler::distribute_dofs( const hp::FECollection &ff) { + this->set_fe(ff); + if (hp_capability_enabled) { object_dof_indices.resize(this->tria->n_levels()); object_dof_ptr.resize(this->tria->n_levels()); cell_dof_cache_indices.resize(this->tria->n_levels()); cell_dof_cache_ptr.resize(this->tria->n_levels()); - hp_cell_active_fe_indices.resize(this->tria->n_levels()); - hp_cell_future_fe_indices.resize(this->tria->n_levels()); - // assign the fe_collection and initialize all active_fe_indices - this->set_fe(ff); // If an underlying shared::Tria allows artificial cells, // then save the current set of subdomain ids, and set @@ -2571,9 +2583,6 @@ DoFHandler::distribute_dofs( } else { - // first, assign the finite_element - this->set_fe(ff); - // delete all levels and set them up newly. note that we still have to // allocate space for all degrees of freedom on this mesh (including ghost // and cells that are entirely stored on different processors), though we @@ -2702,9 +2711,9 @@ DoFHandler::clear_space() if (hp_capability_enabled) { this->hp_cell_active_fe_indices.clear(); + this->hp_cell_active_fe_indices.shrink_to_fit(); this->hp_cell_future_fe_indices.clear(); - - object_dof_indices.clear(); + this->hp_cell_future_fe_indices.shrink_to_fit(); } else { @@ -3029,7 +3038,7 @@ DoFHandler::get_active_fe_indices( template void -DoFHandler::setup_policy_and_listeners() +DoFHandler::connect_to_triangulation_signals() { // connect functions to signals of the underlying triangulation this->tria_listeners.push_back(this->tria->signals.pre_refinement.connect( @@ -3046,10 +3055,6 @@ DoFHandler::setup_policy_and_listeners() const dealii::parallel::DistributedTriangulationBase *>( &this->get_triangulation())) { - this->policy = - std::make_unique>(*this); - // repartitioning signals this->tria_listeners.push_back( this->tria->signals.pre_distributed_repartition.connect([this]() { @@ -3081,10 +3086,6 @@ DoFHandler::setup_policy_and_listeners() const dealii::parallel::shared::Triangulation *>( &this->get_triangulation()) != nullptr) { - this->policy = - std::make_unique>(*this); - // partitioning signals this->tria_listeners.push_back( this->tria->signals.pre_partition.connect([this]() { @@ -3101,10 +3102,6 @@ DoFHandler::setup_policy_and_listeners() } else { - this->policy = std::make_unique< - internal::DoFHandlerImplementation::Policy::Sequential>( - *this); - // refinement signals this->tria_listeners.push_back(this->tria->signals.pre_refinement.connect( [this] { this->pre_active_fe_index_transfer(); })); diff --git a/source/dofs/dof_tools.cc b/source/dofs/dof_tools.cc index dc786b0ae0..2c88a6aa2f 100644 --- a/source/dofs/dof_tools.cc +++ b/source/dofs/dof_tools.cc @@ -2391,7 +2391,7 @@ namespace DoFTools const Table<2, Coupling> & table, std::vector> &tables_by_block) { - if (dof_handler.hp_capability_enabled == false) + if (dof_handler.has_hp_capabilities() == false) { const FiniteElement &fe = dof_handler.get_fe(); const unsigned int nb = fe.n_blocks(); diff --git a/source/dofs/dof_tools_constraints.cc b/source/dofs/dof_tools_constraints.cc index 06bc59730f..4f50b8db7c 100644 --- a/source/dofs/dof_tools_constraints.cc +++ b/source/dofs/dof_tools_constraints.cc @@ -464,7 +464,7 @@ namespace DoFTools unsigned int n_finite_elements(const DoFHandler &dof_handler) { - if (dof_handler.hp_capability_enabled == true) + if (dof_handler.has_hp_capabilities() == true) return dof_handler.get_fe_collection().size(); else return 1; @@ -1118,7 +1118,7 @@ namespace DoFTools std::set fe_ind_face_subface; fe_ind_face_subface.insert(cell->active_fe_index()); - if (dof_handler.hp_capability_enabled) + if (dof_handler.has_hp_capabilities()) for (unsigned int c = 0; c < cell->face(face)->number_of_children(); ++c) @@ -1260,7 +1260,7 @@ namespace DoFTools // // since this is something that can only happen for hp // dof handlers, add a check here... - Assert(dof_handler.hp_capability_enabled == true, + Assert(dof_handler.has_hp_capabilities() == true, ExcInternalError()); const dealii::hp::FECollection @@ -1481,7 +1481,7 @@ namespace DoFTools // Only if there is a neighbor with a different active_fe_index // and the same h-level, some action has to be taken. - if ((dof_handler.hp_capability_enabled) && + if ((dof_handler.has_hp_capabilities()) && !cell->face(face)->at_boundary() && (cell->neighbor(face)->active_fe_index() != cell->active_fe_index()) && diff --git a/source/dofs/dof_tools_sparsity.cc b/source/dofs/dof_tools_sparsity.cc index c61801583d..82b91388c5 100644 --- a/source/dofs/dof_tools_sparsity.cc +++ b/source/dofs/dof_tools_sparsity.cc @@ -783,7 +783,7 @@ namespace DoFTools bool(const typename DoFHandler::active_cell_iterator &, const unsigned int)> &face_has_flux_coupling) { - if (dof.hp_capability_enabled == false) + if (dof.has_hp_capabilities() == false) { const FiniteElement &fe = dof.get_fe(); diff --git a/source/hp/dof_handler.cc b/source/hp/dof_handler.cc index 139eee4df6..43ee32b005 100644 --- a/source/hp/dof_handler.cc +++ b/source/hp/dof_handler.cc @@ -21,7 +21,7 @@ namespace hp { template DoFHandler::DoFHandler() - : dealii::DoFHandler(true) + : dealii::DoFHandler() {} @@ -29,7 +29,7 @@ namespace hp template DoFHandler::DoFHandler( const Triangulation &tria) - : dealii::DoFHandler(tria, true) + : dealii::DoFHandler(tria) {} } // namespace hp diff --git a/source/numerics/solution_transfer.cc b/source/numerics/solution_transfer.cc index 4ea1fa8aa6..150af1711a 100644 --- a/source/numerics/solution_transfer.cc +++ b/source/numerics/solution_transfer.cc @@ -201,7 +201,7 @@ namespace internal extract_interpolation_matrices(const dealii::DoFHandler &dof, dealii::Table<2, FullMatrix> &matrices) { - if (dof.hp_capability_enabled == false) + if (dof.has_hp_capabilities() == false) return; const dealii::hp::FECollection &fe = dof.get_fe_collection(); diff --git a/tests/grid/accessor_04.cc b/tests/grid/accessor_04.cc index 578c2d953b..51b639b675 100644 --- a/tests/grid/accessor_04.cc +++ b/tests/grid/accessor_04.cc @@ -46,7 +46,7 @@ test() fes.push_back(FE_Q(1)); fes.push_back(FE_Q(2)); - DoFHandler dofh(tria, /*hp_capability_enabled=*/true); + DoFHandler dofh(tria); dofh.set_fe(fes); dofh.begin_active()->set_active_fe_index(1); diff --git a/tests/hp/distributed_solution_transfer_01.cc b/tests/mpi/solution_transfer_06.cc similarity index 98% rename from tests/hp/distributed_solution_transfer_01.cc rename to tests/mpi/solution_transfer_06.cc index bda8020149..2269b5ec88 100644 --- a/tests/hp/distributed_solution_transfer_01.cc +++ b/tests/mpi/solution_transfer_06.cc @@ -60,7 +60,7 @@ transfer(const MPI_Comm &comm) // create a DoFHandler on which we have both cells with FE_Q as well as // FE_Nothing - DoFHandler dof_handler(tria, true); + DoFHandler dof_handler(tria); dof_handler.begin(0)->child(0)->set_active_fe_index(1); IndexSet locally_relevant_dofs; diff --git a/tests/hp/distributed_solution_transfer_01.mpirun=1.output b/tests/mpi/solution_transfer_06.with_p4est=true.mpirun=1.output similarity index 100% rename from tests/hp/distributed_solution_transfer_01.mpirun=1.output rename to tests/mpi/solution_transfer_06.with_p4est=true.mpirun=1.output diff --git a/tests/multigrid/mg_level_object_args_01.cc b/tests/multigrid/mg_level_object_args_01.cc index 01b15b6ae8..541c634e01 100644 --- a/tests/multigrid/mg_level_object_args_01.cc +++ b/tests/multigrid/mg_level_object_args_01.cc @@ -33,9 +33,9 @@ main() Triangulation<2> tria; - MGLevelObject> dof_handlers(0, 3, tria, true); + MGLevelObject> dof_handlers(0, 3, tria); - dof_handlers.resize(0, 5, tria, true); + dof_handlers.resize(0, 5, tria); deallog << "OK!" << std::endl; } -- 2.39.5