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::searchableSurfaces
28 Container for searchableSurfaces.
33 \*---------------------------------------------------------------------------*/
35 #ifndef searchableSurfaces_H
36 #define searchableSurfaces_H
38 #include "searchableSurface.H"
39 #include "labelPair.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 // Forward declaration of classes
48 /*---------------------------------------------------------------------------*\
49 Class searchableSurfaces Declaration
50 \*---------------------------------------------------------------------------*/
52 class searchableSurfaces
54 public PtrList<searchableSurface>
61 //- Region names per surface
62 List<wordList> regionNames_;
64 ////- From global region name to surface and region on surface
65 //HashTable<labelPair> regionNames_;
67 //- Indices of all surfaces. Precalculated and stored.
68 labelList allSurfaces_;
71 // Private Member Functions
73 //- Disallow default bitwise copy construct
74 searchableSurfaces(const searchableSurfaces&);
76 //- Disallow default bitwise assignment
77 void operator=(const searchableSurfaces&);
82 ClassName("searchableSurfaces");
86 //- Construct with length specified. Fill later.
87 explicit searchableSurfaces(const label);
90 ////- Construct from list of dictionaries
91 //searchableSurfaces(const IOobject&, const PtrList<dictionary>&);
93 //- Construct from dictionary
94 searchableSurfaces(const IOobject&, const dictionary&);
99 const wordList& names() const
108 const List<wordList>& regionNames() const
112 List<wordList>& regionNames()
118 ////- If adding surfaces 'by hand'
119 //HashTable<labelPair>& regionNames()
121 // return regionNames_;
123 ////- Get surface and region for a name
124 //const labelPair& surfaceRegion(const word& globalRegion) const
126 // return regionNames_[globalRegion];
129 //- Find index of surface. Return -1 if not found.
130 label findSurfaceID(const word& name) const;
133 // Multiple point queries.
135 //- Find any intersection. Return hit point information and
136 // surface number. If multiple surfaces hit the first surface
137 // is returned, not necessarily the nearest (to start).
138 void findAnyIntersection
140 const pointField& start,
141 const pointField& end,
146 //- Find all intersections in order from start to end. Returns for
147 // every hit the surface and the hit info.
148 void findAllIntersections
150 const pointField& start,
151 const pointField& end,
152 labelListList& surfaces,
153 List<List<pointIndexHit> >&
156 //- Find nearest. Return -1 (and a miss()) or surface and nearest
161 const scalarField& nearestDistSqr,
167 // Single point queries
169 //- Calculate point which is on a set of surfaces.
170 pointIndexHit facesIntersection
172 const scalar initialDistSqr,
173 const scalar convergenceDistSqr,
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 } // End namespace Foam
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 // ************************************************************************* //