FreeFOAM The Cross-Platform CFD Toolkit
polyMeshClear.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) 1991-2010 OpenCFD Ltd.
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 <OpenFOAM/primitiveMesh.H>
30 #include <OpenFOAM/pointMesh.H>
31 #include <OpenFOAM/Time.H>
32 
33 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
34 
36 {
37  if (debug)
38  {
39  Info<< "void polyMesh::removeBoundary(): "
40  << "Removing boundary patches."
41  << endl;
42  }
43 
44  // Remove the point zones
45  boundary_.clear();
46  boundary_.setSize(0);
47 
48  clearOut();
49 }
50 
51 
52 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
53 
55 {
56  if (debug)
57  {
58  Info<< "void polyMesh::clearGeom() : "
59  << "clearing geometric data"
60  << endl;
61  }
62 
64 
65  forAll (boundary_, patchI)
66  {
67  boundary_[patchI].clearGeom();
68  }
69 
70  // Reset valid directions (could change with rotation)
71  geometricD_ = Vector<label>::zero;
72  solutionD_ = Vector<label>::zero;
73 
74  pointMesh::Delete(*this);
75 }
76 
77 
79 {
80  if (debug)
81  {
82  Info<< "void polyMesh::clearAddressing() : "
83  << "clearing topology"
84  << endl;
85  }
86 
88 
89  // parallelData depends on the processorPatch ordering so force
90  // recalculation
91  deleteDemandDrivenData(globalMeshDataPtr_);
92 
93  // Reset valid directions
94  geometricD_ = Vector<label>::zero;
95  solutionD_ = Vector<label>::zero;
96 
97  pointMesh::Delete(*this);
98 }
99 
100 
102 {
103  resetMotion();
104 
105  points_.setSize(0);
106  faces_.setSize(0);
107  owner_.setSize(0);
108  neighbour_.setSize(0);
109 
110  clearedPrimitives_ = true;
111 }
112 
113 
115 {
116  clearGeom();
117  clearAddressing();
118 }
119 
120 
121 // ************************ vim: set sw=4 sts=4 et: ************************ //