Thyra Package Browser (Single Doxygen Collection) Version of the Day
Thyra_DiagonalQuadraticResponseOnlyModelEvaluator_decl.hpp
Go to the documentation of this file.
00001 #ifndef THYRA_DIAGONAL_QUADRATIC_RESPONSE_ONLY_MODEL_EVALUATOR_DECL_HPP
00002 #define THYRA_DIAGONAL_QUADRATIC_RESPONSE_ONLY_MODEL_EVALUATOR_DECL_HPP
00003 
00004 
00005 #include "Thyra_ResponseOnlyModelEvaluatorBase.hpp"
00006 #include "Teuchos_Comm.hpp"
00007 
00008 
00009 namespace Thyra {
00010 
00011 
00082 template<class Scalar>
00083 class DiagonalQuadraticResponseOnlyModelEvaluator
00084    : public ResponseOnlyModelEvaluatorBase<Scalar>
00085 {
00086 public:
00087 
00089 
00092 
00094   DiagonalQuadraticResponseOnlyModelEvaluator(
00095     const int localDim,
00096     const RCP<const Teuchos::Comm<Ordinal> > &comm = Teuchos::null
00097     );
00098 
00100   void setSolutionVector(const RCP<const VectorBase<Scalar> > &ps);
00101 
00103   const RCP<const VectorBase<Scalar> >
00104   getSolutionVector() const;
00105   
00107   void setDiagonalVector(const RCP<const VectorBase<Scalar> > &diag);
00108   
00114   void setDiagonalBarVector(const RCP<const VectorBase<Scalar> > &diag_bar);
00115 
00117   void setNonlinearTermFactor(const Scalar &nonlinearTermFactor);
00118 
00120   void setScalarOffset(const Scalar &g_offset);
00121 
00123 
00126 
00128   int Np() const;
00130   int Ng() const;
00132   RCP<const VectorSpaceBase<Scalar> > get_p_space(int l) const;
00134   RCP<const VectorSpaceBase<Scalar> > get_g_space(int j) const;
00136   ModelEvaluatorBase::InArgs<Scalar> createInArgs() const;
00137 
00139 
00140 private:
00141 
00144 
00146   ModelEvaluatorBase::OutArgs<Scalar> createOutArgsImpl() const;
00148   void evalModelImpl(
00149     const ModelEvaluatorBase::InArgs<Scalar>& inArgs,
00150     const ModelEvaluatorBase::OutArgs<Scalar>& outArgs
00151     ) const;
00152 
00154 
00155 private:
00156 
00157   // //////////////////////
00158   // Private data members
00159 
00160   int Np_;
00161   int Ng_;
00162   RCP<const Teuchos::Comm<Ordinal> > comm_;
00163   const int localDim_;
00164 
00165   RCP<const VectorSpaceBase<Scalar> > g_space_;
00166 
00167   // Declared non-const so we can change the space in place!
00168   RCP<VectorSpaceBase<Scalar> > p_space_;
00169 
00170   RCP<const VectorBase<Scalar> > ps_;
00171   RCP<const VectorBase<Scalar> > diag_;
00172   Scalar nonlinearTermFactor_;
00173   Scalar g_offset_;
00174 
00175   RCP<const VectorBase<Scalar> > diag_bar_;
00176   RCP<const VectorBase<Scalar> > s_bar_;
00177 
00178 };
00179 
00180 
00182 template<class Scalar>
00183 RCP<DiagonalQuadraticResponseOnlyModelEvaluator<Scalar> >
00184 diagonalQuadraticResponseOnlyModelEvaluator(
00185   const int localDim,
00186   const RCP<const Teuchos::Comm<Ordinal> > &comm = Teuchos::null
00187   )
00188 {
00189   using Teuchos::rcp;
00190   return rcp(new DiagonalQuadraticResponseOnlyModelEvaluator<Scalar>(localDim, comm));
00191 }
00192 
00193 
00194 } // namespace Thyra
00195 
00196 
00197 #endif // THYRA_DIAGONAL_QUADRATIC_RESPONSE_ONLY_MODEL_EVALUATOR_DECL_HPP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines