ENH: Further updates to lagrangian sampling

This commit is contained in:
andy
2011-02-24 17:23:06 +00:00
parent 0d7ae8bf5e
commit 7c530ff455
6 changed files with 15 additions and 28 deletions

View File

@ -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,

View File

@ -68,7 +68,7 @@ class faceOnlySet
// reached
bool trackToBoundary
(
passiveParticleCloud& particles,
passiveParticle& singleParticle,
DynamicList<point>& samplingPts,
DynamicList<label>& samplingCells,
DynamicList<label>& samplingFaces,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -82,7 +82,7 @@ class uniformSet
// reached
bool trackToBoundary
(
passiveParticleCloud& particles,
passiveParticle& singleParticle,
point& samplePt,
label& sampleI,
DynamicList<point>& samplingPts,