]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add another test. 13536/head
authorDavid Wells <drwells@email.unc.edu>
Sun, 13 Mar 2022 01:16:25 +0000 (20:16 -0500)
committerDavid Wells <drwells@email.unc.edu>
Fri, 25 Mar 2022 22:36:13 +0000 (18:36 -0400)
tests/dofs/nodal_renumbering_01.cc
tests/dofs/nodal_renumbering_01.mpirun=2.with_p4est=true.output
tests/dofs/nodal_renumbering_01.mpirun=3.with_p4est=true.output
tests/dofs/nodal_renumbering_01.with_p4est=true.output

index 4c767bfbd047d06cc0621f8d40729af5831dfe32..368c798773e91b74dac43a974629da0264cd35dd 100644 (file)
@@ -21,6 +21,9 @@
 #include <deal.II/dofs/dof_renumbering.h>
 #include <deal.II/dofs/dof_tools.h>
 
+#include <deal.II/fe/fe_dgq.h>
+#include <deal.II/fe/fe_nedelec_sz.h>
+#include <deal.II/fe/fe_nothing.h>
 #include <deal.II/fe/fe_q.h>
 #include <deal.II/fe/fe_simplex_p.h>
 #include <deal.II/fe/fe_system.h>
@@ -77,7 +80,7 @@ test(DoFHandler<2> &dof_handler, const hp::MappingCollection<2> &mappings)
   const MPI_Comm comm = dof_handler.get_communicator();
 
   const IndexSet &local_dofs = dof_handler.locally_owned_dofs();
-  deallog << "locally owned dofs =\n";
+  deallog << "new case with locally owned dofs = ";
   local_dofs.print(deallog);
   deallog << std::endl;
   const IndexSet relevant_dofs =
@@ -104,8 +107,7 @@ test(DoFHandler<2> &dof_handler, const hp::MappingCollection<2> &mappings)
                                position);
 
       Test test(n_components);
-      if (n_components == 2)
-        VectorTools::interpolate(mappings, dof_handler, test, solution1);
+      VectorTools::interpolate(mappings, dof_handler, test, solution1);
 
       // Verify that we get the same results when we interpolate either manually
       // or by reading off position data and evaluating the interpolated
@@ -174,6 +176,51 @@ main(int argc, char **argv)
     test(dof_handler, mappings);
   }
 
+  // Try discontinuous elements
+  {
+    parallel::shared::Triangulation<2> tria(
+      comm,
+      dealii::Triangulation<2>::none,
+      true,
+      parallel::shared::Triangulation<2>::partition_zorder);
+    GridGenerator::hyper_ball(tria);
+
+    hp::FECollection<2>      fe(FESystem<2>(FE_DGQ<2>(4), 2));
+    hp::MappingCollection<2> mappings(MappingQ<2>(1));
+    DoFHandler<2>            dof_handler(tria);
+    for (const auto &cell : dof_handler.active_cell_iterators())
+      if (cell->is_locally_owned())
+        cell->set_active_fe_index(0);
+    dof_handler.distribute_dofs(fe);
+
+    test(dof_handler, mappings);
+  }
+
+  // Test with p::d::T, hp-FE, multiple components
+  {
+    parallel::distributed::Triangulation<2> tria(comm);
+    GridGenerator::hyper_ball(tria);
+    tria.refine_global(3);
+    for (const auto &cell : tria.active_cell_iterators())
+      if (cell->is_locally_owned() && std::abs(cell->center()[0]) < 0.1)
+        cell->set_refine_flag();
+    tria.execute_coarsening_and_refinement();
+
+    hp::FECollection<2>      fe(FESystem<2>(FE_Q<2>(2), 2),
+                           FESystem<2>(FE_Q<2>(4), 2),
+                           FESystem<2>(FE_Nothing<2>(), 2));
+    hp::MappingCollection<2> mappings(MappingQ<2>(1),
+                                      MappingQ<2>(1),
+                                      MappingQ<2>(1));
+    DoFHandler<2>            dof_handler(tria);
+    for (const auto &cell : dof_handler.active_cell_iterators())
+      if (cell->is_locally_owned())
+        cell->set_active_fe_index(cell->index() % 3);
+    dof_handler.distribute_dofs(fe);
+
+    test(dof_handler, mappings);
+  }
+
   // Test with a scalar FE
   {
     parallel::shared::Triangulation<2> tria(
@@ -238,4 +285,64 @@ main(int argc, char **argv)
 
     test(dof_handler, mappings);
   }
+
+  // Make sure that we fail correctly when we do weird things
+  deal_II_exceptions::disable_abort_on_exception();
+  {
+    try
+      {
+        parallel::distributed::Triangulation<2> tria(comm);
+        GridGenerator::hyper_cube(tria);
+        tria.refine_global(3);
+
+        FESystem<2>   fe(FE_NedelecSZ<2>(0), 1, FE_Q<2>(1), 2);
+        DoFHandler<2> dof_handler(tria);
+        dof_handler.distribute_dofs(fe);
+        hp::MappingCollection<2> mappings(MappingQ<2>(1));
+        for (const auto &cell : dof_handler.active_cell_iterators())
+          cell->set_active_fe_index(0);
+
+        test(dof_handler, mappings);
+      }
+    catch (const ExceptionBase &exc)
+      {
+        // The third line contains line numbers so skip it
+        const std::vector<std::string> lines =
+          Utilities::split_string_list(exc.what(), "\n");
+        deallog
+          << "FE_NedelecSZ nodal renumbering failed successfully with message:"
+          << std::endl;
+        for (std::size_t i = 3; i < 6; ++i)
+          deallog << lines[i] << std::endl;
+      }
+  }
+
+  {
+    try
+      {
+        parallel::distributed::Triangulation<2> tria(comm);
+        GridGenerator::hyper_cube(tria);
+        tria.refine_global(3);
+
+        FE_NedelecSZ<2> fe(0);
+        DoFHandler<2>   dof_handler(tria);
+        dof_handler.distribute_dofs(fe);
+        hp::MappingCollection<2> mappings(MappingQ<2>(1));
+        for (const auto &cell : dof_handler.active_cell_iterators())
+          cell->set_active_fe_index(0);
+
+        test(dof_handler, mappings);
+      }
+    catch (const ExceptionBase &exc)
+      {
+        // The third line contains line numbers so skip it
+        const std::vector<std::string> lines =
+          Utilities::split_string_list(exc.what(), "\n");
+        deallog
+          << "FE_NedelecSZ nodal renumbering failed successfully with message:"
+          << std::endl;
+        for (std::size_t i = 3; i < 6; ++i)
+          deallog << lines[i] << std::endl;
+      }
+  }
 }
index 7dadd621453365a571918e88a9431df26bae8524..f941368ee7f550a573170d5ebc813843eab1b7e8 100644 (file)
@@ -1,31 +1,51 @@
 
-DEAL:0::locally owned dofs =
-{[0,7]}
+DEAL:0::new case with locally owned dofs = {[0,7]}
 DEAL:0::
 DEAL:0::difference norm = 0.00000
-DEAL:0::locally owned dofs =
-{[0,3]}
+DEAL:0::new case with locally owned dofs = {[0,99]}
 DEAL:0::
-DEAL:0::locally owned dofs =
-{[0,230]}
+DEAL:0::difference norm = 0.00000
+DEAL:0::new case with locally owned dofs = {[0,4033]}
+DEAL:0::
+DEAL:0::difference norm = 1.59444e-15
+DEAL:0::new case with locally owned dofs = {[0,3]}
+DEAL:0::
+DEAL:0::new case with locally owned dofs = {[0,230]}
 DEAL:0::
-DEAL:0::locally owned dofs =
-{[0,1721]}
+DEAL:0::new case with locally owned dofs = {[0,1721]}
 DEAL:0::
 DEAL:0::difference norm = 0.00000
+DEAL:0::FE_NedelecSZ nodal renumbering failed successfully with message:
+DEAL:0::void dealii::DoFRenumbering::compute_support_point_wise(std::vector<unsigned int>&, const dealii::DoFHandler<dim, spacedim>&) [with int dim = 2; int spacedim = 2]
+DEAL:0::The violated condition was:
+DEAL:0::dofs_per_component[0] == dpc
+DEAL:0::FE_NedelecSZ nodal renumbering failed successfully with message:
+DEAL:0::void dealii::DoFRenumbering::compute_support_point_wise(std::vector<unsigned int>&, const dealii::DoFHandler<dim, spacedim>&) [with int dim = 2; int spacedim = 2]
+DEAL:0::The violated condition was:
+DEAL:0::dofs_per_component[0] == dpc
 
-DEAL:1::locally owned dofs =
-{[8,9]}
+DEAL:1::new case with locally owned dofs = {[8,9]}
 DEAL:1::
 DEAL:1::difference norm = 0.00000
-DEAL:1::locally owned dofs =
-{4}
+DEAL:1::new case with locally owned dofs = {[100,249]}
+DEAL:1::
+DEAL:1::difference norm = 0.00000
+DEAL:1::new case with locally owned dofs = {[4034,7965]}
+DEAL:1::
+DEAL:1::difference norm = 1.59444e-15
+DEAL:1::new case with locally owned dofs = {4}
 DEAL:1::
-DEAL:1::locally owned dofs =
-{[231,440]}
+DEAL:1::new case with locally owned dofs = {[231,440]}
 DEAL:1::
-DEAL:1::locally owned dofs =
-{[1722,3361]}
+DEAL:1::new case with locally owned dofs = {[1722,3361]}
 DEAL:1::
 DEAL:1::difference norm = 0.00000
+DEAL:1::FE_NedelecSZ nodal renumbering failed successfully with message:
+DEAL:1::void dealii::DoFRenumbering::compute_support_point_wise(std::vector<unsigned int>&, const dealii::DoFHandler<dim, spacedim>&) [with int dim = 2; int spacedim = 2]
+DEAL:1::The violated condition was:
+DEAL:1::dofs_per_component[0] == dpc
+DEAL:1::FE_NedelecSZ nodal renumbering failed successfully with message:
+DEAL:1::void dealii::DoFRenumbering::compute_support_point_wise(std::vector<unsigned int>&, const dealii::DoFHandler<dim, spacedim>&) [with int dim = 2; int spacedim = 2]
+DEAL:1::The violated condition was:
+DEAL:1::dofs_per_component[0] == dpc
 
index bd56e241159fdca1470d5c27da3c2b993d870956..427c6c29b2d414d232095d99a7ac2c8405bf77a3 100644 (file)
@@ -1,47 +1,77 @@
 
-DEAL:0::locally owned dofs =
-{}
+DEAL:0::new case with locally owned dofs = {}
 DEAL:0::
 DEAL:0::difference norm = 0.00000
-DEAL:0::locally owned dofs =
-{}
+DEAL:0::new case with locally owned dofs = {[0,49]}
 DEAL:0::
-DEAL:0::locally owned dofs =
-{[0,120]}
+DEAL:0::difference norm = 0.00000
+DEAL:0::new case with locally owned dofs = {[0,2731]}
+DEAL:0::
+DEAL:0::difference norm = 1.67272e-15
+DEAL:0::new case with locally owned dofs = {}
+DEAL:0::
+DEAL:0::new case with locally owned dofs = {[0,120]}
 DEAL:0::
-DEAL:0::locally owned dofs =
-{[0,1101]}
+DEAL:0::new case with locally owned dofs = {[0,1101]}
 DEAL:0::
 DEAL:0::difference norm = 0.00000
+DEAL:0::FE_NedelecSZ nodal renumbering failed successfully with message:
+DEAL:0::void dealii::DoFRenumbering::compute_support_point_wise(std::vector<unsigned int>&, const dealii::DoFHandler<dim, spacedim>&) [with int dim = 2; int spacedim = 2]
+DEAL:0::The violated condition was:
+DEAL:0::dofs_per_component[0] == dpc
+DEAL:0::FE_NedelecSZ nodal renumbering failed successfully with message:
+DEAL:0::void dealii::DoFRenumbering::compute_support_point_wise(std::vector<unsigned int>&, const dealii::DoFHandler<dim, spacedim>&) [with int dim = 2; int spacedim = 2]
+DEAL:0::The violated condition was:
+DEAL:0::dofs_per_component[0] == dpc
 
-DEAL:1::locally owned dofs =
-{[0,7]}
+DEAL:1::new case with locally owned dofs = {[0,7]}
+DEAL:1::
+DEAL:1::difference norm = 0.00000
+DEAL:1::new case with locally owned dofs = {[50,149]}
 DEAL:1::
 DEAL:1::difference norm = 0.00000
-DEAL:1::locally owned dofs =
-{[0,3]}
+DEAL:1::new case with locally owned dofs = {[2732,5305]}
 DEAL:1::
-DEAL:1::locally owned dofs =
-{[121,340]}
+DEAL:1::difference norm = 1.67272e-15
+DEAL:1::new case with locally owned dofs = {[0,3]}
 DEAL:1::
-DEAL:1::locally owned dofs =
-{[1102,2361]}
+DEAL:1::new case with locally owned dofs = {[121,340]}
+DEAL:1::
+DEAL:1::new case with locally owned dofs = {[1102,2361]}
 DEAL:1::
 DEAL:1::difference norm = 0.00000
+DEAL:1::FE_NedelecSZ nodal renumbering failed successfully with message:
+DEAL:1::void dealii::DoFRenumbering::compute_support_point_wise(std::vector<unsigned int>&, const dealii::DoFHandler<dim, spacedim>&) [with int dim = 2; int spacedim = 2]
+DEAL:1::The violated condition was:
+DEAL:1::dofs_per_component[0] == dpc
+DEAL:1::FE_NedelecSZ nodal renumbering failed successfully with message:
+DEAL:1::void dealii::DoFRenumbering::compute_support_point_wise(std::vector<unsigned int>&, const dealii::DoFHandler<dim, spacedim>&) [with int dim = 2; int spacedim = 2]
+DEAL:1::The violated condition was:
+DEAL:1::dofs_per_component[0] == dpc
 
 
-DEAL:2::locally owned dofs =
-{[8,9]}
+DEAL:2::new case with locally owned dofs = {[8,9]}
+DEAL:2::
+DEAL:2::difference norm = 0.00000
+DEAL:2::new case with locally owned dofs = {[150,249]}
 DEAL:2::
 DEAL:2::difference norm = 0.00000
-DEAL:2::locally owned dofs =
-{4}
+DEAL:2::new case with locally owned dofs = {[5306,7935]}
+DEAL:2::
+DEAL:2::difference norm = 1.67272e-15
+DEAL:2::new case with locally owned dofs = {4}
 DEAL:2::
-DEAL:2::locally owned dofs =
-{[341,440]}
+DEAL:2::new case with locally owned dofs = {[341,440]}
 DEAL:2::
-DEAL:2::locally owned dofs =
-{[2362,3361]}
+DEAL:2::new case with locally owned dofs = {[2362,3361]}
 DEAL:2::
 DEAL:2::difference norm = 0.00000
+DEAL:2::FE_NedelecSZ nodal renumbering failed successfully with message:
+DEAL:2::void dealii::DoFRenumbering::compute_support_point_wise(std::vector<unsigned int>&, const dealii::DoFHandler<dim, spacedim>&) [with int dim = 2; int spacedim = 2]
+DEAL:2::The violated condition was:
+DEAL:2::dofs_per_component[0] == dpc
+DEAL:2::FE_NedelecSZ nodal renumbering failed successfully with message:
+DEAL:2::void dealii::DoFRenumbering::compute_support_point_wise(std::vector<unsigned int>&, const dealii::DoFHandler<dim, spacedim>&) [with int dim = 2; int spacedim = 2]
+DEAL:2::The violated condition was:
+DEAL:2::dofs_per_component[0] == dpc
 
index 3826b2a5bd95a8ead2ae49a2580dbb739406eb72..8d20583e59771c02ea7271c1a4c271a769554f47 100644 (file)
@@ -1,15 +1,25 @@
 
-DEAL:0::locally owned dofs =
-{[0,9]}
+DEAL:0::new case with locally owned dofs = {[0,9]}
 DEAL:0::
 DEAL:0::difference norm = 0.00000
-DEAL:0::locally owned dofs =
-{[0,4]}
+DEAL:0::new case with locally owned dofs = {[0,249]}
 DEAL:0::
-DEAL:0::locally owned dofs =
-{[0,440]}
+DEAL:0::difference norm = 0.00000
+DEAL:0::new case with locally owned dofs = {[0,7941]}
+DEAL:0::
+DEAL:0::difference norm = 1.62791e-15
+DEAL:0::new case with locally owned dofs = {[0,4]}
+DEAL:0::
+DEAL:0::new case with locally owned dofs = {[0,440]}
 DEAL:0::
-DEAL:0::locally owned dofs =
-{[0,3361]}
+DEAL:0::new case with locally owned dofs = {[0,3361]}
 DEAL:0::
 DEAL:0::difference norm = 0.00000
+DEAL:0::FE_NedelecSZ nodal renumbering failed successfully with message:
+DEAL:0::void dealii::DoFRenumbering::compute_support_point_wise(std::vector<unsigned int>&, const dealii::DoFHandler<dim, spacedim>&) [with int dim = 2; int spacedim = 2]
+DEAL:0::The violated condition was:
+DEAL:0::dofs_per_component[0] == dpc
+DEAL:0::FE_NedelecSZ nodal renumbering failed successfully with message:
+DEAL:0::void dealii::DoFRenumbering::compute_support_point_wise(std::vector<unsigned int>&, const dealii::DoFHandler<dim, spacedim>&) [with int dim = 2; int spacedim = 2]
+DEAL:0::The violated condition was:
+DEAL:0::dofs_per_component[0] == dpc

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.