53 #ifndef __Teko_DiagnosticLinearOp_hpp__
54 #define __Teko_DiagnosticLinearOp_hpp__
59 #include "Teko_ImplicitLinearOp.hpp"
61 #include "Teuchos_Time.hpp"
75 DiagnosticLinearOp(
const Teuchos::RCP<std::ostream> & ostrm,
const ModifiableLinearOp & A,
const std::string & diagnosticString);
81 DiagnosticLinearOp(
const Teuchos::RCP<std::ostream> & ostrm,
const LinearOp & A,
const std::string & diagnosticString);
87 DiagnosticLinearOp(
const Teuchos::RCP<std::ostream> & ostrm,
const LinearOp & fwdOp,
const ModifiableLinearOp & A,
const std::string & diagnosticString);
97 virtual VectorSpace
range()
const {
return wrapOpA_lo_->range(); }
100 virtual VectorSpace
domain()
const {
return wrapOpA_lo_->domain(); }
114 virtual void implicitApply(
const MultiVector & x, MultiVector & y,
115 const double alpha = 1.0,
const double beta = 0.0)
const;
118 virtual void describe(Teuchos::FancyOStream & out_arg,
119 const Teuchos::EVerbosityLevel verbLevel)
const
120 { wrapOpA_lo_->describe(out_arg,verbLevel); }
122 int numApplications()
const {
return timer_.numCalls(); }
123 double totalTime()
const {
return timer_.totalElapsedTime(); }
125 ModifiableLinearOp getModifiableOp()
const
128 void setLinearOp(
const LinearOp & lo)
129 { wrapOpA_lo_ = lo; wrapOpA_ = Teuchos::null; }
131 LinearOp getLinearOp()
const
132 {
return wrapOpA_lo_; }
134 void setForwardOp(
const Teko::LinearOp & lo)
139 double getResidualNorm()
const
140 {
return residualNorm_; }
144 Teuchos::RCP<std::ostream> outputStream_;
145 ModifiableLinearOp wrapOpA_;
146 LinearOp wrapOpA_lo_;
148 std::string diagString_;
150 mutable double residualNorm_;
151 mutable Teuchos::Time timer_;
172 inline ModifiableLinearOp
createDiagnosticLinearOp(
const Teuchos::RCP<std::ostream> & os,
const ModifiableLinearOp & A,
const std::string & label)
190 inline ModifiableLinearOp
createDiagnosticLinearOp(
const Teuchos::RCP<std::ostream> & os,
const LinearOp & A,
const std::string & label)
209 inline ModifiableLinearOp
createDiagnosticLinearOp(
const Teuchos::RCP<std::ostream> & os,
const Teko::LinearOp & fwdOp,
const ModifiableLinearOp & A,
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.