Debian Codegraph @

packages/seacas/applications/nas2exo/N2EExoWriter.h

raw
1 /*
2 * N2EExoWriter.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, OCT-2022
8 */
9 #pragma once
10
11 #include "N2EDataTypes.h"
12 #include <string>
13 #include <vector>
14
15 using namespace N2EModules;
16
17 namespace N2ETestingSpace {
18 class ExoWriterTester;
19 }
20
21 namespace ExoModules {
22
23 class N2EExoWriter
24 {
25
26 public:
27 N2EExoWriter() = default;
28 virtual ~N2EExoWriter();
29
30 bool createDB(const std::string &name);
31 bool setNodes(const std::vector<gridType> &gridpts);
32 bool setElements(const std::vector<elementType> &elist);
33 bool setSections(const std::vector<sectionType> &sList);
34
35 bool writeFile();
36
37 void setModelTitle(const std::string &title);
38
39 inline size_t getBlocksOut() { return this->writtenBlocks; };
40 inline size_t getNodesOut() { return this->writtenNodes; };
41 inline size_t getTetsOut() { return this->writtenTets; };
42 inline size_t getHexesOut() { return this->writtenHexes; };
43
44 protected:
45 std::vector<sectionType> sections{};
46 std::vector<gridType> gridList{};
47 std::vector<elementType> elementList{};
48
49 std::string modelTitle{};
50
51 int exoFileID{0};
52
53 int CPU_ws = sizeof(double);
54 int IO_ws = sizeof(double);
55
56 // Data persisteance functions
57 bool writeCoords();
58 bool writeFileParams();
59 bool writeElements();
60
61 size_t writtenBlocks{0};
62 size_t writtenNodes{0};
63 size_t writtenTets{0};
64 size_t writtenHexes{0};
65 // A Friend for testing
66 friend class N2ETestingSpace::ExoWriterTester;
67 };
68
69 } // namespace ExoModules