Forward compatibility: flex
[foam-extend-3.2.git] / src / meshTools / sets / cellSources / sphereToCell / sphereToCell.H
blobdea7e72573bc1ae5259a4e1e736669f15e82c2e1
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::sphereToCell
27 Description
28     A topoSetSource to select cells based on cell centres inside sphere.
30 SourceFiles
31     sphereToCell.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef sphereToCell_H
36 #define sphereToCell_H
38 #include "topoSetSource.H"
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 namespace Foam
45 /*---------------------------------------------------------------------------*\
46                        Class sphereToCell Declaration
47 \*---------------------------------------------------------------------------*/
49 class sphereToCell
51     public topoSetSource
54     // Private data
56         //- Add usage string
57         static addToUsageTable usage_;
59         //- Centre
60         vector centre_;
62         //- Radius
63         scalar radius_;
66     // Private Member Functions
68         void combine(topoSet& set, const bool add) const;
71 public:
73     //- Runtime type information
74     TypeName("sphereToCell");
77     // Constructors
79         //- Construct from components
80         sphereToCell
81         (
82             const polyMesh& mesh,
83             const vector& centre,
84             const scalar radius
85         );
87         //- Construct from dictionary
88         sphereToCell
89         (
90             const polyMesh& mesh,
91             const dictionary& dict
92         );
94         //- Construct from Istream
95         sphereToCell
96         (
97             const polyMesh& mesh,
98             Istream&
99         );
102     // Destructor
104         virtual ~sphereToCell();
107     // Member Functions
109         virtual void applyToSet
110         (
111             const topoSetSource::setAction action,
112             topoSet&
113         ) const;
118 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 } // End namespace Foam
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 #endif
126 // ************************************************************************* //