1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
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
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
26 Foam::searchableSphere
34 \*---------------------------------------------------------------------------*/
36 #ifndef searchableSphere_H
37 #define searchableSphere_H
39 #include "searchableSurface.H"
40 #include "treeBoundBox.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 // Forward declaration of classes
49 /*---------------------------------------------------------------------------*\
50 Class searchableSphere Declaration
51 \*---------------------------------------------------------------------------*/
53 class searchableSphere
55 public searchableSurface
59 // Private Member Data
68 mutable wordList regions_;
71 // Private Member Functions
73 //- Find nearest point on sphere.
74 pointIndexHit findNearest
77 const scalar nearestDistSqr
80 //- Find intersection with sphere
90 //- Disallow default bitwise copy construct
91 searchableSphere(const searchableSphere&);
93 //- Disallow default bitwise assignment
94 void operator=(const searchableSphere&);
99 //- Runtime type information
100 TypeName("searchableSphere");
105 //- Construct from components
106 searchableSphere(const IOobject& io, const point&, const scalar radius);
108 //- Construct from dictionary (used by searchableSurface)
112 const dictionary& dict
117 virtual ~searchableSphere();
122 virtual const wordList& regions() const;
124 //- Whether supports volume type below
125 virtual bool hasVolumeType() const
131 // Multiple point queries.
133 virtual void findNearest
135 const pointField& sample,
136 const scalarField& nearestDistSqr,
140 virtual void findLine
142 const pointField& start,
143 const pointField& end,
147 virtual void findLineAny
149 const pointField& start,
150 const pointField& end,
154 //- Get all intersections in order from start to end.
155 virtual void findLineAll
157 const pointField& start,
158 const pointField& end,
159 List<List<pointIndexHit> >&
162 //- From a set of points and indices get the region
163 virtual void getRegion
165 const List<pointIndexHit>&,
169 //- From a set of points and indices get the normal
170 virtual void getNormal
172 const List<pointIndexHit>&,
176 //- Determine type (inside/outside/mixed) for point. unknown if
177 // cannot be determined (e.g. non-manifold surface)
178 virtual void getVolumeType
185 // regIOobject implementation
187 bool writeData(Ostream&) const
189 notImplemented("searchableSphere::writeData(Ostream&) const");
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 } // End namespace Foam
200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 // ************************************************************************* //