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::searchableSurfaceCollection
28 Set of transformed searchableSurfaces. Does not do boolean operations.
29 So when meshing might find parts 'inside'.
32 searchableSurfaceCollection.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef searchableSurfaceCollection_H
37 #define searchableSurfaceCollection_H
39 #include "searchableSurface.H"
40 #include "treeBoundBox.H"
41 #include "coordinateSystem.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 // Forward declaration of classes
52 /*---------------------------------------------------------------------------*\
53 Class searchableSurfaceCollection Declaration
54 \*---------------------------------------------------------------------------*/
56 class searchableSurfaceCollection
58 public searchableSurface
62 // Private Member Data
73 PtrList<coordinateSystem> transform_;
75 UPtrList<searchableSurface> subGeom_;
77 Switch mergeSubRegions_;
79 //- offsets for indices coming from different surfaces
80 // (sized with size() of each surface)
81 labelList indexOffset_;
84 mutable wordList regions_;
85 //- From individual regions to collection regions
86 mutable labelList regionOffset_;
89 // Private Member Functions
91 //- Find point nearest to sample. Updates minDistSqr. Sets nearestInfo
95 const pointField& samples,
96 scalarField& minDistSqr,
97 List<pointIndexHit>& nearestInfo,
98 labelList& nearestSurf
101 //- Sort hits into per-surface bins. Misses are rejected.
102 // Maintains map back to position
105 const List<pointIndexHit>& info,
106 List<List<pointIndexHit> >& surfInfo,
107 labelListList& infoMap
111 //- Disallow default bitwise copy construct
112 searchableSurfaceCollection(const searchableSurfaceCollection&);
114 //- Disallow default bitwise assignment
115 void operator=(const searchableSurfaceCollection&);
120 //- Runtime type information
121 TypeName("searchableSurfaceCollection");
126 //- Construct from dictionary (used by searchableSurface)
127 searchableSurfaceCollection
130 const dictionary& dict
135 virtual ~searchableSurfaceCollection();
140 virtual const wordList& regions() const;
142 //- Whether supports volume type below
143 virtual bool hasVolumeType() const
148 //- Range of local indices that can be returned.
149 virtual label size() const;
151 //- Get representative set of element coordinates
152 // Usually the element centres (should be of length size()).
153 virtual pointField coordinates() const;
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
211 //- Set bounds of surface. Bounds currently set as list of
212 // bounding boxes. The bounds are hints to the surface as for
213 // the range of queries it can expect. faceMap/pointMap can be
214 // set if the surface has done any redistribution.
215 virtual void distribute
217 const List<treeBoundBox>&,
218 const bool keepNonLocal,
219 autoPtr<mapDistribute>& faceMap,
220 autoPtr<mapDistribute>& pointMap
223 //- WIP. Store element-wise field.
224 virtual void setField(const labelList& values);
226 //- WIP. From a set of hits (points and
227 // indices) get the specified field. Misses do not get set. Return
228 // empty field if not supported.
229 virtual void getField(const List<pointIndexHit>&, labelList&) const;
231 // regIOobject implementation
233 bool writeData(Ostream&) const
237 "searchableSurfaceCollection::writeData(Ostream&) const"
245 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
247 } // End namespace Foam
249 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
253 // ************************************************************************* //