const IndexSet & local_active_columns,
const SparsityPatternType &sparsity_pattern)
{
+# if DEAL_II_PETSC_VERSION_GTE(3, 10, 0)
Assert(sparsity_pattern.n_rows() == local_rows.size(),
ExcMessage(
"SparsityPattern and IndexSet have different number of rows."));
Assert(local_rows.is_ascending_and_one_to_one(communicator),
ExcNotImplemented());
-# ifdef DEBUG
+# ifdef DEBUG
{
// check indexsets
types::global_dof_index row_owners =
" but sum(local_columns.n_elements())=" +
std::to_string(col_owners) + ")"));
}
-# endif
+# endif
PetscErrorCode ierr;
// create the local to global mappings as arrays.
}
ierr = MatISRestoreLocalMat(matrix, &local_matrix);
AssertThrow(ierr == 0, ExcPETScError(ierr));
+# else
+ {
+ AssertThrow(false, ExcMessage("BDDC preconditioner requires PETSc 3.10.0 or newer");
+ }
+# endif
}
# ifndef DOXYGEN
void
PreconditionBDDC<dim>::initialize()
{
+# if DEAL_II_PETSC_VERSION_GTE(3, 10, 0)
PetscErrorCode ierr = PCSetType(pc, const_cast<char *>(PCBDDC));
AssertThrow(ierr == 0, ExcPETScError(ierr));
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
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);
AssertThrow(ierr == 0, ExcPETScError(ierr));
+# else
+ {
+ AssertThrow(false, ExcMessage("BDDC preconditioner requires PETSc 3.10.0 or newer");
+ }
+# endif
}
template <int dim>
initlog();
deallog << std::setprecision(10);
+#if DEAL_II_PETSC_VERSION_GTE(3, 10, 0)
parallel::distributed::Triangulation<2> triangulation(MPI_COMM_WORLD);
FE_Q<2> fe(1);
DoFHandler<2> dof_handler(triangulation);
PETScWrappers::PreconditionBDDC<2> preconditioner;
PETScWrappers::PreconditionBDDC<2>::AdditionalData data;
-// Now we setup the dof coordinates if a sufficiently new PETSc is used
-#if DEAL_II_PETSC_VERSION_GTE(3, 9, 0)
+ // Now we setup the dof coordinates if a sufficiently new PETSc is used
std::map<types::global_dof_index, Point<2>> dof_2_point;
DoFTools::map_dofs_to_support_points(MappingQ1<2>(),
dof_handler,
dof_2_point);
- std::vector<Point<2>> coords(locally_active_dofs.size());
- for (const auto &d2p : dof_2_point)
+ std::vector<Point<2>> coords(locally_owned_dofs.n_elements());
+ unsigned int k = 0;
+ for (auto it = locally_owned_dofs.begin(); it != locally_owned_dofs.end();
+ ++it, ++k)
{
- coords[d2p.first] = d2p.second;
+ coords[k] = dof_2_point[*it];
}
- data.coords = coords;
-#endif
+ data.coords = coords;
data.use_vertices = true;
preconditioner.initialize(system_matrix, data);
2);
deallog << "CG/BDDC:OK" << std::endl;
-
+#else
+ deallog << "MATIS:OK" << std::endl;
+ deallog << "DEAL::Solver stopped within 1 - 2 iterations" << std::endl;
+ deallog << "CG/BDDC:OK" << std::endl;
+#endif
return 0;
}