40 #ifndef TPETRA_BLOCKMULTIVECTOR_DECL_HPP 41 #define TPETRA_BLOCKMULTIVECTOR_DECL_HPP 45 #include "Tpetra_MultiVector.hpp" 135 template<
class Scalar,
144 using STS = Teuchos::ScalarTraits<Scalar>;
193 typedef typename little_vec_type::HostMirror little_host_vec_type;
200 typedef Kokkos::View<const impl_scalar_type *, device_type>
205 typedef Kokkos::View<const impl_scalar_type*, host_device_type>
206 const_little_host_vec_type;
234 const Teuchos::DataAccess copyOrView);
302 const size_t offset = 0);
310 const size_t offset = 0);
358 void scale (
const Scalar& val);
367 update (
const Scalar& alpha,
436 #ifdef TPETRA_ENABLE_DEPRECATED_CODE 459 template<
class TargetMemorySpace>
462 mv_.template sync<typename TargetMemorySpace::memory_space> ();
477 #endif // TPETRA_ENABLE_DEPRECATED_CODE 480 template<
class TargetMemorySpace>
482 return mv_.template need_sync<typename TargetMemorySpace::memory_space> ();
495 #ifdef TPETRA_ENABLE_DEPRECATED_CODE 502 template<
class TargetMemorySpace>
505 mv_.template modify<typename TargetMemorySpace::memory_space> ();
516 void modify_device() {
520 #endif // TPETRA_ENABLE_DEPRECATED_CODE 542 bool replaceLocalValues (
const LO localRowIndex,
const LO colIndex,
const Scalar vals[]);
554 bool replaceGlobalValues (
const GO globalRowIndex,
const LO colIndex,
const Scalar vals[]);
566 bool sumIntoLocalValues (
const LO localRowIndex,
const LO colIndex,
const Scalar vals[]);
578 bool sumIntoGlobalValues (
const GO globalRowIndex,
const LO colIndex,
const Scalar vals[]);
580 #ifdef TPETRA_ENABLE_DEPRECATED_CODE 592 bool getLocalRowView (
const LO localRowIndex,
const LO colIndex, Scalar*& vals);
605 bool getGlobalRowView (
const GO globalRowIndex,
const LO colIndex, Scalar*& vals);
616 little_host_vec_type getLocalBlock (
const LO localRowIndex,
const LO colIndex);
618 #endif // TPETRA_ENABLE_DEPRECATED_CODE 620 const_little_host_vec_type getLocalBlockHost(
621 const LO localRowIndex,
623 const Access::ReadOnlyStruct)
const;
625 little_host_vec_type getLocalBlockHost(
626 const LO localRowIndex,
628 const Access::ReadWriteStruct);
633 little_host_vec_type getLocalBlockHost(
634 const LO localRowIndex,
636 const Access::OverwriteAllStruct);
651 (
const SrcDistObject& source,
652 const size_t numSameIDs,
661 (
const SrcDistObject& source,
664 Kokkos::DualView<packet_type*,
666 Kokkos::DualView<
size_t*,
668 size_t& constantNumPackets);
674 Kokkos::DualView<packet_type*,
676 Kokkos::DualView<
size_t*,
678 const size_t constantNumPackets,
684 #ifdef TPETRA_ENABLE_DEPRECATED_CODE 689 #endif // TPETRA_ENABLE_DEPRECATED_CODE 693 return static_cast<size_t> (1);
721 #ifdef TPETRA_ENABLE_DEPRECATED_CODE 731 #endif // TPETRA_ENABLE_DEPRECATED_CODE 738 replaceLocalValuesImpl (
const LO localRowIndex,
740 const Scalar vals[]);
743 sumIntoLocalValuesImpl (
const LO localRowIndex,
745 const Scalar vals[]);
747 static Teuchos::RCP<const mv_type>
750 static Teuchos::RCP<const BlockMultiVector<Scalar, LO, GO, Node> >
756 #endif // TPETRA_BLOCKMULTIVECTOR_DECL_HPP Node node_type
The Kokkos Node type; a legacy thing that will go away at some point.
BlockMultiVector< Scalar, LO, GO, Node > & operator=(const BlockMultiVector< Scalar, LO, GO, Node > &)=default
Copy assigment (shallow copy).
Namespace Tpetra contains the class and methods constituting the Tpetra library.
void update(const Scalar &alpha, const BlockMultiVector< Scalar, LO, GO, Node > &X, const Scalar &beta)
Update: this = beta*this + alpha*X.
Kokkos::View< const impl_scalar_type *, device_type > const_little_vec_type
"Const block view" of all degrees of freedom at a mesh point, for a single column of the MultiVector...
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 local_ordinal_type
The type of local indices.
Kokkos::View< impl_scalar_type *, device_type > little_vec_type
"Block view" of all degrees of freedom at a mesh point, for a single column of the MultiVector...
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 .
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.
Forward declaration of Tpetra::BlockCrsMatrix.
GO global_ordinal_type
The type of global indices.
virtual bool checkSizes(const Tpetra::SrcDistObject &source)
Compare the source and target (this) objects for compatibility.
bool replaceGlobalValues(const GO globalRowIndex, const LO colIndex, const Scalar vals[])
Replace all values at the given mesh point, using a global index.
bool need_sync_host() const
Whether this MultiVector needs synchronization to the host.
bool replaceLocalValues(const LO localRowIndex, const LO colIndex, const Scalar vals[])
Replace all values at the given mesh point, using local row and column indices.
LO getNumVectors() const
Get the number of columns (vectors) in the BlockMultiVector.
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.
bool sumIntoLocalValues(const LO localRowIndex, const LO colIndex, const Scalar vals[])
Sum into all values at the given mesh point, using a local index.
MultiVector for multiple degrees of freedom per mesh point.
size_t getStride() const
Stride between columns in the multivector.
bool need_sync_host() const
Whether this object needs synchronization to the host.
BlockMultiVector()
Default constructor.
typename ::Kokkos::Details::ArithTraits< Scalar >::val_type packet_type
The type of each datum being sent or received in an Import or Export.
bool need_sync() const
Whether this object needs synchronization to the given memory space.
typename mv_type::device_type device_type
The Kokkos Device type.
CombineMode
Rule for combining data in an Import or Export.
size_t getNumVectors() const
Number of columns in the multivector.
map_type getPointMap() const
Get this BlockMultiVector's (previously computed) point Map.
Tpetra::MultiVector< Scalar, LO, GO, Node > mv_type
The specialization of Tpetra::MultiVector that this class uses.
Tpetra::Map< LO, GO, Node > map_type
The specialization of Tpetra::Map that this class uses.
bool sumIntoGlobalValues(const GO globalRowIndex, const LO colIndex, const Scalar vals[])
Sum into all values at the given mesh point, using a global index.
mv_type mv_
The Tpetra::MultiVector used to represent the data.
Abstract base class for objects that can be the source of an Import or Export operation.
size_t getStrideY() const
Stride between consecutive local entries in the same row.
LO getBlockSize() const
Get the number of degrees of freedom per mesh point.
Forward declaration of Tpetra::BlockMultiVector.
Scalar scalar_type
The type of entries in the object.
typename map_type::device_type device_type
This class' preferred Kokkos device type.
typename Kokkos::Details::ArithTraits< Scalar >::val_type impl_scalar_type
The type used internally in place of Scalar.
size_t getStrideX() const
Stride between consecutive local entries in the same column.
typename dist_object_type::buffer_device_type buffer_device_type
Kokkos::Device specialization used for communication buffers.
bool need_sync_device() const
Whether this object needs synchronization to the device.
bool isValidLocalMeshIndex(const LO meshLocalIndex) const
True if and only if meshLocalIndex is a valid local index in the mesh Map.
Kokkos::Device< typename device_type::execution_space, buffer_memory_space > buffer_device_type
Kokkos::Device specialization for communication buffers.
void scale(const Scalar &val)
Multiply all entries in place by the given value val.
bool need_sync_device() const
Whether this MultiVector needs synchronization to the device.
Base class for distributed Tpetra objects that support data redistribution.
typename mv_type::impl_scalar_type impl_scalar_type
The implementation type of entries in the object.