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 
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 
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 
144 {
145  if (debug)
146  {
147  Pout<< "primitiveMesh::clearCellGeom() : "
148  << "clearing cell centres and volumes"
149  << endl;
150  }
151 
152  deleteDemandDrivenData(cellCentresPtr_);
153  deleteDemandDrivenData(cellVolumesPtr_);
154 }
155 
156 
158 {
159  if (debug)
160  {
161  Pout<< "primitiveMesh::clearAddressing() : "
162  << "clearing topology"
163  << endl;
164  }
165 
166  deleteDemandDrivenData(cellShapesPtr_);
167 
168  clearOutEdges();
169 
170  deleteDemandDrivenData(ccPtr_);
171  deleteDemandDrivenData(ecPtr_);
172  deleteDemandDrivenData(pcPtr_);
173 
174  deleteDemandDrivenData(cfPtr_);
175  deleteDemandDrivenData(efPtr_);
176  deleteDemandDrivenData(pfPtr_);
177 
178  deleteDemandDrivenData(cePtr_);
179  deleteDemandDrivenData(fePtr_);
180  deleteDemandDrivenData(pePtr_);
181  deleteDemandDrivenData(ppPtr_);
182  deleteDemandDrivenData(cpPtr_);
183 }
184 
185 
187 {
188  clearGeom();
189  clearAddressing();
190 }
191 
192 
193 // ************************************************************************* //
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:157
demandDrivenData.H
Template functions to aid in the implementation of demand driven data.
Foam::primitiveMesh::clearCellGeom
void clearCellGeom()
Clear cell-based geometry only.
Definition: primitiveMeshClear.C:143
primitiveMesh.H
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:369
Foam::Pout
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
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:186