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;