Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_Traits.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_TRAITS_HPP
12 #define PANZER_TRAITS_HPP
13 
14 #include "PanzerDiscFE_config.hpp"
15 
16 // Teuchos includes
17 #include "Teuchos_RCP.hpp"
18 
19 // mpl (Meta Programming Library) templates
20 #include "Sacado_mpl_vector.hpp"
21 #include "Sacado_mpl_find.hpp"
22 
23 // Scalar types
24 #include "Sacado.hpp"
25 //#include "Sacado_CacheFad_DFad.hpp"
26 //#include "Sacado_ELRFad_DFad.hpp"
27 //#include "Sacado_ELRCacheFad_DFad.hpp"
28 
29 #include "Phalanx_Traits.hpp"
30 
31 // Include User Data Types
32 //#include "Phalanx_Allocator_Contiguous.hpp"
33 #include "Panzer_Workset.hpp"
34 //#include "Panzer_GlobalEvaluationDataContainer.hpp"
35 
36 // Debugging information
37 //#include "Phalanx_Print.hpp"
38 
39 // forward declaration
40 namespace Intrepid2 {
41 class Orientation;
42 }
43 
44 namespace panzer {
45 
46  class GlobalEvaluationDataContainer;
47 
48  struct Traits {
49 
50  // ******************************************************************
51  // *** Scalar Types
52  // ******************************************************************
53 
54  // Scalar types we plan to use
55  typedef double RealType;
56  // typedef Sacado::Fad::DFad<double> FadType;
57  // typedef Sacado::CacheFad::DFad<double> FadType;
58  // typedef Sacado::ELRFad::DFad<double> FadType;
59  // typedef Sacado::ELRCacheFad::DFad<double> FadType;
60  // typedef Sacado::Fad::SLFad<double,8> FadType;
61  typedef PANZER_FADTYPE FadType;
62 
63 #ifdef Panzer_BUILD_HESSIAN_SUPPORT
64  // typedef Sacado::Fad::SFad<FadType,1> HessianType;
65  typedef Sacado::Fad::DFad<Sacado::Fad::SFad<RealType,1> > HessianType;
66 #endif
67 
68  // ******************************************************************
69  // *** Evaluation Types
70  // ******************************************************************
71  struct Residual { typedef RealType ScalarT; };
72  struct Jacobian { typedef FadType ScalarT; };
73  struct Tangent { typedef FadType ScalarT; };
74 
75 #ifdef Panzer_BUILD_HESSIAN_SUPPORT
76  struct Hessian { typedef HessianType ScalarT; };
77 #endif
78 
79  typedef Sacado::mpl::vector< Residual
80  , Jacobian
81  , Tangent
82 #ifdef Panzer_BUILD_HESSIAN_SUPPORT
83  , Hessian
84 #endif
86 
87  // ******************************************************************
88  // *** User Defined Object Passed in for Evaluation Method
89  // ******************************************************************
90 
91  struct SD {
94  };
95  using SetupData = const SD&;
96 
97  using EvalData = const panzer::Workset&;
98 
99  struct PED {
100  PED();
104  };
105  using PreEvalData = const PED&;
106 
107  typedef void* PostEvalData;
108 
109  };
110 
111 }
112 
113 namespace PHX {
114 
115  template<>
116  struct eval_scalar_types<panzer::Traits::Residual>
117  { typedef Sacado::mpl::vector<panzer::Traits::RealType,bool> type; };
118 
119  template<>
120  struct eval_scalar_types<panzer::Traits::Jacobian>
121  { typedef Sacado::mpl::vector<panzer::Traits::FadType,panzer::Traits::RealType,bool> type; };
122 
123  template<>
124  struct eval_scalar_types<panzer::Traits::Tangent>
125  { typedef Sacado::mpl::vector<panzer::Traits::FadType,panzer::Traits::RealType,bool> type; };
126 
127 #ifdef Panzer_BUILD_HESSIAN_SUPPORT
128  template<>
129  struct eval_scalar_types<panzer::Traits::Hessian>
130  { typedef Sacado::mpl::vector<panzer::Traits::HessianType,bool> type; };
131 #endif
132 
133 }
134 
135 #endif
Teuchos::RCP< GlobalEvaluationDataContainer > gedc
Sacado::mpl::vector< panzer::Traits::FadType, panzer::Traits::RealType, bool > type
Teuchos::RCP< const std::vector< Intrepid2::Orientation > > orientations_
Sacado::mpl::vector< panzer::Traits::FadType, panzer::Traits::RealType, bool > type
std::string second_sensitivities_name
std::string first_sensitivities_name
PANZER_FADTYPE FadType
Sacado::mpl::vector< Residual, Jacobian, Tangent, Hessian > EvalTypes
Sacado::mpl::vector< panzer::Traits::RealType, bool > type
Sacado::Fad::DFad< Sacado::Fad::SFad< RealType, 1 > > HessianType
Sacado::mpl::vector< panzer::Traits::HessianType, bool > type
Teuchos::RCP< const std::vector< panzer::Workset > > worksets_