initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / OpenFOAM / meshes / primitiveMesh / PrimitivePatch / PrimitivePatchClear.C
blob160bf5546fb78f4266b4b5aadfbc4a39bf2f3178
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
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.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Description
27 \*---------------------------------------------------------------------------*/
29 #include "PrimitivePatch.H"
30 #include "demandDrivenData.H"
33 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
35 template
37     class Face,
38     template<class> class FaceList,
39     class PointField,
40     class PointType
43 void
44 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
45 clearGeom()
47     if (debug)
48     {
49         Info<< "PrimitivePatch<Face, FaceList, PointField, PointType>::"
50             << "clearGeom() : clearing geometric data"
51             << endl;
52     }
54     deleteDemandDrivenData(localPointsPtr_);
55     deleteDemandDrivenData(faceNormalsPtr_);
56     deleteDemandDrivenData(pointNormalsPtr_);
60 template
62     class Face,
63     template<class> class FaceList,
64     class PointField,
65     class PointType
68 void
69 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
70 clearTopology()
72     if (debug)
73     {
74         Info<< "PrimitivePatch<Face, FaceList, PointField, PointType>::"
75             << "clearTopology() : clearing patch addressing"
76             << endl;
77     }
79     // group created and destroyed together
80     if (edgesPtr_ && faceFacesPtr_ && edgeFacesPtr_ && faceEdgesPtr_)
81     {
82         delete edgesPtr_;
83         edgesPtr_ = NULL;
85         delete faceFacesPtr_;
86         faceFacesPtr_ = NULL;
88         delete edgeFacesPtr_;
89         edgeFacesPtr_ = NULL;
91         delete faceEdgesPtr_;
92         faceEdgesPtr_ = NULL;
93     }
95     deleteDemandDrivenData(boundaryPointsPtr_);
96     deleteDemandDrivenData(pointEdgesPtr_);
97     deleteDemandDrivenData(pointFacesPtr_);
98     deleteDemandDrivenData(edgeLoopsPtr_);
102 template
104     class Face,
105     template<class> class FaceList,
106     class PointField,
107     class PointType
110 void
111 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
112 clearPatchMeshAddr()
114     if (debug)
115     {
116         Info<< "PrimitivePatch<Face, FaceList, PointField, PointType>::"
117             << "clearPatchMeshAddr() : "
118             << "clearing patch-mesh addressing"
119             << endl;
120     }
122     deleteDemandDrivenData(meshPointsPtr_);
123     deleteDemandDrivenData(meshPointMapPtr_);
124     deleteDemandDrivenData(localFacesPtr_);
128 template
130     class Face,
131     template<class> class FaceList,
132     class PointField,
133     class PointType
136 void
137 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
138 clearOut()
140     clearGeom();
141     clearTopology();
142     clearPatchMeshAddr();
146 // ************************************************************************* //