/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Copyright (C) 2011-2019 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 . Class Foam::fvMeshSubset Description Post-processing mesh subset tool. Given the original mesh and the list of selected cells, it creates the mesh consisting only of the desired cells, with the mapping list for points, faces, and cells. Puts all exposed internal faces into either - a user supplied patch - a newly created patch "oldInternalFaces" - setCellSubset is for small subsets. Uses Maps to minimize memory. - setLargeCellSubset is for largish subsets (>10% of mesh). Uses labelLists instead. - setLargeCellSubset does coupled patch subsetting as well. If it detects a face on a coupled patch 'losing' its neighbour it will move the face into the oldInternalFaces patch. - if a user supplied patch is used it is up to the destination patchField to handle exposed internal faces (mapping from face -1). If not provided the default is to assign the internalField. All the basic patch field types (e.g. fixedValue) will give a warning and preferably derived patch field types should be used that know how to handle exposed faces (e.g. use uniformFixedValue instead of fixedValue) SourceFiles fvMeshSubset.C \*---------------------------------------------------------------------------*/ #ifndef fvMeshSubset_H #define fvMeshSubset_H #include "fvMesh.H" #include "pointMesh.H" #include "GeometricField.H" #include "HashSet.H" #include "surfaceMesh.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { /*---------------------------------------------------------------------------*\ Class fvMeshSubset Declaration \*---------------------------------------------------------------------------*/ class fvMeshSubset { // Private Data //- Mesh to subset from const fvMesh& baseMesh_; //- Subset mesh pointer autoPtr fvMeshSubsetPtr_; //- Point mapping array labelList pointMap_; //- Face mapping array labelList faceMap_; //- Cell mapping array labelList cellMap_; //- Patch mapping array labelList patchMap_; //- Optional face mapping array with flip encoded mutable autoPtr faceFlipMapPtr_; // Private Member Functions //- Check if subset has been performed bool checkCellSubset() const; //- Mark points in Map static void markPoints(const labelList&, Map