PrimitivePatchClear.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) 2011-2016 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 "PrimitivePatch.H"
27 #include "demandDrivenData.H"
28 
29 
30 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
31 
32 template
33 <
34  class Face,
35  template<class> class FaceList,
36  class PointField,
37  class PointType
38 >
39 void
42 {
43  if (debug)
44  {
45  InfoInFunction << "Clearing geometric data" << endl;
46  }
47 
48  deleteDemandDrivenData(localPointsPtr_);
49  deleteDemandDrivenData(faceCentresPtr_);
50  deleteDemandDrivenData(faceNormalsPtr_);
51  deleteDemandDrivenData(pointNormalsPtr_);
52 }
53 
54 
55 template
56 <
57  class Face,
58  template<class> class FaceList,
59  class PointField,
60  class PointType
61 >
62 void
65 {
66  if (debug)
67  {
68  InfoInFunction << "Clearing patch addressing" << endl;
69  }
70 
71  // group created and destroyed together
72  if (edgesPtr_ && faceFacesPtr_ && edgeFacesPtr_ && faceEdgesPtr_)
73  {
74  delete edgesPtr_;
75  edgesPtr_ = nullptr;
76 
77  delete faceFacesPtr_;
78  faceFacesPtr_ = nullptr;
79 
80  delete edgeFacesPtr_;
81  edgeFacesPtr_ = nullptr;
82 
83  delete faceEdgesPtr_;
84  faceEdgesPtr_ = nullptr;
85  }
86 
87  deleteDemandDrivenData(boundaryPointsPtr_);
88  deleteDemandDrivenData(pointEdgesPtr_);
89  deleteDemandDrivenData(pointFacesPtr_);
90  deleteDemandDrivenData(edgeLoopsPtr_);
91  deleteDemandDrivenData(localPointOrderPtr_);
92 }
93 
94 
95 template
96 <
97  class Face,
98  template<class> class FaceList,
99  class PointField,
100  class PointType
101 >
102 void
105 {
106  if (debug)
107  {
108  InfoInFunction << "Clearing patch-mesh addressing" << endl;
109  }
110 
111  deleteDemandDrivenData(meshPointsPtr_);
112  deleteDemandDrivenData(meshPointMapPtr_);
113  deleteDemandDrivenData(localFacesPtr_);
114 }
115 
116 
117 template
118 <
119  class Face,
120  template<class> class FaceList,
121  class PointField,
122  class PointType
123 >
124 void
127 {
128  clearGeom();
129  clearTopology();
130  clearPatchMeshAddr();
131 }
132 
133 
134 // ************************************************************************* //
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:253
Template functions to aid in the implementation of demand driven data.
void deleteDemandDrivenData(DataPtr &dataPtr)
#define InfoInFunction
Report an information message using Foam::Info.