diff --git a/src/sampling/sampledSet/face/faceOnlySet.C b/src/sampling/sampledSet/face/faceOnlySet.C index 1583261d1c6c8c2663eef095a0cb8f74e6453e4a..85fb7bc74b59649889319367c827f5ea5bb5bd01 100644 --- a/src/sampling/sampledSet/face/faceOnlySet.C +++ b/src/sampling/sampledSet/face/faceOnlySet.C @@ -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); } diff --git a/src/sampling/sampledSet/face/faceOnlySet.H b/src/sampling/sampledSet/face/faceOnlySet.H index f50900e6b70362d7fd08c807bebdf0c53328a964..fdb47d4d435d3d7cc138a1e0cdc638a1a35ffe64 100644 --- a/src/sampling/sampledSet/face/faceOnlySet.H +++ b/src/sampling/sampledSet/face/faceOnlySet.H @@ -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, diff --git a/src/sampling/sampledSet/polyLine/polyLineSet.C b/src/sampling/sampledSet/polyLine/polyLineSet.C index 5ba23c5293d1e4f9ce57056a57f6d1ea7fed885e..023acc1dce9fafe06b638313f65652e9527627a8 100644 --- a/src/sampling/sampledSet/polyLine/polyLineSet.C +++ b/src/sampling/sampledSet/polyLine/polyLineSet.C @@ -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); } diff --git a/src/sampling/sampledSet/polyLine/polyLineSet.H b/src/sampling/sampledSet/polyLine/polyLineSet.H index b95e2e0c47d0d782ea7ddda5e90f9973520febe7..0c1339ee7272d63a078107a1d25020a9047ed25d 100644 --- a/src/sampling/sampledSet/polyLine/polyLineSet.H +++ b/src/sampling/sampledSet/polyLine/polyLineSet.H @@ -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, diff --git a/src/sampling/sampledSet/uniform/uniformSet.C b/src/sampling/sampledSet/uniform/uniformSet.C index a36319d81753f64d6925b149f155aecf436e77e5..9689218ae58c591fde4c69fcad9decabc52c767c 100644 --- a/src/sampling/sampledSet/uniform/uniformSet.C +++ b/src/sampling/sampledSet/uniform/uniformSet.C @@ -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); }