/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2015 OpenFOAM Foundation Copyright (C) 2015-2020 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 . \*---------------------------------------------------------------------------*/ #include "meshRefinement.H" #include "Time.H" #include "refinementSurfaces.H" #include "refinementFeatures.H" #include "shellSurfaces.H" #include "triSurfaceMesh.H" #include "treeDataCell.H" #include "searchableSurfaces.H" #include "DynamicField.H" #include "transportData.H" #include "FaceCellWave.H" #include "volFields.H" #include "zeroGradientFvPatchFields.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // Foam::label Foam::meshRefinement::markSurfaceGapRefinement ( const scalar planarCos, const label nAllowRefine, const labelList& neiLevel, const pointField& neiCc, labelList& refineCell, label& nRefine ) const { const labelList& cellLevel = meshCutter_.cellLevel(); const pointField& cellCentres = mesh_.cellCentres(); // Get the gap level for the shells const labelList maxLevel(shells_.maxGapLevel()); label oldNRefine = nRefine; if (max(maxLevel) > 0) { // Use cached surfaceIndex_ to detect if any intersection. If so // re-intersect to determine level wanted. // Collect candidate faces // ~~~~~~~~~~~~~~~~~~~~~~~ labelList testFaces(getRefineCandidateFaces(refineCell)); // Collect segments // ~~~~~~~~~~~~~~~~ pointField start(testFaces.size()); pointField end(testFaces.size()); { labelList minLevel(testFaces.size()); calcCellCellRays ( neiCc, neiLevel, testFaces, start, end, minLevel ); } // Collect cells to test for inside/outside in shell labelList cellToCompact(mesh_.nCells(), -1); labelList bFaceToCompact(mesh_.nBoundaryFaces(), -1); labelList gapShell; List> shellGapInfo; List shellGapMode; { DynamicField compactToCc(mesh_.nCells()/10); DynamicList