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