1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
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::searchableCylinder
34 \*---------------------------------------------------------------------------*/
36 #ifndef searchableCylinder_H
37 #define searchableCylinder_H
39 #include "treeBoundBox.H"
40 #include "searchableSurface.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 // Forward declaration of classes
49 /*---------------------------------------------------------------------------*\
50 Class searchableCylinder Declaration
51 \*---------------------------------------------------------------------------*/
53 class searchableCylinder
55 public searchableSurface
59 // Private Member Data
67 //- length of vector point2-point1
70 //- normalised vector point2-point1
71 const vector unitDir_;
77 mutable wordList regions_;
80 // Private Member Functions
82 //- Find nearest point on cylinder.
83 pointIndexHit findNearest
86 const scalar nearestDistSqr
89 scalar radius2(const point& pt) const;
91 //- Find intersection with cylinder
101 //- Disallow default bitwise copy construct
102 searchableCylinder(const searchableCylinder&);
104 //- Disallow default bitwise assignment
105 void operator=(const searchableCylinder&);
110 //- Runtime type information
111 TypeName("searchableCylinder");
116 //- Construct from components
125 //- Construct from dictionary (used by searchableSurface)
129 const dictionary& dict
134 virtual ~searchableCylinder();
139 virtual const wordList& regions() const;
141 //- Whether supports volume type below
142 virtual bool hasVolumeType() const
147 //- Range of local indices that can be returned.
148 virtual label size() const
153 //- Get representative set of element coordinates
154 // Usually the element centres (should be of length size()).
155 virtual pointField coordinates() const;
158 // Multiple point queries.
160 virtual void findNearest
162 const pointField& sample,
163 const scalarField& nearestDistSqr,
167 virtual void findLine
169 const pointField& start,
170 const pointField& end,
174 virtual void findLineAny
176 const pointField& start,
177 const pointField& end,
181 //- Get all intersections in order from start to end.
182 virtual void findLineAll
184 const pointField& start,
185 const pointField& end,
186 List<List<pointIndexHit> >&
189 //- From a set of points and indices get the region
190 virtual void getRegion
192 const List<pointIndexHit>&,
196 //- From a set of points and indices get the normal
197 virtual void getNormal
199 const List<pointIndexHit>&,
203 //- Determine type (inside/outside/mixed) for point. unknown if
204 // cannot be determined (e.g. non-manifold surface)
205 virtual void getVolumeType
212 // regIOobject implementation
214 bool writeData(Ostream&) const
216 notImplemented("searchableCylinder::writeData(Ostream&) const");
223 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
225 } // End namespace Foam
227 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
231 // ************************************************************************* //