mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Further updates to lagrangian sampling
This commit is contained in:
@ -43,7 +43,7 @@ namespace Foam
|
|||||||
|
|
||||||
bool Foam::faceOnlySet::trackToBoundary
|
bool Foam::faceOnlySet::trackToBoundary
|
||||||
(
|
(
|
||||||
passiveParticleCloud& particles,
|
passiveParticle& singleParticle,
|
||||||
DynamicList<point>& samplingPts,
|
DynamicList<point>& samplingPts,
|
||||||
DynamicList<label>& samplingCells,
|
DynamicList<label>& samplingCells,
|
||||||
DynamicList<label>& samplingFaces,
|
DynamicList<label>& samplingFaces,
|
||||||
@ -55,9 +55,8 @@ bool Foam::faceOnlySet::trackToBoundary
|
|||||||
const vector smallVec = tol*offset;
|
const vector smallVec = tol*offset;
|
||||||
const scalar smallDist = mag(smallVec);
|
const scalar smallDist = mag(smallVec);
|
||||||
|
|
||||||
passiveParticle& singleParticle = *particles.first();
|
passiveParticleCloud particleCloud(mesh());
|
||||||
|
particle::TrackingData<passiveParticleCloud> trackData(particleCloud);
|
||||||
particle::TrackingData<passiveParticleCloud> trackData(particles);
|
|
||||||
|
|
||||||
// Alias
|
// Alias
|
||||||
const point& trackPt = singleParticle.position();
|
const point& trackPt = singleParticle.position();
|
||||||
@ -210,8 +209,6 @@ void Foam::faceOnlySet::calcSamples
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Initialize tracking starting from trackPt
|
// Initialize tracking starting from trackPt
|
||||||
passiveParticleCloud particles(mesh());
|
|
||||||
|
|
||||||
passiveParticle singleParticle
|
passiveParticle singleParticle
|
||||||
(
|
(
|
||||||
mesh(),
|
mesh(),
|
||||||
@ -219,11 +216,9 @@ void Foam::faceOnlySet::calcSamples
|
|||||||
trackCellI
|
trackCellI
|
||||||
);
|
);
|
||||||
|
|
||||||
particles.addParticle(&singleParticle);
|
|
||||||
|
|
||||||
bool reachedBoundary = trackToBoundary
|
bool reachedBoundary = trackToBoundary
|
||||||
(
|
(
|
||||||
particles,
|
singleParticle,
|
||||||
samplingPts,
|
samplingPts,
|
||||||
samplingCells,
|
samplingCells,
|
||||||
samplingFaces,
|
samplingFaces,
|
||||||
|
|||||||
@ -68,7 +68,7 @@ class faceOnlySet
|
|||||||
// reached
|
// reached
|
||||||
bool trackToBoundary
|
bool trackToBoundary
|
||||||
(
|
(
|
||||||
passiveParticleCloud& particles,
|
passiveParticle& singleParticle,
|
||||||
DynamicList<point>& samplingPts,
|
DynamicList<point>& samplingPts,
|
||||||
DynamicList<label>& samplingCells,
|
DynamicList<label>& samplingCells,
|
||||||
DynamicList<label>& samplingFaces,
|
DynamicList<label>& samplingFaces,
|
||||||
|
|||||||
@ -44,7 +44,7 @@ namespace Foam
|
|||||||
// Sample till hits boundary.
|
// Sample till hits boundary.
|
||||||
bool Foam::polyLineSet::trackToBoundary
|
bool Foam::polyLineSet::trackToBoundary
|
||||||
(
|
(
|
||||||
passiveParticleCloud& particles,
|
passiveParticle& singleParticle,
|
||||||
label& sampleI,
|
label& sampleI,
|
||||||
DynamicList<point>& samplingPts,
|
DynamicList<point>& samplingPts,
|
||||||
DynamicList<label>& samplingCells,
|
DynamicList<label>& samplingCells,
|
||||||
@ -52,9 +52,8 @@ bool Foam::polyLineSet::trackToBoundary
|
|||||||
DynamicList<scalar>& samplingCurveDist
|
DynamicList<scalar>& samplingCurveDist
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
passiveParticle& singleParticle = *particles.first();
|
passiveParticleCloud particleCloud(mesh());
|
||||||
|
particle::TrackingData<passiveParticleCloud> trackData(particleCloud);
|
||||||
particle::TrackingData<passiveParticleCloud> trackData(particles);
|
|
||||||
|
|
||||||
// Alias
|
// Alias
|
||||||
const point& trackPt = singleParticle.position();
|
const point& trackPt = singleParticle.position();
|
||||||
@ -260,8 +259,6 @@ void Foam::polyLineSet::calcSamples
|
|||||||
//
|
//
|
||||||
|
|
||||||
// Initialize tracking starting from sampleI
|
// Initialize tracking starting from sampleI
|
||||||
passiveParticleCloud particles(mesh());
|
|
||||||
|
|
||||||
passiveParticle singleParticle
|
passiveParticle singleParticle
|
||||||
(
|
(
|
||||||
mesh(),
|
mesh(),
|
||||||
@ -271,7 +268,7 @@ void Foam::polyLineSet::calcSamples
|
|||||||
|
|
||||||
bool bReached = trackToBoundary
|
bool bReached = trackToBoundary
|
||||||
(
|
(
|
||||||
particles,
|
singleParticle,
|
||||||
sampleI,
|
sampleI,
|
||||||
samplingPts,
|
samplingPts,
|
||||||
samplingCells,
|
samplingCells,
|
||||||
|
|||||||
@ -65,7 +65,7 @@ class polyLineSet
|
|||||||
// Returns false if end of samples reached.
|
// Returns false if end of samples reached.
|
||||||
bool trackToBoundary
|
bool trackToBoundary
|
||||||
(
|
(
|
||||||
passiveParticleCloud& particles,
|
passiveParticle& singleParticle,
|
||||||
label& sampleI,
|
label& sampleI,
|
||||||
DynamicList<point>& samplingPts,
|
DynamicList<point>& samplingPts,
|
||||||
DynamicList<label>& samplingCells,
|
DynamicList<label>& samplingCells,
|
||||||
|
|||||||
@ -77,7 +77,7 @@ bool Foam::uniformSet::nextSample
|
|||||||
|
|
||||||
bool Foam::uniformSet::trackToBoundary
|
bool Foam::uniformSet::trackToBoundary
|
||||||
(
|
(
|
||||||
passiveParticleCloud& particles,
|
passiveParticle& singleParticle,
|
||||||
point& samplePt,
|
point& samplePt,
|
||||||
label& sampleI,
|
label& sampleI,
|
||||||
DynamicList<point>& samplingPts,
|
DynamicList<point>& samplingPts,
|
||||||
@ -91,12 +91,11 @@ bool Foam::uniformSet::trackToBoundary
|
|||||||
const vector smallVec = tol*offset;
|
const vector smallVec = tol*offset;
|
||||||
const scalar smallDist = mag(smallVec);
|
const scalar smallDist = mag(smallVec);
|
||||||
|
|
||||||
passiveParticle& singleParticle = *particles.first();
|
|
||||||
|
|
||||||
// Alias
|
// Alias
|
||||||
const point& trackPt = singleParticle.position();
|
const point& trackPt = singleParticle.position();
|
||||||
|
|
||||||
particle::TrackingData<passiveParticleCloud> trackData(particles);
|
passiveParticleCloud particleCloud(mesh());
|
||||||
|
particle::TrackingData<passiveParticleCloud> trackData(particleCloud);
|
||||||
|
|
||||||
while(true)
|
while(true)
|
||||||
{
|
{
|
||||||
@ -305,16 +304,12 @@ void Foam::uniformSet::calcSamples
|
|||||||
|
|
||||||
while(true)
|
while(true)
|
||||||
{
|
{
|
||||||
passiveParticleCloud particles(mesh());
|
|
||||||
|
|
||||||
// Initialize tracking starting from trackPt
|
// Initialize tracking starting from trackPt
|
||||||
passiveParticle singleParticle(mesh(), trackPt, trackCellI);
|
passiveParticle singleParticle(mesh(), trackPt, trackCellI);
|
||||||
|
|
||||||
particles.addParticle(&singleParticle);
|
|
||||||
|
|
||||||
bool reachedBoundary = trackToBoundary
|
bool reachedBoundary = trackToBoundary
|
||||||
(
|
(
|
||||||
particles,
|
singleParticle,
|
||||||
samplePt,
|
samplePt,
|
||||||
sampleI,
|
sampleI,
|
||||||
samplingPts,
|
samplingPts,
|
||||||
|
|||||||
@ -82,7 +82,7 @@ class uniformSet
|
|||||||
// reached
|
// reached
|
||||||
bool trackToBoundary
|
bool trackToBoundary
|
||||||
(
|
(
|
||||||
passiveParticleCloud& particles,
|
passiveParticle& singleParticle,
|
||||||
point& samplePt,
|
point& samplePt,
|
||||||
label& sampleI,
|
label& sampleI,
|
||||||
DynamicList<point>& samplingPts,
|
DynamicList<point>& samplingPts,
|
||||||
|
|||||||
Reference in New Issue
Block a user