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
ElementDescription.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 #ifndef ElementDescription_h
9 #define ElementDescription_h
10 
11 #include <stddef.h>
12 #include <map>
13 #include <memory>
14 #include <vector>
15 
16 #include <stk_topology/topology.hpp>
17 
18 
19 
20 namespace sierra {
21 namespace nalu {
22 
23  int poly_order_from_super_topology(int dimension, stk::topology superTopo);
24 
25  using ordinal_type = int;
26 
28 {
37  using AddedConnectivityOrdinalMap = std::map<ordinal_type, std::vector<ordinal_type>>;
38  using AddedNodeLocationsMap = std::map<ordinal_type, std::vector<double>> ;
39  using SubElementConnectivity = std::vector<std::vector<ordinal_type>> ;
40 public:
41  static std::unique_ptr<ElementDescription> create(int dimension, int order);
42  static std::unique_ptr<ElementDescription> create(int dimension, stk::topology topo);
43 
44  virtual ~ElementDescription();
45 
46  ordinal_type node_map(ordinal_type i, ordinal_type j) const { return nodeMap.at(i+nodes1D*j); };
48  ordinal_type node_map_bc(ordinal_type j) const { return nodeMapBC.at(j); };
50 
51  const ordinal_type* side_node_ordinals(ordinal_type sideOrdinal) const {
52  return sideOrdinalMap.at(sideOrdinal).data();
53  };
54 
55  std::vector<double> nodeLocs1D;
56 
57  stk::topology baseTopo;
58 
59  int polyOrder;
60  int dimension;
61  int nodes1D;
64  int numEdges;
65  int numFaces;
72 
79 
80  std::vector<ordinal_type> baseNodeOrdinals;
81  std::vector<ordinal_type> promotedNodeOrdinals;
82  std::vector<ordinal_type> nodeMap;
83  std::vector<ordinal_type> nodeMapBC;
84 
85  std::vector<std::vector<ordinal_type>> baseEdgeConnectivity;
86  std::vector<std::vector<ordinal_type>> baseFaceConnectivity;
87  std::vector<std::vector<ordinal_type>> baseFaceEdgeConnectivity;
88 
89  std::vector<std::vector<ordinal_type>> inverseNodeMap;
90  std::vector<std::vector<ordinal_type>> inverseNodeMapBC;
91  std::vector<std::vector<ordinal_type>> faceNodeMap;
92  std::vector<std::vector<ordinal_type>> sideOrdinalMap;
93 protected:
95 };
96 
97 } // namespace nalu
98 } // namespace Sierra
99 
100 #endif
std::vector< std::vector< ordinal_type > > faceNodeMap
Definition: ElementDescription.h:91
Definition: ElementDescription.h:27
AddedNodeLocationsMap nodeLocs
Definition: ElementDescription.h:77
AddedConnectivityOrdinalMap edgeNodeConnectivities
Definition: ElementDescription.h:74
std::vector< std::vector< ordinal_type > > baseFaceEdgeConnectivity
Definition: ElementDescription.h:87
int nodesInBaseElement
Definition: ElementDescription.h:67
Definition: ABLForcingAlgorithm.C:26
int polyOrder
Definition: ElementDescription.h:59
AddedConnectivityOrdinalMap addedConnectivities
Definition: ElementDescription.h:73
std::vector< ordinal_type > nodeMapBC
Definition: ElementDescription.h:83
static std::unique_ptr< ElementDescription > create(int dimension, int order)
Definition: ElementDescription.C:56
int numEdges
Definition: ElementDescription.h:64
int newNodesPerFace
Definition: ElementDescription.h:70
ordinal_type node_map(ordinal_type i, ordinal_type j) const
Definition: ElementDescription.h:46
std::map< ordinal_type, std::vector< double >> AddedNodeLocationsMap
Definition: ElementDescription.h:38
int nodes1D
Definition: ElementDescription.h:61
ordinal_type node_map_bc(ordinal_type i, ordinal_type j) const
Definition: ElementDescription.h:49
int nodesPerSubElement
Definition: ElementDescription.h:68
std::vector< std::vector< ordinal_type > > inverseNodeMapBC
Definition: ElementDescription.h:90
stk::topology baseTopo
Definition: ElementDescription.h:57
std::vector< ordinal_type > baseNodeOrdinals
Definition: ElementDescription.h:80
std::map< ordinal_type, std::vector< ordinal_type >> AddedConnectivityOrdinalMap
We implement the high order method using the "super topology" concept in STK.
Definition: ElementDescription.h:37
const ordinal_type * side_node_ordinals(ordinal_type sideOrdinal) const
Definition: ElementDescription.h:51
std::vector< ordinal_type > nodeMap
Definition: ElementDescription.h:82
std::vector< std::vector< ordinal_type > > inverseNodeMap
Definition: ElementDescription.h:89
std::vector< std::vector< ordinal_type >> SubElementConnectivity
Definition: ElementDescription.h:39
int dimension
Definition: ElementDescription.h:60
std::vector< std::vector< ordinal_type > > sideOrdinalMap
Definition: ElementDescription.h:92
SubElementConnectivity subElementConnectivity
Definition: ElementDescription.h:78
int newNodesPerEdge
Definition: ElementDescription.h:69
ordinal_type node_map(ordinal_type i, ordinal_type j, ordinal_type k) const
Definition: ElementDescription.h:47
int nodesPerElement
Definition: ElementDescription.h:62
int nodesPerSide
Definition: ElementDescription.h:63
std::vector< std::vector< ordinal_type > > baseEdgeConnectivity
Definition: ElementDescription.h:85
std::vector< std::vector< ordinal_type > > baseFaceConnectivity
Definition: ElementDescription.h:86
AddedConnectivityOrdinalMap volumeNodeConnectivities
Definition: ElementDescription.h:76
int poly_order_from_super_topology(int dimension, stk::topology superTopo)
Definition: ElementDescription.C:20
ordinal_type node_map_bc(ordinal_type j) const
Definition: ElementDescription.h:48
std::vector< ordinal_type > promotedNodeOrdinals
Definition: ElementDescription.h:81
AddedConnectivityOrdinalMap faceNodeConnectivities
Definition: ElementDescription.h:75
int numFaces
Definition: ElementDescription.h:65
int newNodesPerVolume
Definition: ElementDescription.h:71
int numBoundaries
Definition: ElementDescription.h:66
std::vector< double > nodeLocs1D
Definition: ElementDescription.h:53
int ordinal_type
Definition: ElementDescription.h:25