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

patchCloudSet.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) 2011-2011 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::patchCloudSet
00026 
00027 Description
00028     Like cloudSet but samples nearest patch face
00029 
00030 
00031 SourceFiles
00032     patchCloudSet.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef patchCloudSet_H
00037 #define patchCloudSet_H
00038 
00039 #include <sampling/sampledSet.H>
00040 #include <OpenFOAM/DynamicList.H>
00041 #include <OpenFOAM/HashSet.H>
00042 
00043 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00044 
00045 namespace Foam
00046 {
00047 
00048 /*---------------------------------------------------------------------------*\
00049                            Class patchCloudSet Declaration
00050 \*---------------------------------------------------------------------------*/
00051 
00052 class patchCloudSet
00053 :
00054     public sampledSet
00055 {
00056     // Private data
00057 
00058         //- Sampling points
00059         const List<point> sampleCoords_;
00060 
00061         //- Patches to sample
00062         const labelHashSet patchSet_;
00063 
00064         //- Maximum distance to look for nearest
00065         const scalar searchDist_;
00066 
00067 
00068     // Private Member Functions
00069 
00070         //- Samples all points in sampleCoords.
00071         void calcSamples
00072         (
00073             DynamicList<point>& samplingPts,
00074             DynamicList<label>& samplingCells,
00075             DynamicList<label>& samplingFaces,
00076             DynamicList<label>& samplingSegments,
00077             DynamicList<scalar>& samplingCurveDist
00078         ) const;
00079 
00080         //- Uses calcSamples to obtain samples. Copies them into *this.
00081         void genSamples();
00082 
00083 
00084 public:
00085 
00086     //- Runtime type information
00087     TypeName("patchCloud");
00088 
00089 
00090     // Constructors
00091 
00092         //- Construct from components
00093         patchCloudSet
00094         (
00095             const word& name,
00096             const polyMesh& mesh,
00097             meshSearch& searchEngine,
00098             const word& axis,
00099             const List<point>& sampleCoords,
00100             const labelHashSet& patchSet,
00101             const scalar searchDist
00102         );
00103 
00104         //- Construct from dictionary
00105         patchCloudSet
00106         (
00107             const word& name,
00108             const polyMesh& mesh,
00109             meshSearch& searchEngine,
00110             const dictionary& dict
00111         );
00112 
00113 
00114     //- Destructor
00115     virtual ~patchCloudSet();
00116 
00117 
00118     // Member Functions
00119 
00120         //- Get reference point
00121         virtual point getRefPoint(const List<point>&) const;
00122 };
00123 
00124 
00125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00126 
00127 } // End namespace Foam
00128 
00129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00130 
00131 #endif
00132 
00133 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines