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

curveSet.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::curveSet
00027 
00028 Description
00029 
00030 SourceFiles
00031     curveSet.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef curveSet_H
00036 #define curveSet_H
00037 
00038 #include "sampledSet.H"
00039 #include "DynamicList.H"
00040 
00041 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00042 
00043 namespace Foam
00044 {
00045 
00046 // Forward declaration of classes
00047 class passiveParticle;
00048 template<class Type> class Particle;
00049 
00050 /*---------------------------------------------------------------------------*\
00051                            Class curveSet Declaration
00052 \*---------------------------------------------------------------------------*/
00053 
00054 class curveSet
00055 :
00056     public sampledSet
00057 {
00058     // Private data
00059 
00060         //- sampling points
00061         List<point> sampleCoords_;
00062 
00063 
00064     // Private Member Functions
00065 
00066         //- Sample till hits boundary. Called with singleParticle at position
00067         //  inbetween sampleCoords_[sampleI] and sampleCoords_[sampleI+1].
00068         //  Returns false if end of samples reached.
00069         bool trackToBoundary
00070         (
00071             Particle<passiveParticle>& singleParticle,
00072             label& sampleI,
00073             DynamicList<point>& samplingPts,
00074             DynamicList<label>& samplingCells,
00075             DynamicList<label>& samplingFaces,
00076             DynamicList<scalar>& samplingCurveDist
00077         ) const;
00078 
00079         //- Samples all point in sampleCoords_
00080         //  samplingSegments contains segmentNo for each sample.
00081         void calcSamples
00082         (
00083             DynamicList<point>& samplingPts,
00084             DynamicList<label>& samplingCells,
00085             DynamicList<label>& samplingFaces,
00086             DynamicList<label>& samplingSegments,
00087             DynamicList<scalar>& samplingCurveDist
00088         ) const;
00089 
00090         //- Uses calcSamples to obtain samples. Copies them into *this.
00091         void genSamples();
00092 
00093 
00094 public:
00095 
00096     //- Runtime type information
00097     TypeName("curve");
00098 
00099 
00100     // Constructors
00101 
00102         //- Construct from components
00103         curveSet
00104         (
00105             const word& name,
00106             const polyMesh& mesh,
00107             meshSearch& searchEngine,
00108             const word& axis,
00109             const List<point>& samplePoints
00110         );
00111 
00112         //- Construct from dictionary
00113         curveSet
00114         (
00115             const word& name,
00116             const polyMesh& mesh,
00117             meshSearch& searchEngine,
00118             const dictionary& dict
00119         );
00120 
00121 
00122     // Destructor
00123 
00124         virtual ~curveSet();
00125 
00126 
00127     // Member Functions
00128 
00129         //- Get reference point
00130         virtual point getRefPoint(const List<point>&) const;
00131 };
00132 
00133 
00134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00135 
00136 } // End namespace Foam
00137 
00138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00139 
00140 #endif
00141 
00142 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd