Added linuxIA64 compilation options
[OpenFOAM-1.6.x.git] / src / meshTools / cellDist / cellDistFuncs.H
blob9574ecaae0c0914955cffdfafa7ae17d36ce3e42
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::cellDistFuncs
28 Description
29     Collection of functions used in wall distance calculation.
31 SourceFiles
32     cellDistFuncs.C
33     cellDistFuncsTemplates.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef cellDistFuncs_H
38 #define cellDistFuncs_H
40 #include "scalarField.H"
41 #include "HashSet.H"
42 #include "Map.H"
43 #include "wordList.H"
44 #include "scalarField.H"
45 #include "point.H"
46 #include "primitivePatch.H"
47 #include "className.H"
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 namespace Foam
54 // Forward declaration of classes
55 class polyMesh;
56 class polyPatch;
57 class polyBoundaryMesh;
59 /*---------------------------------------------------------------------------*\
60                            Class cellDistFuncs Declaration
61 \*---------------------------------------------------------------------------*/
63 class cellDistFuncs
65     // Private Member Data
67         //- Reference to mesh
68         const polyMesh& mesh_;
71     // Private Member Functions
73         //- Search for element in first n elements of labelList. Return index
74         //  or -1.
75         static label findIndex(const label n, const labelList&, const label);
78         //- Disallow default bitwise copy construct
79         cellDistFuncs(const cellDistFuncs&);
81         //- Disallow default bitwise assignment
82         void operator=(const cellDistFuncs&);
84 public:
86     ClassName("cellDistFuncs");
88     // Constructors
90         //- Construct from mesh
91         cellDistFuncs(const polyMesh& mesh);
94     // Member Functions
96         //- Access mesh
97         const polyMesh& mesh() const
98         {
99             return mesh_;
100         }
102         //- Get patchIDs of named patches
103         labelHashSet getPatchIDs(const wordList&) const;
105         //- Get patchIDs of/derived off certain type (e.g. 'processorPolyPatch')
106         //  Uses isA, not isType
107         template<class Type>
108         labelHashSet getPatchIDs() const;
110         //- Calculate smallest true distance (and face index)
111         //  from pt to faces wallFaces.
112         //  For efficiency reasons we still pass in patch instead of extracting
113         //  it from mesh_
114         scalar smallestDist
115         (
116             const point& p,
117             const polyPatch& patch,
118             const label nWallFaces,
119             const labelList& wallFaces,
120             label& meshFaceI
121         ) const;
123         //- Get faces sharing point with face on patch
124         label getPointNeighbours
125         (
126             const primitivePatch&,
127             const label patchFaceI,
128             labelList&
129         ) const;
131         //- Size of largest patch (out of supplied subset of patches)
132         label maxPatchSize(const labelHashSet& patchIDs) const;
134         //- Sum of patch sizes (out of supplied subset of patches). 
135         //  Used in sizing arrays.
136         label sumPatchSize(const labelHashSet& patchIDs) const;
138         //- Correct all cells connected to boundary (via face). Sets values in
139         //  wallDistCorrected. Sets nearest wallface in nearestFace.
140         void correctBoundaryFaceCells
141         (
142             const labelHashSet& patchIDs,
143             scalarField& wallDistCorrected,
144             Map<label>& nearestFace
145         ) const;
148         //- Correct all cells connected to wall (via point). Sets values in
149         //  wallDistCorrected. Uses/sets nearest wallFace in nearestFace.
150         void correctBoundaryPointCells
151         (
152             const labelHashSet& patchIDs,
153             scalarField& wallDistCorrected,
154             Map<label>& nearestFace
155         ) const;
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 } // End namespace Foam
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 #ifdef NoRepository
166 #   include "cellDistFuncsTemplates.C"
167 #endif
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 #endif
173 // ************************************************************************* //