sampling: Explicitly cache data needed for tracking in parallel and on moving meshes

This commit is contained in:
Will Bainbridge
2021-08-13 08:56:13 +01:00
parent 19bdfa969f
commit 436c012a82
3 changed files with 18 additions and 0 deletions

View File

@ -56,6 +56,12 @@ void Foam::sampledSets::lineFace::calcSamples
DynamicList<scalar>& samplingCurveDist
)
{
// Ask for the tetBasePtIs and oldCellCentres to trigger all processors to
// build them, otherwise, if some processors have no particles then there
// is a comms mismatch.
mesh.tetBasePtIs();
mesh.oldCellCentres();
// Create lists of initial positions from which to track, the faces and
// cells associated with those positions, and whether the track propagates
// forward (true) or backward (false) along the line from start to end

View File

@ -52,6 +52,12 @@ void Foam::sampledSets::lineUniform::calcSamples
DynamicList<scalar>& samplingCurveDist
) const
{
// Ask for the tetBasePtIs and oldCellCentres to trigger all processors to
// build them, otherwise, if some processors have no particles then there
// is a comms mismatch.
mesh().tetBasePtIs();
mesh().oldCellCentres();
label sampleSegmentI = 0, sampleI = 0;
scalar sampleT = 0;

View File

@ -77,6 +77,12 @@ void Foam::sampledSets::points::calcSamplesOrdered
DynamicList<scalar>& samplingCurveDist
) const
{
// Ask for the tetBasePtIs and oldCellCentres to trigger all processors to
// build them, otherwise, if some processors have no particles then there
// is a comms mismatch.
mesh().tetBasePtIs();
mesh().oldCellCentres();
const label n = points_.size();
label sampleSegmentI = 0;