FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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