1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
28 Various utilities to handle sets relating mesh to surface.
29 Note: work in progress. Used in meshing tools.
34 \*---------------------------------------------------------------------------*/
39 #include <OpenFOAM/label.H>
40 #include <OpenFOAM/scalar.H>
41 #include <OpenFOAM/fileName.H>
42 #include <OpenFOAM/pointField.H>
43 #include <OpenFOAM/polyMesh.H>
44 #include <triSurface/triSurface.H>
45 #include <meshTools/triSurfaceSearch.H>
46 #include <meshTools/pointSet.H>
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 // Forward declaration of classes
56 class triSurfaceSearch;
59 /*---------------------------------------------------------------------------*\
60 Class surfaceSets Declaration
61 \*---------------------------------------------------------------------------*/
65 //- Visibility of points: from inside cells, from outside cells or
78 ////- Min length of connected mesh edges
79 //static scalar minEdgeLen(const primitiveMesh& mesh, const label pointI);
81 ////- Returns true if cell uses at least one selected point
82 //static bool usesPoint
84 // const primitiveMesh& mesh,
85 // const boolList& selectedPoint,
89 ////- Find points used only by internalCells and remove from
90 //// internalCells all
91 //// cells which don't use any internal point. Return number of
93 //static label removeHangingCells
95 // const primitiveMesh&,
96 // const triSurfaceSearch& querySurf,
97 // labelHashSet& internalCells
100 ////- Select all points out of pointSet where the distance to the surface
102 //// than a factor times a local length scale (minimum length of
103 //// connected edges)
104 //static void getNearPoints
106 // const primitiveMesh& mesh,
107 // const triSurface& surf,
108 // const triSurfaceSearch& querySurf,
109 // const scalar edgeFactor,
110 // const pointSet& candidateSet,
111 // pointSet& nearPointSet
118 //- Divide cells into cut,inside and outside
119 // nCutLayers>0 : remove cutCells (set to type inside) if further
120 // than nCutLayers away from outside type cell.
121 static void getSurfaceSets
123 const polyMesh& mesh,
124 const fileName& surfName,
125 const triSurface& surf,
126 const triSurfaceSearch& querySurf,
127 const pointField& outsidePts,
129 const label nCutLayers,
131 labelHashSet& inside,
132 labelHashSet& outside,
136 //- Get cells using points on 'outside' only
137 static labelHashSet getHangingCells
139 const primitiveMesh& mesh,
140 const labelHashSet& internalCells
144 // //- Write cell sets with cells 'inside' and 'outside' surface.
145 // static void writeSurfaceSets
147 // const polyMesh& mesh,
148 // const fileName& surfName,
149 // const triSurface& surf,
150 // const triSurfaceSearch& querySurf,
151 // const pointField& outsidePts,
152 // const scalar edgeFactor
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 } // End namespace Foam
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 // ************************ vim: set sw=4 sts=4 et: ************************ //