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" 55 #include "Teuchos_ParameterList.hpp" 129 template<
typename MatrixType,
typename InverseType>
158 static_assert(std::is_same<MatrixType,
159 Tpetra::RowMatrix<
typename MatrixType::scalar_type,
160 typename MatrixType::local_ordinal_type,
161 typename MatrixType::global_ordinal_type,
162 typename MatrixType::node_type> >::value,
163 "Ifpack2::SparseContainer: Please use MatrixType = Tpetra::RowMatrix.");
173 typedef typename Container<MatrixType>::row_matrix_type
row_matrix_type;
193 const Teuchos::ArrayView<const local_ordinal_type>& localRows);
215 virtual void setParameters(
const Teuchos::ParameterList& List);
229 apply (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
230 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
231 Teuchos::ETransp mode=Teuchos::NO_TRANS,
232 scalar_type alpha=Teuchos::ScalarTraits< scalar_type >::one(),
233 scalar_type beta=Teuchos::ScalarTraits< scalar_type >::zero())
const;
237 weightedApply (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
238 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
239 const Tpetra::Vector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& D,
240 Teuchos::ETransp mode=Teuchos::NO_TRANS,
241 scalar_type alpha=Teuchos::ScalarTraits< scalar_type >::one(),
242 scalar_type beta=Teuchos::ScalarTraits< scalar_type >::zero())
const;
251 virtual std::ostream&
print(std::ostream& os)
const;
262 describe (Teuchos::FancyOStream &out,
263 const Teuchos::EVerbosityLevel verbLevel =
264 Teuchos::Describable::verbLevel_default)
const;
268 typedef typename InverseType::scalar_type InverseScalar;
269 typedef typename InverseType::local_ordinal_type InverseLocalOrdinal;
270 typedef typename InverseType::global_ordinal_type InverseGlobalOrdinal;
271 typedef typename InverseType::node_type InverseNode;
277 void extract (
const Teuchos::RCP<const row_matrix_type>& globalMatrix);
291 applyImpl (
const Tpetra::MultiVector<InverseScalar,InverseLocalOrdinal,InverseGlobalOrdinal,InverseNode>& X,
292 Tpetra::MultiVector<InverseScalar,InverseLocalOrdinal,InverseGlobalOrdinal,InverseNode>& Y,
293 Teuchos::ETransp mode,
295 InverseScalar beta)
const;
300 Teuchos::RCP<Tpetra::Map<InverseLocalOrdinal,InverseGlobalOrdinal,InverseNode> > localMap_;
302 Teuchos::RCP<Tpetra::CrsMatrix<InverseScalar,InverseLocalOrdinal,InverseGlobalOrdinal,InverseNode> > diagBlock_;
304 mutable Teuchos::RCP<Tpetra::MultiVector<InverseScalar,InverseLocalOrdinal,InverseGlobalOrdinal,InverseNode> > Y_;
306 mutable Teuchos::RCP<Tpetra::MultiVector<InverseScalar,InverseLocalOrdinal,InverseGlobalOrdinal,InverseNode> > X_;
312 Teuchos::RCP<Teuchos::Comm<int> > localComm_;
321 Teuchos::RCP<InverseType> Inverse_;
324 Teuchos::ParameterList List_;
331 #endif // IFPACK2_SPARSECONTAINER_HPP MatrixType::node_type node_type
The Node type of the input (global) matrix.
Definition: Ifpack2_SparseContainer_decl.hpp:156
virtual void apply(const Tpetra::MultiVector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > &X, Tpetra::MultiVector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > &Y, 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:194
Ifpack2::Container class declaration.
virtual bool isComputed() const
Whether the container has been successfully computed.
Definition: Ifpack2_SparseContainer_def.hpp:97
Store and solve a local sparse linear problem.
Definition: Ifpack2_SparseContainer_decl.hpp:130
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:498
virtual void weightedApply(const Tpetra::MultiVector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > &X, Tpetra::MultiVector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > &Y, const Tpetra::Vector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > &D, 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:304
MatrixType::global_ordinal_type global_ordinal_type
The type of global indices in the input (global) matrix.
Definition: Ifpack2_SparseContainer_decl.hpp:154
virtual void initialize()
Do all set-up operations that only require matrix structure.
Definition: Ifpack2_SparseContainer_def.hpp:111
MatrixType::local_ordinal_type local_ordinal_type
The type of local indices in the input (global) matrix.
Definition: Ifpack2_SparseContainer_decl.hpp:152
virtual std::ostream & print(std::ostream &os) const
Print information about this object to the given output stream.
Definition: Ifpack2_SparseContainer_def.hpp:466
Declaration and definition of the Ifpack2::Details::MultiVectorLocalGatherScatter class...
virtual size_t getNumRows() const
The number of rows in the local matrix on the calling process.
Definition: Ifpack2_SparseContainer_def.hpp:79
virtual std::string description() const
A one-line description of this object.
Definition: Ifpack2_SparseContainer_def.hpp:476
virtual bool isInitialized() const
Whether the container has been successfully initialized.
Definition: Ifpack2_SparseContainer_def.hpp:90
InverseType inverse_type
The second template parameter of this class.
Definition: Ifpack2_SparseContainer_decl.hpp:147
virtual ~SparseContainer()
Destructor (declared virtual for memory safety of derived classes).
Definition: Ifpack2_SparseContainer_def.hpp:74
Interface for creating and solving a local linear problem.
Definition: Ifpack2_Container.hpp:103
SparseContainer(const Teuchos::RCP< const row_matrix_type > &matrix, const Teuchos::ArrayView< const local_ordinal_type > &localRows)
Constructor.
Definition: Ifpack2_SparseContainer_def.hpp:59
virtual void setParameters(const Teuchos::ParameterList &List)
Set all necessary parameters.
Definition: Ifpack2_SparseContainer_def.hpp:104
MatrixType::scalar_type scalar_type
The type of entries in the input (global) matrix.
Definition: Ifpack2_SparseContainer_decl.hpp:150
virtual void compute()
Extract the local diagonal block and prepare the solver.
Definition: Ifpack2_SparseContainer_def.hpp:145
Preconditioners and smoothers for Tpetra sparse matrices.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:72
Container< MatrixType >::row_matrix_type row_matrix_type
The (base class) type of the input matrix.
Definition: Ifpack2_SparseContainer_decl.hpp:163
MatrixType matrix_type
The first template parameter of this class.
Definition: Ifpack2_SparseContainer_decl.hpp:141