Nalu
Nalu: a generalized unstructured massively parallel low Mach flow code designed to support a variety of energy applications of interest (most notably Wind ECP) built on the Sierra Toolkit and Trilinos solver Tpetra/Epetra stack. The open source BSD, clause 3 license model has been chosen for the code base. See LICENSE for more information. http://NaluCFD.org
AlgTraits.h
Go to the documentation of this file.
1 /*------------------------------------------------------------------------*/
2 /* Copyright 2014 Sandia Corporation. */
3 /* This software is released under the license detailed */
4 /* in the file, LICENSE, which is located in the top-level Nalu */
5 /* directory structure */
6 /*------------------------------------------------------------------------*/
7 
8 
9 #ifndef AlgTraits_h
10 #define AlgTraits_h
11 
12 #include <stk_topology/topology.hpp>
13 
14 namespace sierra {
15 namespace nalu {
16 
17 // limited supported now (P=1 3D elements)
18 struct AlgTraitsHex8 {
19  static constexpr int nDim_ = 3;
20  static constexpr int nodesPerElement_ = 8;
21  static constexpr int numScsIp_ = 12;
22  static constexpr int numScvIp_ = 8;
23  static constexpr int numGp_ = 8; // for FEM
24  static constexpr stk::topology::topology_t topo_ = stk::topology::HEX_8;
25 };
26 
28  static constexpr int nDim_ = 3;
29  static constexpr int nodesPerElement_ = 27;
30  static constexpr int numScsIp_ = 216;
31  static constexpr int numScvIp_ = 216;
32  static constexpr int numGp_ = 27; // for FEM (not supported)
33  static constexpr stk::topology::topology_t topo_ = stk::topology::HEX_27;
34 };
35 
36 struct AlgTraitsTet4 {
37  static constexpr int nDim_ = 3;
38  static constexpr int nodesPerElement_ = 4;
39  static constexpr int numScsIp_ = 6;
40  static constexpr int numScvIp_ = 4;
41  static constexpr int numGp_ = 4; // for FEM (not supported)
42  static constexpr stk::topology::topology_t topo_ = stk::topology::TET_4;
43 };
44 
45 struct AlgTraitsPyr5 {
46  static constexpr int nDim_ = 3;
47  static constexpr int nodesPerElement_ = 5;
48  static constexpr int numScsIp_ = 8;
49  static constexpr int numScvIp_ = 5;
50  static constexpr int numGp_ = 5; // for FEM (not supported)
51  static constexpr stk::topology::topology_t topo_ = stk::topology::PYRAMID_5;
52 };
53 
54 struct AlgTraitsWed6 {
55  static constexpr int nDim_ = 3;
56  static constexpr int nodesPerElement_ = 6;
57  static constexpr int numScsIp_ = 9;
58  static constexpr int numScvIp_ = 6;
59  static constexpr int numGp_ = 6; // for FEM (not supported)
60  static constexpr stk::topology::topology_t topo_ = stk::topology::WEDGE_6;
61 };
62 
64  static constexpr int nDim_ = 2;
65  static constexpr int nodesPerElement_ = 4;
66  static constexpr int numScsIp_ = 4;
67  static constexpr int numScvIp_ = 4;
68  static constexpr int numGp_ = 4; // for FEM (not supported)
69  static constexpr stk::topology::topology_t topo_ = stk::topology::QUAD_4_2D;
70 };
71 
73  static constexpr int nDim_ = 2;
74  static constexpr int nodesPerElement_ = 9;
75  static constexpr int numScsIp_ = 24;
76  static constexpr int numScvIp_ = 36;
77  static constexpr int numGp_ = 9; // for FEM (not supported)
78  static constexpr stk::topology::topology_t topo_ = stk::topology::QUAD_9_2D;
79 };
80 
82  static constexpr int nDim_ = 2;
83  static constexpr int nodesPerElement_ = 3;
84  static constexpr int numScsIp_ = 3;
85  static constexpr int numScvIp_ = 3;
86  static constexpr int numGp_ = 3; // for FEM (not supported)
87  static constexpr stk::topology::topology_t topo_ = stk::topology::TRI_3_2D;
88 };
89 
90 template <int p> constexpr int nGL() { return (p % 2 == 0) ? p / 2 + 1 : (p + 1) / 2; }
91 
92 template <int p>
94  static constexpr int nDim_ = 3;
95  static constexpr int nodesPerElement_ = (p+1) * (p+1);
96  static constexpr int numScsIp_ = 2 * p * (p + 1) * nGL<p>();
97  static constexpr int numScvIp_ = nodesPerElement_ * nGL<p>() * nGL<p>();
98  static constexpr int numGp_ = nodesPerElement_; // for FEM (not supported)
99 
100  static constexpr stk::topology::topology_t topo_ = static_cast<stk::topology::topology_t>(
101  nodesPerElement_ + stk::topology::SUPERELEMENT_START
102  );
103  static constexpr stk::topology::topology_t baseTopo_ = stk::topology::QUAD_4_2D;
104 };
105 
106 template <int p>
108  static constexpr int nDim_ = 3;
109  static constexpr int nodesPerElement_ = (p+1)*(p+1)*(p+1);
110  static constexpr int numScsIp_ = 3 * p * (p+1) * (p+1) * nGL<p>() * nGL<p>();
111  static constexpr int numScvIp_ = nodesPerElement_ * nGL<p>() * nGL<p>() * nGL<p>();
112  static constexpr int numGp_ = nodesPerElement_; // for FEM (not supported)
113 
114  static constexpr stk::topology::topology_t topo_ = static_cast<stk::topology::topology_t>(
115  nodesPerElement_ + stk::topology::SUPERELEMENT_START
116  );
117  static constexpr stk::topology::topology_t baseTopo_ = stk::topology::HEX_8;
118 };
119 
120 
121 
122 } // namespace nalu
123 } // namespace Sierra
124 
125 #endif
Definition: AlgTraits.h:36
Definition: AlgTraits.h:81
Definition: ABLForcingAlgorithm.C:26
static constexpr int numScsIp_
Definition: AlgTraits.h:21
Definition: AlgTraits.h:93
Definition: AlgTraits.h:45
Definition: AlgTraits.h:27
static constexpr int nDim_
Definition: AlgTraits.h:19
Definition: AlgTraits.h:54
Definition: AlgTraits.h:63
static constexpr int nodesPerElement_
Definition: AlgTraits.h:20
static constexpr int numGp_
Definition: AlgTraits.h:23
Definition: AlgTraits.h:107
static constexpr int numScvIp_
Definition: AlgTraits.h:22
Definition: AlgTraits.h:72
constexpr int nGL()
Definition: AlgTraits.h:90
Definition: AlgTraits.h:18
static constexpr stk::topology::topology_t topo_
Definition: AlgTraits.h:24