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

surfaceToPoint.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::surfaceToPoint
00027 
00028 Description
00029     A topoSetSource to selects points based on relation to surface.
00030 
00031     Select based on:
00032     - distance to surface
00033     - inside/outside status to surface
00034       (Uses normal of nearest surface triangle so requires valid surface
00035       topology!)
00036 
00037 SourceFiles
00038     surfaceToPoint.C
00039 
00040 \*---------------------------------------------------------------------------*/
00041 
00042 #ifndef surfaceToPoint_H
00043 #define surfaceToPoint_H
00044 
00045 #include "topoSetSource.H"
00046 #include "Map.H"
00047 
00048 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00049 
00050 namespace Foam
00051 {
00052 class triSurfaceSearch;
00053 
00054 /*---------------------------------------------------------------------------*\
00055                            Class surfaceToPoint Declaration
00056 \*---------------------------------------------------------------------------*/
00057 
00058 class surfaceToPoint
00059 :
00060     public topoSetSource
00061 {
00062 
00063     // Private data
00064 
00065         //- Add usage string
00066         static addToUsageTable usage_;
00067 
00068         //- Name of surface file
00069         fileName surfName_;
00070 
00071         //- if > 0 : include points with distance to surface less than nearDist.
00072         scalar nearDist_;
00073 
00074         //- include all points on opposite sign of normal on nearest surface.
00075         bool includeInside_;
00076 
00077         //- include all points on this sign of normal on nearest surface.
00078         bool includeOutside_;
00079 
00080 
00081     // Private Member Functions
00082 
00083         //- Depending on surface add to or delete from pointSet.
00084         void combine(topoSet& set, const bool add) const;
00085 
00086         //- Check settings at construction time.
00087         void checkSettings() const;
00088 
00089 public:
00090 
00091     //- Runtime type information
00092     TypeName("surfaceToPoint");
00093 
00094     // Constructors
00095 
00096         //- Construct from components
00097         surfaceToPoint
00098         (
00099             const polyMesh& mesh,
00100             const fileName& surfName,
00101             const scalar nearDist,
00102             const bool includeInside,
00103             const bool includeOutside
00104         );
00105 
00106         //- Construct from dictionary
00107         surfaceToPoint
00108         (
00109             const polyMesh& mesh,
00110             const dictionary& dict
00111         );
00112 
00113         //- Construct from Istream
00114         surfaceToPoint
00115         (
00116             const polyMesh& mesh,
00117             Istream&
00118         );
00119 
00120 
00121     // Destructor
00122 
00123         virtual ~surfaceToPoint();
00124 
00125 
00126     // Member Functions
00127 
00128         virtual void applyToSet
00129         (
00130             const topoSetSource::setAction action,
00131             topoSet&
00132         ) const;
00133 
00134 };
00135 
00136 
00137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00138 
00139 } // End namespace Foam
00140 
00141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00142 
00143 #endif
00144 
00145 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd