FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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-2010 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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 \*---------------------------------------------------------------------------*/
00025 
00026 #include "PrimitivePatch_.H"
00027 #include <OpenFOAM/demandDrivenData.H>
00028 
00029 
00030 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00031 
00032 template
00033 <
00034     class Face,
00035     template<class> class FaceList,
00036     class PointField,
00037     class PointType
00038 >
00039 void
00040 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
00041 clearGeom()
00042 {
00043     if (debug)
00044     {
00045         Info<< "PrimitivePatch<Face, FaceList, PointField, PointType>::"
00046             << "clearGeom() : clearing geometric data"
00047             << endl;
00048     }
00049 
00050     deleteDemandDrivenData(localPointsPtr_);
00051     deleteDemandDrivenData(faceCentresPtr_);
00052     deleteDemandDrivenData(faceNormalsPtr_);
00053     deleteDemandDrivenData(pointNormalsPtr_);
00054 }
00055 
00056 
00057 template
00058 <
00059     class Face,
00060     template<class> class FaceList,
00061     class PointField,
00062     class PointType
00063 >
00064 void
00065 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
00066 clearTopology()
00067 {
00068     if (debug)
00069     {
00070         Info<< "PrimitivePatch<Face, FaceList, PointField, PointType>::"
00071             << "clearTopology() : clearing patch addressing"
00072             << endl;
00073     }
00074 
00075     // group created and destroyed together
00076     if (edgesPtr_ && faceFacesPtr_ && edgeFacesPtr_ && faceEdgesPtr_)
00077     {
00078         delete edgesPtr_;
00079         edgesPtr_ = NULL;
00080 
00081         delete faceFacesPtr_;
00082         faceFacesPtr_ = NULL;
00083 
00084         delete edgeFacesPtr_;
00085         edgeFacesPtr_ = NULL;
00086 
00087         delete faceEdgesPtr_;
00088         faceEdgesPtr_ = NULL;
00089     }
00090 
00091     deleteDemandDrivenData(boundaryPointsPtr_);
00092     deleteDemandDrivenData(pointEdgesPtr_);
00093     deleteDemandDrivenData(pointFacesPtr_);
00094     deleteDemandDrivenData(edgeLoopsPtr_);
00095 }
00096 
00097 
00098 template
00099 <
00100     class Face,
00101     template<class> class FaceList,
00102     class PointField,
00103     class PointType
00104 >
00105 void
00106 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
00107 clearPatchMeshAddr()
00108 {
00109     if (debug)
00110     {
00111         Info<< "PrimitivePatch<Face, FaceList, PointField, PointType>::"
00112             << "clearPatchMeshAddr() : "
00113             << "clearing patch-mesh addressing"
00114             << endl;
00115     }
00116 
00117     deleteDemandDrivenData(meshPointsPtr_);
00118     deleteDemandDrivenData(meshPointMapPtr_);
00119     deleteDemandDrivenData(localFacesPtr_);
00120 }
00121 
00122 
00123 template
00124 <
00125     class Face,
00126     template<class> class FaceList,
00127     class PointField,
00128     class PointType
00129 >
00130 void
00131 Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
00132 clearOut()
00133 {
00134     clearGeom();
00135     clearTopology();
00136     clearPatchMeshAddr();
00137 }
00138 
00139 
00140 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines