Thyra
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
core
test
nonlinear
models
Thyra_DiagonalQuadraticResponseOnlyModelEvaluator_decl.hpp
1
/*
2
// @HEADER
3
// ***********************************************************************
4
//
5
// Thyra: Interfaces and Support for Abstract Numerical Algorithms
6
// Copyright (2004) Sandia Corporation
7
//
8
// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
9
// license for use of this work by or on behalf of the U.S. Government.
10
//
11
// Redistribution and use in source and binary forms, with or without
12
// modification, are permitted provided that the following conditions are
13
// met:
14
//
15
// 1. Redistributions of source code must retain the above copyright
16
// notice, this list of conditions and the following disclaimer.
17
//
18
// 2. Redistributions in binary form must reproduce the above copyright
19
// notice, this list of conditions and the following disclaimer in the
20
// documentation and/or other materials provided with the distribution.
21
//
22
// 3. Neither the name of the Corporation nor the names of the
23
// contributors may be used to endorse or promote products derived from
24
// this software without specific prior written permission.
25
//
26
// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37
//
38
// Questions? Contact Roscoe A. Bartlett (bartlettra@ornl.gov)
39
//
40
// ***********************************************************************
41
// @HEADER
42
*/
43
44
#ifndef THYRA_DIAGONAL_QUADRATIC_RESPONSE_ONLY_MODEL_EVALUATOR_DECL_HPP
45
#define THYRA_DIAGONAL_QUADRATIC_RESPONSE_ONLY_MODEL_EVALUATOR_DECL_HPP
46
47
48
#include "Thyra_ResponseOnlyModelEvaluatorBase.hpp"
49
#include "Teuchos_Comm.hpp"
50
51
52
namespace
Thyra {
53
54
125
template
<
class
Scalar>
126
class
DiagonalQuadraticResponseOnlyModelEvaluator
127
:
public
ResponseOnlyModelEvaluatorBase
<Scalar>
128
{
129
public
:
130
132
135
137
DiagonalQuadraticResponseOnlyModelEvaluator
(
138
const
int
localDim,
139
const
RCP
<
const
Teuchos::Comm<Ordinal>
> &comm = Teuchos::null
140
);
141
143
void
setSolutionVector
(
const
RCP
<
const
VectorBase<Scalar>
> &ps);
144
146
const
RCP<const VectorBase<Scalar>
>
147
getSolutionVector
()
const
;
148
150
void
setDiagonalVector
(
const
RCP
<
const
VectorBase<Scalar>
> &diag);
151
157
void
setDiagonalBarVector
(
const
RCP
<
const
VectorBase<Scalar>
> &diag_bar);
158
160
void
setNonlinearTermFactor
(
const
Scalar &nonlinearTermFactor);
161
163
void
setScalarOffset
(
const
Scalar &g_offset);
164
166
169
171
int
Np
()
const
;
173
int
Ng
()
const
;
175
RCP<const VectorSpaceBase<Scalar>
>
get_p_space
(
int
l)
const
;
177
RCP<const VectorSpaceBase<Scalar>
>
get_g_space
(
int
j)
const
;
179
ModelEvaluatorBase::InArgs<Scalar>
createInArgs
()
const
;
180
182
183
private
:
184
187
189
ModelEvaluatorBase::OutArgs<Scalar>
createOutArgsImpl()
const
;
191
void
evalModelImpl(
192
const
ModelEvaluatorBase::InArgs<Scalar>
& inArgs,
193
const
ModelEvaluatorBase::OutArgs<Scalar>
& outArgs
194
)
const
;
195
197
198
private
:
199
200
// //////////////////////
201
// Private data members
202
203
int
Np_;
204
int
Ng_;
205
RCP<const Teuchos::Comm<Ordinal>
> comm_;
206
const
int
localDim_;
207
208
RCP<const VectorSpaceBase<Scalar>
> g_space_;
209
210
// Declared non-const so we can change the space in place!
211
RCP<VectorSpaceBase<Scalar>
> p_space_;
212
213
RCP<const VectorBase<Scalar>
> ps_;
214
RCP<const VectorBase<Scalar>
> diag_;
215
Scalar nonlinearTermFactor_;
216
Scalar g_offset_;
217
218
RCP<const VectorBase<Scalar>
> diag_bar_;
219
RCP<const VectorBase<Scalar>
> s_bar_;
220
221
};
222
223
225
template
<
class
Scalar>
226
RCP<DiagonalQuadraticResponseOnlyModelEvaluator<Scalar>
>
227
diagonalQuadraticResponseOnlyModelEvaluator(
228
const
int
localDim,
229
const
RCP
<
const
Teuchos::Comm<Ordinal>
> &comm = Teuchos::null
230
)
231
{
232
using
Teuchos::rcp
;
233
return
rcp(
new
DiagonalQuadraticResponseOnlyModelEvaluator<Scalar>
(localDim, comm));
234
}
235
236
237
}
// namespace Thyra
238
239
240
#endif
// THYRA_DIAGONAL_QUADRATIC_RESPONSE_ONLY_MODEL_EVALUATOR_DECL_HPP
Teuchos::Comm
Teuchos::RCP
Thyra::DiagonalQuadraticResponseOnlyModelEvaluator
Simple parallel response-only ModelEvaluator.
Definition
Thyra_DiagonalQuadraticResponseOnlyModelEvaluator_decl.hpp:128
Thyra::DiagonalQuadraticResponseOnlyModelEvaluator::setDiagonalVector
void setDiagonalVector(const RCP< const VectorBase< Scalar > > &diag)
Set the diagonal vector diag.
Definition
Thyra_DiagonalQuadraticResponseOnlyModelEvaluator_def.hpp:133
Thyra::DiagonalQuadraticResponseOnlyModelEvaluator::setSolutionVector
void setSolutionVector(const RCP< const VectorBase< Scalar > > &ps)
Set the solution vector ps .
Definition
Thyra_DiagonalQuadraticResponseOnlyModelEvaluator_def.hpp:117
Thyra::DiagonalQuadraticResponseOnlyModelEvaluator::createInArgs
ModelEvaluatorBase::InArgs< Scalar > createInArgs() const
Definition
Thyra_DiagonalQuadraticResponseOnlyModelEvaluator_def.hpp:234
Thyra::DiagonalQuadraticResponseOnlyModelEvaluator::Np
int Np() const
Definition
Thyra_DiagonalQuadraticResponseOnlyModelEvaluator_def.hpp:193
Thyra::DiagonalQuadraticResponseOnlyModelEvaluator::setScalarOffset
void setScalarOffset(const Scalar &g_offset)
Set offset scalar g_offset .
Definition
Thyra_DiagonalQuadraticResponseOnlyModelEvaluator_def.hpp:182
Thyra::DiagonalQuadraticResponseOnlyModelEvaluator::get_g_space
RCP< const VectorSpaceBase< Scalar > > get_g_space(int j) const
Definition
Thyra_DiagonalQuadraticResponseOnlyModelEvaluator_def.hpp:221
Thyra::DiagonalQuadraticResponseOnlyModelEvaluator::setNonlinearTermFactor
void setNonlinearTermFactor(const Scalar &nonlinearTermFactor)
Set nonlinear term factory.
Definition
Thyra_DiagonalQuadraticResponseOnlyModelEvaluator_def.hpp:174
Thyra::DiagonalQuadraticResponseOnlyModelEvaluator::DiagonalQuadraticResponseOnlyModelEvaluator
DiagonalQuadraticResponseOnlyModelEvaluator(const int localDim, const RCP< const Teuchos::Comm< Ordinal > > &comm=Teuchos::null)
Definition
Thyra_DiagonalQuadraticResponseOnlyModelEvaluator_def.hpp:70
Thyra::DiagonalQuadraticResponseOnlyModelEvaluator::get_p_space
RCP< const VectorSpaceBase< Scalar > > get_p_space(int l) const
Definition
Thyra_DiagonalQuadraticResponseOnlyModelEvaluator_def.hpp:208
Thyra::DiagonalQuadraticResponseOnlyModelEvaluator::setDiagonalBarVector
void setDiagonalBarVector(const RCP< const VectorBase< Scalar > > &diag_bar)
Set the diagonal vector diag_bar.
Definition
Thyra_DiagonalQuadraticResponseOnlyModelEvaluator_def.hpp:142
Thyra::DiagonalQuadraticResponseOnlyModelEvaluator::Ng
int Ng() const
Definition
Thyra_DiagonalQuadraticResponseOnlyModelEvaluator_def.hpp:200
Thyra::DiagonalQuadraticResponseOnlyModelEvaluator::getSolutionVector
const RCP< const VectorBase< Scalar > > getSolutionVector() const
Get the solution vector ps .
Definition
Thyra_DiagonalQuadraticResponseOnlyModelEvaluator_def.hpp:126
Thyra::ModelEvaluatorBase::InArgs
Concrete aggregate class for all input arguments computable by a ModelEvaluator subclass object.
Definition
Thyra_ModelEvaluatorBase_decl.hpp:159
Thyra::ModelEvaluatorBase::OutArgs
Concrete aggregate class for all output arguments computable by a ModelEvaluator subclass object.
Definition
Thyra_ModelEvaluatorBase_decl.hpp:902
Thyra::ResponseOnlyModelEvaluatorBase
This base class defines default function implementations appropritate for a response-only model evalu...
Definition
Thyra_ResponseOnlyModelEvaluatorBase.hpp:64
Thyra::VectorBase
Abstract interface for finite-dimensional dense vectors.
Definition
Thyra_VectorBase.hpp:147
Teuchos::rcp
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Generated by
1.17.0