1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2010 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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, see <http://www.gnu.org/licenses/>.
25 Foam::searchableCylinder
33 \*---------------------------------------------------------------------------*/
35 #ifndef searchableCylinder_H
36 #define searchableCylinder_H
38 #include "treeBoundBox.H"
39 #include "searchableSurface.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 // Forward declaration of classes
48 /*---------------------------------------------------------------------------*\
49 Class searchableCylinder Declaration
50 \*---------------------------------------------------------------------------*/
52 class searchableCylinder
54 public searchableSurface
58 // Private Member Data
66 //- length of vector point2-point1
69 //- normalised vector point2-point1
70 const vector unitDir_;
76 mutable wordList regions_;
79 // Private Member Functions
81 //- Find nearest point on cylinder.
82 pointIndexHit findNearest
85 const scalar nearestDistSqr
88 scalar radius2(const point& pt) const;
90 //- Find intersection with cylinder
100 //- Disallow default bitwise copy construct
101 searchableCylinder(const searchableCylinder&);
103 //- Disallow default bitwise assignment
104 void operator=(const searchableCylinder&);
109 //- Runtime type information
110 TypeName("searchableCylinder");
115 //- Construct from components
124 //- Construct from dictionary (used by searchableSurface)
128 const dictionary& dict
132 virtual ~searchableCylinder();
137 virtual const wordList& regions() const;
139 //- Whether supports volume type below
140 virtual bool hasVolumeType() const
145 //- Range of local indices that can be returned.
146 virtual label size() const
151 //- Get representative set of element coordinates
152 // Usually the element centres (should be of length size()).
153 virtual pointField coordinates() const;
156 // Multiple point queries.
158 virtual void findNearest
160 const pointField& sample,
161 const scalarField& nearestDistSqr,
165 virtual void findLine
167 const pointField& start,
168 const pointField& end,
172 virtual void findLineAny
174 const pointField& start,
175 const pointField& end,
179 //- Get all intersections in order from start to end.
180 virtual void findLineAll
182 const pointField& start,
183 const pointField& end,
184 List<List<pointIndexHit> >&
187 //- From a set of points and indices get the region
188 virtual void getRegion
190 const List<pointIndexHit>&,
194 //- From a set of points and indices get the normal
195 virtual void getNormal
197 const List<pointIndexHit>&,
201 //- Determine type (inside/outside/mixed) for point. unknown if
202 // cannot be determined (e.g. non-manifold surface)
203 virtual void getVolumeType
210 // regIOobject implementation
212 bool writeData(Ostream&) const
214 notImplemented("searchableCylinder::writeData(Ostream&) const");
221 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
223 } // End namespace Foam
225 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
229 // ************************************************************************* //