1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 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 // Private Member Functions
74 //- Disallow default bitwise copy construct
75 searchableSurfaces(const searchableSurfaces&);
77 //- Disallow default bitwise assignment
78 void operator=(const searchableSurfaces&);
83 ClassName("searchableSurfaces");
87 //- Construct with length specified. Fill later.
88 explicit searchableSurfaces(const label);
91 ////- Construct from list of dictionaries
92 //searchableSurfaces(const IOobject&, const PtrList<dictionary>&);
94 //- Construct from dictionary
95 searchableSurfaces(const IOobject&, const dictionary&);
100 const wordList& names() const
109 const List<wordList>& regionNames() const
113 List<wordList>& regionNames()
119 ////- If adding surfaces 'by hand'
120 //HashTable<labelPair>& regionNames()
122 // return regionNames_;
124 ////- Get surface and region for a name
125 //const labelPair& surfaceRegion(const word& globalRegion) const
127 // return regionNames_[globalRegion];
130 //- Find index of surface. Return -1 if not found.
131 label findSurfaceID(const word& name) const;
134 // Multiple point queries.
136 //- Find any intersection. Return hit point information and
137 // surface number. If multiple surfaces hit the first surface
138 // is returned, not necessarily the nearest (to start).
139 void findAnyIntersection
141 const pointField& start,
142 const pointField& end,
147 //- Find all intersections in order from start to end. Returns for
148 // every hit the surface and the hit info.
149 void findAllIntersections
151 const pointField& start,
152 const pointField& end,
153 labelListList& surfaces,
154 List<List<pointIndexHit> >&
157 //- Find nearest. Return -1 (and a miss()) or surface and nearest
162 const scalarField& nearestDistSqr,
168 // Single point queries
170 //- Calculate point which is on a set of surfaces.
171 pointIndexHit facesIntersection
173 const scalar initialDistSqr,
174 const scalar convergenceDistSqr,
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 } // End namespace Foam
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 // ************************************************************************* //