BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
cl_Mesh_ExodusWriter.hpp
Go to the documentation of this file.
1/*
2 * BELFEM -- The Berkeley Lab Finite Element Framework
3 * Copyright (c) 2026, The Regents of the University of California,
4 * through Lawrence Berkeley National Laboratory (subject to receipt of any required
5 * approvals from the U.S. Dept. of Energy). All rights reserved.
6 *
7 * Developers: Christian Messe, Gregory Giard
8 *
9 * See the top-level LICENSE file for the complete license and disclaimer.
10 */
11
12#ifndef BELFEM_CL_MESH_EXODUSWRITER_HPP
13#define BELFEM_CL_MESH_EXODUSWRITER_HPP
14
15#include "typedefs.hpp"
16#include "cl_Cell.hpp"
17#include "cl_Mesh.hpp"
18#include "cl_Progressbar.hpp"
19
20namespace belfem
21{
22 namespace mesh
23 {
25 {
26#ifdef BELFEM_EXODUS
27 // pointer to mesh
28 Mesh * mMesh;
29
30 // path to file
31 string mPath;
32
33 // handler to file
34 int mHandle = -1;
35
36 // error handle
37 int mError = 0;
38
39 int mCpuWordSize;
40
41 int mIoWordSize;
42
43 int64_t mNumDim = 0;
44 int64_t mNumNodes = 0;
45 int64_t mNumElements = 0;
46
47 int64_t mNumBlocks = 0;
48 int64_t mNumSideSets = 0;
49 int64_t mNumNodeSets = 0;
50
51 int mTimeStep = 1;
52 double mTimeValue = 0.0;
53
57 Cell< Block * > mBlocks ;
58
59#endif
60
61//------------------------------------------------------------------------------
62 public:
63//------------------------------------------------------------------------------
64
65 ExodusWriter( Mesh * aMesh );
66
67//------------------------------------------------------------------------------
68
69 ~ExodusWriter() = default;
70
71//------------------------------------------------------------------------------
72
73 void
74 save( const string & aPath );
75
76//------------------------------------------------------------------------------
77 private:
78//------------------------------------------------------------------------------
79
80 void
81 check( const string & aRoutine );
82
83//------------------------------------------------------------------------------
84 void
85 close_file();
86
87//------------------------------------------------------------------------------
88
89 void
90 collect_blocks();
91
92//------------------------------------------------------------------------------
93
94 void
95 populate_header();
96
97//------------------------------------------------------------------------------
98
99 void
100 populate_node_coords();
101
102//------------------------------------------------------------------------------
103
104 void
105 populate_element_ids();
106
107//------------------------------------------------------------------------------
108
109 void
110 populate_blocks( Progressbar * aProgressbar );
111
112//------------------------------------------------------------------------------
113
114 string
115 element_string_from_type( const ElementType & aType );
116
117//------------------------------------------------------------------------------
118
119 void
120 populate_element_connectivity();
121
122//------------------------------------------------------------------------------
123
124 void
125 populate_sidesets( Progressbar * aProgressbar );
126
127//------------------------------------------------------------------------------
128
129 void
130 populate_time();
131
132//------------------------------------------------------------------------------
133
134 void
135 populate_global_variables();
136
137//------------------------------------------------------------------------------
138
139 void
140 populate_fields();
141
142//------------------------------------------------------------------------------
143
144 void
145 populate_node_fields( Cell< mesh::Field * > & aFields );
146
147//------------------------------------------------------------------------------
148
149 void
150 populate_element_fields( Cell< mesh::Field * > & aFields );
151
152//------------------------------------------------------------------------------
153
157 int
158 fix_num_nodes( const ElementType & aType );
159
160//------------------------------------------------------------------------------
161 };
162 }
163}
164#endif //BELFEM_CL_MESH_EXODUSWRITER_HPP
Cell is a wrapper around the standard vector.
Definition cl_Cell.hpp:42
Top-level container for all mesh entities.
Definition cl_Mesh.hpp:60
Progress display for long-running loops.
Definition cl_Progressbar.hpp:27
void save(const string &aPath)
Definition cl_Mesh_ExodusWriter.cpp:46
ExodusWriter(Mesh *aMesh)
Definition cl_Mesh_ExodusWriter.cpp:35
Definition cl_EF_EdgeFunction.hpp:17
USER GUIDES:
Definition cl_Capacitor.cpp:16
ElementType
Element types.
Definition Mesh_Enums.hpp:27