polyMeshClear.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-2026 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 "polyMesh.H"
27 #include "primitiveMesh.H"
28 #include "globalMeshData.H"
29 #include "meshObjects.H"
30 
31 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
32 
34 {
35  DebugInFunction << "Removing boundary patches." << endl;
36 
37  // Remove the point zones
38  boundary_.clear();
39  boundary_.setSize(0);
40 
41  clearOut();
42 }
43 
44 
45 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
46 
48 {
50 
51  Pout<< "polyMesh allocated :" << endl;
52 
53  if (tetBasePtIsPtr_.valid())
54  {
55  Pout<< " Tet base points" << endl;
56  }
57 }
58 
59 
61 {
62  DebugInFunction << "Clearing geometric data" << endl;
63 
64  // Clear all geometric mesh objects
65  meshObjects::clear<polyMesh, DeletableMeshObject>(*this);
66 
68 
69  boundary_.clearGeom();
70 
71  // Reset valid directions (could change with rotation)
72  geometricD_ = Zero;
73  solutionD_ = Zero;
74 }
75 
76 
77 void Foam::polyMesh::clearAddressing()
78 {
80 
81  // parallelData depends on the processorPatch ordering so force
82  // recalculation
83  globalMeshDataPtr_.clear();
84 
85  // Reset valid directions
86  geometricD_ = Zero;
87  solutionD_ = Zero;
88 
89  // Update zones
90  pointZones_.clearAddressing();
91  faceZones_.clearAddressing();
92  cellZones_.clearAddressing();
93 
94  // Remove the stored tet base points
95  tetBasePtIsPtr_.clear();
96 }
97 
98 
100 {
101  meshObjects::clear<polyMesh, DeletableMeshObject>(*this);
102  clearGeom();
103  clearAddressing();
104 }
105 
106 
108 {
109  DebugInFunction << "Clearing tet base points" << endl;
110 
111  tetBasePtIsPtr_.clear();
112 }
113 
114 
115 // ************************************************************************* //
void clear()
Clear the PtrList, i.e. set size to zero deleting all the.
Definition: PtrList.C:198
void setSize(const label)
Reset size of PtrList. If extending the PtrList, new entries are.
Definition: PtrList.C:131
void clearGeom()
Clear geometry.
Definition: polyMeshClear.C:60
void clearTetBasePtIs()
Clear tet base points.
void printAllocated() const
Print a list of all the currently allocated mesh data.
Definition: polyMeshClear.C:47
void removeBoundary()
Remove boundary patches.
Definition: polyMeshClear.C:33
void clearOut()
Clear all geometry and addressing unnecessary for CFD.
Definition: polyMeshClear.C:99
void clearGeom()
Clear geometry.
void clearAddressing()
Clear topological data.
void printAllocated() const
Print a list of all the currently allocated mesh data.
#define DebugInFunction
Report an information message using Foam::Info.
static const zero Zero
Definition: zero.H:97
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:288
prefixOSstream Pout(cout, "Pout")
Definition: IOstreams.H:53