]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix up test 10747/head
authorDaniel Arndt <arndtd@ornl.gov>
Fri, 3 Jun 2022 12:33:21 +0000 (08:33 -0400)
committerDaniel Arndt <arndtd@ornl.gov>
Fri, 3 Jun 2022 12:33:21 +0000 (08:33 -0400)
tests/bits/point_value_03.cc
tests/bits/point_value_03.mpirun=1.output [moved from tests/bits/point_value_03.with_petsc=true.with_petsc_with_complex=false.mpirun=1.output with 100% similarity]
tests/bits/point_value_03.mpirun=7.output [new file with mode: 0644]
tests/bits/point_value_03.with_petsc=true.with_petsc_with_complex=false.mpirun=7.output [deleted file]
tests/bits/point_value_03.with_petsc=true.with_petsc_with_complex=true.mpirun=1.output [deleted file]
tests/bits/point_value_03.with_petsc=true.with_petsc_with_complex=true.mpirun=7.output [deleted file]

index 8439fb112c0ae396e218f37911cdef006c37a598..738b2e8b5a2ff453b7ffc02fb47c3fab2b5be8ce 100644 (file)
@@ -26,6 +26,7 @@
 #include <deal.II/distributed/tria.h>
 
 #include <deal.II/dofs/dof_handler.h>
+#include <deal.II/dofs/dof_tools.h>
 
 #include <deal.II/fe/fe_q.h>
 
@@ -44,7 +45,7 @@
 #include "../tests.h"
 
 
-using VectorType = LinearAlgebraPETSc::MPI::Vector;
+using VectorType = LinearAlgebra::distributed::Vector<double>;
 
 template <int dim>
 class MySquareFunction : public Function<dim, VectorType::value_type>
@@ -129,15 +130,15 @@ check()
 
   static const MySquareFunction<dim> function;
 
-
-  IndexSet locally_owned_dofs;
-
   VectorType v;
 
-  locally_owned_dofs = dof.locally_owned_dofs();
+  const IndexSet locally_owned_dofs = dof.locally_owned_dofs();
+  const IndexSet locally_relevant_dofs =
+    DoFTools::extract_locally_relevant_dofs(dof);
 
-  v.reinit(locally_owned_dofs, MPI_COMM_WORLD);
+  v.reinit(locally_owned_dofs, locally_relevant_dofs, MPI_COMM_WORLD);
   VectorTools::interpolate(dof, function, v);
+  v.update_ghost_values();
 
   // v = 1.;
 
@@ -158,32 +159,28 @@ check()
     }
   Vector<VectorType::value_type> value(1);
   const auto &                   mapping = get_default_linear_mapping(tria);
-  GridTools::Cache<dim, dim>     cache(tria, mapping);
-  typename Triangulation<dim, dim>::active_cell_iterator cell_hint{};
-  std::vector<bool>                                      marked_vertices = {};
-  const double                                           tolerance = 1.e-10;
   for (unsigned int i = 0; i < 3; ++i)
     {
       {
         bool point_in_locally_owned_cell = false;
         value(0)                         = 0;
         {
-          auto cell_and_ref_point = GridTools::find_active_cell_around_point(
-            cache, p[i], cell_hint, marked_vertices, tolerance);
+          auto cell_and_ref_point =
+            GridTools::find_active_cell_around_point(mapping, dof, p[i]);
           if (cell_and_ref_point.first.state() == IteratorState::valid)
             {
-              cell_hint = cell_and_ref_point.first;
               point_in_locally_owned_cell =
                 cell_and_ref_point.first->is_locally_owned();
             }
         }
         if (point_in_locally_owned_cell)
           {
-            VectorTools::point_value(dof, v, p[i], value);
+            VectorTools::point_value(mapping, dof, v, p[i], value);
           }
       }
       value(0) = Utilities::MPI::sum(value(0), MPI_COMM_WORLD);
       deallog << -value(0) << std::endl;
+      std::cout << value(0) << std::endl;
 
       Assert(std::abs(value(0) - function.value(p[i])) < 2e-4,
              ExcInternalError());
diff --git a/tests/bits/point_value_03.mpirun=7.output b/tests/bits/point_value_03.mpirun=7.output
new file mode 100644 (file)
index 0000000..0dbd1af
--- /dev/null
@@ -0,0 +1,69 @@
+
+DEAL:0:2d::-1.000
+DEAL:0:2d::-1.500
+DEAL:0:2d::-1.222
+DEAL:0:2d::OK
+DEAL:0:3d::-1.000
+DEAL:0:3d::-1.750
+DEAL:0:3d::-1.333
+DEAL:0:3d::OK
+
+DEAL:1:2d::-1.000
+DEAL:1:2d::-1.500
+DEAL:1:2d::-1.222
+DEAL:1:2d::OK
+DEAL:1:3d::-1.000
+DEAL:1:3d::-1.750
+DEAL:1:3d::-1.333
+DEAL:1:3d::OK
+
+
+DEAL:2:2d::-1.000
+DEAL:2:2d::-1.500
+DEAL:2:2d::-1.222
+DEAL:2:2d::OK
+DEAL:2:3d::-1.000
+DEAL:2:3d::-1.750
+DEAL:2:3d::-1.333
+DEAL:2:3d::OK
+
+
+DEAL:3:2d::-1.000
+DEAL:3:2d::-1.500
+DEAL:3:2d::-1.222
+DEAL:3:2d::OK
+DEAL:3:3d::-1.000
+DEAL:3:3d::-1.750
+DEAL:3:3d::-1.333
+DEAL:3:3d::OK
+
+
+DEAL:4:2d::-1.000
+DEAL:4:2d::-1.500
+DEAL:4:2d::-1.222
+DEAL:4:2d::OK
+DEAL:4:3d::-1.000
+DEAL:4:3d::-1.750
+DEAL:4:3d::-1.333
+DEAL:4:3d::OK
+
+
+DEAL:5:2d::-1.000
+DEAL:5:2d::-1.500
+DEAL:5:2d::-1.222
+DEAL:5:2d::OK
+DEAL:5:3d::-1.000
+DEAL:5:3d::-1.750
+DEAL:5:3d::-1.333
+DEAL:5:3d::OK
+
+
+DEAL:6:2d::-1.000
+DEAL:6:2d::-1.500
+DEAL:6:2d::-1.222
+DEAL:6:2d::OK
+DEAL:6:3d::-1.000
+DEAL:6:3d::-1.750
+DEAL:6:3d::-1.333
+DEAL:6:3d::OK
+
diff --git a/tests/bits/point_value_03.with_petsc=true.with_petsc_with_complex=false.mpirun=7.output b/tests/bits/point_value_03.with_petsc=true.with_petsc_with_complex=false.mpirun=7.output
deleted file mode 100644 (file)
index 2a7da63..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-
-DEAL:0:2d::-1.000
-DEAL:0:2d::-1.500
-DEAL:0:2d::-1.222
-DEAL:0:2d::OK
-DEAL:0:3d::-1.000
-DEAL:0:3d::-1.750
-DEAL:0:3d::-1.333
-DEAL:0:3d::OK
diff --git a/tests/bits/point_value_03.with_petsc=true.with_petsc_with_complex=true.mpirun=1.output b/tests/bits/point_value_03.with_petsc=true.with_petsc_with_complex=true.mpirun=1.output
deleted file mode 100644 (file)
index 435c47d..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-
-DEAL:0:2d::(-1.000,0.000)
-DEAL:0:2d::(-1.500,0.000)
-DEAL:0:2d::(-1.222,0.000)
-DEAL:0:2d::OK
-DEAL:0:3d::(-1.000,0.000)
-DEAL:0:3d::(-1.750,0.000)
-DEAL:0:3d::(-1.333,0.000)
-DEAL:0:3d::OK
diff --git a/tests/bits/point_value_03.with_petsc=true.with_petsc_with_complex=true.mpirun=7.output b/tests/bits/point_value_03.with_petsc=true.with_petsc_with_complex=true.mpirun=7.output
deleted file mode 100644 (file)
index 435c47d..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-
-DEAL:0:2d::(-1.000,0.000)
-DEAL:0:2d::(-1.500,0.000)
-DEAL:0:2d::(-1.222,0.000)
-DEAL:0:2d::OK
-DEAL:0:3d::(-1.000,0.000)
-DEAL:0:3d::(-1.750,0.000)
-DEAL:0:3d::(-1.333,0.000)
-DEAL:0:3d::OK

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.