Panzer
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
disc-fe
src
Panzer_ExplicitModelEvaluator.hpp
Go to the documentation of this file.
1
// @HEADER
2
// ***********************************************************************
3
//
4
// Panzer: A partial differential equation assembly
5
// engine for strongly coupled complex multiphysics systems
6
// Copyright (2011) Sandia Corporation
7
//
8
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9
// the U.S. Government retains certain rights in this software.
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 Roger P. Pawlowski (rppawlo@sandia.gov) and
39
// Eric C. Cyr (eccyr@sandia.gov)
40
// ***********************************************************************
41
// @HEADER
42
43
#ifndef PANZER_EXPLICIT_MODEL_EVALUATOR_HPP
44
#define PANZER_EXPLICIT_MODEL_EVALUATOR_HPP
45
46
#include "PanzerDiscFE_config.hpp"
47
48
#include "Thyra_ModelEvaluatorDelegatorBase.hpp"
49
#include "Thyra_BlockedLinearOpBase.hpp"
50
51
#include "
Panzer_ModelEvaluator.hpp
"
52
53
#ifdef PANZER_HAVE_EPETRA_STACK
54
#include "
Panzer_ModelEvaluator_Epetra.hpp
"
55
#endif
56
57
#include "
Panzer_MassMatrixModelEvaluator.hpp
"
58
59
namespace
panzer
{
60
66
template
<
typename
Scalar>
67
class
ExplicitModelEvaluator
68
:
public
Thyra::ModelEvaluatorDelegatorBase<Scalar>,
69
public
panzer::MassMatrixModelEvaluator
<Scalar> {
70
public
:
71
74
78
ExplicitModelEvaluator
(
const
Teuchos::RCP<
Thyra::ModelEvaluator<Scalar>
> & model,
79
bool
constantMassMatrix,
80
bool
useLumpedMass,
81
bool
applyMassInverse=
true
);
82
84
86
Thyra::ModelEvaluatorBase::InArgs<Scalar>
getNominalValues
()
const
;
87
89
Thyra::ModelEvaluatorBase::InArgs<Scalar>
createInArgs
()
const
;
90
92
Thyra::ModelEvaluatorBase::OutArgs<Scalar>
createOutArgs
()
const
;
93
95
Teuchos::RCP<panzer::ModelEvaluator<Scalar> >
getPanzerUnderlyingModel
();
96
97
virtual
void
applyInverseMassMatrix
(
const
Teuchos::RCP<
Thyra::MultiVectorBase<Scalar>
> input,
const
Teuchos::RCP<
Thyra::MultiVectorBase<Scalar>
> output)
const
98
{
99
Thyra::apply(*
invMassMatrix_
,Thyra::NOTRANS,*input,output.ptr());
100
}
101
102
virtual
void
applyMassMatrix
(
const
Teuchos::RCP<
Thyra::MultiVectorBase<Scalar>
> input,
const
Teuchos::RCP<
Thyra::MultiVectorBase<Scalar>
> output)
const
103
{
104
Thyra::apply(*
mass_
,Thyra::NOTRANS,*input,output.ptr());
105
}
106
107
private
:
// data members
108
112
void
applyDirichletBCs
(
const
Teuchos::RCP<
Thyra::VectorBase<Scalar>
> & x,
113
const
Teuchos::RCP<
Thyra::VectorBase<Scalar>
> & f)
const
114
{
115
if
(
panzerModel_
!=Teuchos::null) {
panzerModel_
->applyDirichletBCs(x,f);
return
; }
116
#ifdef PANZER_HAVE_EPETRA_STACK
117
if
(panzerEpetraModel_!=Teuchos::null) { panzerEpetraModel_->applyDirichletBCs(x,f);
return
; }
118
#endif
119
120
TEUCHOS_ASSERT(
false
);
121
}
122
126
void
buildInverseMassMatrix
(
const
Thyra::ModelEvaluatorBase::InArgs<Scalar> &inArgs)
const
;
127
129
void
buildArgsPrototypes
();
130
133
135
void
evalModelImpl
(
const
Thyra::ModelEvaluatorBase::InArgs<Scalar> &inArgs,
136
const
Thyra::ModelEvaluatorBase::OutArgs<Scalar> &outArgs)
const
;
137
139
147
void
setOneTimeDirichletBeta
(
double
beta,
const
Thyra::ModelEvaluator<Scalar>
& me)
const
;
148
150
bool
constantMassMatrix_
;
151
153
bool
massLumping_
;
154
156
Teuchos::RCP<const panzer::ModelEvaluator<Scalar> >
panzerModel_
;
157
158
#ifdef PANZER_HAVE_EPETRA_STACK
160
Teuchos::RCP<const panzer::ModelEvaluator_Epetra> panzerEpetraModel_;
161
#endif
162
163
mutable
Teuchos::RCP<Thyra::LinearOpBase<Scalar> >
mass_
;
164
mutable
Teuchos::RCP<const Thyra::LinearOpBase<Scalar> >
invMassMatrix_
;
165
mutable
Teuchos::RCP<Thyra::VectorBase<Scalar> >
scrap_f_
;
166
mutable
Teuchos::RCP<Thyra::VectorBase<Scalar> >
zero_
;
167
168
// build prototype in/out args
169
Thyra::ModelEvaluatorBase::InArgs<Scalar>
prototypeInArgs_
;
170
Thyra::ModelEvaluatorBase::OutArgs<Scalar>
prototypeOutArgs_
;
171
172
// hide the default constructor
173
ExplicitModelEvaluator
();
174
175
};
176
177
}
// end namespace panzer
178
179
#endif
Panzer_MassMatrixModelEvaluator.hpp
Panzer_ModelEvaluator.hpp
Panzer_ModelEvaluator_Epetra.hpp
Thyra::ModelEvaluator
Thyra::MultiVectorBase
Thyra::VectorBase
panzer::ExplicitModelEvaluator::panzerModel_
Teuchos::RCP< const panzer::ModelEvaluator< Scalar > > panzerModel_
Access to the panzer model evaluator pointer (thyra version).
Definition
Panzer_ExplicitModelEvaluator.hpp:156
panzer::ExplicitModelEvaluator::prototypeOutArgs_
Thyra::ModelEvaluatorBase::OutArgs< Scalar > prototypeOutArgs_
Definition
Panzer_ExplicitModelEvaluator.hpp:170
panzer::ExplicitModelEvaluator::zero_
Teuchos::RCP< Thyra::VectorBase< Scalar > > zero_
Definition
Panzer_ExplicitModelEvaluator.hpp:166
panzer::ExplicitModelEvaluator::evalModelImpl
void evalModelImpl(const Thyra::ModelEvaluatorBase::InArgs< Scalar > &inArgs, const Thyra::ModelEvaluatorBase::OutArgs< Scalar > &outArgs) const
Evaluation of model, applies the mass matrix to the RHS.
Definition
Panzer_ExplicitModelEvaluator_impl.hpp:122
panzer::ExplicitModelEvaluator::invMassMatrix_
Teuchos::RCP< const Thyra::LinearOpBase< Scalar > > invMassMatrix_
Definition
Panzer_ExplicitModelEvaluator.hpp:164
panzer::ExplicitModelEvaluator::applyDirichletBCs
void applyDirichletBCs(const Teuchos::RCP< Thyra::VectorBase< Scalar > > &x, const Teuchos::RCP< Thyra::VectorBase< Scalar > > &f) const
Definition
Panzer_ExplicitModelEvaluator.hpp:112
panzer::ExplicitModelEvaluator::setOneTimeDirichletBeta
void setOneTimeDirichletBeta(double beta, const Thyra::ModelEvaluator< Scalar > &me) const
Definition
Panzer_ExplicitModelEvaluator_impl.hpp:258
panzer::ExplicitModelEvaluator::ExplicitModelEvaluator
ExplicitModelEvaluator(const Teuchos::RCP< Thyra::ModelEvaluator< Scalar > > &model, bool constantMassMatrix, bool useLumpedMass, bool applyMassInverse=true)
Definition
Panzer_ExplicitModelEvaluator_impl.hpp:60
panzer::ExplicitModelEvaluator::ExplicitModelEvaluator
ExplicitModelEvaluator()
panzer::ExplicitModelEvaluator::mass_
Teuchos::RCP< Thyra::LinearOpBase< Scalar > > mass_
Definition
Panzer_ExplicitModelEvaluator.hpp:163
panzer::ExplicitModelEvaluator::getNominalValues
Thyra::ModelEvaluatorBase::InArgs< Scalar > getNominalValues() const
Build the nominal values, modifies the underlying models in args slightly.
Definition
Panzer_ExplicitModelEvaluator_impl.hpp:89
panzer::ExplicitModelEvaluator::buildInverseMassMatrix
void buildInverseMassMatrix(const Thyra::ModelEvaluatorBase::InArgs< Scalar > &inArgs) const
Definition
Panzer_ExplicitModelEvaluator_impl.hpp:169
panzer::ExplicitModelEvaluator::scrap_f_
Teuchos::RCP< Thyra::VectorBase< Scalar > > scrap_f_
Definition
Panzer_ExplicitModelEvaluator.hpp:165
panzer::ExplicitModelEvaluator::prototypeInArgs_
Thyra::ModelEvaluatorBase::InArgs< Scalar > prototypeInArgs_
Definition
Panzer_ExplicitModelEvaluator.hpp:169
panzer::ExplicitModelEvaluator::applyInverseMassMatrix
virtual void applyInverseMassMatrix(const Teuchos::RCP< Thyra::MultiVectorBase< Scalar > > input, const Teuchos::RCP< Thyra::MultiVectorBase< Scalar > > output) const
Definition
Panzer_ExplicitModelEvaluator.hpp:97
panzer::ExplicitModelEvaluator::applyMassMatrix
virtual void applyMassMatrix(const Teuchos::RCP< Thyra::MultiVectorBase< Scalar > > input, const Teuchos::RCP< Thyra::MultiVectorBase< Scalar > > output) const
Definition
Panzer_ExplicitModelEvaluator.hpp:102
panzer::ExplicitModelEvaluator::createOutArgs
Thyra::ModelEvaluatorBase::OutArgs< Scalar > createOutArgs() const
Build the out args, modifies the underlying models in args slightly.
Definition
Panzer_ExplicitModelEvaluator_impl.hpp:108
panzer::ExplicitModelEvaluator::getPanzerUnderlyingModel
Teuchos::RCP< panzer::ModelEvaluator< Scalar > > getPanzerUnderlyingModel()
Get the underlying panzer::ModelEvaluator.
Definition
Panzer_ExplicitModelEvaluator_impl.hpp:115
panzer::ExplicitModelEvaluator::constantMassMatrix_
bool constantMassMatrix_
Is the mass matrix constant.
Definition
Panzer_ExplicitModelEvaluator.hpp:150
panzer::ExplicitModelEvaluator::massLumping_
bool massLumping_
Use mass lumping, or a full solve.
Definition
Panzer_ExplicitModelEvaluator.hpp:153
panzer::ExplicitModelEvaluator::buildArgsPrototypes
void buildArgsPrototypes()
Build prototype in/out args.
Definition
Panzer_ExplicitModelEvaluator_impl.hpp:238
panzer::ExplicitModelEvaluator::createInArgs
Thyra::ModelEvaluatorBase::InArgs< Scalar > createInArgs() const
Build the in args, modifies the underlying models in args slightly.
Definition
Panzer_ExplicitModelEvaluator_impl.hpp:101
panzer::MassMatrixModelEvaluator
Definition
Panzer_MassMatrixModelEvaluator.hpp:74
panzer
Computes .
Definition
Panzer_BasisValues_Evaluator_decl.hpp:54
Generated by
1.17.0