]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Remove hp::DoFHandler::get_fe() 9734/head
authorPeter Munch <peterrmuench@gmail.com>
Wed, 25 Mar 2020 20:47:31 +0000 (21:47 +0100)
committerPeter Munch <peterrmuench@gmail.com>
Thu, 26 Mar 2020 23:51:03 +0000 (00:51 +0100)
14 files changed:
doc/news/changes/incompatibilities/20200326PeterMunch [new file with mode: 0644]
include/deal.II/hp/dof_handler.h
include/deal.II/matrix_free/matrix_free.templates.h
include/deal.II/numerics/data_out_dof_data.templates.h
include/deal.II/numerics/vector_tools.templates.h
tests/distributed_grids/hp_2d_dofhandler_01.cc
tests/dofs/dof_tools_12.cc
tests/hp/dof_renumbering_04.cc
tests/hp/dof_renumbering_05.cc
tests/hp/dof_renumbering_06.cc
tests/hp/n_active_fe_indices.cc
tests/hp/renumber_block_wise_02.cc
tests/hp/renumber_component_wise.cc
tests/hp/step-12.cc

diff --git a/doc/news/changes/incompatibilities/20200326PeterMunch b/doc/news/changes/incompatibilities/20200326PeterMunch
new file mode 100644 (file)
index 0000000..80a8834
--- /dev/null
@@ -0,0 +1,4 @@
+Removed: The deprecated method hp::DoFHandler::get_fe() has been removed. Please use
+hp::DoFHandler::get_fe_collection() instead.
+<br>
+(Peter Munch, 2020/03/26)
index badc4bdf1a44a845d3d9bef045c054a56f67e9bf..ce1e50f7007a1340cfb4729b92872440a4e4908f 100644 (file)
@@ -955,16 +955,6 @@ namespace hp
     DEAL_II_DEPRECATED const std::vector<IndexSet> &
                              locally_owned_mg_dofs_per_processor(const unsigned int level) const;
 
-    /**
-     * Return a constant reference to the set of finite element objects that
-     * are used by this @p DoFHandler.
-     *
-     * @deprecated Use get_fe_collection() instead.
-     */
-    DEAL_II_DEPRECATED
-    const hp::FECollection<dim, spacedim> &
-    get_fe() const;
-
     /**
      * Return a constant reference to the indexth finite element object that is
      * used by this @p DoFHandler.
@@ -1720,18 +1710,6 @@ namespace hp
 
 
 
-  template <int dim, int spacedim>
-  inline const hp::FECollection<dim, spacedim> &
-  DoFHandler<dim, spacedim>::get_fe() const
-  {
-    Assert(fe_collection.size() > 0,
-           ExcMessage("No finite element collection is associated with "
-                      "this DoFHandler"));
-    return fe_collection;
-  }
-
-
-
   template <int dim, int spacedim>
   inline const FiniteElement<dim, spacedim> &
   DoFHandler<dim, spacedim>::get_fe(const unsigned int number) const
index 0b88f7aff03465b291a7f8127811a70ce775b82d..d305f62708e9d62c458cfb908a6ec2fd262d22d3 100644 (file)
@@ -529,7 +529,7 @@ MatrixFree<dim, Number, VectorizedArrayType>::internal_reinit(
   {
     unsigned int n_components = 0;
     for (unsigned int no = 0; no < dof_handler.size(); ++no)
-      n_components += dof_handler[no]->get_fe()[0].n_base_elements();
+      n_components += dof_handler[no]->get_fe(0).n_base_elements();
     const unsigned int n_quad             = quad.size();
     unsigned int       n_fe_in_collection = 0;
     for (unsigned int i = 0; i < n_components; ++i)
@@ -587,7 +587,7 @@ MatrixFree<dim, Number, VectorizedArrayType>::internal_reinit(
             additional_data.store_plain_indices;
           dof_info[no].global_base_element_offset =
             no > 0 ? dof_info[no - 1].global_base_element_offset +
-                       dof_handler[no - 1]->get_fe()[0].n_base_elements() :
+                       dof_handler[no - 1]->get_fe(0).n_base_elements() :
                      0;
         }
 
index af7fbe654ff98c26eb4364f0d35f6ce55fa84c4f..d9d4a3071e2aa73f039644e1b188486ee0d18330 100644 (file)
@@ -1253,7 +1253,7 @@ namespace internal
       const VectorType *vector = &((*vectors)[dof_cell->level()]);
 
       const unsigned int dofs_per_cell =
-        this->dof_handler->get_fe()[0].dofs_per_cell;
+        this->dof_handler->get_fe(0).dofs_per_cell;
 
       std::vector<types::global_dof_index> dof_indices(dofs_per_cell);
       dof_cell->get_mg_dof_indices(dof_indices);
@@ -1292,7 +1292,7 @@ namespace internal
       const VectorType *vector = &((*vectors)[dof_cell->level()]);
 
       const unsigned int dofs_per_cell =
-        this->dof_handler->get_fe()[0].dofs_per_cell;
+        this->dof_handler->get_fe(0).dofs_per_cell;
 
       std::vector<types::global_dof_index> dof_indices(dofs_per_cell);
       dof_cell->get_mg_dof_indices(dof_indices);
index 229f111e82f90cedc0ea8a59c90e5287a49341be..fdc99098671eb9fba33672fc0f4b26f0fcb3e73c 100644 (file)
@@ -286,7 +286,7 @@ namespace VectorTools
                 const ComponentMask &                component_mask)
     {
       Assert(component_mask.represents_n_components(
-               dof_handler.get_fe().n_components()),
+               dof_handler.get_fe_collection().n_components()),
              ExcMessage(
                "The number of components in the mask has to be either "
                "zero or equal to the number of components in the finite "
@@ -296,7 +296,7 @@ namespace VectorTools
              ExcDimensionMismatch(vec.size(), dof_handler.n_dofs()));
 
       Assert(component_mask.n_selected_components(
-               dof_handler.get_fe().n_components()) > 0,
+               dof_handler.get_fe_collection().n_components()) > 0,
              ComponentMask::ExcNoComponentSelected());
 
       //
@@ -427,9 +427,10 @@ namespace VectorTools
           dof_values.resize(n_dofs);
 
           // Get all function values:
-          Assert(n_components == function(cell)->n_components,
-                 ExcDimensionMismatch(dof_handler.get_fe().n_components(),
-                                      function(cell)->n_components));
+          Assert(
+            n_components == function(cell)->n_components,
+            ExcDimensionMismatch(dof_handler.get_fe_collection().n_components(),
+                                 function(cell)->n_components));
           function(cell)->vector_value_list(generalized_support_points,
                                             function_values);
 
@@ -553,8 +554,9 @@ namespace VectorTools
     VectorType &                                               vec,
     const ComponentMask &                                      component_mask)
   {
-    Assert(dof_handler.get_fe().n_components() == function.n_components,
-           ExcDimensionMismatch(dof_handler.get_fe().n_components(),
+    Assert(dof_handler.get_fe_collection().n_components() ==
+             function.n_components,
+           ExcDimensionMismatch(dof_handler.get_fe_collection().n_components(),
                                 function.n_components));
 
     // Create a small lambda capture wrapping function and call the
index f12eb1ec32e41068cd55d08e3fb0fdf8f2c783aa..60357fe91130a7d8281c693d276d0f8a511911a2 100644 (file)
@@ -63,7 +63,7 @@ test()
 
   typename hp::DoFHandler<dim>::active_cell_iterator cell = dofh.begin_active();
 
-  const unsigned int dofs_per_cell = dofh.get_fe()[0].dofs_per_cell;
+  const unsigned int dofs_per_cell = dofh.get_fe(0).dofs_per_cell;
   std::vector<types::global_dof_index> local_dof_indices(dofs_per_cell);
 
 
index 9a355ca4ee866bdd1e740abedd46fecc3ca5e6d7..acfea62115f8df3617839429a1639f6918b339b7 100644 (file)
@@ -28,7 +28,7 @@ template <typename DoFHandlerType>
 void
 check_this(const DoFHandlerType &dof_handler)
 {
-  std::vector<bool> mask(dof_handler.get_fe().n_components(), false);
+  std::vector<bool> mask(dof_handler.get_fe(0).n_components(), false);
 
   // only select first component
   mask[0] = true;
index bf0ebc378c84dc1e749116326872f4e890ca7a54..160d899b2bc319b06f8489fc42727325e7a12234 100644 (file)
@@ -64,9 +64,9 @@ template <int dim>
 void
 check_renumbering(hp::DoFHandler<dim> &dof)
 {
-  for (unsigned int i = 0; i < dof.get_fe().size(); ++i)
+  for (unsigned int i = 0; i < dof.get_fe_collection().size(); ++i)
     {
-      const FiniteElement<dim> &element = dof.get_fe()[i];
+      const FiniteElement<dim> &element = dof.get_fe_collection()[i];
       deallog << element.get_name() << std::endl;
     }
 
index a47a8f7d82b8c1d3f6254777820730aba6d6daa0..cf0051b5c1ab855481af8c8f05bac511b34a6323 100644 (file)
@@ -64,9 +64,9 @@ template <int dim>
 void
 check_renumbering(hp::DoFHandler<dim> &dof)
 {
-  for (unsigned int i = 0; i < dof.get_fe().size(); ++i)
+  for (unsigned int i = 0; i < dof.get_fe_collection().size(); ++i)
     {
-      const FiniteElement<dim> &element = dof.get_fe()[i];
+      const FiniteElement<dim> &element = dof.get_fe_collection()[i];
       deallog << element.get_name() << std::endl;
     }
 
index 2738b6c01b230804824b5f4ddbdc647015995a08..7cb8734cd73672e1e5b10370ebace4eab70dcbdc 100644 (file)
@@ -64,9 +64,9 @@ template <int dim>
 void
 check_renumbering(hp::DoFHandler<dim> &dof)
 {
-  for (unsigned int i = 0; i < dof.get_fe().size(); ++i)
+  for (unsigned int i = 0; i < dof.get_fe_collection().size(); ++i)
     {
-      const FiniteElement<dim> &element = dof.get_fe()[i];
+      const FiniteElement<dim> &element = dof.get_fe_collection()[i];
       deallog << element.get_name() << std::endl;
     }
 
index b8595d794f9ff6d779bc3603369866f862040f53..c1d28fdc3a75025dbd8dd589fe901da4162cb8c7 100644 (file)
@@ -47,7 +47,7 @@ check_cells(const hp::DoFHandler<dim> &dof_handler)
       deallog << "cell=" << cell << std::endl;
       deallog << "n=" << cell->n_active_fe_indices() << std::endl;
       deallog << "x=";
-      for (unsigned int i = 0; i < dof_handler.get_fe().size(); ++i)
+      for (unsigned int i = 0; i < dof_handler.get_fe_collection().size(); ++i)
         deallog << cell->fe_index_is_active(i);
       deallog << std::endl;
 
@@ -74,7 +74,8 @@ check_faces(const hp::DoFHandler<dim> &dof_handler)
         deallog << "face=" << cell->face(f) << std::endl;
         deallog << "n=" << cell->face(f)->n_active_fe_indices() << std::endl;
         deallog << "x=";
-        for (unsigned int i = 0; i < dof_handler.get_fe().size(); ++i)
+        for (unsigned int i = 0; i < dof_handler.get_fe_collection().size();
+             ++i)
           deallog << cell->face(f)->fe_index_is_active(i);
         deallog << std::endl;
 
@@ -107,13 +108,14 @@ check_edges(const hp::DoFHandler<dim> &dof_handler)
         deallog << "edge=" << cell->line(e) << std::endl;
         deallog << "n=" << cell->line(e)->n_active_fe_indices() << std::endl;
         deallog << "x=";
-        for (unsigned int i = 0; i < dof_handler.get_fe().size(); ++i)
+        for (unsigned int i = 0; i < dof_handler.get_fe_collection().size();
+             ++i)
           deallog << cell->line(e)->fe_index_is_active(i);
         deallog << std::endl;
 
         Assert(cell->line(e)->n_active_fe_indices() >= 1, ExcInternalError());
         Assert(cell->line(e)->n_active_fe_indices() <=
-                 dof_handler.get_fe().size(),
+                 dof_handler.get_fe_collection().size(),
                ExcInternalError());
       }
 }
index a1757d78286de293a37f20ccd6a70eb4860e883c..d2ccc874b4866ca9d59036c060ee2da75c26f744 100644 (file)
@@ -75,7 +75,7 @@ check_renumbering(hp::DoFHandler<dim> &dof)
   // components so that each
   // component maps to its natural
   // block
-  std::vector<unsigned int> order(dof.get_fe().n_components());
+  std::vector<unsigned int> order(dof.get_fe_collection().n_components());
   order[0] = 0;
   order[1] = 1;
   order[2] = 1;
index f7f7944746ab20fa424ff346c17552fc4e44e1fa..c8b32ff2eb7b8e57ec9129646e8bc4b1d65a3d58 100644 (file)
@@ -69,7 +69,7 @@ check_renumbering(hp::DoFHandler<dim> &dof)
 {
   // Prepare a reordering of
   // components for later use
-  std::vector<unsigned int> order(dof.get_fe().n_components());
+  std::vector<unsigned int> order(dof.get_fe_collection().n_components());
   for (unsigned int i = 0; i < order.size(); ++i)
     order[i] = order.size() - i - 1;
 
index 63ebe590eec2c2bd31285d3a31896d56a4e6c7a8..16621e26e9e2f3abbcae484c7b52ddfda055443a 100644 (file)
@@ -484,7 +484,7 @@ template <int dim>
 void
 DGMethod<dim>::assemble_system1()
 {
-  const unsigned int dofs_per_cell = dof_handler.get_fe()[0].dofs_per_cell;
+  const unsigned int dofs_per_cell = dof_handler.get_fe(0).dofs_per_cell;
   std::vector<types::global_dof_index> dofs(dofs_per_cell);
   std::vector<types::global_dof_index> dofs_neighbor(dofs_per_cell);
 
@@ -663,7 +663,7 @@ template <int dim>
 void
 DGMethod<dim>::assemble_system2()
 {
-  const unsigned int dofs_per_cell = dof_handler.get_fe()[0].dofs_per_cell;
+  const unsigned int dofs_per_cell = dof_handler.get_fe(0).dofs_per_cell;
   std::vector<types::global_dof_index> dofs(dofs_per_cell);
   std::vector<types::global_dof_index> dofs_neighbor(dofs_per_cell);
 

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.