41#ifndef TPETRA_FECRSMATRIX_DECL_HPP
42#define TPETRA_FECRSMATRIX_DECL_HPP
49#include "Tpetra_FECrsGraph.hpp"
58template<
class Scalar = ::Tpetra::Details::DefaultTypes::scalar_type,
60 class GlobalOrdinal = ::Tpetra::Details::DefaultTypes::global_ordinal_type,
61 class Node = ::Tpetra::Details::DefaultTypes::node_type>
63 public CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>
65 friend class CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>;
128 typedef typename CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>::local_matrix_host_type local_matrix_host_type;
131 typedef CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> crs_matrix_type;
134 typedef FECrsGraph<LocalOrdinal, GlobalOrdinal, Node> fe_crs_graph_type;
171 explicit FECrsMatrix (
const Teuchos::RCP<const fe_crs_graph_type>& graph,
172 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
175 FECrsMatrix (
const FECrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>&) =
delete;
178 FECrsMatrix (FECrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>&&) =
delete;
182 operator= (
const FECrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>&) =
delete;
185 operator= (FECrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>&&) =
delete;
196 virtual ~FECrsMatrix () =
default;
229 void globalAssemble () {endFill();}
235 void beginAssembly();
253 static const bool useAtomicUpdatesByDefault =
254#ifdef KOKKOS_ENABLE_SERIAL
255 ! std::is_same<execution_space, Kokkos::Serial>::value;
264 replaceGlobalValuesImpl (impl_scalar_type rowVals[],
265 const crs_graph_type& graph,
266 const RowInfo& rowInfo,
267 const GlobalOrdinal inds[],
268 const impl_scalar_type newVals[],
269 const LocalOrdinal numElts);
272 replaceLocalValuesImpl (impl_scalar_type rowVals[],
273 const crs_graph_type& graph,
274 const RowInfo& rowInfo,
275 const LocalOrdinal inds[],
276 const impl_scalar_type newVals[],
277 const LocalOrdinal numElts);
280 sumIntoGlobalValuesImpl (impl_scalar_type rowVals[],
281 const crs_graph_type& graph,
282 const RowInfo& rowInfo,
283 const GlobalOrdinal inds[],
284 const impl_scalar_type newVals[],
285 const LocalOrdinal numElts,
286 const bool atomic = useAtomicUpdatesByDefault);
289 sumIntoLocalValuesImpl (impl_scalar_type rowVals[],
290 const crs_graph_type& graph,
291 const RowInfo& rowInfo,
292 const LocalOrdinal inds[],
293 const impl_scalar_type newVals[],
294 const LocalOrdinal numElts,
295 const bool atomic = useAtomicUpdatesByDefault);
298 insertGlobalValuesImpl (crs_graph_type& graph,
300 const GlobalOrdinal gblColInds[],
301 const impl_scalar_type vals[],
302 const size_t numInputEnt);
315 void switchActiveCrsMatrix();
323 FE_ACTIVE_OWNED_PLUS_SHARED
327 Teuchos::RCP<const FECrsGraph<LocalOrdinal, GlobalOrdinal, Node> > feGraph_;
330 Teuchos::RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > inactiveCrsMatrix_;
332 Teuchos::RCP<FEWhichActive> activeCrsMatrix_;
340 Teuchos::RCP<FillState> fillState_;
Declaration of the Tpetra::CrsMatrix class.
typename device_type::execution_space execution_space
The Kokkos execution space.
CrsGraph< LocalOrdinal, GlobalOrdinal, Node > crs_graph_type
The CrsGraph specialization suitable for this CrsMatrix specialization.
Node node_type
This class' Kokkos Node type.
GlobalOrdinal global_ordinal_type
The type of each global index in the matrix.
Map< LocalOrdinal, GlobalOrdinal, Node > map_type
The Map specialization suitable for this CrsMatrix specialization.
typename Node::device_type device_type
The Kokkos device type.
Scalar scalar_type
The type of each entry in the matrix.
LocalOrdinal local_ordinal_type
The type of each local index in the matrix.
Export< LocalOrdinal, GlobalOrdinal, Node > export_type
The Export specialization suitable for this CrsMatrix specialization.
typename Kokkos::ArithTraits< impl_scalar_type >::mag_type mag_type
Type of a norm result.
typename crs_graph_type::local_graph_device_type local_graph_device_type
The part of the sparse matrix's graph on each MPI process.
KokkosSparse::CrsMatrix< impl_scalar_type, local_ordinal_type, device_type, void, typename local_graph_device_type::size_type > local_matrix_device_type
The specialization of Kokkos::CrsMatrix that represents the part of the sparse matrix on each MPI pro...
CrsMatrix(const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &)=default
Copy constructor.
typename row_matrix_type::impl_scalar_type impl_scalar_type
The type used internally in place of Scalar.
Import< LocalOrdinal, GlobalOrdinal, Node > import_type
The Import specialization suitable for this CrsMatrix specialization.
int local_ordinal_type
Default value of Scalar template parameter.
Namespace Tpetra contains the class and methods constituting the Tpetra library.
CombineMode
Rule for combining data in an Import or Export.