/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License This file is part of OpenFOAM. OpenFOAM is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA \*---------------------------------------------------------------------------*/ #include "polyMesh.H" #include "Time.H" #include "cellIOList.H" #include "SubList.H" #include "wedgePolyPatch.H" #include "emptyPolyPatch.H" #include "globalMeshData.H" #include "processorPolyPatch.H" #include "OSspecific.H" #include "demandDrivenData.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { defineTypeNameAndDebug(polyMesh, 0); } Foam::word Foam::polyMesh::defaultRegion = "region0"; Foam::word Foam::polyMesh::meshSubDir = "polyMesh"; // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // void Foam::polyMesh::calcDirections() const { for (direction cmpt=0; cmpt(boundaryMesh()[patchi])) { if (boundaryMesh()[patchi].size()) { nEmptyPatches++; dirVec += sum(cmptMag(boundaryMesh()[patchi].faceAreas())); } } } if (nEmptyPatches) { reduce(dirVec, sumOp()); dirVec /= mag(dirVec); for (direction cmpt=0; cmpt 1e-6) { directions_[cmpt] = -1; } else { directions_[cmpt] = 1; } } } } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::polyMesh::polyMesh(const IOobject& io) : objectRegistry(io), primitiveMesh(), points_ ( IOobject ( "points", time().findInstance(meshDir(), "points"), meshSubDir, *this, IOobject::MUST_READ, IOobject::NO_WRITE ) ), faces_ ( IOobject ( "faces", time().findInstance(meshDir(), "faces"), meshSubDir, *this, IOobject::MUST_READ, IOobject::NO_WRITE ) ), owner_ ( IOobject ( "owner", time().findInstance(meshDir(), "faces"), meshSubDir, *this, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE ) ), neighbour_ ( IOobject ( "neighbour", time().findInstance(meshDir(), "faces"), meshSubDir, *this, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE ) ), clearedPrimitives_(false), boundary_ ( IOobject ( "boundary", time().findInstance(meshDir(), "boundary"), meshSubDir, *this, IOobject::MUST_READ, IOobject::NO_WRITE ), *this ), bounds_(points_), directions_(Vector