Forward compatibility: flex
[foam-extend-3.2.git] / src / meshTools / sets / cellSources / nearestToCell / nearestToCell.H
blob97c032c26c10157f9dcf340c99d8c4c4495bc5c8
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | foam-extend: Open Source CFD
4    \\    /   O peration     | Version:     3.2
5     \\  /    A nd           | Web:         http://www.foam-extend.org
6      \\/     M anipulation  | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
8 License
9     This file is part of foam-extend.
11     foam-extend 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 3 of the License, or (at your
14     option) any later version.
16     foam-extend is distributed in the hope that it will be useful, but
17     WITHOUT ANY WARRANTY; without even the implied warranty of
18     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19     General Public License for more details.
21     You should have received a copy of the GNU General Public License
22     along with foam-extend.  If not, see <http://www.gnu.org/licenses/>.
24 Class
25     Foam::nearestToCell
27 Description
28     A topoSetSource to select cells nearest to points.
30 SourceFiles
31     nearestToCell.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef nearestToCell_H
36 #define nearestToCell_H
38 #include "topoSetSource.H"
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 namespace Foam
45 /*---------------------------------------------------------------------------*\
46                        Class nearestToCell Declaration
47 \*---------------------------------------------------------------------------*/
49 class nearestToCell
51     public topoSetSource
54     // Private data
56         //- Add usage string
57         static addToUsageTable usage_;
59         //- points to select nearest to
60         pointField points_;
63     // Private Member Functions
65         void combine(topoSet& set, const bool add) const;
68 public:
70     //- Runtime type information
71     TypeName("nearestToCell");
73     // Constructors
75         //- Construct from components
76         nearestToCell
77         (
78             const polyMesh& mesh,
79             const pointField& points
80         );
82         //- Construct from dictionary
83         nearestToCell
84         (
85             const polyMesh& mesh,
86             const dictionary& dict
87         );
89         //- Construct from Istream
90         nearestToCell
91         (
92             const polyMesh& mesh,
93             Istream&
94         );
97     // Destructor
99         virtual ~nearestToCell();
102     // Member Functions
104         virtual void applyToSet
105         (
106             const topoSetSource::setAction action,
107             topoSet&
108         ) const;
113 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
115 } // End namespace Foam
117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119 #endif
121 // ************************************************************************* //