57 inline double sqr(
const double& s ) {
return s*s; }
72 :xt0_(xt0),xt1_(xt1),pt0_(pt0),pt1_(pt1),d_(d),
73 isInitialized_(false),supportDerivs_(true)
79 const int nx = 2, np = 2, ng = 1;
86 const double inf = 1e+50;
100 int indices[nx] = { 0, 1 };
101 for(
int i = 0; i < nx; ++i )
118 double pL0,
double pL1,
double pU0,
double pU1
128 double xL0,
double xL1,
double xU0,
double xU1
270 using Teuchos::rcp_dynamic_cast;
292 f[0] = x[0] + x[1]*x[1] - p[0];
293 f[1] =
d_ * ( x[0]*x[0] - x[1] - p[1] );
297 g[0] = 0.5 * ( sqr(x[0]-
xt0_) + sqr(x[1]-
xt1_) + sqr(p[0]-
pt0_) + sqr(p[1]-
pt1_) );
311 values[0] = 1.0; indexes[0] = 0;
312 values[1] = 2.0*x[1]; indexes[1] = 1;
315 values[0] = 2.0*
d_*x[0]; indexes[0] = 0;
316 values[1] = -
d_; indexes[1] = 1;
327 DgDx_trans[0] = x[0]-
xt0_;
328 DgDx_trans[1] = x[1]-
xt1_;
332 DgDp_trans[0] = p[0]-
pt0_;
333 DgDp_trans[1] = p[1]-
pt1_;
void set_x_bounds(double xL0, double xL1, double xU0, double xU1)
Teuchos::RCP< const Epetra_Map > get_x_map() const
Teuchos::RCP< const Epetra_Map > map_p_
void set_W_properties(const DerivativeProperties &properties)
Evaluation< Epetra_Vector > get_g(int j) const
Get g(j) where 0 <= j && j < this->Ng().
void setSupports(EOutArgsMembers arg, bool supports=true)
Teuchos::RCP< Epetra_Vector > p0_
Teuchos::RCP< Epetra_Vector > pL_
Teuchos::RCP< const Epetra_Map > get_f_map() const
Teuchos::RCP< Epetra_Vector > xL_
Teuchos::RCP< Epetra_CrsGraph > W_graph_
Teuchos::RCP< Epetra_MultiVector > get_DgDp_mv(const int j, const int l, const ModelEvaluator::OutArgs &outArgs, const ModelEvaluator::EDerivativeMultiVectorOrientation mvOrientation)
void evalModel(const InArgs &inArgs, const OutArgs &outArgs) const
Teuchos::RCP< Epetra_Operator > get_W() const
Teuchos::RCP< const Epetra_Map > map_x_
Teuchos::RCP< const Epetra_Map > map_g_
Teuchos::RCP< Epetra_Vector > xU_
virtual int SumIntoGlobalValues(int GlobalRow, int NumEntries, const double *Values, const int *Indices)
void setSupports(EInArgsMembers arg, bool supports=true)
void set_p_bounds(double pL0, double pL1, double pU0, double pU1)
Teuchos::RCP< const Epetra_Map > get_p_map(int l) const
.
Teuchos::RCP< const Epetra_Vector > get_p_init(int l) const
Teuchos::RCP< const Epetra_Vector > get_p(int l) const
OutArgs createOutArgs() const
int InsertGlobalIndices(int_type GlobalRow, int NumIndices, int_type *Indices)
Teuchos::RCP< Epetra_Vector > gU_
Teuchos::RCP< const Epetra_Vector > get_x_init() const
int PutScalar(double ScalarConstant)
void set_DgDp_properties(int j, int l, const DerivativeProperties &properties)
Teuchos::RCP< const Epetra_Comm > epetra_comm_
void set_DfDp_properties(int l, const DerivativeProperties &properties)
Teuchos::RCP< const Epetra_Vector > get_p_lower_bounds(int l) const
void setModelEvalDescription(const std::string &modelEvalDescription)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Teuchos::RCP< Epetra_MultiVector > get_DfDp_mv(const int l, const ModelEvaluator::OutArgs &outArgs)
Teuchos::RCP< Epetra_Vector > gL_
T_To & dyn_cast(T_From &from)
InArgs createInArgs() const
Teuchos::RCP< Epetra_MultiVector > get_DgDx_mv(const int j, const ModelEvaluator::OutArgs &outArgs, const ModelEvaluator::EDerivativeMultiVectorOrientation mvOrientation)
virtual std::string description() const
Teuchos::RCP< const Epetra_Vector > get_p_upper_bounds(int l) const
void setModelEvalDescription(const std::string &modelEvalDescription)
Teuchos::RCP< Epetra_Vector > pU_
Teuchos::RCP< Epetra_Vector > x0_
void setSupportDerivs(bool supportDerivs)
Teuchos::RCP< const Epetra_Vector > get_x_upper_bounds() const
Teuchos::RCP< const Epetra_Map > get_g_map(int j) const
.
void set_DgDx_properties(int j, const DerivativeProperties &properties)
Teuchos::RCP< Epetra_Operator > create_W() const
Evaluation< Epetra_Vector > get_f() const
Teuchos::RCP< const Epetra_Vector > get_x() const
Set solution vector Taylor polynomial.
Teuchos::RCP< const Epetra_Vector > get_x_lower_bounds() const
void set_Np_Ng(int Np, int Ng)
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)