/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\/ 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 3 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, see . Description Remove a layer of cells and prepare addressing data \*---------------------------------------------------------------------------*/ #include "layerAdditionRemoval.H" #include "polyMesh.H" #include "primitiveMesh.H" #include "polyTopoChange.H" #include "oppositeFace.H" #include "polyTopoChanger.H" #include "polyRemoveCell.H" #include "polyRemoveFace.H" #include "polyRemovePoint.H" #include "polyModifyFace.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // bool Foam::layerAdditionRemoval::validCollapse() const { // Check for valid layer collapse // - no boundary-to-boundary collapse if (debug) { Pout<< "Checking layer collapse for object " << name() << endl; } // Grab the face collapse mapping const polyMesh& mesh = topoChanger().mesh(); const labelList& ftc = facesPairing(); const labelList& mf = mesh.faceZones()[faceZoneID_.index()]; label nBoundaryHits = 0; forAll(mf, faceI) { if ( !mesh.isInternalFace(mf[faceI]) && !mesh.isInternalFace(ftc[faceI]) ) { nBoundaryHits++; } } if (debug) { Pout<< "Finished checking layer collapse for object " << name() <<". Number of boundary-on-boundary hits: " << nBoundaryHits << endl; } if (returnReduce(nBoundaryHits, sumOp