Files
openfoam/applications/utilities/postProcessing/sampling/sample/sampleSets/face/faceOnlySet.H
2008-04-15 18:56:58 +01:00

154 lines
4.0 KiB
C++

/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::faceOnlySet
Description
SourceFiles
faceOnlySet.C
\*---------------------------------------------------------------------------*/
#ifndef faceOnlySet_H
#define faceOnlySet_H
#include "sampleSet.H"
#include "DynamicList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declaration of classes
class passiveParticle;
template<class Type> class Particle;
/*---------------------------------------------------------------------------*\
Class faceOnlySet Declaration
\*---------------------------------------------------------------------------*/
class faceOnlySet
:
public sampleSet
{
// Private data
//- Starting point
point start_;
//- End point
point end_;
// Private Member Functions
//- Samples from startTrackPt/CellI. Updates particle/samplePt/sampleI
// and puts
// samples in the DynamicLists. Returns false if end of all samples
// reached
bool trackToBoundary
(
Particle<passiveParticle>& singleParticle,
DynamicList<point>& samplingPts,
DynamicList<label>& samplingCells,
DynamicList<label>& samplingFaces,
DynamicList<scalar>& samplingCurve
) const;
//- Samples from start_ to end_. samplingSegments contains segmentNo
// for each sample.
void calcSamples
(
DynamicList<point>& samplingPts,
DynamicList<label>& samplingCells,
DynamicList<label>& samplingFaces,
DynamicList<label>& samplingSegments,
DynamicList<scalar>& samplingCurveDist
) const;
//- Uses calcSamples to obtain samples. Copies them into *this.
void genSamples();
public:
//- Runtime type information
TypeName("face");
// Constructors
//- Construct from components
faceOnlySet
(
const polyMesh& mesh,
meshSearch& searchEngine,
const word& name,
const word& axis,
const point& start,
const point& end
);
//- Construct from dictionary
faceOnlySet
(
const polyMesh& mesh,
meshSearch& searchEngine,
const dictionary& dict
);
// Destructor
virtual ~faceOnlySet();
// Member Functions
const point& start() const
{
return start_;
}
const point& end() const
{
return end_;
}
//- Get reference point
virtual point getRefPoint(const List<point>&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //