OpenFOAM: API Guide
v2006
The open source CFD toolbox
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
-------------------------------------------------------------------------------
10
License
11
This file is part of OpenFOAM.
12
13
OpenFOAM is free software: you can redistribute it and/or modify it
14
under the terms of the GNU General Public License as published by
15
the Free Software Foundation, either version 3 of the License, or
16
(at your option) any later version.
17
18
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21
for more details.
22
23
You should have received a copy of the GNU General Public License
24
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26
\*---------------------------------------------------------------------------*/
27
28
#include "
primitiveMesh.H
"
29
#include "
demandDrivenData.H
"
30
31
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
32
33
void
Foam::primitiveMesh::printAllocated
()
const
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
(faceCentresPtr_)
110
{
111
Pout
<<
" Face-centres"
<<
endl
;
112
}
113
114
if
(cellVolumesPtr_)
115
{
116
Pout
<<
" Cell-volumes"
<<
endl
;
117
}
118
119
if
(faceAreasPtr_)
120
{
121
Pout
<<
" Face-areas"
<<
endl
;
122
}
123
124
}
125
126
127
void
Foam::primitiveMesh::clearGeom
()
128
{
129
if
(
debug
)
130
{
131
Pout
<<
"primitiveMesh::clearGeom() : "
132
<<
"clearing geometric data"
133
<<
endl
;
134
}
135
136
deleteDemandDrivenData
(cellCentresPtr_);
137
deleteDemandDrivenData
(faceCentresPtr_);
138
deleteDemandDrivenData
(cellVolumesPtr_);
139
deleteDemandDrivenData
(faceAreasPtr_);
140
}
141
142
143
void
Foam::primitiveMesh::clearAddressing
()
144
{
145
if
(
debug
)
146
{
147
Pout
<<
"primitiveMesh::clearAddressing() : "
148
<<
"clearing topology"
149
<<
endl
;
150
}
151
152
deleteDemandDrivenData
(cellShapesPtr_);
153
154
clearOutEdges();
155
156
deleteDemandDrivenData
(ccPtr_);
157
deleteDemandDrivenData
(ecPtr_);
158
deleteDemandDrivenData
(pcPtr_);
159
160
deleteDemandDrivenData
(cfPtr_);
161
deleteDemandDrivenData
(efPtr_);
162
deleteDemandDrivenData
(pfPtr_);
163
164
deleteDemandDrivenData
(cePtr_);
165
deleteDemandDrivenData
(fePtr_);
166
deleteDemandDrivenData
(pePtr_);
167
deleteDemandDrivenData
(ppPtr_);
168
deleteDemandDrivenData
(cpPtr_);
169
}
170
171
172
void
Foam::primitiveMesh::clearOut
()
173
{
174
clearGeom();
175
clearAddressing();
176
}
177
178
179
// ************************************************************************* //
Foam::expressions::patchExpr::debug
int debug
Static debugging option.
Foam::primitiveMesh::printAllocated
void printAllocated() const
Print a list of all the currently allocated mesh data.
Definition:
primitiveMeshClear.C:33
Foam::primitiveMesh::clearGeom
void clearGeom()
Clear geometry.
Definition:
primitiveMeshClear.C:127
Foam::primitiveMesh::clearAddressing
void clearAddressing()
Clear topological data.
Definition:
primitiveMeshClear.C:143
demandDrivenData.H
Template functions to aid in the implementation of demand driven data.
primitiveMesh.H
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition:
Ostream.H:350
Foam::Pout
prefixOSstream Pout
An Ostream wrapper for parallel output to std::cout.
Foam::deleteDemandDrivenData
void deleteDemandDrivenData(DataPtr &dataPtr)
Definition:
demandDrivenData.H:42
Foam::primitiveMesh::clearOut
void clearOut()
Clear all geometry and addressing unnecessary for CFD.
Definition:
primitiveMeshClear.C:172
src
OpenFOAM
meshes
primitiveMesh
primitiveMeshClear.C
Generated by
1.8.17
OPENFOAM® is a registered
trademark
of OpenCFD Ltd.