From: Martin Kronbichler Date: Tue, 9 Jun 2009 08:25:39 +0000 (+0000) Subject: Cannot perform usual condense and distribute functions on distributed Trilinos vector... X-Git-Tag: v8.0.0~7628 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e671388affabca1eb8a54b89ff92c968ca24bebe;p=dealii.git Cannot perform usual condense and distribute functions on distributed Trilinos vectors. We need to explicitly implement that functionality if we want to have it. git-svn-id: https://svn.dealii.org/trunk@18919 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/source/constraint_matrix.cc b/deal.II/lac/source/constraint_matrix.cc index 4023052e3a..7f6ea40e29 100644 --- a/deal.II/lac/source/constraint_matrix.cc +++ b/deal.II/lac/source/constraint_matrix.cc @@ -1988,6 +1988,9 @@ ConstraintMatrix::memory_consumption () const // VectorType/MatrixType. note that we need a space between "VectorType" and // ">" to disambiguate ">>" when VectorType trails in an angle bracket +// TODO: The way we define all the instantiations is probably not the very +// best one. Try to find a better description. + #define VECTOR_FUNCTIONS(VectorType) \ template void ConstraintMatrix::condense(const VectorType &uncondensed,\ VectorType &condensed) const;\ @@ -2010,12 +2013,25 @@ ConstraintMatrix::memory_consumption () const VectorType &uncondensed) const;\ template void ConstraintMatrix::distribute(VectorType &vec) const +#define PARALLEL_VECTOR_FUNCTIONS(VectorType) \ + template void ConstraintMatrix:: \ + distribute_local_to_global (const Vector &, \ + const std::vector &, \ + VectorType &, \ + const FullMatrix &) const + + VECTOR_FUNCTIONS(Vector); VECTOR_FUNCTIONS(Vector); VECTOR_FUNCTIONS(BlockVector); VECTOR_FUNCTIONS(BlockVector); +// TODO: Can PETSc really do all the operations required by the above +// condense/distribute function etc also on distributed vectors? Trilinos +// can't do that - we have to rewrite those functions by hand if we want to +// use them. The key is to use local ranges etc., which still needs to be +// implemented. #ifdef DEAL_II_USE_PETSC VECTOR_FUNCTIONS(PETScWrappers::Vector); VECTOR_FUNCTIONS(PETScWrappers::BlockVector); @@ -2026,8 +2042,8 @@ VECTOR_FUNCTIONS(PETScWrappers::MPI::BlockVector); #ifdef DEAL_II_USE_TRILINOS VECTOR_FUNCTIONS(TrilinosWrappers::Vector); VECTOR_FUNCTIONS(TrilinosWrappers::BlockVector); -VECTOR_FUNCTIONS(TrilinosWrappers::MPI::Vector); -VECTOR_FUNCTIONS(TrilinosWrappers::MPI::BlockVector); +PARALLEL_VECTOR_FUNCTIONS(TrilinosWrappers::MPI::Vector); +PARALLEL_VECTOR_FUNCTIONS(TrilinosWrappers::MPI::BlockVector); #endif #define CONDENSE_FUNCTIONS(VectorType, number, MatrixType) \ @@ -2138,62 +2154,26 @@ template void ConstraintMatrix::distribute_local_to_global TrilinosWrappers::MPI::BlockVector &) const; #endif -template void ConstraintMatrix:: -add_entries_local_to_global (const std::vector &, - SparsityPattern &, - const bool, - const Table<2,bool> &) const; -template void ConstraintMatrix:: -add_entries_local_to_global (const std::vector &, - CompressedSparsityPattern &, - const bool, - const Table<2,bool> &) const; -template void ConstraintMatrix:: -add_entries_local_to_global (const std::vector &, - CompressedSetSparsityPattern &, - const bool, - const Table<2,bool> &) const; -template void ConstraintMatrix:: -add_entries_local_to_global (const std::vector &, - CompressedSimpleSparsityPattern &, - const bool, - const Table<2,bool> &) const; -#ifdef DEAL_II_USE_TRILINOS -template void ConstraintMatrix:: -add_entries_local_to_global - (const std::vector &, - TrilinosWrappers::SparsityPattern &, - const bool, - const Table<2,bool> &) const; -#endif -template void ConstraintMatrix:: -add_entries_local_to_global (const std::vector &, - BlockSparsityPattern &, - const bool, - const Table<2,bool> &) const; -template void ConstraintMatrix:: -add_entries_local_to_global (const std::vector &, - BlockCompressedSparsityPattern &, - const bool, - const Table<2,bool> &) const; -template void ConstraintMatrix:: -add_entries_local_to_global (const std::vector &, - BlockCompressedSetSparsityPattern &, - const bool, - const Table<2,bool> &) const; -template void ConstraintMatrix:: -add_entries_local_to_global (const std::vector &, - BlockCompressedSimpleSparsityPattern &, - const bool, - const Table<2,bool> &) const; +#define SPARSITY_FUNCTIONS(SparsityType) \ + template void ConstraintMatrix::add_entries_local_to_global (\ + const std::vector &, \ + SparsityType &, \ + const bool, \ + const Table<2,bool> &) const + +SPARSITY_FUNCTIONS(SparsityPattern); +SPARSITY_FUNCTIONS(CompressedSparsityPattern); +SPARSITY_FUNCTIONS(CompressedSetSparsityPattern); +SPARSITY_FUNCTIONS(CompressedSimpleSparsityPattern); +SPARSITY_FUNCTIONS(BlockSparsityPattern); +SPARSITY_FUNCTIONS(BlockCompressedSparsityPattern); +SPARSITY_FUNCTIONS(BlockCompressedSetSparsityPattern); +SPARSITY_FUNCTIONS(BlockCompressedSimpleSparsityPattern); + #ifdef DEAL_II_USE_TRILINOS -template void ConstraintMatrix:: -add_entries_local_to_global - (const std::vector &, - TrilinosWrappers::BlockSparsityPattern &, - const bool, - const Table<2,bool> &) const; +SPARSITY_FUNCTIONS(TrilinosWrappers::SparsityPattern); +SPARSITY_FUNCTIONS(TrilinosWrappers::BlockSparsityPattern); #endif DEAL_II_NAMESPACE_CLOSE