diff --git a/applications/utilities/parallelProcessing/decomposePar/faMeshDecomposition.C b/applications/utilities/parallelProcessing/decomposePar/faMeshDecomposition.C index e198573c1..36d7ed30b 100644 --- a/applications/utilities/parallelProcessing/decomposePar/faMeshDecomposition.C +++ b/applications/utilities/parallelProcessing/decomposePar/faMeshDecomposition.C @@ -61,27 +61,87 @@ void faMeshDecomposition::distributeFaces() ) ); - labelHashSet faceProcAddressingHash - ( - labelIOList - ( - IOobject - ( - "faceProcAddressing", - "constant", - procMesh.meshSubDir, - procMesh, - IOobject::MUST_READ, - IOobject::NO_WRITE - ) - ) - ); - - forAll (faceLabels(), faceI) + // If faMesh's fvPatch is a part of the global face zones, faces of that + // patch will be present on all processors. Because of that, looping + // through faceProcAddressing will decompose global faMesh faces to the + // very last processor regardless of where fvPatch is really decomposed. + // Since global faces which do not belong to specific processor are + // located at the end of the faceProcAddressing, cutting it at + // i = owner.size() will correctly decompose faMesh faces. + // Vanja Skuric, 2016-04-21 + if (decompositionDict_.found("globalFaceZones")) { - if (faceProcAddressingHash.found(faceLabels()[faceI] + 1)) + labelList faceProcAddressing + ( + labelIOList + ( + IOobject + ( + "faceProcAddressing", + "constant", + procMesh.meshSubDir, + procMesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ) + ); + + const label ownerSize = + ( + labelIOList + ( + IOobject + ( + "owner", + "constant", + procMesh.meshSubDir, + procMesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ) + ).size(); + + labelHashSet faceProcAddressingHash(ownerSize); + + for (int i = 0; i < ownerSize; ++i) { - faceToProc_[faceI] = procI; + faceProcAddressingHash.insert(faceProcAddressing[i]); + } + + forAll (faceLabels(), faceI) + { + if (faceProcAddressingHash.found(faceLabels()[faceI] + 1)) + { + faceToProc_[faceI] = procI; + } + } + } + else + { + labelHashSet faceProcAddressingHash + ( + labelIOList + ( + IOobject + ( + "faceProcAddressing", + "constant", + procMesh.meshSubDir, + procMesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ) + ); + + forAll (faceLabels(), faceI) + { + if (faceProcAddressingHash.found(faceLabels()[faceI] + 1)) + { + faceToProc_[faceI] = procI; + } } } } diff --git a/src/finiteArea/finiteArea/fam/famLaplacian.C b/src/finiteArea/finiteArea/fam/famLaplacian.C index 05fddf196..b7c6f982d 100644 --- a/src/finiteArea/finiteArea/fam/famLaplacian.C +++ b/src/finiteArea/finiteArea/fam/famLaplacian.C @@ -329,6 +329,40 @@ laplacian } +template +tmp > +laplacian +( + const edgeTensorField& gamma, + const GeometricField& vf, + const word& name +) +{ + const faMesh& mesh = vf.mesh(); + + return fam::laplacian + ( + (mesh.Le() & gamma & mesh.Le())/sqr(mesh.magLe()), + vf, + name + ); +} + +template +tmp > +laplacian +( + const tmp& tgamma, + const GeometricField& vf, + const word& name +) +{ + tmp > Laplacian = fam::laplacian(tgamma(), vf, name); + tgamma.clear(); + return Laplacian; +} + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace fam diff --git a/src/finiteArea/finiteArea/fam/famLaplacian.H b/src/finiteArea/finiteArea/fam/famLaplacian.H index 4eb78e09f..a719ce09a 100644 --- a/src/finiteArea/finiteArea/fam/famLaplacian.H +++ b/src/finiteArea/finiteArea/fam/famLaplacian.H @@ -180,6 +180,23 @@ namespace fam const tmp&, const GeometricField& ); + + + template + tmp > laplacian + ( + const edgeTensorField&, + const GeometricField&, + const word& name + ); + + template + tmp > laplacian + ( + const tmp&, + const GeometricField&, + const word& name + ); }