Rythmos - Transient Integration for Differential Equations Version of the Day
Loading...
Searching...
No Matches
Rythmos_ForwardSensitivityModelEvaluatorBase.hpp
1//@HEADER
2// ***********************************************************************
3//
4// Rythmos Package
5// Copyright (2006) Sandia Corporation
6//
7// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8// license for use of this work by or on behalf of the U.S. Government.
9//
10// This library is free software; you can redistribute it and/or modify
11// it under the terms of the GNU Lesser General Public License as
12// published by the Free Software Foundation; either version 2.1 of the
13// License, or (at your option) any later version.
14//
15// This library is distributed in the hope that it will be useful, but
16// WITHOUT ANY WARRANTY; without even the implied warranty of
17// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18// Lesser General Public License for more details.
19//
20// You should have received a copy of the GNU Lesser General Public
21// License along with this library; if not, write to the Free Software
22// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
23// USA
24// Questions? Contact Todd S. Coffey (tscoffe@sandia.gov)
25//
26// ***********************************************************************
27//@HEADER
28
29#ifndef RYTHMOS_FORWARD_SENSITIVITY_MODEL_EVALUATOR_BASE_HPP
30#define RYTHMOS_FORWARD_SENSITIVITY_MODEL_EVALUATOR_BASE_HPP
31
32
33#include "Rythmos_IntegratorBase.hpp"
34#include "Thyra_ModelEvaluator.hpp" // Interface
35#include "Thyra_StateFuncModelEvaluatorBase.hpp" // Implementation
36#include "Thyra_DefaultProductVectorSpace.hpp"
37#include "Thyra_PhysicallyBlockedLinearOpWithSolveBase.hpp" // Interface
38#include "Thyra_DefaultBlockedTriangularLinearOpWithSolve.hpp" // Implementation
39#include "Thyra_ModelEvaluatorDelegatorBase.hpp"
40#include "Thyra_ModelEvaluatorHelpers.hpp"
41#include "Thyra_DefaultMultiVectorProductVectorSpace.hpp"
42#include "Thyra_DefaultMultiVectorProductVector.hpp"
43#include "Thyra_DefaultMultiVectorLinearOpWithSolve.hpp"
44#include "Teuchos_implicit_cast.hpp"
45#include "Teuchos_Assert.hpp"
46
47
48namespace Rythmos {
49
50
60template<class Scalar>
62 : virtual public Thyra::StateFuncModelEvaluatorBase<Scalar>
63{
64public:
65
80 virtual void initializeStructure(
81 const RCP<const Thyra::ModelEvaluator<Scalar> > &stateModel,
82 const int p_index
83 ) = 0;
84
101 const RCP<const Thyra::ModelEvaluator<Scalar> >& stateModel,
102 const RCP<const Thyra::VectorSpaceBase<Scalar> >& p_space
103 ) = 0;
104
106 virtual RCP<const Thyra::ModelEvaluator<Scalar> >
107 getStateModel() const =0;
108
110 virtual RCP<Thyra::ModelEvaluator<Scalar> >
112
114 virtual int get_p_index() const = 0;
115
117 virtual RCP<const Thyra::DefaultMultiVectorProductVectorSpace<Scalar> >
118 get_s_bar_space() const = 0;
119
121 virtual RCP<const Thyra::VectorSpaceBase<Scalar> > get_p_sens_space() const = 0;
122
125 Ptr<StepperBase<Scalar> > stateStepper,
126 bool forceUpToDateW
127 ) =0;
128
129};
130
131
135template<class Scalar>
136RCP<const Thyra::VectorBase<Scalar> > create_s_bar_given_S(
137 const ForwardSensitivityModelEvaluatorBase<Scalar> &fwdSensModel,
138 const RCP<Thyra::MultiVectorBase<Scalar> > &S
139 )
140{
141 return Thyra::multiVectorProductVector(fwdSensModel.get_s_bar_space(), S);
142}
143
144
148template<class Scalar>
149RCP<const Thyra::VectorBase<Scalar> > create_s_bar_given_S(
150 const ForwardSensitivityModelEvaluatorBase<Scalar> &fwdSensModel,
151 const RCP<const Thyra::MultiVectorBase<Scalar> > &S
152 )
153{
154 return Thyra::multiVectorProductVector(fwdSensModel.get_s_bar_space(), S);
155}
156
157
158} // namespace Rythmos
159
160
161#endif // RYTHMOS_FORWARD_SENSITIVITY_MODEL_EVALUATOR_BASE_HPP
Forward sensitivity transient ModelEvaluator node interface class.
virtual RCP< const Thyra::VectorSpaceBase< Scalar > > get_p_sens_space() const =0
virtual RCP< const Thyra::DefaultMultiVectorProductVectorSpace< Scalar > > get_s_bar_space() const =0
virtual void initializePointState(Ptr< StepperBase< Scalar > > stateStepper, bool forceUpToDateW)=0
virtual RCP< const Thyra::ModelEvaluator< Scalar > > getStateModel() const =0
virtual RCP< Thyra::ModelEvaluator< Scalar > > getNonconstStateModel() const =0
virtual void initializeStructureInitCondOnly(const RCP< const Thyra::ModelEvaluator< Scalar > > &stateModel, const RCP< const Thyra::VectorSpaceBase< Scalar > > &p_space)=0
Initialize the structure of the model for an initial condition only sensitivity problem.
virtual void initializeStructure(const RCP< const Thyra::ModelEvaluator< Scalar > > &stateModel, const int p_index)=0
Initialize the structure of the model.