]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Added check for corner selection in BDDC, as it it a more recent feature
authorNicolas Barnafi <nabw91@gmail.com>
Fri, 9 Sep 2022 14:31:23 +0000 (16:31 +0200)
committerNicolas Barnafi <nabw91@gmail.com>
Fri, 9 Sep 2022 14:31:23 +0000 (16:31 +0200)
source/lac/petsc_precondition.cc
tests/petsc/bddc.cc

index 8c72ccd42e05f978677e3648f312be32e62d875f..1b6108dd9285fc29f89f7e420302974d42eb1c41 100644 (file)
@@ -926,6 +926,7 @@ namespace PETScWrappers
     else
       set_option_value("-pc_bddc_symmetric", "false");
     if (additional_data.coords.size() > 0)
+#  if DEAL_II_PETSC_VERSION_GTE(3, 9, 0)
       {
         set_option_value("-pc_bddc_corner_selection", "true");
         // Convert coords vector to PETSc data array
@@ -949,6 +950,11 @@ namespace PETScWrappers
         ierr = PCSetCoordinates(pc, 0, 0, NULL);
         AssertThrow(ierr == 0, ExcPETScError(ierr));
       }
+#  else
+      {
+        AssertThrow(false, ExcMessage("Corner selection in BDDC is only available with PETSc 3.9.0 or newer");
+      }
+#  endif
 
 
     ierr = PCSetFromOptions(pc);
index 1dfc9fb76e34971f0334400508858661cd40d8f9..a627dc1daa15e0d25906a6781ea2c3a41262c6f7 100644 (file)
@@ -160,7 +160,8 @@ main(int argc, char *argv[])
   PETScWrappers::PreconditionBDDC<2> preconditioner;
   PETScWrappers::PreconditionBDDC<2>::AdditionalData data;
 
-  // Now we setup the dof coordinates
+// Now we setup the dof coordinates if a sufficiently new PETSc is used
+#if DEAL_II_PETSC_VERSION_GTE(3, 9, 0)
   std::map<types::global_dof_index, Point<2>> dof_2_point;
   DoFTools::map_dofs_to_support_points(MappingQ1<2>(),
                                        dof_handler,
@@ -170,6 +171,9 @@ main(int argc, char *argv[])
     {
       coords[d2p.first] = d2p.second;
     }
+  data.coords = coords;
+#endif
+  data.use_vertices = true;
 
   preconditioner.initialize(system_matrix, data);
   check_solver_within_range(solver.solve(system_matrix,

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.