/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation Copyright (C) 2015-2024 OpenCFD Ltd. ------------------------------------------------------------------------------- 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::meshRefinement Description Helper class which maintains intersections of (changing) mesh with (static) surfaces. Maintains - per face any intersections of the cc-cc segment with any of the surfaces SourceFiles meshRefinement.C meshRefinementBaffles.C meshRefinementGapRefine.C meshRefinementMerge.C meshRefinementProblemCells.C meshRefinementRefine.C \*---------------------------------------------------------------------------*/ #ifndef Foam_meshRefinement_H #define Foam_meshRefinement_H #include "hexRef8.H" #include "mapPolyMesh.H" #include "autoPtr.H" #include "labelPairHashes.H" #include "indirectPrimitivePatch.H" #include "pointFieldsFwd.H" #include "Tuple2.H" #include "pointIndexHit.H" #include "wordPairHashes.H" #include "surfaceZonesInfo.H" #include "volumeType.H" #include "DynamicField.H" #include "coordSetWriter.H" #include "surfaceWriter.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { // Forward Declarations class fvMesh; class mapDistributePolyMesh; class mapDistribute; class decompositionMethod; class refinementSurfaces; class refinementFeatures; class shellSurfaces; class removeCells; class fvMeshDistribute; class removePoints; class localPointRegion; class snapParameters; /*---------------------------------------------------------------------------*\ Class meshRefinement Declaration \*---------------------------------------------------------------------------*/ class meshRefinement { public: // Public Data Types //- Enumeration for how to operate enum MeshType { CASTELLATED, // split-hex refinement, snapping, layer addition CASTELLATEDBUFFERLAYER, // same but add buffer layers before // snapping CASTELLATEDBUFFERLAYER2 // experimental. wip. }; static const Enum MeshTypeNames; //- Enumeration for what to debug. Used as a bit-pattern. enum debugType { MESH = (1 << 0), OBJINTERSECTIONS = (1 << 1), FEATURESEEDS = (1 << 2), ATTRACTION = (1 << 3), LAYERINFO = (1 << 4) }; static const Enum debugTypeNames; ////- Enumeration for what to output. Used as a bit-pattern. //enum outputType //{ // OUTPUTLAYERINFO = (1 << 0) //}; // //static const Enum outputTypeNames; //- Enumeration for what to write. Used as a bit-pattern. enum writeType { WRITEMESH = (1 << 0), NOWRITEREFINEMENT = (1 << 1), WRITELEVELS = (1 << 2), WRITELAYERSETS = (1 << 3), WRITELAYERFIELDS = (1 << 4) }; static const Enum writeTypeNames; //- Enumeration for how userdata is to be mapped upon refinement. enum mapType { MASTERONLY = 1, //!< maintain master only KEEPALL = 2, //!< have slaves (upon refinement) from master REMOVE = 4 //!< set value to -1 any face that was refined }; //- Enumeration for what to do with co-planar patch faces on a single // cell enum FaceMergeType { NONE, // no merging GEOMETRIC, // use feature angle IGNOREPATCH // use feature angle, allow merging of different // patches }; private: // Static Data Members //- Control of writing level static writeType writeLevel_; ////- Control of output/log level //static outputType outputLevel_; // Private Data //- Reference to mesh fvMesh& mesh_; //- Tolerance used for sorting coordinates (used in 'less' routine) const scalar mergeDistance_; //- Overwrite the mesh? const bool overwrite_; //- Instance of mesh upon construction. Used when in overwrite_ mode. const word oldInstance_; //- All surface-intersection interaction const refinementSurfaces& surfaces_; //- All feature-edge interaction const refinementFeatures& features_; //- All shell-refinement interaction const shellSurfaces& shells_; //- All limit-refinement interaction const shellSurfaces& limitShells_; //- How to generate mesh const MeshType meshType_; //- Are we operating in test mode? const bool dryRun_; //- Refinement engine hexRef8 meshCutter_; //- Per cc-cc vector the index of the surface hit labelIOList surfaceIndex_; // For baffle merging //- Original patch for baffle faces that used to be on // coupled patches Map