OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

searchableSurfaceCollection.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     Foam::searchableSurfaceCollection
00027 
00028 Description
00029     Set of transformed searchableSurfaces. Does not do boolean operations.
00030     So when meshing might find parts 'inside'.
00031 
00032 SourceFiles
00033     searchableSurfaceCollection.C
00034 
00035 \*---------------------------------------------------------------------------*/
00036 
00037 #ifndef searchableSurfaceCollection_H
00038 #define searchableSurfaceCollection_H
00039 
00040 #include "searchableSurface.H"
00041 #include "treeBoundBox.H"
00042 #include "coordinateSystem.H"
00043 #include "UPtrList.H"
00044 #include "Switch.H"
00045 
00046 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00047 
00048 namespace Foam
00049 {
00050 
00051 // Forward declaration of classes
00052 
00053 /*---------------------------------------------------------------------------*\
00054                  Class searchableSurfaceCollection Declaration
00055 \*---------------------------------------------------------------------------*/
00056 
00057 class searchableSurfaceCollection
00058 :
00059     public searchableSurface
00060 {
00061 private:
00062 
00063     // Private Member Data
00064 
00065         // Per instance data
00066 
00067             //- instance name
00068             wordList instance_;
00069 
00070             //- scaling vector
00071             vectorField scale_;
00072 
00073             //- transformation
00074             PtrList<coordinateSystem> transform_;
00075 
00076             UPtrList<searchableSurface> subGeom_;
00077 
00078             Switch mergeSubRegions_;
00079 
00080         //- Region names
00081         mutable wordList regions_;
00082         //- From individual regions to collection regions
00083         mutable labelList regionOffset_;
00084 
00085 
00086     // Private Member Functions
00087 
00088         //- Find point nearest to sample. Updates minDistSqr. Sets nearestInfo
00089         //  and surface index
00090         void findNearest
00091         (
00092             const pointField& samples,
00093             scalarField& minDistSqr,
00094             List<pointIndexHit>& nearestInfo,
00095             labelList& nearestSurf
00096         ) const;
00097 
00098 
00099         //- Disallow default bitwise copy construct
00100         searchableSurfaceCollection(const searchableSurfaceCollection&);
00101 
00102         //- Disallow default bitwise assignment
00103         void operator=(const searchableSurfaceCollection&);
00104 
00105 
00106 public:
00107 
00108     //- Runtime type information
00109     TypeName("searchableSurfaceCollection");
00110 
00111 
00112     // Constructors
00113 
00114         //- Construct from dictionary (used by searchableSurface)
00115         searchableSurfaceCollection
00116         (
00117             const IOobject& io,
00118             const dictionary& dict
00119         );
00120 
00121     // Destructor
00122 
00123         virtual ~searchableSurfaceCollection();
00124 
00125 
00126     // Member Functions
00127 
00128         virtual const wordList& regions() const;
00129 
00130         //- Whether supports volume type below
00131         virtual bool hasVolumeType() const
00132         {
00133             return false;
00134         }
00135 
00136         //- Range of local indices that can be returned.
00137         virtual label size() const;
00138 
00139 
00140         // Multiple point queries.
00141 
00142             virtual void findNearest
00143             (
00144                 const pointField& sample,
00145                 const scalarField& nearestDistSqr,
00146                 List<pointIndexHit>&
00147             ) const;
00148 
00149             virtual void findLine
00150             (
00151                 const pointField& start,
00152                 const pointField& end,
00153                 List<pointIndexHit>&
00154             ) const;
00155 
00156             virtual void findLineAny
00157             (
00158                 const pointField& start,
00159                 const pointField& end,
00160                 List<pointIndexHit>&
00161             ) const;
00162 
00163             //- Get all intersections in order from start to end.
00164             virtual void findLineAll
00165             (
00166                 const pointField& start,
00167                 const pointField& end,
00168                 List<List<pointIndexHit> >&
00169             ) const;
00170 
00171             //- From a set of points and indices get the region
00172             virtual void getRegion
00173             (
00174                 const List<pointIndexHit>&,
00175                 labelList& region
00176             ) const;
00177 
00178             //- From a set of points and indices get the normal
00179             virtual void getNormal
00180             (
00181                 const List<pointIndexHit>&,
00182                 vectorField& normal
00183             ) const;
00184 
00185             //- Determine type (inside/outside/mixed) for point. unknown if
00186             //  cannot be determined (e.g. non-manifold surface)
00187             virtual void getVolumeType
00188             (
00189                 const pointField&,
00190                 List<volumeType>&
00191             ) const;
00192 
00193 
00194         // regIOobject implementation
00195 
00196             bool writeData(Ostream&) const
00197             {
00198                 notImplemented
00199                 (
00200                     "searchableSurfaceCollection::writeData(Ostream&) const"
00201                 );
00202                 return false;
00203             }
00204 
00205 };
00206 
00207 
00208 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00209 
00210 } // End namespace Foam
00211 
00212 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00213 
00214 #endif
00215 
00216 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd