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/>.
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
128 virtual ~searchablePlate();
133 virtual const wordList& regions() const;
135 //- Whether supports volume type below
136 virtual bool hasVolumeType() const
141 //- Range of local indices that can be returned.
142 virtual label size() const
147 //- Get representative set of element coordinates
148 // Usually the element centres (should be of length size()).
149 virtual pointField coordinates() const
151 return pointField(1, origin_);
155 // Multiple point queries.
157 virtual void findNearest
159 const pointField& sample,
160 const scalarField& nearestDistSqr,
164 virtual void findLine
166 const pointField& start,
167 const pointField& end,
171 virtual void findLineAny
173 const pointField& start,
174 const pointField& end,
178 //- Get all intersections in order from start to end.
179 virtual void findLineAll
181 const pointField& start,
182 const pointField& end,
183 List<List<pointIndexHit> >&
186 //- From a set of points and indices get the region
187 virtual void getRegion
189 const List<pointIndexHit>&,
193 //- From a set of points and indices get the normal
194 virtual void getNormal
196 const List<pointIndexHit>&,
200 //- Determine type (inside/outside/mixed) for point. unknown if
201 // cannot be determined (e.g. non-manifold surface)
202 virtual void getVolumeType
209 // regIOobject implementation
211 bool writeData(Ostream&) const
213 notImplemented("searchablePlate::writeData(Ostream&) const");
220 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
222 } // End namespace Foam
224 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
228 // ************************************************************************* //