44 #include <Xyce_config.h>
51 #include <N_ERH_ErrorMgr.h>
54 #include <N_LAS_Vector.h>
55 #include <N_PDS_ParMap.h>
69 RCP<NonLinearSolver> nonlinearSolver,
70 RCP<Linear::Vector> solVector,
71 RCP<Linear::Vector> rhsVector,
72 RCP<const Epetra_Map> solutionMap
75 RCP<MatrixFreeEpetraOperator> epetraOperator =
77 epetraOperator->initialize(nonlinearSolver,
82 return epetraOperator;
120 RCP<NonLinearSolver> nonlinearSolver,
121 RCP<Linear::Vector> solVector,
122 RCP<Linear::Vector> rhsVector,
123 RCP<const Epetra_Map> solutionMap
156 const Epetra_MultiVector& X,
157 Epetra_MultiVector& Y
163 Epetra_MultiVector* Xcopy =
new Epetra_MultiVector(X);
164 Epetra_MultiVector* Ycopy =
new Epetra_MultiVector(Y);
165 Linear::MultiVector las_X(Xcopy,
true);
166 Linear::MultiVector las_Y(Ycopy,
true);
167 int status =
Apply(las_X,las_Y);
169 Y = las_Y.epetraObj();
182 const Linear::MultiVector& X,
183 Linear::MultiVector& Y
188 std::string msg =
"MatrixFreeEpetraOperator::Apply: I'm not initialized!";
189 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
192 for (
int i=0 ; i<X.numVectors() ; ++i)
194 const Linear::Vector x(X.epetraVector(i),
true);
195 Linear::Vector y(Y.epetraVector(i),
true);
197 status = status && localStatus;
217 const Epetra_MultiVector& X,
218 Epetra_MultiVector& Y
221 std::string msg =
"MatrixFreeEpetraOperator::ApplyInverse is not supported!";
222 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
235 const Linear::MultiVector& X,
236 Linear::MultiVector& Y
239 std::string msg =
"MatrixFreeEpetraOperator::ApplyInverse is not supported!";
240 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
254 std::string msg =
"MatrixFreeEpetraOperator::NormInf is not supported!";
255 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
269 return "Matrix Free Harmonic Balance Epetra Operator";
312 std::string msg =
"MatrixFreeEpetraOperator::Comm: I'm not initialized!";
313 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
330 std::string msg =
"MatrixFreeEpetraOperator::OperatorDomainMap: I'm not initialized!";
331 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
348 std::string msg =
"MatrixFreeEpetraOperator::OperatorRangeMap: I'm not initialized!";
349 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
351 const Epetra_Map* emap =
dynamic_cast<const Epetra_Map*
>(&
rhsVectorRCPtr_->epetraObj().Map());
bool UseTranspose() const
Returns the current UseTranspose setting.
Teuchos::RCP< Linear::Vector > rhsVectorRCPtr_
Teuchos::RCP< NonLinearSolver > nonlinearSolverRCPtr_
Pure virtual class to augment a linear system.
const char * Label() const
Returns a character string describing the operator.
int ApplyInverse(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Returns the result of a Epetra_Operator inverse applied to an Epetra_MultiVector X in Y...
const Epetra_Map & OperatorDomainMap() const
Returns the Epetra_Map object associated with the domain of this operator.
const Epetra_Comm & Comm() const
Returns a pointer to the Epetra_Comm communicator associated with this operator.
MatrixFreeEpetraOperator()
int SetUseTranspose(bool UseTranspose)
If set true, transpose of this operator will be applied.
virtual ~MatrixFreeEpetraOperator()
void initialize(RCP< NonLinearSolver > nonlinearSolver, RCP< Linear::Vector > solVector, RCP< Linear::Vector > rhsVector, RCP< const Epetra_Map > solutionMap)
bool HasNormInf() const
Returns true if the this object can provide an approximate Inf-norm, false otherwise.
Teuchos::RCP< const Epetra_Map > solutionMap_
double NormInf() const
Returns the infinity norm of the global matrix.
Teuchos::RCP< Linear::Vector > solVectorRCPtr_
const Epetra_Map & OperatorRangeMap() const
Returns the Epetra_Map object associated with the range of this operator.
RCP< MatrixFreeEpetraOperator > matrixFreeEpetraOperator(RCP< NonLinearSolver > nonlinearSolver, RCP< Linear::Vector > solVector, RCP< Linear::Vector > rhsVector, RCP< const Epetra_Map > solutionMap)
int Apply(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Returns the result of a Epetra_Operator applied to a Epetra_MultiVector X in Y.