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::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
133 virtual ~searchableCylinder();
138 virtual const wordList& regions() const;
140 //- Whether supports volume type below
141 virtual bool hasVolumeType() const
146 //- Range of local indices that can be returned.
147 virtual label size() const
152 //- Get representative set of element coordinates
153 // Usually the element centres (should be of length size()).
154 virtual pointField coordinates() const;
157 // Multiple point queries.
159 virtual void findNearest
161 const pointField& sample,
162 const scalarField& nearestDistSqr,
166 virtual void findLine
168 const pointField& start,
169 const pointField& end,
173 virtual void findLineAny
175 const pointField& start,
176 const pointField& end,
180 //- Get all intersections in order from start to end.
181 virtual void findLineAll
183 const pointField& start,
184 const pointField& end,
185 List<List<pointIndexHit> >&
188 //- From a set of points and indices get the region
189 virtual void getRegion
191 const List<pointIndexHit>&,
195 //- From a set of points and indices get the normal
196 virtual void getNormal
198 const List<pointIndexHit>&,
202 //- Determine type (inside/outside/mixed) for point. unknown if
203 // cannot be determined (e.g. non-manifold surface)
204 virtual void getVolumeType
211 // regIOobject implementation
213 bool writeData(Ostream&) const
215 notImplemented("searchableCylinder::writeData(Ostream&) const");
222 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
224 } // End namespace Foam
226 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
230 // ************************************************************************* //