diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files index dc8e946baa..43ac4822ab 100644 --- a/src/OpenFOAM/Make/files +++ b/src/OpenFOAM/Make/files @@ -317,6 +317,7 @@ algebraicPairGAMGAgglomeration = $(GAMGAgglomerations)/algebraicPairGAMGAgglomer $(algebraicPairGAMGAgglomeration)/algebraicPairGAMGAgglomeration.C meshes/lduMesh/lduMesh.C +meshes/lduMesh/lduPrimitiveMesh.C LduMatrix = matrices/LduMatrix $(LduMatrix)/LduMatrix/lduMatrices.C diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C b/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C index 9c49b28963..81562f6998 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C +++ b/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C @@ -355,7 +355,7 @@ int Foam::UPstream::baseProcNo(const label myComm, const int myProcID) } -Foam::label Foam::UPstream::myProcNo(const label myComm, const int baseProcID) +Foam::label Foam::UPstream::procNo(const label myComm, const int baseProcID) { const List& parentRanks = procID(myComm); label parentComm = parent(myComm); @@ -366,12 +366,24 @@ Foam::label Foam::UPstream::myProcNo(const label myComm, const int baseProcID) } else { - label parentRank = myProcNo(parentComm, baseProcID); + label parentRank = procNo(parentComm, baseProcID); return findIndex(parentRanks, parentRank); } } +Foam::label Foam::UPstream::procNo +( + const label myComm, + const label currentComm, + const int currentProcID +) +{ + label physProcID = UPstream::baseProcNo(currentComm, currentProcID); + return procNo(myComm, physProcID); +} + + // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // By default this is not a parallel run diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H b/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H index ab6517dadb..f23ee07bfc 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H +++ b/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H @@ -336,12 +336,20 @@ public: //- Return physical processor number (i.e. processor number in // worldComm) given communicator and procssor - static int baseProcNo(const label myComm, const int myProcID); + static int baseProcNo(const label myComm, const int procID); //- Return processor number in communicator (given physical processor // number) (= reverse of baseProcNo) - static label myProcNo(const label myComm, const int baseProcID); + static label procNo(const label comm, const int baseProcID); + //- Return processor number in communicator (given processor number + // and communicator) + static label procNo + ( + const label myComm, + const label currentComm, + const int currentProcID + ); //- Add the valid option this type of communications library // adds/requires on the command line diff --git a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduAddressing.H b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduAddressing.H index 676119f523..6266737285 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduAddressing.H +++ b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduAddressing.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -39,7 +39,7 @@ Description order but only for groups of edges belonging to each point. An example is given below: \verbatim - owner eighbour + owner neighbour 0 1 0 20 1 2 diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/GAMGInterface.H b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/GAMGInterface.H index 9de5255abb..a994b792f7 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/GAMGInterface.H +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/GAMGInterface.H @@ -65,10 +65,10 @@ protected: const lduInterfacePtrsList& coarseInterfaces_; //- Face-cell addressing - labelField faceCells_; + labelList faceCells_; //- Face restrict addressing - labelField faceRestrictAddressing_; + labelList faceRestrictAddressing_; private: @@ -134,17 +134,11 @@ public: // Constructors - //- Construct from fine-level interface, - // local and neighbour restrict addressing + //- Construct from interfaces, restrict addressing set later on GAMGInterface ( const label index, - const lduInterfacePtrsList& coarseInterfaces, - const lduInterface&, - const labelField&, - const labelField&, - const label fineLevelIndex = -1, - const label coarseComm = UPstream::worldComm + const lduInterfacePtrsList& coarseInterfaces ) : index_(index), @@ -152,6 +146,22 @@ public: {} + //- Construct from interfaces and restrict addressing + GAMGInterface + ( + const label index, + const lduInterfacePtrsList& coarseInterfaces, + const labelUList& faceCells, + const labelUList& faceRestrictAddressing + ) + : + index_(index), + coarseInterfaces_(coarseInterfaces), + faceCells_(faceCells), + faceRestrictAddressing_(faceRestrictAddressing) + {} + + // Member Functions // Access diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/cyclicGAMGInterface/cyclicGAMGInterface.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/cyclicGAMGInterface/cyclicGAMGInterface.C index 54ea2116c9..c00b2f0fda 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/cyclicGAMGInterface/cyclicGAMGInterface.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/cyclicGAMGInterface/cyclicGAMGInterface.C @@ -58,10 +58,10 @@ Foam::cyclicGAMGInterface::cyclicGAMGInterface GAMGInterface ( index, - coarseInterfaces, - fineInterface, - localRestrictAddressing, - neighbourRestrictAddressing + coarseInterfaces +// fineInterface, +// localRestrictAddressing, +// neighbourRestrictAddressing ), fineCyclicInterface_(refCast(fineInterface)) { diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/processorGAMGInterface/processorGAMGInterface.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/processorGAMGInterface/processorGAMGInterface.C index f753853a72..4fd4b76481 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/processorGAMGInterface/processorGAMGInterface.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/processorGAMGInterface/processorGAMGInterface.C @@ -58,13 +58,20 @@ Foam::processorGAMGInterface::processorGAMGInterface GAMGInterface ( index, - coarseInterfaces, - fineInterface, - localRestrictAddressing, - neighbourRestrictAddressing + coarseInterfaces +// fineInterface, +// localRestrictAddressing, +// neighbourRestrictAddressing ), - fineProcInterface_(refCast(fineInterface)), - comm_(coarseComm) +// fineProcInterface_(refCast(fineInterface)), + comm_(coarseComm), + myProcNo_(refCast(fineInterface).myProcNo()), + neighbProcNo_ + ( + refCast(fineInterface).neighbProcNo() + ), + forwardT_(refCast(fineInterface).forwardT()), + tag_(refCast(fineInterface).tag()) { // From coarse face to coarse cell DynamicList