52#ifndef AMESOS2_SOLVERCORE_DECL_HPP
53#define AMESOS2_SOLVERCORE_DECL_HPP
57#include <Teuchos_RCP.hpp>
58#include <Teuchos_ParameterList.hpp>
60#include "Amesos2_Solver.hpp"
61#include "Amesos2_MatrixTraits.hpp"
62#include "Amesos2_MatrixAdapter_decl.hpp"
63#include "Amesos2_MultiVecAdapter_decl.hpp"
102 template <
template <
class,
class>
class ConcreteSolver,
110 typedef SolverCore<ConcreteSolver,Matrix,Vector> type;
111 typedef Solver<Matrix,Vector> super_type;
112 typedef ConcreteSolver<Matrix,Vector> solver_type;
113 typedef Matrix matrix_type;
114 typedef Vector vector_type;
115 typedef typename MatrixAdapter<matrix_type>::scalar_t scalar_type;
116 typedef typename MatrixAdapter<matrix_type>::local_ordinal_t local_ordinal_type;
117 typedef typename MatrixAdapter<matrix_type>::global_ordinal_t global_ordinal_type;
118 typedef typename MatrixAdapter<matrix_type>::global_size_t global_size_type;
119 typedef typename MatrixAdapter<matrix_type>::node_t node_type;
135 Teuchos::RCP<Vector> X,
136 Teuchos::RCP<const Vector> B );
235 void solve(
const Teuchos::Ptr<Vector> X,
const Teuchos::Ptr<const Vector> B)
const;
236 void solve(Vector* X,
const Vector* B)
const;
238 int solve_ir(
const Teuchos::Ptr<Vector> X,
const Teuchos::Ptr<const Vector> B,
239 const int maxNumIters,
const bool verbose)
const;
240 int solve_ir(Vector* X,
const Vector* B,
241 const int maxNumIters,
const bool verbose)
const;
242 int solve_ir(
const int maxNumIters,
const bool verbose);
258 void setA(
const Teuchos::RCP<const Matrix> a,
EPhase keep_phase = CLEAN );
260 void setA(
const Matrix* a,
EPhase keep_phase = CLEAN ){
setA(Teuchos::rcp(a), keep_phase); }
304 const Teuchos::RCP<Teuchos::ParameterList> & parameterList );
341 return Teuchos::null;
352 return Teuchos::null;
363 Teuchos::RCP<const Teuchos::Comm<int> >
getComm()
const
382 void describe(Teuchos::FancyOStream &out,
383 const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default)
const;
403 Teuchos::FancyOStream &out,
404 const Teuchos::EVerbosityLevel verbLevel)
const;
415 void getTiming(Teuchos::ParameterList& timingParameterList)
const;
425 std::string
name()
const;
455 Teuchos::RCP<const MatrixAdapter<Matrix> >
matrixA_;
Container class for control variables.
Container class for status variables.
Container class for Timers used with the Amesos2::Solver class.
Enum and other types declarations for Amesos2.
Amesos2::SolverCore: A templated interface for interaction with third-party direct sparse solvers.
Definition Amesos2_SolverCore_decl.hpp:106
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Definition Amesos2_SolverCore_def.hpp:598
const Teuchos::RCP< Vector > getX()
Returns the vector that is the LHS of the linear system.
Definition Amesos2_SolverCore_decl.hpp:266
SolverCore(const solver_type &rhs)
Do not allow copying of this Solver object.
int nprocs_
Number of process images in the matrix communicator.
Definition Amesos2_SolverCore_decl.hpp:509
super_type & numericFactorization()
Performs numeric factorization on the matrix A.
Definition Amesos2_SolverCore_def.hpp:144
void printTiming(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
Prints timing information about the current solver.
Definition Amesos2_SolverCore_def.hpp:659
void setParameterList(const Teuchos::RCP< Teuchos::ParameterList > ¶meterList)
Set or update internal variables and solver options.
Definition Amesos2_SolverCore_decl.hpp:328
Teuchos::RCP< const MatrixAdapter< Matrix > > matrixA_
The LHS operator.
Definition Amesos2_SolverCore_decl.hpp:455
Status & getStatus() const
Returns a reference to this solver's internal status object.
Definition Amesos2_SolverCore_decl.hpp:370
std::string description() const
Returns a short description of this Solver.
Definition Amesos2_SolverCore_def.hpp:588
int rank_
The MPI rank of this image.
Definition Amesos2_SolverCore_decl.hpp:503
bool root_
If true, then this is the root processor.
Definition Amesos2_SolverCore_decl.hpp:506
void setNnzLU(size_t nnz)
Set the number of non-zero values in the and factors.
Definition Amesos2_SolverCore_decl.hpp:452
SolverCore(Teuchos::RCP< const Matrix > A, Teuchos::RCP< Vector > X, Teuchos::RCP< const Vector > B)
Initialize a Solver instance.
Definition Amesos2_SolverCore_def.hpp:70
super_type & setParameters(const Teuchos::RCP< Teuchos::ParameterList > ¶meterList)
Set/update internal variables and solver options.
Definition Amesos2_SolverCore_def.hpp:518
void getTiming(Teuchos::ParameterList &timingParameterList) const
Extracts timing information from the current solver.
Definition Amesos2_SolverCore_def.hpp:741
Vector * getXRaw()
Returns a raw pointer to the LHS of the linear system.
Definition Amesos2_SolverCore_decl.hpp:268
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
Return a const parameter list of all of the valid parameters that this->setParameterList(....
Definition Amesos2_SolverCore_def.hpp:550
void setB(const Vector *b)
Sets the RHS vector B using a raw pointer.
Definition Amesos2_SolverCore_decl.hpp:272
global_size_type rowIndexBase_
Index base of rowmap of matrixA_.
Definition Amesos2_SolverCore_decl.hpp:485
const Vector * getBRaw()
Returns a raw pointer to the RHS of the linear system.
Definition Amesos2_SolverCore_decl.hpp:276
void setA(const Matrix *a, EPhase keep_phase=CLEAN)
Sets the matrix A of this solver.
Definition Amesos2_SolverCore_decl.hpp:260
std::string name() const
Return the name of this solver.
Definition Amesos2_SolverCore_def.hpp:751
global_size_type globalNumCols_
Number of global columns in matrixA_.
Definition Amesos2_SolverCore_decl.hpp:479
void setA(const Teuchos::RCP< const Matrix > a, EPhase keep_phase=CLEAN)
Sets the matrix A of this solver.
Definition Amesos2_SolverCore_def.hpp:475
void setX(Vector *x)
Sets the LHS vector X using a raw pointer.
Definition Amesos2_SolverCore_decl.hpp:264
void loadA(EPhase current_phase)
Refresh this solver's internal data about A.
Definition Amesos2_SolverCore_def.hpp:759
bool matrix_loaded_
Definition Amesos2_SolverCore_decl.hpp:462
Teuchos::RCP< Teuchos::ParameterList > unsetParameterList()
This is an empty stub.
Definition Amesos2_SolverCore_decl.hpp:350
void setX(const Teuchos::RCP< Vector > x)
Sets the LHS vector X.
Definition Amesos2_SolverCore_decl.hpp:262
Teuchos::RCP< Teuchos::ParameterList > getNonconstParameterList()
This is a empty stub.
Definition Amesos2_SolverCore_decl.hpp:339
global_size_type columnIndexBase_
Index base of column map of matrixA_.
Definition Amesos2_SolverCore_decl.hpp:488
void setB(const Teuchos::RCP< const Vector > b)
Sets the RHS vector B.
Definition Amesos2_SolverCore_decl.hpp:270
Timers timers_
Various timing statistics.
Definition Amesos2_SolverCore_decl.hpp:497
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
Returns a pointer to the Teuchos::Comm communicator with this operator.
Definition Amesos2_SolverCore_decl.hpp:363
global_size_type globalNumNonZeros_
Number of global non-zero values in matrixA_.
Definition Amesos2_SolverCore_decl.hpp:482
global_size_type globalNumRows_
Number of global rows in matrixA_.
Definition Amesos2_SolverCore_decl.hpp:476
Status status_
Holds status information about a solver.
Definition Amesos2_SolverCore_decl.hpp:491
const Teuchos::RCP< const Vector > getB()
Returns the vector that is the RHS of the linear system.
Definition Amesos2_SolverCore_decl.hpp:274
~SolverCore()
Destructor.
Definition Amesos2_SolverCore_def.hpp:95
Teuchos::RCP< const Vector > multiVecB_
The RHS vector/multi-vector.
Definition Amesos2_SolverCore_decl.hpp:473
void solve()
Solves (or )
Definition Amesos2_SolverCore_def.hpp:167
Control control_
Parameters for solving.
Definition Amesos2_SolverCore_decl.hpp:494
super_type & operator=(const solver_type *rhs)
Do not allow copying of this Solver by assignment.
bool matrixShapeOK()
Returns true if the solver can handle this matrix shape.
Definition Amesos2_SolverCore_def.hpp:461
super_type & symbolicFactorization()
Performs symbolic factorization on the matrix A.
Definition Amesos2_SolverCore_def.hpp:121
Teuchos::RCP< Vector > multiVecX_
The LHS vector/multi-vector.
Definition Amesos2_SolverCore_decl.hpp:466
super_type & preOrdering()
Pre-orders the matrix A for minimal fill-in.
Definition Amesos2_SolverCore_def.hpp:103
Interface to Amesos2 solver objects.
Definition Amesos2_Solver_decl.hpp:78
Holds internal status data about the owning Amesos2 solver.
Definition Amesos2_Status.hpp:73
size_t lu_nnz_
The number of non-zeros in the factors.
Definition Amesos2_Status.hpp:149
EPhase
Used to indicate a phase in the direct solution.
Definition Amesos2_TypeDecl.hpp:65