diff --git a/applications/test/extendedStencil/Test-ExtendedStencil.C b/applications/test/extendedStencil/Test-ExtendedStencil.C index 72c1afb2c1..0e50f8710f 100644 --- a/applications/test/extendedStencil/Test-ExtendedStencil.C +++ b/applications/test/extendedStencil/Test-ExtendedStencil.C @@ -56,6 +56,8 @@ Description //#include "centredCFCFaceToCellStencilObject.H" #include "centredCECCellToCellStencilObject.H" +#include "centredCFCCellToCellStencilObject.H" +#include "centredCPCCellToCellStencilObject.H" using namespace Foam; @@ -460,7 +462,63 @@ int main(int argc, char *argv[]) { writeStencilOBJ ( - runTime.path()/"centredCell" + Foam::name(cellI) + ".obj", + runTime.path()/"centredCECCell" + Foam::name(cellI) + ".obj", + mesh.cellCentres()[cellI], + stencilPoints[cellI] + ); + } + } + { + const extendedCentredCellToCellStencil& addressing = + centredCPCCellToCellStencilObject::New + ( + mesh + ); + + Info<< "cellCellCell:" << endl; + writeStencilStats(addressing.stencil()); + + // Collect stencil cell centres + List > stencilPoints(mesh.nCells()); + addressing.collectData + ( + mesh.C(), + stencilPoints + ); + + forAll(stencilPoints, cellI) + { + writeStencilOBJ + ( + runTime.path()/"centredCPCCell" + Foam::name(cellI) + ".obj", + mesh.cellCentres()[cellI], + stencilPoints[cellI] + ); + } + } + { + const extendedCentredCellToCellStencil& addressing = + centredCFCCellToCellStencilObject::New + ( + mesh + ); + + Info<< "cellCellCell:" << endl; + writeStencilStats(addressing.stencil()); + + // Collect stencil cell centres + List > stencilPoints(mesh.nCells()); + addressing.collectData + ( + mesh.C(), + stencilPoints + ); + + forAll(stencilPoints, cellI) + { + writeStencilOBJ + ( + runTime.path()/"centredCFCCell" + Foam::name(cellI) + ".obj", mesh.cellCentres()[cellI], stencilPoints[cellI] ); diff --git a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C index f4ce2cc95d..f2c091e4ad 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C +++ b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C @@ -493,7 +493,6 @@ int main(int argc, char *argv[]) mesh.nFaces(), // start patchI, // index mesh.boundaryMesh(),// polyBoundaryMesh - Pstream::worldComm, // communicator Pstream::myProcNo(),// myProcNo nbrProcI // neighbProcNo ) diff --git a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict index f448faa40c..ca4a9dc6b5 100644 --- a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict +++ b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict @@ -180,6 +180,12 @@ castellatedMeshControls // - used if feature snapping (see snapControls below) is used resolveFeatureAngle 30; + // Planar angle: + // - used to determine if neighbouring surface normals + // are roughly the same so e.g. free-standing baffles can be merged + // If not specified same as resolveFeatureAngle + //planarAngle 30; + // Region-wise refinement // ~~~~~~~~~~~~~~~~~~~~~~ diff --git a/applications/utilities/mesh/manipulation/createBaffles/createBafflesDict b/applications/utilities/mesh/manipulation/createBaffles/createBafflesDict index b392f07642..ef2eb96227 100644 --- a/applications/utilities/mesh/manipulation/createBaffles/createBafflesDict +++ b/applications/utilities/mesh/manipulation/createBaffles/createBafflesDict @@ -14,6 +14,20 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Sample for creating baffles: +// - usually converting internal faces into two boundary faces +// - or converting boundary faces into a boundary face +// (internalFacesOnly=false)(though should use really createPatch +// to do this) +// - can also create duplicate (overlapping) sets of baffles: +// - internalFacesOnly = false +// - have 4 entries in patches: +// - master +// - slave +// - additional master +// - additional slave + + // Whether to convert internal faces only (so leave boundary faces intact). // This is only relevant if your face selection type can pick up boundary // faces. diff --git a/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C b/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C index f563978b60..15cbd85d11 100644 --- a/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C +++ b/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C @@ -448,7 +448,6 @@ bool Foam::domainDecomposition::writeDecomposition() curStart, nPatches, procMesh.boundaryMesh(), - Pstream::worldComm, procI, curNeighbourProcessors[procPatchI] ); @@ -476,7 +475,6 @@ bool Foam::domainDecomposition::writeDecomposition() curStart, nPatches, procMesh.boundaryMesh(), - Pstream::worldComm, procI, curNeighbourProcessors[procPatchI], referPatch, diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C b/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C index edb29d3998..d50bf96448 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C @@ -240,7 +240,7 @@ int main(int argc, char *argv[]) wordHashSet allCloudNames; if (Pstream::master()) { - word geomFileName = prepend + "000"; + word geomFileName = prepend + "0000"; // test pre check variable if there is a moving mesh if (meshMoving) diff --git a/applications/utilities/preProcessing/viewFactorsGen/searchingEngine.H b/applications/utilities/preProcessing/viewFactorsGen/searchingEngine.H index ed1d9031ec..ef5b264a54 100644 --- a/applications/utilities/preProcessing/viewFactorsGen/searchingEngine.H +++ b/applications/utilities/preProcessing/viewFactorsGen/searchingEngine.H @@ -26,7 +26,8 @@ dict.add("mergeDistance", SMALL); labelHashSet includePatches; forAll(patches, patchI) { - if (!isA(patches[patchI])) + const polyPatch& pp = patches[patchI]; + if (!pp.coupled() && !isA(pp)) { includePatches.insert(patchI); } diff --git a/applications/utilities/preProcessing/viewFactorsGen/viewFactorsGen.C b/applications/utilities/preProcessing/viewFactorsGen/viewFactorsGen.C index c9aa219d13..8276528945 100644 --- a/applications/utilities/preProcessing/viewFactorsGen/viewFactorsGen.C +++ b/applications/utilities/preProcessing/viewFactorsGen/viewFactorsGen.C @@ -44,6 +44,7 @@ Description #include "volFields.H" #include "surfaceFields.H" #include "distributedTriSurfaceMesh.H" +#include "cyclicAMIPolyPatch.H" #include "triSurfaceTools.H" #include "mapDistribute.H" diff --git a/etc/caseDicts/setConstraintTypes b/etc/caseDicts/setConstraintTypes index 85d6ec525c..1678e2a147 100644 --- a/etc/caseDicts/setConstraintTypes +++ b/etc/caseDicts/setConstraintTypes @@ -16,6 +16,11 @@ cyclicAMI type cyclicAMI; } +cyclicACMI +{ + type cyclicACMI; +} + cyclicSlip { type cyclicSlip; diff --git a/etc/controlDict b/etc/controlDict index b9c41cb3a4..fba02069de 100644 --- a/etc/controlDict +++ b/etc/controlDict @@ -135,7 +135,7 @@ DebugSwitches FDIC 0; FaceCellWave 0; GAMG 0; - GAMGAgglomeration 0; + GAMGAgglomeration 1; GAMGInterface 0; GAMGInterfaceField 0; Gamma 0; diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files index a261a58572..8fbcde54bc 100644 --- a/src/OpenFOAM/Make/files +++ b/src/OpenFOAM/Make/files @@ -332,10 +332,8 @@ eagerGAMGProcAgglomeration = $(GAMGProcAgglomerations)/eagerGAMGProcAgglomeratio $(eagerGAMGProcAgglomeration)/eagerGAMGProcAgglomeration.C noneGAMGProcAgglomeration = $(GAMGProcAgglomerations)/noneGAMGProcAgglomeration $(noneGAMGProcAgglomeration)/noneGAMGProcAgglomeration.C -/* -cellFaceRatioGAMGProcAgglomeration = $(GAMGProcAgglomerations)/cellFaceRatioGAMGProcAgglomeration -$(cellFaceRatioGAMGProcAgglomeration)/cellFaceRatioGAMGProcAgglomeration.C -*/ +procFacesGAMGProcAgglomeration = $(GAMGProcAgglomerations)/procFacesGAMGProcAgglomeration +$(procFacesGAMGProcAgglomeration)/procFacesGAMGProcAgglomeration.C meshes/lduMesh/lduMesh.C diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C index c1b516e97c..c024d98389 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C +++ b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -49,21 +49,16 @@ readField << endl; } - // Patch or patch-groups. (using non-wild card entries of dictionaries) + + // 1. Handle explicit patch names forAllConstIter(dictionary, dict, iter) { if (iter().isDict() && !iter().keyword().isPattern()) { - const labelList patchIDs = bmesh_.findIndices - ( - iter().keyword(), - true - ); + label patchi = bmesh_.findPatchID(iter().keyword()); - forAll(patchIDs, i) + if (patchi != -1) { - label patchi = patchIDs[i]; - this->set ( patchi, @@ -78,7 +73,43 @@ readField } } - // Check for wildcard patch overrides + + // 2. Patch-groups. (using non-wild card entries of dictionaries) + // (patchnames already matched above) + // Note: in order of entries in the dictionary (first patchGroups wins) + forAllConstIter(dictionary, dict, iter) + { + if (iter().isDict() && !iter().keyword().isPattern()) + { + const labelList patchIDs = bmesh_.findIndices + ( + iter().keyword(), + true // use patchGroups + ); + + forAll(patchIDs, i) + { + label patchi = patchIDs[i]; + + if (!this->set(patchi)) + { + this->set + ( + patchi, + PatchField::New + ( + bmesh_[patchi], + field, + iter().dict() + ) + ); + } + } + } + } + + + // 3. Wildcard patch overrides forAll(bmesh_, patchi) { if (!this->set(patchi)) diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomerateLduAddressing.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomerateLduAddressing.C index e6781ed23f..066aa39d3b 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomerateLduAddressing.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomerateLduAddressing.C @@ -351,7 +351,7 @@ void Foam::GAMGAgglomeration::agglomerateLduAddressing ); - if (debug) + if (debug & 2) { Pout<< "GAMGAgglomeration :" << " agglomerated level " << fineLevelIndex diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C index d1551eb399..75af8eb20a 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C @@ -27,9 +27,9 @@ License #include "lduMesh.H" #include "lduMatrix.H" #include "Time.H" -#include "dlLibraryTable.H" #include "GAMGInterface.H" #include "GAMGProcAgglomeration.H" +#include "IOmanip.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -67,23 +67,112 @@ void Foam::GAMGAgglomeration::compactLevels(const label nCreatedLevels) procBoundaryFaceMap_.setSize(nCreatedLevels); procAgglomeratorPtr_().agglomerate(); - } - if (debug) - { - for (label levelI = 0; levelI <= size(); levelI++) + + if (debug) { - if (hasMeshLevel(levelI)) + + Info<< "GAMGAgglomeration:" << nl + << " local agglomerator : " << type() << nl + << " processor agglomerator : " + << procAgglomeratorPtr_().type() << nl + << nl; + + Info<< setw(40) << "nCells" + << setw(24) << "nFaces/nCells" + << setw(24) << "nInterfaces" + << setw(24) << "nIntFaces/nCells" << nl + << setw(8) << "Level" + << setw(8) << "nProcs" + << " " + << setw(8) << "avg" + << setw(8) << "max" + << " " + << setw(8) << "avg" + << setw(8) << "max" + << " " + << setw(8) << "avg" + << setw(8) << "max" + << " " << setw(4) << "avg" + << " " << setw(4) << "max" + << nl + << setw(8) << "-----" + << setw(8) << "------" + << " " + << setw(8) << "---" + << setw(8) << "---" + << " " + << setw(8) << "---" + << setw(8) << "---" + << " " << setw(4) << "---" + << " " << setw(4) << "---" + << nl; + + for (label levelI = 0; levelI <= size(); levelI++) { - const lduMesh& fineMesh = meshLevel(levelI); - Pout<< "Level " << levelI << " fine mesh:"<< nl; - Pout<< fineMesh.info() << endl; - } - else - { - Pout<< "Level " << levelI << " has no fine mesh:" << nl - << endl; + label nProcs = 0; + label nCells = 0; + scalar faceCellRatio = 0; + label nInterfaces = 0; + label nIntFaces = 0; + scalar ratio = 0.0; + + if (hasMeshLevel(levelI)) + { + nProcs = 1; + + const lduMesh& fineMesh = meshLevel(levelI); + nCells = fineMesh.lduAddr().size(); + faceCellRatio = + scalar(fineMesh.lduAddr().lowerAddr().size())/nCells; + + const lduInterfacePtrsList interfaces = + fineMesh.interfaces(); + forAll(interfaces, i) + { + if (interfaces.set(i)) + { + nInterfaces++; + nIntFaces += interfaces[i].faceCells().size(); + } + } + ratio = scalar(nIntFaces)/nCells; + } + + label totNprocs = returnReduce(nProcs, sumOp