10 #ifndef THYRA_DEFAULT_FINAL_POINT_CAPTURE_MODEL_EVALUATOR_HPP
11 #define THYRA_DEFAULT_FINAL_POINT_CAPTURE_MODEL_EVALUATOR_HPP
13 #include "Thyra_ModelEvaluatorDelegatorBase.hpp"
14 #include "Thyra_LinearOpWithSolveFactoryBase.hpp"
15 #include "Teuchos_Time.hpp"
31 template<
class Scalar>
94 bool finalPointWasSolved_;
106 template<
class Scalar>
108 :finalPointWasSolved_(false)
112 template<
class Scalar>
118 finalPoint_ = thyraModel->createInArgs();
119 finalPoint_.setArgs(thyraModel->getNominalValues());
120 finalPointWasSolved_ =
false;
124 template<
class Scalar>
128 #ifdef THYRA_DEFAULT_FINAL_POINT_CAPTURE_MODEL_EVALUATOR_DUMP_ALL
130 <<
"\nDefaultFinalPointCaptureModelEvaluator<Scalar>::getFinalPoint():"
137 template<
class Scalar>
140 return finalPointWasSolved_;
147 template<
class Scalar>
151 thyraModel = this->getUnderlyingModel();
152 std::ostringstream oss;
153 oss <<
"Thyra::DefaultFinalPointCaptureModelEvaluator{";
154 oss <<
"thyraModel=";
156 oss <<
"\'"<<thyraModel->description()<<
"\'";
167 template<
class Scalar>
173 finalPoint_.setArgs(finalPoint);
174 finalPointWasSolved_ = wasSolved;
175 if(!this->isUnderlyingModelConst())
176 this->getNonconstUnderlyingModel()->reportFinalPoint(finalPoint,wasSolved);
177 #ifdef THYRA_DEFAULT_FINAL_POINT_CAPTURE_MODEL_EVALUATOR_DUMP_ALL
179 <<
"\nDefaultFinalPointCaptureModelEvaluator<Scalar>::reportFinalPoint(...):"
188 template<
class Scalar>
195 THYRA_MODEL_EVALUATOR_DECORATOR_EVAL_MODEL_BEGIN(
196 "Thyra::DefaultFinalPointCaptureModelEvaluator",inArgs,outArgs
199 thyraModel->evalModel(inArgs,outArgs);
201 THYRA_MODEL_EVALUATOR_DECORATOR_EVAL_MODEL_END();
209 #endif // THYRA_DEFAULT_FINAL_POINT_CAPTURE_MODEL_EVALUATOR_HPP
void reportFinalPoint(const ModelEvaluatorBase::InArgs< Scalar > &finalPoint, const bool wasSolved)
Pure abstract base interface for evaluating a stateless "model" that can be mapped into a number of d...
DefaultFinalPointCaptureModelEvaluator()
bool finalPointWasSolved() const
Concrete aggregate class for all output arguments computable by a ModelEvaluator subclass object...
std::string description() const
This is a base class that delegetes almost all function to a wrapped model evaluator object...
void initialize(const RCP< ModelEvaluator< Scalar > > &model)
Initialize given a non-const model evaluator.
const ModelEvaluatorBase::InArgs< Scalar > & getFinalPoint() const
static RCP< FancyOStream > getDefaultOStream()
Teuchos::ScalarTraits< Scalar >::magnitudeType ScalarMag
This class wraps any ModelEvaluator object and allows the client to capture the final point that is r...
Concrete aggregate class for all input arguments computable by a ModelEvaluator subclass object...