43 #ifndef IFPACK2_SPARSECONTAINER_DECL_HPP
44 #define IFPACK2_SPARSECONTAINER_DECL_HPP
51 #include "Tpetra_MultiVector.hpp"
52 #include "Tpetra_Map.hpp"
53 #include "Tpetra_RowMatrix.hpp"
54 #include "Tpetra_CrsMatrix.hpp"
58 #ifdef HAVE_IFPACK2_AMESOS2
59 #include "Ifpack2_Details_Amesos2Wrapper.hpp"
133 template<
typename MatrixType,
typename InverseType>
144 typedef MatrixType matrix_type;
150 typedef InverseType inverse_type;
152 typedef typename Container<MatrixType>::scalar_type scalar_type;
153 typedef typename Container<MatrixType>::local_ordinal_type local_ordinal_type;
154 typedef typename Container<MatrixType>::global_ordinal_type global_ordinal_type;
155 typedef typename Container<MatrixType>::node_type node_type;
157 typedef typename Container<MatrixType>::mv_type mv_type;
158 typedef typename Container<MatrixType>::map_type map_type;
159 typedef typename Container<MatrixType>::vector_type vector_type;
161 typedef typename Container<MatrixType>::import_type import_type;
163 typedef typename InverseType::scalar_type InverseScalar;
164 typedef typename InverseType::local_ordinal_type InverseLocalOrdinal;
165 typedef typename InverseType::global_ordinal_type InverseGlobalOrdinal;
166 typedef typename InverseType::node_type InverseNode;
168 typedef typename Tpetra::MultiVector<InverseScalar, InverseLocalOrdinal, InverseGlobalOrdinal, InverseNode> inverse_mv_type;
169 typedef typename Tpetra::CrsMatrix<InverseScalar, InverseLocalOrdinal, InverseGlobalOrdinal, InverseNode> InverseCrs;
170 typedef typename Tpetra::Map<InverseLocalOrdinal, InverseGlobalOrdinal, InverseNode> InverseMap;
172 typedef typename Container<MatrixType>::HostView HostView;
173 typedef typename inverse_mv_type::dual_view_type::t_host HostViewInverse;
175 static_assert(std::is_same<MatrixType,
176 Tpetra::RowMatrix<scalar_type, local_ordinal_type, global_ordinal_type, node_type>>::value,
"Ifpack2::SparseContainer: Please use MatrixType = Tpetra::RowMatrix.");
186 typedef typename Container<MatrixType>::row_matrix_type row_matrix_type;
204 scalar_type DampingFactor);
268 virtual std::ostream&
print(std::ostream& os)
const;
307 applyImpl (inverse_mv_type& X,
313 InverseScalar beta)
const;
316 std::vector<Teuchos::RCP<InverseCrs>> diagBlocks_;
319 mutable std::vector<inverse_mv_type> invX;
321 mutable std::vector<inverse_mv_type> invY;
330 mutable std::vector<Teuchos::Ptr<InverseType>> Inverses_;
331 mutable std::vector<map_type> localMaps_;
346 #endif // IFPACK2_SPARSECONTAINER_HPP
static std::string getName()
Get the name of this container type for Details::constructContainer()
Definition: Ifpack2_SparseContainer_def.hpp:629
Ifpack2::Container class declaration.
virtual bool isComputed() const
Whether the container has been successfully computed.
Definition: Ifpack2_SparseContainer_def.hpp:115
Store and solve a local sparse linear problem.
Definition: Ifpack2_SparseContainer_decl.hpp:134
virtual void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to the given FancyOStream.
Definition: Ifpack2_SparseContainer_def.hpp:525
virtual void initialize()
Do all set-up operations that only require matrix structure.
Definition: Ifpack2_SparseContainer_def.hpp:129
virtual std::ostream & print(std::ostream &os) const
Print information about this object to the given output stream.
Definition: Ifpack2_SparseContainer_def.hpp:488
Declaration and definition of the Ifpack2::Details::MultiVectorLocalGatherScatter class...
virtual void weightedApply(HostView &X, HostView &Y, HostView &W, int blockIndex, int stride, Teuchos::ETransp mode=Teuchos::NO_TRANS, scalar_type alpha=Teuchos::ScalarTraits< scalar_type >::one(), scalar_type beta=Teuchos::ScalarTraits< scalar_type >::zero()) const
Compute Y := alpha * diag(D) * M^{-1} (diag(D) * X) + beta*Y.
Definition: Ifpack2_SparseContainer_def.hpp:334
Ifpack2::Partitioner:
Definition: Ifpack2_Partitioner.hpp:179
virtual std::string description() const
A one-line description of this object.
Definition: Ifpack2_SparseContainer_def.hpp:498
virtual bool isInitialized() const
Whether the container has been successfully initialized.
Definition: Ifpack2_SparseContainer_def.hpp:108
SparseContainer(const Teuchos::RCP< const row_matrix_type > &matrix, const Teuchos::Array< Teuchos::Array< local_ordinal_type > > &partitions, const Teuchos::RCP< const import_type > &importer, int OverlapLevel, scalar_type DampingFactor)
Constructor.
Definition: Ifpack2_SparseContainer_def.hpp:60
static const EVerbosityLevel verbLevel_default
virtual void apply(HostView &X, HostView &Y, int blockIndex, int stride, Teuchos::ETransp mode=Teuchos::NO_TRANS, scalar_type alpha=Teuchos::ScalarTraits< scalar_type >::one(), scalar_type beta=Teuchos::ScalarTraits< scalar_type >::zero()) const
Compute Y := alpha * M^{-1} X + beta*Y.
Definition: Ifpack2_SparseContainer_def.hpp:222
virtual ~SparseContainer()
Destructor (declared virtual for memory safety of derived classes).
Definition: Ifpack2_SparseContainer_def.hpp:100
Interface for creating and solving a local linear problem.
Definition: Ifpack2_Container.hpp:114
virtual void setParameters(const Teuchos::ParameterList &List)
Set all necessary parameters.
Definition: Ifpack2_SparseContainer_def.hpp:122
virtual void compute()
Initialize and compute all blocks.
Definition: Ifpack2_SparseContainer_def.hpp:161
Declaration of ILUT preconditioner.
void clearBlocks()
Definition: Ifpack2_SparseContainer_def.hpp:183