BUG: sampledSet: track on static mesh

This commit is contained in:
mattijs
2014-09-16 13:07:38 +01:00
committed by Andrew Heather
parent a50cca5fb4
commit b7ebc021c8
5 changed files with 23 additions and 10 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -43,6 +43,7 @@ namespace Foam
bool Foam::faceOnlySet::trackToBoundary
(
passiveParticleCloud& particleCloud,
passiveParticle& singleParticle,
DynamicList<point>& samplingPts,
DynamicList<label>& samplingCells,
@ -55,7 +56,6 @@ bool Foam::faceOnlySet::trackToBoundary
const vector smallVec = tol*offset;
const scalar smallDist = mag(smallVec);
passiveParticleCloud particleCloud(mesh());
particle::TrackingData<passiveParticleCloud> trackData(particleCloud);
// Alias
@ -115,8 +115,9 @@ void Foam::faceOnlySet::calcSamples
const vector smallVec = tol*offset;
const scalar smallDist = mag(smallVec);
// Force calculation of minimum-tet decomposition.
(void) mesh().tetBasePtIs();
// Force calculation of cloud addressing on all processors
const bool oldMoving = const_cast<polyMesh&>(mesh()).moving(false);
passiveParticleCloud particleCloud(mesh());
// Get all boundary intersections
List<pointIndexHit> bHits = searchEngine().intersections
@ -218,6 +219,7 @@ void Foam::faceOnlySet::calcSamples
bool reachedBoundary = trackToBoundary
(
particleCloud,
singleParticle,
samplingPts,
samplingCells,
@ -286,6 +288,8 @@ void Foam::faceOnlySet::calcSamples
startSegmentI = samplingPts.size();
}
const_cast<polyMesh&>(mesh()).moving(oldMoving);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -68,6 +68,7 @@ class faceOnlySet
// reached
bool trackToBoundary
(
passiveParticleCloud& particleCloud,
passiveParticle& singleParticle,
DynamicList<point>& samplingPts,
DynamicList<label>& samplingCells,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -43,6 +43,7 @@ namespace Foam
bool Foam::polyLineSet::trackToBoundary
(
passiveParticleCloud& particleCloud,
passiveParticle& singleParticle,
label& sampleI,
DynamicList<point>& samplingPts,
@ -51,7 +52,6 @@ bool Foam::polyLineSet::trackToBoundary
DynamicList<scalar>& samplingCurveDist
) const
{
passiveParticleCloud particleCloud(mesh());
particle::TrackingData<passiveParticleCloud> trackData(particleCloud);
// Alias
@ -157,8 +157,9 @@ void Foam::polyLineSet::calcSamples
oldPoint = sampleCoords_[sampleI];
}
// Force calculation of minimum-tet decomposition.
(void) mesh().tetBasePtIs();
// Force calculation of cloud addressing on all processors
const bool oldMoving = const_cast<polyMesh&>(mesh()).moving(false);
passiveParticleCloud particleCloud(mesh());
// current segment number
label segmentI = 0;
@ -267,6 +268,7 @@ void Foam::polyLineSet::calcSamples
bool bReached = trackToBoundary
(
particleCloud,
singleParticle,
sampleI,
samplingPts,
@ -306,6 +308,8 @@ void Foam::polyLineSet::calcSamples
startSegmentI = samplingPts.size();
}
const_cast<polyMesh&>(mesh()).moving(oldMoving);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -65,6 +65,7 @@ class polyLineSet
// Returns false if end of samples reached.
bool trackToBoundary
(
passiveParticleCloud& particleCloud,
passiveParticle& singleParticle,
label& sampleI,
DynamicList<point>& samplingPts,

View File

@ -232,6 +232,7 @@ void Foam::uniformSet::calcSamples
const scalar smallDist = mag(smallVec);
// Force calculation of cloud addressing on all processors
const bool oldMoving = const_cast<polyMesh&>(mesh()).moving(false);
passiveParticleCloud particleCloud(mesh());
// Get all boundary intersections
@ -383,6 +384,8 @@ void Foam::uniformSet::calcSamples
startSegmentI = samplingPts.size();
}
const_cast<polyMesh&>(mesh()).moving(oldMoving);
}