From 6ccdc7746858ffc641e392a0a36e22754b97d208 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 17 Jan 2019 18:21:38 +0000 Subject: [PATCH] BUG: trackingInverseDistance: fix trackingInverseDistance. Fixes #736. --- .../extrude/extrudeMesh/extrudeMesh.C | 58 +---- .../extrudeToRegionMesh/extrudeToRegionMesh.C | 57 +---- .../splitMeshRegions/splitMeshRegions.C | 53 +---- src/Allwmake | 2 +- src/dynamicMesh/fvMeshTools/fvMeshTools.C | 64 ++++- src/dynamicMesh/fvMeshTools/fvMeshTools.H | 10 +- src/overset/Make/options | 2 + .../cellCellStencil/cellCellStencil.H | 9 +- .../cellCellStencilTemplates.C | 15 +- .../cellVolumeWeightCellCellStencil.C | 127 ++++++---- .../inverseDistanceCellCellStencil.C | 33 ++- .../trackingInverseDistanceCellCellStencil.C | 224 ++++++++++++++---- .../trackingInverseDistance/voxelMeshSearch.C | 118 ++++++++- .../trackingInverseDistance/voxelMeshSearch.H | 10 +- .../simpleRotor/system/fvSchemes | 4 +- 15 files changed, 504 insertions(+), 282 deletions(-) diff --git a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C index 02e18d2af9..a726de2505 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C +++ b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd. + \\/ M anipulation | Copyright (C) 2015-2019 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -48,6 +48,7 @@ Description #include "MeshedSurfaces.H" #include "globalIndex.H" #include "cellSet.H" +#include "fvMeshTools.H" #include "extrudedMesh.H" #include "extrudeModel.H" @@ -78,59 +79,6 @@ static const Enum ExtrudeModeNames }; -void createDummyFvMeshFiles(const polyMesh& mesh, const word& regionName) -{ - // Create dummy system/fv* - { - IOobject io - ( - "fvSchemes", - mesh.time().system(), - regionName, - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ); - - Info<< "Testing:" << io.objectPath() << endl; - - if (!io.typeHeaderOk(false)) - { - Info<< "Writing dummy " << regionName/io.name() << endl; - dictionary dummyDict; - dictionary divDict; - dummyDict.add("divSchemes", divDict); - dictionary gradDict; - dummyDict.add("gradSchemes", gradDict); - dictionary laplDict; - dummyDict.add("laplacianSchemes", laplDict); - - IOdictionary(io, dummyDict).regIOobject::write(); - } - } - { - IOobject io - ( - "fvSolution", - mesh.time().system(), - regionName, - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ); - - if (!io.typeHeaderOk(false)) - { - Info<< "Writing dummy " << regionName/io.name() << endl; - dictionary dummyDict; - IOdictionary(io, dummyDict).regIOobject::write(); - } - } -} - - label findPatchID(const polyBoundaryMesh& patches, const word& name) { const label patchID = patches.findPatchID(name); @@ -738,7 +686,7 @@ int main(int argc, char *argv[]) // Create dummy fvSchemes, fvSolution - createDummyFvMeshFiles(mesh, regionDir); + fvMeshTools::createDummyFvMeshFiles(mesh, regionDir, true); // Create actual mesh from polyTopoChange container autoPtr map = meshMod().makeMesh diff --git a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C index 9f5e221952..ab733f3ad6 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C +++ b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd. + \\/ M anipulation | Copyright (C) 2015-2019 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -353,59 +353,6 @@ void deleteEmptyPatches(fvMesh& mesh) } -void createDummyFvMeshFiles(const polyMesh& mesh, const word& regionName) -{ - // Create dummy system/fv* - { - IOobject io - ( - "fvSchemes", - mesh.time().system(), - regionName, - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ); - - Info<< "Testing:" << io.objectPath() << endl; - - if (!io.typeHeaderOk(true)) - { - Info<< "Writing dummy " << regionName/io.name() << endl; - dictionary dummyDict; - dictionary divDict; - dummyDict.add("divSchemes", divDict); - dictionary gradDict; - dummyDict.add("gradSchemes", gradDict); - dictionary laplDict; - dummyDict.add("laplacianSchemes", laplDict); - - IOdictionary(io, dummyDict).regIOobject::write(); - } - } - { - IOobject io - ( - "fvSolution", - mesh.time().system(), - regionName, - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ); - - if (!io.typeHeaderOk(true)) - { - Info<< "Writing dummy " << regionName/io.name() << endl; - dictionary dummyDict; - IOdictionary(io, dummyDict).regIOobject::write(); - } - } -} - - // Check zone either all internal or all external faces void checkZoneInside ( @@ -1642,7 +1589,7 @@ int main(int argc, char *argv[]) // Create dummy fv* files - createDummyFvMeshFiles(mesh, shellRegionName); + fvMeshTools::createDummyFvMeshFiles(mesh, shellRegionName, true); word meshInstance; diff --git a/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C b/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C index 3692adeeb0..ebf6e7c65e 100644 --- a/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C +++ b/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation - \\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd. + \\/ M anipulation | Copyright (C) 2015-2019 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -584,56 +584,7 @@ autoPtr createRegionMesh ) { // Create dummy system/fv* - { - IOobject io - ( - "fvSchemes", - mesh.time().system(), - regionName, - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ); - - Info<< "Testing:" << io.objectPath() << endl; - - if (!io.typeHeaderOk(true)) - // if (!exists(io.objectPath())) - { - Info<< "Writing dummy " << regionName/io.name() << endl; - dictionary dummyDict; - dictionary divDict; - dummyDict.add("divSchemes", divDict); - dictionary gradDict; - dummyDict.add("gradSchemes", gradDict); - dictionary laplDict; - dummyDict.add("laplacianSchemes", laplDict); - - IOdictionary(io, dummyDict).regIOobject::write(); - } - } - { - IOobject io - ( - "fvSolution", - mesh.time().system(), - regionName, - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ); - - if (!io.typeHeaderOk(true)) - //if (!exists(io.objectPath())) - { - Info<< "Writing dummy " << regionName/io.name() << endl; - dictionary dummyDict; - IOdictionary(io, dummyDict).regIOobject::write(); - } - } - + fvMeshTools::createDummyFvMeshFiles(mesh, regionName, true); // Neighbour cellRegion. labelList coupledRegion(mesh.nBoundaryFaces()); diff --git a/src/Allwmake b/src/Allwmake index 7742d3502c..b5378ac63c 100755 --- a/src/Allwmake +++ b/src/Allwmake @@ -53,7 +53,6 @@ wmake $targetType topoChangerFvMesh parallel/Allwmake $targetType $* randomProcesses/Allwmake $targetType $* -wmake $targetType overset wmake $targetType ODE transportModels/Allwmake $targetType $* @@ -67,6 +66,7 @@ wmake $targetType fvOptions wmake $targetType fvMotionSolver mesh/Allwmake $targetType $* +wmake $targetType overset renumber/Allwmake $targetType $* fvAgglomerationMethods/Allwmake $targetType $* wmake $targetType waveModels diff --git a/src/dynamicMesh/fvMeshTools/fvMeshTools.C b/src/dynamicMesh/fvMeshTools/fvMeshTools.C index b45e84eda4..2cd12e2626 100644 --- a/src/dynamicMesh/fvMeshTools/fvMeshTools.C +++ b/src/dynamicMesh/fvMeshTools/fvMeshTools.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation - \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. + \\/ M anipulation | Copyright (C) 2015-2019 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -667,4 +667,66 @@ Foam::autoPtr Foam::fvMeshTools::newMesh } +void Foam::fvMeshTools::createDummyFvMeshFiles +( + const objectRegistry& mesh, + const word& regionName, + const bool verbose +) +{ + // Create dummy system/fv* + { + IOobject io + ( + "fvSchemes", + mesh.time().system(), + regionName, + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ); + + if (!io.typeHeaderOk(false)) + { + if (verbose) + { + Info<< "Writing dummy " << regionName/io.name() << endl; + } + dictionary dummyDict; + dictionary divDict; + dummyDict.add("divSchemes", divDict); + dictionary gradDict; + dummyDict.add("gradSchemes", gradDict); + dictionary laplDict; + dummyDict.add("laplacianSchemes", laplDict); + + IOdictionary(io, dummyDict).regIOobject::write(); + } + } + { + IOobject io + ( + "fvSolution", + mesh.time().system(), + regionName, + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ); + + if (!io.typeHeaderOk(false)) + { + if (verbose) + { + Info<< "Writing dummy " << regionName/io.name() << endl; + } + dictionary dummyDict; + IOdictionary(io, dummyDict).regIOobject::write(); + } + } +} + + // ************************************************************************* // diff --git a/src/dynamicMesh/fvMeshTools/fvMeshTools.H b/src/dynamicMesh/fvMeshTools/fvMeshTools.H index 78a6c4390c..b65832bbea 100644 --- a/src/dynamicMesh/fvMeshTools/fvMeshTools.H +++ b/src/dynamicMesh/fvMeshTools/fvMeshTools.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation - \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. + \\/ M anipulation | Copyright (C) 2015-2019 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -137,6 +137,14 @@ public: const IOobject& io, const bool masterOnlyReading ); + + //- Create additional fv* files + static void createDummyFvMeshFiles + ( + const objectRegistry& parent, + const word& regionName, + const bool verbose = false + ); }; diff --git a/src/overset/Make/options b/src/overset/Make/options index fc6854c46f..fb7f46e24e 100644 --- a/src/overset/Make/options +++ b/src/overset/Make/options @@ -4,6 +4,7 @@ EXE_INC = \ -I$(LIB_SRC)/fileFormats/lnInclude \ + -I$(LIB_SRC)/mesh/blockMesh/lnInclude \ -I$(LIB_SRC)/surfMesh/lnInclude \ -I$(LIB_SRC)/sampling/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ @@ -15,4 +16,5 @@ EXE_INC = \ LIB_LIBS = \ -ldynamicFvMesh \ -lsampling \ + -lblockMesh \ -ldecompositionMethods diff --git a/src/overset/cellCellStencil/cellCellStencil/cellCellStencil.H b/src/overset/cellCellStencil/cellCellStencil/cellCellStencil.H index 9bb1760188..476f359382 100644 --- a/src/overset/cellCellStencil/cellCellStencil/cellCellStencil.H +++ b/src/overset/cellCellStencil/cellCellStencil/cellCellStencil.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2017-2018 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2017-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -97,7 +97,12 @@ protected: //- Helper: create volScalarField for postprocessing. template - tmp createField(const word& name, UList&) const; + static tmp createField + ( + const fvMesh& mesh, + const word& name, + const UList& + ); private: diff --git a/src/overset/cellCellStencil/cellCellStencil/cellCellStencilTemplates.C b/src/overset/cellCellStencil/cellCellStencil/cellCellStencilTemplates.C index d431890976..18c045ced2 100644 --- a/src/overset/cellCellStencil/cellCellStencil/cellCellStencilTemplates.C +++ b/src/overset/cellCellStencil/cellCellStencil/cellCellStencilTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2018 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -29,7 +29,12 @@ License template Foam::tmp -Foam::cellCellStencil::createField(const word& name, UList& psi) const +Foam::cellCellStencil::createField +( + const fvMesh& mesh, + const word& name, + const UList& psi +) { tmp tfld ( @@ -38,13 +43,13 @@ Foam::cellCellStencil::createField(const word& name, UList& psi) const IOobject ( name, - mesh_.time().timeName(), - mesh_, + mesh.time().timeName(), + mesh, IOobject::NO_READ, IOobject::NO_WRITE, false ), - mesh_, + mesh, dimensionedScalar(dimless, Zero), zeroGradientFvPatchScalarField::typeName ) diff --git a/src/overset/cellCellStencil/cellVolumeWeight/cellVolumeWeightCellCellStencil.C b/src/overset/cellCellStencil/cellVolumeWeight/cellVolumeWeightCellCellStencil.C index 0e048a8c26..dba9cf6053 100644 --- a/src/overset/cellCellStencil/cellVolumeWeight/cellVolumeWeightCellCellStencil.C +++ b/src/overset/cellCellStencil/cellVolumeWeight/cellVolumeWeightCellCellStencil.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2014-2018 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2014-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -155,12 +155,12 @@ void Foam::cellCellStencils::cellVolumeWeight::walkFront { allWeight[own] = fraction; - if (debug) - { - Pout<< " setting cell " - << mesh_.cellCentres()[own] - << " to " << fraction << endl; - } + //if (debug) + //{ + // Pout<< " setting cell " + // << mesh_.cellCentres()[own] + // << " to " << fraction << endl; + //} allCellTypes[own] = INTERPOLATED; newIsFront.set(mesh_.cells()[own]); } @@ -174,12 +174,12 @@ void Foam::cellCellStencils::cellVolumeWeight::walkFront { allWeight[nei] = fraction; - if (debug) - { - Pout<< " setting cell " - << mesh_.cellCentres()[nei] - << " to " << fraction << endl; - } + //if (debug) + //{ + // Pout<< " setting cell " + // << mesh_.cellCentres()[nei] + // << " to " << fraction << endl; + //} allCellTypes[nei] = INTERPOLATED; newIsFront.set(mesh_.cells()[nei]); @@ -928,6 +928,16 @@ bool Foam::cellCellStencils::cellVolumeWeight::update() } + if (debug) + { + tmp tfld + ( + createField(mesh_, "allCellTypes", allCellTypes) + ); + tfld().write(); + } + + // Use the patch types and weights to decide what to do forAll(allPatchTypes, cellI) { @@ -977,15 +987,44 @@ bool Foam::cellCellStencils::cellVolumeWeight::update() } } + if (debug) + { + tmp tfld + ( + createField(mesh_, "allCellTypes_patch", allCellTypes) + ); + //tfld.ref().correctBoundaryConditions(); + tfld().write(); + } + // Mark unreachable bits findHoles(globalCells, mesh_, zoneID, allStencil, allCellTypes); + if (debug) + { + tmp tfld + ( + createField(mesh_, "allCellTypes_hole", allCellTypes) + ); + //tfld.ref().correctBoundaryConditions(); + tfld().write(); + } + // Add buffer interpolation layer around holes scalarField allWeight(mesh_.nCells(), Zero); walkFront(layerRelax, allCellTypes, allWeight); + if (debug) + { + tmp tfld + ( + createField(mesh_, "allCellTypes_front", allCellTypes) + ); + //tfld.ref().correctBoundaryConditions(); + tfld().write(); + } // Check previous iteration cellTypes_ for any hole->calculated changes { @@ -1104,39 +1143,39 @@ bool Foam::cellCellStencils::cellVolumeWeight::update() } -// // Check previous iteration cellTypes_ for any hole->calculated changes -// { -// label nCalculated = 0; +// // Check previous iteration cellTypes_ for any hole->calculated changes +// { +// label nCalculated = 0; // -// forAll(cellTypes_, celli) -// { -// if (allCellTypes[celli] == CALCULATED && cellTypes_[celli] == HOLE) -// { -// if (allStencil[celli].size() == 0) -// { -// FatalErrorInFunction -// << "Cell:" << celli -// << " at:" << mesh_.cellCentres()[celli] -// << " zone:" << zoneID[celli] -// << " changed from hole to calculated" -// << " but there is no donor" -// << exit(FatalError); -// } -// else -// { -// allCellTypes[celli] = INTERPOLATED; -// nCalculated++; -// } -// } -// } +// forAll(cellTypes_, celli) +// { +// if (allCellTypes[celli] == CALCULATED && cellTypes_[celli] == HOLE) +// { +// if (allStencil[celli].size() == 0) +// { +// FatalErrorInFunction +// << "Cell:" << celli +// << " at:" << mesh_.cellCentres()[celli] +// << " zone:" << zoneID[celli] +// << " changed from hole to calculated" +// << " but there is no donor" +// << exit(FatalError); +// } +// else +// { +// allCellTypes[celli] = INTERPOLATED; +// nCalculated++; +// } +// } +// } // -// if (debug) -// { -// Pout<< "Detected " << nCalculated << " cells changing from hole" -// << " to calculated. Changed these to interpolated" -// << endl; -// } -// } +// if (debug) +// { +// Pout<< "Detected " << nCalculated << " cells changing from hole" +// << " to calculated. Changed these to interpolated" +// << endl; +// } +// } cellTypes_.transfer(allCellTypes); diff --git a/src/overset/cellCellStencil/inverseDistance/inverseDistanceCellCellStencil.C b/src/overset/cellCellStencil/inverseDistance/inverseDistanceCellCellStencil.C index 0d09a2330e..1e019dab39 100644 --- a/src/overset/cellCellStencil/inverseDistance/inverseDistanceCellCellStencil.C +++ b/src/overset/cellCellStencil/inverseDistance/inverseDistanceCellCellStencil.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2017-2018 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2017-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -1998,8 +1998,10 @@ bool Foam::cellCellStencils::inverseDistance::update() if (debug) { - tmp tfld(createField("allCellTypes", allCellTypes)); - //tfld.ref().correctBoundaryConditions(); + tmp tfld + ( + createField(mesh_, "allCellTypes", allCellTypes) + ); tfld().write(); } @@ -2041,9 +2043,8 @@ bool Foam::cellCellStencils::inverseDistance::update() { tmp tfld ( - createField("allCellTypes_patch", allCellTypes) + createField(mesh_, "allCellTypes_patch", allCellTypes) ); - //tfld.ref().correctBoundaryConditions(); tfld().write(); } @@ -2054,9 +2055,8 @@ bool Foam::cellCellStencils::inverseDistance::update() { tmp tfld ( - createField("allCellTypes_hole", allCellTypes) + createField(mesh_, "allCellTypes_hole", allCellTypes) ); - //tfld.ref().correctBoundaryConditions(); tfld().write(); } if (debug) @@ -2066,8 +2066,10 @@ bool Foam::cellCellStencils::inverseDistance::update() { stencilSize[celli] = allStencil[celli].size(); } - tmp tfld(createField("allStencil_hole", stencilSize)); - //tfld.ref().correctBoundaryConditions(); + tmp tfld + ( + createField(mesh_, "allStencil_hole", stencilSize) + ); tfld().write(); } @@ -2080,9 +2082,8 @@ bool Foam::cellCellStencils::inverseDistance::update() { tmp tfld ( - createField("allCellTypes_front", allCellTypes) + createField(mesh_, "allCellTypes_front", allCellTypes) ); - //tfld.ref().correctBoundaryConditions(); tfld().write(); } @@ -2227,14 +2228,20 @@ bool Foam::cellCellStencils::inverseDistance::update() << endl; } } - tmp tfld(createField("maxMagWeight", maxMagWeight)); + tmp tfld + ( + createField(mesh_, "maxMagWeight", maxMagWeight) + ); tfld.ref().correctBoundaryConditions(); tfld().write(); } // Dump cell types { - tmp tfld(createField("cellTypes", cellTypes_)); + tmp tfld + ( + createField(mesh_, "cellTypes", cellTypes_) + ); tfld.ref().correctBoundaryConditions(); tfld().write(); } diff --git a/src/overset/cellCellStencil/trackingInverseDistance/trackingInverseDistanceCellCellStencil.C b/src/overset/cellCellStencil/trackingInverseDistance/trackingInverseDistanceCellCellStencil.C index a30a601d30..988404591f 100644 --- a/src/overset/cellCellStencil/trackingInverseDistance/trackingInverseDistanceCellCellStencil.C +++ b/src/overset/cellCellStencil/trackingInverseDistance/trackingInverseDistanceCellCellStencil.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2017-2018 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2017-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -441,55 +441,55 @@ Foam::cellCellStencils::trackingInverseDistance::trackingInverseDistance inverseDistance(mesh, dict, false), globalCells_(mesh_.nCells()) { + // Initialise donor cell + globalDonor_.setSize(mesh_.nCells()); + globalDonor_ = -1; + + // Initialise mesh partitions + const labelIOList& zoneID = this->zoneID(); + label nZones = gMax(zoneID)+1; + + labelList nCellsPerZone(nZones, Zero); + forAll(zoneID, celli) + { + nCellsPerZone[zoneID[celli]]++; + } + Pstream::listCombineGather(nCellsPerZone, plusEqOp