mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Update to sampleSets so that distance outputs cumulative distance
along sample path STYLE: Minor code formatting
This commit is contained in:
@ -151,20 +151,4 @@ Foam::cloudSet::~cloudSet()
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::point Foam::cloudSet::getRefPoint(const List<point>& pts) const
|
|
||||||
{
|
|
||||||
if (pts.size())
|
|
||||||
{
|
|
||||||
// Use first samplePt as starting point
|
|
||||||
return pts[0];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return vector::zero;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -75,6 +75,7 @@ class cloudSet
|
|||||||
//- Uses calcSamples to obtain samples. Copies them into *this.
|
//- Uses calcSamples to obtain samples. Copies them into *this.
|
||||||
void genSamples();
|
void genSamples();
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
@ -104,14 +105,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
|
virtual ~cloudSet();
|
||||||
virtual ~cloudSet();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Get reference point
|
|
||||||
virtual point getRefPoint(const List<point>&) const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -25,6 +25,22 @@ License
|
|||||||
|
|
||||||
#include "coordSet.H"
|
#include "coordSet.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<>
|
||||||
|
const char* Foam::NamedEnum<Foam::coordSet::coordFormat, 5>::names[] =
|
||||||
|
{
|
||||||
|
"xyz",
|
||||||
|
"x",
|
||||||
|
"y",
|
||||||
|
"z",
|
||||||
|
"distance"
|
||||||
|
};
|
||||||
|
|
||||||
|
const Foam::NamedEnum<Foam::coordSet::coordFormat, 5>
|
||||||
|
Foam::coordSet::coordFormatNames_;
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
//- Construct from components
|
//- Construct from components
|
||||||
@ -36,8 +52,8 @@ Foam::coordSet::coordSet
|
|||||||
:
|
:
|
||||||
pointField(0),
|
pointField(0),
|
||||||
name_(name),
|
name_(name),
|
||||||
axis_(axis),
|
axis_(coordFormatNames_[axis]),
|
||||||
refPoint_(vector::zero)
|
curveDist_(0)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -47,62 +63,21 @@ Foam::coordSet::coordSet
|
|||||||
const word& name,
|
const word& name,
|
||||||
const word& axis,
|
const word& axis,
|
||||||
const List<point>& points,
|
const List<point>& points,
|
||||||
const point& refPoint
|
const scalarList& curveDist
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
pointField(points),
|
pointField(points),
|
||||||
name_(name),
|
name_(name),
|
||||||
axis_(axis),
|
axis_(coordFormatNames_[axis]),
|
||||||
refPoint_(refPoint)
|
curveDist_(curveDist)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
//- Construct from components
|
|
||||||
Foam::coordSet::coordSet
|
|
||||||
(
|
|
||||||
const word& name,
|
|
||||||
const word& axis,
|
|
||||||
const scalarField& points,
|
|
||||||
const scalar refPoint
|
|
||||||
)
|
|
||||||
:
|
|
||||||
pointField(points.size(), point::zero),
|
|
||||||
name_(name),
|
|
||||||
axis_(axis),
|
|
||||||
refPoint_(point::zero)
|
|
||||||
{
|
|
||||||
if (axis_ == "x" || axis_ == "distance")
|
|
||||||
{
|
|
||||||
refPoint_.x() = refPoint;
|
|
||||||
replace(point::X, points);
|
|
||||||
}
|
|
||||||
else if (axis_ == "y")
|
|
||||||
{
|
|
||||||
replace(point::Y, points);
|
|
||||||
}
|
|
||||||
else if (axis_ == "z")
|
|
||||||
{
|
|
||||||
replace(point::Z, points);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
FatalErrorIn
|
|
||||||
(
|
|
||||||
"coordSet::coordSet(const word& name,"
|
|
||||||
"const word& axis, const List<scalar>& points,"
|
|
||||||
"const scalar refPoint)"
|
|
||||||
) << "Illegal axis specification " << axis_
|
|
||||||
<< " for sampling line " << name_
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
bool Foam::coordSet::hasVectorAxis() const
|
bool Foam::coordSet::hasVectorAxis() const
|
||||||
{
|
{
|
||||||
return axis_ == "xyz";
|
return axis_ == XYZ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -113,22 +88,22 @@ Foam::scalar Foam::coordSet::scalarCoord
|
|||||||
{
|
{
|
||||||
const point& p = operator[](index);
|
const point& p = operator[](index);
|
||||||
|
|
||||||
if (axis_ == "x")
|
if (axis_ == X)
|
||||||
{
|
{
|
||||||
return p.x();
|
return p.x();
|
||||||
}
|
}
|
||||||
else if (axis_ == "y")
|
else if (axis_ == Y)
|
||||||
{
|
{
|
||||||
return p.y();
|
return p.y();
|
||||||
}
|
}
|
||||||
else if (axis_ == "z")
|
else if (axis_ == Z)
|
||||||
{
|
{
|
||||||
return p.z();
|
return p.z();
|
||||||
}
|
}
|
||||||
else if (axis_ == "distance")
|
else if (axis_ == DISTANCE)
|
||||||
{
|
{
|
||||||
// Use distance to reference point
|
// Use distance to reference point
|
||||||
return mag(p - refPoint_);
|
return curveDist_[index];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -154,7 +129,7 @@ Foam::point Foam::coordSet::vectorCoord(const label index) const
|
|||||||
|
|
||||||
Foam::Ostream& Foam::coordSet::write(Ostream& os) const
|
Foam::Ostream& Foam::coordSet::write(Ostream& os) const
|
||||||
{
|
{
|
||||||
os << "name:" << name_ << " axis:" << axis_ << " reference:" << refPoint_
|
os << "name:" << name_ << " axis:" << axis_
|
||||||
<< endl
|
<< endl
|
||||||
<< endl << "\t(coord)"
|
<< endl << "\t(coord)"
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|||||||
@ -52,16 +52,38 @@ class coordSet
|
|||||||
public pointField
|
public pointField
|
||||||
{
|
{
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Public data types
|
||||||
|
|
||||||
|
//- Enumeration defining the output format for coordinates
|
||||||
|
enum coordFormat
|
||||||
|
{
|
||||||
|
XYZ,
|
||||||
|
X,
|
||||||
|
Y,
|
||||||
|
Z,
|
||||||
|
DISTANCE
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
//- String representation of coordFormat enums
|
||||||
|
static const NamedEnum<coordFormat, 5> coordFormatNames_;
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
//- Name
|
//- Name
|
||||||
const word name_;
|
const word name_;
|
||||||
|
|
||||||
//- Axis write type
|
//- Axis write type
|
||||||
const word axis_;
|
const coordFormat axis_;
|
||||||
|
|
||||||
|
//- Cumulative distance "distance" write specifier.
|
||||||
|
scalarList curveDist_;
|
||||||
|
|
||||||
//- Reference point for "distance" write specifier.
|
|
||||||
point refPoint_;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -81,16 +103,7 @@ public:
|
|||||||
const word& name,
|
const word& name,
|
||||||
const word& axis,
|
const word& axis,
|
||||||
const List<point>& points,
|
const List<point>& points,
|
||||||
const point& refPoint = point::zero
|
const scalarList& curveDist
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct from components
|
|
||||||
coordSet
|
|
||||||
(
|
|
||||||
const word& name,
|
|
||||||
const word& axis,
|
|
||||||
const scalarField& points,
|
|
||||||
const scalar refPoint = 0.0
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@ -101,33 +114,26 @@ public:
|
|||||||
return name_;
|
return name_;
|
||||||
}
|
}
|
||||||
|
|
||||||
const word& axis() const
|
word axis() const
|
||||||
{
|
{
|
||||||
return axis_;
|
return coordFormatNames_[axis_];
|
||||||
}
|
}
|
||||||
|
|
||||||
const point& refPoint() const
|
//- Cumulative distance
|
||||||
|
const scalarList& curveDist() const
|
||||||
{
|
{
|
||||||
return refPoint_;
|
return curveDist_;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Is axis specification a vector
|
//- Is axis specification a vector
|
||||||
bool hasVectorAxis() const;
|
bool hasVectorAxis() const;
|
||||||
|
|
||||||
//- Get coordinate of point according to axis specification.
|
//- Get coordinate of point according to axis specification.
|
||||||
// If axis="distance" can be: -distance to starting point (e.g.
|
// If axis="distance" is the curveDist[index]
|
||||||
// uniformSet) or -distance to first sampling point
|
scalar scalarCoord(const label index) const;
|
||||||
// (e.g. cloudSet)
|
|
||||||
scalar scalarCoord
|
|
||||||
(
|
|
||||||
const label index
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Get point according to axis="full" specification
|
//- Get point according to axis="xyz" specification
|
||||||
vector vectorCoord
|
vector vectorCoord(const label index) const;
|
||||||
(
|
|
||||||
const label index
|
|
||||||
) const;
|
|
||||||
|
|
||||||
Ostream& write(Ostream& os) const;
|
Ostream& write(Ostream& os) const;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -64,7 +64,7 @@ bool Foam::faceOnlySet::trackToBoundary
|
|||||||
// Alias
|
// Alias
|
||||||
const point& trackPt = singleParticle.position();
|
const point& trackPt = singleParticle.position();
|
||||||
|
|
||||||
while (true)
|
while(true)
|
||||||
{
|
{
|
||||||
point oldPoint = trackPt;
|
point oldPoint = trackPt;
|
||||||
|
|
||||||
@ -198,7 +198,7 @@ void Foam::faceOnlySet::calcSamples
|
|||||||
// index in bHits; current boundary intersection
|
// index in bHits; current boundary intersection
|
||||||
label bHitI = 1;
|
label bHitI = 1;
|
||||||
|
|
||||||
while (true)
|
while(true)
|
||||||
{
|
{
|
||||||
if (trackFaceI != -1)
|
if (trackFaceI != -1)
|
||||||
{
|
{
|
||||||
@ -229,7 +229,7 @@ void Foam::faceOnlySet::calcSamples
|
|||||||
);
|
);
|
||||||
|
|
||||||
// fill sampleSegments
|
// fill sampleSegments
|
||||||
for (label i = samplingPts.size() - 1; i >= startSegmentI; --i)
|
for(label i = samplingPts.size() - 1; i >= startSegmentI; --i)
|
||||||
{
|
{
|
||||||
samplingSegments.append(segmentI);
|
samplingSegments.append(segmentI);
|
||||||
}
|
}
|
||||||
@ -380,12 +380,4 @@ Foam::faceOnlySet::~faceOnlySet()
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::point Foam::faceOnlySet::getRefPoint(const List<point>& pts) const
|
|
||||||
{
|
|
||||||
return start_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -47,7 +47,7 @@ class passiveParticle;
|
|||||||
template<class Type> class Particle;
|
template<class Type> class Particle;
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class faceOnlySet Declaration
|
Class faceOnlySet Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class faceOnlySet
|
class faceOnlySet
|
||||||
@ -92,6 +92,7 @@ class faceOnlySet
|
|||||||
//- Uses calcSamples to obtain samples. Copies them into *this.
|
//- Uses calcSamples to obtain samples. Copies them into *this.
|
||||||
void genSamples();
|
void genSamples();
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
@ -121,8 +122,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
|
virtual ~faceOnlySet();
|
||||||
virtual ~faceOnlySet();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
@ -136,9 +136,6 @@ public:
|
|||||||
{
|
{
|
||||||
return end_;
|
return end_;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Get reference point
|
|
||||||
virtual point getRefPoint(const List<point>&) const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -53,7 +53,7 @@ void Foam::midPointSet::genSamples()
|
|||||||
|
|
||||||
label sampleI = 0;
|
label sampleI = 0;
|
||||||
|
|
||||||
while (true)
|
while(true)
|
||||||
{
|
{
|
||||||
// calculate midpoint between sampleI and sampleI+1 (if in same segment)
|
// calculate midpoint between sampleI and sampleI+1 (if in same segment)
|
||||||
while
|
while
|
||||||
|
|||||||
@ -58,6 +58,7 @@ class midPointSet
|
|||||||
|
|
||||||
void genSamples();
|
void genSamples();
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
@ -88,8 +89,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
|
virtual ~midPointSet();
|
||||||
virtual ~midPointSet();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -55,7 +55,7 @@ void Foam::midPointAndFaceSet::genSamples()
|
|||||||
|
|
||||||
label sampleI = 0;
|
label sampleI = 0;
|
||||||
|
|
||||||
while (true)
|
while(true)
|
||||||
{
|
{
|
||||||
// sampleI is start of segment
|
// sampleI is start of segment
|
||||||
|
|
||||||
|
|||||||
@ -59,6 +59,7 @@ class midPointAndFaceSet
|
|||||||
|
|
||||||
void genSamples();
|
void genSamples();
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
@ -89,8 +90,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
|
virtual ~midPointAndFaceSet();
|
||||||
virtual ~midPointAndFaceSet();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -394,20 +394,4 @@ Foam::polyLineSet::~polyLineSet()
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::point Foam::polyLineSet::getRefPoint(const List<point>& pts) const
|
|
||||||
{
|
|
||||||
if (pts.size())
|
|
||||||
{
|
|
||||||
// Use first samplePt as starting point
|
|
||||||
return pts[0];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return vector::zero;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -121,12 +121,6 @@ public:
|
|||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
virtual ~polyLineSet();
|
virtual ~polyLineSet();
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Get reference point
|
|
||||||
virtual point getRefPoint(const List<point>&) const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -354,10 +354,11 @@ void Foam::sampledSet::setSamples
|
|||||||
{
|
{
|
||||||
operator[](sampleI) = samplingPts[sampleI];
|
operator[](sampleI) = samplingPts[sampleI];
|
||||||
}
|
}
|
||||||
|
curveDist_ = samplingCurveDist;
|
||||||
|
|
||||||
cells_ = samplingCells;
|
cells_ = samplingCells;
|
||||||
faces_ = samplingFaces;
|
faces_ = samplingFaces;
|
||||||
segments_ = samplingSegments;
|
segments_ = samplingSegments;
|
||||||
curveDist_ = samplingCurveDist;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -375,7 +376,6 @@ Foam::sampledSet::sampledSet
|
|||||||
mesh_(mesh),
|
mesh_(mesh),
|
||||||
searchEngine_(searchEngine),
|
searchEngine_(searchEngine),
|
||||||
segments_(0),
|
segments_(0),
|
||||||
curveDist_(0),
|
|
||||||
cells_(0),
|
cells_(0),
|
||||||
faces_(0)
|
faces_(0)
|
||||||
{}
|
{}
|
||||||
@ -393,7 +393,6 @@ Foam::sampledSet::sampledSet
|
|||||||
mesh_(mesh),
|
mesh_(mesh),
|
||||||
searchEngine_(searchEngine),
|
searchEngine_(searchEngine),
|
||||||
segments_(0),
|
segments_(0),
|
||||||
curveDist_(0),
|
|
||||||
cells_(0),
|
cells_(0),
|
||||||
faces_(0)
|
faces_(0)
|
||||||
{}
|
{}
|
||||||
|
|||||||
@ -41,13 +41,10 @@ SourceFiles
|
|||||||
#ifndef sampledSet_H
|
#ifndef sampledSet_H
|
||||||
#define sampledSet_H
|
#define sampledSet_H
|
||||||
|
|
||||||
#include "pointField.H"
|
#include "coordSet.H"
|
||||||
#include "word.H"
|
|
||||||
#include "labelList.H"
|
|
||||||
#include "typeInfo.H"
|
#include "typeInfo.H"
|
||||||
#include "runTimeSelectionTables.H"
|
#include "runTimeSelectionTables.H"
|
||||||
#include "autoPtr.H"
|
#include "autoPtr.H"
|
||||||
#include "coordSet.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -80,10 +77,6 @@ protected:
|
|||||||
//- Segment numbers
|
//- Segment numbers
|
||||||
labelList segments_;
|
labelList segments_;
|
||||||
|
|
||||||
//- Parameter along sample curve. Uniquely identifies position
|
|
||||||
// along sampling. Used for combining parallel results.
|
|
||||||
scalarList curveDist_;
|
|
||||||
|
|
||||||
//- Cell numbers
|
//- Cell numbers
|
||||||
labelList cells_;
|
labelList cells_;
|
||||||
|
|
||||||
@ -245,8 +238,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
|
virtual ~sampledSet();
|
||||||
virtual ~sampledSet();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
@ -266,11 +258,6 @@ public:
|
|||||||
return segments_;
|
return segments_;
|
||||||
}
|
}
|
||||||
|
|
||||||
const scalarList& curveDist() const
|
|
||||||
{
|
|
||||||
return curveDist_;
|
|
||||||
}
|
|
||||||
|
|
||||||
const labelList& cells() const
|
const labelList& cells() const
|
||||||
{
|
{
|
||||||
return cells_;
|
return cells_;
|
||||||
@ -281,9 +268,6 @@ public:
|
|||||||
return faces_;
|
return faces_;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Given all sampling points (on all processors) return reference point
|
|
||||||
virtual point getRefPoint(const List<point>&) const = 0;
|
|
||||||
|
|
||||||
//- Output for debugging
|
//- Output for debugging
|
||||||
Ostream& write(Ostream&) const;
|
Ostream& write(Ostream&) const;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -100,19 +100,6 @@ void Foam::sampledSets::combineSampledSets
|
|||||||
SortableList<scalar> sortedDist(allCurveDist);
|
SortableList<scalar> sortedDist(allCurveDist);
|
||||||
indexSets[setI] = sortedDist.indices();
|
indexSets[setI] = sortedDist.indices();
|
||||||
|
|
||||||
// Get reference point (note: only master has all points)
|
|
||||||
point refPt;
|
|
||||||
|
|
||||||
if (allPts.size())
|
|
||||||
{
|
|
||||||
refPt = samplePts.getRefPoint(allPts);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
refPt = vector::zero;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
masterSampledSets.set
|
masterSampledSets.set
|
||||||
(
|
(
|
||||||
setI,
|
setI,
|
||||||
@ -121,7 +108,7 @@ void Foam::sampledSets::combineSampledSets
|
|||||||
samplePts.name(),
|
samplePts.name(),
|
||||||
samplePts.axis(),
|
samplePts.axis(),
|
||||||
List<point>(UIndirectList<point>(allPts, indexSets[setI])),
|
List<point>(UIndirectList<point>(allPts, indexSets[setI])),
|
||||||
refPt
|
allCurveDist
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -268,8 +268,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
|
virtual ~sampledSets();
|
||||||
virtual ~sampledSets();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -57,7 +57,6 @@ class triSurfaceMeshPointSet
|
|||||||
//- Name of triSurfaceMesh
|
//- Name of triSurfaceMesh
|
||||||
const word surface_;
|
const word surface_;
|
||||||
|
|
||||||
|
|
||||||
//- Sampling points
|
//- Sampling points
|
||||||
List<point> sampleCoords_;
|
List<point> sampleCoords_;
|
||||||
|
|
||||||
@ -77,6 +76,7 @@ class triSurfaceMeshPointSet
|
|||||||
//- Uses calcSamples to obtain samples. Copies them into *this.
|
//- Uses calcSamples to obtain samples. Copies them into *this.
|
||||||
void genSamples();
|
void genSamples();
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
@ -96,8 +96,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
|
virtual ~triSurfaceMeshPointSet();
|
||||||
virtual ~triSurfaceMeshPointSet();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -64,7 +64,7 @@ bool Foam::uniformSet::nextSample
|
|||||||
samplePt += offset;
|
samplePt += offset;
|
||||||
sampleI++;
|
sampleI++;
|
||||||
|
|
||||||
for (; sampleI < nPoints_; sampleI++)
|
for(; sampleI < nPoints_; sampleI++)
|
||||||
{
|
{
|
||||||
scalar s = (samplePt - currentPt) & normOffset;
|
scalar s = (samplePt - currentPt) & normOffset;
|
||||||
|
|
||||||
@ -102,7 +102,7 @@ bool Foam::uniformSet::trackToBoundary
|
|||||||
// Alias
|
// Alias
|
||||||
const point& trackPt = singleParticle.position();
|
const point& trackPt = singleParticle.position();
|
||||||
|
|
||||||
while (true)
|
while(true)
|
||||||
{
|
{
|
||||||
// Find next samplePt on/after trackPt. Update samplePt, sampleI
|
// Find next samplePt on/after trackPt. Update samplePt, sampleI
|
||||||
if (!nextSample(trackPt, offset, smallDist, samplePt, sampleI))
|
if (!nextSample(trackPt, offset, smallDist, samplePt, sampleI))
|
||||||
@ -304,7 +304,7 @@ void Foam::uniformSet::calcSamples
|
|||||||
// index in bHits; current boundary intersection
|
// index in bHits; current boundary intersection
|
||||||
label bHitI = 1;
|
label bHitI = 1;
|
||||||
|
|
||||||
while (true)
|
while(true)
|
||||||
{
|
{
|
||||||
// Initialize tracking starting from trackPt
|
// Initialize tracking starting from trackPt
|
||||||
Cloud<passiveParticle> particles(mesh(), IDLList<passiveParticle>());
|
Cloud<passiveParticle> particles(mesh(), IDLList<passiveParticle>());
|
||||||
@ -328,7 +328,7 @@ void Foam::uniformSet::calcSamples
|
|||||||
);
|
);
|
||||||
|
|
||||||
// fill sampleSegments
|
// fill sampleSegments
|
||||||
for (label i = samplingPts.size() - 1; i >= startSegmentI; --i)
|
for(label i = samplingPts.size() - 1; i >= startSegmentI; --i)
|
||||||
{
|
{
|
||||||
samplingSegments.append(segmentI);
|
samplingSegments.append(segmentI);
|
||||||
}
|
}
|
||||||
@ -483,14 +483,4 @@ Foam::uniformSet::~uniformSet()
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
Foam::point Foam::uniformSet::getRefPoint(const List<point>& pts) const
|
|
||||||
{
|
|
||||||
// Use start point as reference for 'distance'
|
|
||||||
return start_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -139,14 +139,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
|
virtual ~uniformSet();
|
||||||
virtual ~uniformSet();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Get reference point
|
|
||||||
virtual point getRefPoint(const List<point>&) const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user