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

polyMeshClear.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 "polyMesh.H"
00027 #include <OpenFOAM/primitiveMesh.H>
00028 #include <OpenFOAM/globalMeshData.H>
00029 #include <OpenFOAM/demandDrivenData.H>
00030 #include <OpenFOAM/pointMesh.H>
00031 #include <OpenFOAM/Time.H>
00032 
00033 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
00034 
00035 void Foam::polyMesh::removeBoundary()
00036 {
00037     if (debug)
00038     {
00039         Info<< "void polyMesh::removeBoundary(): "
00040             << "Removing boundary patches."
00041             << endl;
00042     }
00043 
00044     // Remove the point zones
00045     boundary_.clear();
00046     boundary_.setSize(0);
00047 
00048     clearOut();
00049 }
00050 
00051 
00052 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00053 
00054 void Foam::polyMesh::clearGeom()
00055 {
00056     if (debug)
00057     {
00058         Info<< "void polyMesh::clearGeom() : "
00059             << "clearing geometric data"
00060             << endl;
00061     }
00062 
00063     primitiveMesh::clearGeom();
00064 
00065     forAll (boundary_, patchI)
00066     {
00067         boundary_[patchI].clearGeom();
00068     }
00069 
00070     // Reset valid directions (could change with rotation)
00071     geometricD_ = Vector<label>::zero;
00072     solutionD_ = Vector<label>::zero;
00073 
00074     pointMesh::Delete(*this);
00075 }
00076 
00077 
00078 void Foam::polyMesh::clearAddressing()
00079 {
00080     if (debug)
00081     {
00082         Info<< "void polyMesh::clearAddressing() : "
00083             << "clearing topology"
00084             << endl;
00085     }
00086 
00087     primitiveMesh::clearAddressing();
00088 
00089     // parallelData depends on the processorPatch ordering so force
00090     // recalculation
00091     deleteDemandDrivenData(globalMeshDataPtr_);
00092 
00093     // Reset valid directions
00094     geometricD_ = Vector<label>::zero;
00095     solutionD_ = Vector<label>::zero;
00096 
00097     pointMesh::Delete(*this);
00098 }
00099 
00100 
00101 void Foam::polyMesh::clearPrimitives()
00102 {
00103     resetMotion();
00104 
00105     points_.setSize(0);
00106     faces_.setSize(0);
00107     owner_.setSize(0);
00108     neighbour_.setSize(0);
00109 
00110     clearedPrimitives_ = true;
00111 }
00112 
00113 
00114 void Foam::polyMesh::clearOut()
00115 {
00116     clearGeom();
00117     clearAddressing();
00118 }
00119 
00120 
00121 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines