/usr/include/trilinos/MLAPI_InverseOperator.h is in libtrilinos-ml-dev 12.10.1-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | #ifndef ML_INVERSEOPERATOR_H
#define ML_INVERSEOPERATOR_H
/*!
\file MLAPI_InverseOperator.h
\brief Base class for smoothers and coarse solvers.
\author Marzio Sala, D-INFK/ETHZ.
\date Last updated on Mar-06.
*/
/* ******************************************************************** */
/* See the file COPYRIGHT for a complete copyright notice, contact */
/* person and disclaimer. */
/* ******************************************************************** */
#include "ml_common.h"
#include "ml_MultiLevelPreconditioner.h"
#include "MLAPI_BaseOperator.h"
#include "MLAPI_CompObject.h"
#include "MLAPI_TimeObject.h"
#include "MLAPI_Operator.h"
#include "Teuchos_RefCountPtr.hpp"
namespace Teuchos {
class List;
}
class Ifpack_Preconditioner;
namespace MLAPI {
class MultiLevel;
/*!
* \class InverseOperator
*
* \brief InverseOperator: basic class to define smoother and coarse solvers.
*
*
* \author Marzio Sala, D-INFK/ETHZ.
*
* \date Last updated on Mar-06.
*/
class InverseOperator : public BaseOperator, public CompObject, public TimeObject {
public:
// @{ \name Constructors and destructors.
//! Empty constructor.
InverseOperator() {}
//! Constructor for a given Operator and type, and default parameters.
InverseOperator(const Operator& Op, const std::string Type);
//! Constructor for a given Operator, type and parameters.
InverseOperator(const Operator& Op, const std::string Type,
Teuchos::ParameterList& List);
//! Copy constructor.
InverseOperator(const InverseOperator& RHS);
//! Destructor.
~InverseOperator()
{}
// @}
// @{ \name Overloaded operators
//! Operator =.
InverseOperator& operator=(const InverseOperator& RHS);
// @}
// @{ Reshaping methods
//! Resets \c this object.
void Reshape();
//! Reshapes the object with default values.
void Reshape(const Operator& Op, const std::string Type);
//! Reshapes the object by setting the Operator and the specified type.
void Reshape(const Operator& Op, const std::string Type,
Teuchos::ParameterList& List,
Teuchos::ParameterList* pushlist = NULL);
//! Reshape with preconstructed smoother as Ifpack_Preconditioner
void Reshape(Ifpack_Preconditioner* prec, const Operator& Op,
const bool ownership);
// @}
// @{ Get and Set methods.
//! Returns a reference to the range space of \c this object.
const Space GetOperatorRangeSpace() const;
//! Returns a reference to the domain space of \c this object.
const Space GetOperatorDomainSpace() const;
//! Returns a reference to the range space of \c this object.
const Space GetRangeSpace() const;
//! Returns a reference to the domain space of \c this object.
const Space GetDomainSpace() const;
//! Returns pointer of the internally stored ML_Epetra::RowMatrix object.
const Teuchos::RefCountPtr<Epetra_RowMatrix> RCPRowMatrix() const;
//! Returns pointer of the internally stored ML_Epetra::RowMatrix object.
Epetra_RowMatrix* RowMatrix() const;
//! Returns a reference to the Operator of which \c this object defines the inverse.
const Operator& GetOperator() const;
//! Returns a pointer to the internally stored IFPACK preconditioner.
Teuchos::RefCountPtr<Ifpack_Preconditioner>& GetRCPData();
//! Returns a pointer to the internally stored IFPACK preconditioner.
Teuchos::RefCountPtr<ML_Epetra::MultiLevelPreconditioner>& GetRCPMLPrec();
//! Returns a pointer to the internally stored IFPACK preconditioner.
const Teuchos::RefCountPtr<Ifpack_Preconditioner>& GetRCPData() const;
//! Returns a pointer to the internally stored ML preconditioner.
const Teuchos::RefCountPtr<ML_Epetra::MultiLevelPreconditioner>& GetRCPMLPrec() const;
// @}
// @{ Mathematical methods
//! Applies \c this object to vector \c lhs, returns values in \c rhs.
int Apply(const MultiVector& x, MultiVector& y) const;
//! Applies the operator to LHS, returns the results.
MultiVector operator()(const MultiVector& LHS);
//! Applies the operator to LHS using RHS as initial solution, returns the results.
MultiVector operator()(const MultiVector& LHS,
const MultiVector& RHS);
// @}
// @{ \name Miscellaneous methods
//! Prints out basic information about \c this object.
std::ostream& Print(std::ostream& os, const bool verbose = true) const;
private:
// @}
// @{ \name Private data and methods
void Destroy();
//! Operator of which \c this object define the inverse.
Operator Op_;
//! Wrapper for IFPACK
Teuchos::RefCountPtr<Epetra_RowMatrix> RCPRowMatrix_;
//! IFPACK preconditioner.
Teuchos::RefCountPtr<Ifpack_Preconditioner> RCPData_;
//! ML preconditioner
Teuchos::RefCountPtr<ML_Epetra::MultiLevelPreconditioner> RCPMLPrec_;
// @}
}; // InverseOperator
} // namespace MLAPI
#endif // ML_INVERSEOPERATOR_H
|