From 62206b32d277c6b2beb6edcc7d23c247f48f4e94 Mon Sep 17 00:00:00 2001 From: mattijs <mattijs> Date: Fri, 27 Jul 2012 16:38:38 +0100 Subject: [PATCH] BUG: volPointInterpolation: collocated point handling --- .../polyMesh/globalMeshData/globalMeshData.H | 7 ++- .../polyMesh/globalMeshData/globalPoints.C | 45 +++++++++++-------- .../polyMesh/globalMeshData/globalPoints.H | 8 +++- .../volPointInterpolate.C | 21 ++++----- .../volPointInterpolation.C | 8 +--- 5 files changed, 50 insertions(+), 39 deletions(-) diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.H b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.H index 3a3c2348215..1f9c51ac9f6 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.H +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.H @@ -323,8 +323,6 @@ class globalMeshData // its own master. Maybe store as well? void calcGlobalCoPointSlaves() const; - const labelListList& globalCoPointSlaves() const; - const mapDistribute& globalCoPointSlavesMap() const; //- Disallow default bitwise copy construct @@ -547,6 +545,11 @@ public: //- Is my edge same orientation as master edge const PackedBoolList& globalEdgeOrientation() const; + // Collocated point to collocated point + + const labelListList& globalCoPointSlaves() const; + const mapDistribute& globalCoPointSlavesMap() const; + // Coupled point to boundary faces. These are uncoupled boundary // faces only but include empty patches. diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.C b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.C index 7ecd1b84a13..b4333fc3a78 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.C +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -339,6 +339,31 @@ bool Foam::globalPoints::storeInitialInfo } +void Foam::globalPoints::printProcPoint +( + const labelList& patchToMeshPoint, + const labelPair& pointInfo +) const +{ + label procI = globalIndexAndTransform::processor(pointInfo); + label index = globalIndexAndTransform::index(pointInfo); + label trafoI = globalIndexAndTransform::transformIndex(pointInfo); + + Pout<< " proc:" << procI; + Pout<< " localpoint:"; + Pout<< index; + Pout<< " through transform:" + << trafoI << " bits:" + << globalTransforms_.decodeTransformIndex(trafoI); + + if (procI == Pstream::myProcNo()) + { + label meshPointI = localToMeshPoint(patchToMeshPoint, index); + Pout<< " at:" << mesh_.points()[meshPointI]; + } +} + + void Foam::globalPoints::printProcPoints ( const labelList& patchToMeshPoint, @@ -347,23 +372,7 @@ void Foam::globalPoints::printProcPoints { forAll(pointInfo, i) { - label procI = globalIndexAndTransform::processor(pointInfo[i]); - label index = globalIndexAndTransform::index(pointInfo[i]); - label trafoI = globalIndexAndTransform::transformIndex(pointInfo[i]); - - Pout<< " proc:" << procI; - Pout<< " localpoint:"; - Pout<< index; - Pout<< " through transform:" - << trafoI << " bits:" - << globalTransforms_.decodeTransformIndex(trafoI); - - if (procI == Pstream::myProcNo()) - { - label meshPointI = localToMeshPoint(patchToMeshPoint, index); - Pout<< " at:" << mesh_.points()[meshPointI]; - } - + printProcPoint(patchToMeshPoint, pointInfo[i]); Pout<< endl; } } diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.H b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.H index daef012fe70..de7a6b88d0f 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.H +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -206,6 +206,12 @@ class globalPoints ); //- Debug printing + void printProcPoint + ( + const labelList& patchToMeshPoint, + const labelPair& pointInfo + ) const; + void printProcPoints ( const labelList& patchToMeshPoint, diff --git a/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolate.C b/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolate.C index 1e0aa90e410..0f2b751bbdc 100644 --- a/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolate.C +++ b/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolate.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -51,8 +51,8 @@ void volPointInterpolation::syncUntransformedData const indirectPrimitivePatch& cpp = gmd.coupledPatch(); const labelList& meshPoints = cpp.meshPoints(); - const mapDistribute& slavesMap = gmd.globalPointSlavesMap(); - const labelListList& slaves = gmd.globalPointSlaves(); + const mapDistribute& slavesMap = gmd.globalCoPointSlavesMap(); + const labelListList& slaves = gmd.globalCoPointSlaves(); List<Type> elems(slavesMap.constructSize()); forAll(meshPoints, i) @@ -105,8 +105,8 @@ void volPointInterpolation::pushUntransformedData const indirectPrimitivePatch& cpp = gmd.coupledPatch(); const labelList& meshPoints = cpp.meshPoints(); - const mapDistribute& slavesMap = gmd.globalPointSlavesMap(); - const labelListList& slaves = gmd.globalPointSlaves(); + const mapDistribute& slavesMap = gmd.globalCoPointSlavesMap(); + const labelListList& slaves = gmd.globalCoPointSlaves(); List<Type> elems(slavesMap.constructSize()); forAll(meshPoints, i) @@ -155,14 +155,14 @@ void volPointInterpolation::addSeparated refCast<coupledPointPatchField<Type> > (pf.boundaryField()[patchI]).initSwapAddSeparated ( - Pstream::blocking, //Pstream::nonBlocking, + Pstream::nonBlocking, pf.internalField() ); } } // Block for any outstanding requests - //Pstream::waitRequests(); + Pstream::waitRequests(); forAll(pf.boundaryField(), patchI) { @@ -171,7 +171,7 @@ void volPointInterpolation::addSeparated refCast<coupledPointPatchField<Type> > (pf.boundaryField()[patchI]).swapAddSeparated ( - Pstream::blocking, //Pstream::nonBlocking, + Pstream::nonBlocking, pf.internalField() ); } @@ -306,7 +306,6 @@ void volPointInterpolation::interpolateBoundaryField } // Sum collocated contributions - //mesh().globalData().syncPointData(pfi, plusEqOp<Type>()); syncUntransformedData(pfi, plusEqOp<Type>()); // And add separated contributions @@ -314,9 +313,7 @@ void volPointInterpolation::interpolateBoundaryField // Push master data to slaves. It is possible (not sure how often) for // a coupled point to have its master on a different patch so - // to make sure just push master data to slaves. Reuse the syncPointData - // structure. - //mesh().globalData().syncPointData(pfi, nopEqOp<Type>()); + // to make sure just push master data to slaves. pushUntransformedData(pfi); diff --git a/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolation.C b/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolation.C index cb47e0a101c..87305f2fa80 100644 --- a/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolation.C +++ b/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolation.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -113,10 +113,8 @@ void volPointInterpolation::calcBoundaryAddressing() { boolList oldData(isPatchPoint_); - //mesh().globalData().syncPointData(isPatchPoint_, orEqOp<bool>()); syncUntransformedData(isPatchPoint_, orEqOp<bool>()); - forAll(isPatchPoint_, pointI) { if (isPatchPoint_[pointI] != oldData[pointI]) @@ -272,7 +270,7 @@ void volPointInterpolation::makeWeights() makeInternalWeights(sumWeights); - // Create boundary weights; add to sumWeights + // Create boundary weights; override sumWeights makeBoundaryWeights(sumWeights); @@ -292,7 +290,6 @@ void volPointInterpolation::makeWeights() // Sum collocated contributions - //mesh().globalData().syncPointData(sumWeights, plusEqOp<scalar>()); syncUntransformedData(sumWeights, plusEqOp<scalar>()); // And add separated contributions @@ -302,7 +299,6 @@ void volPointInterpolation::makeWeights() // a coupled point to have its master on a different patch so // to make sure just push master data to slaves. Reuse the syncPointData // structure. - //mesh().globalData().syncPointData(sumWeights, nopEqOp<scalar>()); pushUntransformedData(sumWeights); -- GitLab