42 #ifndef TPETRA_VBRMATRIX_DECL_HPP
43 #define TPETRA_VBRMATRIX_DECL_HPP
48 #include <Tpetra_ConfigDefs.hpp>
49 #include <Tpetra_Operator.hpp>
51 #include <Kokkos_DefaultNode.hpp>
52 #include <Kokkos_DefaultKernels.hpp>
58 #ifndef DOXYGEN_SHOULD_SKIP_THIS
60 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
63 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
66 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
71 template<
class Scalar,
class LocalOrdinal,
class Node>
76 template<
class OrdinalType,
class ScalarType>
77 class SerialDenseMatrix;
79 #endif // DOXYGEN_SHOULD_SKIP_THIS
112 template <
class Scalar,
113 class LocalOrdinal = int,
114 class GlobalOrdinal = LocalOrdinal,
115 class Node = Kokkos::DefaultNode::DefaultNodeType,
116 class LocalMatOps =
typename Kokkos::DefaultKernels<Scalar,LocalOrdinal,Node>::BlockSparseOps >
125 typedef LocalMatOps mat_vec_type;
165 template <
class DomainScalar,
class RangeScalar>
166 void multiply(
const MultiVector<DomainScalar,LocalOrdinal,GlobalOrdinal,Node> & X,
MultiVector<RangeScalar,LocalOrdinal,GlobalOrdinal,Node> &Y,
Teuchos::ETransp trans, RangeScalar alpha, RangeScalar beta)
const;
181 template <
class DomainScalar,
class RangeScalar>
402 LocalOrdinal& numPtRows,
411 LocalOrdinal& numPtRows,
426 GlobalOrdinal globalBlockCol,
427 LocalOrdinal& numPtRows,
428 LocalOrdinal& numPtCols,
443 GlobalOrdinal globalBlockCol,
444 LocalOrdinal& numPtRows,
445 LocalOrdinal& numPtCols,
460 LocalOrdinal localBlockCol,
461 LocalOrdinal& numPtRows,
462 LocalOrdinal& numPtCols,
483 LocalOrdinal localBlockCol,
484 LocalOrdinal& numPtRows,
485 LocalOrdinal& numPtCols,
496 getBlockCrsGraph () {
497 return constBlkGraph_;
517 size_t& constantNumPackets,
524 size_t constantNumPackets,
544 void createImporterExporter();
545 void optimizeStorage();
546 void fillLocalMatrix();
547 void fillLocalMatVec();
587 LocalMatOps lclMatOps_;
593 typedef typename std::map<GlobalOrdinal,Teuchos::ArrayRCP<Scalar> > RowGlobalCols;
605 VbrUtils::VbrData<LocalOrdinal,GlobalOrdinal,Scalar> nonlocal_data_;
607 bool is_fill_completed_;
608 bool is_storage_optimized_;
663 #endif //TPETRA_VBRMATRIX_DECL_HPP
void getLocalBlockEntryView(LocalOrdinal localBlockRow, LocalOrdinal localBlockCol, LocalOrdinal &numPtRows, LocalOrdinal &numPtCols, Teuchos::ArrayRCP< const Scalar > &blockEntry) const
Returns a const read-only view of a block-entry.
Block-entry counterpart to Tpetra::Map.
const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > & getRangeMap() const
Returns the (point-entry) Map associated with the range of this operator.
VbrMatrix(const Teuchos::RCP< const BlockMap< LocalOrdinal, GlobalOrdinal, Node > > &blkRowMap, size_t maxNumEntriesPerRow, ProfileType pftype=DynamicProfile)
Constructor specifying the row-map and the max number of (block) non-zeros for all rows...
void setLocalBlockEntry(LocalOrdinal localBlockRow, LocalOrdinal localBlockCol, const Teuchos::SerialDenseMatrix< int, Scalar > &blockEntry)
Copy the contents of the input block-entry into the matrix.
GlobalOrdinal global_ordinal_type
The global index type.
Block-entry counterpart to Tpetra::CrsGraph.
std::string description() const
One-line descriptiion of this object.
const Teuchos::RCP< const BlockMap< LocalOrdinal, GlobalOrdinal, Node > > & getBlockRangeMap() const
Returns the block-range map.
Scalar scalar_type
The type of the entries of the input and output multivectors.
One or more distributed dense vectors.
bool isFillComplete() const
Return true if fillComplete has been called, false otherwise.
void putScalar(Scalar s)
Set the specified scalar throughout the matrix.
void fillComplete()
Transition the matrix to the packed, optimized-storage state.
const Teuchos::RCP< const BlockMap< LocalOrdinal, GlobalOrdinal, Node > > & getBlockRowMap() const
Returns the block-row map.
void sumIntoLocalBlockEntry(LocalOrdinal localBlockRow, LocalOrdinal localBlockCol, const Teuchos::SerialDenseMatrix< int, Scalar > &blockEntry)
Add the contents of the input block-entry into the matrix.
virtual void unpackAndCombine(const Teuchos::ArrayView< const LocalOrdinal > &importLIDs, const Teuchos::ArrayView< const char > &imports, const Teuchos::ArrayView< size_t > &numPacketsPerLID, size_t constantNumPackets, Distributor &distor, CombineMode CM)
Perform any unpacking and combining after communication.
VbrMatrix: Variable block row matrix.
virtual void copyAndPermute(const SrcDistObject &source, size_t numSameIDs, const Teuchos::ArrayView< const LocalOrdinal > &permuteToLIDs, const Teuchos::ArrayView< const LocalOrdinal > &permuteFromLIDs)
Perform copies and permutations that are local to this process.
void getLocalBlockEntryViewNonConst(LocalOrdinal localBlockRow, LocalOrdinal localBlockCol, LocalOrdinal &numPtRows, LocalOrdinal &numPtCols, Teuchos::ArrayRCP< Scalar > &blockEntry)
Returns a non-const read-write view of a block-entry.
void setGlobalBlockEntry(GlobalOrdinal globalBlockRow, GlobalOrdinal globalBlockCol, const Teuchos::SerialDenseMatrix< int, Scalar > &blockEntry)
Copy the contents of the input block-entry into the matrix.
void applyInverse(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Y, MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X, Teuchos::ETransp trans) const
Triangular Solve – Matrix must be triangular.
void getGlobalBlockEntryViewNonConst(GlobalOrdinal globalBlockRow, GlobalOrdinal globalBlockCol, LocalOrdinal &numPtRows, LocalOrdinal &numPtCols, Teuchos::ArrayRCP< Scalar > &blockEntry)
Returns a non-const read-write view of a block-entry.
void getGlobalBlockEntryView(GlobalOrdinal globalBlockRow, GlobalOrdinal globalBlockCol, LocalOrdinal &numPtRows, LocalOrdinal &numPtCols, Teuchos::ArrayRCP< const Scalar > &blockEntry) const
Returns a const read-only view of a block-entry.
Abstract interface for linear operators accepting Tpetra MultiVector objects.
void multiply(const MultiVector< DomainScalar, LocalOrdinal, GlobalOrdinal, Node > &X, MultiVector< RangeScalar, LocalOrdinal, GlobalOrdinal, Node > &Y, Teuchos::ETransp trans, RangeScalar alpha, RangeScalar beta) const
Multiply this matrix by a MultiVector.
const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > & getDomainMap() const
Returns the (point-entry) Map associated with the domain of this operator.
LocalOrdinal local_ordinal_type
The local index type.
Sets up and executes a communication plan for a Tpetra DistObject.
CombineMode
Tpetra::Combine Mode enumerable type.
virtual void packAndPrepare(const SrcDistObject &source, const Teuchos::ArrayView< const LocalOrdinal > &exportLIDs, Teuchos::Array< char > &exports, const Teuchos::ArrayView< size_t > &numPacketsPerLID, size_t &constantNumPackets, Distributor &distor)
Perform any packing or preparation required for communication.
Abstract base class for objects that can be the source of an Import or Export operation.
Node node_type
The Kokkos Node type.
static const EVerbosityLevel verbLevel_default
void globalAssemble()
Communicate non-local contributions to the processors that own those contributions.
void getLocalDiagCopy(Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag) const
Return a copy of the (point-entry) diagonal values.
const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > & getPointColMap() const
Returns the point-column map.
const Teuchos::RCP< const BlockMap< LocalOrdinal, GlobalOrdinal, Node > > & getBlockColMap() const
Returns the block-column map.
virtual ~VbrMatrix()
Destructor.
void apply(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X, MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Y, Teuchos::ETransp trans=Teuchos::NO_TRANS, Scalar alpha=Teuchos::ScalarTraits< Scalar >::one(), Scalar beta=Teuchos::ScalarTraits< Scalar >::zero()) const
Computes the operator-multivector application.
A distributed dense vector.
const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > & getPointRowMap() const
Returns the point-row map.
void getGlobalBlockRowView(GlobalOrdinal globalBlockRow, LocalOrdinal &numPtRows, Teuchos::ArrayView< const GlobalOrdinal > &blockCols, Teuchos::Array< LocalOrdinal > &ptColsPerBlockCol, Teuchos::Array< Teuchos::ArrayRCP< const Scalar > > &blockEntries) const
Returns a const read-only view of the block-entries in the specified row.
void solve(const MultiVector< RangeScalar, LocalOrdinal, GlobalOrdinal, Node > &Y, MultiVector< DomainScalar, LocalOrdinal, GlobalOrdinal, Node > &X, Teuchos::ETransp trans) const
Triangular Solve – Matrix must be triangular.
void sumIntoGlobalBlockEntry(GlobalOrdinal globalBlockRow, GlobalOrdinal globalBlockCol, const Teuchos::SerialDenseMatrix< int, Scalar > &blockEntry)
Add the contents of the input block-entry into the matrix.
const Teuchos::RCP< const BlockMap< LocalOrdinal, GlobalOrdinal, Node > > & getBlockDomainMap() const
Returns the block-domain map.
Base class for distributed Tpetra objects that support data redistribution.
void getLocalBlockRowView(LocalOrdinal localBlockRow, LocalOrdinal &numPtRows, Teuchos::ArrayView< const LocalOrdinal > &blockCols, Teuchos::Array< LocalOrdinal > &ptColsPerBlockCol, Teuchos::ArrayRCP< const Scalar > &blockEntries) const
Returns a const read-only view of the block-entries in the specified row.
virtual bool checkSizes(const SrcDistObject &source)
Compare the source and target (this) objects for compatibility.
bool hasTransposeApply() const
Indicates whether this operator supports applying the adjoint operator.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to a FancyOStream object.