53 inline double sqr(
const double& s ) {
return s*s; }
70 :isInitialized_(false), epetra_comm_(epetra_comm),
71 xt0_(xt0),xt1_(xt1),pt0_(pt0),pt1_(pt1),d_(d)
75 const int nx = 2, np = 2, ng = 1, nq = 1;
83 const double inf = 1e+50;
100 int indices[nx] = { 0, 1 };
101 for(
int i = 0; i < nx; ++i )
111 double pL0,
double pL1,
double pU0,
double pU1
121 double xL0,
double xL1,
double xU0,
double xU1
169 if (l==0)
return p0_;
189 if (l==0)
return pL_;
197 if (l==0)
return pU_;
262 using Teuchos::rcp_dynamic_cast;
287 f[0] = x[0] + x[1]*x[1] - p[0] + q[0];
288 f[1] =
d_ * ( x[0]*x[0] - x[1] - p[1] );
292 g[0] = 0.5 * ( sqr(x[0]-
xt0_) + sqr(x[1]-
xt1_) + sqr(p[0]-
pt0_) + sqr(p[1]-
pt1_) );
306 values[0] = 1.0; indexes[0] = 0;
307 values[1] = 2.0*x[1]; indexes[1] = 1;
310 values[0] = 2.0*
d_*x[0]; indexes[0] = 0;
311 values[1] = -
d_; indexes[1] = 1;
322 DgDx_trans[0] = x[0]-
xt0_;
323 DgDx_trans[1] = x[1]-
xt1_;
327 DgDp_trans[0] = p[0]-
pt0_;
328 DgDp_trans[1] = p[1]-
pt1_;
InArgs createInArgs() const
void set_W_properties(const DerivativeProperties &properties)
Evaluation< Epetra_Vector > get_g(int j) const
Get g(j) where 0 <= j && j < this->Ng().
Teuchos::RCP< Epetra_Vector > qU_
void setSupports(EOutArgsMembers arg, bool supports=true)
Teuchos::RCP< const Epetra_Vector > get_p_init(int l) const
Teuchos::RCP< const Epetra_Vector > get_p_upper_bounds(int l) const
Teuchos::RCP< const Epetra_Map > get_x_map() const
Teuchos::RCP< Epetra_MultiVector > get_DgDp_mv(const int j, const int l, const ModelEvaluator::OutArgs &outArgs, const ModelEvaluator::EDerivativeMultiVectorOrientation mvOrientation)
Teuchos::RCP< Epetra_Vector > gL_
Teuchos::RCP< Epetra_Operator > get_W() const
Teuchos::RCP< const Epetra_Map > map_p_
virtual int SumIntoGlobalValues(int GlobalRow, int NumEntries, const double *Values, const int *Indices)
void setSupports(EInArgsMembers arg, bool supports=true)
Teuchos::RCP< Epetra_Operator > create_W() const
Teuchos::RCP< Epetra_Vector > gU_
Teuchos::RCP< const Epetra_Vector > get_p(int l) const
Teuchos::RCP< const Epetra_Map > get_p_map(int l) const
.
int InsertGlobalIndices(int_type GlobalRow, int NumIndices, int_type *Indices)
Teuchos::RCP< const Epetra_Map > get_f_map() const
Teuchos::RCP< const Epetra_Vector > get_p_lower_bounds(int l) const
Teuchos::RCP< const Epetra_Map > get_g_map(int j) const
.
Teuchos::RCP< Epetra_Vector > q_
int PutScalar(double ScalarConstant)
void set_DgDp_properties(int j, int l, const DerivativeProperties &properties)
Teuchos::RCP< const Epetra_Map > map_g_
void set_DfDp_properties(int l, const DerivativeProperties &properties)
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)
T_To & dyn_cast(T_From &from)
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< Epetra_Vector > xL_
void setModelEvalDescription(const std::string &modelEvalDescription)
void set_p_bounds(double pL0, double pL1, double pU0, double pU1)
Teuchos::RCP< Epetra_Vector > xU_
Teuchos::RCP< const Epetra_Map > map_x_
Teuchos::RCP< const Epetra_Vector > get_x_upper_bounds() const
Teuchos::RCP< Epetra_Vector > x0_
EpetraMultiPointModelEval4DOpt(Teuchos::RCP< Epetra_Comm > epetra_comm, const double xt0=1.0, const double xt1=1.0, const double pt0=2.0, const double pt1=0.0, const double d=10.0, const double x00=1.0, const double x01=1.0, const double p00=2.0, const double p01=0.0, const double q0=0.0)
Teuchos::RCP< const Epetra_Vector > get_x_lower_bounds() const
Teuchos::RCP< Epetra_Vector > qL_
Teuchos::RCP< const Epetra_Comm > epetra_comm_
Teuchos::RCP< Epetra_Vector > p0_
Teuchos::RCP< Epetra_Vector > pU_
void set_DgDx_properties(int j, const DerivativeProperties &properties)
void set_x_bounds(double xL0, double xL1, double xU0, double xU1)
void evalModel(const InArgs &inArgs, const OutArgs &outArgs) const
Teuchos::RCP< const Epetra_Vector > get_x_init() const
Teuchos::RCP< Epetra_CrsGraph > W_graph_
Evaluation< Epetra_Vector > get_f() const
Teuchos::RCP< const Epetra_Vector > get_x() const
Set solution vector Taylor polynomial.
Teuchos::RCP< const Epetra_Map > map_q_
void set_Np_Ng(int Np, int Ng)
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
Teuchos::RCP< Epetra_Vector > pL_
OutArgs createOutArgs() const