PrimitivePatchClear.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-2020 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<class FaceList, class PointField>
34 {
35  if (debug)
36  {
37  InfoInFunction << "Clearing geometric data" << endl;
38  }
39 
40  deleteDemandDrivenData(localPointsPtr_);
41  deleteDemandDrivenData(faceCentresPtr_);
42  deleteDemandDrivenData(faceAreasPtr_);
43  deleteDemandDrivenData(faceNormalsPtr_);
44  deleteDemandDrivenData(pointNormalsPtr_);
45 }
46 
47 
48 template<class FaceList, class PointField>
50 {
51  if (debug)
52  {
53  InfoInFunction << "Clearing patch addressing" << endl;
54  }
55 
56  // group created and destroyed together
57  if (edgesPtr_ && faceFacesPtr_ && edgeFacesPtr_ && faceEdgesPtr_)
58  {
59  delete edgesPtr_;
60  edgesPtr_ = nullptr;
61 
62  delete faceFacesPtr_;
63  faceFacesPtr_ = nullptr;
64 
65  delete edgeFacesPtr_;
66  edgeFacesPtr_ = nullptr;
67 
68  delete faceEdgesPtr_;
69  faceEdgesPtr_ = nullptr;
70  }
71 
72  deleteDemandDrivenData(boundaryPointsPtr_);
73  deleteDemandDrivenData(pointEdgesPtr_);
74  deleteDemandDrivenData(pointFacesPtr_);
75  deleteDemandDrivenData(edgeLoopsPtr_);
76  deleteDemandDrivenData(localPointOrderPtr_);
77 }
78 
79 
80 template<class FaceList, class PointField>
82 {
83  if (debug)
84  {
85  InfoInFunction << "Clearing patch-mesh addressing" << endl;
86  }
87 
88  deleteDemandDrivenData(meshPointsPtr_);
89  deleteDemandDrivenData(meshPointMapPtr_);
90  deleteDemandDrivenData(localFacesPtr_);
91 }
92 
93 
94 template<class FaceList, class PointField>
96 {
97  clearGeom();
98  clearTopology();
99  clearPatchMeshAddr();
100 }
101 
102 
103 // ************************************************************************* //
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Template functions to aid in the implementation of demand driven data.
void deleteDemandDrivenData(DataPtr &dataPtr)
#define InfoInFunction
Report an information message using Foam::Info.