00001 #ifndef ML_INVERSEOPERATOR_H
00002 #define ML_INVERSEOPERATOR_H
00003
00013
00014
00015
00016
00017
00018 #include "ml_common.h"
00019 #include "ml_MultiLevelPreconditioner.h"
00020 #include "MLAPI_BaseOperator.h"
00021 #include "MLAPI_CompObject.h"
00022 #include "MLAPI_TimeObject.h"
00023 #include "MLAPI_Operator.h"
00024 #include "Teuchos_RefCountPtr.hpp"
00025
00026 namespace Teuchos {
00027 class List;
00028 }
00029 class Ifpack_Preconditioner;
00030
00031 namespace MLAPI {
00032
00033 class MultiLevel;
00034
00046 class InverseOperator : public BaseOperator, public CompObject, public TimeObject {
00047
00048 public:
00049
00050
00052 InverseOperator() {}
00053
00055 InverseOperator(const Operator& Op, const string Type);
00056
00058 InverseOperator(const Operator& Op, const string Type,
00059 Teuchos::ParameterList& List);
00060
00062 InverseOperator(const InverseOperator& RHS);
00063
00065 ~InverseOperator()
00066 {}
00067
00068
00069
00070
00072 InverseOperator& operator=(const InverseOperator& RHS);
00073
00074
00075
00076
00078 void Reshape();
00079
00081 void Reshape(const Operator& Op, const string Type);
00082
00084 void Reshape(const Operator& Op, const string Type,
00085 Teuchos::ParameterList& List);
00086
00087
00088
00089
00091 const Space GetOperatorRangeSpace() const;
00092
00094 const Space GetOperatorDomainSpace() const;
00095
00097 const Space GetRangeSpace() const;
00098
00100 const Space GetDomainSpace() const;
00101
00103 const Teuchos::RefCountPtr<Epetra_RowMatrix> RCPRowMatrix() const;
00104
00106 Epetra_RowMatrix* RowMatrix() const;
00107
00109 const Operator& GetOperator() const;
00110
00112 Teuchos::RefCountPtr<Ifpack_Preconditioner>& GetRCPData();
00113
00115 Teuchos::RefCountPtr<ML_Epetra::MultiLevelPreconditioner>& GetRCPMLPrec();
00116
00118 const Teuchos::RefCountPtr<Ifpack_Preconditioner>& GetRCPData() const;
00119
00121 const Teuchos::RefCountPtr<ML_Epetra::MultiLevelPreconditioner>& GetRCPMLPrec() const;
00122
00123
00124
00125
00127 int Apply(const MultiVector& x, MultiVector& y) const;
00128
00130 MultiVector operator()(const MultiVector& LHS);
00131
00133 MultiVector operator()(const MultiVector& LHS,
00134 const MultiVector& RHS);
00135
00136
00137
00138
00140 ostream& Print(std::ostream& os, const bool verbose = true) const;
00141
00142 private:
00143
00144
00145
00146
00147 void Destroy();
00148
00150 Operator Op_;
00152 Teuchos::RefCountPtr<Epetra_RowMatrix> RCPRowMatrix_;
00154 Teuchos::RefCountPtr<Ifpack_Preconditioner> RCPData_;
00156 Teuchos::RefCountPtr<ML_Epetra::MultiLevelPreconditioner> RCPMLPrec_;
00157
00158
00159 };
00160
00161 }
00162
00163 #endif // ML_INVERSEOPERATOR_H