Thyra
Version of the Day
|
Composite subclass that takes a single ModelEvaluator
object and represents it as a single aggregate multi-period ModelEvalator
object.
More...
#include <Thyra_DefaultMultiPeriodModelEvaluator.hpp>
Constructors/Intializers/Accessors | |
DefaultMultiPeriodModelEvaluator () | |
DefaultMultiPeriodModelEvaluator (const int N, const Array< RCP< ModelEvaluator< Scalar > > > &periodModels, const Array< int > &z_indexes, const Array< Array< RCP< const VectorBase< Scalar > > > > &z, const int g_index, const Array< Scalar > g_weights, const RCP< const ProductVectorSpaceBase< Scalar > > &x_bar_space=Teuchos::null, const RCP< const ProductVectorSpaceBase< Scalar > > &f_bar_space=Teuchos::null, const RCP< LinearOpWithSolveFactoryBase< Scalar > > &W_bar_factory=Teuchos::null) | |
Calls intialize(...) . More... | |
void | initialize (const int N, const Array< RCP< ModelEvaluator< Scalar > > > &periodModels, const Array< int > &z_indexes, const Array< Array< RCP< const VectorBase< Scalar > > > > &z, const int g_index, const Array< Scalar > g_weights, const RCP< const ProductVectorSpaceBase< Scalar > > &x_bar_space=Teuchos::null, const RCP< const ProductVectorSpaceBase< Scalar > > &f_bar_space=Teuchos::null, const RCP< LinearOpWithSolveFactoryBase< Scalar > > &W_bar_factory=Teuchos::null) |
Initialize. More... | |
void | reset_z (const Array< Array< RCP< const VectorBase< Scalar > > > > &z) |
Reset z. More... | |
Public functions overridden from ModelEvaulator. | |
int | Np () const |
int | Ng () const |
RCP< const VectorSpaceBase < Scalar > > | get_x_space () const |
RCP< const VectorSpaceBase < Scalar > > | get_f_space () const |
RCP< const VectorSpaceBase < Scalar > > | get_p_space (int l) const |
RCP< const Array< std::string > > | get_p_names (int l) const |
RCP< const VectorSpaceBase < Scalar > > | get_g_space (int j) const |
ArrayView< const std::string > | get_g_names (int j) const |
ModelEvaluatorBase::InArgs < Scalar > | getNominalValues () const |
ModelEvaluatorBase::InArgs < Scalar > | getLowerBounds () const |
ModelEvaluatorBase::InArgs < Scalar > | getUpperBounds () const |
RCP< LinearOpBase< Scalar > > | create_W_op () const |
RCP< PreconditionerBase< Scalar > > | create_W_prec () const |
RCP< const LinearOpWithSolveFactoryBase < Scalar > > | get_W_factory () const |
ModelEvaluatorBase::InArgs < Scalar > | createInArgs () const |
void | reportFinalPoint (const ModelEvaluatorBase::InArgs< Scalar > &finalPoint, const bool wasSolved) |
Ignores the final point. More... | |
Composite subclass that takes a single ModelEvaluator
object and represents it as a single aggregate multi-period ModelEvalator
object.
Mathematically, this subclass is used to form a multi-period (or multi-point) problem of the form:
(x_bar,{p_l}\p_period) -> f_bar (x_bar,{p_l}\p_period) -> g_bar
where
x_bar = [ x[0]; x[1]; ...; x[N-1]] {p_l}\p_period = { p_(0), p_(1), ..., p_(z_index-1), p_(z_index+1), ..., p_(Np-1) } f_bar(...) = [ f(x[0],{p_l},z[0]); f(x[1],{p_l},z[1]); ..., f(x[N-1],{p_l},z[N-1]) ] g_bar(...) = sum( g_weights[i]*g[g_index](x[0],{p_l},z[i]), i = 0,...,N-1 )
Above, the notation {p_l}
is meant to represent the set of all parameter subvectors in each of the constituent models minus the parameter subvector used to define period data.
This gives the first derivative objects:
[ W[0], 0, ... 0 ] [ 0, W[i], ... 0 ] W_bar = DfDx_bar = [ ., ., ... . ] [ 0, 0, ... W[N-1] ] [ DfDp[0][l] ] [ DfDp[1][l] ] DfDp_bar[l] = [ ... ] [ DfDp[N=1][l] ] [ g_wieght[0] * DgDx_dot[0] ] [ g_wieght[1] * DgDx_dot[1] ] DgDx_dot_bar = [ ... ] [ g_wieght[N-1] * DgDx_dot[N-1] ] [ g_wieght[0] * DgDx[0] ] [ g_wieght[1] * DgDx[1] ] DgDx_bar = [ ... ] [ g_wieght[N-1] * DgDx[N-1] ] DgDp_bar = sum( g_weights[i]*DgDp[i][g_index], i = 0,...,N-1 )
This class could be made much more general but for now ???
Definition at line 99 of file Thyra_DefaultMultiPeriodModelEvaluator.hpp.
Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::DefaultMultiPeriodModelEvaluator | ( | ) |
Definition at line 336 of file Thyra_DefaultMultiPeriodModelEvaluator.hpp.
Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::DefaultMultiPeriodModelEvaluator | ( | const int | N, |
const Array< RCP< ModelEvaluator< Scalar > > > & | periodModels, | ||
const Array< int > & | z_indexes, | ||
const Array< Array< RCP< const VectorBase< Scalar > > > > & | z, | ||
const int | g_index, | ||
const Array< Scalar > | g_weights, | ||
const RCP< const ProductVectorSpaceBase< Scalar > > & | x_bar_space = Teuchos::null , |
||
const RCP< const ProductVectorSpaceBase< Scalar > > & | f_bar_space = Teuchos::null , |
||
const RCP< LinearOpWithSolveFactoryBase< Scalar > > & | W_bar_factory = Teuchos::null |
||
) |
Calls intialize(...)
.
Definition at line 342 of file Thyra_DefaultMultiPeriodModelEvaluator.hpp.
void Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::initialize | ( | const int | N, |
const Array< RCP< ModelEvaluator< Scalar > > > & | periodModels, | ||
const Array< int > & | z_indexes, | ||
const Array< Array< RCP< const VectorBase< Scalar > > > > & | z, | ||
const int | g_index, | ||
const Array< Scalar > | g_weights, | ||
const RCP< const ProductVectorSpaceBase< Scalar > > & | x_bar_space = Teuchos::null , |
||
const RCP< const ProductVectorSpaceBase< Scalar > > & | f_bar_space = Teuchos::null , |
||
const RCP< LinearOpWithSolveFactoryBase< Scalar > > & | W_bar_factory = Teuchos::null |
||
) |
Initialize.
N | [in] The number of periods. |
periodModels | [in] Array (length N ) of the period models. For now, each of the period models at periodModels[i] must have an identical structure for every input and output. The reason that different models are passed in is so that different behaviors of the output functions and different nominal values for each period's x and bounds can be specified. The nominal values from periodModels[0] will be used to set the nominal values for the non-peroid parameters. |
z_indexes | [in] Array of sorted zero-based indexes of the model's parameter subvector that represents z[i] . Note, this array must be sorted from smallest to largets and can not have any duplicate entires! |
z | [in] Array (length N ) of the period defining auxiliary paramter subvectors. Each entry z[i] is an array of subvectors where z[i][k] is the subvector p(z_indexes[k]) in the underlying perild model. Therefore, the array z[i] must be ordered according to z_indexes . Note that z[i][k] is allowed to be null in which case the underlying default value for this parameter will be used. |
g_index | [in] The index of the response function that will be used for the period objective function. |
g_weights | [in] Array (length N ) of the g_weights for the auxiliary response functions in the summation for g_bar(...) shown above. |
x_bar_space | [in] The product vector space that represents the space for x_bar as defined above. If x_bar_space.get()==NULL then a default version of this product space will be created internally. |
f_bar_space | [in] The product vector space that represents the space for f_bar as defined above. If f_bar_space.get()==NULL then a default version of this product space will be created internally. |
W_bar_factory | [in] Factory object that is used to create the block LOWS object that will be used to represent the block diagonal object W_bar . If is_null(W_bar_factory)==true on input then a DefaultBlockedTriangularLinearOpWithSolveFactory object will be created and used internally. |
Preconditions:
N > 0
periodModels.size()==N
. z_indexes[k] >= 0
and z_indexes[k]
are sorted low to high and are unique. z.size()==N
and z[i].size()==z_indexes.size()
, for i=0...N-1
Definition at line 363 of file Thyra_DefaultMultiPeriodModelEvaluator.hpp.
void Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::reset_z | ( | const Array< Array< RCP< const VectorBase< Scalar > > > > & | z | ) |
Reset z.
z | [in] See initialize() . |
Preconditions:
initialize()
Definition at line 450 of file Thyra_DefaultMultiPeriodModelEvaluator.hpp.
|
virtual |
Implements Thyra::ModelEvaluator< Scalar >.
Definition at line 479 of file Thyra_DefaultMultiPeriodModelEvaluator.hpp.
|
virtual |
Implements Thyra::ModelEvaluator< Scalar >.
Definition at line 486 of file Thyra_DefaultMultiPeriodModelEvaluator.hpp.
|
virtual |
Implements Thyra::ModelEvaluator< Scalar >.
Definition at line 494 of file Thyra_DefaultMultiPeriodModelEvaluator.hpp.
|
virtual |
Implements Thyra::ModelEvaluator< Scalar >.
Definition at line 502 of file Thyra_DefaultMultiPeriodModelEvaluator.hpp.
|
virtual |
Implements Thyra::ModelEvaluator< Scalar >.
Definition at line 510 of file Thyra_DefaultMultiPeriodModelEvaluator.hpp.
|
virtual |
Implements Thyra::ModelEvaluator< Scalar >.
Definition at line 518 of file Thyra_DefaultMultiPeriodModelEvaluator.hpp.
|
virtual |
Implements Thyra::ModelEvaluator< Scalar >.
Definition at line 526 of file Thyra_DefaultMultiPeriodModelEvaluator.hpp.
|
virtual |
Implements Thyra::ModelEvaluator< Scalar >.
Definition at line 535 of file Thyra_DefaultMultiPeriodModelEvaluator.hpp.
|
virtual |
Implements Thyra::ModelEvaluator< Scalar >.
Definition at line 543 of file Thyra_DefaultMultiPeriodModelEvaluator.hpp.
|
virtual |
Implements Thyra::ModelEvaluator< Scalar >.
Definition at line 551 of file Thyra_DefaultMultiPeriodModelEvaluator.hpp.
|
virtual |
Implements Thyra::ModelEvaluator< Scalar >.
Definition at line 559 of file Thyra_DefaultMultiPeriodModelEvaluator.hpp.
|
virtual |
.
Implements Thyra::ModelEvaluator< Scalar >.
Definition at line 567 of file Thyra_DefaultMultiPeriodModelEvaluator.hpp.
|
virtual |
.
Implements Thyra::ModelEvaluator< Scalar >.
Definition at line 584 of file Thyra_DefaultMultiPeriodModelEvaluator.hpp.
|
virtual |
.
Implements Thyra::ModelEvaluator< Scalar >.
Definition at line 592 of file Thyra_DefaultMultiPeriodModelEvaluator.hpp.
|
virtual |
Implements Thyra::ModelEvaluator< Scalar >.
Definition at line 600 of file Thyra_DefaultMultiPeriodModelEvaluator.hpp.
|
virtual |
Ignores the final point.
Implements Thyra::ModelEvaluator< Scalar >.
Definition at line 613 of file Thyra_DefaultMultiPeriodModelEvaluator.hpp.