From 5fbd611fb313b6dd5256a63dea8ca5f1480fe01d Mon Sep 17 00:00:00 2001 From: Ryan Moulday Date: Fri, 27 Jun 2025 01:03:29 -0400 Subject: [PATCH] Guard relevant blocks against case where only PETSc or Trilinos is active --- source/lac/sparse_direct.cc | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/source/lac/sparse_direct.cc b/source/lac/sparse_direct.cc index 75e46da54b..f873796bc0 100644 --- a/source/lac/sparse_direct.cc +++ b/source/lac/sparse_direct.cc @@ -36,6 +36,24 @@ DEAL_II_NAMESPACE_OPEN +namespace TrilinosWrappers +{ + class SparseMatrix; + namespace MPI + { + class SparseMatrix; + class Vector; + } // namespace MPI +} // namespace TrilinosWrappers +namespace PETScWrappers +{ + namespace MPI + { + class SparseMatrix; + class Vector; + } // namespace MPI +} // namespace PETScWrappers + namespace { /** @@ -1442,9 +1460,12 @@ InstantiateUMFPACK(BlockSparseMatrix>); # define InstantiateMUMPSMatVec(VECTOR) \ template void SparseDirectMUMPS::vmult(VECTOR &, const VECTOR &) const; \ template void SparseDirectMUMPS::Tvmult(VECTOR &, const VECTOR &) const; - +# ifdef DEAL_II_WITH_TRILINOS InstantiateMUMPSMatVec(TrilinosWrappers::MPI::Vector) +# endif +# ifdef DEAL_II_WITH_PETSC InstantiateMUMPSMatVec(PETScWrappers::MPI::Vector) +# endif InstantiateMUMPSMatVec(Vector) # define InstantiateMUMPS(MATRIX) \ @@ -1452,9 +1473,13 @@ InstantiateMUMPSMatVec(TrilinosWrappers::MPI::Vector) InstantiateMUMPS(SparseMatrix) InstantiateMUMPS(SparseMatrix) +# ifdef DEAL_II_WITH_TRILINOS InstantiateMUMPS(TrilinosWrappers::SparseMatrix) +# endif +# ifdef DEAL_II_WITH_PETSC InstantiateMUMPS(PETScWrappers::SparseMatrix) InstantiateMUMPS(PETScWrappers::MPI::SparseMatrix) +# endif // InstantiateMUMPS(SparseMatrixEZ) // InstantiateMUMPS(SparseMatrixEZ) InstantiateMUMPS(BlockSparseMatrix) -- 2.39.5