10 #ifndef THYRA_DIRECTIONAL_FINITE_DIFF_CALCULATOR_DECL_HPP
11 #define THYRA_DIRECTIONAL_FINITE_DIFF_CALCULATOR_DECL_HPP
13 #include "Thyra_ModelEvaluator.hpp"
14 #include "Teuchos_VerboseObject.hpp"
15 #include "Teuchos_ParameterListAcceptor.hpp"
16 #include "Teuchos_StandardMemberCompositionMacros.hpp"
17 #include "Teuchos_StandardParameterEntryValidators.hpp"
23 namespace DirectionalFiniteDiffCalculatorTypes {
35 ,FD_ORDER_FOUR_CENTRAL
60 { supports_DfDp_.push_back(l);
return *
this; }
63 { supports_DgDp_.push_back(std::pair<int,int>(j,l));
return *
this; }
66 typedef std::list<int> supports_DfDp_t;
67 typedef std::list<std::pair<int,int> > supports_DgDp_t;
68 supports_DfDp_t supports_DfDp_;
69 supports_DgDp_t supports_DgDp_;
97 template<
class Scalar>
150 EFDMethodType fd_method_type = DirectionalFiniteDiffCalculatorTypes::FD_ORDER_FOUR_AUTO,
151 EFDStepSelectType fd_step_select_type = DirectionalFiniteDiffCalculatorTypes::FD_STEP_ABSOLUTE,
227 static const std::string& FDMethod_name();
232 static const std::string& FDMethod_default();
234 static const std::string& FDStepSelectType_name();
237 fdStepSelectTypeValidator();
239 static const std::string& FDStepSelectType_default();
241 static const std::string& FDStepLength_name();
243 static const double& FDStepLength_default();
252 template<
class Scalar>
266 template<
class Scalar>
274 fdCalc->setParameterList(paramList);
282 #endif // THYRA_DIRECTIONAL_FINITE_DIFF_CALCULATOR_DECL_HPP
ModelEvaluatorBase::OutArgs< Scalar > createOutArgs(const ModelEvaluator< Scalar > &model, const SelectedDerivatives &fdDerivatives)
Create an augmented out args object for holding finite difference objects.
Pure abstract base interface for evaluating a stateless "model" that can be mapped into a number of d...
Simple utility class used to select finite difference derivatives for OutArgs object.
void setParameterList(RCP< ParameterList > const ¶mList)
DirectionalFiniteDiffCalculatorTypes::EFDStepSelectType EFDStepSelectType
ScalarTraits< Scalar > ST
Concrete aggregate class for all output arguments computable by a ModelEvaluator subclass object...
DirectionalFiniteDiffCalculatorTypes::EFDMethodType EFDMethodType
void calcVariations(const ModelEvaluator< Scalar > &model, const ModelEvaluatorBase::InArgs< Scalar > &basePoint, const ModelEvaluatorBase::InArgs< Scalar > &directions, const ModelEvaluatorBase::OutArgs< Scalar > &baseFunctionValues, const ModelEvaluatorBase::OutArgs< Scalar > &variations) const
Compute variations using directional finite differences..
RCP< const ParameterList > getValidParameters() const
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
RCP< DirectionalFiniteDiffCalculator< Scalar > > directionalFiniteDiffCalculator()
Nonmember constructor.
SelectedDerivatives & supports(ModelEvaluatorBase::EOutArgsDgDp, int j, int l)
void calcDerivatives(const ModelEvaluator< Scalar > &model, const ModelEvaluatorBase::InArgs< Scalar > &basePoint, const ModelEvaluatorBase::OutArgs< Scalar > &baseFunctionValues, const ModelEvaluatorBase::OutArgs< Scalar > &derivatives) const
Compute entire derivative objects using finite differences.
DirectionalFiniteDiffCalculatorTypes::SelectedDerivatives SelectedDerivatives
DirectionalFiniteDiffCalculator(EFDMethodType fd_method_type=DirectionalFiniteDiffCalculatorTypes::FD_ORDER_FOUR_AUTO, EFDStepSelectType fd_step_select_type=DirectionalFiniteDiffCalculatorTypes::FD_STEP_ABSOLUTE, ScalarMag fd_step_size=-1.0, ScalarMag fd_step_size_min=-1.0)
ScalarTraits< ScalarMag > SMT
RCP< const ParameterList > getParameterList() const
ST::magnitudeType ScalarMag
RCP< ParameterList > unsetParameterList()
RCP< ParameterList > getNonconstParameterList()
SelectedDerivatives & supports(ModelEvaluatorBase::EOutArgsDfDp, int l)
RCP< DirectionalFiniteDiffCalculator< Scalar > > directionalFiniteDiffCalculator(const RCP< ParameterList > ¶mList)
Nonmember constructor.
STANDARD_MEMBER_COMPOSITION_MEMBERS(EFDMethodType, fd_method_type)
Utility class for computing directional finite differences of a model.
Concrete aggregate class for all input arguments computable by a ModelEvaluator subclass object...