Thyra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Thyra_DiagonalQuadraticResponseOnlyModelEvaluator_decl.hpp
1 // @HEADER
2 // *****************************************************************************
3 // Thyra: Interfaces and Support for Abstract Numerical Algorithms
4 //
5 // Copyright 2004 NTESS and the Thyra contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef THYRA_DIAGONAL_QUADRATIC_RESPONSE_ONLY_MODEL_EVALUATOR_DECL_HPP
11 #define THYRA_DIAGONAL_QUADRATIC_RESPONSE_ONLY_MODEL_EVALUATOR_DECL_HPP
12 
13 
14 #include "Thyra_ResponseOnlyModelEvaluatorBase.hpp"
15 #include "Teuchos_Comm.hpp"
16 
17 
18 namespace Thyra {
19 
20 
91 template<class Scalar>
93  : public ResponseOnlyModelEvaluatorBase<Scalar>
94 {
95 public:
96 
98 
101 
104  const int localDim,
105  const RCP<const Teuchos::Comm<Ordinal> > &comm = Teuchos::null
106  );
107 
109  void setSolutionVector(const RCP<const VectorBase<Scalar> > &ps);
110 
113  getSolutionVector() const;
114 
116  void setDiagonalVector(const RCP<const VectorBase<Scalar> > &diag);
117 
123  void setDiagonalBarVector(const RCP<const VectorBase<Scalar> > &diag_bar);
124 
126  void setNonlinearTermFactor(const Scalar &nonlinearTermFactor);
127 
129  void setScalarOffset(const Scalar &g_offset);
130 
132 
135 
137  int Np() const;
139  int Ng() const;
146 
148 
149 private:
150 
153 
155  ModelEvaluatorBase::OutArgs<Scalar> createOutArgsImpl() const;
157  void evalModelImpl(
160  ) const;
161 
163 
164 private:
165 
166  // //////////////////////
167  // Private data members
168 
169  int Np_;
170  int Ng_;
172  const int localDim_;
173 
175 
176  // Declared non-const so we can change the space in place!
177  RCP<VectorSpaceBase<Scalar> > p_space_;
178 
181  Scalar nonlinearTermFactor_;
182  Scalar g_offset_;
183 
184  RCP<const VectorBase<Scalar> > diag_bar_;
186 
187 };
188 
189 
191 template<class Scalar>
193 diagonalQuadraticResponseOnlyModelEvaluator(
194  const int localDim,
195  const RCP<const Teuchos::Comm<Ordinal> > &comm = Teuchos::null
196  )
197 {
198  using Teuchos::rcp;
199  return rcp(new DiagonalQuadraticResponseOnlyModelEvaluator<Scalar>(localDim, comm));
200 }
201 
202 
203 } // namespace Thyra
204 
205 
206 #endif // THYRA_DIAGONAL_QUADRATIC_RESPONSE_ONLY_MODEL_EVALUATOR_DECL_HPP
Concrete aggregate class for all output arguments computable by a ModelEvaluator subclass object...
void setSolutionVector(const RCP< const VectorBase< Scalar > > &ps)
Set the solution vector ps .
DiagonalQuadraticResponseOnlyModelEvaluator(const int localDim, const RCP< const Teuchos::Comm< Ordinal > > &comm=Teuchos::null)
const RCP< const VectorBase< Scalar > > getSolutionVector() const
Get the solution vector ps .
void setNonlinearTermFactor(const Scalar &nonlinearTermFactor)
Set nonlinear term factory.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
This base class defines default function implementations appropritate for a response-only model evalu...
Abstract interface for finite-dimensional dense vectors.
void setDiagonalVector(const RCP< const VectorBase< Scalar > > &diag)
Set the diagonal vector diag.
void setDiagonalBarVector(const RCP< const VectorBase< Scalar > > &diag_bar)
Set the diagonal vector diag_bar.
Concrete aggregate class for all input arguments computable by a ModelEvaluator subclass object...