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