Thyra Package Browser (Single Doxygen Collection) Version of the Day
Private Member Functions | Private Attributes | Static Private Attributes | Related Functions
Thyra::DefaultLumpedParameterModelEvaluator< Scalar > Class Template Reference

Decorator class that wraps any ModelEvaluator object and lumps parameters together using a linear basis matrix. More...

#include <Thyra_DefaultLumpedParameterModelEvaluator.hpp>

Inheritance diagram for Thyra::DefaultLumpedParameterModelEvaluator< Scalar >:
Inheritance graph
[legend]

List of all members.

Private Member Functions

void finishInitialization () const
void generateParameterBasisMatrix () const
void updateNominalValuesAndBounds () const
RCP< VectorBase< Scalar > > map_from_p_to_p_orig (const VectorBase< Scalar > &p) const
void setupWrappedParamDerivOutArgs (const ModelEvaluatorBase::OutArgs< Scalar > &outArgs, ModelEvaluatorBase::OutArgs< Scalar > *wrappedOutArgs) const
ModelEvaluatorBase::Derivative
< Scalar > 
create_deriv_wrt_p_orig (const ModelEvaluatorBase::Derivative< Scalar > &DhDp, const ModelEvaluatorBase::EDerivativeMultiVectorOrientation requiredOrientation) const
void assembleParamDerivOutArgs (const ModelEvaluatorBase::OutArgs< Scalar > &wrappedOutArgs, const ModelEvaluatorBase::OutArgs< Scalar > &outArgs) const
void assembleParamDeriv (const ModelEvaluatorBase::Derivative< Scalar > &DhDp_orig, const ModelEvaluatorBase::Derivative< Scalar > &DhDp) const

Private Attributes

bool isInitialized_
bool nominalValuesAndBoundsUpdated_
RCP< const Teuchos::ParameterList > validParamList_
RCP< Teuchos::ParameterList > paramList_
int p_idx_
bool autogenerateBasisMatrix_
int numberOfBasisColumns_
bool nominalValueIsParameterBase_
bool ignoreParameterBounds_
Teuchos::EVerbosityLevel localVerbLevel_
bool dumpBasisMatrix_
RCP< const MultiVectorBase
< Scalar > > 
B_
RCP< const VectorBase< Scalar > > p_orig_base_
ModelEvaluatorBase::InArgs
< Scalar > 
nominalValues_
ModelEvaluatorBase::InArgs
< Scalar > 
lowerBounds_
ModelEvaluatorBase::InArgs
< Scalar > 
upperBounds_

Static Private Attributes

static const std::string ParameterSubvectorIndex_name_ = "Parameter Subvector Index"
static const int ParameterSubvectorIndex_default_ = 0
static const std::string AutogenerateBasisMatrix_name_ = "Auto-generate Basis Matrix"
static const bool AutogenerateBasisMatrix_default_ = true
static const std::string NumberOfBasisColumns_name_ = "Number of Basis Columns"
static const int NumberOfBasisColumns_default_ = 1
static const std::string NominalValueIsParameterBase_name_ = "Nominal Value is Parameter Base"
static const bool NominalValueIsParameterBase_default_ = true
static const std::string ParameterBaseVector_name_ = "Parameter Base Vector"
static const std::string IgnoreParameterBounds_name_ = "Ignore Parameter Bounds"
static const bool IgnoreParameterBounds_default_ = false
static const std::string DumpBasisMatrix_name_ = "Dump Basis Matrix"
static const bool DumpBasisMatrix_default_ = false

Related Functions

(Note that these are not member functions.)

template<class Scalar >
RCP
< DefaultLumpedParameterModelEvaluator
< Scalar > > 
defaultLumpedParameterModelEvaluator (const RCP< ModelEvaluator< Scalar > > &thyraModel)
 Non-member constructor.

Constructors/initializers/accessors/utilities.

 DefaultLumpedParameterModelEvaluator ()
 
void initialize (const RCP< ModelEvaluator< Scalar > > &thyraModel)
 
void uninitialize (RCP< ModelEvaluator< Scalar > > *thyraModel)
 

Public functions overridden from Teuchos::Describable.

std::string description () const
 

Overridden from ParameterListAcceptor

void setParameterList (RCP< Teuchos::ParameterList > const &paramList)
 
RCP< Teuchos::ParameterList > getNonconstParameterList ()
 
RCP< Teuchos::ParameterList > unsetParameterList ()
 
RCP< const Teuchos::ParameterList > getParameterList () const
 
RCP< const Teuchos::ParameterList > getValidParameters () const
 

Public functions overridden from ModelEvaulator.

RCP< const VectorSpaceBase
< Scalar > > 
get_p_space (int l) const
 
RCP< const Array< std::string > > get_p_names (int l) const
 
ModelEvaluatorBase::InArgs
< Scalar > 
getNominalValues () const
 
ModelEvaluatorBase::InArgs
< Scalar > 
getLowerBounds () const
 
ModelEvaluatorBase::InArgs
< Scalar > 
getUpperBounds () const
 
void reportFinalPoint (const ModelEvaluatorBase::InArgs< Scalar > &finalPoint, const bool wasSolved)
 

Private functions overridden from ModelEvaulatorDefaultBase.

ModelEvaluatorBase::OutArgs
< Scalar > 
createOutArgsImpl () const
 
void evalModelImpl (const ModelEvaluatorBase::InArgs< Scalar > &inArgs, const ModelEvaluatorBase::OutArgs< Scalar > &outArgs) const
 

Detailed Description

template<class Scalar>
class Thyra::DefaultLumpedParameterModelEvaluator< Scalar >

Decorator class that wraps any ModelEvaluator object and lumps parameters together using a linear basis matrix.

Introduction

The purpose of this Decorator class is to provide a linear basis reduction, or "lumping", for a set of parameters. Let p_orig be one of the parameter subvectors of the underlying model *getUnderlyingModel(). This class provides an affine model for the reduced parameters:


   p_orig = B * p + p_orig_base

 

where B is some MultiVectorBase object with linearly independent columns where B.range()->isCompatible(*p_orig.space())==true and B.domain()->dim() <= B.range()->dim(). The basis matrix B can be set by the client or can be generated automatically in this object for any number of columns. The vector p_orig_base is generally selected to be the nominal values of the original parameters p_orig in which case p == 0 gives the original nominal values and p != 0 gives a perturbation from the nominal values. This is the default option but a different base vector can be set. Note that storing B as a column-wise multi-vector allows the space *p_orig.space() to be any arbitrary vector space, including a parallel distributed vector space in an SPMD program. It is this flexibility that truly makes this decorator class an ANA class.

The reduced parameter subvector p is what is exposed to an ANA client dnd the original parameter subvector p_orig is what is passed to the original underlying model. Note that given p, p_orig is uniquely determined but opposite is not true in general (see Section Mapping between fully and reduced parameters).

Derivatives

The reduced basis B of course affects the definition of all of the derivatives with respect to the given parameter subvector. The relationship between the derivative of any function h with respect to p_orig and p is:


   d(h)/d(p) = d(h)/d(p_orig) * B

 

When d(h)/d(p) is only needed as a linear operator, both d(h)/d(p_orig) and B would just need to be supplied as general linear operators and then the multiplied linear operator d(h)/d(p_orig)*B could be represented implicitly using a Thyra::DefaultMultipliedLinearOp subclass object.

When d(h)/d(p) is only needed as a column-wise multi-vector, then d(h)/d(p_orig) is only needed as a general linear operator and B must be a column-wise multi-vector.

Lastly, when the row-wise transpose multi-vector form of d(h)/d(p)^T is requested, it can be computed as:


   d(h)/d(p)^T = B^T * d(h)/d(p_orig)^T

 

which requires that d(h)/d(p_orig)^T be supplied in row-wise transpose multi-vector form but B could actually just be a general linear operator. This would allow for huge spaces for p_orig and p which may be of some use for adjoint-based sensitivity methods.

Since the current implementation in this class requires B be a multi-vector, both forms d(h)/d(p) and d(h)/d(p)^T can be supported. In the future, it would be possible to support the implementation of B as a general linear operator which would mean that very large full and reduced parameter spaces could be supported. However, focusing on small reduced parameter spaces is the very motivation for this decorator subclass and therefore requiring that B be represented as a multi-vector is not a serious limitation.

Mapping between fully and reduced parameters

In cases where p_orig is given and p must be determined, in general there is no solution for p that will satisfy p_orig=B*p+p_orig_base.

To support the (overdetermined) mapping from p_orig to p, we choose p to solve the classic linear least squares problem:


   min   0.5 * (B*p + p_orig_base - p_orig)^T * (B*p + p_orig_base - p_orig)

 

This well known linear least squares problem has the solution:


   p = inv(B^T * B) * (B^T * (-p_orig_base+p_oirg))

 

This approach has the unfortunate side effect that we can not completely represent an arbitrary vector p_orig with a reduced p but this is the nature of this approximation for both good and bad.

The one case in which a unique reduced p can be determined is when p_orig was computed from the afffine relationship given p and therefore we expect a zero residual meaning that (p_orig_base-p_oirg) lies in the null-space of B. This is handy when one wants to write out p in the form of p_orig and then reconstruct p again.

Parameter bounds

As mentioned above, one can simply select p_orig_base to be the nominal values of the original full parameters p_orig and therefore allow p==0 to give the exact nominal parameter values which is critical for the initial guess for many ANAs. The problem of handling the bounds on the parameters is more difficult. This approximation really requires that the simple bounds on p_orig be replaced with the general linear inequality constraints:


   p_orig_l - p_orig_base <= B*p <= p_orig_u - p_orig_base

 

Modeling and enforcing these linear inequality constraints correctly would require that B and p_orig_base be exposed to the client so that the client can build these extra linear inequality constraints into the ANA algorithm. Certain optimization algorithms could then enforce these general inequalities and therefore guarantee that the original parameter bounds are never violated. This is easy to do in both active-set and interior-point methods when the size of the space p_orig.space()->dim() is not too large. When p_orig.space()->dim() is large, handling these inequality constraints can be very difficult to deal with.

An alternative simpler approach would be to try to find lower and upper bounds p_l and p_u that tried to match the original bounds as close as possible while not restricting the feasible region p_l <= p <= p_u too much. For example, one could solve the inequality-constrained least squares problems:


   min     0.5 * (B*p+p_orig_base-p_orig_l)^T * (B*p+p_orig_base-p_orig_l)
   s.t.    B*p+p_orig_base >= p_orig_l

 

and


   min     0.5 * (B*p+p_orig_base-p_orig_u)^T * (B*p+p_orig_base-p_orig_u)
   s.t.    B*p+p_orig_base <= p_orig_u

 

but in general it would not be possible to guarantee that the solution p_l and p_u satisfies p_l <= p <= p_u.

Because of the challenges of dealing with bounds on the parameters, this subclass currently throws an exception if it is given an underlying model with finite bounds on the parameters. However, a parameter-list option can be set that will cause the bounds to be ignored and it would be the client's responsibility to deal with the implications of this choice.

Definition at line 227 of file Thyra_DefaultLumpedParameterModelEvaluator.hpp.


Constructor & Destructor Documentation


Member Function Documentation

template<class Scalar >
void Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::initialize ( const RCP< ModelEvaluator< Scalar > > &  thyraModel)
template<class Scalar >
void Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::uninitialize ( RCP< ModelEvaluator< Scalar > > *  thyraModel)
template<class Scalar >
std::string Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::description ( ) const
template<class Scalar >
void Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::setParameterList ( RCP< Teuchos::ParameterList > const &  paramList)
template<class Scalar >
RCP< Teuchos::ParameterList > Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::getNonconstParameterList ( )
template<class Scalar >
RCP< Teuchos::ParameterList > Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::unsetParameterList ( )
template<class Scalar >
RCP< const Teuchos::ParameterList > Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::getParameterList ( ) const
template<class Scalar >
RCP< const Teuchos::ParameterList > Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::getValidParameters ( ) const
template<class Scalar >
RCP< const VectorSpaceBase< Scalar > > Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::get_p_space ( int  l) const [virtual]
template<class Scalar >
RCP< const Array< std::string > > Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::get_p_names ( int  l) const [virtual]
template<class Scalar >
ModelEvaluatorBase::InArgs< Scalar > Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::getNominalValues ( ) const [virtual]
template<class Scalar >
ModelEvaluatorBase::InArgs< Scalar > Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::getLowerBounds ( ) const [virtual]
template<class Scalar >
ModelEvaluatorBase::InArgs< Scalar > Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::getUpperBounds ( ) const [virtual]
template<class Scalar >
void Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::reportFinalPoint ( const ModelEvaluatorBase::InArgs< Scalar > &  finalPoint,
const bool  wasSolved 
) [virtual]
template<class Scalar >
ModelEvaluatorBase::OutArgs< Scalar > Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::createOutArgsImpl ( ) const [private, virtual]
template<class Scalar >
void Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::evalModelImpl ( const ModelEvaluatorBase::InArgs< Scalar > &  inArgs,
const ModelEvaluatorBase::OutArgs< Scalar > &  outArgs 
) const [private, virtual]
template<class Scalar >
void Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::finishInitialization ( ) const [private]
template<class Scalar >
void Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::generateParameterBasisMatrix ( ) const [private]
template<class Scalar >
void Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::updateNominalValuesAndBounds ( ) const [private]

Definition at line 976 of file Thyra_DefaultLumpedParameterModelEvaluator.hpp.

References Thyra::assign().

template<class Scalar >
RCP< VectorBase< Scalar > > Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::map_from_p_to_p_orig ( const VectorBase< Scalar > &  p) const [private]
template<class Scalar >
void Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::setupWrappedParamDerivOutArgs ( const ModelEvaluatorBase::OutArgs< Scalar > &  outArgs,
ModelEvaluatorBase::OutArgs< Scalar > *  wrappedOutArgs 
) const [private]
template<class Scalar >
ModelEvaluatorBase::Derivative< Scalar > Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::create_deriv_wrt_p_orig ( const ModelEvaluatorBase::Derivative< Scalar > &  DhDp,
const ModelEvaluatorBase::EDerivativeMultiVectorOrientation  requiredOrientation 
) const [private]
template<class Scalar >
void Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::assembleParamDerivOutArgs ( const ModelEvaluatorBase::OutArgs< Scalar > &  wrappedOutArgs,
const ModelEvaluatorBase::OutArgs< Scalar > &  outArgs 
) const [private]
template<class Scalar >
void Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::assembleParamDeriv ( const ModelEvaluatorBase::Derivative< Scalar > &  DhDp_orig,
const ModelEvaluatorBase::Derivative< Scalar > &  DhDp 
) const [private]

Friends And Related Function Documentation

template<class Scalar >
RCP< DefaultLumpedParameterModelEvaluator< Scalar > > defaultLumpedParameterModelEvaluator ( const RCP< ModelEvaluator< Scalar > > &  thyraModel) [related]

Non-member constructor.

Definition at line 420 of file Thyra_DefaultLumpedParameterModelEvaluator.hpp.


Member Data Documentation

template<class Scalar >
bool Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::isInitialized_ [mutable, private]
template<class Scalar >
bool Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::nominalValuesAndBoundsUpdated_ [mutable, private]
template<class Scalar >
RCP<const Teuchos::ParameterList> Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::validParamList_ [mutable, private]
template<class Scalar >
RCP<Teuchos::ParameterList> Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::paramList_ [private]
template<class Scalar >
int Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::p_idx_ [private]
template<class Scalar >
bool Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::autogenerateBasisMatrix_ [private]
template<class Scalar >
int Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::numberOfBasisColumns_ [private]
template<class Scalar >
bool Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::nominalValueIsParameterBase_ [private]
template<class Scalar >
bool Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::ignoreParameterBounds_ [private]
template<class Scalar >
Teuchos::EVerbosityLevel Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::localVerbLevel_ [private]
template<class Scalar >
bool Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::dumpBasisMatrix_ [private]
template<class Scalar >
RCP<const MultiVectorBase<Scalar> > Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::B_ [mutable, private]
template<class Scalar >
RCP<const VectorBase<Scalar> > Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::p_orig_base_ [mutable, private]
template<class Scalar >
ModelEvaluatorBase::InArgs<Scalar> Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::nominalValues_ [mutable, private]
template<class Scalar >
ModelEvaluatorBase::InArgs<Scalar> Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::lowerBounds_ [mutable, private]
template<class Scalar >
ModelEvaluatorBase::InArgs<Scalar> Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::upperBounds_ [mutable, private]
template<class Scalar >
const std::string Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::ParameterSubvectorIndex_name_ = "Parameter Subvector Index" [static, private]
template<class Scalar >
const int Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::ParameterSubvectorIndex_default_ = 0 [static, private]
template<class Scalar >
const std::string Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::AutogenerateBasisMatrix_name_ = "Auto-generate Basis Matrix" [static, private]
template<class Scalar >
const bool Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::AutogenerateBasisMatrix_default_ = true [static, private]
template<class Scalar >
const std::string Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::NumberOfBasisColumns_name_ = "Number of Basis Columns" [static, private]
template<class Scalar >
const int Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::NumberOfBasisColumns_default_ = 1 [static, private]
template<class Scalar >
const std::string Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::NominalValueIsParameterBase_name_ = "Nominal Value is Parameter Base" [static, private]
template<class Scalar >
const bool Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::NominalValueIsParameterBase_default_ = true [static, private]
template<class Scalar >
const std::string Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::ParameterBaseVector_name_ = "Parameter Base Vector" [static, private]
template<class Scalar >
const std::string Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::IgnoreParameterBounds_name_ = "Ignore Parameter Bounds" [static, private]
template<class Scalar >
const bool Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::IgnoreParameterBounds_default_ = false [static, private]
template<class Scalar >
const std::string Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::DumpBasisMatrix_name_ = "Dump Basis Matrix" [static, private]
template<class Scalar >
const bool Thyra::DefaultLumpedParameterModelEvaluator< Scalar >::DumpBasisMatrix_default_ = false [static, private]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines