initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / meshTools / sets / pointSources / surfaceToPoint / surfaceToPoint.H
blob443fad9671291c2af118465cdc068c13c4e25cc4
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::surfaceToPoint
28 Description
29     A topoSetSource to selects points based on relation to surface.
31     Select based on:
32     - distance to surface
33     - inside/outside status to surface
34       (Uses normal of nearest surface triangle so requires valid surface
35       topology!)
37 SourceFiles
38     surfaceToPoint.C
40 \*---------------------------------------------------------------------------*/
42 #ifndef surfaceToPoint_H
43 #define surfaceToPoint_H
45 #include "topoSetSource.H"
46 #include "Map.H"
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 namespace Foam
52 class triSurfaceSearch;
54 /*---------------------------------------------------------------------------*\
55                            Class surfaceToPoint Declaration
56 \*---------------------------------------------------------------------------*/
58 class surfaceToPoint
60     public topoSetSource
63     // Private data
65         //- Add usage string
66         static addToUsageTable usage_;
68         //- Name of surface file
69         fileName surfName_;
71         //- if > 0 : include points with distance to surface less than nearDist.
72         scalar nearDist_;
74         //- include all points on opposite sign of normal on nearest surface.
75         bool includeInside_;
77         //- include all points on this sign of normal on nearest surface.
78         bool includeOutside_;
81     // Private Member Functions
83         //- Depending on surface add to or delete from pointSet.
84         void combine(topoSet& set, const bool add) const;
86         //- Check settings at construction time.
87         void checkSettings() const;
89 public:
91     //- Runtime type information
92     TypeName("surfaceToPoint");
94     // Constructors
96         //- Construct from components
97         surfaceToPoint
98         (
99             const polyMesh& mesh,
100             const fileName& surfName,
101             const scalar nearDist,
102             const bool includeInside,
103             const bool includeOutside
104         );
106         //- Construct from dictionary
107         surfaceToPoint
108         (
109             const polyMesh& mesh,
110             const dictionary& dict
111         );
113         //- Construct from Istream
114         surfaceToPoint
115         (
116             const polyMesh& mesh,
117             Istream&
118         );
121     // Destructor
123         virtual ~surfaceToPoint();
126     // Member Functions
128         virtual void applyToSet
129         (
130             const topoSetSource::setAction action,
131             topoSet&
132         ) const;
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 } // End namespace Foam
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 #endif
145 // ************************************************************************* //