From 20a3d67c93bdbb4d4ea59fcc714f2aa1cd638841 Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 14 Oct 2013 14:48:05 +0100 Subject: [PATCH 01/13] STYLE: various: small coding issues --- applications/test/HashingSpeed/Test-HashingSpeed.C | 1 - applications/test/List/Test-List.C | 4 ++-- applications/test/string/Test-string.C | 4 ++-- .../PV3FoamReader/PV3FoamReader/pqPV3FoamReaderPanel.cxx | 6 +----- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/applications/test/HashingSpeed/Test-HashingSpeed.C b/applications/test/HashingSpeed/Test-HashingSpeed.C index 1b42b5d34d..c3cbda702d 100644 --- a/applications/test/HashingSpeed/Test-HashingSpeed.C +++ b/applications/test/HashingSpeed/Test-HashingSpeed.C @@ -1016,7 +1016,6 @@ int i; // found somewhere in the 2nd addition uint32_t stroustrup (const char * s, int len) { uint32_t h; - int i; for (register int i=0; i < len; ++s, ++i) { diff --git a/applications/test/List/Test-List.C b/applications/test/List/Test-List.C index ca303d53b7..719a5ebc5c 100644 --- a/applications/test/List/Test-List.C +++ b/applications/test/List/Test-List.C @@ -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 @@ -137,7 +137,7 @@ int main(int argc, char *argv[]) Info<< " std::list constructed from Foam::List: "; std::list::iterator it; - for (it=stlList.begin(); it != stlList.end(); it++) + for (it=stlList.begin(); it != stlList.end(); ++it) { Info<< *it << " "; } diff --git a/applications/test/string/Test-string.C b/applications/test/string/Test-string.C index 8494e8a104..f39be8c206 100644 --- a/applications/test/string/Test-string.C +++ b/applications/test/string/Test-string.C @@ -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 @@ -79,7 +79,7 @@ int main(int argc, char *argv[]) while (iter != iter2) { Info<< *iter; - iter++; + ++iter; } Info<< "<\n"; diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/pqPV3FoamReaderPanel.cxx b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/pqPV3FoamReaderPanel.cxx index f795ed8eec..3b111ff59f 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/pqPV3FoamReaderPanel.cxx +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/pqPV3FoamReaderPanel.cxx @@ -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 @@ -441,8 +441,6 @@ void pqPV3FoamReaderPanel::IncludeZonesToggled() void pqPV3FoamReaderPanel::ExtrapolatePatchesToggled() { - vtkSMProperty* prop; - vtkSMIntVectorProperty::SafeDownCast ( this->proxy()->GetProperty("UiExtrapolatePatches") @@ -454,8 +452,6 @@ void pqPV3FoamReaderPanel::ExtrapolatePatchesToggled() void pqPV3FoamReaderPanel::InterpolateVolFieldsToggled() { - vtkSMProperty* prop; - vtkSMIntVectorProperty::SafeDownCast ( this->proxy()->GetProperty("UiInterpolateVolFields") From 8f2e21952bf9e46de4e3487e7ceff05671963239 Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 14 Oct 2013 14:50:44 +0100 Subject: [PATCH 02/13] ENH: Field: add maxMagSqr op --- .../fields/Fields/Field/FieldFunctions.C | 55 +++++++++++++++++++ .../fields/Fields/Field/FieldFunctions.H | 12 ++++ 2 files changed, 67 insertions(+) diff --git a/src/OpenFOAM/fields/Fields/Field/FieldFunctions.C b/src/OpenFOAM/fields/Fields/Field/FieldFunctions.C index b33a9bc091..ff38ae0917 100644 --- a/src/OpenFOAM/fields/Fields/Field/FieldFunctions.C +++ b/src/OpenFOAM/fields/Fields/Field/FieldFunctions.C @@ -358,6 +358,59 @@ Type sum(const UList& f) TMP_UNARY_FUNCTION(Type, sum) +template +Type maxMagSqr(const UList& f) +{ + if (f.size()) + { + Type Max(f[0]); + TFOR_ALL_S_OP_FUNC_F_S + ( + Type, + Max, + =, + maxMagSqrOp(), + Type, + f, + Type, + Max + ) + return Max; + } + else + { + return pTraits::min; + } +} + +TMP_UNARY_FUNCTION(Type, maxMagSqr) + +template +Type minMagSqr(const UList& f) +{ + if (f.size()) + { + Type Min(f[0]); + TFOR_ALL_S_OP_FUNC_F_S + ( + Type, + Min, + =, + minMagSqrOp(), + Type, + f, + Type, + Min + ) + return Min; + } + else + { + return pTraits::max; + } +} + +TMP_UNARY_FUNCTION(Type, minMagSqr) template scalar sumProd(const UList& f1, const UList& f2) @@ -488,6 +541,8 @@ TMP_UNARY_FUNCTION(ReturnType, gFunc) G_UNARY_FUNCTION(Type, gMax, max, max) G_UNARY_FUNCTION(Type, gMin, min, min) G_UNARY_FUNCTION(Type, gSum, sum, sum) +G_UNARY_FUNCTION(Type, gMaxMagSqr, maxMagSqr, maxMagSqr) +G_UNARY_FUNCTION(Type, gMinMagSqr, minMagSqr, minMagSqr) G_UNARY_FUNCTION(scalar, gSumSqr, sumSqr, sum) G_UNARY_FUNCTION(scalar, gSumMag, sumMag, sum) G_UNARY_FUNCTION(Type, gSumCmptMag, sumCmptMag, sum) diff --git a/src/OpenFOAM/fields/Fields/Field/FieldFunctions.H b/src/OpenFOAM/fields/Fields/Field/FieldFunctions.H index f1fa2fdd96..4c51262f9e 100644 --- a/src/OpenFOAM/fields/Fields/Field/FieldFunctions.H +++ b/src/OpenFOAM/fields/Fields/Field/FieldFunctions.H @@ -171,6 +171,16 @@ Type sum(const UList& f); TMP_UNARY_FUNCTION(Type, sum) +template +Type maxMagSqr(const UList& f); + +TMP_UNARY_FUNCTION(Type, maxMagSqr) + +template +Type minMagSqr(const UList& f); + +TMP_UNARY_FUNCTION(Type, minMagSqr) + template scalar sumProd(const UList& f1, const UList& f2); @@ -208,6 +218,8 @@ TMP_UNARY_FUNCTION(ReturnType, gFunc) G_UNARY_FUNCTION(Type, gMax, max, max) G_UNARY_FUNCTION(Type, gMin, min, min) G_UNARY_FUNCTION(Type, gSum, sum, sum) +G_UNARY_FUNCTION(Type, gMaxMagSqr, maxMagSqr, maxMagSqr) +G_UNARY_FUNCTION(Type, gMinMagSqr, minMagSqr, minMagSqr) G_UNARY_FUNCTION(scalar, gSumSqr, sumSqr, sum) G_UNARY_FUNCTION(scalar, gSumMag, sumMag, sum) G_UNARY_FUNCTION(Type, gSumCmptMag, sumCmptMag, sum) From 719885002c1d45799b58f2d81c0ce638dfc49688 Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 14 Oct 2013 14:51:20 +0100 Subject: [PATCH 03/13] ENH: globalMeshData: expose plusEq operator for Lists. --- .../polyMesh/globalMeshData/globalMeshData.C | 2 +- .../polyMesh/globalMeshData/globalMeshData.H | 46 +++++++++---------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C index a83b2bf190..2739e828b3 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C @@ -1963,7 +1963,7 @@ Foam::pointField Foam::globalMeshData::geometricSharedPoints() const pointField sharedPoints(mesh_.points(), sharedPointLabels()); // Append from all processors - combineReduce(sharedPoints, plusEqOp()); + combineReduce(sharedPoints, ListPlusEqOp()); // Merge tolerance scalar tolDim = matchTol_ * mesh_.bounds().mag(); diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.H b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.H index ab1858b148..35543fd093 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.H +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.H @@ -109,29 +109,6 @@ class globalMeshData public processorTopology { - // Private class - - // To combineReduce a pointField. Just appends all lists. - template - class plusEqOp - { - - public: - - void operator()(T& x, const T& y) const - { - label n = x.size(); - - x.setSize(x.size() + y.size()); - - forAll(y, i) - { - x[n++] = y[i]; - } - } - }; - - // Private data //- Reference to mesh @@ -337,6 +314,29 @@ class globalMeshData public: + // Public class + + // To combineReduce a List. Just appends all lists. + template + class ListPlusEqOp + { + + public: + + void operator()(T& x, const T& y) const + { + label n = x.size(); + + x.setSize(x.size() + y.size()); + + forAll(y, i) + { + x[n++] = y[i]; + } + } + }; + + //- Runtime type information ClassName("globalMeshData"); From 1f63b868244f0b8c4d43e6b6a9abf529c1982b40 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 17 Oct 2013 11:49:14 +0100 Subject: [PATCH 04/13] ENH: snappyHexMeshDict: added comment --- .../mesh/generation/snappyHexMesh/snappyHexMeshDict | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict index bf8eba6e0d..9db10ea85e 100644 --- a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict +++ b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict @@ -474,10 +474,12 @@ meshQualityControls // Advanced // Flags for optional output -// 0 : only write final meshes -// 1 : write intermediate meshes -// 2 : write volScalarField with cellLevel for postprocessing -// 4 : write current intersections as .obj files +// 0 : only write final meshes +// 1 : write intermediate meshes +// 2 : write volScalarField with cellLevel for postprocessing +// 4 : write current mesh intersections as .obj files +// 8 : write information about explicit feature edge refinement +// 16 : write information about layers debug 0; // Merge tolerance. Is fraction of overall bounding box of initial mesh. From cfcd1ab30b08e47c303f322ca5516d39e619d347 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 17 Oct 2013 12:42:58 +0100 Subject: [PATCH 05/13] GIT: orientFaceZone: remove embedded testcase --- .../manipulation/orientFaceZone/cavity/Allrun | 22 --- .../orientFaceZone/cavity/README.txt | 1 - .../cavity/constant/polyMesh/blockMeshDict | 75 ---------- .../cavity/constant/polyMesh/boundary | 41 ------ .../cavity/constant/transportProperties | 21 --- .../orientFaceZone/cavity/system/controlDict | 49 ------- .../cavity/system/decomposeParDict | 135 ------------------ .../orientFaceZone/cavity/system/fvSchemes | 60 -------- .../orientFaceZone/cavity/system/fvSolution | 46 ------ .../cavity/system/renumberMeshDict | 110 -------------- .../orientFaceZone/cavity/system/topoSetDict | 64 --------- 11 files changed, 624 deletions(-) delete mode 100755 applications/utilities/mesh/manipulation/orientFaceZone/cavity/Allrun delete mode 100644 applications/utilities/mesh/manipulation/orientFaceZone/cavity/README.txt delete mode 100644 applications/utilities/mesh/manipulation/orientFaceZone/cavity/constant/polyMesh/blockMeshDict delete mode 100644 applications/utilities/mesh/manipulation/orientFaceZone/cavity/constant/polyMesh/boundary delete mode 100644 applications/utilities/mesh/manipulation/orientFaceZone/cavity/constant/transportProperties delete mode 100644 applications/utilities/mesh/manipulation/orientFaceZone/cavity/system/controlDict delete mode 100644 applications/utilities/mesh/manipulation/orientFaceZone/cavity/system/decomposeParDict delete mode 100644 applications/utilities/mesh/manipulation/orientFaceZone/cavity/system/fvSchemes delete mode 100644 applications/utilities/mesh/manipulation/orientFaceZone/cavity/system/fvSolution delete mode 100644 applications/utilities/mesh/manipulation/orientFaceZone/cavity/system/renumberMeshDict delete mode 100644 applications/utilities/mesh/manipulation/orientFaceZone/cavity/system/topoSetDict diff --git a/applications/utilities/mesh/manipulation/orientFaceZone/cavity/Allrun b/applications/utilities/mesh/manipulation/orientFaceZone/cavity/Allrun deleted file mode 100755 index 11f1cb983e..0000000000 --- a/applications/utilities/mesh/manipulation/orientFaceZone/cavity/Allrun +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -cd ${0%/*} || exit 1 # run from this directory - -# Source tutorial run functions -. $WM_PROJECT_DIR/bin/tools/RunFunctions - -# Get application name -application=`getApplication` - -runApplication blockMesh -# Make random cell numbering to get faceZone orientation random -runApplication renumberMesh -dict system/renumberMeshDict - -# Construct faceZone -runApplication topoSet - -runApplication decomposePar -force -cellDist -runParallel orientFaceZone 2 f0 '(10 0 0)' -runApplication reconstructParMesh -latestTime -mergeTol 1e-6 - - -# ----------------------------------------------------------------- end-of-file diff --git a/applications/utilities/mesh/manipulation/orientFaceZone/cavity/README.txt b/applications/utilities/mesh/manipulation/orientFaceZone/cavity/README.txt deleted file mode 100644 index df42877302..0000000000 --- a/applications/utilities/mesh/manipulation/orientFaceZone/cavity/README.txt +++ /dev/null @@ -1 +0,0 @@ -2013-09-16 To test orientFaceZone. Make random orientation. Orient afterwards. diff --git a/applications/utilities/mesh/manipulation/orientFaceZone/cavity/constant/polyMesh/blockMeshDict b/applications/utilities/mesh/manipulation/orientFaceZone/cavity/constant/polyMesh/blockMeshDict deleted file mode 100644 index 165a600c7b..0000000000 --- a/applications/utilities/mesh/manipulation/orientFaceZone/cavity/constant/polyMesh/blockMeshDict +++ /dev/null @@ -1,75 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - object blockMeshDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -convertToMeters 0.1; - -vertices -( - (0 0 0) - (1 0 0) - (1 1 0) - (0 1 0) - (0 0 0.1) - (1 0 0.1) - (1 1 0.1) - (0 1 0.1) -); - -blocks -( - hex (0 1 2 3 4 5 6 7) (20 20 1) simpleGrading (1 1 1) -); - -edges -( -); - -boundary -( - movingWall - { - type wall; - faces - ( - (3 7 6 2) - ); - } - fixedWalls - { - type wall; - faces - ( - (0 4 7 3) - (2 6 5 1) - (1 5 4 0) - ); - } - frontAndBack - { - type empty; - faces - ( - (0 3 2 1) - (4 5 6 7) - ); - } -); - -mergePatchPairs -( -); - -// ************************************************************************* // diff --git a/applications/utilities/mesh/manipulation/orientFaceZone/cavity/constant/polyMesh/boundary b/applications/utilities/mesh/manipulation/orientFaceZone/cavity/constant/polyMesh/boundary deleted file mode 100644 index 3d25397906..0000000000 --- a/applications/utilities/mesh/manipulation/orientFaceZone/cavity/constant/polyMesh/boundary +++ /dev/null @@ -1,41 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 2.2.x | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class polyBoundaryMesh; - location "constant/polyMesh"; - object boundary; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -3 -( - movingWall - { - type wall; - nFaces 20; - startFace 760; - } - fixedWalls - { - type wall; - nFaces 60; - startFace 780; - } - frontAndBack - { - type empty; - inGroups 1(empty); - nFaces 800; - startFace 840; - } -) - -// ************************************************************************* // diff --git a/applications/utilities/mesh/manipulation/orientFaceZone/cavity/constant/transportProperties b/applications/utilities/mesh/manipulation/orientFaceZone/cavity/constant/transportProperties deleted file mode 100644 index fa1c1ca0b1..0000000000 --- a/applications/utilities/mesh/manipulation/orientFaceZone/cavity/constant/transportProperties +++ /dev/null @@ -1,21 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - location "constant"; - object transportProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -nu nu [ 0 2 -1 0 0 0 0 ] 0.01; - - -// ************************************************************************* // diff --git a/applications/utilities/mesh/manipulation/orientFaceZone/cavity/system/controlDict b/applications/utilities/mesh/manipulation/orientFaceZone/cavity/system/controlDict deleted file mode 100644 index f28aaab146..0000000000 --- a/applications/utilities/mesh/manipulation/orientFaceZone/cavity/system/controlDict +++ /dev/null @@ -1,49 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - location "system"; - object controlDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -application icoFoam; - -startFrom latestTime; - -startTime 0; - -stopAt endTime; - -endTime 0.5; - -deltaT 0.005; - -writeControl timeStep; - -writeInterval 20; - -purgeWrite 0; - -writeFormat ascii; - -writePrecision 6; - -writeCompression off; - -timeFormat general; - -timePrecision 6; - -runTimeModifiable true; - - -// ************************************************************************* // diff --git a/applications/utilities/mesh/manipulation/orientFaceZone/cavity/system/decomposeParDict b/applications/utilities/mesh/manipulation/orientFaceZone/cavity/system/decomposeParDict deleted file mode 100644 index 60454a0a87..0000000000 --- a/applications/utilities/mesh/manipulation/orientFaceZone/cavity/system/decomposeParDict +++ /dev/null @@ -1,135 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - note "mesh decomposition control dictionary"; - object decomposeParDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -numberOfSubdomains 2; - -//- Keep owner and neighbour on same processor for faces in zones: -// preserveFaceZones (heater solid1 solid3); - -//- Keep owner and neighbour on same processor for faces in patches: -// (makes sense only for cyclic patches) -//preservePatches (cyclic_half0 cyclic_half1); - -//- 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 ((f0 -1)); - - -//- 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 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); - delta 0.001; -} - -hierarchicalCoeffs -{ - n (2 1 1); - delta 0.001; - order xyz; -} - -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 (bottomPatch); -} - -//// 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/applications/utilities/mesh/manipulation/orientFaceZone/cavity/system/fvSchemes b/applications/utilities/mesh/manipulation/orientFaceZone/cavity/system/fvSchemes deleted file mode 100644 index c311eb8961..0000000000 --- a/applications/utilities/mesh/manipulation/orientFaceZone/cavity/system/fvSchemes +++ /dev/null @@ -1,60 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - location "system"; - object fvSchemes; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -ddtSchemes -{ - default Euler; -} - -gradSchemes -{ - default Gauss linear; - grad(p) Gauss linear; -} - -divSchemes -{ - default none; - div(phi,U) Gauss linear; -} - -laplacianSchemes -{ - default none; - laplacian(nu,U) Gauss linear orthogonal; - laplacian((1|A(U)),p) Gauss linear orthogonal; -} - -interpolationSchemes -{ - default linear; - interpolate(HbyA) linear; -} - -snGradSchemes -{ - default orthogonal; -} - -fluxRequired -{ - default no; - p ; -} - - -// ************************************************************************* // diff --git a/applications/utilities/mesh/manipulation/orientFaceZone/cavity/system/fvSolution b/applications/utilities/mesh/manipulation/orientFaceZone/cavity/system/fvSolution deleted file mode 100644 index cc4750f16c..0000000000 --- a/applications/utilities/mesh/manipulation/orientFaceZone/cavity/system/fvSolution +++ /dev/null @@ -1,46 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - location "system"; - object fvSolution; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -solvers -{ - p - { - solver PCG; - preconditioner DIC; - tolerance 1e-06; - relTol 0; - } - - U - { - solver PBiCG; - preconditioner DILU; - tolerance 1e-05; - relTol 0; - } -} - -PISO -{ - nCorrectors 2; - nNonOrthogonalCorrectors 0; - pRefCell 0; - pRefValue 0; -} - - -// ************************************************************************* // diff --git a/applications/utilities/mesh/manipulation/orientFaceZone/cavity/system/renumberMeshDict b/applications/utilities/mesh/manipulation/orientFaceZone/cavity/system/renumberMeshDict deleted file mode 100644 index addb04236e..0000000000 --- a/applications/utilities/mesh/manipulation/orientFaceZone/cavity/system/renumberMeshDict +++ /dev/null @@ -1,110 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - note "mesh renumbering dictionary"; - object renumberMeshDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -// Write maps from renumbered back to original mesh -writeMaps true; - -// Optional entry: sort cells on coupled boundaries to last for use with -// e.g. nonBlockingGaussSeidel. -sortCoupledFaceCells false; - -// Optional entry: renumber on a block-by-block basis. It uses a -// blockCoeffs dictionary to construct a decompositionMethod to do -// a block subdivision) and then applies the renumberMethod to each -// block in turn. This can be used in large cases to keep the blocks -// fitting in cache with all the the cache misses bunched at the end. -// This number is the approximate size of the blocks - this gets converted -// to a number of blocks that is the input to the decomposition method. -//blockSize 1000; - -// Optional entry: sort points into internal and boundary points -//orderPoints false; - - - -//method CuthillMcKee; -//method Sloan; -//method manual; -method random; -//method structured; -//method spring; -//method zoltan; // only if compiled with zoltan support - -//CuthillMcKeeCoeffs -//{ -// // Reverse CuthillMcKee (RCM) or plain -// reverse true; -//} - -manualCoeffs -{ - // In system directory: new-to-original (i.e. order) labelIOList - dataFile "cellMap"; -} - - -// For extruded (i.e. structured in one direction) meshes -structuredCoeffs -{ - // Patches that mesh was extruded from. These determine the starting - // layer of cells - patches (movingWall); - // Method to renumber the starting layer of cells - method random; - - // Renumber in columns (depthFirst) or in layers - depthFirst true; - - // Optional: reverse ordering - //reverse false; -} - - -springCoeffs -{ - // Maximum jump of cell indices. Is fraction of number of cells - maxCo 0.01; - - // Limit the amount of movement; the fraction maxCo gets decreased - // with every iteration - freezeFraction 0.999; - - // Maximum number of iterations - maxIter 1000; -} - - -blockCoeffs -{ - method scotch; - //method hierarchical; - //hierarchicalCoeffs - //{ - // n (1 2 1); - // delta 0.001; - // order xyz; - //} -} - - -zoltanCoeffs -{ - ORDER_METHOD LOCAL_HSFC; -} - - -// ************************************************************************* // diff --git a/applications/utilities/mesh/manipulation/orientFaceZone/cavity/system/topoSetDict b/applications/utilities/mesh/manipulation/orientFaceZone/cavity/system/topoSetDict deleted file mode 100644 index fca42b45f8..0000000000 --- a/applications/utilities/mesh/manipulation/orientFaceZone/cavity/system/topoSetDict +++ /dev/null @@ -1,64 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 2.2.1 | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - object topoSetDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -actions -( - // Get 'T' of faces - { - name f0; - type faceSet; - action new; - source boxToFace; - sourceInfo - { - boxes - ( - (0.0499 -100 -100)(0.0501 100 100) - (0.03 0.0499 -100)(0.05 0.0501 100) - ); - } - } - -// // Pick up some cells -// { -// name c0; -// type cellSet; -// action new; -// source boxToCell; -// sourceInfo -// { -// boxes -// ( -// (-100 -100 -100)(0.05 0.05 100) -// (0.05 0.05 -100)(100 100 100) -// ); -// } -// } - - // Convert faceSet to faceZone - { - name f0; - type faceZoneSet; - action new; - source setToFaceZone; - sourceInfo - { - faceSet f0; - } - } -); - -// ************************************************************************* // From 7a2269eccba8622760b957fd9e8fa1f572e11a63 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 17 Oct 2013 14:04:22 +0100 Subject: [PATCH 06/13] ENH: setsToFaceZone: allow flipping --- .../mesh/manipulation/topoSet/topoSetDict | 2 ++ .../setsToFaceZone/setsToFaceZone.C | 30 ++++++++++++------- .../setsToFaceZone/setsToFaceZone.H | 13 +++++--- 3 files changed, 31 insertions(+), 14 deletions(-) diff --git a/applications/utilities/mesh/manipulation/topoSet/topoSetDict b/applications/utilities/mesh/manipulation/topoSet/topoSetDict index 9dee4d1df9..5f0e5c0b39 100644 --- a/applications/utilities/mesh/manipulation/topoSet/topoSetDict +++ b/applications/utilities/mesh/manipulation/topoSet/topoSetDict @@ -368,6 +368,8 @@ FoamFile // { // faceSet f0; // name of faceSet // cellSet c0; // name of cellSet of slave side +// flip false; // optional: flip the faceZone (so now the cellSet +// // is the master side) // } // // // Select based on surface. Orientation from normals on surface diff --git a/src/meshTools/sets/faceZoneSources/setsToFaceZone/setsToFaceZone.C b/src/meshTools/sets/faceZoneSources/setsToFaceZone/setsToFaceZone.C index bb09ecb084..d4699870a4 100644 --- a/src/meshTools/sets/faceZoneSources/setsToFaceZone/setsToFaceZone.C +++ b/src/meshTools/sets/faceZoneSources/setsToFaceZone/setsToFaceZone.C @@ -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 @@ -56,12 +56,14 @@ Foam::setsToFaceZone::setsToFaceZone ( const polyMesh& mesh, const word& faceSetName, - const word& cellSetName + const word& cellSetName, + const Switch& flip ) : topoSetSource(mesh), faceSetName_(faceSetName), - cellSetName_(cellSetName) + cellSetName_(cellSetName), + flip_(flip) {} @@ -74,7 +76,8 @@ Foam::setsToFaceZone::setsToFaceZone : topoSetSource(mesh), faceSetName_(dict.lookup("faceSet")), - cellSetName_(dict.lookup("cellSet")) + cellSetName_(dict.lookup("cellSet")), + flip_(dict.lookupOrDefault("flip", false)) {} @@ -87,7 +90,8 @@ Foam::setsToFaceZone::setsToFaceZone : topoSetSource(mesh), faceSetName_(checkIs(is)), - cellSetName_(checkIs(is)) + cellSetName_(checkIs(is)), + flip_(false) {} @@ -136,7 +140,7 @@ void Foam::setsToFaceZone::applyToSet if (!fzSet.found(faceI)) { - bool flip = false; + bool flipFace = false; label own = mesh_.faceOwner()[faceI]; bool ownFound = cSet.found(own); @@ -148,11 +152,11 @@ void Foam::setsToFaceZone::applyToSet if (ownFound && !neiFound) { - flip = false; + flipFace = false; } else if (!ownFound && neiFound) { - flip = true; + flipFace = true; } else { @@ -174,11 +178,17 @@ void Foam::setsToFaceZone::applyToSet } else { - flip = !ownFound; + flipFace = !ownFound; + } + + + if (flip_) + { + flipFace = !flipFace; } newAddressing.append(faceI); - newFlipMap.append(flip); + newFlipMap.append(flipFace); } } diff --git a/src/meshTools/sets/faceZoneSources/setsToFaceZone/setsToFaceZone.H b/src/meshTools/sets/faceZoneSources/setsToFaceZone/setsToFaceZone.H index 686849cc50..72d2f6501e 100644 --- a/src/meshTools/sets/faceZoneSources/setsToFaceZone/setsToFaceZone.H +++ b/src/meshTools/sets/faceZoneSources/setsToFaceZone/setsToFaceZone.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 @@ -36,6 +36,7 @@ SourceFiles #define setsToFaceZone_H #include "topoSetSource.H" +#include "Switch.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -56,10 +57,13 @@ class setsToFaceZone static addToUsageTable usage_; //- Name of set to use - word faceSetName_; + const word faceSetName_; //- Name of set to use - word cellSetName_; + const word cellSetName_; + + //- Whether cellSet is slave cells or master cells + const Switch flip_; public: @@ -73,7 +77,8 @@ public: ( const polyMesh& mesh, const word& faceSetName, - const word& cellSetName + const word& cellSetName, + const Switch& flip ); //- Construct from dictionary From 6a572da350d34463af6581af9e13a5bc37cc9235 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 17 Oct 2013 14:05:44 +0100 Subject: [PATCH 07/13] STYLE: autoLayerDriver: suppress messages --- .../autoHexMesh/autoHexMeshDriver/autoLayerDriver.C | 6 +++--- .../autoHexMesh/autoHexMeshDriver/autoLayerDriverShrink.C | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C index 685e043fdb..a0a325410d 100644 --- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C +++ b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C @@ -1446,9 +1446,9 @@ void Foam::autoLayerDriver::syncPatchDisplacement } } - Info<< "Prevented extrusion on " - << returnReduce(nChangedTotal, sumOp