trilinos_rcp();
/** @} */
+ /**
+ * @name Partitioners
+ */
+ /** @{ */
+
+ /**
+ * Return the partitioning of the domain space of this matrix, i.e., the
+ * partitioning of the vectors this matrix has to be multiplied with.
+ */
+ IndexSet
+ locally_owned_domain_indices() const;
+
+ /**
+ * Return the partitioning of the range space of this matrix, i.e., the
+ * partitioning of the vectors that are result from matrix-vector
+ * products.
+ */
+ IndexSet
+ locally_owned_range_indices() const;
+
+ /** @} */
+
/**
* @addtogroup Exceptions
*/
return matrix;
}
+
+
+ template <typename Number, typename MemorySpace>
+ inline IndexSet
+ SparseMatrix<Number, MemorySpace>::locally_owned_domain_indices() const
+ {
+ return IndexSet(matrix->getDomainMap());
+ }
+
+
+
+ template <typename Number, typename MemorySpace>
+ inline IndexSet
+ SparseMatrix<Number, MemorySpace>::locally_owned_range_indices() const
+ {
+ return IndexSet(matrix->getRangeMap());
+ }
+
} // namespace TpetraWrappers
} // namespace LinearAlgebra
} // namespace LinearAlgebra
+
+namespace internal
+{
+ namespace LinearOperatorImplementation
+ {
+ template <typename>
+ class ReinitHelper;
+
+ /**
+ * A helper class used internally in linear_operator.h. Specialization for
+ * LinearAlgebra::TpetraWrappers::Vector<Number, MemorySpace>.
+ */
+ template <typename Number, typename MemorySpace>
+ class ReinitHelper<
+ LinearAlgebra::TpetraWrappers::Vector<Number, MemorySpace>>
+ {
+ public:
+ template <typename Matrix>
+ static void
+ reinit_range_vector(
+ const Matrix &matrix,
+ LinearAlgebra::TpetraWrappers::Vector<Number, MemorySpace> &v,
+ bool omit_zeroing_entries)
+ {
+ v.reinit(matrix.locally_owned_range_indices(),
+ matrix.get_mpi_communicator(),
+ omit_zeroing_entries);
+ }
+
+ template <typename Matrix>
+ static void
+ reinit_domain_vector(
+ const Matrix &matrix,
+ LinearAlgebra::TpetraWrappers::Vector<Number, MemorySpace> &v,
+ bool omit_zeroing_entries)
+ {
+ v.reinit(matrix.locally_owned_domain_indices(),
+ matrix.get_mpi_communicator(),
+ omit_zeroing_entries);
+ }
+ };
+
+ } // namespace LinearOperatorImplementation
+} /* namespace internal */
+
/**
* Declare dealii::LinearAlgebra::TpetraWrappers::Vector as distributed vector.
*/
#include <deal.II/lac/linear_operator.h>
#include <deal.II/lac/trilinos_block_sparse_matrix.h>
#include <deal.II/lac/trilinos_sparse_matrix.h>
+#include <deal.II/lac/trilinos_tpetra_sparse_matrix.h>
+#include <deal.II/lac/trilinos_tpetra_vector.h>
#include <deal.II/lac/trilinos_vector.h>
#include "../tests.h"
initlog();
deallog << std::setprecision(10);
- TrilinosWrappers::SparseMatrix a;
-
- auto op_a = linear_operator<TrilinosWrappers::MPI::Vector>(a);
- auto op_a2 = linear_operator<TrilinosWrappers::MPI::Vector>(a);
-
- TrilinosWrappers::BlockSparseMatrix b;
-
- auto op_b = linear_operator<TrilinosWrappers::MPI::BlockVector>(b);
- auto op_b3 = linear_operator<TrilinosWrappers::MPI::BlockVector>(b);
+ {
+ TrilinosWrappers::SparseMatrix a;
+ auto op_a = linear_operator<TrilinosWrappers::MPI::Vector>(a);
+ auto op_a2 = linear_operator<TrilinosWrappers::MPI::Vector>(a);
+ }
+
+#ifdef DEAL_II_TRILINOS_WITH_TPETRA
+ {
+ LinearAlgebra::TpetraWrappers::SparseMatrix<double> a;
+ auto op_a =
+ linear_operator<LinearAlgebra::TpetraWrappers::Vector<double>>(a);
+ auto op_a2 =
+ linear_operator<LinearAlgebra::TpetraWrappers::Vector<double>>(a);
+ }
+#endif
+
+ {
+ TrilinosWrappers::BlockSparseMatrix b;
+ auto op_b = linear_operator<TrilinosWrappers::MPI::BlockVector>(b);
+ auto op_b3 = linear_operator<TrilinosWrappers::MPI::BlockVector>(b);
+ }
deallog << "OK" << std::endl;
#include <deal.II/base/mpi.h>
+#include <deal.II/lac/trilinos_tpetra_vector.h>
#include <deal.II/lac/trilinos_vector.h>
#include <deal.II/lac/vector_memory.h>
do_test<TrilinosWrappers::MPI::Vector>();
do_test<TrilinosWrappers::MPI::Vector>();
+
+#ifdef DEAL_II_TRILINOS_WITH_TPETRA
+ do_test<LinearAlgebra::TpetraWrappers::Vector<double>>();
+ do_test<LinearAlgebra::TpetraWrappers::Vector<double>>();
+#endif
}