Thyra Version of the Day
Loading...
Searching...
No Matches
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
18namespace Thyra {
19
20
91template<class Scalar>
93 : public ResponseOnlyModelEvaluatorBase<Scalar>
94{
95public:
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
149private:
150
153
155 ModelEvaluatorBase::OutArgs<Scalar> createOutArgsImpl() const;
157 void evalModelImpl(
160 ) const;
161
163
164private:
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!
178
181 Scalar nonlinearTermFactor_;
182 Scalar g_offset_;
183
186
187};
188
189
191template<class Scalar>
193diagonalQuadraticResponseOnlyModelEvaluator(
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
void setDiagonalVector(const RCP< const VectorBase< Scalar > > &diag)
Set the diagonal vector diag.
void setSolutionVector(const RCP< const VectorBase< Scalar > > &ps)
Set the solution vector ps .
void setNonlinearTermFactor(const Scalar &nonlinearTermFactor)
Set nonlinear term factory.
void setDiagonalBarVector(const RCP< const VectorBase< Scalar > > &diag_bar)
Set the diagonal vector diag_bar.
const RCP< const VectorBase< Scalar > > getSolutionVector() const
Get the solution vector ps .
Concrete aggregate class for all input arguments computable by a ModelEvaluator subclass object.
Concrete aggregate class for all output arguments computable by a ModelEvaluator subclass object.
This base class defines default function implementations appropritate for a response-only model evalu...
Abstract interface for finite-dimensional dense vectors.
T_To & dyn_cast(T_From &from)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)