Loading...
Searching...
No Matches
primitiveMeshClear.C
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011 OpenFOAM Foundation
9 Copyright (C) 2024 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
27\*---------------------------------------------------------------------------*/
28
29#include "primitiveMesh.H"
30
31// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
32
34{
35 Pout<< "primitiveMesh allocated :" << endl;
36
37 // Topology
38 if (cellShapesPtr_)
39 {
40 Pout<< " Cell shapes" << endl;
41 }
42
43 if (edgesPtr_)
44 {
45 Pout<< " Edges" << endl;
46 }
47
48 if (ccPtr_)
49 {
50 Pout<< " Cell-cells" << endl;
51 }
52
53 if (ecPtr_)
54 {
55 Pout<< " Edge-cells" << endl;
56 }
57
58 if (pcPtr_)
59 {
60 Pout<< " Point-cells" << endl;
61 }
62
63 if (cfPtr_)
64 {
65 Pout<< " Cell-faces" << endl;
66 }
67
68 if (efPtr_)
69 {
70 Pout<< " Edge-faces" << endl;
71 }
72
73 if (pfPtr_)
74 {
75 Pout<< " Point-faces" << endl;
76 }
77
78 if (cePtr_)
79 {
80 Pout<< " Cell-edges" << endl;
81 }
82
83 if (fePtr_)
84 {
85 Pout<< " Face-edges" << endl;
86 }
87
88 if (pePtr_)
89 {
90 Pout<< " Point-edges" << endl;
91 }
92
93 if (ppPtr_)
94 {
95 Pout<< " Point-point" << endl;
96 }
97
98 if (cpPtr_)
99 {
100 Pout<< " Cell-point" << endl;
101 }
102
103 // Geometry
104 if (cellCentresPtr_)
105 {
106 Pout<< " Cell-centres" << endl;
107 }
108
109 if (cellVolumesPtr_)
110 {
111 Pout<< " Cell-volumes" << endl;
112 }
113
114 if (faceCentresPtr_)
115 {
116 Pout<< " Face-centres" << endl;
117 }
118
119 if (faceAreasPtr_)
120 {
121 Pout<< " Face-areas" << endl;
122 }
123}
124
125
127{
128 if (debug)
129 {
130 Pout<< "primitiveMesh::clearGeom() : "
131 << "clearing geometric data"
132 << endl;
133 }
134
135 cellCentresPtr_.reset(nullptr);
136 cellVolumesPtr_.reset(nullptr);
137 faceCentresPtr_.reset(nullptr);
138 faceAreasPtr_.reset(nullptr);
139}
140
141
143{
144 if (debug)
145 {
146 Pout<< "primitiveMesh::clearCellGeom() : "
147 << "clearing cell centres and volumes"
148 << endl;
150
151 cellCentresPtr_.reset(nullptr);
152 cellVolumesPtr_.reset(nullptr);
153}
154
155
157{
158 if (debug)
159 {
160 Pout<< "primitiveMesh::clearAddressing() : "
161 << "clearing topology"
162 << endl;
163 }
164
165 cellShapesPtr_.reset(nullptr);
166
167 clearOutEdges();
168
169 ccPtr_.reset(nullptr);
170 ecPtr_.reset(nullptr);
171 pcPtr_.reset(nullptr);
172
173 cfPtr_.reset(nullptr);
174 efPtr_.reset(nullptr);
175 pfPtr_.reset(nullptr);
176
177 cePtr_.reset(nullptr);
178 fePtr_.reset(nullptr);
179 pePtr_.reset(nullptr);
180 ppPtr_.reset(nullptr);
181 cpPtr_.reset(nullptr);
182}
183
184
186{
187 clearGeom();
188 clearAddressing();
189}
190
191
192// ************************************************************************* //
void clearGeom()
Clear geometry.
void clearAddressing()
Clear topological data.
void clearCellGeom()
Clear cell-based geometry only.
void printAllocated() const
Print a list of all the currently allocated mesh data.
void clearOut()
Clear all geometry and addressing unnecessary for CFD.
Namespace for handling debugging switches.
Definition debug.C:45
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition Ostream.H:519
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.