BELFEM
0.9.4
Berkeley Lab Finite Element Framework
Toggle main menu visibility
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
20
namespace
belfem
21
{
22
namespace
mesh
23
{
24
class
ExodusWriter
25
{
26
// outside the guard: element_string_from_type reads it in stub builds too
27
int64_t mNumDim = 0;
28
29
#ifdef BELFEM_EXODUS
30
// pointer to mesh
31
Mesh
* mMesh;
32
33
// path to file
34
string
mPath;
35
36
// handler to file
37
int
mHandle = -1;
38
39
// error handle
40
int
mError = 0;
41
42
int
mCpuWordSize;
43
44
int
mIoWordSize;
45
46
int64_t mNumNodes = 0;
47
int64_t mNumElements = 0;
48
49
int64_t mNumBlocks = 0;
50
int64_t mNumSideSets = 0;
51
int64_t mNumNodeSets = 0;
52
53
int
mTimeStep = 1;
54
double
mTimeValue = 0.0;
55
59
Cell< Block * >
mBlocks ;
60
61
#endif
62
63
//------------------------------------------------------------------------------
64
public
:
65
//------------------------------------------------------------------------------
66
67
ExodusWriter
(
Mesh
* aMesh );
68
69
//------------------------------------------------------------------------------
70
71
~ExodusWriter
() =
default
;
72
73
//------------------------------------------------------------------------------
74
75
void
76
save
(
const
string
& aPath );
77
78
//------------------------------------------------------------------------------
79
private
:
80
//------------------------------------------------------------------------------
81
82
void
83
check(
const
string
& aRoutine );
84
85
//------------------------------------------------------------------------------
86
void
87
close_file();
88
89
//------------------------------------------------------------------------------
90
91
void
92
collect_blocks();
93
94
//------------------------------------------------------------------------------
95
96
void
97
populate_header();
98
99
//------------------------------------------------------------------------------
100
101
void
102
populate_node_coords();
103
104
//------------------------------------------------------------------------------
105
106
void
107
populate_element_ids();
108
109
//------------------------------------------------------------------------------
110
111
void
112
populate_blocks(
Progressbar
* aProgressbar );
113
114
//------------------------------------------------------------------------------
115
116
string
117
element_string_from_type(
const
ElementType
& aType );
118
119
//------------------------------------------------------------------------------
120
121
void
122
populate_element_connectivity();
123
124
//------------------------------------------------------------------------------
125
126
void
127
populate_sidesets(
Progressbar
* aProgressbar );
128
129
//------------------------------------------------------------------------------
130
131
void
132
populate_time();
133
134
//------------------------------------------------------------------------------
135
136
void
137
populate_global_variables();
138
139
//------------------------------------------------------------------------------
140
141
void
142
populate_fields();
143
144
//------------------------------------------------------------------------------
145
146
void
147
populate_node_fields(
Cell< mesh::Field * >
& aFields );
148
149
//------------------------------------------------------------------------------
150
151
void
152
populate_element_fields(
Cell< mesh::Field * >
& aFields );
153
154
//------------------------------------------------------------------------------
155
159
int
160
fix_num_nodes(
const
ElementType
& aType );
161
162
//------------------------------------------------------------------------------
163
};
164
}
165
}
166
#endif
//BELFEM_CL_MESH_EXODUSWRITER_HPP
cl_Cell.hpp
cl_Mesh.hpp
cl_Progressbar.hpp
belfem::Cell
A bounds-checked wrapper around std::vector.
Definition
cl_Cell.hpp:45
belfem::Mesh
Top-level container for all mesh entities.
Definition
cl_Mesh.hpp:60
belfem::Progressbar
Progress display for long-running loops.
Definition
cl_Progressbar.hpp:27
belfem::mesh::ExodusWriter::~ExodusWriter
~ExodusWriter()=default
belfem::mesh::ExodusWriter::save
void save(const string &aPath)
Definition
cl_Mesh_ExodusWriter.cpp:45
belfem::mesh::ExodusWriter::ExodusWriter
ExodusWriter(Mesh *aMesh)
Definition
cl_Mesh_ExodusWriter.cpp:34
belfem::mesh
Definition
cl_EF_EdgeFunction.hpp:24
belfem
USER GUIDES:
Definition
cl_Capacitor.cpp:16
belfem::ElementType
ElementType
Element types.
Definition
Mesh_Enums.hpp:27
typedefs.hpp
src
mesh
cl_Mesh_ExodusWriter.hpp
Generated by
1.18.0