diff --git a/src/OpenFOAM/matrices/LUscalarMatrix/LUscalarMatrix.C b/src/OpenFOAM/matrices/LUscalarMatrix/LUscalarMatrix.C index 03dc2d5536..121f016c2f 100644 --- a/src/OpenFOAM/matrices/LUscalarMatrix/LUscalarMatrix.C +++ b/src/OpenFOAM/matrices/LUscalarMatrix/LUscalarMatrix.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -260,6 +260,11 @@ void Foam::LUscalarMatrix::convert } else if (interface.myProcNo_ < interface.neighbProcNo_) { + // Interface to neighbour proc. Find on neighbour proc the + // corresponding interface. The problem is that there can + // be multiple interfaces between two processors (from + // processorCyclics) so also compare the communication tag + const PtrList& neiInterfaces = lduMatrices[interface.neighbProcNo_].interfaces_; @@ -269,8 +274,11 @@ void Foam::LUscalarMatrix::convert { if ( - neiInterfaces[ninti].neighbProcNo_ - == interface.myProcNo_ + ( + neiInterfaces[ninti].neighbProcNo_ + == interface.myProcNo_ + ) + && (neiInterfaces[ninti].tag_ == interface.tag_) ) { neiInterfacei = ninti; diff --git a/src/OpenFOAM/matrices/LUscalarMatrix/procLduInterface.C b/src/OpenFOAM/matrices/LUscalarMatrix/procLduInterface.C index 0a4b713202..979ef37027 100644 --- a/src/OpenFOAM/matrices/LUscalarMatrix/procLduInterface.C +++ b/src/OpenFOAM/matrices/LUscalarMatrix/procLduInterface.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -39,7 +39,8 @@ Foam::procLduInterface::procLduInterface faceCells_(interface.interface().faceCells()), coeffs_(coeffs), myProcNo_(-1), - neighbProcNo_(-1) + neighbProcNo_(-1), + tag_(-1) { if (isA(interface.interface())) { @@ -48,6 +49,7 @@ Foam::procLduInterface::procLduInterface myProcNo_ = pldui.myProcNo(); neighbProcNo_ = pldui.neighbProcNo(); + tag_ = pldui.tag(); } else if (isA(interface.interface())) { @@ -70,7 +72,8 @@ Foam::procLduInterface::procLduInterface(Istream& is) faceCells_(is), coeffs_(is), myProcNo_(readLabel(is)), - neighbProcNo_(readLabel(is)) + neighbProcNo_(readLabel(is)), + tag_(readLabel(is)) {} @@ -81,7 +84,8 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const procLduInterface& cldui) os << cldui.faceCells_ << cldui.coeffs_ << cldui.myProcNo_ - << cldui.neighbProcNo_; + << cldui.neighbProcNo_ + << cldui.tag_; return os; } diff --git a/src/OpenFOAM/matrices/LUscalarMatrix/procLduInterface.H b/src/OpenFOAM/matrices/LUscalarMatrix/procLduInterface.H index 0e03bfdb37..defaa331ff 100644 --- a/src/OpenFOAM/matrices/LUscalarMatrix/procLduInterface.H +++ b/src/OpenFOAM/matrices/LUscalarMatrix/procLduInterface.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -57,6 +57,7 @@ class procLduInterface scalarField coeffs_; label myProcNo_; label neighbProcNo_; + label tag_; // Private Member Functions