From: Nicolas Barnafi Date: Fri, 9 Sep 2022 14:31:23 +0000 (+0200) Subject: Added check for corner selection in BDDC, as it it a more recent feature X-Git-Tag: v9.5.0-rc1~947^2~8 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f378ae415bbeca9118911dad9fa45fdd7c41fce;p=dealii.git Added check for corner selection in BDDC, as it it a more recent feature --- diff --git a/source/lac/petsc_precondition.cc b/source/lac/petsc_precondition.cc index 8c72ccd42e..1b6108dd92 100644 --- a/source/lac/petsc_precondition.cc +++ b/source/lac/petsc_precondition.cc @@ -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); diff --git a/tests/petsc/bddc.cc b/tests/petsc/bddc.cc index 1dfc9fb76e..a627dc1daa 100644 --- a/tests/petsc/bddc.cc +++ b/tests/petsc/bddc.cc @@ -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> 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,