1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
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
26 Foam::searchableSurfaces
29 Container for searchableSurfaces.
34 \*---------------------------------------------------------------------------*/
36 #ifndef searchableSurfaces_H
37 #define searchableSurfaces_H
39 #include "searchableSurface.H"
40 #include "labelPair.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 // Forward declaration of classes
49 /*---------------------------------------------------------------------------*\
50 Class searchableSurfaces Declaration
51 \*---------------------------------------------------------------------------*/
53 class searchableSurfaces
55 public PtrList<searchableSurface>
62 //- Region names per surface
63 List<wordList> regionNames_;
65 ////- From global region name to surface and region on surface
66 //HashTable<labelPair> regionNames_;
68 //- Indices of all surfaces. Precalculated and stored.
69 labelList allSurfaces_;
72 //- Disallow default bitwise copy construct
73 searchableSurfaces(const searchableSurfaces&);
75 //- Disallow default bitwise assignment
76 void operator=(const searchableSurfaces&);
81 ClassName("searchableSurfaces");
85 //- Construct with length specified. Fill later.
86 explicit searchableSurfaces(const label);
89 ////- Construct from list of dictionaries
90 //searchableSurfaces(const IOobject&, const PtrList<dictionary>&);
92 //- Construct from dictionary
93 searchableSurfaces(const IOobject&, const dictionary&);
98 const wordList& names() const
107 const List<wordList>& regionNames() const
111 List<wordList>& regionNames()
117 ////- If adding surfaces 'by hand'
118 //HashTable<labelPair>& regionNames()
120 // return regionNames_;
122 ////- Get surface and region for a name
123 //const labelPair& surfaceRegion(const word& globalRegion) const
125 // return regionNames_[globalRegion];
128 //- Find index of surface. Return -1 if not found.
129 label findSurfaceID(const word& name) const;
132 // Multiple point queries.
134 //- Find any intersection. Return hit point information and
135 // surface number. If multiple surfaces hit the first surface
136 // is returned, not necessarily the nearest (to start).
137 void findAnyIntersection
139 const pointField& start,
140 const pointField& end,
145 //- Find all intersections in order from start to end. Returns for
146 // every hit the surface and the hit info.
147 void findAllIntersections
149 const pointField& start,
150 const pointField& end,
151 labelListList& surfaces,
152 List<List<pointIndexHit> >& surfaceHits
155 //- Find nearest. Return -1 (and a miss()) or surface and nearest
160 const scalarField& nearestDistSqr,
166 // Single point queries
168 //- Calculate point which is on a set of surfaces.
169 pointIndexHit facesIntersection
171 const scalar initialDistSqr,
172 const scalar convergenceDistSqr,
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 } // End namespace Foam
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 // ************************************************************************* //