|
Stokhos Package Browser (Single Doxygen Collection)
Version of the Day
|
Go to the documentation of this file.
42 #ifndef AMESOS2_SOLVER_MP_VECTOR_HPP
43 #define AMESOS2_SOLVER_MP_VECTOR_HPP
45 #include "Amesos2_Solver.hpp"
46 #include "Amesos2_Factory.hpp"
52 template <
class S,
class LO,
class GO,
class N>
59 return S::static_size;
62 #if defined(TPETRA_HAVE_KOKKOS_REFACTOR)
63 template <
class S,
class LO,
class GO,
class D>
69 if (
A != Teuchos::null) {
72 else if (X != Teuchos::null) {
75 else if (
B != Teuchos::null) {
89 template<
class,
class>
class ConcreteSolver>
91 public Solver< Tpetra::CrsMatrix<Sacado::MP::Vector<Storage>,
95 Tpetra::MultiVector<Sacado::MP::Vector<Storage>,
104 typedef Tpetra::CrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node>
Matrix;
105 typedef Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>
Vector;
108 typedef Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node>
Map;
109 typedef Tpetra::CrsGraph<LocalOrdinal,GlobalOrdinal,Node>
FlatGraph;
110 typedef Tpetra::CrsMatrix<BaseScalar,LocalOrdinal,GlobalOrdinal,Node>
FlatMatrix;
111 typedef Tpetra::MultiVector<BaseScalar,LocalOrdinal,GlobalOrdinal,Node>
FlatVector;
116 typedef typename solver_type::type
type;
123 A(A_),
X(X_),
B(B_) {
129 if (
A != Teuchos::null)
131 if (
X != Teuchos::null)
133 if (
B != Teuchos::null)
136 create_solver_with_supported_type<ConcreteSolver,FlatMatrix,FlatVector>::apply(
flat_A,
flat_X,
flat_B);
311 EPhase keep_phase = CLEAN ) {
316 if (keep_phase <= CLEAN) {
325 if (keep_phase <= SYMBFACT)
350 virtual void setA(
const Matrix* a, EPhase keep_phase = CLEAN ) {
364 if (
x != Teuchos::null)
401 if (b != Teuchos::null)
448 virtual std::string
name(
void )
const {
514 template <
template <
class,
class>
class ConcreteSolver,
515 class ST,
class LO,
class GO,
class NO >
518 typedef Tpetra::CrsMatrix<SC,LO,GO,NO>
Matrix;
519 typedef Tpetra::MultiVector<SC,LO,GO,NO>
Vector;
526 typename MatrixTraits<Matrix>::scalar_t,
527 typename MultiVecAdapter<Vector>::scalar_t
529 > same_scalar_assertion;
530 (void)same_scalar_assertion;
540 template <
template <
class,
class>
class ConcreteSolver,
541 class ST,
class LO,
class GO,
class NO >
542 struct create_solver_with_supported_type<
544 Tpetra::CrsMatrix<Sacado::MP::Vector<ST>,LO,GO,NO>,
545 Tpetra::MultiVector<Sacado::MP::Vector<ST>,LO,GO,NO> > :
551 template <
template <
class,
class>
class ConcreteSolver,
553 struct solver_supports_scalar<ConcreteSolver,
Sacado::MP::Vector<Storage> > {
557 static const bool value =
558 Meta::if_then_else<Meta::is_same<supported_scalars, Meta::nil_t>::value,
566 #endif // AMESOS2_SOLVER_MP_VECTOR_HPP
MPVectorSolverAdapter(const Teuchos::RCP< const Matrix > &A_, const Teuchos::RCP< Vector > &X_, const Teuchos::RCP< const Vector > &B_)
Constructor.
virtual Teuchos::RCP< const Teuchos::Comm< int > > getComm(void) const
Returns a pointer to the Teuchos::Comm communicator with this matrix.
Teuchos::RCP< const Vector > B
Tpetra::CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > Matrix
Scalar::value_type BaseScalar
Scalar::value_type BaseScalar
virtual void getTiming(Teuchos::ParameterList &timingParameterList) const
Extracts timing information from the current solver.
virtual void solve(Vector *XX, const Vector *BB) const
Solve using the given XX and BB (multi)vectors.
virtual void setB(const Teuchos::RCP< const Vector > b)
Sets the RHS vector B.
Tpetra::MultiVector< SC, LO, GO, NO > Vector
virtual void setX(const Teuchos::RCP< Vector > x)
Sets the LHS vector X.
virtual type & preOrdering(void)
Pre-orders the matrix.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Solver< FlatMatrix, FlatVector > FlatSolver
Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > FlatGraph
Teuchos::RCP< const FlatVector > flat_B
Tpetra::CrsMatrix< SC, LO, GO, NO > Matrix
virtual type & setParameters(const Teuchos::RCP< Teuchos::ParameterList > ¶meterList)
Set/update internal variables and solver options.
virtual void setA(const Matrix *a, EPhase keep_phase=CLEAN)
Sets the matrix A of this solver.
KokkosClassic::DefaultNode::DefaultNodeType Node
static Teuchos::RCP< Solver< Matrix, Vector > > apply(Teuchos::RCP< const Matrix > A, Teuchos::RCP< Vector > X, Teuchos::RCP< const Vector > B)
virtual std::string description(void) const
Returns a short description of this Solver.
virtual Teuchos::RCP< const Teuchos::ParameterList > getValidParameters(void) const
Return a const parameter list of all of the valid parameters that this->setParameterList(....
virtual Vector * getXRaw(void)
Returns a raw pointer to the LHS of the linear system.
virtual void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
virtual void printTiming(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Prints timing information about the current solver.
ConcreteSolver< FlatMatrix, FlatVector > FlatConcreteSolver
Teuchos::RCP< Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > create_flat_mp_graph(const Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > &graph, Teuchos::RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > &flat_domain_map, Teuchos::RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > &flat_range_map, const LocalOrdinal block_size)
Teuchos::RCP< const FlatGraph > flat_graph
Tpetra::CrsMatrix< BaseScalar, LocalOrdinal, GlobalOrdinal, Node > FlatMatrix
constexpr KOKKOS_INLINE_FUNCTION std::enable_if< is_view_uq_pce< View< T, P... > >::value, unsigned >::type dimension_scalar(const View< T, P... > &view)
virtual Status & getStatus() const
Returns a reference to this solver's internal status object.
Amesos2 solver adapter for MP::Vector scalar type.
virtual bool matrixShapeOK(void)
Returns true if the solver can handle the matrix shape.
Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > Vector
Teuchos::RCP< const Tpetra::MultiVector< typename Storage::value_type, LocalOrdinal, GlobalOrdinal, Node > > create_flat_vector_view(const Tpetra::MultiVector< Sacado::MP::Vector< Storage >, LocalOrdinal, GlobalOrdinal, Node > &vec_const, const Teuchos::RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > &flat_map)
Teuchos::RCP< Tpetra::CrsMatrix< typename Storage::value_type, LocalOrdinal, GlobalOrdinal, Node > > create_flat_matrix(const Tpetra::CrsMatrix< Sacado::MP::Vector< Storage >, LocalOrdinal, GlobalOrdinal, Node > &mat, const Teuchos::RCP< const Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &flat_graph, const LocalOrdinal block_size)
virtual const Teuchos::RCP< Vector > getX(void)
Returns the vector that is the LHS of the linear system.
const IndexType const IndexType const IndexType const IndexType const ValueType const ValueType * x
virtual std::string name(void) const
Return the name of this solver.
Teuchos::RCP< FlatVector > flat_X
virtual void solve(const Teuchos::Ptr< Vector > XX, const Teuchos::Ptr< const Vector > BB) const
Solve using the given XX and BB (multi)vectors.
Teuchos::RCP< const Map > flat_X_map
LO get_mp_vector_size(const Teuchos::RCP< const Tpetra::CrsMatrix< Sacado::MP::Vector< S >, LO, GO, N > > &A=Teuchos::null, const Teuchos::RCP< Tpetra::MultiVector< Sacado::MP::Vector< S >, LO, GO, N > > &X=Teuchos::null, const Teuchos::RCP< const Tpetra::MultiVector< Sacado::MP::Vector< S >, LO, GO, N > > &B=Teuchos::null)
Sacado::MP::Vector< Storage > Scalar
virtual const Vector * getBRaw(void)
Returns a raw pointer to the RHS of the linear system.
Sacado::MP::Vector< Storage > Scalar
solver_traits< ConcreteSolver >::supported_scalars supported_scalars
Teuchos::RCP< FlatSolver > flat_solver
Teuchos::RCP< const Map > flat_B_map
virtual type & symbolicFactorization(void)
Performs symbolic factorization on the matrix.
virtual void solve(void)
Solves (or )
Solver< Matrix, Vector > solver_type
Sacado::MP::Vector< ST > SC
virtual type & numericFactorization(void)
Performs numeric factorization on the matrix.
virtual void setX(Vector *x)
Sets the LHS vector X using a raw pointer.
Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > Map
Stokhos::StandardStorage< int, double > Storage
static const EVerbosityLevel verbLevel_default
Teuchos::RCP< const FlatMatrix > flat_A
Tpetra::MultiVector< BaseScalar, LocalOrdinal, GlobalOrdinal, Node > FlatVector
virtual void setA(const Teuchos::RCP< const Matrix > a, EPhase keep_phase=CLEAN)
Sets the matrix A of this solver.
virtual const Teuchos::RCP< const Vector > getB(void)
Returns the vector that is the RHS of the linear system.
virtual void setB(const Vector *b)
Sets the RHS vector B using a raw pointer.
Teuchos::RCP< const Matrix > A