Commit 7c530ff4 authored by andy's avatar andy
Browse files

ENH: Further updates to lagrangian sampling

parent 0d7ae8bf
......@@ -43,7 +43,7 @@ namespace Foam
bool Foam::faceOnlySet::trackToBoundary
(
passiveParticleCloud& particles,
passiveParticle& singleParticle,
DynamicList<point>& samplingPts,
DynamicList<label>& samplingCells,
DynamicList<label>& samplingFaces,
......@@ -55,9 +55,8 @@ bool Foam::faceOnlySet::trackToBoundary
const vector smallVec = tol*offset;
const scalar smallDist = mag(smallVec);
passiveParticle& singleParticle = *particles.first();
particle::TrackingData<passiveParticleCloud> trackData(particles);
passiveParticleCloud particleCloud(mesh());
particle::TrackingData<passiveParticleCloud> trackData(particleCloud);
// Alias
const point& trackPt = singleParticle.position();
......@@ -210,8 +209,6 @@ void Foam::faceOnlySet::calcSamples
}
// Initialize tracking starting from trackPt
passiveParticleCloud particles(mesh());
passiveParticle singleParticle
(
mesh(),
......@@ -219,11 +216,9 @@ void Foam::faceOnlySet::calcSamples
trackCellI
);
particles.addParticle(&singleParticle);
bool reachedBoundary = trackToBoundary
(
particles,
singleParticle,
samplingPts,
samplingCells,
samplingFaces,
......
......@@ -68,7 +68,7 @@ class faceOnlySet
// reached
bool trackToBoundary
(
passiveParticleCloud& particles,
passiveParticle& singleParticle,
DynamicList<point>& samplingPts,
DynamicList<label>& samplingCells,
DynamicList<label>& samplingFaces,
......
......@@ -44,7 +44,7 @@ namespace Foam
// Sample till hits boundary.
bool Foam::polyLineSet::trackToBoundary
(
passiveParticleCloud& particles,
passiveParticle& singleParticle,
label& sampleI,
DynamicList<point>& samplingPts,
DynamicList<label>& samplingCells,
......@@ -52,9 +52,8 @@ bool Foam::polyLineSet::trackToBoundary
DynamicList<scalar>& samplingCurveDist
) const
{
passiveParticle& singleParticle = *particles.first();
particle::TrackingData<passiveParticleCloud> trackData(particles);
passiveParticleCloud particleCloud(mesh());
particle::TrackingData<passiveParticleCloud> trackData(particleCloud);
// Alias
const point& trackPt = singleParticle.position();
......@@ -260,8 +259,6 @@ void Foam::polyLineSet::calcSamples
//
// Initialize tracking starting from sampleI
passiveParticleCloud particles(mesh());
passiveParticle singleParticle
(
mesh(),
......@@ -271,7 +268,7 @@ void Foam::polyLineSet::calcSamples
bool bReached = trackToBoundary
(
particles,
singleParticle,
sampleI,
samplingPts,
samplingCells,
......
......@@ -65,7 +65,7 @@ class polyLineSet
// Returns false if end of samples reached.
bool trackToBoundary
(
passiveParticleCloud& particles,
passiveParticle& singleParticle,
label& sampleI,
DynamicList<point>& samplingPts,
DynamicList<label>& samplingCells,
......
......@@ -77,7 +77,7 @@ bool Foam::uniformSet::nextSample
bool Foam::uniformSet::trackToBoundary
(
passiveParticleCloud& particles,
passiveParticle& singleParticle,
point& samplePt,
label& sampleI,
DynamicList<point>& samplingPts,
......@@ -91,12 +91,11 @@ bool Foam::uniformSet::trackToBoundary
const vector smallVec = tol*offset;
const scalar smallDist = mag(smallVec);
passiveParticle& singleParticle = *particles.first();
// Alias
const point& trackPt = singleParticle.position();
particle::TrackingData<passiveParticleCloud> trackData(particles);
passiveParticleCloud particleCloud(mesh());
particle::TrackingData<passiveParticleCloud> trackData(particleCloud);
while(true)
{
......@@ -305,16 +304,12 @@ void Foam::uniformSet::calcSamples
while(true)
{
passiveParticleCloud particles(mesh());
// Initialize tracking starting from trackPt
passiveParticle singleParticle(mesh(), trackPt, trackCellI);
particles.addParticle(&singleParticle);
bool reachedBoundary = trackToBoundary
(
particles,
singleParticle,
samplePt,
sampleI,
samplingPts,
......
......@@ -82,7 +82,7 @@ class uniformSet
// reached
bool trackToBoundary
(
passiveParticleCloud& particles,
passiveParticle& singleParticle,
point& samplePt,
label& sampleI,
DynamicList<point>& samplingPts,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment