1 /*---------------------------------------------------------------------------*\
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 -------------------------------------------------------------------------------
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/>.
25 Foam::searchableSphere
33 \*---------------------------------------------------------------------------*/
35 #ifndef searchableSphere_H
36 #define searchableSphere_H
38 #include "treeBoundBox.H"
39 #include "searchableSurface.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 // Forward declaration of classes
48 /*---------------------------------------------------------------------------*\
49 Class searchableSphere Declaration
50 \*---------------------------------------------------------------------------*/
52 class searchableSphere
54 public searchableSurface
58 // Private Member Data
67 mutable wordList regions_;
70 // Private Member Functions
72 //- Find nearest point on sphere.
73 pointIndexHit findNearest
76 const scalar nearestDistSqr
79 //- Find intersection with sphere
89 //- Disallow default bitwise copy construct
90 searchableSphere(const searchableSphere&);
92 //- Disallow default bitwise assignment
93 void operator=(const searchableSphere&);
98 //- Runtime type information
99 TypeName("searchableSphere");
104 //- Construct from components
105 searchableSphere(const IOobject& io, const point&, const scalar radius);
107 //- Construct from dictionary (used by searchableSurface)
111 const dictionary& dict
116 virtual ~searchableSphere();
121 virtual const wordList& regions() const;
123 //- Whether supports volume type below
124 virtual bool hasVolumeType() const
129 //- Range of local indices that can be returned.
130 virtual label size() const
135 //- Get representative set of element coordinates
136 // Usually the element centres (should be of length size()).
137 virtual pointField coordinates() const
139 return pointField(1, centre_);
143 // Multiple point queries.
145 virtual void findNearest
147 const pointField& sample,
148 const scalarField& nearestDistSqr,
152 virtual void findLine
154 const pointField& start,
155 const pointField& end,
159 virtual void findLineAny
161 const pointField& start,
162 const pointField& end,
166 //- Get all intersections in order from start to end.
167 virtual void findLineAll
169 const pointField& start,
170 const pointField& end,
171 List<List<pointIndexHit> >&
174 //- From a set of points and indices get the region
175 virtual void getRegion
177 const List<pointIndexHit>&,
181 //- From a set of points and indices get the normal
182 virtual void getNormal
184 const List<pointIndexHit>&,
188 //- Determine type (inside/outside/mixed) for point. unknown if
189 // cannot be determined (e.g. non-manifold surface)
190 virtual void getVolumeType
197 // regIOobject implementation
199 bool writeData(Ostream&) const
201 notImplemented("searchableSphere::writeData(Ostream&) const");
208 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 } // End namespace Foam
212 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216 // ************************************************************************* //