Report patch name instead of index in debug
[foam-extend-3.2.git] / src / foam / meshes / polyMesh / polyMeshClear.C
blobe253d103b87ac37b4b8d2759870af394957727d1
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.
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.
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.
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/>.
24 \*---------------------------------------------------------------------------*/
26 #include "polyMesh.H"
27 #include "primitiveMesh.H"
28 #include "globalMeshData.H"
29 #include "demandDrivenData.H"
30 #include "meshObjectBase.H"
31 #include "pointMesh.H"
33 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
35 void Foam::polyMesh::removeBoundary()
37     if (debug)
38     {
39         Info<< "void polyMesh::removeBoundary(): "
40             << "Removing boundary patches."
41             << endl;
42     }
44     // Remove the point zones
45     boundary_.clear();
46     boundary_.setSize(0);
48     clearOut();
52 void Foam::polyMesh::removeZones()
54     if (debug)
55     {
56         Info<< "void polyMesh::removeZones(): "
57             << "Removing point, face and cell zones."
58             << endl;
59     }
61     // Remove the zones and reset writing
62     pointZones_.clear();
63     pointZones_.setSize(0);
64     pointZones_.writeOpt() = IOobject::NO_WRITE;
66     faceZones_.clear();
67     faceZones_.setSize(0);
68     faceZones_.writeOpt() = IOobject::NO_WRITE;
70     cellZones_.clear();
71     cellZones_.setSize(0);
72     cellZones_.writeOpt() = IOobject::NO_WRITE;
73     clearOut();
77 void Foam::polyMesh::clearGeom()
79     if (debug)
80     {
81         Info<< "void polyMesh::clearGeom() : "
82             << "clearing geometric data"
83             << endl;
84     }
86     primitiveMesh::clearGeom();
88     forAll (boundary_, patchI)
89     {
90         boundary_[patchI].clearGeom();
91     }
93     // Reset valid directions (could change with rotation)
94     geometricD_ = Vector<label>::zero;
95     solutionD_ = Vector<label>::zero;
97     // Move points all mesh objects.  HJ, 13/Oct/2010
98     // This is a problem, because it is called in a destructor.
99     meshObjectBase::allDelete(*this);
100 //     meshObjectBase::allMovePoints(*this);
104 void Foam::polyMesh::clearAddressing()
106     if (debug)
107     {
108         Info<< "void polyMesh::clearAddressing() : "
109             << "clearing topology"
110             << endl;
111     }
113     primitiveMesh::clearAddressing();
115     // parallelData depends on the processorPatch ordering so force
116     // recalculation
117     deleteDemandDrivenData(globalMeshDataPtr_);
119     // Reset valid directions
120     geometricD_ = Vector<label>::zero;
121     solutionD_ = Vector<label>::zero;
125 void Foam::polyMesh::clearPrimitives()
127     resetMotion();
129     allPoints_.setSize(0);
130     allFaces_.setSize(0);
131     owner_.setSize(0);
132     neighbour_.setSize(0);
134     clearedPrimitives_ = true;
138 void Foam::polyMesh::clearOut()
140     clearGeom();
141     clearAddressing();
145 // ************************************************************************* //