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
29 Searching on finite plate. Plate has to be aligned with coordinate
31 Plate defined as origin and span. One of the components of span has
32 to be 0 which defines the normal direction. E.g.
34 span = (Sx Sy 0) // plate in x-y plane
37 now plane is from (Ox Oy Oz) to (Ox+Sx Oy+Sy Oz)
42 \*---------------------------------------------------------------------------*/
44 #ifndef searchablePlate_H
45 #define searchablePlate_H
47 #include "searchableSurface.H"
48 #include "treeBoundBox.H"
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55 // Forward declaration of classes
57 /*---------------------------------------------------------------------------*\
58 Class searchablePlate Declaration
59 \*---------------------------------------------------------------------------*/
63 public searchableSurface
67 // Private Member Data
73 //- Coordinate direction which is normal
74 const direction normalDir_;
76 mutable wordList regions_;
79 // Private Member Functions
81 //- Calculate normal direction from span
82 static direction calcNormal(const point&);
84 pointIndexHit findNearest
87 const scalar nearestDistSqr
90 pointIndexHit findLine
97 //- Disallow default bitwise copy construct
98 searchablePlate(const searchablePlate&);
100 //- Disallow default bitwise assignment
101 void operator=(const searchablePlate&);
106 //- Runtime type information
107 TypeName("searchablePlate");
112 //- Construct from components
120 //- Construct from dictionary (used by searchableSurface)
124 const dictionary& dict
129 virtual ~searchablePlate();
134 virtual const wordList& regions() const;
136 //- Whether supports volume type below
137 virtual bool hasVolumeType() const
142 //- Range of local indices that can be returned.
143 virtual label size() const
148 //- Get representative set of element coordinates
149 // Usually the element centres (should be of length size()).
150 virtual pointField coordinates() const
152 return pointField(1, origin_);
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("searchablePlate::writeData(Ostream&) const");
221 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
223 } // End namespace Foam
225 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
229 // ************************************************************************* //