Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
54 
55 namespace panzer {
56 
62 template<typename Scalar>
64  : public Thyra::ModelEvaluatorDelegatorBase<Scalar>,
65  public panzer::MassMatrixModelEvaluator<Scalar> {
66 public:
67 
70 
75  bool constantMassMatrix,
76  bool useLumpedMass,
77  bool applyMassInverse=true);
78 
80 
82  Thyra::ModelEvaluatorBase::InArgs<Scalar> getNominalValues() const;
83 
85  Thyra::ModelEvaluatorBase::InArgs<Scalar> createInArgs() const;
86 
88  Thyra::ModelEvaluatorBase::OutArgs<Scalar> createOutArgs() const;
89 
92 
94  {
95  Thyra::apply(*invMassMatrix_,Thyra::NOTRANS,*input,output.ptr());
96  }
97 
99  {
100  Thyra::apply(*mass_,Thyra::NOTRANS,*input,output.ptr());
101  }
102 
103 private: // data members
104 
109  const Teuchos::RCP<Thyra::VectorBase<Scalar> > & f) const
110  {
111  if(panzerModel_!=Teuchos::null) { panzerModel_->applyDirichletBCs(x,f); return; }
112  if(panzerEpetraModel_!=Teuchos::null) { panzerEpetraModel_->applyDirichletBCs(x,f); return; }
113 
114  TEUCHOS_ASSERT(false);
115  }
116 
120  void buildInverseMassMatrix(const Thyra::ModelEvaluatorBase::InArgs<Scalar> &inArgs) const;
121 
123  void buildArgsPrototypes();
124 
127 
129  void evalModelImpl(const Thyra::ModelEvaluatorBase::InArgs<Scalar> &inArgs,
130  const Thyra::ModelEvaluatorBase::OutArgs<Scalar> &outArgs) const;
131 
133 
141  void setOneTimeDirichletBeta(double beta,const Thyra::ModelEvaluator<Scalar> & me) const;
142 
145 
148 
151 
154 
159 
160  // build prototype in/out args
161  Thyra::ModelEvaluatorBase::InArgs<Scalar> prototypeInArgs_;
162  Thyra::ModelEvaluatorBase::OutArgs<Scalar> prototypeOutArgs_;
163 
164  // hide the default constructor
166 
167 };
168 
169 } // end namespace panzer
170 
171 #endif
virtual void applyInverseMassMatrix(const Teuchos::RCP< Thyra::MultiVectorBase< Scalar > > input, const Teuchos::RCP< Thyra::MultiVectorBase< Scalar > > output) const
Thyra::ModelEvaluatorBase::OutArgs< Scalar > prototypeOutArgs_
Thyra::ModelEvaluatorBase::InArgs< Scalar > createInArgs() const
Build the in args, modifies the underlying models in args slightly.
void buildArgsPrototypes()
Build prototype in/out args.
Thyra::ModelEvaluatorBase::InArgs< Scalar > prototypeInArgs_
Teuchos::RCP< const Thyra::LinearOpBase< Scalar > > invMassMatrix_
Teuchos::RCP< Thyra::LinearOpBase< Scalar > > mass_
Teuchos::RCP< panzer::ModelEvaluator< Scalar > > getPanzerUnderlyingModel()
Get the underlying panzer::ModelEvaluator.
Teuchos::RCP< Thyra::VectorBase< Scalar > > scrap_f_
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.
Teuchos::RCP< Thyra::VectorBase< Scalar > > zero_
Thyra::ModelEvaluatorBase::InArgs< Scalar > getNominalValues() const
Build the nominal values, modifies the underlying models in args slightly.
Ptr< T > ptr() const
Teuchos::RCP< const panzer::ModelEvaluator_Epetra > panzerEpetraModel_
Access to the epetra panzer model evaluator pointer.
void setOneTimeDirichletBeta(double beta, const Thyra::ModelEvaluator< Scalar > &me) const
Teuchos::RCP< const panzer::ModelEvaluator< Scalar > > panzerModel_
Access to the panzer model evaluator pointer (thyra version)
Thyra::ModelEvaluatorBase::OutArgs< Scalar > createOutArgs() const
Build the out args, modifies the underlying models in args slightly.
bool constantMassMatrix_
Is the mass matrix constant.
void applyDirichletBCs(const Teuchos::RCP< Thyra::VectorBase< Scalar > > &x, const Teuchos::RCP< Thyra::VectorBase< Scalar > > &f) const
#define TEUCHOS_ASSERT(assertion_test)
void buildInverseMassMatrix(const Thyra::ModelEvaluatorBase::InArgs< Scalar > &inArgs) const
bool massLumping_
Use mass lumping, or a full solve.
virtual void applyMassMatrix(const Teuchos::RCP< Thyra::MultiVectorBase< Scalar > > input, const Teuchos::RCP< Thyra::MultiVectorBase< Scalar > > output) const