initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / meshTools / surfaceSets / surfaceSets.H
blob38072d1a489c4fc7eb76b71cdcbd9d802b2f1e5d
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     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
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::surfaceSets
28 Description
29     Various utilities to handle sets relating mesh to surface.
30     Note: work in progress. Used in meshing tools.
32 SourceFiles
33     surfaceSets.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef surfaceSets_H
38 #define surfaceSets_H
40 #include "label.H"
41 #include "scalar.H"
42 #include "fileName.H"
43 #include "pointField.H"
44 #include "polyMesh.H"
45 #include "triSurface.H"
46 #include "triSurfaceSearch.H"
47 #include "pointSet.H"
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 namespace Foam
54 // Forward declaration of classes
55 class polyMesh;
56 class triSurface;
57 class triSurfaceSearch;
58 class pointSet;
60 /*---------------------------------------------------------------------------*\
61                            Class surfaceSets Declaration
62 \*---------------------------------------------------------------------------*/
64 class surfaceSets
66     //- Visibility of points: from inside cells, from outside cells or
67     //  from both
68     enum pointStatus
69     {
70         NOTSET,
71         INSIDE,
72         MIXED,
73         OUTSIDE
74     };
77     // Static
79         ////- Min length of connected mesh edges
80         //static scalar minEdgeLen(const primitiveMesh& mesh, const label pointI);
81         //
82         ////- Returns true if cell uses at least one selected point 
83         //static bool usesPoint
84         //(
85         //    const primitiveMesh& mesh,
86         //    const boolList& selectedPoint,
87         //    const label cellI
88         //);
90         ////- Find points used only by internalCells and remove from
91         ////  internalCells all
92         ////  cells which don't use any internal point. Return number of
93         ////  removed cells.
94         //static label removeHangingCells
95         //(
96         //    const primitiveMesh&, 
97         //    const triSurfaceSearch& querySurf,
98         //    labelHashSet& internalCells
99         //);
101         ////- Select all points out of pointSet where the distance to the surface
102         ////  is less
103         ////  than a factor times a local length scale (minimum length of
104         ////  connected edges)
105         //static void getNearPoints
106         //(
107         //    const primitiveMesh& mesh,
108         //    const triSurface& surf,
109         //    const triSurfaceSearch& querySurf,
110         //    const scalar edgeFactor,
111         //    const pointSet& candidateSet,
112         //    pointSet& nearPointSet
113         //);
115 public:
117     // Static Functions
119         //- Divide cells into cut,inside and outside
120         //  nCutLayers>0 : remove cutCells (set to type inside) if further
121         //  than nCutLayers away from outside type cell.
122         static void getSurfaceSets
123         (
124             const polyMesh& mesh,
125             const fileName& surfName,
126             const triSurface& surf,
127             const triSurfaceSearch& querySurf,
128             const pointField& outsidePts,
130             const label nCutLayers,
132             labelHashSet& inside,
133             labelHashSet& outside,
134             labelHashSet& cut
135         );
137         //- Get cells using points on 'outside' only
138         static labelHashSet getHangingCells
139         (
140             const primitiveMesh& mesh,
141             const labelHashSet& internalCells
142         );
145 //        //- Write cell sets with cells 'inside' and 'outside' surface.
146 //        static void writeSurfaceSets
147 //        (
148 //            const polyMesh& mesh,
149 //            const fileName& surfName,
150 //            const triSurface& surf,
151 //            const triSurfaceSearch& querySurf,
152 //            const pointField& outsidePts,
153 //            const scalar edgeFactor
154 //        );
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 } // End namespace Foam
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 #endif
168 // ************************************************************************* //