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

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