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

searchablePlane.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::searchablePlane
00027 
00028 Description
00029     Searching on plane. See plane.H
00030 
00031 SourceFiles
00032     searchablePlane.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef searchablePlane_H
00037 #define searchablePlane_H
00038 
00039 #include "searchableSurface.H"
00040 #include "plane.H"
00041 
00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00043 
00044 namespace Foam
00045 {
00046 
00047 // Forward declaration of classes
00048 
00049 /*---------------------------------------------------------------------------*\
00050                            Class searchablePlane Declaration
00051 \*---------------------------------------------------------------------------*/
00052 
00053 class searchablePlane
00054 :
00055     public searchableSurface,
00056     public plane
00057 {
00058 private:
00059 
00060     // Private Member Data
00061 
00062         mutable wordList regions_;
00063 
00064 
00065     // Private Member Functions
00066 
00067         pointIndexHit findLine
00068         (
00069             const point& start,
00070             const point& end
00071         ) const;
00072 
00073 
00074         //- Disallow default bitwise copy construct
00075         searchablePlane(const searchablePlane&);
00076 
00077         //- Disallow default bitwise assignment
00078         void operator=(const searchablePlane&);
00079 
00080 
00081 public:
00082 
00083     //- Runtime type information
00084     TypeName("searchablePlane");
00085 
00086 
00087     // Constructors
00088 
00089         //- Construct from components
00090         searchablePlane
00091         (
00092             const IOobject& io,
00093             const point& basePoint,
00094             const vector& normal
00095         );
00096 
00097         //- Construct from dictionary (used by searchableSurface)
00098         searchablePlane
00099         (
00100             const IOobject& io,
00101             const dictionary& dict
00102         );
00103 
00104     // Destructor
00105 
00106         virtual ~searchablePlane();
00107 
00108 
00109     // Member Functions
00110 
00111         virtual const wordList& regions() const;
00112 
00113         //- Whether supports volume type below
00114         virtual bool hasVolumeType() const
00115         {
00116             return false;
00117         }
00118 
00119         //- Range of local indices that can be returned.
00120         virtual label size() const
00121         {
00122             return 1;
00123         }
00124 
00125 
00126         // Multiple point queries.
00127 
00128             virtual void findNearest
00129             (
00130                 const pointField& sample,
00131                 const scalarField& nearestDistSqr,
00132                 List<pointIndexHit>&
00133             ) const;
00134 
00135             virtual void findLine
00136             (
00137                 const pointField& start,
00138                 const pointField& end,
00139                 List<pointIndexHit>&
00140             ) const;
00141 
00142             virtual void findLineAny
00143             (
00144                 const pointField& start,
00145                 const pointField& end,
00146                 List<pointIndexHit>&
00147             ) const;
00148 
00149             //- Get all intersections in order from start to end.
00150             virtual void findLineAll
00151             (
00152                 const pointField& start,
00153                 const pointField& end,
00154                 List<List<pointIndexHit> >&
00155             ) const;
00156 
00157             //- From a set of points and indices get the region
00158             virtual void getRegion
00159             (
00160                 const List<pointIndexHit>&,
00161                 labelList& region
00162             ) const;
00163 
00164             //- From a set of points and indices get the normal
00165             virtual void getNormal
00166             (
00167                 const List<pointIndexHit>&,
00168                 vectorField& normal
00169             ) const;
00170 
00171             //- Determine type (inside/outside/mixed) for point. unknown if
00172             //  cannot be determined (e.g. non-manifold surface)
00173             virtual void getVolumeType
00174             (
00175                 const pointField&,
00176                 List<volumeType>&
00177             ) const;
00178 
00179 
00180         // regIOobject implementation
00181 
00182             bool writeData(Ostream&) const
00183             {
00184                 notImplemented("searchablePlane::writeData(Ostream&) const");
00185                 return false;
00186             }
00187 
00188 };
00189 
00190 
00191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00192 
00193 } // End namespace Foam
00194 
00195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00196 
00197 #endif
00198 
00199 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd