From 192e2eeb9de627d8c5da723ae8cfb18b9a074dac Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 31 Oct 2018 12:08:55 +0000 Subject: [PATCH] BUG: tutorials: fix tutorials for 1812. See #1059. --- .../refinementSurfaces/refinementSurfaces.C | 4 +- .../shellSurfaces/shellSurfaces.C | 2 +- .../searchableSurfaceCollection.C | 33 ++-- .../parallel/cavity/system/decomposeParDict | 144 +----------------- .../parallel/cavity/system/decomposeParDict-5 | 143 +---------------- .../system/decomposeParDict | 124 --------------- .../system/snappyHexMeshDict | 18 +-- 7 files changed, 36 insertions(+), 432 deletions(-) diff --git a/src/mesh/snappyHexMesh/refinementSurfaces/refinementSurfaces.C b/src/mesh/snappyHexMesh/refinementSurfaces/refinementSurfaces.C index ec4a95b43a..9d68962bf5 100644 --- a/src/mesh/snappyHexMesh/refinementSurfaces/refinementSurfaces.C +++ b/src/mesh/snappyHexMesh/refinementSurfaces/refinementSurfaces.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation - \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. + \\/ M anipulation | Copyright (C) 2015-2018 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -185,7 +185,7 @@ Foam::refinementSurfaces::refinementSurfaces const word& geomName = allGeometry_.names()[geomI]; const entry* ePtr = - surfacesDict.findEntry(geomName, keyType::LITERAL); + surfacesDict.findEntry(geomName, keyType::REGEX); if (ePtr) { diff --git a/src/mesh/snappyHexMesh/shellSurfaces/shellSurfaces.C b/src/mesh/snappyHexMesh/shellSurfaces/shellSurfaces.C index 56d263c3fa..82a81a2bf7 100644 --- a/src/mesh/snappyHexMesh/shellSurfaces/shellSurfaces.C +++ b/src/mesh/snappyHexMesh/shellSurfaces/shellSurfaces.C @@ -613,7 +613,7 @@ Foam::shellSurfaces::shellSurfaces { const word& geomName = allGeometry_.names()[geomI]; - const entry* eptr = shellsDict.findEntry(geomName, keyType::LITERAL); + const entry* eptr = shellsDict.findEntry(geomName, keyType::REGEX); if (eptr) { diff --git a/src/meshTools/searchableSurfaces/searchableSurfaceCollection/searchableSurfaceCollection.C b/src/meshTools/searchableSurfaces/searchableSurfaceCollection/searchableSurfaceCollection.C index 82c01dac0d..8188f683df 100644 --- a/src/meshTools/searchableSurfaces/searchableSurfaceCollection/searchableSurfaceCollection.C +++ b/src/meshTools/searchableSurfaces/searchableSurfaceCollection/searchableSurfaceCollection.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation - \\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd. + \\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -193,16 +193,31 @@ Foam::searchableSurfaceCollection::searchableSurfaceCollection { instance_[surfI] = dEntry.keyword(); - const dictionary& subDict = dEntry.dict(); + const dictionary& sDict = dEntry.dict(); - subDict.readEntry("scale", scale_[surfI]); - transform_.set - ( - surfI, - new coordSystem::cartesian(subDict, "transform") - ); + sDict.readEntry("scale", scale_[surfI]); - const word subGeomName(subDict.get("surface")); + const dictionary& coordDict = sDict.subDict("transform"); + if (coordDict.found("coordinateSystem")) + { + // Backwards compatibility: use coordinateSystem subdictionary + transform_.set + ( + surfI, + new coordSystem::cartesian(coordDict, "coordinateSystem") + ); + } + else + { + // New form: directly set from dictionary + transform_.set + ( + surfI, + new coordSystem::cartesian(sDict, "transform") + ); + } + + const word subGeomName(sDict.get("surface")); //Pout<< "Trying to find " << subGeomName << endl; searchableSurface& s = diff --git a/tutorials/mesh/parallel/cavity/system/decomposeParDict b/tutorials/mesh/parallel/cavity/system/decomposeParDict index 7318ec1d80..70d6961d97 100644 --- a/tutorials/mesh/parallel/cavity/system/decomposeParDict +++ b/tutorials/mesh/parallel/cavity/system/decomposeParDict @@ -17,148 +17,6 @@ FoamFile numberOfSubdomains 2; -//- Use the volScalarField named here as a weight for each cell in the -// decomposition. For example, use a particle population field to decompose -// for a balanced number of particles in a lagrangian simulation. -// weightField dsmcRhoNMean; - -method scotch; -// method kahip; -// method metis; -// method hierarchical; -// method simple; -// method manual; -// method multiLevel; -// method structured; // does 2D decomposition of structured mesh - -multiLevelCoeffs -{ - // Decomposition methods to apply in turn. This is like hierarchical but - // fully general - every method can be used at every level. - - level0 - { - numberOfSubdomains 64; - //method simple; - //simpleCoeffs - //{ - // n (2 1 1); - // delta 0.001; - //} - method scotch; - } - level1 - { - numberOfSubdomains 4; - method scotch; - } -} - -// Desired output - -simpleCoeffs -{ - n (2 1 1); -} - -hierarchicalCoeffs -{ - n (1 2 1); -} - -metisCoeffs -{ - /* - processorWeights - ( - 1 - 1 - 1 - 1 - ); - */ -} - -scotchCoeffs -{ - //processorWeights - //( - // 1 - // 1 - // 1 - // 1 - //); - //writeGraph true; - //strategy "b"; -} - -manualCoeffs -{ - dataFile "decompositionData"; -} - -structuredCoeffs -{ - // Patches to do 2D decomposition on. Structured mesh only; cells have - // to be in 'columns' on top of patches. - patches (movingWall); - - // Method to use on the 2D subset - method scotch; -} - -/* -constraints -{ - //- Keep owner and neighbour on same processor for faces in zones: - zones - { - type preserveFaceZones; - zones (heater solid1 solid3); - enabled false; - } - - //- Keep owner and neighbour on same processor for faces in patches: - // (makes sense only for cyclic patches) - patches - { - type preservePatches; - patches (cyclic_half0 cyclic_half1); - enabled false; - } - - //- Keep all of faceSet on a single processor. This puts all cells - // connected with a point, edge or face on the same processor. - // (just having face connected cells might not guarantee a balanced - // decomposition) - // The processor can be -1 (the decompositionMethod chooses the processor - // for a good load balance) or explicitly provided (upsets balance). - processors - { - type singleProcessorFaceSets; - sets ((f0 -1)); - enabled false; - } - - //- Keep owner and neighbour of baffles on same processor - // (i.e. keep it detectable as a baffle). - // Baffles are two boundary face sharing the same points. - baffles - { - type preserveBaffles; - enabled false; - } -} -*/ - -//// Is the case distributed? Note: command-line argument -roots takes -//// precedence -//distributed yes; -//// Per slave (so nProcs-1 entries) the directory above the case. -//roots -//( -// "/tmp" -// "/tmp" -//); +method scotch; // ************************************************************************* // diff --git a/tutorials/mesh/parallel/cavity/system/decomposeParDict-5 b/tutorials/mesh/parallel/cavity/system/decomposeParDict-5 index 008d946f44..fcd2180e92 100644 --- a/tutorials/mesh/parallel/cavity/system/decomposeParDict-5 +++ b/tutorials/mesh/parallel/cavity/system/decomposeParDict-5 @@ -17,147 +17,6 @@ FoamFile numberOfSubdomains 5; -//- Use the volScalarField named here as a weight for each cell in the -// decomposition. For example, use a particle population field to decompose -// for a balanced number of particles in a lagrangian simulation. -// weightField dsmcRhoNMean; - -method scotch; -// method kahip; -// method metis; -// method hierarchical; -// method simple; -// method manual; -// method multiLevel; -// method structured; // does 2D decomposition of structured mesh - -multiLevelCoeffs -{ - // Decomposition methods to apply in turn. This is like hierarchical but - // fully general - every method can be used at every level. - - level0 - { - numberOfSubdomains 64; - //method simple; - //simpleCoeffs - //{ - // n (2 1 1); - // delta 0.001; - //} - method scotch; - } - level1 - { - numberOfSubdomains 4; - method scotch; - } -} - -// Desired output - -simpleCoeffs -{ - n (2 1 1); -} - -hierarchicalCoeffs -{ - n (1 2 1); -} - -metisCoeffs -{ - /* - processorWeights - ( - 1 - 1 - 1 - 1 - ); - */ -} - -scotchCoeffs -{ - //processorWeights - //( - // 1 - // 1 - // 1 - // 1 - //); - //writeGraph true; - //strategy "b"; -} - -manualCoeffs -{ - dataFile "decompositionData"; -} - -structuredCoeffs -{ - // Method to use on the 2D subset - method scotch; - - // Patches to do 2D decomposition on. Structured mesh only; cells have - // to be in 'columns' on top of patches. - patches (movingWall); -} - -constraints -{ - //- Keep owner and neighbour on same processor for faces in zones: - zones - { - type preserveFaceZones; - zones (heater solid1 solid3); - enabled false; - } - - //- Keep owner and neighbour on same processor for faces in patches: - // (makes sense only for cyclic patches) - patches - { - type preservePatches; - patches (cyclic_half0 cyclic_half1); - enabled false; - } - - //- Keep all of faceSet on a single processor. This puts all cells - // connected with a point, edge or face on the same processor. - // (just having face connected cells might not guarantee a balanced - // decomposition) - // The processor can be -1 (the decompositionMethod chooses the processor - // for a good load balance) or explicitly provided (upsets balance). - processors - { - type singleProcessorFaceSets; - sets ((f0 -1)); - enabled false; - } - - //- Keep owner and neighbour of baffles on same processor - // (i.e. keep it detectable as a baffle). - // Baffles are two boundary face sharing the same points. - baffles - { - type preserveBaffles; - enabled false; - } -} - - -//// Is the case distributed? Note: command-line argument -roots takes -//// precedence -//distributed yes; -//// Per slave (so nProcs-1 entries) the directory above the case. -//roots -//( -// "/tmp" -// "/tmp" -//); +method scotch; // ************************************************************************* // diff --git a/tutorials/mesh/snappyHexMesh/addLayersToFaceZone/system/decomposeParDict b/tutorials/mesh/snappyHexMesh/addLayersToFaceZone/system/decomposeParDict index 64a98e1f0e..c8aadf8931 100644 --- a/tutorials/mesh/snappyHexMesh/addLayersToFaceZone/system/decomposeParDict +++ b/tutorials/mesh/snappyHexMesh/addLayersToFaceZone/system/decomposeParDict @@ -23,141 +23,17 @@ numberOfSubdomains 2; // weightField dsmcRhoNMean; method scotch; -//method hierarchical; -// method simple; -// method metis; -// method manual; -// method multiLevel; -// method structured; // does 2D decomposition of structured mesh - -multiLevelCoeffs -{ - // Decomposition methods to apply in turn. This is like hierarchical but - // fully general - every method can be used at every level. - - level0 - { - numberOfSubdomains 64; - //method simple; - //simpleCoeffs - //{ - // n (2 1 1); - // delta 0.001; - //} - method scotch; - } - level1 - { - numberOfSubdomains 4; - method scotch; - } -} - -// Desired output - -simpleCoeffs -{ - n (2 1 1); -} - -hierarchicalCoeffs -{ - n (1 2 1); -} - -metisCoeffs -{ - /* - processorWeights - ( - 1 - 1 - 1 - 1 - ); - */ -} - -scotchCoeffs -{ - //processorWeights - //( - // 1 - // 1 - // 1 - // 1 - //); - //writeGraph true; - //strategy "b"; -} - -manualCoeffs -{ - dataFile "decompositionData"; -} - -structuredCoeffs -{ - // Method to use on the 2D subset - method scotch; - - // Patches to do 2D decomposition on. Structured mesh only; cells have - // to be in 'columns' on top of patches. - patches (movingWall); -} - constraints { - //- Keep owner and neighbour on same processor for faces in zones: - zones - { - type preserveFaceZones; - zones (heater solid1 solid3); - enabled false; - } - - //- Keep owner and neighbour on same processor for faces in patches: - // (makes sense only for cyclic patches) - patches - { - type preservePatches; - patches (cyclic_half0 cyclic_half1); - enabled false; - } - - //- Keep all of faceSet on a single processor. This puts all cells - // connected with a point, edge or face on the same processor. - // (just having face connected cells might not guarantee a balanced - // decomposition) - // The processor can be -1 (the decompositionMethod chooses the processor - // for a good load balance) or explicitly provided (upsets balance). - singleProcessorFaceSets - { - type singleProcessorFaceSets; - sets ((f0 -1)); - enabled false; - } - //- Keep owner and neighbour of baffles on same processor // (i.e. keep it detectable as a baffle). // Baffles are two boundary face sharing the same points. baffles { type preserveBaffles; - enabled false; } } -//// Is the case distributed? Note: command-line argument -roots takes -//// precedence -//distributed yes; -//// Per slave (so nProcs-1 entries) the directory above the case. -//roots -//( -// "/tmp" -// "/tmp" -//); - // ************************************************************************* // diff --git a/tutorials/mesh/snappyHexMesh/iglooWithFridgesDirectionalRefinement/system/snappyHexMeshDict b/tutorials/mesh/snappyHexMesh/iglooWithFridgesDirectionalRefinement/system/snappyHexMeshDict index b3e43aff51..7cc3d37290 100644 --- a/tutorials/mesh/snappyHexMesh/iglooWithFridgesDirectionalRefinement/system/snappyHexMeshDict +++ b/tutorials/mesh/snappyHexMesh/iglooWithFridgesDirectionalRefinement/system/snappyHexMeshDict @@ -52,6 +52,8 @@ geometry { surface box1; scale (1.0 1.0 2.1); + + // Old syntax transform { coordinateSystem @@ -71,19 +73,13 @@ geometry { surface box1; scale (1.0 1.0 2.1); + + // Simplified syntax transform { - coordinateSystem - { - type cartesian; - origin (3.5 3 0); - coordinateRotation - { - type axesRotation; - e1 (1 0 0); - e3 (0 0 1); - } - } + origin (3.5 3 0); + e1 (1 0 0); + e3 (0 0 1); } } }