OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

PrimitivePatchClear.C

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Description
00026 
00027 \*---------------------------------------------------------------------------*/
00028 
00029 #include "PrimitivePatch.H"
00030 #include "demandDrivenData.H"
00031 
00032 
00033 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00034 
00035 template
00036 <
00037     class Face,
00038     template<class> class FaceList,
00039     class PointField,
00040     class PointType
00041 >
00042 
00043 void
00044 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
00045 clearGeom()
00046 {
00047     if (debug)
00048     {
00049         Info<< "PrimitivePatch<Face, FaceList, PointField, PointType>::"
00050             << "clearGeom() : clearing geometric data"
00051             << endl;
00052     }
00053 
00054     deleteDemandDrivenData(localPointsPtr_);
00055     deleteDemandDrivenData(faceNormalsPtr_);
00056     deleteDemandDrivenData(pointNormalsPtr_);
00057 }
00058 
00059 
00060 template
00061 <
00062     class Face,
00063     template<class> class FaceList,
00064     class PointField,
00065     class PointType
00066 >
00067 
00068 void
00069 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
00070 clearTopology()
00071 {
00072     if (debug)
00073     {
00074         Info<< "PrimitivePatch<Face, FaceList, PointField, PointType>::"
00075             << "clearTopology() : clearing patch addressing"
00076             << endl;
00077     }
00078 
00079     // group created and destroyed together
00080     if (edgesPtr_ && faceFacesPtr_ && edgeFacesPtr_ && faceEdgesPtr_)
00081     {
00082         delete edgesPtr_;
00083         edgesPtr_ = NULL;
00084 
00085         delete faceFacesPtr_;
00086         faceFacesPtr_ = NULL;
00087 
00088         delete edgeFacesPtr_;
00089         edgeFacesPtr_ = NULL;
00090 
00091         delete faceEdgesPtr_;
00092         faceEdgesPtr_ = NULL;
00093     }
00094 
00095     deleteDemandDrivenData(boundaryPointsPtr_);
00096     deleteDemandDrivenData(pointEdgesPtr_);
00097     deleteDemandDrivenData(pointFacesPtr_);
00098     deleteDemandDrivenData(edgeLoopsPtr_);
00099 }
00100 
00101 
00102 template
00103 <
00104     class Face,
00105     template<class> class FaceList,
00106     class PointField,
00107     class PointType
00108 >
00109 
00110 void
00111 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
00112 clearPatchMeshAddr()
00113 {
00114     if (debug)
00115     {
00116         Info<< "PrimitivePatch<Face, FaceList, PointField, PointType>::"
00117             << "clearPatchMeshAddr() : "
00118             << "clearing patch-mesh addressing"
00119             << endl;
00120     }
00121 
00122     deleteDemandDrivenData(meshPointsPtr_);
00123     deleteDemandDrivenData(meshPointMapPtr_);
00124     deleteDemandDrivenData(localFacesPtr_);
00125 }
00126 
00127 
00128 template
00129 <
00130     class Face,
00131     template<class> class FaceList,
00132     class PointField,
00133     class PointType
00134 >
00135 
00136 void
00137 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
00138 clearOut()
00139 {
00140     clearGeom();
00141     clearTopology();
00142     clearPatchMeshAddr();
00143 }
00144 
00145 
00146 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd