1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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/>.
28 Searching on finite plate. Plate has to be aligned with coordinate
30 Plate defined as origin and span. One of the components of span has
31 to be 0 which defines the normal direction. E.g.
33 span = (Sx Sy 0) // plate in x-y plane
36 now plane is from (Ox Oy Oz) to (Ox+Sx Oy+Sy Oz)
41 \*---------------------------------------------------------------------------*/
43 #ifndef searchablePlate_H
44 #define searchablePlate_H
46 #include "searchableSurface.H"
47 #include "treeBoundBox.H"
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 // Forward declaration of classes
56 /*---------------------------------------------------------------------------*\
57 Class searchablePlate Declaration
58 \*---------------------------------------------------------------------------*/
62 public searchableSurface
66 // Private Member Data
72 //- Coordinate direction which is normal
73 const direction normalDir_;
75 mutable wordList regions_;
78 // Private Member Functions
80 //- Calculate normal direction from span
81 static direction calcNormal(const point&);
83 pointIndexHit findNearest
86 const scalar nearestDistSqr
89 pointIndexHit findLine
96 //- Disallow default bitwise copy construct
97 searchablePlate(const searchablePlate&);
99 //- Disallow default bitwise assignment
100 void operator=(const searchablePlate&);
105 //- Runtime type information
106 TypeName("searchablePlate");
111 //- Construct from components
119 //- Construct from dictionary (used by searchableSurface)
123 const dictionary& dict
127 virtual ~searchablePlate();
132 virtual const wordList& regions() const;
134 //- Whether supports volume type below
135 virtual bool hasVolumeType() const
140 //- Range of local indices that can be returned.
141 virtual label size() const
146 //- Get representative set of element coordinates
147 // Usually the element centres (should be of length size()).
148 virtual pointField coordinates() const
150 return pointField(1, origin_);
154 // Multiple point queries.
156 virtual void findNearest
158 const pointField& sample,
159 const scalarField& nearestDistSqr,
163 virtual void findLine
165 const pointField& start,
166 const pointField& end,
170 virtual void findLineAny
172 const pointField& start,
173 const pointField& end,
177 //- Get all intersections in order from start to end.
178 virtual void findLineAll
180 const pointField& start,
181 const pointField& end,
182 List<List<pointIndexHit> >&
185 //- From a set of points and indices get the region
186 virtual void getRegion
188 const List<pointIndexHit>&,
192 //- From a set of points and indices get the normal
193 virtual void getNormal
195 const List<pointIndexHit>&,
199 //- Determine type (inside/outside/mixed) for point. unknown if
200 // cannot be determined (e.g. non-manifold surface)
201 virtual void getVolumeType
208 // regIOobject implementation
210 bool writeData(Ostream&) const
212 notImplemented("searchablePlate::writeData(Ostream&) const");
219 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
221 } // End namespace Foam
223 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
227 // ************************************************************************* //