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