#include <LOCA_Epetra_AugmentedOp.H>
Public Member Functions | |
AugmentedOp (const Teuchos::RCP< LOCA::GlobalData > &global_data, const Teuchos::RCP< Epetra_Operator > &jac, const Teuchos::RCP< const Epetra_MultiVector > &a, const Teuchos::RCP< const Epetra_MultiVector > &b, const Teuchos::RCP< const NOX::Abstract::MultiVector::DenseMatrix > c) | |
Constructor. | |
virtual | ~AugmentedOp () |
Destructor. | |
virtual int | SetUseTranspose (bool UseTranspose) |
If set true, transpose of this operator will be applied. | |
virtual int | Apply (const Epetra_MultiVector &Input, Epetra_MultiVector &Result) const |
Returns the result of a Epetra_Operator applied to a Epetra_MultiVector Input in Result. | |
virtual int | ApplyInverse (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const |
Returns the result of a Epetra_Operator inverse applied to an Epetra_MultiVector Input in Result. | |
virtual double | NormInf () const |
Returns the infinity norm of the bordered matrix. | |
virtual const char * | Label () const |
Returns a character string describing the operator. | |
virtual bool | UseTranspose () const |
Returns the current UseTranspose setting. | |
virtual bool | HasNormInf () const |
Returns true if the this object can provide an approximate Inf-norm, false otherwise. | |
virtual const Epetra_Comm & | Comm () const |
Returns a reference to the Epetra_Comm communicator associated with this operator. | |
virtual const Epetra_Map & | OperatorDomainMap () const |
Returns the Epetra_Map object associated with the domain of this matrix operator. | |
virtual const Epetra_Map & | OperatorRangeMap () const |
Returns the Epetra_Map object associated with the range of this matrix operator. | |
virtual void | init (const Epetra_MultiVector &x) |
Initialiazes operator for a solve. | |
virtual Teuchos::RCP < Epetra_MultiVector > | buildEpetraAugmentedMultiVec (const Epetra_MultiVector &x, const NOX::Abstract::MultiVector::DenseMatrix *y, bool doCopy) const |
Builds an extended vector from components. | |
virtual void | setEpetraAugmentedMultiVec (Epetra_MultiVector &x, NOX::Abstract::MultiVector::DenseMatrix &y, const Epetra_MultiVector &augMultiVec) const |
Sets components from extended vector. | |
Protected Member Functions | |
void | buildExtendedMap (const Epetra_BlockMap &map, Epetra_Map *&extMapPtr, bool buildImporter, bool haveParam) |
Builds extended domain, range maps. | |
int | blockMap2PointMap (const Epetra_BlockMap &BlockMap, Epetra_Map *&PointMap) const |
Converts a block map to an equivalent point map. | |
Protected Attributes | |
Teuchos::RCP< LOCA::GlobalData > | globalData |
LOCA global data object. | |
string | label |
Label for operator. | |
Teuchos::RCP< Epetra_Operator > | jacOperator |
Stores operator representing ![]() | |
const Epetra_BlockMap & | underlyingMap |
Stores underlying domain map. | |
const Epetra_Comm & | underlyingComm |
Stores comm. | |
Epetra_LocalMap | localMap |
Local map for generating Epetra matrices. | |
Teuchos::RCP< const Epetra_MultiVector > | a |
Stores pointer to a multivector. | |
Teuchos::RCP< const Epetra_MultiVector > | b |
Stores pointer to b multivector. | |
Epetra_MultiVector | c |
Stores c matrix. | |
int | underlyingLength |
Stores underlying vector local length. | |
int | numConstraints |
Number of constraints. | |
Epetra_Map * | extendedMapPtr |
Stores extended domain map. | |
Epetra_Map * | extendedImportMapPtr |
Stores extended turning point map for importing param component. | |
Epetra_Import * | extendedImporter |
Stores importer object for importing param component. | |
Epetra_MultiVector * | importedInput |
Stores imported input multivector. | |
Epetra_MultiVector * | result_y |
Stores parameter component of result multivector. | |
Epetra_MultiVector * | tmp |
Stores temporary multivector used in ApplyInverse(). | |
bool | haveParamComponent |
Flag indicating whether we have the parameter component. | |
bool | useTranspose |
Flag indicating whether to use transpose of operator. | |
Teuchos::LAPACK< int, double > | dlapack |
LAPACK Wrappers. | |
Private Member Functions | |
AugmentedOp (const AugmentedOp &) | |
Private to prohibit copying. | |
AugmentedOp & | operator= (const AugmentedOp &) |
Private to prohibit copying. |
The LOCAEpetra::AugmentedOp is an Epetra_Operator representing the bordered matrix
where is an Epetra_Operator representing an
matrix, and
and
are length
Epetra_MultiVector's with
columns, and
is an
dense matrix. It is assumed the Epetra_Map's for
,
, and
are the same and the corresponding map for the bordered matrix is constructed from this map by storing the additional components on processor 0. The buildEpetraAugmentedMultiVec() method can be used to construct an Epetra_MultiVector using this map, a supplied length
Epetra_MultiVector and an
matrix, while setEpetraAugmentedMultiVec() splits an extended multivector into its length
and
components. The Apply() method performs the
matrix multiplication while ApplyInverse() uses a block-elimination algorithm to compute the inverse using the ApplyInverse() method of the underlying operator
. In this way, linear systems of the form
can be solved in a matrix-free mode using the Apply() method. This operator can also represent a preconditioner of the form
using the ApplyInvese() method, where is a preconditioner for
. Note that if
is nearly singular, the preconditioner should not be too good because otherwise the preconditining operation represented by ApplyInverse() becomes unstable.
Definition at line 116 of file LOCA_Epetra_AugmentedOp.H.
LOCA::Epetra::AugmentedOp::AugmentedOp | ( | const Teuchos::RCP< LOCA::GlobalData > & | global_data, | |
const Teuchos::RCP< Epetra_Operator > & | jac, | |||
const Teuchos::RCP< const Epetra_MultiVector > & | a, | |||
const Teuchos::RCP< const Epetra_MultiVector > & | b, | |||
const Teuchos::RCP< const NOX::Abstract::MultiVector::DenseMatrix > | c | |||
) |
Constructor.
Builds the bordered operator using the supplied operator jac and Epetra_Vector's a and b. It is assumed a, b, and jac all have the same map.
Definition at line 49 of file LOCA_Epetra_AugmentedOp.C.
References buildExtendedMap(), extendedImporter, extendedImportMapPtr, extendedMapPtr, haveParamComponent, underlyingComm, and underlyingMap.
LOCA::Epetra::AugmentedOp::~AugmentedOp | ( | ) | [virtual] |
Destructor.
Definition at line 93 of file LOCA_Epetra_AugmentedOp.C.
References extendedImporter, extendedImportMapPtr, extendedMapPtr, importedInput, result_y, and tmp.
LOCA::Epetra::AugmentedOp::AugmentedOp | ( | const AugmentedOp & | ) | [private] |
Private to prohibit copying.
int LOCA::Epetra::AugmentedOp::SetUseTranspose | ( | bool | UseTranspose | ) | [virtual] |
If set true, transpose of this operator will be applied.
Note that is only valid if the underlying operator supports a transpose.
Definition at line 104 of file LOCA_Epetra_AugmentedOp.C.
References jacOperator, and useTranspose.
int LOCA::Epetra::AugmentedOp::Apply | ( | const Epetra_MultiVector & | Input, | |
Epetra_MultiVector & | Result | |||
) | const [virtual] |
Returns the result of a Epetra_Operator applied to a Epetra_MultiVector Input in Result.
Computes the extended matrix-vector product
or its transpose if UseTranpose() is true.
Definition at line 112 of file LOCA_Epetra_AugmentedOp.C.
References a, b, c, extendedImporter, globalData, haveParamComponent, importedInput, jacOperator, localMap, numConstraints, result_y, underlyingLength, underlyingMap, and useTranspose.
int LOCA::Epetra::AugmentedOp::ApplyInverse | ( | const Epetra_MultiVector & | X, | |
Epetra_MultiVector & | Y | |||
) | const [virtual] |
Returns the result of a Epetra_Operator inverse applied to an Epetra_MultiVector Input in Result.
Solves the extended system
using the following block-elimination algorithm:
If UseTranpose() is true, the tranpose of the system is solved.
Definition at line 181 of file LOCA_Epetra_AugmentedOp.C.
References a, b, c, dlapack, extendedImporter, globalData, haveParamComponent, importedInput, jacOperator, localMap, numConstraints, result_y, tmp, underlyingLength, underlyingMap, and useTranspose.
double LOCA::Epetra::AugmentedOp::NormInf | ( | ) | const [virtual] |
Returns the infinity norm of the bordered matrix.
This is defined only if NormInf() of the underlying operator is defined and is given by
.
Definition at line 283 of file LOCA_Epetra_AugmentedOp.C.
References a, b, jacOperator, and numConstraints.
const char * LOCA::Epetra::AugmentedOp::Label | ( | ) | const [virtual] |
Returns a character string describing the operator.
Definition at line 309 of file LOCA_Epetra_AugmentedOp.C.
References label.
bool LOCA::Epetra::AugmentedOp::UseTranspose | ( | ) | const [virtual] |
Returns the current UseTranspose setting.
Definition at line 315 of file LOCA_Epetra_AugmentedOp.C.
References useTranspose.
bool LOCA::Epetra::AugmentedOp::HasNormInf | ( | ) | const [virtual] |
Returns true if the this object can provide an approximate Inf-norm, false otherwise.
Definition at line 321 of file LOCA_Epetra_AugmentedOp.C.
References jacOperator.
const Epetra_Comm & LOCA::Epetra::AugmentedOp::Comm | ( | ) | const [virtual] |
Returns a reference to the Epetra_Comm communicator associated with this operator.
Definition at line 327 of file LOCA_Epetra_AugmentedOp.C.
References underlyingComm.
const Epetra_Map & LOCA::Epetra::AugmentedOp::OperatorDomainMap | ( | ) | const [virtual] |
Returns the Epetra_Map object associated with the domain of this matrix operator.
Definition at line 332 of file LOCA_Epetra_AugmentedOp.C.
References extendedMapPtr.
const Epetra_Map & LOCA::Epetra::AugmentedOp::OperatorRangeMap | ( | ) | const [virtual] |
Returns the Epetra_Map object associated with the range of this matrix operator.
Definition at line 338 of file LOCA_Epetra_AugmentedOp.C.
References extendedMapPtr.
void LOCA::Epetra::AugmentedOp::init | ( | const Epetra_MultiVector & | x | ) | [virtual] |
Initialiazes operator for a solve.
Definition at line 344 of file LOCA_Epetra_AugmentedOp.C.
References extendedImportMapPtr, importedInput, localMap, result_y, tmp, and underlyingMap.
Referenced by LOCA::BorderedSolver::EpetraAugmented::applyInverse().
Teuchos::RCP< Epetra_MultiVector > LOCA::Epetra::AugmentedOp::buildEpetraAugmentedMultiVec | ( | const Epetra_MultiVector & | x, | |
const NOX::Abstract::MultiVector::DenseMatrix * | y, | |||
bool | doCopy | |||
) | const [virtual] |
Builds an extended vector from components.
Builds an extended vector using the map representing the bordered matrix. If doCopy is true, the contents of x are copied into the extended vector, otherwise only space for the extended vector is created.
Definition at line 360 of file LOCA_Epetra_AugmentedOp.C.
References extendedMapPtr, haveParamComponent, numConstraints, and underlyingLength.
Referenced by LOCA::BorderedSolver::EpetraAugmented::applyInverse().
void LOCA::Epetra::AugmentedOp::setEpetraAugmentedMultiVec | ( | Epetra_MultiVector & | x, | |
NOX::Abstract::MultiVector::DenseMatrix & | y, | |||
const Epetra_MultiVector & | augMultiVec | |||
) | const [virtual] |
Sets components from extended vector.
Splits the extended vector augMultiVec into components x and y by copying values out of extVec.
Definition at line 382 of file LOCA_Epetra_AugmentedOp.C.
References extendedImporter, globalData, importedInput, numConstraints, and underlyingLength.
Referenced by LOCA::BorderedSolver::EpetraAugmented::applyInverse().
void LOCA::Epetra::AugmentedOp::buildExtendedMap | ( | const Epetra_BlockMap & | map, | |
Epetra_Map *& | extMapPtr, | |||
bool | buildImporter, | |||
bool | haveParam | |||
) | [protected] |
Builds extended domain, range maps.
Definition at line 405 of file LOCA_Epetra_AugmentedOp.C.
References blockMap2PointMap(), and numConstraints.
Referenced by AugmentedOp().
int LOCA::Epetra::AugmentedOp::blockMap2PointMap | ( | const Epetra_BlockMap & | BlockMap, | |
Epetra_Map *& | PointMap | |||
) | const [protected] |
Converts a block map to an equivalent point map.
Definition at line 467 of file LOCA_Epetra_AugmentedOp.C.
Referenced by buildExtendedMap().
AugmentedOp& LOCA::Epetra::AugmentedOp::operator= | ( | const AugmentedOp & | ) | [private] |
Private to prohibit copying.
Teuchos::RCP<LOCA::GlobalData> LOCA::Epetra::AugmentedOp::globalData [protected] |
LOCA global data object.
Definition at line 291 of file LOCA_Epetra_AugmentedOp.H.
Referenced by Apply(), ApplyInverse(), and setEpetraAugmentedMultiVec().
string LOCA::Epetra::AugmentedOp::label [protected] |
Label for operator.
Definition at line 294 of file LOCA_Epetra_AugmentedOp.H.
Referenced by Label().
Teuchos::RCP<Epetra_Operator> LOCA::Epetra::AugmentedOp::jacOperator [protected] |
Stores operator representing .
Definition at line 297 of file LOCA_Epetra_AugmentedOp.H.
Referenced by Apply(), ApplyInverse(), HasNormInf(), NormInf(), and SetUseTranspose().
const Epetra_BlockMap& LOCA::Epetra::AugmentedOp::underlyingMap [protected] |
Stores underlying domain map.
Definition at line 300 of file LOCA_Epetra_AugmentedOp.H.
Referenced by Apply(), ApplyInverse(), AugmentedOp(), and init().
const Epetra_Comm& LOCA::Epetra::AugmentedOp::underlyingComm [protected] |
Stores comm.
Definition at line 303 of file LOCA_Epetra_AugmentedOp.H.
Referenced by AugmentedOp(), and Comm().
Epetra_LocalMap LOCA::Epetra::AugmentedOp::localMap [protected] |
Local map for generating Epetra matrices.
Definition at line 306 of file LOCA_Epetra_AugmentedOp.H.
Referenced by Apply(), ApplyInverse(), and init().
Teuchos::RCP<const Epetra_MultiVector> LOCA::Epetra::AugmentedOp::a [protected] |
Stores pointer to a multivector.
Definition at line 309 of file LOCA_Epetra_AugmentedOp.H.
Referenced by Apply(), ApplyInverse(), and NormInf().
Teuchos::RCP<const Epetra_MultiVector> LOCA::Epetra::AugmentedOp::b [protected] |
Stores pointer to b multivector.
Definition at line 312 of file LOCA_Epetra_AugmentedOp.H.
Referenced by Apply(), ApplyInverse(), and NormInf().
Epetra_MultiVector LOCA::Epetra::AugmentedOp::c [protected] |
Stores c matrix.
Definition at line 315 of file LOCA_Epetra_AugmentedOp.H.
Referenced by Apply(), and ApplyInverse().
int LOCA::Epetra::AugmentedOp::underlyingLength [protected] |
Stores underlying vector local length.
Definition at line 318 of file LOCA_Epetra_AugmentedOp.H.
Referenced by Apply(), ApplyInverse(), buildEpetraAugmentedMultiVec(), and setEpetraAugmentedMultiVec().
int LOCA::Epetra::AugmentedOp::numConstraints [protected] |
Number of constraints.
Definition at line 321 of file LOCA_Epetra_AugmentedOp.H.
Referenced by Apply(), ApplyInverse(), buildEpetraAugmentedMultiVec(), buildExtendedMap(), NormInf(), and setEpetraAugmentedMultiVec().
Epetra_Map* LOCA::Epetra::AugmentedOp::extendedMapPtr [protected] |
Stores extended domain map.
Definition at line 324 of file LOCA_Epetra_AugmentedOp.H.
Referenced by AugmentedOp(), buildEpetraAugmentedMultiVec(), OperatorDomainMap(), OperatorRangeMap(), and ~AugmentedOp().
Epetra_Map* LOCA::Epetra::AugmentedOp::extendedImportMapPtr [protected] |
Stores extended turning point map for importing param component.
Definition at line 327 of file LOCA_Epetra_AugmentedOp.H.
Referenced by AugmentedOp(), init(), and ~AugmentedOp().
Epetra_Import* LOCA::Epetra::AugmentedOp::extendedImporter [protected] |
Stores importer object for importing param component.
Definition at line 330 of file LOCA_Epetra_AugmentedOp.H.
Referenced by Apply(), ApplyInverse(), AugmentedOp(), setEpetraAugmentedMultiVec(), and ~AugmentedOp().
Epetra_MultiVector* LOCA::Epetra::AugmentedOp::importedInput [protected] |
Stores imported input multivector.
Definition at line 333 of file LOCA_Epetra_AugmentedOp.H.
Referenced by Apply(), ApplyInverse(), init(), setEpetraAugmentedMultiVec(), and ~AugmentedOp().
Epetra_MultiVector* LOCA::Epetra::AugmentedOp::result_y [protected] |
Stores parameter component of result multivector.
Definition at line 336 of file LOCA_Epetra_AugmentedOp.H.
Referenced by Apply(), ApplyInverse(), init(), and ~AugmentedOp().
Epetra_MultiVector* LOCA::Epetra::AugmentedOp::tmp [protected] |
Stores temporary multivector used in ApplyInverse().
Definition at line 339 of file LOCA_Epetra_AugmentedOp.H.
Referenced by ApplyInverse(), init(), and ~AugmentedOp().
bool LOCA::Epetra::AugmentedOp::haveParamComponent [protected] |
Flag indicating whether we have the parameter component.
Definition at line 342 of file LOCA_Epetra_AugmentedOp.H.
Referenced by Apply(), ApplyInverse(), AugmentedOp(), and buildEpetraAugmentedMultiVec().
bool LOCA::Epetra::AugmentedOp::useTranspose [protected] |
Flag indicating whether to use transpose of operator.
Definition at line 345 of file LOCA_Epetra_AugmentedOp.H.
Referenced by Apply(), ApplyInverse(), SetUseTranspose(), and UseTranspose().
Teuchos::LAPACK<int,double> LOCA::Epetra::AugmentedOp::dlapack [protected] |
LAPACK Wrappers.
Definition at line 348 of file LOCA_Epetra_AugmentedOp.H.
Referenced by ApplyInverse().