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

primitiveMeshClear.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 "primitiveMesh.H"
00027 #include <OpenFOAM/demandDrivenData.H>
00028 
00029 
00030 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00031 
00032 void Foam::primitiveMesh::printAllocated() const
00033 {
00034     Pout<< "primitiveMesh allocated :" << endl;
00035 
00036     // Topology
00037     if (cellShapesPtr_)
00038     {
00039         Pout<< "    Cell shapes" << endl;
00040     }
00041 
00042     if (edgesPtr_)
00043     {
00044         Pout<< "    Edges" << endl;
00045     }
00046 
00047     if (ccPtr_)
00048     {
00049         Pout<< "    Cell-cells" << endl;
00050     }
00051 
00052     if (ecPtr_)
00053     {
00054         Pout<< "    Edge-cells" << endl;
00055     }
00056 
00057     if (pcPtr_)
00058     {
00059         Pout<< "    Point-cells" << endl;
00060     }
00061 
00062     if (cfPtr_)
00063     {
00064         Pout<< "    Cell-faces" << endl;
00065     }
00066 
00067     if (efPtr_)
00068     {
00069         Pout<< "    Edge-faces" << endl;
00070     }
00071 
00072     if (pfPtr_)
00073     {
00074         Pout<< "    Point-faces" << endl;
00075     }
00076 
00077     if (cePtr_)
00078     {
00079         Pout<< "    Cell-edges" << endl;
00080     }
00081 
00082     if (fePtr_)
00083     {
00084         Pout<< "    Face-edges" << endl;
00085     }
00086 
00087     if (pePtr_)
00088     {
00089         Pout<< "    Point-edges" << endl;
00090     }
00091 
00092     if (ppPtr_)
00093     {
00094         Pout<< "    Point-point" << endl;
00095     }
00096 
00097     if (cpPtr_)
00098     {
00099         Pout<< "    Cell-point" << endl;
00100     }
00101 
00102     // Geometry
00103     if (cellCentresPtr_)
00104     {
00105         Pout<< "    Cell-centres" << endl;
00106     }
00107 
00108     if (faceCentresPtr_)
00109     {
00110         Pout<< "    Face-centres" << endl;
00111     }
00112 
00113     if (cellVolumesPtr_)
00114     {
00115         Pout<< "    Cell-volumes" << endl;
00116     }
00117 
00118     if (faceAreasPtr_)
00119     {
00120         Pout<< "    Face-areas" << endl;
00121     }
00122 
00123 }
00124 
00125 
00126 void Foam::primitiveMesh::clearGeom()
00127 {
00128     if (debug)
00129     {
00130         Pout<< "primitiveMesh::clearGeom() : "
00131             << "clearing geometric data"
00132             << endl;
00133     }
00134 
00135     deleteDemandDrivenData(cellCentresPtr_);
00136     deleteDemandDrivenData(faceCentresPtr_);
00137     deleteDemandDrivenData(cellVolumesPtr_);
00138     deleteDemandDrivenData(faceAreasPtr_);
00139 }
00140 
00141 
00142 void Foam::primitiveMesh::clearAddressing()
00143 {
00144     if (debug)
00145     {
00146         Pout<< "primitiveMesh::clearAddressing() : "
00147             << "clearing topology"
00148             << endl;
00149     }
00150 
00151     deleteDemandDrivenData(cellShapesPtr_);
00152 
00153     clearOutEdges();
00154 
00155     deleteDemandDrivenData(ccPtr_);
00156     deleteDemandDrivenData(ecPtr_);
00157     deleteDemandDrivenData(pcPtr_);
00158 
00159     deleteDemandDrivenData(cfPtr_);
00160     deleteDemandDrivenData(efPtr_);
00161     deleteDemandDrivenData(pfPtr_);
00162 
00163     deleteDemandDrivenData(cePtr_);
00164     deleteDemandDrivenData(fePtr_);
00165     deleteDemandDrivenData(pePtr_);
00166     deleteDemandDrivenData(ppPtr_);
00167     deleteDemandDrivenData(cpPtr_);
00168 }
00169 
00170 
00171 void Foam::primitiveMesh::clearOut()
00172 {
00173     clearGeom();
00174     clearAddressing();
00175 }
00176 
00177 
00178 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines