42 #ifndef THYRA_DIRECTIONAL_FINITE_DIFF_CALCULATOR_DECL_HPP
43 #define THYRA_DIRECTIONAL_FINITE_DIFF_CALCULATOR_DECL_HPP
45 #include "Thyra_ModelEvaluator.hpp"
46 #include "Teuchos_VerboseObject.hpp"
47 #include "Teuchos_ParameterListAcceptor.hpp"
48 #include "Teuchos_StandardMemberCompositionMacros.hpp"
49 #include "Teuchos_StandardParameterEntryValidators.hpp"
55 namespace DirectionalFiniteDiffCalculatorTypes {
67 ,FD_ORDER_FOUR_CENTRAL
92 { supports_DfDp_.push_back(l);
return *
this; }
95 { supports_DgDp_.push_back(std::pair<int,int>(j,l));
return *
this; }
98 typedef std::list<int> supports_DfDp_t;
99 typedef std::list<std::pair<int,int> > supports_DgDp_t;
100 supports_DfDp_t supports_DfDp_;
101 supports_DgDp_t supports_DgDp_;
129 template<
class Scalar>
182 EFDMethodType fd_method_type = DirectionalFiniteDiffCalculatorTypes::FD_ORDER_FOUR_AUTO,
183 EFDStepSelectType fd_step_select_type = DirectionalFiniteDiffCalculatorTypes::FD_STEP_ABSOLUTE,
259 static const std::string& FDMethod_name();
264 static const std::string& FDMethod_default();
266 static const std::string& FDStepSelectType_name();
269 fdStepSelectTypeValidator();
271 static const std::string& FDStepSelectType_default();
273 static const std::string& FDStepLength_name();
275 static const double& FDStepLength_default();
284 template<
class Scalar>
298 template<
class Scalar>
306 fdCalc->setParameterList(paramList);
314 #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...