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 | Copyright (C) 2011 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 // ************************************************************************* //
Foam::primitiveMesh::printAllocated
void printAllocated() const
Print a list of all the currently allocated mesh data.
Definition: primitiveMeshClear.C:32
Foam::primitiveMesh::fePtr_
labelListList * fePtr_
Face-edges.
Definition: primitiveMesh.H:137
Foam::primitiveMesh::clearGeom
void clearGeom()
Clear geometry.
Definition: primitiveMeshClear.C:126
Foam::primitiveMesh::pePtr_
labelListList * pePtr_
Point-edges.
Definition: primitiveMesh.H:140
primitiveMesh.H
Foam::primitiveMesh::ppPtr_
labelListList * ppPtr_
Point-points.
Definition: primitiveMesh.H:143
Foam::primitiveMesh::clearAddressing
void clearAddressing()
Clear topological data.
Definition: primitiveMeshClear.C:142
demandDrivenData.H
Template functions to aid in the implementation of demand driven data.
Foam::primitiveMesh::ecPtr_
labelListList * ecPtr_
Edge-cells.
Definition: primitiveMesh.H:119
Foam::primitiveMesh::cellVolumesPtr_
scalarField * cellVolumesPtr_
Cell volumes.
Definition: primitiveMesh.H:167
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Foam::primitiveMesh::pfPtr_
labelListList * pfPtr_
Point-faces.
Definition: primitiveMesh.H:131
Foam::deleteDemandDrivenData
void deleteDemandDrivenData(DataPtr &dataPtr)
Definition: demandDrivenData.H:40
Foam::primitiveMesh::faceCentresPtr_
vectorField * faceCentresPtr_
Face centres.
Definition: primitiveMesh.H:164
Foam::primitiveMesh::pcPtr_
labelListList * pcPtr_
Point-cells.
Definition: primitiveMesh.H:122
Foam::primitiveMesh::cfPtr_
cellList * cfPtr_
Cell-faces.
Definition: primitiveMesh.H:125
Foam::primitiveMesh::cellShapesPtr_
cellShapeList * cellShapesPtr_
Cell shapes.
Definition: primitiveMesh.H:104
Foam::primitiveMesh::ccPtr_
labelListList * ccPtr_
Cell-cells.
Definition: primitiveMesh.H:116
Foam::primitiveMesh::cpPtr_
labelListList * cpPtr_
Cell-points.
Definition: primitiveMesh.H:146
Foam::Pout
prefixOSstream Pout(cout, "Pout")
Definition: IOstreams.H:53
Foam::primitiveMesh::faceAreasPtr_
vectorField * faceAreasPtr_
Face areas.
Definition: primitiveMesh.H:170
Foam::primitiveMesh::cePtr_
labelListList * cePtr_
Cell-edges.
Definition: primitiveMesh.H:134
Foam::primitiveMesh::efPtr_
labelListList * efPtr_
Edge-faces.
Definition: primitiveMesh.H:128
Foam::primitiveMesh::edgesPtr_
edgeList * edgesPtr_
Edges are ordered in upper triangular order.
Definition: primitiveMesh.H:110
Foam::primitiveMesh::clearOut
void clearOut()
Clear all geometry and addressing unnecessary for CFD.
Definition: primitiveMeshClear.C:171
Foam::primitiveMesh::cellCentresPtr_
vectorField * cellCentresPtr_
Cell centres.
Definition: primitiveMesh.H:161