ENH: Renamed curveSet to polyLineSet to better represent sampling method

This commit is contained in:
andy
2010-04-01 12:35:41 +01:00
parent 3060d2a048
commit f99a145143
4 changed files with 41 additions and 41 deletions

View File

@ -60,7 +60,7 @@ fields
// midPoint one point per cell, inbetween two face intersections // midPoint one point per cell, inbetween two face intersections
// midPointAndFace combination of face and midPoint // midPointAndFace combination of face and midPoint
// //
// curve specified points, not nessecary on line, uses // polyLine specified points, not nessecary on line, uses
// tracking // tracking
// cloud specified points, uses findCell // cloud specified points, uses findCell
// triSurfaceMeshPointSet points of triSurface // triSurfaceMeshPointSet points of triSurface
@ -75,7 +75,7 @@ fields
// type specific: // type specific:
// uniform, face, midPoint, midPointAndFace : start and end coordinate // uniform, face, midPoint, midPointAndFace : start and end coordinate
// uniform: extra number of sampling points // uniform: extra number of sampling points
// curve, cloud: list of coordinates // polyLine, cloud: list of coordinates
sets sets
( (
lineX1 lineX1

View File

@ -4,7 +4,7 @@ probes/probesFunctionObject/probesFunctionObject.C
sampledSet/cloud/cloudSet.C sampledSet/cloud/cloudSet.C
sampledSet/coordSet/coordSet.C sampledSet/coordSet/coordSet.C
sampledSet/curve/curveSet.C sampledSet/polyLine/polyLineSet.C
sampledSet/face/faceOnlySet.C sampledSet/face/faceOnlySet.C
sampledSet/midPoint/midPointSet.C sampledSet/midPoint/midPointSet.C
sampledSet/midPointAndFace/midPointAndFaceSet.C sampledSet/midPointAndFace/midPointAndFaceSet.C

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -23,7 +23,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "curveSet.H" #include "polyLineSet.H"
#include "meshSearch.H" #include "meshSearch.H"
#include "DynamicList.H" #include "DynamicList.H"
#include "polyMesh.H" #include "polyMesh.H"
@ -38,22 +38,22 @@ License
namespace Foam namespace Foam
{ {
defineTypeNameAndDebug(curveSet, 0); defineTypeNameAndDebug(polyLineSet, 0);
addToRunTimeSelectionTable(sampledSet, curveSet, word); addToRunTimeSelectionTable(sampledSet, polyLineSet, word);
} }
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// Sample till hits boundary. // Sample till hits boundary.
bool Foam::curveSet::trackToBoundary bool Foam::polyLineSet::trackToBoundary
( (
Particle<passiveParticle>& singleParticle, Particle<passiveParticle>& singleParticle,
label& sampleI, label& sampleI,
DynamicList<point>& samplingPts, DynamicList<point>& samplingPts,
DynamicList<label>& samplingCells, DynamicList<label>& samplingCells,
DynamicList<label>& samplingFaces, DynamicList<label>& samplingFaces,
DynamicList<scalar>& samplingCurveDist DynamicList<scalar>& samplingPolyLineDist
) const ) const
{ {
// Alias // Alias
@ -97,7 +97,7 @@ bool Foam::curveSet::trackToBoundary
samplingFaces.append(facei); samplingFaces.append(facei);
// trackPt is at sampleI+1 // trackPt is at sampleI+1
samplingCurveDist.append(1.0*(sampleI+1)); samplingPolyLineDist.append(1.0*(sampleI+1));
} }
return true; return true;
} }
@ -111,7 +111,7 @@ bool Foam::curveSet::trackToBoundary
scalar dist = scalar dist =
mag(trackPt - sampleCoords_[sampleI]) mag(trackPt - sampleCoords_[sampleI])
/ mag(sampleCoords_[sampleI+1] - sampleCoords_[sampleI]); / mag(sampleCoords_[sampleI+1] - sampleCoords_[sampleI]);
samplingCurveDist.append(sampleI + dist); samplingPolyLineDist.append(sampleI + dist);
// go to next samplePt // go to next samplePt
sampleI++; sampleI++;
@ -127,19 +127,19 @@ bool Foam::curveSet::trackToBoundary
} }
void Foam::curveSet::calcSamples void Foam::polyLineSet::calcSamples
( (
DynamicList<point>& samplingPts, DynamicList<point>& samplingPts,
DynamicList<label>& samplingCells, DynamicList<label>& samplingCells,
DynamicList<label>& samplingFaces, DynamicList<label>& samplingFaces,
DynamicList<label>& samplingSegments, DynamicList<label>& samplingSegments,
DynamicList<scalar>& samplingCurveDist DynamicList<scalar>& samplingPolyLineDist
) const ) const
{ {
// Check sampling points // Check sampling points
if (sampleCoords_.size() < 2) if (sampleCoords_.size() < 2)
{ {
FatalErrorIn("curveSet::calcSamples()") FatalErrorIn("polyLineSet::calcSamples()")
<< "Incorrect sample specification. Too few points:" << "Incorrect sample specification. Too few points:"
<< sampleCoords_ << exit(FatalError); << sampleCoords_ << exit(FatalError);
} }
@ -148,7 +148,7 @@ void Foam::curveSet::calcSamples
{ {
if (mag(sampleCoords_[sampleI] - oldPoint) < SMALL) if (mag(sampleCoords_[sampleI] - oldPoint) < SMALL)
{ {
FatalErrorIn("curveSet::calcSamples()") FatalErrorIn("polyLineSet::calcSamples()")
<< "Incorrect sample specification." << "Incorrect sample specification."
<< " Point " << sampleCoords_[sampleI-1] << " Point " << sampleCoords_[sampleI-1]
<< " at position " << sampleI-1 << " at position " << sampleI-1
@ -227,12 +227,12 @@ void Foam::curveSet::calcSamples
samplingCells.append(trackCellI); samplingCells.append(trackCellI);
samplingFaces.append(trackFaceI); samplingFaces.append(trackFaceI);
// Convert sampling position to unique curve parameter. Get // Convert sampling position to unique poly line parameter. Get
// fraction of distance between sampleI and sampleI+1. // fraction of distance between sampleI and sampleI+1.
scalar dist = scalar dist =
mag(trackPt - sampleCoords_[sampleI]) mag(trackPt - sampleCoords_[sampleI])
/ mag(sampleCoords_[sampleI+1] - sampleCoords_[sampleI]); / mag(sampleCoords_[sampleI+1] - sampleCoords_[sampleI]);
samplingCurveDist.append(sampleI + dist); samplingPolyLineDist.append(sampleI + dist);
lastSample = trackPt; lastSample = trackPt;
} }
@ -273,7 +273,7 @@ void Foam::curveSet::calcSamples
samplingPts, samplingPts,
samplingCells, samplingCells,
samplingFaces, samplingFaces,
samplingCurveDist samplingPolyLineDist
); );
// fill sampleSegments // fill sampleSegments
@ -310,14 +310,14 @@ void Foam::curveSet::calcSamples
} }
void Foam::curveSet::genSamples() void Foam::polyLineSet::genSamples()
{ {
// Storage for sample points // Storage for sample points
DynamicList<point> samplingPts; DynamicList<point> samplingPts;
DynamicList<label> samplingCells; DynamicList<label> samplingCells;
DynamicList<label> samplingFaces; DynamicList<label> samplingFaces;
DynamicList<label> samplingSegments; DynamicList<label> samplingSegments;
DynamicList<scalar> samplingCurveDist; DynamicList<scalar> samplingPolyLineDist;
calcSamples calcSamples
( (
@ -325,14 +325,14 @@ void Foam::curveSet::genSamples()
samplingCells, samplingCells,
samplingFaces, samplingFaces,
samplingSegments, samplingSegments,
samplingCurveDist samplingPolyLineDist
); );
samplingPts.shrink(); samplingPts.shrink();
samplingCells.shrink(); samplingCells.shrink();
samplingFaces.shrink(); samplingFaces.shrink();
samplingSegments.shrink(); samplingSegments.shrink();
samplingCurveDist.shrink(); samplingPolyLineDist.shrink();
setSamples setSamples
( (
@ -340,14 +340,14 @@ void Foam::curveSet::genSamples()
samplingCells, samplingCells,
samplingFaces, samplingFaces,
samplingSegments, samplingSegments,
samplingCurveDist samplingPolyLineDist
); );
} }
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::curveSet::curveSet Foam::polyLineSet::polyLineSet
( (
const word& name, const word& name,
const polyMesh& mesh, const polyMesh& mesh,
@ -368,7 +368,7 @@ Foam::curveSet::curveSet
} }
Foam::curveSet::curveSet Foam::polyLineSet::polyLineSet
( (
const word& name, const word& name,
const polyMesh& mesh, const polyMesh& mesh,
@ -390,13 +390,13 @@ Foam::curveSet::curveSet
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::curveSet::~curveSet() Foam::polyLineSet::~polyLineSet()
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::point Foam::curveSet::getRefPoint(const List<point>& pts) const Foam::point Foam::polyLineSet::getRefPoint(const List<point>& pts) const
{ {
if (pts.size()) if (pts.size())
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -22,17 +22,18 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class Class
Foam::curveSet Foam::polyLineSet
Description Description
Sample along poly line defined by a list of points (knots)
SourceFiles SourceFiles
curveSet.C polyLineSet.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef curveSet_H #ifndef polyLineSet_H
#define curveSet_H #define polyLineSet_H
#include "sampledSet.H" #include "sampledSet.H"
#include "DynamicList.H" #include "DynamicList.H"
@ -47,10 +48,10 @@ class passiveParticle;
template<class Type> class Particle; template<class Type> class Particle;
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class curveSet Declaration Class polyLineSet Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class curveSet class polyLineSet
: :
public sampledSet public sampledSet
{ {
@ -72,7 +73,7 @@ class curveSet
DynamicList<point>& samplingPts, DynamicList<point>& samplingPts,
DynamicList<label>& samplingCells, DynamicList<label>& samplingCells,
DynamicList<label>& samplingFaces, DynamicList<label>& samplingFaces,
DynamicList<scalar>& samplingCurveDist DynamicList<scalar>& samplingPolyLineDist
) const; ) const;
//- Samples all point in sampleCoords_ //- Samples all point in sampleCoords_
@ -83,7 +84,7 @@ class curveSet
DynamicList<label>& samplingCells, DynamicList<label>& samplingCells,
DynamicList<label>& samplingFaces, DynamicList<label>& samplingFaces,
DynamicList<label>& samplingSegments, DynamicList<label>& samplingSegments,
DynamicList<scalar>& samplingCurveDist DynamicList<scalar>& samplingPolyLineDist
) const; ) const;
//- Uses calcSamples to obtain samples. Copies them into *this. //- Uses calcSamples to obtain samples. Copies them into *this.
@ -93,13 +94,13 @@ class curveSet
public: public:
//- Runtime type information //- Runtime type information
TypeName("curve"); TypeName("polyLine");
// Constructors // Constructors
//- Construct from components //- Construct from components
curveSet polyLineSet
( (
const word& name, const word& name,
const polyMesh& mesh, const polyMesh& mesh,
@ -109,7 +110,7 @@ public:
); );
//- Construct from dictionary //- Construct from dictionary
curveSet polyLineSet
( (
const word& name, const word& name,
const polyMesh& mesh, const polyMesh& mesh,
@ -119,8 +120,7 @@ public:
// Destructor // Destructor
virtual ~polyLineSet();
virtual ~curveSet();
// Member Functions // Member Functions