|
Tpetra parallel linear algebra
Version of the Day
|
42 #ifndef TPETRA_EXPERIMENTAL_BLOCKMULTIVECTOR_DECL_HPP
43 #define TPETRA_EXPERIMENTAL_BLOCKMULTIVECTOR_DECL_HPP
47 #include "Tpetra_MultiVector.hpp"
49 #include "Teuchos_OrdinalTraits.hpp"
52 namespace Experimental {
143 template<
class Scalar = ::Tpetra::Details::DefaultTypes::scalar_type,
145 class GO = ::Tpetra::Details::DefaultTypes::global_ordinal_type,
152 typedef Teuchos::ScalarTraits<Scalar> STS;
202 Kokkos::MemoryTraits<Kokkos::Unmanaged> >
213 Kokkos::MemoryTraits<Kokkos::Unmanaged> >
286 const size_t offset = 0);
294 const size_t offset = 0);
348 void scale (
const Scalar& val);
357 update (
const Scalar& alpha,
448 template<
class TargetMemorySpace>
450 mv_.template sync<typename TargetMemorySpace::memory_space> ();
454 template<
class TargetMemorySpace>
456 return mv_.template need_sync<typename TargetMemorySpace::memory_space> ();
464 template<
class TargetMemorySpace>
466 mv_.template modify<typename TargetMemorySpace::memory_space> ();
490 bool replaceLocalValues (
const LO localRowIndex,
const LO colIndex,
const Scalar vals[])
const;
502 bool replaceGlobalValues (
const GO globalRowIndex,
const LO colIndex,
const Scalar vals[])
const;
514 bool sumIntoLocalValues (
const LO localRowIndex,
const LO colIndex,
const Scalar vals[])
const;
526 bool sumIntoGlobalValues (
const GO globalRowIndex,
const LO colIndex,
const Scalar vals[])
const;
538 bool getLocalRowView (
const LO localRowIndex,
const LO colIndex, Scalar*& vals)
const;
550 bool getGlobalRowView (
const GO globalRowIndex,
const LO colIndex, Scalar*& vals)
const;
563 typename little_vec_type::HostMirror
564 getLocalBlock (
const LO localRowIndex,
const LO colIndex)
const;
580 const Teuchos::ArrayView<const LO>& permuteToLIDs,
581 const Teuchos::ArrayView<const LO>& permuteFromLIDs);
585 const Teuchos::ArrayView<const LO>& exportLIDs,
586 Teuchos::Array<impl_scalar_type>& exports,
587 const Teuchos::ArrayView<size_t>& numPacketsPerLID,
588 size_t& constantNumPackets,
592 unpackAndCombine (
const Teuchos::ArrayView<const LO> &importLIDs,
593 const Teuchos::ArrayView<const impl_scalar_type> &imports,
594 const Teuchos::ArrayView<size_t> &numPacketsPerLID,
595 size_t constantNumPackets,
608 return static_cast<size_t> (1);
619 return meshLocalIndex != Teuchos::OrdinalTraits<LO>::invalid () &&
654 replaceLocalValuesImpl (
const LO localRowIndex,
656 const Scalar vals[])
const;
659 sumIntoLocalValuesImpl (
const LO localRowIndex,
661 const Scalar vals[])
const;
663 static Teuchos::RCP<const mv_type>
666 static Teuchos::RCP<const BlockMultiVector<Scalar, LO, GO, Node> >
674 #endif // TPETRA_EXPERIMENTAL_BLOCKMULTIVECTOR_DECL_HPP
void scale(const Scalar &val)
Multiply all entries in place by the given value val.
BlockMultiVector()
Default constructor.
bool sumIntoLocalValues(const LO localRowIndex, const LO colIndex, const Scalar vals[]) const
Sum into all values at the given mesh point, using a local index.
mv_type getMultiVectorView() const
Get a Tpetra::MultiVector that views this BlockMultiVector's data.
void putScalar(const Scalar &val)
Fill all entries with the given value val.
LO getNumVectors() const
Get the number of columns (vectors) in the BlockMultiVector.
bool sumIntoGlobalValues(const GO globalRowIndex, const LO colIndex, const Scalar vals[]) const
Sum into all values at the given mesh point, using a global index.
impl_scalar_type * getRawPtr() const
Raw pointer to the MultiVector's data.
Tpetra::Map< LO, GO, Node > map_type
The specialization of Tpetra::Map that this class uses.
void blockWiseMultiply(const Scalar &alpha, const Kokkos::View< const impl_scalar_type ***, device_type, Kokkos::MemoryUnmanaged > &D, const BlockMultiVector< Scalar, LO, GO, Node > &X)
*this := alpha * D * X, where D is a block diagonal matrix.
virtual bool checkSizes(const Tpetra::SrcDistObject &source)
Compare the source and target (this) objects for compatibility.
LO local_ordinal_type
The type of local indices.
::Kokkos::Compat::KokkosDeviceWrapperNode< execution_space > node_type
Default value of Node template parameter.
Node node_type
The Kokkos Node type.
size_t getStrideY() const
Stride between consecutive local entries in the same row.
Forward declaration of Tpetra::Experimental::BlockMultiVector.
Scalar scalar_type
The type of entries in the matrix.
Forward declaration of Tpetra::Experimental::BlockCrsMatrix.
bool replaceLocalValues(const LO localRowIndex, const LO colIndex, const Scalar vals[]) const
Replace all values at the given mesh point, using local row and column indices.
Tpetra::MultiVector< Scalar, LO, GO, Node > mv_type
The specialization of Tpetra::MultiVector that this class uses.
Linear algebra kernels for small dense matrices and vectors.
little_vec_type::HostMirror getLocalBlock(const LO localRowIndex, const LO colIndex) const
Get a host view of the degrees of freedom at the given mesh point.
size_t getStride() const
Stride between columns in the multivector.
mv_type::impl_scalar_type impl_scalar_type
The implementation type of entries in the matrix.
Node::device_type device_type
The Kokkos Device type.
LO getBlockSize() const
Get the number of degrees of freedom per mesh point.
bool getGlobalRowView(const GO globalRowIndex, const LO colIndex, Scalar *&vals) const
Get a writeable view of the entries at the given mesh point, using a global index.
Base class for distributed Tpetra objects that support data redistribution.
bool getLocalRowView(const LO localRowIndex, const LO colIndex, Scalar *&vals) const
Get a writeable view of the entries at the given mesh point, using a local index.
void modify()
Mark data as modified on the given memory space.
Sets up and executes a communication plan for a Tpetra DistObject.
static map_type makePointMap(const map_type &meshMap, const LO blockSize)
Create and return the point Map corresponding to the given mesh Map and block size.
One or more distributed dense vectors.
int local_ordinal_type
Default value of Scalar template parameter.
bool replaceGlobalValues(const GO globalRowIndex, const LO colIndex, const Scalar vals[]) const
Replace all values at the given mesh point, using a global index.
void sync()
Update data to the given target memory space, only if data in the "other" space have been marked as m...
size_t getNumVectors() const
Number of columns in the multivector.
MultiVector for multiple degrees of freedom per mesh point.
A parallel distribution of indices over processes.
Kokkos::Details::ArithTraits< Scalar >::val_type impl_scalar_type
The type used internally in place of Scalar.
::Kokkos::Details::ArithTraits< Packet >::val_type packet_type
The type of each datum being sent or received in an Import or Export.
Kokkos::View< const impl_scalar_type *, Kokkos::LayoutRight, device_type, Kokkos::MemoryTraits< Kokkos::Unmanaged > > const_little_vec_type
"Const block view" of all degrees of freedom at a mesh point, for a single column of the MultiVector.
Namespace Tpetra contains the class and methods constituting the Tpetra library.
bool isNodeLocalElement(LocalOrdinal localIndex) const
Whether the given local index is valid for this Map on the calling process.
map_type getPointMap() const
Get this BlockMultiVector's (previously computed) point Map.
void update(const Scalar &alpha, const BlockMultiVector< Scalar, LO, GO, Node > &X, const Scalar &beta)
Update: this = beta*this + alpha*X.
Abstract base class for objects that can be the source of an Import or Export operation.
size_t getStrideX() const
Stride between consecutive local entries in the same column.
GO global_ordinal_type
The type of global indices.
mv_type mv_
The Tpetra::MultiVector used to represent the data.
void blockJacobiUpdate(const Scalar &alpha, const Kokkos::View< const impl_scalar_type ***, device_type, Kokkos::MemoryUnmanaged > &D, const BlockMultiVector< Scalar, LO, GO, Node > &X, BlockMultiVector< Scalar, LO, GO, Node > &Z, const Scalar &beta)
Block Jacobi update .
Kokkos::View< impl_scalar_type *, Kokkos::LayoutRight, device_type, Kokkos::MemoryTraits< Kokkos::Unmanaged > > little_vec_type
"Block view" of all degrees of freedom at a mesh point, for a single column of the MultiVector.
CombineMode
Rule for combining data in an Import or Export.
bool need_sync() const
Whether this object needs synchronization to the given memory space.
bool isValidLocalMeshIndex(const LO meshLocalIndex) const
True if and only if meshLocalIndex is a valid local index in the mesh Map.