45 #include "Teuchos_ScalarTraits.hpp"
46 #include "Epetra_SerialComm.h"
47 #include "Epetra_CrsMatrix.h"
53 DiagonalQuadraticResponseOnlyModelEvaluator
54 ::DiagonalQuadraticResponseOnlyModelEvaluator(
55 const Teuchos::RCP<Epetra_Comm> &comm,
56 const int localDim,
const double &pt,
const double &p0,
const double &scale
58 :epetra_comm_(comm), scale_(scale)
65 map_p_ = rcp(
new Epetra_Map(-1, localDim, 0, *epetra_comm_));
66 map_g_ = rcp(
new Epetra_Map(ng, ng, 0, *epetra_comm_));
80 Teuchos::RCP<const Epetra_Map>
87 Teuchos::RCP<const Epetra_Map>
94 Teuchos::RCP<const Epetra_Map>
97 TEUCHOS_TEST_FOR_EXCEPT(l!=0);
102 Teuchos::RCP<const Epetra_Map>
105 TEUCHOS_TEST_FOR_EXCEPT(j!=0);
110 Teuchos::RCP<const Epetra_Vector>
113 TEUCHOS_TEST_FOR_EXCEPT(l!=0);
152 using Teuchos::dyn_cast;
153 using Teuchos::rcp_dynamic_cast;
165 const RCP<Epetra_Vector> g_out = outArgs.
get_g(0);
167 const RCP<Epetra_MultiVector> DgDp_trans_out =
174 if (nonnull(g_out) || nonnull(DgDp_trans_out)) {
179 p_minus_pt.Update(-1.0, *pt_, 1.0);
181 if (nonnull(g_out)) {
183 p_minus_pt.Dot(p_minus_pt, dot);
184 (*g_out)[0] = scale_ * 0.5 * dot[0];
187 if (nonnull(DgDp_trans_out)) {
188 (*DgDp_trans_out) = p_minus_pt;
189 DgDp_trans_out->Scale(scale_);
Teuchos::RCP< const Epetra_Map > get_x_map() const
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_MultiVector > get_DgDp_mv(const int j, const int l, const ModelEvaluator::OutArgs &outArgs, const ModelEvaluator::EDerivativeMultiVectorOrientation mvOrientation)
Teuchos::RCP< const Epetra_Map > get_f_map() const
InArgs createInArgs() const
Teuchos::RCP< const Epetra_Vector > get_p(int l) const
void set_DgDp_properties(int j, int l, const DerivativeProperties &properties)
OutArgs createOutArgs() const
void setModelEvalDescription(const std::string &modelEvalDescription)
void evalModel(const InArgs &inArgs, const OutArgs &outArgs) const
Teuchos::RCP< const Epetra_Vector > get_p_init(int l) const
void setModelEvalDescription(const std::string &modelEvalDescription)
Teuchos::RCP< const Epetra_Map > get_p_map(int l) const
.
Teuchos::RCP< const Epetra_Map > get_g_map(int j) const
.
void set_Np_Ng(int Np, int Ng)