Debian Codegraph @

packages/seacas/applications/nas2exo/N2EDataTypes.h

raw
1 /*
2 * N2EDatatTypes.h
3 *
4 * Created on: Oct 10, 2020
5 * Author: Ramon J. Moral(Contractor, STRA LLC)
6 * John Niederhouse(ORG 1443, SNL, Coordinator)
7 * Copyright: Sandia National Labs, 2020, 2021, 2022, 2023
8 */
9 #pragma once
10
11 #include <cstring>
12 #include <exodusII.h>
13 #include <string>
14 #include <tuple>
15
16 namespace N2EModules {
17
18 const std::string N2EFileCues[5]{"UNSP", "GRID", "CTETRA", "CHEXA", "PSOLID"};
19 // These are the supported element types for this
20 // application.
21
22 struct supportedElements
23 {
24
25 ex_entity_type elementType{};
26 char elemDesc[MAX_STR_LENGTH]{'\0'};
27 int64_t numNodesPerElem{};
28 int64_t numEdgesPerElem{};
29 int64_t numFacesPerElem{};
30 int64_t numAttrPerElem{};
31
32 supportedElements(ex_entity_type elType, const std::string &elDesc, int64_t nodesPer,
33 int64_t edgesPer, int64_t facesPer, int64_t attrPer)
34 {
35
36 elementType = elType;
37 strncpy(elemDesc, elDesc.c_str(), MAX_STR_LENGTH - 1);
38 elemDesc[MAX_STR_LENGTH - 1] = '\0';
39 numNodesPerElem = nodesPer;
40 numEdgesPerElem = edgesPer;
41 numFacesPerElem = facesPer;
42 numAttrPerElem = attrPer;
43 }
44 };
45
46 const supportedElements ExoElTypes[] = {
47 supportedElements(ex_entity_type::EX_ELEM_BLOCK, std::string("TET4"), 4, 6, 4, 1),
48 supportedElements(ex_entity_type::EX_ELEM_BLOCK, std::string("HEX8"), 8, 12, 6, 1)};
49
50 struct N2EPoint3D
51 {
52 double x[3];
53 };
54 struct N2EGridPtList
55 {
56 int v[8];
57 };
58 using sectionType = std::tuple<unsigned /*propID*/, unsigned /*MATID*/>;
59 using gridType = std::tuple<unsigned /*GRIDID*/, N2EPoint3D>;
60 using elementType = std::tuple<unsigned /*ID*/, unsigned /*propId*/, unsigned /*numNodes*/,
61 N2EGridPtList /*nodes*/>;
62
63 } // namespace N2EModules