From ba2617519864224f62fa41de5de3b890a4970d61 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Mon, 4 Feb 2019 14:48:03 +0100 Subject: [PATCH 01/16] BUG: foamCreateModuleInclude ignores -output option (fixes #1190) ENH: add -prefs option to pass in a preferences configuration file --- bin/tools/foamCreateModuleInclude | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/bin/tools/foamCreateModuleInclude b/bin/tools/foamCreateModuleInclude index 661b94dfa9..7074ad5c96 100755 --- a/bin/tools/foamCreateModuleInclude +++ b/bin/tools/foamCreateModuleInclude @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2017-2018 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 2017-2019 OpenCFD Ltd. # \\/ M anipulation | Copyright (C) 2016-2017 CINECA #------------------------------------------------------------------------------ # License @@ -27,8 +27,10 @@ # # Description # Script to create module settings. +# # This is still incomplete, but can be a useful basis when using a module # system. +# #------------------------------------------------------------------------------ usage() { exec 1>&2 @@ -38,7 +40,8 @@ usage() { usage: ${0##*/} [OPTION] projectDir options: -output=file The output name (default: ModuleInclude.tcl) - -preload=file Specify (module) file to preload. Can use multiple times + -prefs=file A preferences file (OpenFOAM) to load. + -preload=file Specify a shell file to preload. Can use multiple times -tmpdir=file The tmp directory to use. -help Print the usage @@ -63,7 +66,7 @@ die() #------------------------------------------------------------------------------ -unset optBackend optDebug preload projectDir +unset optBackend optDebug optPrefs preloads projectDir unset moduleOutput moduleTmpDir # Parse some options @@ -79,8 +82,11 @@ do -debug) optDebug=true ;; + -prefs=*) + optPrefs="${1#*=}" + ;; -preload=*) - preload="$preload${preload:+ }${1#*=}" + preloads="$preloads${preloads:+ }${1#*=}" ;; --recursive-backend--) optBackend=true @@ -130,7 +136,7 @@ then die "Incorrect projectDir? $projectDir" # Check preloads - for file in $preloads + for file in "$preloads" do [ -f "$file" ] || echo "No such file to preload: $file" 1>&2 done @@ -146,7 +152,8 @@ then $0 \ --recursive-backend-- \ "${optDebug:+-debug}" \ - "${output:+-output=$moduleOutput}" \ + "${optPrefs:+-prefs=$optPrefs}" \ + "${moduleOutput:+-output=$moduleOutput}" \ "${preloads:+-preload=$preloads}" \ "${moduleTmpDir:+-tmpdir=$moduleTmpDir}" \ $projectDir @@ -164,7 +171,7 @@ fi : ${moduleTmpDir:=${TMPDIR:-/tmp}} # Preload any/all modules -for file in $preloads +for file in "$preloads" do [ -f "$file" ] && . "$file" '' done @@ -213,7 +220,7 @@ printEnv > $tmpFiles.env.pre.log printAlias > $tmpFiles.alias.pre.log # OpenFOAM settings -. $projectDir/etc/bashrc '' +. $projectDir/etc/bashrc "$optPrefs" echo "Using openfoam: $WM_PROJECT_DIR" 1>&2 echo "==> $moduleOutput" 1>&2 @@ -227,7 +234,9 @@ unset SCOTCH_VERSION # Also remove user directories as being unreliable -foamOldDirs="$CEI_HOME $BOOST_ARCH_PATH $CGAL_ARCH_PATH $FFTW_ARCH_PATH $MPI_ARCH_PATH $SCOTCH_ARCH_PATH \ +foamOldDirs="$BOOST_ARCH_PATH $CGAL_ARCH_PATH $FFTW_ARCH_PATH \ +$MESA_ARCH_PATH $LLVM_ARCH_PATH \ +$MPI_ARCH_PATH $SCOTCH_ARCH_PATH \ $FOAM_SITE_APPBIN $FOAM_SITE_LIBBIN $WM_PROJECT_SITE \ $FOAM_USER_APPBIN $FOAM_USER_LIBBIN" foamClean=$WM_PROJECT_DIR/bin/foamCleanPath @@ -245,9 +254,6 @@ then unset FOAM_EXT_LIBBIN fi fi -unset CEI_HOME -unset ENSIGHT9_INPUT ENSIGHT9_READER -unset ENSIGHT10_INPUT ENSIGHT10_READER # Always consider site to be bogus. If needed, should be done elsewhere. unset FOAM_SITE_APPBIN FOAM_SITE_LIBBIN WM_PROJECT_SITE From 5615d1f256428678a86368801c22dc493fe67bac Mon Sep 17 00:00:00 2001 From: Andrew Heather <> Date: Mon, 11 Feb 2019 12:19:39 +0000 Subject: [PATCH 02/16] BUG: Corrected debug output for solarLoad. Fixes #1195 --- .../solarLoad/faceShading/faceShading.C | 22 +++++-------------- .../externalSolarLoad/Allclean | 1 - 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/src/thermophysicalModels/radiation/radiationModels/solarLoad/faceShading/faceShading.C b/src/thermophysicalModels/radiation/radiationModels/solarLoad/faceShading/faceShading.C index 4c0785eb11..da762b641d 100644 --- a/src/thermophysicalModels/radiation/radiationModels/solarLoad/faceShading/faceShading.C +++ b/src/thermophysicalModels/radiation/radiationModels/solarLoad/faceShading/faceShading.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation - \\/ M anipulation | Copyright (C) 2017-2018 OpenCFD Ltd. + \\/ M anipulation | Copyright (C) 2017-2019 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -26,11 +26,10 @@ License #include "faceShading.H" #include "fvMesh.H" #include "boundaryRadiationProperties.H" -#include "OFstream.H" #include "cyclicAMIPolyPatch.H" #include "volFields.H" #include "distributedTriSurfaceMesh.H" - +#include "OBJstream.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -49,25 +48,14 @@ void Foam::faceShading::writeRays const pointField& myFc ) { - OFstream str(fName); - label vertI = 0; + OBJstream os(fName); - Pout<< "Dumping rays to " << str.name() << endl; + Pout<< "Dumping rays to " << os.name() << endl; forAll(myFc, faceI) { - meshTools::writeOBJ(str, myFc[faceI]); - vertI++; - meshTools::writeOBJ(str, endCf[faceI]); - vertI++; - str << "l " << vertI-1 << ' ' << vertI << nl; + os.write(linePointRef(myFc[faceI], endCf[faceI])); } - str.flush(); - - Pout<< "cmd: objToVTK " << fName.c_str() << endl; - - stringList cmd({"objToVTK", fName, fName.lessExt().ext("vtk")}); - Foam::system(cmd); } diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allclean b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allclean index 9e53e2850b..d4a9953c51 100755 --- a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allclean +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allclean @@ -4,7 +4,6 @@ cd ${0%/*} || exit 1 # Run from this directory cleanCase0 -rm -rf VTK rm -rf constant/cellToRegion rm -rf constant/*/polyMesh # region meshes From d7a8a2056daa5e0954351ceb95bb32283a730218 Mon Sep 17 00:00:00 2001 From: Andrew Heather Date: Tue, 12 Feb 2019 09:09:32 +0000 Subject: [PATCH 03/16] STYLE: Updated bug report template --- .gitlab/issue_templates/bug.md | 55 +++++++++++++++++++++++----------- 1 file changed, 37 insertions(+), 18 deletions(-) diff --git a/.gitlab/issue_templates/bug.md b/.gitlab/issue_templates/bug.md index 3f93464adb..1423a4aa00 100644 --- a/.gitlab/issue_templates/bug.md +++ b/.gitlab/issue_templates/bug.md @@ -1,52 +1,71 @@ - + Before opening a new issue, make sure to search for keywords in the issues + filtered by the "bug" label and check to see if it has already been reported +--> + + ### Summary -(Summarize the bug encountered concisely) + ### Steps to reproduce -(How one can reproduce the issue - this is very important) + ### Example case -(If possible, please create a SMALL example case and attach it to your bug report) + ### What is the current *bug* behaviour? -(What actually happens) + ### What is the expected *correct* behavior? -(What you should see instead) + ### Relevant logs and/or images -(Paste any relevant logs - please use code blocks (```) to format console output, -logs, and code as it's very hard to read otherwise.) + ### Environment information -(OpenFOAM version : XXX) -(Operating system : XXX) -(Hardware info : XXX) - + +OpenFOAM version : +Operating system : +Compiler : ### Possible fixes -(If you can, link to the line of code that might be responsible for the problem) + /label ~bug From 77b2c8482dfca948aa8c5bdfa9ca47ffe1855efe Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 4 Mar 2019 10:56:41 +0000 Subject: [PATCH 04/16] BUG: faMesh: processors without faMesh. See #1090. pointNormals calculation gets triggered through processorfvPatches so on processors that don't have these bypass this. This leads to the global reduction hanging. --- .../faMesh/faBoundaryMesh/faBoundaryMesh.C | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/finiteArea/faMesh/faBoundaryMesh/faBoundaryMesh.C b/src/finiteArea/faMesh/faBoundaryMesh/faBoundaryMesh.C index bc904e8e27..53dda11eac 100644 --- a/src/finiteArea/faMesh/faBoundaryMesh/faBoundaryMesh.C +++ b/src/finiteArea/faMesh/faBoundaryMesh/faBoundaryMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2018 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2016-2017 Wikki Ltd @@ -173,6 +173,12 @@ Foam::faBoundaryMesh::faBoundaryMesh void Foam::faBoundaryMesh::calcGeometry() { + // processorFaPatch geometry triggers calculation of pointNormals. + // This uses parallel comms and hence will not be trigggered + // on processors that do not have a processorFaPatch so instead + // force construction. + (void)mesh_.pointAreaNormals(); + forAll(*this, patchi) { operator[](patchi).initGeometry(); @@ -377,6 +383,12 @@ bool Foam::faBoundaryMesh::checkDefinition(const bool report) const void Foam::faBoundaryMesh::movePoints(const pointField& p) { + // processorFaPatch geometry triggers calculation of pointNormals. + // This uses parallel comms and hence will not be trigggered + // on processors that do not have a processorFaPatch so instead + // force construction. + (void)mesh_.pointAreaNormals(); + faPatchList& patches = *this; forAll(patches, patchi) From c04963c41e2cfd023baa29114387b2eb6b029038 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 22 Mar 2019 09:08:35 +0100 Subject: [PATCH 05/16] CONFIG: missing semicolon in config file (fixes #1246) --- etc/caseDicts/postProcessing/pressure/pressureDifference.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/caseDicts/postProcessing/pressure/pressureDifference.cfg b/etc/caseDicts/postProcessing/pressure/pressureDifference.cfg index 9ac24c7073..4f652d2ab6 100644 --- a/etc/caseDicts/postProcessing/pressure/pressureDifference.cfg +++ b/etc/caseDicts/postProcessing/pressure/pressureDifference.cfg @@ -12,7 +12,7 @@ libs ("libfieldFunctionObjects.so"); operation subtract; writeControl timeStep; -writeInterval 1 +writeInterval 1; log false; region1 From 8a576b27aed4f8b7e8b9d3d3ef05a4eed1ccd671 Mon Sep 17 00:00:00 2001 From: Andrew Heather <> Date: Mon, 18 Feb 2019 11:20:18 +0000 Subject: [PATCH 06/16] COMP: Added randomProcesses-based function objects to build --- src/functionObjects/Allwmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/functionObjects/Allwmake b/src/functionObjects/Allwmake index be5bc41170..fa4da4d414 100755 --- a/src/functionObjects/Allwmake +++ b/src/functionObjects/Allwmake @@ -12,4 +12,6 @@ wmake $targetType solvers ./graphics/Allwmake $targetType +./randomProcesses/Allwmake $targetType + #------------------------------------------------------------------------------ From ca0bdb6ff2db48df692585ecb09763e3b0132fe8 Mon Sep 17 00:00:00 2001 From: Andrew Heather <> Date: Mon, 18 Feb 2019 11:20:40 +0000 Subject: [PATCH 07/16] COMP: Updated for 64 bit labels --- .../randomProcesses/energySpectrum/energySpectrum.C | 6 +++--- .../randomProcesses/energySpectrum/energySpectrum.H | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/functionObjects/randomProcesses/energySpectrum/energySpectrum.C b/src/functionObjects/randomProcesses/energySpectrum/energySpectrum.C index 7c19426a6e..23da6e0e64 100644 --- a/src/functionObjects/randomProcesses/energySpectrum/energySpectrum.C +++ b/src/functionObjects/randomProcesses/energySpectrum/energySpectrum.C @@ -62,7 +62,7 @@ void Foam::functionObjects::energySpectrum::calcAndWriteSpectrum const vectorField& C, const vector& c0, const vector& deltaC, - const Vector