16 #ifndef __Teko_DiagnosticLinearOp_hpp__
17 #define __Teko_DiagnosticLinearOp_hpp__
22 #include "Teko_ImplicitLinearOp.hpp"
24 #include "Teuchos_Time.hpp"
38 DiagnosticLinearOp(
const Teuchos::RCP<std::ostream> &ostrm,
const ModifiableLinearOp &A,
39 const std::string &diagnosticString);
46 const std::string &diagnosticString);
53 const ModifiableLinearOp &A,
const std::string &diagnosticString);
63 virtual VectorSpace
range()
const {
return wrapOpA_lo_->range(); }
66 virtual VectorSpace
domain()
const {
return wrapOpA_lo_->domain(); }
80 virtual void implicitApply(
const MultiVector &x, MultiVector &y,
const double alpha = 1.0,
81 const double beta = 0.0)
const;
84 virtual void describe(Teuchos::FancyOStream &out_arg,
85 const Teuchos::EVerbosityLevel verbLevel)
const {
86 wrapOpA_lo_->describe(out_arg, verbLevel);
89 int numApplications()
const {
return timer_.numCalls(); }
90 double totalTime()
const {
return timer_.totalElapsedTime(); }
92 ModifiableLinearOp getModifiableOp()
const {
return wrapOpA_; }
94 void setLinearOp(
const LinearOp &lo) {
96 wrapOpA_ = Teuchos::null;
99 LinearOp getLinearOp()
const {
return wrapOpA_lo_; }
101 void setForwardOp(
const Teko::LinearOp &lo) { fwdOp_ = lo; }
105 double getResidualNorm()
const {
return residualNorm_; }
109 Teuchos::RCP<std::ostream> outputStream_;
110 ModifiableLinearOp wrapOpA_;
111 LinearOp wrapOpA_lo_;
113 std::string diagString_;
115 mutable double residualNorm_;
116 mutable Teuchos::Time timer_;
138 const ModifiableLinearOp &A,
139 const std::string &label) {
157 const LinearOp &A,
const std::string &label) {
176 const Teko::LinearOp &fwdOp,
177 const ModifiableLinearOp &A,
178 const std::string &label) {
virtual void implicitApply(const MultiVector &x, MultiVector &y, const double alpha=1.0, const double beta=0.0) const
Perform a matrix vector multiply with this operator.
virtual VectorSpace domain() const
Domain space of this operator.
ModifiableLinearOp createDiagnosticLinearOp(const Teuchos::RCP< std::ostream > &os, const LinearOp &A, const std::string &label)
Constructor method for building DiagnosticLinearOp.
virtual ~DiagnosticLinearOp()
Destructor prints out timing information about this operator.
DiagnosticLinearOp(const Teuchos::RCP< std::ostream > &ostrm, const ModifiableLinearOp &A, const std::string &diagnosticString)
This constructor explicitly takes the linear operator that needs to be wrapped and a string for outpu...
A virtual class that simplifies the construction of custom operators.
ModifiableLinearOp createDiagnosticLinearOp(const Teuchos::RCP< std::ostream > &os, const ModifiableLinearOp &A, const std::string &label)
Constructor method for building DiagnosticLinearOp.
This linear operator prints diagnostics about operator application and creation times. It is useful for debugging problems and determining bottle necks.
virtual VectorSpace range() const
Range space of this operator.
ModifiableLinearOp createDiagnosticLinearOp(const Teuchos::RCP< std::ostream > &os, const Teko::LinearOp &fwdOp, const ModifiableLinearOp &A, const std::string &label)
Constructor method for building DiagnosticLinearOp.