OpenFOAM logo
Open Source CFD Toolkit

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