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"
49#include "Teuchos_StandardParameterEntryValidators.hpp"
55namespace 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_;
129template<
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();
284template<
class Scalar>
298template<
class Scalar>
306 fdCalc->setParameterList(paramList);
Simple utility class used to select finite difference derivatives for OutArgs object.
SelectedDerivatives & supports(ModelEvaluatorBase::EOutArgsDgDp, int j, int l)
SelectedDerivatives & supports(ModelEvaluatorBase::EOutArgsDfDp, int l)
Utility class for computing directional finite differences of a model.
STANDARD_MEMBER_COMPOSITION_MEMBERS(ScalarMag, fd_step_size)
Pick the size of the finite difference step.
RCP< const ParameterList > getParameterList() const
ScalarTraits< Scalar > ST
void setParameterList(RCP< ParameterList > const ¶mList)
ModelEvaluatorBase::OutArgs< Scalar > createOutArgs(const ModelEvaluator< Scalar > &model, const SelectedDerivatives &fdDerivatives)
Create an augmented out args object for holding finite difference objects.
DirectionalFiniteDiffCalculatorTypes::EFDStepSelectType EFDStepSelectType
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.
RCP< const ParameterList > getValidParameters() const
RCP< ParameterList > getNonconstParameterList()
RCP< ParameterList > unsetParameterList()
STANDARD_MEMBER_COMPOSITION_MEMBERS(EFDStepSelectType, fd_step_select_type)
STANDARD_MEMBER_COMPOSITION_MEMBERS(EFDMethodType, fd_method_type)
ST::magnitudeType ScalarMag
RCP< DirectionalFiniteDiffCalculator< Scalar > > directionalFiniteDiffCalculator()
Nonmember constructor.
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)
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..
DirectionalFiniteDiffCalculatorTypes::SelectedDerivatives SelectedDerivatives
ScalarTraits< ScalarMag > SMT
STANDARD_MEMBER_COMPOSITION_MEMBERS(ScalarMag, fd_step_size_min)
Pick the minimum step size under which the finite difference product will not be computed.
RCP< DirectionalFiniteDiffCalculator< Scalar > > directionalFiniteDiffCalculator(const RCP< ParameterList > ¶mList)
Nonmember constructor.
DirectionalFiniteDiffCalculatorTypes::EFDMethodType EFDMethodType
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.
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)