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-2018 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 }
123 
124 
126 {
127  if (debug)
128  {
129  Pout<< "primitiveMesh::clearGeom() : "
130  << "clearing geometric data"
131  << endl;
132  }
133 
134  deleteDemandDrivenData(cellCentresPtr_);
135  deleteDemandDrivenData(faceCentresPtr_);
136  deleteDemandDrivenData(cellVolumesPtr_);
137  deleteDemandDrivenData(faceAreasPtr_);
138 }
139 
140 
142 {
143  if (debug)
144  {
145  Pout<< "primitiveMesh::clearAddressing() : "
146  << "clearing topology"
147  << endl;
148  }
149 
150  deleteDemandDrivenData(cellShapesPtr_);
151 
152  clearOutEdges();
153 
154  deleteDemandDrivenData(ccPtr_);
155  deleteDemandDrivenData(ecPtr_);
156  deleteDemandDrivenData(pcPtr_);
157 
158  deleteDemandDrivenData(cfPtr_);
159  deleteDemandDrivenData(efPtr_);
160  deleteDemandDrivenData(pfPtr_);
161 
162  deleteDemandDrivenData(cePtr_);
163  deleteDemandDrivenData(fePtr_);
164  deleteDemandDrivenData(pePtr_);
165  deleteDemandDrivenData(ppPtr_);
166  deleteDemandDrivenData(cpPtr_);
167 }
168 
169 
171 {
172  clearGeom();
173  clearAddressing();
174 }
175 
176 
177 // ************************************************************************* //
void clearAddressing()
Clear topological data.
void printAllocated() const
Print a list of all the currently allocated mesh data.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:256
void clearGeom()
Clear geometry.
void clearOut()
Clear all geometry and addressing unnecessary for CFD.
Template functions to aid in the implementation of demand driven data.
prefixOSstream Pout(cout, "Pout")
Definition: IOstreams.H:53
void deleteDemandDrivenData(DataPtr &dataPtr)