45 #include "Teuchos_ScalarTraits.hpp"
46 #include "Epetra_SerialComm.h"
47 #include "Epetra_CrsMatrix.h"
55 ,
const bool showGetInvalidArg
57 :d_(d),showGetInvalidArg_(showGetInvalidArg)
65 map_x_ = rcp(
new Epetra_Map(nx,0,*epetra_comm_));
66 x0_ = rcp(
new Epetra_Vector(*map_x_)); (*x0_)[0] = x00; (*x0_)[1] = x01;
67 p_ = rcp(
new Epetra_Vector(*map_x_)); (*p_)[0] = p0; (*p_)[1] = p1;
72 int indices[nx] = { 0, 1 };
73 for(
int i = 0; i < nx; ++i )
74 W_graph_->InsertGlobalIndices(i,nx,indices);
76 W_graph_->FillComplete();
78 isInitialized_ =
true;
84 Teuchos::RCP<const Epetra_Map>
90 Teuchos::RCP<const Epetra_Map>
96 Teuchos::RCP<const Epetra_Vector>
102 Teuchos::RCP<Epetra_Operator>
136 using Teuchos::dyn_cast;
137 using Teuchos::rcp_dynamic_cast;
147 if(showGetInvalidArg_) {
156 f[0] = x[0] + x[1]*x[1] - p[0];
157 f[1] = d_ * ( x[0]*x[0] - x[1] - p[1] );
171 values[0] = 1.0; indexes[0] = 0;
172 values[1] = 2.0*x[1]; indexes[1] = 1;
175 values[0] = 2.0*d_*x[0]; indexes[0] = 0;
176 values[1] = -d_; indexes[1] = 1;
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)
virtual int SumIntoGlobalValues(int GlobalRow, int NumEntries, const double *Values, const int *Indices)
OutArgs createOutArgs() const
Teuchos::RCP< Epetra_Operator > get_W() const
void setSupports(EInArgsMembers arg, bool supports=true)
Teuchos::RCP< const Epetra_Map > get_f_map() const
Teuchos::RCP< Epetra_Operator > create_W() const
Teuchos::RCP< const Epetra_Vector > get_x_init() const
EpetraModelEval2DSim(const double d=10.0, const double p0=2.0, const double p1=0.0, const double x00=1.0, const double x01=1.0, const bool showGetInvalidArg=false)
int PutScalar(double ScalarConstant)
void setModelEvalDescription(const std::string &modelEvalDescription)
InArgs createInArgs() const
void setModelEvalDescription(const std::string &modelEvalDescription)
Teuchos::RCP< const Epetra_Map > get_x_map() const
void evalModel(const InArgs &inArgs, const OutArgs &outArgs) const
Evaluation< Epetra_Vector > get_f() const
Teuchos::RCP< const Epetra_Vector > get_x() const
Set solution vector Taylor polynomial.