|
Thyra Package Browser (Single Doxygen Collection) Version of the Day
|
Utility calss for computing directional finite differences of a model. More...
#include <Thyra_DirectionalFiniteDiffCalculator_decl.hpp>

Private Attributes | |
| RCP< ParameterList > | paramList_ |
Static Private Attributes | |
| static const std::string | FDMethod_name = "FD Method" |
| static const RCP < Teuchos::StringToIntegralParameterEntryValidator < EFDMethodType > > | fdMethodValidator |
| static const std::string | FDMethod_default = "order-one" |
| static const std::string | FDStepSelectType_name = "FD Step Select Type" |
| static const RCP < Teuchos::StringToIntegralParameterEntryValidator < EFDStepSelectType > > | fdStepSelectTypeValidator |
| static const std::string | FDStepSelectType_default = "Absolute" |
| static const std::string | FDStepLength_name = "FD Step Length" |
| static const double | FDStepLength_default = -1.0 |
Related Functions | |
(Note that these are not member functions.) | |
| template<class Scalar > | |
| RCP < DirectionalFiniteDiffCalculator < Scalar > > | directionalFiniteDiffCalculator (const RCP< ParameterList > ¶mList) |
| Nonmember constructor. | |
Public Types | |
| typedef ScalarTraits< Scalar > | ST |
| | |
| typedef ST::magnitudeType | ScalarMag |
| | |
| typedef ScalarTraits< ScalarMag > | SMT |
| | |
| typedef DirectionalFiniteDiffCalculatorTypes::EFDMethodType | EFDMethodType |
| | |
| typedef DirectionalFiniteDiffCalculatorTypes::EFDStepSelectType | EFDStepSelectType |
| | |
| typedef DirectionalFiniteDiffCalculatorTypes::SelectedDerivatives | SelectedDerivatives |
| | |
Constructors/setup | |
| STANDARD_MEMBER_COMPOSITION_MEMBERS (EFDMethodType, fd_method_type) | |
| | |
| STANDARD_MEMBER_COMPOSITION_MEMBERS (EFDStepSelectType, fd_step_select_type) | |
| | |
| STANDARD_MEMBER_COMPOSITION_MEMBERS (ScalarMag, fd_step_size) | |
| Pick the size of the finite difference step. | |
| STANDARD_MEMBER_COMPOSITION_MEMBERS (ScalarMag, fd_step_size_min) | |
| Pick the minimum step size under which the finite difference product will not be computed. | |
| 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) | |
| | |
Overridden from ParameterListAcceptor | |
| void | setParameterList (RCP< ParameterList > const ¶mList) |
| | |
| RCP< ParameterList > | getNonconstParameterList () |
| | |
| RCP< ParameterList > | unsetParameterList () |
| | |
| RCP< const ParameterList > | getParameterList () const |
| | |
| RCP< const ParameterList > | getValidParameters () const |
| | |
Finite difference functions. | |
| ModelEvaluatorBase::OutArgs < Scalar > | createOutArgs (const ModelEvaluator< Scalar > &model, const SelectedDerivatives &fdDerivatives) |
| Create an augmented out args object for holding finite difference objects. | |
| 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.. | |
| 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. | |
Utility calss for computing directional finite differences of a model.
This class computes finite difference approximations to the variations:
df = DfDx*delta_x + sum(DfDp(l)*delta_p(l),l=0...Np) dg(j) = sum(DgDx(j)*delta_x,j=0...Ng) + sum(DfDp(j,l)*delta_p(l),j=0...Ng,l=0...Np) The client can leave any of the delta_x or delta_p(l) directions as NULL and they will be assumed to be zero.
Warning!</b The client should only set parameters using either the parameter list function setParameterList() or the more typesafe functions but not a mixture of the two. The behavior of setting options in two different ways is undefined and is likely to change.
ToDo: Finish documentaton!
Definition at line 117 of file Thyra_DirectionalFiniteDiffCalculator_decl.hpp.
| typedef ScalarTraits<Scalar> Thyra::DirectionalFiniteDiffCalculator< Scalar >::ST |
Definition at line 127 of file Thyra_DirectionalFiniteDiffCalculator_decl.hpp.
| typedef ST::magnitudeType Thyra::DirectionalFiniteDiffCalculator< Scalar >::ScalarMag |
Definition at line 129 of file Thyra_DirectionalFiniteDiffCalculator_decl.hpp.
| typedef ScalarTraits<ScalarMag> Thyra::DirectionalFiniteDiffCalculator< Scalar >::SMT |
Definition at line 131 of file Thyra_DirectionalFiniteDiffCalculator_decl.hpp.
| typedef DirectionalFiniteDiffCalculatorTypes::EFDMethodType Thyra::DirectionalFiniteDiffCalculator< Scalar >::EFDMethodType |
Definition at line 133 of file Thyra_DirectionalFiniteDiffCalculator_decl.hpp.
| typedef DirectionalFiniteDiffCalculatorTypes::EFDStepSelectType Thyra::DirectionalFiniteDiffCalculator< Scalar >::EFDStepSelectType |
Definition at line 135 of file Thyra_DirectionalFiniteDiffCalculator_decl.hpp.
| typedef DirectionalFiniteDiffCalculatorTypes::SelectedDerivatives Thyra::DirectionalFiniteDiffCalculator< Scalar >::SelectedDerivatives |
Definition at line 137 of file Thyra_DirectionalFiniteDiffCalculator_decl.hpp.
| Thyra::DirectionalFiniteDiffCalculator< Scalar >::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 |
||
| ) |
Definition at line 245 of file Thyra_DirectionalFiniteDiffCalculator_def.hpp.
| Thyra::DirectionalFiniteDiffCalculator< Scalar >::STANDARD_MEMBER_COMPOSITION_MEMBERS | ( | EFDMethodType | , |
| fd_method_type | |||
| ) |
| Thyra::DirectionalFiniteDiffCalculator< Scalar >::STANDARD_MEMBER_COMPOSITION_MEMBERS | ( | EFDStepSelectType | , |
| fd_step_select_type | |||
| ) |
| Thyra::DirectionalFiniteDiffCalculator< Scalar >::STANDARD_MEMBER_COMPOSITION_MEMBERS | ( | ScalarMag | , |
| fd_step_size | |||
| ) |
Pick the size of the finite difference step.
If fd_step_size < 0 then the implementation will try to select it based on the order of method fd_method_type() that is selected.
| Thyra::DirectionalFiniteDiffCalculator< Scalar >::STANDARD_MEMBER_COMPOSITION_MEMBERS | ( | ScalarMag | , |
| fd_step_size_min | |||
| ) |
Pick the minimum step size under which the finite difference product will not be computed.
If fd_step_size_min == 0 then the finite difference computation will always be performed. If fd_step_size_min < 0 then the minimum step size will be determined internally.
| void Thyra::DirectionalFiniteDiffCalculator< Scalar >::setParameterList | ( | RCP< ParameterList > const & | paramList | ) |
Definition at line 262 of file Thyra_DirectionalFiniteDiffCalculator_def.hpp.
| RCP< ParameterList > Thyra::DirectionalFiniteDiffCalculator< Scalar >::getNonconstParameterList | ( | ) |
Definition at line 281 of file Thyra_DirectionalFiniteDiffCalculator_def.hpp.
| RCP< ParameterList > Thyra::DirectionalFiniteDiffCalculator< Scalar >::unsetParameterList | ( | ) |
Definition at line 289 of file Thyra_DirectionalFiniteDiffCalculator_def.hpp.
| RCP< const ParameterList > Thyra::DirectionalFiniteDiffCalculator< Scalar >::getParameterList | ( | ) | const |
Definition at line 299 of file Thyra_DirectionalFiniteDiffCalculator_def.hpp.
| RCP< const ParameterList > Thyra::DirectionalFiniteDiffCalculator< Scalar >::getValidParameters | ( | ) | const |
Definition at line 307 of file Thyra_DirectionalFiniteDiffCalculator_def.hpp.
| ModelEvaluatorBase::OutArgs< Scalar > Thyra::DirectionalFiniteDiffCalculator< Scalar >::createOutArgs | ( | const ModelEvaluator< Scalar > & | model, |
| const SelectedDerivatives & | fdDerivatives | ||
| ) |
Create an augmented out args object for holding finite difference objects.
Warning! The returned object must only be used with the below functions calcVariations() and calcDerivatives() and not with the original model object directly.
Definition at line 337 of file Thyra_DirectionalFiniteDiffCalculator_def.hpp.
References Thyra::DirectionalFiniteDiffCalculatorTypes::OutArgsCreator< Scalar >::createOutArgs().
| void Thyra::DirectionalFiniteDiffCalculator< Scalar >::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..
The computation may fail if a NaN or Inf is encountered during any of the computations in which case a NaNInfException exception will be thrown. Otherwise the computation should be completed successfully.
If the finite difference could not be computed because of cramped bounds then a CrampedBoundsException object will be thrown.
ToDo: Discuss options!
Definition at line 348 of file Thyra_DirectionalFiniteDiffCalculator_def.hpp.
References Thyra::assign(), Thyra::ModelEvaluator< Scalar >::createInArgs(), Thyra::ModelEvaluator< Scalar >::createOutArgs(), Thyra::ModelEvaluator< Scalar >::evalModel(), Thyra::DirectionalFiniteDiffCalculatorTypes::FD_ORDER_FOUR, Thyra::DirectionalFiniteDiffCalculatorTypes::FD_ORDER_FOUR_AUTO, Thyra::DirectionalFiniteDiffCalculatorTypes::FD_ORDER_FOUR_CENTRAL, Thyra::DirectionalFiniteDiffCalculatorTypes::FD_ORDER_ONE, Thyra::DirectionalFiniteDiffCalculatorTypes::FD_ORDER_TWO, Thyra::DirectionalFiniteDiffCalculatorTypes::FD_ORDER_TWO_AUTO, Thyra::DirectionalFiniteDiffCalculatorTypes::FD_ORDER_TWO_CENTRAL, Thyra::DirectionalFiniteDiffCalculatorTypes::FD_STEP_ABSOLUTE, Thyra::DirectionalFiniteDiffCalculatorTypes::FD_STEP_RELATIVE, Thyra::ModelEvaluatorBase::OutArgs< Scalar >::get_f(), Thyra::ModelEvaluator< Scalar >::get_f_space(), Thyra::ModelEvaluatorBase::OutArgs< Scalar >::get_g(), Thyra::ModelEvaluator< Scalar >::get_g_space(), Thyra::ModelEvaluatorBase::InArgs< Scalar >::get_p(), Thyra::ModelEvaluator< Scalar >::get_p_space(), Thyra::ModelEvaluatorBase::InArgs< Scalar >::get_x(), Thyra::ModelEvaluatorBase::InArgs< Scalar >::get_x_dot(), Thyra::ModelEvaluator< Scalar >::get_x_space(), Thyra::ModelEvaluatorBase::OutArgs< Scalar >::isEmpty(), Thyra::ModelEvaluatorBase::OutArgs< Scalar >::Ng(), Thyra::ModelEvaluatorBase::OutArgs< Scalar >::Np(), Thyra::ModelEvaluatorBase::OutArgs< Scalar >::supports(), Thyra::ModelEvaluatorBase::InArgs< Scalar >::supports(), Thyra::V_StVpV(), and Thyra::Vt_S().
| void Thyra::DirectionalFiniteDiffCalculator< Scalar >::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.
Definition at line 836 of file Thyra_DirectionalFiniteDiffCalculator_def.hpp.
References Thyra::assign(), Thyra::ModelEvaluator< Scalar >::createInArgs(), Thyra::ModelEvaluator< Scalar >::createOutArgs(), Thyra::ModelEvaluatorBase::OutArgs< Scalar >::get_DfDp(), Thyra::ModelEvaluatorBase::OutArgs< Scalar >::get_DgDp(), Thyra::ModelEvaluator< Scalar >::get_g_space(), Thyra::ModelEvaluator< Scalar >::get_p_space(), Thyra::ModelEvaluatorBase::OutArgs< Scalar >::Ng(), Thyra::ModelEvaluatorBase::InArgs< Scalar >::Np(), Thyra::set_ele(), and Thyra::ModelEvaluatorBase::OutArgs< Scalar >::supports().
| RCP< DirectionalFiniteDiffCalculator< Scalar > > directionalFiniteDiffCalculator | ( | const RCP< ParameterList > & | paramList | ) | [related] |
Nonmember constructor.
Definition at line 268 of file Thyra_DirectionalFiniteDiffCalculator_decl.hpp.
RCP<ParameterList> Thyra::DirectionalFiniteDiffCalculator< Scalar >::paramList_ [private] |
Definition at line 241 of file Thyra_DirectionalFiniteDiffCalculator_decl.hpp.
const std::string Thyra::DirectionalFiniteDiffCalculator< Scalar >::FDMethod_name = "FD Method" [static, private] |
Definition at line 246 of file Thyra_DirectionalFiniteDiffCalculator_decl.hpp.
const RCP<Teuchos::StringToIntegralParameterEntryValidator<EFDMethodType> > Thyra::DirectionalFiniteDiffCalculator< Scalar >::fdMethodValidator [static, private] |
Definition at line 248 of file Thyra_DirectionalFiniteDiffCalculator_decl.hpp.
const std::string Thyra::DirectionalFiniteDiffCalculator< Scalar >::FDMethod_default = "order-one" [static, private] |
Definition at line 249 of file Thyra_DirectionalFiniteDiffCalculator_decl.hpp.
const std::string Thyra::DirectionalFiniteDiffCalculator< Scalar >::FDStepSelectType_name = "FD Step Select Type" [static, private] |
Definition at line 251 of file Thyra_DirectionalFiniteDiffCalculator_decl.hpp.
const RCP< Teuchos::StringToIntegralParameterEntryValidator< Thyra::DirectionalFiniteDiffCalculatorTypes::EFDStepSelectType > > Thyra::DirectionalFiniteDiffCalculator< Scalar >::fdStepSelectTypeValidator [static, private] |
Teuchos::rcp( new Teuchos::StringToIntegralParameterEntryValidator<Thyra::DirectionalFiniteDiffCalculatorTypes::EFDStepSelectType>( Teuchos::tuple<std::string>( "Absolute" ,"Relative" ) ,Teuchos::tuple<std::string>( "Use absolute step size \""+FDStepLength_name+"\"" ,"Use relative step size \""+FDStepLength_name+"\"*||xo||inf" ) ,Teuchos::tuple<Thyra::DirectionalFiniteDiffCalculatorTypes::EFDStepSelectType>( Thyra::DirectionalFiniteDiffCalculatorTypes::FD_STEP_ABSOLUTE ,Thyra::DirectionalFiniteDiffCalculatorTypes::FD_STEP_RELATIVE ) ,"" ) )
Definition at line 253 of file Thyra_DirectionalFiniteDiffCalculator_decl.hpp.
const std::string Thyra::DirectionalFiniteDiffCalculator< Scalar >::FDStepSelectType_default = "Absolute" [static, private] |
Definition at line 254 of file Thyra_DirectionalFiniteDiffCalculator_decl.hpp.
const std::string Thyra::DirectionalFiniteDiffCalculator< Scalar >::FDStepLength_name = "FD Step Length" [static, private] |
Definition at line 256 of file Thyra_DirectionalFiniteDiffCalculator_decl.hpp.
const double Thyra::DirectionalFiniteDiffCalculator< Scalar >::FDStepLength_default = -1.0 [static, private] |
Definition at line 257 of file Thyra_DirectionalFiniteDiffCalculator_decl.hpp.
1.7.4