const bool exchange_data)
{
# ifdef DEBUG
- std::vector<typename BlockType::MapType> tpetra_maps;
+ std::vector<typename TpetraTypes::MapType<MemorySpace>> tpetra_maps;
for (size_type i = 0; i < block_sparsity_pattern.n_block_rows(); ++i)
tpetra_maps.push_back(
parallel_partitioning[i].make_tpetra_map(communicator, false));
#include <deal.II/base/config.h>
+#include "deal.II/base/memory_space.h"
+
+#include <deal.II/lac/trilinos_tpetra_types.h>
+
#ifdef DEAL_II_TRILINOS_WITH_TPETRA
# include <deal.II/base/communication_pattern_base.h>
class CommunicationPattern : public Utilities::MPI::CommunicationPatternBase
{
public:
+ using MemorySpace = dealii::MemorySpace::Host;
/**
* Initialize the communication pattern.
*
/**
* Return the underlying Tpetra::Import object.
*/
- const Tpetra::Import<int, types::signed_global_dof_index> &
+ const TpetraTypes::ImportType<MemorySpace> &
get_tpetra_import() const;
/**
* Return a Teuchos::RCP to the underlying Tpetra::Import object.
*/
- Teuchos::RCP<const Tpetra::Import<int, types::signed_global_dof_index>>
+ Teuchos::RCP<TpetraTypes::ImportType<MemorySpace>>
get_tpetra_import_rcp() const;
/**
* Return the underlying Tpetra::Export object.
*/
- const Tpetra::Export<int, types::signed_global_dof_index> &
+ const TpetraTypes::ExportType<MemorySpace> &
get_tpetra_export() const;
/**
* Return a Teuchos::RCP to the underlying Tpetra::Export object.
*/
- Teuchos::RCP<const Tpetra::Export<int, types::signed_global_dof_index>>
+ Teuchos::RCP<TpetraTypes::ExportType<MemorySpace>>
get_tpetra_export_rcp() const;
private:
/**
* Teuchos::RCP to the Tpetra::Import object used.
*/
- Teuchos::RCP<Tpetra::Import<int, types::signed_global_dof_index>>
- tpetra_import;
+ Teuchos::RCP<TpetraTypes::ImportType<MemorySpace>> tpetra_import;
/**
* Teuchos::RCP to the Tpetra::Export object used.
*/
- Teuchos::RCP<Tpetra::Export<int, types::signed_global_dof_index>>
- tpetra_export;
+ Teuchos::RCP<TpetraTypes::ExportType<MemorySpace>> tpetra_export;
};
} // end of namespace TpetraWrappers
} // end of namespace LinearAlgebra
#include "deal.II/grid/grid_generator.h"
+#include "deal.II/lac/trilinos_tpetra_types.h"
+
#include <string>
#ifdef DEAL_II_TRILINOS_WITH_TPETRA
class SolverDirectBase
{
public:
- /**
- * Declare the type for container size.
- */
- using size_type = dealii::types::signed_global_dof_index;
-
- /**
- * Typedef for the NodeType
- */
-# if DEAL_II_TRILINOS_VERSION_GTE(14, 2, 0)
- using NodeType = Tpetra::KokkosCompat::KokkosDeviceWrapperNode<
- typename MemorySpace::kokkos_space::execution_space,
- typename MemorySpace::kokkos_space>;
-# else
- using NodeType = Kokkos::Compat::KokkosDeviceWrapperNode<
- typename MemorySpace::kokkos_space::execution_space,
- typename MemorySpace::kokkos_space>;
-# endif
-
- /**
- * Typedef for the LinearOperator type
- */
- using LinearOperator = Tpetra::Operator<Number, int, size_type, NodeType>;
-
- /**
- * Typedef for the MultiVector type
- */
- using MultiVector = Tpetra::MultiVector<Number, int, size_type, NodeType>;
-
/**
* Destructor.
*/
* A structure that contains the Trilinos solver object.
*/
Teuchos::RCP<
- Amesos2::Solver<typename SparseMatrix<Number, MemorySpace>::MatrixType,
- MultiVector>>
+ Amesos2::Solver<TpetraTypes::MatrixType<Number, MemorySpace>,
+ TpetraTypes::MultiVectorType<Number, MemorySpace>>>
solver;
/*
#include <deal.II/base/config.h>
#include "deal.II/lac/solver_control.h"
+#include "deal.II/lac/trilinos_tpetra_types.h"
#include <string>
{
// Allocate the Amesos2 solver with the concrete solver, if possible.
solver =
- Amesos2::create<typename SparseMatrix<Number, MemorySpace>::MatrixType,
- MultiVector>(solver_type, A.trilinos_rcp());
+ Amesos2::create<TpetraTypes::MatrixType<Number, MemorySpace>,
+ TpetraTypes::MultiVectorType<Number, MemorySpace>>(
+ solver_type, A.trilinos_rcp());
solver->setParameters(Teuchos::rcpFromRef(parameter_list));
// Now do the actual factorization, which is a two step procedure.
const Vector<Number, MemorySpace> &b)
{
solver =
- Amesos2::create<typename SparseMatrix<Number, MemorySpace>::MatrixType,
- MultiVector>(solver_type,
- A.trilinos_rcp(),
- x.trilinos_rcp(),
- b.trilinos_rcp());
+ Amesos2::create<TpetraTypes::MatrixType<Number, MemorySpace>,
+ TpetraTypes::MultiVectorType<Number, MemorySpace>>(
+ solver_type, A.trilinos_rcp(), x.trilinos_rcp(), b.trilinos_rcp());
do_solve();
}
*/
using value_type = Number;
- /**
- * Typedef for the NodeType
- */
-# if DEAL_II_TRILINOS_VERSION_GTE(14, 2, 0)
- using NodeType = Tpetra::KokkosCompat::KokkosDeviceWrapperNode<
- typename MemorySpace::kokkos_space::execution_space,
- typename MemorySpace::kokkos_space>;
-# else
- using NodeType = Kokkos::Compat::KokkosDeviceWrapperNode<
- typename MemorySpace::kokkos_space::execution_space,
- typename MemorySpace::kokkos_space>;
-# endif
-
- /**
- * Typedef for Tpetra::CrsMatrix
- */
- using MatrixType =
- Tpetra::CrsMatrix<Number,
- int,
- dealii::types::signed_global_dof_index,
- NodeType>;
-
- /**
- * Typedef for Tpetra::Map
- */
- using MapType =
- Tpetra::Map<int, dealii::types::signed_global_dof_index, NodeType>;
-
- /**
- * Typedef for Tpetra::CrsGraph
- */
- using GraphType =
- Tpetra::CrsGraph<int, dealii::types::signed_global_dof_index, NodeType>;
-
- /**
- * Typedef for Tpetra::Vector
- */
- using VectorType = Tpetra::
- Vector<Number, int, dealii::types::signed_global_dof_index, NodeType>;
-
/**
* @name Constructors and initialization.
*/
* href="https://docs.trilinos.org/dev/packages/tpetra/doc/html/classTpetra_1_1CrsMatrix.html">Tpetra::CrsMatrix</a>
* class.
*/
- const MatrixType &
+ const TpetraTypes::MatrixType<Number, MemorySpace> &
trilinos_matrix() const;
/**
* href="https://docs.trilinos.org/dev/packages/tpetra/doc/html/classTpetra_1_1CrsMatrix.html">Tpetra::CrsMatrix</a>
* class.
*/
- MatrixType &
+ TpetraTypes::MatrixType<Number, MemorySpace> &
trilinos_matrix();
/**
* href="https://docs.trilinos.org/dev/packages/tpetra/doc/html/classTpetra_1_1CrsMatrix.html">Tpetra::CrsMatrix</a>
* class.
*/
- Teuchos::RCP<const MatrixType>
+ Teuchos::RCP<const TpetraTypes::MatrixType<Number, MemorySpace>>
trilinos_rcp() const;
/**
* href="https://docs.trilinos.org/dev/packages/tpetra/doc/html/classTpetra_1_1CrsMatrix.html">Tpetra::CrsMatrix</a>
* class.
*/
- Teuchos::RCP<MatrixType>
+ Teuchos::RCP<TpetraTypes::MatrixType<Number, MemorySpace>>
trilinos_rcp();
/** @} */
* information from the column space map is used to speed up the
* assembly process.
*/
- Teuchos::RCP<MapType> column_space_map;
+ Teuchos::RCP<TpetraTypes::MapType<MemorySpace>> column_space_map;
/**
* A sparse matrix object in Trilinos to be used for finite element based
* problems which allows for assembling into non-local elements. The
* actual type, a sparse matrix, is set in the constructor.
*/
- Teuchos::RCP<MatrixType> matrix;
+ Teuchos::RCP<TpetraTypes::MatrixType<Number, MemorySpace>> matrix;
/**
* A boolean variable to hold information on whether the matrix is
template <typename Number, typename MemorySpace>
- inline const Tpetra::CrsMatrix<
- Number,
- int,
- types::signed_global_dof_index,
- typename SparseMatrix<Number, MemorySpace>::NodeType> &
+ inline const TpetraTypes::MatrixType<Number, MemorySpace> &
SparseMatrix<Number, MemorySpace>::trilinos_matrix() const
{
return *matrix;
template <typename Number, typename MemorySpace>
- inline Tpetra::CrsMatrix<
- Number,
- int,
- types::signed_global_dof_index,
- typename SparseMatrix<Number, MemorySpace>::NodeType> &
+ inline TpetraTypes::MatrixType<Number, MemorySpace> &
SparseMatrix<Number, MemorySpace>::trilinos_matrix()
{
return *matrix;
template <typename Number, typename MemorySpace>
- inline Teuchos::RCP<const Tpetra::CrsMatrix<
- Number,
- int,
- types::signed_global_dof_index,
- typename SparseMatrix<Number, MemorySpace>::NodeType>>
+ inline Teuchos::RCP<const TpetraTypes::MatrixType<Number, MemorySpace>>
SparseMatrix<Number, MemorySpace>::trilinos_rcp() const
{
return matrix.getConst();
template <typename Number, typename MemorySpace>
- inline Teuchos::RCP<
- Tpetra::CrsMatrix<Number,
- int,
- types::signed_global_dof_index,
- typename SparseMatrix<Number, MemorySpace>::NodeType>>
+ inline Teuchos::RCP<TpetraTypes::MatrixType<Number, MemorySpace>>
SparseMatrix<Number, MemorySpace>::trilinos_rcp()
{
return matrix;
}
# if DEAL_II_TRILINOS_VERSION_GTE(13, 2, 0)
- typename SparseMatrix<Number, MemorySpace>::MatrixType::
+ typename TpetraTypes::MatrixType<Number, MemorySpace>::
nonconst_global_inds_host_view_type col_indices(colnum_cache->data(),
colnums);
- typename SparseMatrix<Number, MemorySpace>::MatrixType::
+ typename TpetraTypes::MatrixType<Number, MemorySpace>::
nonconst_values_host_view_type values(value_cache->data(), colnums);
# else
Teuchos::ArrayView<dealii::types::signed_global_dof_index> col_indices(
#include <deal.II/base/config.h>
+#include "deal.II/base/types.h"
+
+#include "deal.II/lac/trilinos_tpetra_types.h"
+
#ifdef DEAL_II_TRILINOS_WITH_TPETRA
# include <deal.II/lac/dynamic_sparsity_pattern.h>
// get a Kokkos::DualView
auto mirror_view_dst = Kokkos::create_mirror_view_and_copy(
typename MemorySpace::kokkos_space{}, kokkos_view_dst);
- typename SparseMatrix<Number, MemorySpace>::VectorType::dual_view_type
+ typename TpetraTypes::VectorType<Number, MemorySpace>::dual_view_type
kokkos_dual_view_dst(mirror_view_dst, kokkos_view_dst);
// create the Tpetra::Vector
- typename SparseMatrix<Number, MemorySpace>::VectorType tpetra_dst(
+ typename TpetraTypes::VectorType<Number, MemorySpace> tpetra_dst(
M.trilinos_matrix().getRangeMap(), kokkos_dual_view_dst);
// For the src vector:
// get a Kokkos::DualView
auto mirror_view_src = Kokkos::create_mirror_view_and_copy(
typename MemorySpace::kokkos_space{}, kokkos_view_src);
- typename SparseMatrix<Number, MemorySpace>::VectorType::dual_view_type
+ typename TpetraTypes::VectorType<Number, MemorySpace>::dual_view_type
kokkos_dual_view_src(mirror_view_src, kokkos_view_src);
// create the Tpetra::Vector
- typename SparseMatrix<Number, MemorySpace>::VectorType tpetra_src(
+ typename TpetraTypes::VectorType<Number, MemorySpace> tpetra_src(
M.trilinos_matrix().getDomainMap(), kokkos_dual_view_src);
M.trilinos_matrix().apply(tpetra_src, tpetra_dst, mode, alpha, beta);
{
using size_type = dealii::types::signed_global_dof_index;
- template <typename NodeType>
- using MapType =
- Tpetra::Map<int, dealii::types::signed_global_dof_index, NodeType>;
-
- template <typename Number, typename NodeType>
- using MatrixType =
- Tpetra::CrsMatrix<Number,
- int,
- dealii::types::signed_global_dof_index,
- NodeType>;
-
- template <typename NodeType>
- using GraphType =
- Tpetra::CrsGraph<int, dealii::types::signed_global_dof_index, NodeType>;
-
template <typename Number,
- typename NodeType,
+ typename MemorySpace,
typename SparsityPatternType>
void
- reinit_matrix(const IndexSet &row_parallel_partitioning,
- const IndexSet &column_parallel_partitioning,
- const SparsityPatternType &sparsity_pattern,
- const bool exchange_data,
- const MPI_Comm communicator,
- Teuchos::RCP<MapType<NodeType>> &column_space_map,
- Teuchos::RCP<MatrixType<Number, NodeType>> &matrix)
+ reinit_matrix(
+ const IndexSet &row_parallel_partitioning,
+ const IndexSet &column_parallel_partitioning,
+ const SparsityPatternType &sparsity_pattern,
+ const bool exchange_data,
+ const MPI_Comm communicator,
+ Teuchos::RCP<TpetraTypes::MapType<MemorySpace>> &column_space_map,
+ Teuchos::RCP<TpetraTypes::MatrixType<Number, MemorySpace>> &matrix)
{
// release memory before reallocation
matrix.reset();
// Get the Tpetra::Maps
- Teuchos::RCP<MapType<NodeType>> row_space_map =
+ Teuchos::RCP<TpetraTypes::MapType<MemorySpace>> row_space_map =
row_parallel_partitioning.make_tpetra_map_rcp(communicator, false);
column_space_map =
communicator,
exchange_data);
matrix = Utilities::Trilinos::internal::make_rcp<
- MatrixType<Number, NodeType>>(
+ TpetraTypes::MatrixType<Number, MemorySpace>>(
trilinos_sparsity.trilinos_sparsity_pattern());
return;
// internal reordering is done on ints only, and we can leave the
// doubles aside.
# if DEAL_II_TRILINOS_VERSION_GTE(12, 16, 0)
- Teuchos::RCP<GraphType<NodeType>> graph =
- Utilities::Trilinos::internal::make_rcp<GraphType<NodeType>>(
- row_space_map, n_entries_per_row);
+ Teuchos::RCP<TpetraTypes::GraphType<MemorySpace>> graph =
+ Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::GraphType<MemorySpace>>(row_space_map,
+ n_entries_per_row);
# else
- Teuchos::RCP<GraphType<NodeType>> graph =
- Utilities::Trilinos::internal::make_rcp<GraphType<NodeType>>(
+ Teuchos::RCP<TpetraTypes::GraphType<MemorySpace>> graph =
+ Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::GraphType<MemorySpace>>(
row_space_map, Teuchos::arcpFromArray(n_entries_per_row));
# endif
AssertDimension(sparsity_pattern.n_cols(), graph->getGlobalNumCols());
// And now finally generate the matrix.
- matrix =
- Utilities::Trilinos::internal::make_rcp<MatrixType<Number, NodeType>>(
- graph);
+ matrix = Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::MatrixType<Number, MemorySpace>>(graph);
}
- template <typename Number, typename NodeType>
+ template <typename Number, typename MemorySpace>
void
- reinit_matrix(const IndexSet &row_parallel_partitioning,
- const IndexSet &column_parallel_partitioning,
- const DynamicSparsityPattern &sparsity_pattern,
- const bool exchange_data,
- const MPI_Comm communicator,
- Teuchos::RCP<MapType<NodeType>> &column_space_map,
- Teuchos::RCP<MatrixType<Number, NodeType>> &matrix)
+ reinit_matrix(
+ const IndexSet &row_parallel_partitioning,
+ const IndexSet &column_parallel_partitioning,
+ const DynamicSparsityPattern &sparsity_pattern,
+ const bool exchange_data,
+ const MPI_Comm communicator,
+ Teuchos::RCP<TpetraTypes::MapType<MemorySpace>> &column_space_map,
+ Teuchos::RCP<TpetraTypes::MatrixType<Number, MemorySpace>> &matrix)
{
// release memory before reallocation
matrix.reset();
// Get the Tpetra::Maps
- Teuchos::RCP<MapType<NodeType>> row_space_map =
+ Teuchos::RCP<TpetraTypes::MapType<MemorySpace>> row_space_map =
row_parallel_partitioning.make_tpetra_map_rcp(communicator, false);
column_space_map =
communicator,
exchange_data);
matrix = Utilities::Trilinos::internal::make_rcp<
- MatrixType<Number, NodeType>>(
+ TpetraTypes::MatrixType<Number, MemorySpace>>(
trilinos_sparsity.trilinos_sparsity_pattern());
return;
// internal reordering is done on ints only, and we can leave the
// doubles aside.
# if DEAL_II_TRILINOS_VERSION_GTE(12, 16, 0)
- Teuchos::RCP<GraphType<NodeType>> graph =
- Utilities::Trilinos::internal::make_rcp<GraphType<NodeType>>(
- row_space_map, n_entries_per_row);
+ Teuchos::RCP<TpetraTypes::GraphType<MemorySpace>> graph =
+ Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::GraphType<MemorySpace>>(row_space_map,
+ n_entries_per_row);
# else
- Teuchos::RCP<GraphType<NodeType>> graph =
- Utilities::Trilinos::internal::make_rcp<GraphType<NodeType>>(
+ Teuchos::RCP<TpetraTypes::GraphType<MemorySpace>> graph =
+ Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::GraphType<MemorySpace>>(
row_space_map, Teuchos::arcpFromArray(n_entries_per_row));
# endif
AssertDimension(sparsity_pattern.n_cols(), graph->getGlobalNumCols());
// And now finally generate the matrix.
- matrix =
- Utilities::Trilinos::internal::make_rcp<MatrixType<Number, NodeType>>(
- graph);
+ matrix = Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::MatrixType<Number, MemorySpace>>(graph);
}
} // namespace SparseMatrixImpl
// thread on a configuration with MPI will still get a parallel interface.
template <typename Number, typename MemorySpace>
SparseMatrix<Number, MemorySpace>::SparseMatrix()
- : column_space_map(Utilities::Trilinos::internal::make_rcp<MapType>(
+ : column_space_map(Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::MapType<MemorySpace>>(
0,
0,
Utilities::Trilinos::tpetra_comm_self()))
{
// Prepare the graph
- Teuchos::RCP<GraphType> graph =
- Utilities::Trilinos::internal::make_rcp<GraphType>(column_space_map,
- column_space_map,
- 0);
+ Teuchos::RCP<TpetraTypes::GraphType<MemorySpace>> graph =
+ Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::GraphType<MemorySpace>>(column_space_map,
+ column_space_map,
+ 0);
graph->fillComplete();
// Create the matrix from the graph
- matrix = Utilities::Trilinos::internal::make_rcp<MatrixType>(graph);
+ matrix = Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::MatrixType<Number, MemorySpace>>(graph);
compressed = false;
}
template <typename Number, typename MemorySpace>
SparseMatrix<Number, MemorySpace>::SparseMatrix(
const SparsityPattern<MemorySpace> &sparsity_pattern)
- : matrix(Utilities::Trilinos::internal::make_rcp<MatrixType>(
+ : matrix(Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::MatrixType<Number, MemorySpace>>(
sparsity_pattern.trilinos_sparsity_pattern()))
{
column_space_map =
- Teuchos::rcp_const_cast<MapType>(sparsity_pattern.domain_partitioner());
+ Teuchos::rcp_const_cast<TpetraTypes::MapType<MemorySpace>>(
+ sparsity_pattern.domain_partitioner());
compressed = false;
compress(VectorOperation::add);
}
const size_type m,
const size_type n,
const unsigned int n_max_entries_per_row)
- : column_space_map(Utilities::Trilinos::internal::make_rcp<MapType>(
- n,
+ : column_space_map(Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::MapType<MemorySpace>>(
+ static_cast<dealii::types::signed_global_dof_index>(n),
0,
Utilities::Trilinos::tpetra_comm_self()))
- , matrix(Utilities::Trilinos::internal::make_rcp<MatrixType>(
- Utilities::Trilinos::internal::make_rcp<MapType>(
- m,
+ , matrix(Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::MatrixType<Number, MemorySpace>>(
+ Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::MapType<MemorySpace>>(
+ static_cast<dealii::types::signed_global_dof_index>(m),
0,
Utilities::Trilinos::tpetra_comm_self()),
column_space_map,
const size_type m,
const size_type n,
const std::vector<unsigned int> &n_entries_per_row)
- : column_space_map(Utilities::Trilinos::internal::make_rcp<MapType>(
+ : column_space_map(Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::MapType<MemorySpace>>(
n,
0,
Utilities::Trilinos::tpetra_comm_self()))
{
std::vector<size_t> entries_per_row_size_type(n_entries_per_row.begin(),
n_entries_per_row.end());
- matrix = Utilities::Trilinos::internal::make_rcp<MatrixType>(
- Utilities::Trilinos::internal::make_rcp<MapType>(
+ matrix = Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::MatrixType<Number, MemorySpace>>(
+ Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::MapType<MemorySpace>>(
m, 0, Utilities::Trilinos::tpetra_comm_self()),
column_space_map,
# if DEAL_II_TRILINOS_VERSION_GTE(13, 2, 0)
SparseMatrix<Number, MemorySpace>::reinit(
const SparsityPatternType &sparsity_pattern)
{
- SparseMatrixImpl::reinit_matrix<Number, NodeType, SparsityPatternType>(
+ SparseMatrixImpl::reinit_matrix<Number, MemorySpace, SparsityPatternType>(
complete_index_set(sparsity_pattern.n_rows()),
complete_index_set(sparsity_pattern.n_cols()),
sparsity_pattern,
// reinit with a (distributed) Trilinos sparsity pattern.
column_space_map =
- Teuchos::rcp_const_cast<MapType>(sparsity_pattern.domain_partitioner());
- matrix = Utilities::Trilinos::internal::make_rcp<MatrixType>(
+ Teuchos::rcp_const_cast<TpetraTypes::MapType<MemorySpace>>(
+ sparsity_pattern.domain_partitioner());
+ matrix = Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::MatrixType<Number, MemorySpace>>(
sparsity_pattern.trilinos_sparsity_pattern());
compressed = false;
const unsigned int n_max_entries_per_row)
: column_space_map(
parallel_partitioning.make_tpetra_map_rcp(communicator, false))
- , matrix(Utilities::Trilinos::internal::make_rcp<MatrixType>(
+ , matrix(Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::MatrixType<Number, MemorySpace>>(
column_space_map,
n_max_entries_per_row))
, compressed(false)
Teuchos::Array<size_t> n_entries_per_row_array(n_entries_per_row.begin(),
n_entries_per_row.end());
# if DEAL_II_TRILINOS_VERSION_GTE(12, 16, 0)
- matrix = Utilities::Trilinos::internal::make_rcp<MatrixType>(
- column_space_map, n_entries_per_row_array);
+ matrix = Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::MatrixType<Number, MemorySpace>>(column_space_map,
+ n_entries_per_row_array);
# else
- matrix = Utilities::Trilinos::internal::make_rcp<MatrixType>(
+ matrix = Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::MatrixType<Number, MemorySpace>>(
column_space_map, Teuchos::arcpFromArray(n_entries_per_row_array));
# endif
}
const size_type n_max_entries_per_row)
: column_space_map(
col_parallel_partitioning.make_tpetra_map_rcp(communicator, false))
- , matrix(Utilities::Trilinos::internal::make_rcp<MatrixType>(
+ , matrix(Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::MatrixType<Number, MemorySpace>>(
row_parallel_partitioning.make_tpetra_map_rcp(communicator, false),
n_max_entries_per_row))
, compressed(false)
Teuchos::Array<size_t> n_entries_per_row_array(n_entries_per_row.begin(),
n_entries_per_row.end());
# if DEAL_II_TRILINOS_VERSION_GTE(12, 16, 0)
- matrix = Utilities::Trilinos::internal::make_rcp<MatrixType>(
+ matrix = Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::MatrixType<Number, MemorySpace>>(
row_parallel_partitioning.make_tpetra_map_rcp(communicator, false),
n_entries_per_row_array);
# else
- matrix = Utilities::Trilinos::internal::make_rcp<MatrixType>(
+ matrix = Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::MatrixType<Number, MemorySpace>>(
row_parallel_partitioning.make_tpetra_map_rcp(communicator, false),
Teuchos::arcpFromArray(n_entries_per_row_array));
# endif
const MPI_Comm communicator,
const bool exchange_data)
{
- SparseMatrixImpl::reinit_matrix<Number, NodeType, SparsityPatternType>(
+ SparseMatrixImpl::reinit_matrix<Number, MemorySpace, SparsityPatternType>(
row_parallel_partitioning,
col_parallel_partitioning,
sparsity_pattern,
matrix->getDomainMap(),
matrix->getRangeMap(),
Teuchos::null);
+ // needs a local typedef or Assert thinks it gets more arguments than it
+ // does...
+ using MatrixType = TpetraTypes::MatrixType<Number, MemorySpace>;
Assert(dynamic_cast<MatrixType *>(result.get()), ExcInternalError());
- matrix.reset(dynamic_cast<MatrixType *>(result.release().get()));
+ matrix.reset(dynamic_cast<TpetraTypes::MatrixType<Number, MemorySpace> *>(
+ result.release().get()));
}
col_indices_vector.resize(nnz);
values_vector.resize(nnz);
# if DEAL_II_TRILINOS_VERSION_GTE(13, 2, 0)
- typename MatrixType::nonconst_local_inds_host_view_type
- col_indices(col_indices_vector.data(), nnz);
- typename MatrixType::nonconst_values_host_view_type values(
- values_vector.data(), nnz);
+ typename TpetraTypes::MatrixType<Number, MemorySpace>::
+ nonconst_local_inds_host_view_type col_indices(
+ col_indices_vector.data(), nnz);
+ typename TpetraTypes::MatrixType<Number, MemorySpace>::
+ nonconst_values_host_view_type values(values_vector.data(),
+ nnz);
# else
Teuchos::ArrayView<int> col_indices(col_indices_vector);
Teuchos::ArrayView<Number> values(values_vector);
// Perform a deep copy
# if DEAL_II_TRILINOS_VERSION_GTE(12, 18, 1)
- matrix =
- Utilities::Trilinos::internal::make_rcp<MatrixType>(*source.matrix,
- Teuchos::Copy);
+ matrix = Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::MatrixType<Number, MemorySpace>>(*source.matrix,
+ Teuchos::Copy);
# else
matrix = source.matrix->clone(
Utilities::Trilinos::internal::make_rcp<NodeType>());
# endif
- column_space_map = Teuchos::rcp_const_cast<MapType>(matrix->getColMap());
- compressed = source.compressed;
+ column_space_map =
+ Teuchos::rcp_const_cast<TpetraTypes::MapType<MemorySpace>>(
+ matrix->getColMap());
+ compressed = source.compressed;
}
// When we clear the matrix, reset
// the pointer and generate an
// empty matrix.
- column_space_map = Utilities::Trilinos::internal::make_rcp<MapType>(
+ column_space_map = Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::MapType<MemorySpace>>(
0, 0, Utilities::Trilinos::tpetra_comm_self());
// Prepare the graph
- Teuchos::RCP<GraphType> graph =
- Utilities::Trilinos::internal::make_rcp<GraphType>(column_space_map,
- column_space_map,
- 0);
+ Teuchos::RCP<TpetraTypes::GraphType<MemorySpace>> graph =
+ Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::GraphType<MemorySpace>>(column_space_map,
+ column_space_map,
+ 0);
graph->fillComplete();
// Create the matrix from the graph
- matrix = Utilities::Trilinos::internal::make_rcp<MatrixType>(graph);
+ matrix = Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::MatrixType<Number, MemorySpace>>(graph);
compressed = true;
}
else
{
# if DEAL_II_TRILINOS_VERSION_GTE(13, 2, 0)
- typename MatrixType::values_host_view_type values;
- typename MatrixType::local_inds_host_view_type indices;
+ typename TpetraTypes::MatrixType<Number,
+ MemorySpace>::values_host_view_type
+ values;
+ typename TpetraTypes::MatrixType<Number, MemorySpace>::
+ local_inds_host_view_type indices;
# else
Teuchos::ArrayView<const Number> values;
Teuchos::ArrayView<const int> indices;
// Prepare pointers for extraction of a view of the row.
size_t nnz_present = matrix->getNumEntriesInLocalRow(trilinos_i);
# if DEAL_II_TRILINOS_VERSION_GTE(13, 2, 0)
- typename MatrixType::nonconst_local_inds_host_view_type col_indices(
- "indices", nnz_present);
- typename MatrixType::nonconst_values_host_view_type values(
- "values", nnz_present);
+ typename TpetraTypes::MatrixType<Number, MemorySpace>::
+ nonconst_local_inds_host_view_type col_indices("indices",
+ nnz_present);
+ typename TpetraTypes::MatrixType<Number, MemorySpace>::
+ nonconst_values_host_view_type values("values", nnz_present);
# else
std::vector<int> col_indices_vector(nnz_present);
Teuchos::ArrayView<int> col_indices(col_indices_vector);
#include <deal.II/base/config.h>
+#include "deal.II/base/types.h"
+
+#include "deal.II/lac/trilinos_tpetra_types.h"
+
#ifdef DEAL_II_TRILINOS_WITH_TPETRA
# include <deal.II/base/index_set.h>
/**
* Declare type for container size.
*/
- using size_type = dealii::types::signed_global_dof_index;
-
- /**
- * Typedef for the NodeType
- */
-# if DEAL_II_TRILINOS_VERSION_GTE(14, 2, 0)
- using NodeType = Tpetra::KokkosCompat::KokkosDeviceWrapperNode<
- typename MemorySpace::kokkos_space::execution_space,
- typename MemorySpace::kokkos_space>;
-# else
- using NodeType = Kokkos::Compat::KokkosDeviceWrapperNode<
- typename MemorySpace::kokkos_space::execution_space,
- typename MemorySpace::kokkos_space>;
-# endif
+ using size_type = dealii::types::global_dof_index;
/**
* Constructor.
/**
* Declare type for container size.
*/
- using size_type = size_t;
-
- /**
- * Typedef for the NodeType
- */
-# if DEAL_II_TRILINOS_VERSION_GTE(14, 2, 0)
- using NodeType = Tpetra::KokkosCompat::KokkosDeviceWrapperNode<
- typename MemorySpace::kokkos_space::execution_space,
- typename MemorySpace::kokkos_space>;
-# else
- using NodeType = Kokkos::Compat::KokkosDeviceWrapperNode<
- typename MemorySpace::kokkos_space::execution_space,
- typename MemorySpace::kokkos_space>;
-# endif
+ using size_type = types::global_dof_index;
/**
* Constructor. Create an iterator into the matrix @p matrix for the
/**
* Declare type for container size.
*/
- using size_type = dealii::types::signed_global_dof_index;
-
- /**
- * Typedef for the NodeType
- */
-# if DEAL_II_TRILINOS_VERSION_GTE(14, 2, 0)
- using NodeType = Tpetra::KokkosCompat::KokkosDeviceWrapperNode<
- typename MemorySpace::kokkos_space::execution_space,
- typename MemorySpace::kokkos_space>;
-# else
- using NodeType = Kokkos::Compat::KokkosDeviceWrapperNode<
- typename MemorySpace::kokkos_space::execution_space,
- typename MemorySpace::kokkos_space>;
-# endif
-
+ using size_type = dealii::types::global_dof_index;
/**
* Declare an alias for the iterator class.
*/
using const_iterator = SparsityPatternIterators::Iterator<MemorySpace>;
- /**
- * Typedef for Tpetra::Map
- */
- using MapType =
- Tpetra::Map<int, dealii::types::signed_global_dof_index, NodeType>;
-
- /**
- * Typedef for Tpetra::Graph
- */
- using GraphType =
- Tpetra::CrsGraph<int, dealii::types::signed_global_dof_index, NodeType>;
-
-
/**
* @name Basic constructors and initialization
*/
* Return a Teuchos::RCP to the underlying Trilinos Tpetra::CrsGraph
* data that stores the sparsity pattern.
*/
- Teuchos::RCP<GraphType>
+ Teuchos::RCP<TpetraTypes::GraphType<MemorySpace>>
trilinos_sparsity_pattern() const;
/**
* pattern, i.e., the partitioning of the vectors matrices based on this
* sparsity pattern are multiplied with.
*/
- Teuchos::RCP<const MapType>
+ Teuchos::RCP<const TpetraTypes::MapType<MemorySpace>>
domain_partitioner() const;
/**
* i.e., the partitioning of the vectors that are result from matrix-
* vector products.
*/
- Teuchos::RCP<const MapType>
+ Teuchos::RCP<const TpetraTypes::MapType<MemorySpace>>
range_partitioner() const;
/**
* Teuchos::RCP to the user-supplied Tpetra Trilinos mapping of the matrix
* columns that assigns parts of the matrix to the individual processes.
*/
- Teuchos::RCP<MapType> column_space_map;
+ Teuchos::RCP<TpetraTypes::MapType<MemorySpace>> column_space_map;
/**
* A sparsity pattern object in Trilinos to be used for finite element
* based problems which allows for adding non-local elements to the
* pattern.
*/
- Teuchos::RCP<GraphType> graph;
+ Teuchos::RCP<TpetraTypes::GraphType<MemorySpace>> graph;
/**
* A sparsity pattern object for the non-local part of the sparsity
* when the particular constructor or reinit method with writable_rows
* argument is set
*/
- Teuchos::RCP<GraphType> nonlocal_graph;
+ Teuchos::RCP<TpetraTypes::GraphType<MemorySpace>> nonlocal_graph;
// TODO: currently only for double
friend class SparseMatrix<double, MemorySpace>;
// place the iterator on the first entry
// past this line, or at the end of the
// matrix
- for (size_type i = r + 1;
- i < static_cast<dealii::types::signed_global_dof_index>(n_rows());
- ++i)
+ for (size_type i = r + 1; i < n_rows(); ++i)
if (row_length(i) > 0)
return const_iterator(this, i, 0);
template <typename MemorySpace>
- inline Teuchos::RCP<
- Tpetra::CrsGraph<int,
- dealii::types::signed_global_dof_index,
- typename SparsityPattern<MemorySpace>::NodeType>>
+ inline Teuchos::RCP<Tpetra::CrsGraph<int,
+ dealii::types::signed_global_dof_index,
+ TpetraTypes::NodeType<MemorySpace>>>
SparsityPattern<MemorySpace>::trilinos_sparsity_pattern() const
{
return graph;
--- /dev/null
+// ------------------------------------------------------------------------
+//
+// SPDX-License-Identifier: LGPL-2.1-or-later
+// Copyright (C) 2018 - 2024 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// Part of the source code is dual licensed under Apache-2.0 WITH
+// LLVM-exception OR LGPL-2.1-or-later. Detailed license information
+// governing the source code and code contributions can be found in
+// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II.
+//
+// ------------------------------------------------------------------------
+
+#ifndef dealii_trilinos_tpetra_types_h
+#define dealii_trilinos_tpetra_types_h
+
+#include <deal.II/base/config.h>
+
+#include "deal.II/base/types.h"
+
+#ifdef DEAL_II_TRILINOS_WITH_TPETRA
+
+# include <Tpetra_Details_DefaultTypes.hpp>
+
+// Forward declarations
+# ifndef DOXYGEN
+# include <Tpetra_CrsGraph_fwd.hpp>
+# include <Tpetra_CrsMatrix_fwd.hpp>
+# include <Tpetra_Export_fwd.hpp>
+# include <Tpetra_Import_fwd.hpp>
+# include <Tpetra_Map_fwd.hpp>
+# include <Tpetra_MultiVector_fwd.hpp>
+# include <Tpetra_Operator_fwd.hpp>
+# include <Tpetra_Vector_fwd.hpp>
+
+# endif
+
+DEAL_II_NAMESPACE_OPEN
+
+namespace LinearAlgebra
+{
+ namespace TpetraWrappers
+ {
+
+ namespace TpetraTypes
+ {
+ /**
+ * local ordinate (processor local indices).
+ */
+ using LO = int;
+ /**
+ * global ordinate (global indices).
+ */
+ using GO = types::signed_global_dof_index;
+
+
+# if DEAL_II_TRILINOS_VERSION_GTE(14, 2, 0)
+ /**
+ * Where and how calculations should be executed,
+ * i.e. Host (Serial,OpenMP) or Device (GPU)
+ */
+ //
+ template <typename MemorySpace>
+ using NodeType = Tpetra::KokkosCompat::KokkosDeviceWrapperNode<
+ typename MemorySpace::kokkos_space::execution_space,
+ typename MemorySpace::kokkos_space>;
+# else
+ template <typename MemorySpace>
+ using NodeType = Kokkos::Compat::KokkosDeviceWrapperNode<
+ typename MemorySpace::kokkos_space::execution_space,
+ typename MemorySpace::kokkos_space>;
+# endif
+
+
+ /**
+ * Communication between processors.
+ */
+ template <typename MemorySpace>
+ using ExportType = Tpetra::Export<LO, GO, NodeType<MemorySpace>>;
+
+ /**
+ * Communication between processors.
+ */
+ template <typename MemorySpace>
+ using ImportType = Tpetra::Import<LO, GO, NodeType<MemorySpace>>;
+
+ /**
+ * Tpetra equivalent of IndexSet.
+ */
+ template <typename MemorySpace>
+ using MapType = Tpetra::Map<LO, GO, NodeType<MemorySpace>>;
+
+ /**
+ * Tpetra sparsity pattern type.
+ */
+ template <typename MemorySpace>
+ using GraphType = Tpetra::CrsGraph<LO, GO, NodeType<MemorySpace>>;
+
+ /**
+ * Tpetra Vector type.
+ */
+ template <typename Number, typename MemorySpace>
+ using VectorType = Tpetra::Vector<Number, LO, GO, NodeType<MemorySpace>>;
+
+ /**
+ * Tpetra type for a row column vectors.
+ */
+ template <typename Number, typename MemorySpace>
+ using MultiVectorType =
+ Tpetra::MultiVector<Number, LO, GO, NodeType<MemorySpace>>;
+
+
+ /**
+ * General Tpetra class for a linear operator,
+ * e.g. a Matrix or Preconditioner.
+ *
+ */
+ template <typename Number, typename MemorySpace>
+ using LinearOperator =
+ Tpetra::Operator<Number, LO, GO, NodeType<MemorySpace>>;
+
+
+ /**
+ * Tpetra type for a parallel distributed sparse matrix in Crs or CSR
+ * format.
+ */
+ template <typename Number, typename MemorySpace>
+ using MatrixType =
+ Tpetra::CrsMatrix<Number, LO, GO, NodeType<MemorySpace>>;
+ } // namespace TpetraTypes
+ } // namespace TpetraWrappers
+} // namespace LinearAlgebra
+DEAL_II_NAMESPACE_CLOSE
+#endif
+
+#endif
#include <deal.II/base/config.h>
+#include "deal.II/base/types.h"
+
+#include <deal.II/lac/trilinos_tpetra_types.h>
+
#ifdef DEAL_II_TRILINOS_WITH_TPETRA
# include <deal.II/base/index_set.h>
*/
namespace TpetraWrappers
{
+
/**
* This class defines type aliases that are used in vector classes
* within the TpetraWrappers namespace.
class VectorTraits
{
public:
- using size_type = dealii::types::global_dof_index;
+ using size_type = types::global_dof_index;
};
/**
/**
* Declare type for container size.
*/
- using size_type = VectorTraits::size_type;
+ using size_type = types::global_dof_index;
/**
* This class implements a wrapper for accessing the Trilinos Tpetra
/**
* Declare some of the standard types used in all containers.
*/
-# if DEAL_II_TRILINOS_VERSION_GTE(14, 2, 0)
- using NodeType = Tpetra::KokkosCompat::KokkosDeviceWrapperNode<
- typename MemorySpace::kokkos_space::execution_space,
- typename MemorySpace::kokkos_space>;
-# else
- using NodeType = Kokkos::Compat::KokkosDeviceWrapperNode<
- typename MemorySpace::kokkos_space::execution_space,
- typename MemorySpace::kokkos_space>;
-# endif
using value_type = Number;
using real_type = typename numbers::NumberTraits<Number>::real_type;
- using size_type = VectorTraits::size_type;
+ using size_type = types::global_dof_index;
using reference = internal::VectorReference<Number, MemorySpace>;
using const_reference =
const internal::VectorReference<Number, MemorySpace>;
- using MapType =
- Tpetra::Map<int, dealii::types::signed_global_dof_index, NodeType>;
- using VectorType = Tpetra::
- Vector<Number, int, dealii::types::signed_global_dof_index, NodeType>;
- using ExportType =
- Tpetra::Export<int, dealii::types::signed_global_dof_index, NodeType>;
- using ImportType =
- Tpetra::Import<int, dealii::types::signed_global_dof_index, NodeType>;
/**
* @name 1: Basic Object-handling
/**
* Copy constructor from Teuchos::RCP<Tpetra::Vector>.
*/
- Vector(const Teuchos::RCP<VectorType> V);
+ Vector(
+ const Teuchos::RCP<TpetraTypes::VectorType<Number, MemorySpace>> V);
/**
* TODO: This is not used
* Return a const reference to the underlying Trilinos
* Tpetra::Vector class.
*/
- const Tpetra::Vector<Number, int, types::signed_global_dof_index> &
+ const TpetraTypes::VectorType<Number, MemorySpace> &
trilinos_vector() const;
/**
* Return a (modifiable) reference to the underlying Trilinos
* Tpetra::Vector class.
*/
- Tpetra::Vector<Number, int, types::signed_global_dof_index> &
+ TpetraTypes::VectorType<Number, MemorySpace> &
trilinos_vector();
/**
* Return a const Teuchos::RCP to the underlying Trilinos
* Tpetra::Vector class.
*/
- Teuchos::RCP<
- const Tpetra::Vector<Number, int, types::signed_global_dof_index>>
+ Teuchos::RCP<const TpetraTypes::VectorType<Number, MemorySpace>>
trilinos_rcp() const;
/**
* Return a (modifiable) Teuchos::RCP to the underlying Trilinos
* Tpetra::Vector class.
*/
- Teuchos::RCP<Tpetra::Vector<Number, int, types::signed_global_dof_index>>
+ Teuchos::RCP<TpetraTypes::VectorType<Number, MemorySpace>>
trilinos_rcp();
/**
/**
* Teuchos::RCP to the actual Tpetra vector object.
*/
- Teuchos::RCP<VectorType> vector;
+ Teuchos::RCP<TpetraTypes::VectorType<Number, MemorySpace>> vector;
/**
* A vector object in Trilinos to be used for collecting the non-local
* elements if the vector was constructed with an additional IndexSet
* describing ghost elements.
*/
- Teuchos::RCP<VectorType> nonlocal_vector;
+ Teuchos::RCP<TpetraTypes::VectorType<Number, MemorySpace>>
+ nonlocal_vector;
/**
* IndexSet of the elements of the last imported vector.
: Subscriptor()
, compressed(true)
, has_ghost(false)
- , vector(Utilities::Trilinos::internal::make_rcp<VectorType>(
- Utilities::Trilinos::internal::make_rcp<MapType>(
- 0,
- 0,
- Utilities::Trilinos::tpetra_comm_self())))
+ , vector(Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::VectorType<Number, MemorySpace>>(
+ Utilities::Trilinos::internal::make_rcp<TpetraTypes::MapType<
+ MemorySpace>>(0, 0, Utilities::Trilinos::tpetra_comm_self())))
{}
: Subscriptor()
, compressed(V.compressed)
, has_ghost(V.has_ghost)
- , vector(
- Utilities::Trilinos::internal::make_rcp<VectorType>(*V.vector,
- Teuchos::Copy))
+ , vector(Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::VectorType<Number, MemorySpace>>(*V.vector,
+ Teuchos::Copy))
{
if (!V.nonlocal_vector.is_null())
- nonlocal_vector = Utilities::Trilinos::internal::make_rcp<VectorType>(
- *V.nonlocal_vector, Teuchos::Copy);
+ nonlocal_vector = Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::VectorType<Number, MemorySpace>>(*V.nonlocal_vector,
+ Teuchos::Copy);
}
template <typename Number, typename MemorySpace>
- Vector<Number, MemorySpace>::Vector(const Teuchos::RCP<VectorType> V)
+ Vector<Number, MemorySpace>::Vector(
+ const Teuchos::RCP<TpetraTypes::VectorType<Number, MemorySpace>> V)
: Subscriptor()
, compressed(true)
, has_ghost(V->getMap()->isOneToOne() == false)
: Subscriptor()
, compressed(true)
, has_ghost(false)
- , vector(Utilities::Trilinos::internal::make_rcp<VectorType>(
+ , vector(Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::VectorType<Number, MemorySpace>>(
parallel_partitioner.make_tpetra_map_rcp(communicator, true)))
{}
IndexSet parallel_partitioner = locally_owned_entries;
parallel_partitioner.add_indices(ghost_entries);
- vector = Utilities::Trilinos::internal::make_rcp<VectorType>(
+ vector = Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::VectorType<Number, MemorySpace>>(
parallel_partitioner.make_tpetra_map_rcp(communicator, true));
compressed = true;
}
else
{
- Teuchos::RCP<MapType> map =
+ Teuchos::RCP<TpetraTypes::MapType<MemorySpace>> map =
locally_owned_entries.make_tpetra_map_rcp(communicator, false);
- vector = Utilities::Trilinos::internal::make_rcp<VectorType>(map);
+ vector = Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::VectorType<Number, MemorySpace>>(map);
IndexSet nonlocal_entries(ghost_entries);
nonlocal_entries.subtract_set(locally_owned_entries);
- nonlocal_vector = Utilities::Trilinos::internal::make_rcp<VectorType>(
+ nonlocal_vector = Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::VectorType<Number, MemorySpace>>(
nonlocal_entries.make_tpetra_map_rcp(communicator, true));
compressed = false;
void
Vector<Number, MemorySpace>::clear()
{
- vector = Utilities::Trilinos::internal::make_rcp<VectorType>(
- Utilities::Trilinos::internal::make_rcp<MapType>(
+ vector = Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::VectorType<Number, MemorySpace>>(
+ Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::MapType<MemorySpace>>(
0, 0, Utilities::Trilinos::tpetra_comm_self()));
has_ghost = false;
compressed = true;
compressed = true;
has_ghost = false;
- vector = Utilities::Trilinos::internal::make_rcp<VectorType>(
+ vector = Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::VectorType<Number, MemorySpace>>(
parallel_partitioner.make_tpetra_map_rcp(communicator, true));
}
IndexSet parallel_partitioner = locally_owned_entries;
parallel_partitioner.add_indices(ghost_entries);
- vector = Utilities::Trilinos::internal::make_rcp<VectorType>(
+ vector = Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::VectorType<Number, MemorySpace>>(
parallel_partitioner.make_tpetra_map_rcp(communicator, true));
compressed = true;
}
else
{
- Teuchos::RCP<MapType> map =
+ Teuchos::RCP<TpetraTypes::MapType<MemorySpace>> map =
locally_owned_entries.make_tpetra_map_rcp(communicator, false);
if (!vector->getMap()->isSameAs(*map))
{
vector.reset();
- vector = Utilities::Trilinos::internal::make_rcp<VectorType>(map);
+ vector = Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::VectorType<Number, MemorySpace>>(map);
}
else
vector->putScalar(0);
IndexSet nonlocal_entries(ghost_entries);
nonlocal_entries.subtract_set(locally_owned_entries);
- nonlocal_vector = Utilities::Trilinos::internal::make_rcp<VectorType>(
+ nonlocal_vector = Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::VectorType<Number, MemorySpace>>(
nonlocal_entries.make_tpetra_map_rcp(communicator, true));
compressed = false;
"Therefore, compress() must be called on this "
"vector first."));
- Teuchos::RCP<const ImportType> importer =
+ Teuchos::RCP<const TpetraTypes::ImportType<MemorySpace>> importer =
Tpetra::createImport(V.vector->getMap(), vector->getMap());
// Since we are distributing the vector from a one-to-one map
else
{
vector.reset();
- vector =
- Utilities::Trilinos::internal::make_rcp<VectorType>(*V.vector,
- Teuchos::Copy);
+ vector = Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::VectorType<Number, MemorySpace>>(*V.vector,
+ Teuchos::Copy);
compressed = V.compressed;
has_ghost = V.has_ghost;
nonlocal_vector.reset();
Teuchos::Array<OtherNumber> vector_data(V.begin(), V.end());
- vector = Utilities::Trilinos::internal::make_rcp<VectorType>(
+ vector = Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::VectorType<Number, MemorySpace>>(
V.locally_owned_elements().make_tpetra_map_rcp(), vector_data);
has_ghost = false;
"LinearAlgebra::TpetraWrappers::CommunicationPattern."));
}
- Teuchos::RCP<const ExportType> tpetra_export =
+ Teuchos::RCP<const TpetraTypes::ExportType<MemorySpace>> tpetra_export =
tpetra_comm_pattern->get_tpetra_export_rcp();
- VectorType source_vector(tpetra_export->getSourceMap());
+ TpetraTypes::VectorType<Number, MemorySpace> source_vector(
+ tpetra_export->getSourceMap());
{
# if DEAL_II_TRILINOS_VERSION_GTE(13, 2, 0)
// elements, maybe there is a better workaround.
Tpetra::Vector<Number, int, types::signed_global_dof_index> dummy(
vector->getMap(), false);
- ImportType data_exchange(V.trilinos_vector().getMap(),
- dummy.getMap());
+ TpetraTypes::ImportType<MemorySpace> data_exchange(
+ V.trilinos_vector().getMap(), dummy.getMap());
dummy.doImport(V.trilinos_vector(), data_exchange, Tpetra::INSERT);
vector->update(1.0, dummy, 1.0);
else
DEAL_II_NOT_IMPLEMENTED();
- Teuchos::RCP<const ExportType> exporter =
+ Teuchos::RCP<const TpetraTypes::ExportType<MemorySpace>> exporter =
Tpetra::createExport(nonlocal_vector->getMap(), vector->getMap());
vector->doExport(*nonlocal_vector, *exporter, tpetra_operation);
template <typename Number, typename MemorySpace>
- const Tpetra::Vector<Number, int, types::signed_global_dof_index> &
+ const TpetraTypes::VectorType<Number, MemorySpace> &
Vector<Number, MemorySpace>::trilinos_vector() const
{
return *vector;
template <typename Number, typename MemorySpace>
- Tpetra::Vector<Number, int, types::signed_global_dof_index> &
+ TpetraTypes::VectorType<Number, MemorySpace> &
Vector<Number, MemorySpace>::trilinos_vector()
{
return *vector;
template <typename Number, typename MemorySpace>
- Teuchos::RCP<Tpetra::Vector<Number, int, types::signed_global_dof_index>>
+ Teuchos::RCP<TpetraTypes::VectorType<Number, MemorySpace>>
Vector<Number, MemorySpace>::trilinos_rcp()
{
return vector;
template <typename Number, typename MemorySpace>
- Teuchos::RCP<
- const Tpetra::Vector<Number, int, types::signed_global_dof_index>>
+ Teuchos::RCP<const TpetraTypes::VectorType<Number, MemorySpace>>
Vector<Number, MemorySpace>::trilinos_rcp() const
{
return vector.getConst();
// Copy the distributed vector to
// a local one at all processors
// that know about the original vector.
- typename LinearAlgebra::TpetraWrappers::Vector<OtherNumber,
- MemorySpace>::VectorType
+ LinearAlgebra::TpetraWrappers::TpetraTypes::VectorType<OtherNumber,
+ MemorySpace>
localized_vector(complete_index_set(size()).make_tpetra_map_rcp(),
v.get_mpi_communicator());
- Teuchos::RCP<const typename LinearAlgebra::TpetraWrappers::
- Vector<OtherNumber, MemorySpace>::ImportType>
+ Teuchos::RCP<const LinearAlgebra::TpetraWrappers::TpetraTypes::ImportType<
+ MemorySpace>>
importer = Tpetra::createImport(v.trilinos_vector().getMap(),
localized_vector.getMap());
// Copy the distributed vector to
// a local one at all processors
// that know about the original vector.
- typename LinearAlgebra::TpetraWrappers::Vector<OtherNumber,
- MemorySpace>::VectorType
+ LinearAlgebra::TpetraWrappers::TpetraTypes::VectorType<OtherNumber,
+ MemorySpace>
localized_vector(complete_index_set(size()).make_tpetra_map_rcp(),
v.get_mpi_communicator());
- Teuchos::RCP<const typename LinearAlgebra::TpetraWrappers::
- Vector<OtherNumber, MemorySpace>::ImportType>
+ Teuchos::RCP<const LinearAlgebra::TpetraWrappers::TpetraTypes::ImportType<
+ MemorySpace>>
importer = Tpetra::createImport(v.trilinos_vector().getMap(),
localized_vector.getMap());
//
// ------------------------------------------------------------------------
+#include "deal.II/base/memory_space.h"
+
+#include "deal.II/lac/trilinos_tpetra_types.h"
#include <deal.II/lac/trilinos_tpetra_communication_pattern.h>
#ifdef DEAL_II_TRILINOS_WITH_TPETRA
- Teuchos::RCP<const Tpetra::Import<int, types::signed_global_dof_index>>
+ Teuchos::RCP<TpetraTypes::ImportType<dealii::MemorySpace::Host>>
CommunicationPattern::get_tpetra_import_rcp() const
{
return tpetra_import;
- Teuchos::RCP<const Tpetra::Export<int, types::signed_global_dof_index>>
+ Teuchos::RCP<TpetraTypes::ExportType<dealii::MemorySpace::Host>>
CommunicationPattern::get_tpetra_export_rcp() const
{
return tpetra_export;
// get a representation of the present row
std::size_t ncols;
# if DEAL_II_TRILINOS_VERSION_GTE(13, 2, 0)
- typename Tpetra::CrsGraph<
- int,
- dealii::types::signed_global_dof_index,
- NodeType>::nonconst_global_inds_host_view_type
+ typename TpetraTypes::GraphType<
+ MemorySpace>::nonconst_global_inds_host_view_type
column_indices_view(colnum_cache->data(), colnum_cache->size());
# else
Teuchos::ArrayView<dealii::types::signed_global_dof_index>
template <typename MemorySpace>
SparsityPattern<MemorySpace>::SparsityPattern()
{
- column_space_map = Utilities::Trilinos::internal::make_rcp<MapType>(
+ column_space_map = Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::MapType<MemorySpace>>(
TrilinosWrappers::types::int_type(0),
TrilinosWrappers::types::int_type(0),
Utilities::Trilinos::tpetra_comm_self());
- graph =
- Utilities::Trilinos::internal::make_rcp<GraphType>(column_space_map,
- column_space_map,
- 0);
+ graph = Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::GraphType<MemorySpace>>(column_space_map,
+ column_space_map,
+ 0);
graph->fillComplete();
}
SparsityPattern<MemorySpace>::SparsityPattern(
const SparsityPattern<MemorySpace> &input_sparsity)
: SparsityPatternBase(input_sparsity)
- , column_space_map(Utilities::Trilinos::internal::make_rcp<MapType>(
+ , column_space_map(Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::MapType<MemorySpace>>(
0,
0,
Utilities::Trilinos::tpetra_comm_self()))
- , graph(
- Utilities::Trilinos::internal::make_rcp<GraphType>(column_space_map,
- column_space_map,
- 0))
+ , graph(Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::GraphType<MemorySpace>>(column_space_map,
+ column_space_map,
+ 0))
{
(void)input_sparsity;
Assert(input_sparsity.n_rows() == 0,
template <typename MemorySpace>
using size_type = typename SparsityPattern<MemorySpace>::size_type;
- template <typename MemorySpace>
- using MapType =
- Tpetra::Map<int,
- dealii::types::signed_global_dof_index,
- typename SparsityPattern<MemorySpace>::NodeType>;
-
- template <typename MemorySpace>
- using GraphType =
- Tpetra::CrsGraph<int,
- dealii::types::signed_global_dof_index,
- typename SparsityPattern<MemorySpace>::NodeType>;
-
template <typename MemorySpace>
void
- reinit_sp(const Teuchos::RCP<MapType<MemorySpace>> &row_map,
- const Teuchos::RCP<MapType<MemorySpace>> &col_map,
- const size_type<MemorySpace> n_entries_per_row,
- Teuchos::RCP<MapType<MemorySpace>> &column_space_map,
- Teuchos::RCP<GraphType<MemorySpace>> &graph,
- Teuchos::RCP<GraphType<MemorySpace>> &nonlocal_graph)
+ reinit_sp(
+ const Teuchos::RCP<TpetraTypes::MapType<MemorySpace>> &row_map,
+ const Teuchos::RCP<TpetraTypes::MapType<MemorySpace>> &col_map,
+ const size_type<MemorySpace> n_entries_per_row,
+ Teuchos::RCP<TpetraTypes::MapType<MemorySpace>> &column_space_map,
+ Teuchos::RCP<TpetraTypes::GraphType<MemorySpace>> &graph,
+ Teuchos::RCP<TpetraTypes::GraphType<MemorySpace>> &nonlocal_graph)
{
Assert(row_map->isOneToOne(),
ExcMessage("Row map must be 1-to-1, i.e., no overlap between "
// columns as well. If we use a recent Trilinos version, we can also
// require building a non-local graph which gives us thread-safe
// initialization.
- graph = Utilities::Trilinos::internal::make_rcp<GraphType<MemorySpace>>(
- row_map, row_map, n_entries_per_row);
+ graph = Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::GraphType<MemorySpace>>(row_map,
+ row_map,
+ n_entries_per_row);
}
template <typename MemorySpace>
void
- reinit_sp(const Teuchos::RCP<MapType<MemorySpace>> &row_map,
- const Teuchos::RCP<MapType<MemorySpace>> &col_map,
- const std::vector<size_type<MemorySpace>> &n_entries_per_row,
- Teuchos::RCP<MapType<MemorySpace>> &column_space_map,
- Teuchos::RCP<GraphType<MemorySpace>> &graph,
- Teuchos::RCP<GraphType<MemorySpace>> &nonlocal_graph)
+ reinit_sp(
+ const Teuchos::RCP<TpetraTypes::MapType<MemorySpace>> &row_map,
+ const Teuchos::RCP<TpetraTypes::MapType<MemorySpace>> &col_map,
+ const std::vector<size_type<MemorySpace>> &n_entries_per_row,
+ Teuchos::RCP<TpetraTypes::MapType<MemorySpace>> &column_space_map,
+ Teuchos::RCP<TpetraTypes::GraphType<MemorySpace>> &graph,
+ Teuchos::RCP<TpetraTypes::GraphType<MemorySpace>> &nonlocal_graph)
{
Assert(row_map->isOneToOne(),
ExcMessage("Row map must be 1-to-1, i.e., no overlap between "
ExcMessage(
"You are requesting to store more elements than global ordinal type allows."));
- graph = Utilities::Trilinos::internal::make_rcp<GraphType<MemorySpace>>(
- row_map, col_map, local_entries_per_row);
+ graph = Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::GraphType<MemorySpace>>(row_map,
+ col_map,
+ local_entries_per_row);
}
template <typename SparsityPatternType, typename MemorySpace>
void
- reinit_sp(const Teuchos::RCP<MapType<MemorySpace>> &row_map,
- const Teuchos::RCP<MapType<MemorySpace>> &col_map,
- const SparsityPatternType &sp,
- [[maybe_unused]] const bool exchange_data,
- Teuchos::RCP<MapType<MemorySpace>> &column_space_map,
- Teuchos::RCP<GraphType<MemorySpace>> &graph,
- Teuchos::RCP<GraphType<MemorySpace>> &nonlocal_graph)
+ reinit_sp(
+ const Teuchos::RCP<TpetraTypes::MapType<MemorySpace>> &row_map,
+ const Teuchos::RCP<TpetraTypes::MapType<MemorySpace>> &col_map,
+ const SparsityPatternType &sp,
+ [[maybe_unused]] const bool exchange_data,
+ Teuchos::RCP<TpetraTypes::MapType<MemorySpace>> &column_space_map,
+ Teuchos::RCP<TpetraTypes::GraphType<MemorySpace>> &graph,
+ Teuchos::RCP<TpetraTypes::GraphType<MemorySpace>> &nonlocal_graph)
{
nonlocal_graph.reset();
graph.reset();
AssertDimension(sp.n_rows(), row_map->getGlobalNumElements());
AssertDimension(sp.n_cols(), col_map->getGlobalNumElements());
- column_space_map =
- Utilities::Trilinos::internal::make_rcp<MapType<MemorySpace>>(
- *col_map);
+ column_space_map = Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::MapType<MemorySpace>>(*col_map);
Assert(row_map->isContiguous() == true,
ExcMessage(
# if DEAL_II_TRILINOS_VERSION_GTE(12, 16, 0)
if (row_map->getComm()->getSize() > 1)
- graph =
- Utilities::Trilinos::internal::make_rcp<GraphType<MemorySpace>>(
- row_map, n_entries_per_row);
+ graph = Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::GraphType<MemorySpace>>(row_map, n_entries_per_row);
else
- graph =
- Utilities::Trilinos::internal::make_rcp<GraphType<MemorySpace>>(
- row_map, col_map, n_entries_per_row);
+ graph = Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::GraphType<MemorySpace>>(row_map,
+ col_map,
+ n_entries_per_row);
# else
if (row_map->getComm()->getSize() > 1)
graph =
{
SparsityPatternBase::resize(parallel_partitioning.size(),
parallel_partitioning.size());
- Teuchos::RCP<MapType> map =
+ Teuchos::RCP<TpetraTypes::MapType<MemorySpace>> map =
parallel_partitioning.make_tpetra_map_rcp(communicator, false);
SparsityPatternImpl::reinit_sp<MemorySpace>(
map, map, n_entries_per_row, column_space_map, graph, nonlocal_graph);
{
SparsityPatternBase::resize(parallel_partitioning.size(),
parallel_partitioning.size());
- Teuchos::RCP<MapType> map =
+ Teuchos::RCP<TpetraTypes::MapType<MemorySpace>> map =
parallel_partitioning.make_tpetra_map_rcp(communicator, false);
SparsityPatternImpl::reinit_sp<MemorySpace>(
map, map, n_entries_per_row, column_space_map, graph, nonlocal_graph);
{
SparsityPatternBase::resize(row_parallel_partitioning.size(),
col_parallel_partitioning.size());
- Teuchos::RCP<MapType> row_map =
+ Teuchos::RCP<TpetraTypes::MapType<MemorySpace>> row_map =
row_parallel_partitioning.make_tpetra_map_rcp(communicator, false);
- Teuchos::RCP<MapType> col_map =
+ Teuchos::RCP<TpetraTypes::MapType<MemorySpace>> col_map =
col_parallel_partitioning.make_tpetra_map_rcp(communicator, false);
SparsityPatternImpl::reinit_sp<MemorySpace>(row_map,
col_map,
{
SparsityPatternBase::resize(row_parallel_partitioning.size(),
col_parallel_partitioning.size());
- Teuchos::RCP<MapType> row_map =
+ Teuchos::RCP<TpetraTypes::MapType<MemorySpace>> row_map =
row_parallel_partitioning.make_tpetra_map_rcp(communicator, false);
- Teuchos::RCP<MapType> col_map =
+ Teuchos::RCP<TpetraTypes::MapType<MemorySpace>> col_map =
col_parallel_partitioning.make_tpetra_map_rcp(communicator, false);
SparsityPatternImpl::reinit_sp<MemorySpace>(row_map,
col_map,
{
SparsityPatternBase::resize(row_parallel_partitioning.size(),
col_parallel_partitioning.size());
- Teuchos::RCP<MapType> row_map =
+ Teuchos::RCP<TpetraTypes::MapType<MemorySpace>> row_map =
row_parallel_partitioning.make_tpetra_map_rcp(communicator, false);
- Teuchos::RCP<MapType> col_map =
+ Teuchos::RCP<TpetraTypes::MapType<MemorySpace>> col_map =
col_parallel_partitioning.make_tpetra_map_rcp(communicator, false);
SparsityPatternImpl::reinit_sp<MemorySpace>(row_map,
col_map,
nonlocal_partitioner.subtract_set(row_parallel_partitioning);
if (Utilities::MPI::n_mpi_processes(communicator) > 1)
{
- Teuchos::RCP<MapType> nonlocal_map =
+ Teuchos::RCP<TpetraTypes::MapType<MemorySpace>> nonlocal_map =
nonlocal_partitioner.make_tpetra_map_rcp(communicator, true);
- nonlocal_graph =
- Utilities::Trilinos::internal::make_rcp<GraphType>(nonlocal_map,
- col_map,
- 0);
+ nonlocal_graph = Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::GraphType<MemorySpace>>(nonlocal_map, col_map, 0);
}
else
Assert(nonlocal_partitioner.n_elements() == 0, ExcInternalError());
{
SparsityPatternBase::resize(row_parallel_partitioning.size(),
col_parallel_partitioning.size());
- Teuchos::RCP<MapType> row_map =
+ Teuchos::RCP<TpetraTypes::MapType<MemorySpace>> row_map =
row_parallel_partitioning.make_tpetra_map_rcp(communicator, false);
- Teuchos::RCP<MapType> col_map =
+ Teuchos::RCP<TpetraTypes::MapType<MemorySpace>> col_map =
col_parallel_partitioning.make_tpetra_map_rcp(communicator, false);
SparsityPatternImpl::reinit_sp<SparsityPatternType, MemorySpace>(
row_map,
parallel_partitioning.size());
SparsityPatternBase::resize(parallel_partitioning.size(),
parallel_partitioning.size());
- Teuchos::RCP<MapType> map =
+ Teuchos::RCP<TpetraTypes::MapType<MemorySpace>> map =
parallel_partitioning.make_tpetra_map_rcp(communicator, false);
SparsityPatternImpl::reinit_sp<SparsityPatternType, MemorySpace>(
map,
const SparsityPattern<MemorySpace> &sp)
{
SparsityPatternBase::resize(sp.n_rows(), sp.n_cols());
- column_space_map =
- Utilities::Trilinos::internal::make_rcp<MapType>(*sp.column_space_map);
- graph = Utilities::Trilinos::internal::make_rcp<GraphType>(*sp.graph);
+ column_space_map = Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::MapType<MemorySpace>>(*sp.column_space_map);
+ graph = Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::GraphType<MemorySpace>>(*sp.graph);
if (sp.nonlocal_graph.get() != nullptr)
- nonlocal_graph = Utilities::Trilinos::internal::make_rcp<GraphType>(
- *sp.nonlocal_graph);
+ nonlocal_graph = Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::GraphType<MemorySpace>>(*sp.nonlocal_graph);
else
nonlocal_graph.reset();
}
SparsityPattern<MemorySpace>::copy_from(const SparsityPatternType &sp)
{
SparsityPatternBase::resize(sp.n_rows(), sp.n_cols());
- Teuchos::RCP<MapType> rows =
- Utilities::Trilinos::internal::make_rcp<MapType>(
+ Teuchos::RCP<TpetraTypes::MapType<MemorySpace>> rows =
+ Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::MapType<MemorySpace>>(
TrilinosWrappers::types::int_type(sp.n_rows()),
0,
Utilities::Trilinos::tpetra_comm_self());
- Teuchos::RCP<MapType> columns =
- Utilities::Trilinos::internal::make_rcp<MapType>(
+ Teuchos::RCP<TpetraTypes::MapType<MemorySpace>> columns =
+ Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::MapType<MemorySpace>>(
TrilinosWrappers::types::int_type(sp.n_cols()),
0,
Utilities::Trilinos::tpetra_comm_self());
// When we clear the matrix, reset
// the pointer and generate an
// empty sparsity pattern.
- column_space_map = Utilities::Trilinos::internal::make_rcp<MapType>(
+ column_space_map = Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::MapType<MemorySpace>>(
TrilinosWrappers::types::int_type(0),
TrilinosWrappers::types::int_type(0),
Utilities::Trilinos::tpetra_comm_self());
- graph =
- Utilities::Trilinos::internal::make_rcp<GraphType>(column_space_map,
- column_space_map,
- 0);
+ graph = Utilities::Trilinos::internal::make_rcp<
+ TpetraTypes::GraphType<MemorySpace>>(column_space_map,
+ column_space_map,
+ 0);
graph->fillComplete();
nonlocal_graph.reset();
const auto trilinos_i = graph->getRowMap()->getLocalElement(i);
const auto trilinos_j = graph->getColMap()->getLocalElement(j);
- typename GraphType::local_inds_host_view_type col_indices;
+ typename TpetraTypes::GraphType<MemorySpace>::local_inds_host_view_type
+ col_indices;
// Generate the view.
graph->getLocalRowView(trilinos_i, col_indices);
for (int i = 0; i < static_cast<int>(local_size()); ++i)
{
# if DEAL_II_TRILINOS_VERSION_GTE(13, 2, 0)
- typename GraphType::local_inds_host_view_type indices;
+ typename TpetraTypes::GraphType<
+ MemorySpace>::local_inds_host_view_type indices;
# else
Teuchos::ArrayView<const int> indices;
# endif
template <typename MemorySpace>
- Teuchos::RCP<const typename SparsityPattern<MemorySpace>::MapType>
+ Teuchos::RCP<const typename TpetraTypes::MapType<MemorySpace>>
SparsityPattern<MemorySpace>::domain_partitioner() const
{
return graph->getDomainMap();
template <typename MemorySpace>
- Teuchos::RCP<const typename SparsityPattern<MemorySpace>::MapType>
+ Teuchos::RCP<const typename TpetraTypes::MapType<MemorySpace>>
SparsityPattern<MemorySpace>::range_partitioner() const
{
return graph->getRangeMap();
# endif
{
# if DEAL_II_TRILINOS_VERSION_GTE(13, 2, 0)
- typename GraphType::local_inds_host_view_type indices;
+ typename TpetraTypes::GraphType<
+ MemorySpace>::local_inds_host_view_type indices;
# else
Teuchos::ArrayView<const int> indices;
# endif
for (unsigned int row = 0; row < local_size(); ++row)
{
# if DEAL_II_TRILINOS_VERSION_GTE(13, 2, 0)
- typename GraphType::local_inds_host_view_type indices;
+ typename TpetraTypes::GraphType<
+ MemorySpace>::local_inds_host_view_type indices;
# else
Teuchos::ArrayView<const int> indices;
# endif