Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_Constant_impl.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Panzer: A partial differential equation assembly
4 // engine for strongly coupled complex multiphysics systems
5 //
6 // Copyright 2011 NTESS and the Panzer contributors.
7 // SPDX-License-Identifier: BSD-3-Clause
8 // *****************************************************************************
9 // @HEADER
10 
11 #ifndef PANZER_CONSTANT_IMPL_HPP
12 #define PANZER_CONSTANT_IMPL_HPP
13 
14 namespace panzer {
15 
16 //**********************************************************************
17 template<typename EvalT, typename Traits>
20  const Teuchos::ParameterList& p) :
21  value( p.get<double>("Value") ),
22  constant( p.get<std::string>("Name"),
23  p.get< Teuchos::RCP<PHX::DataLayout> >("Data Layout") )
24 {
25  this->addEvaluatedField(constant);
26 
27  // Make this unshared so that it is not overwritten
28  this->addUnsharedField(constant.fieldTag().clone());
29 
30  std::string n = "Constant: " + constant.fieldTag().name();
31  this->setName(n);
32 }
33 
34 //**********************************************************************
35 template<typename EvalT, typename Traits>
36 void
39  typename Traits::SetupData /* worksets */,
41 {
42  using namespace PHX;
43  this->utils.setFieldData(constant,fm);
44 
45  constant.deep_copy(value);
46 }
47 
48 //**********************************************************************
49 template<typename EvalT, typename Traits>
50 void
53  typename Traits::EvalData /* d */)
54 {}
55 
56 //**********************************************************************
57 
58 }
59 
60 #endif
Constant(const Teuchos::ParameterList &p)
PHX::MDField< ScalarT > constant
void evaluateFields(typename Traits::EvalData d)
void postRegistrationSetup(typename Traits::SetupData d, PHX::FieldManager< Traits > &fm)