/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | Copyright (C) 2018 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::surfaceToCell Description A topoSetCellSource to select cells based on relation to surface. Selects: - all cells inside/outside/cut by surface - all cells inside/outside surface ('useSurfaceOrientation', requires closed surface) - cells with centre nearer than XXX to surface - cells with centre nearer than XXX to surface \b and with normal at nearest point to centre and cell-corners differing by more than YYY (i.e., point of high curvature) \heading Dictionary parameters \table Property | Description | Required | Default file | The surface "filename" | yes | scale | surface scaling factor | no | -1 nearDistance | Near distance to the surface | yes | curvature | surface curvature selection | yes | outsidePoints| Points outside of surface | yes | includeCut | Include cut cells (bool) | yes | includeInside | Include inside cells (bool) | yes | includeOutside | Include outside cells (bool) | yes | useSurfaceOrientation | useSurfaceOrientation | no | false \endtable SourceFiles surfaceToCell.C \*---------------------------------------------------------------------------*/ #ifndef surfaceToCell_H #define surfaceToCell_H #include "topoSetCellSource.H" #include "Map.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { class triSurfaceSearch; class triSurface; /*---------------------------------------------------------------------------*\ Class surfaceToCell Declaration \*---------------------------------------------------------------------------*/ class surfaceToCell : public topoSetCellSource { // Private data //- Add usage string static addToUsageTable usage_; //- Name of surface file const fileName surfName_; //- Points which are outside const pointField outsidePoints_; //- Include cut cells const bool includeCut_; //- Include inside cells const bool includeInside_; //- Include outside cells const bool includeOutside_; //- Determine inside/outside purely using geometric test // (does not allow includeCut) const bool useSurfaceOrientation_; //- If > 0 : include cells with distance from cellCentre to surface // less than nearDist. const scalar nearDist_; //- If > -1 : include cells with normals at nearest surface points // varying more than curvature_. const scalar curvature_; //- triSurface to search on. On pointer since can be external. const triSurface* surfPtr_; //- Search engine on surface. const triSurfaceSearch* querySurfPtr_; //- Whether I allocated above surface ptrs or whether they are // external. const bool IOwnPtrs_; // Private Member Functions //- Find index of nearest triangle to point. Returns triangle or -1 if // not found within search span. // Cache result under pointi. static label getNearest ( const triSurfaceSearch& querySurf, const label pointi, const point& pt, const vector& searchSpan, Map