From fee11f0fa56b98d1bee9e52d9084452309830e2e Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 22 Feb 2013 17:26:12 +0000 Subject: [PATCH] ENH: laplacianFoam: back to solve on single processor --- .../laplacianFoam.C | 1186 ++++------------- 1 file changed, 278 insertions(+), 908 deletions(-) diff --git a/applications/test/laplacianFoam-communicators/laplacianFoam.C b/applications/test/laplacianFoam-communicators/laplacianFoam.C index 3f7bf4cf6d..8a54cb256c 100644 --- a/applications/test/laplacianFoam-communicators/laplacianFoam.C +++ b/applications/test/laplacianFoam-communicators/laplacianFoam.C @@ -34,6 +34,8 @@ Description #include "globalIndex.H" #include "lduPrimitiveMesh.H" #include "processorGAMGInterface.H" +#include "GAMGInterfaceField.H" +#include "processorLduInterfaceField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -126,7 +128,7 @@ void print(const string& msg, const lduMesh& mesh) } } - Pout<< "Patches:" << nl; + Pout<< " Patches:" << nl; forAll(interfaces, i) { if (interfaces.set(i)) @@ -135,7 +137,7 @@ void print(const string& msg, const lduMesh& mesh) { const processorLduInterface& pldui = refCast(interfaces[i]); - Pout<< " " << i + Pout<< " " << i << " me:" << pldui.myProcNo() << " nbr:" << pldui.neighbProcNo() << " comm:" << pldui.comm() @@ -144,7 +146,7 @@ void print(const string& msg, const lduMesh& mesh) } { - Pout<< " " << i << " addressing:" << nl; + Pout<< " " << i << " addressing:" << nl; const labelUList& faceCells = interfaces[i].faceCells(); forAll(faceCells, i) { @@ -156,7 +158,6 @@ void print(const string& msg, const lduMesh& mesh) } - template lduSchedule nonBlockingSchedule ( @@ -203,503 +204,6 @@ lduSchedule nonBlockingSchedule } - -// Say combining procs 1,13,9,4. -// - cells get added in order 1,4,9,13 -// - internal faces get added in order of processor and then order of -// neighbouring processor: -// - internal faces of 1 -// - faces between 1 and 4 (keep orientation) -// - faces between 1 and 9 -// - faces between 1 and 13 -// - interfaces between 1 and other processors -// and then -// - internal faces of 4 -// - faces between 4 and 1 (skip; already added) -// - faces between 4 and 9 -// - faces between 4 and 13 -// - interfaces between 4 and other processors -// etc. -// - this still does not guarantee that upper-triangular order is preserved: -// A cell has two processor faces. These now become internal faces and if -// the cell numbering on the other side is not in the same order as the internal -// faces we have upper-triangular. -autoPtr combineMeshes -( - const label newComm, - const labelList& procIDs, - const PtrList& procMeshes, - - labelList& cellOffsets, // per mesh the starting cell - labelList& faceOffsets, // per mesh the starting face - labelList& interfaceOffsets // per mesh,per interface the starting face -) -{ - // Sanity check. - for (label i = 1; i < procIDs.size(); i++) - { - if (procIDs[i] <= procIDs[i-1]) - { - FatalErrorIn - ( - "combineMeshes(const labelList&, const PtrList&)" - ) << "Processor " << procIDs[i] << " at index " << i - << " should be higher numbered than its predecessor " - << procIDs[i-1] - << exit(FatalError); - } - } - - - label currentComm = procMeshes[0].comm(); - - - // Cells get added in order. - cellOffsets.setSize(procMeshes.size()+1); - cellOffsets[0] = 0; - forAll(procMeshes, procMeshI) - { - const lduMesh& mesh = procMeshes[procMeshI]; - cellOffsets[procMeshI+1] = - cellOffsets[procMeshI] - + mesh.lduAddr().size(); - } - - // Faces initially get added in order, sorted later - labelList internalFaceOffsets(procMeshes.size()+1); - internalFaceOffsets[0] = 0; - forAll(procMeshes, procMeshI) - { - const lduMesh& mesh = procMeshes[procMeshI]; - internalFaceOffsets[procMeshI+1] = - internalFaceOffsets[procMeshI] - + mesh.lduAddr().lowerAddr().size(); - } - - // Count how faces get added. Interfaces inbetween get merged. - - // Merged interfaces: map from two processors back to - // - procMeshes - // - interface in procMesh - EdgeMap mergedMap - ( - 2*procMeshes[0].interfaces().size() - ); - - - // Unmerged interfaces: map from two processors back to - // - procMeshes - // - interface in procMesh - EdgeMap unmergedMap - ( - 2*procMeshes[0].interfaces().size() - ); - // Per interface the size - //DynamicList