Thyra Version of the Day
Loading...
Searching...
No Matches
Thyra_DefaultFiniteDifferenceModelEvaluator_decl.hpp
1// @HEADER
2// *****************************************************************************
3// Thyra: Interfaces and Support for Abstract Numerical Algorithms
4//
5// Copyright 2004 NTESS and the Thyra contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
10#ifndef THYRA_DEFAULT_FINITE_DIFFERENCE_MODEL_EVALUATOR_DECL_HPP
11#define THYRA_DEFAULT_FINITE_DIFFERENCE_MODEL_EVALUATOR_DECL_HPP
12
13#include "Thyra_ModelEvaluatorDelegatorBase.hpp"
14#include "Thyra_DirectionalFiniteDiffCalculator.hpp"
15#include "Teuchos_StandardMemberCompositionMacros.hpp"
16#include "Teuchos_StandardCompositionMacros.hpp"
17
18
19namespace Thyra {
20
21
29template<class Scalar>
31 : virtual public ModelEvaluatorDelegatorBase<Scalar>
32{
33public:
34
37
40 DirectionalFiniteDiffCalculator<Scalar>, direcFiniteDiffCalculator );
41
44
46 void initialize(
47 const RCP<ModelEvaluator<Scalar> > &thyraModel
48 ,const RCP<DirectionalFiniteDiffCalculator<Scalar> > &direcFiniteDiffCalculator
49 );
50
52
55
57 std::string description() const;
58
60
61private:
62
65
67 ModelEvaluatorBase::OutArgs<Scalar> createOutArgsImpl() const;
69 void evalModelImpl(
72 ) const;
73
75
76};
77
78
83template<class Scalar>
89
90
95template<class Scalar>
98 const RCP<ModelEvaluator<Scalar> > &thyraModel,
99 const RCP<DirectionalFiniteDiffCalculator<Scalar> > &direcFiniteDiffCalculator
100 )
101{
103 defaultFiniteDifferenceModelEvaluator<Scalar>();
104 fdModel->initialize(thyraModel, direcFiniteDiffCalculator);
105 return fdModel;
106}
107
108
109} // namespace Thyra
110
111
112#endif // THYRA_DEFAULT_FINITE_DIFFERENCE_MODEL_EVALUATOR_DECL_HPP
This class wraps any ModelEvaluator object and computes certain derivatives using finite differences.
STANDARD_COMPOSITION_MEMBERS(DirectionalFiniteDiffCalculator< Scalar >, direcFiniteDiffCalculator)
Utility object that computes directional finite differences.
RCP< DefaultFiniteDifferenceModelEvaluator< Scalar > > defaultFiniteDifferenceModelEvaluator(const RCP< ModelEvaluator< Scalar > > &thyraModel, const RCP< DirectionalFiniteDiffCalculator< Scalar > > &direcFiniteDiffCalculator)
Nonmember constructor.
void initialize(const RCP< ModelEvaluator< Scalar > > &thyraModel, const RCP< DirectionalFiniteDiffCalculator< Scalar > > &direcFiniteDiffCalculator)
RCP< DefaultFiniteDifferenceModelEvaluator< Scalar > > defaultFiniteDifferenceModelEvaluator()
Nonmember constructor.
Utility class for computing directional finite differences of a model.
Concrete aggregate class for all input arguments computable by a ModelEvaluator subclass object.
Concrete aggregate class for all output arguments computable by a ModelEvaluator subclass object.
This is a base class that delegetes almost all function to a wrapped model evaluator object.
Pure abstract base interface for evaluating a stateless "model" that can be mapped into a number of d...
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)