From 968ce0290d1d77ef2c3d34bbaf2b72a28d36c01f Mon Sep 17 00:00:00 2001 From: Andrew Heather <> Date: Wed, 1 Jul 2020 14:59:11 +0100 Subject: [PATCH 01/13] DOC: Corrected header documentation - see #1756 --- .../pressureDirectedInletOutletVelocityFvPatchVectorField.H | 2 +- .../pressureInletOutletVelocityFvPatchVectorField.H | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.H index d0f6663fd3..a7f58e6681 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.H @@ -30,7 +30,7 @@ Group grpInletBoundaryConditions grpOutletBoundaryConditions Description - This velocity inlet/outlet boundary condition is applied to pressure + This velocity inlet/outlet boundary condition is applied to velocity boundaries where the pressure is specified. A zero-gradient condition is applied for outflow (as defined by the flux); for inflow, the velocity is obtained from the flux with the specified inlet direction. diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.H index 280d7be9bb..478c3f1d4a 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.H @@ -30,7 +30,7 @@ Group grpInletBoundaryConditions grpOutletBoundaryConditions Description - This velocity inlet/outlet boundary condition is applied to pressure + This velocity inlet/outlet boundary condition is applied to velocity boundaries where the pressure is specified. A zero-gradient condition is applied for outflow (as defined by the flux); for inflow, the velocity is obtained from the patch-face normal component of the internal-cell value. From 0b41521d98df45be2365a3655349173b0d3c3f5b Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Wed, 1 Jul 2020 15:07:57 +0200 Subject: [PATCH 02/13] CONFIG: avoid triggering dash expansion bug (fixes #1757) - use long form to avoid dash 0.5.8 error (ubuntu bionic) - consolidate the prefix handling into modules/Allwmake --- Allwmake | 12 ------------ modules/Allwmake | 15 ++++++++++++++- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/Allwmake b/Allwmake index 240e7e2621..6136570be0 100755 --- a/Allwmake +++ b/Allwmake @@ -80,18 +80,6 @@ then echo elif [ -d "$WM_PROJECT_DIR/modules" ] then - echo "========================================" - echo "Compile OpenFOAM modules" - echo " ignoring possible compilation errors" - echo " make certain to check the output file" - echo - set +e - export WM_CONTINUE_ON_ERROR=true - - # Default build into OpenFOAM project locations - : "${FOAM_MODULE_PREFIX:=${FOAM_LIBBIN%/*}}" - export FOAM_MODULE_PREFIX - (cd "$WM_PROJECT_DIR/modules" 2>/dev/null && wmake -all) fi diff --git a/modules/Allwmake b/modules/Allwmake index 1a6ca94867..b6bf9301a5 100755 --- a/modules/Allwmake +++ b/modules/Allwmake @@ -7,9 +7,22 @@ targetType=libso # Default build into OpenFOAM project locations unless specified with # -prefix or FOAM_MODULE_PREFIX env varable -: "${FOAM_MODULE_PREFIX:=${FOAM_LIBBIN%/*}}" +# Long form to avoid dash 0.5.8 error (issue #1757) +[ -n "$FOAM_MODULE_PREFIX" ] || FOAM_MODULE_PREFIX="${FOAM_LIBBIN%/*}" export FOAM_MODULE_PREFIX +echo "========================================" +echo "Compile OpenFOAM modules" +echo "prefix = $FOAM_MODULE_PREFIX" +echo +echo " ignoring possible compilation errors" +echo " make certain to check the output file" +echo +set +e +export WM_CONTINUE_ON_ERROR=true + +#------------------------------------------------------------------------------ + for moduleName in $(./list-modules) do if [ -d "$moduleName" ] From 6d965d699b2314034da0403adb913e6a5d446f7f Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Wed, 1 Jul 2020 18:40:04 +0200 Subject: [PATCH 03/13] BUG: mergeOrSplitBaffles -dict option ignored (fixes #1759) - regression from f721b5344f51 --- .../mesh/manipulation/mergeOrSplitBaffles/mergeOrSplitBaffles.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/utilities/mesh/manipulation/mergeOrSplitBaffles/mergeOrSplitBaffles.C b/applications/utilities/mesh/manipulation/mergeOrSplitBaffles/mergeOrSplitBaffles.C index 489c5b40f0..1440943840 100644 --- a/applications/utilities/mesh/manipulation/mergeOrSplitBaffles/mergeOrSplitBaffles.C +++ b/applications/utilities/mesh/manipulation/mergeOrSplitBaffles/mergeOrSplitBaffles.C @@ -286,7 +286,7 @@ int main(int argc, char *argv[]) #include "addOverwriteOption.H" #include "addRegionOption.H" - argList::addBoolOption + argList::addOption ( "dict", "file", From 9b78472e06b199354953055227de4f47da61f22b Mon Sep 17 00:00:00 2001 From: Andrew Heather <> Date: Thu, 2 Jul 2020 09:16:59 +0100 Subject: [PATCH 04/13] DOC: Updated header doc - see #1756 --- .../freeSurfacePressure/freeSurfacePressureFvPatchScalarField.H | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dynamicFaMesh/interfaceTrackingFvMesh/fvPatchFields/freeSurfacePressure/freeSurfacePressureFvPatchScalarField.H b/src/dynamicFaMesh/interfaceTrackingFvMesh/fvPatchFields/freeSurfacePressure/freeSurfacePressureFvPatchScalarField.H index 667a200308..818ce6ba41 100644 --- a/src/dynamicFaMesh/interfaceTrackingFvMesh/fvPatchFields/freeSurfacePressure/freeSurfacePressureFvPatchScalarField.H +++ b/src/dynamicFaMesh/interfaceTrackingFvMesh/fvPatchFields/freeSurfacePressure/freeSurfacePressureFvPatchScalarField.H @@ -34,7 +34,7 @@ Description calculated as: \f[ - p = pa - \vec{g} & \vec{r} + p = pa - \vec{g} \cdot \vec{r} \f] where From a86860430a6af27a315f50f39b2c26dbd1044350 Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 13 Jul 2020 13:00:13 +0100 Subject: [PATCH 05/13] BUG: checkMesh: index into surfaceScalarField. Fixes #1771. --- .../mesh/manipulation/checkMesh/writeFields.C | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/applications/utilities/mesh/manipulation/checkMesh/writeFields.C b/applications/utilities/mesh/manipulation/checkMesh/writeFields.C index f58db28de7..dfc825a817 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/writeFields.C +++ b/applications/utilities/mesh/manipulation/checkMesh/writeFields.C @@ -616,6 +616,17 @@ void Foam::writeFields } if (selectedFields.found("faceZone")) { + // Determine for each face the zone index (scalar for ease of + // manipulation) + scalarField zoneID(mesh.nFaces(), -1); + const faceZoneMesh& czs = mesh.faceZones(); + for (const auto& zone : czs) + { + UIndirectList(zoneID, zone) = zone.index(); + } + + + // Split into internal and boundary values surfaceScalarField faceZone ( IOobject @@ -632,10 +643,13 @@ void Foam::writeFields calculatedFvsPatchScalarField::typeName ); - const faceZoneMesh& czs = mesh.faceZones(); - for (const auto& zone : czs) + faceZone.primitiveFieldRef() = + SubField(zoneID, mesh.nInternalFaces()); + surfaceScalarField::Boundary& bfld = faceZone.boundaryFieldRef(); + for (auto& pfld : bfld) { - UIndirectList(faceZone, zone) = zone.index(); + const fvPatch& fvp = pfld.patch(); + pfld == SubField(zoneID, fvp.size(), fvp.start()); } //faceZone.correctBoundaryConditions(); From 5dc04530d9bdabf0068130310d9083699d47591e Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 14 Jul 2020 12:16:48 +0200 Subject: [PATCH 06/13] COMP: additional linkage libraries for AMD compiler (#1627) --- .../mesh/generation/foamyMesh/foamyHexMesh/Make/options | 2 ++ .../postProcessing/lumped/lumpedPointForces/Make/options | 1 + .../postProcessing/lumped/lumpedPointMovement/Make/options | 1 + 3 files changed, 4 insertions(+) diff --git a/applications/utilities/mesh/generation/foamyMesh/foamyHexMesh/Make/options b/applications/utilities/mesh/generation/foamyMesh/foamyHexMesh/Make/options index cfef4dc46e..0155c4b209 100644 --- a/applications/utilities/mesh/generation/foamyMesh/foamyHexMesh/Make/options +++ b/applications/utilities/mesh/generation/foamyMesh/foamyHexMesh/Make/options @@ -26,6 +26,8 @@ EXE_INC = \ EXE_LIBS = \ ${CGAL_LIBS} \ -lconformalVoronoiMesh \ + -lfileFormats \ + -lsurfMesh \ -lmeshTools \ -ldecompositionMethods \ -ldecompose \ diff --git a/applications/utilities/postProcessing/lumped/lumpedPointForces/Make/options b/applications/utilities/postProcessing/lumped/lumpedPointForces/Make/options index 5821a660d0..2a3b4bbf38 100644 --- a/applications/utilities/postProcessing/lumped/lumpedPointForces/Make/options +++ b/applications/utilities/postProcessing/lumped/lumpedPointForces/Make/options @@ -6,5 +6,6 @@ EXE_INC = \ EXE_LIBS = \ -lfiniteVolume \ + -lfileFormats \ -lmeshTools \ -llumpedPointMotion diff --git a/applications/utilities/postProcessing/lumped/lumpedPointMovement/Make/options b/applications/utilities/postProcessing/lumped/lumpedPointMovement/Make/options index 5821a660d0..2a3b4bbf38 100644 --- a/applications/utilities/postProcessing/lumped/lumpedPointMovement/Make/options +++ b/applications/utilities/postProcessing/lumped/lumpedPointMovement/Make/options @@ -6,5 +6,6 @@ EXE_INC = \ EXE_LIBS = \ -lfiniteVolume \ + -lfileFormats \ -lmeshTools \ -llumpedPointMotion From fa86a98482355f28520374069479d63303016c30 Mon Sep 17 00:00:00 2001 From: Andrew Heather Date: Fri, 17 Jul 2020 14:09:34 +0100 Subject: [PATCH 07/13] BUG: Minor correction to lumpedPointState.C for debug build --- src/lumpedPointMotion/state/lumpedPointState.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lumpedPointMotion/state/lumpedPointState.C b/src/lumpedPointMotion/state/lumpedPointState.C index 83a847664b..5dc1c5e434 100644 --- a/src/lumpedPointMotion/state/lumpedPointState.C +++ b/src/lumpedPointMotion/state/lumpedPointState.C @@ -152,7 +152,7 @@ Foam::lumpedPointState::lumpedPointState FatalErrorInFunction << "Have " << points_.size() << " points but " << angles_.size() << " angles" << nl - exit(FatalError); + << exit(FatalError); #else WarningInFunction << "Have " << points_.size() << " points but " From dc6c3c8add22ca2c3484cb5a52e3339916cf7fb4 Mon Sep 17 00:00:00 2001 From: Andrew Heather <> Date: Mon, 20 Jul 2020 10:19:34 +0100 Subject: [PATCH 08/13] TUT: Correction for Alltest --- .../chtMultiRegionSimpleFoam/jouleHeatingSolid/Allrun | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/jouleHeatingSolid/Allrun b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/jouleHeatingSolid/Allrun index e49ca8f0b1..9bc9ab4936 100755 --- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/jouleHeatingSolid/Allrun +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/jouleHeatingSolid/Allrun @@ -7,6 +7,9 @@ cd "${0%/*}" || exit # Run from this directory runApplication $(getApplication) -./createGraphs +if notTest "$@" +then + ./createGraphs +fi #------------------------------------------------------------------------------ From e8b06ac2226efbef2e2302b588a277d8eed76ce2 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Thu, 23 Jul 2020 16:52:15 +0200 Subject: [PATCH 09/13] STYLE: remove incorrect branch condition in setExprFields --- .../utilities/preProcessing/setExprFields/setExprFields.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/utilities/preProcessing/setExprFields/setExprFields.C b/applications/utilities/preProcessing/setExprFields/setExprFields.C index 2b995e0c31..3f5f5b68ab 100644 --- a/applications/utilities/preProcessing/setExprFields/setExprFields.C +++ b/applications/utilities/preProcessing/setExprFields/setExprFields.C @@ -898,7 +898,7 @@ int main(int argc, char *argv[]) ); } } - else if (exprDictPtr.valid()) + else { FatalErrorInFunction << "No command-line or dictionary??" << nl << endl From c411c0cc0982eb3ca42a9434188fbe7ce856901f Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Thu, 23 Jul 2020 18:12:06 +0200 Subject: [PATCH 10/13] SUBMODULE: adios (style), external-solver (bugfix), visualization (style) --- modules/adios | 2 +- modules/external-solver | 2 +- modules/visualization | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/adios b/modules/adios index da20135092..f635fe3375 160000 --- a/modules/adios +++ b/modules/adios @@ -1 +1 @@ -Subproject commit da201350928db0bdd7b6e3777b36f927f617de53 +Subproject commit f635fe3375bc035409a3375d4876f943e99746b3 diff --git a/modules/external-solver b/modules/external-solver index 8ebbdb6319..302f251828 160000 --- a/modules/external-solver +++ b/modules/external-solver @@ -1 +1 @@ -Subproject commit 8ebbdb63196b9556e90a0c25f30878fb743bc9c9 +Subproject commit 302f2518284be5a3c796091357a67fb1ae0250cd diff --git a/modules/visualization b/modules/visualization index 07cd1156fa..e426bad603 160000 --- a/modules/visualization +++ b/modules/visualization @@ -1 +1 @@ -Subproject commit 07cd1156faf9510fb07dc622674c5928d26a68a8 +Subproject commit e426bad603eecd5bc6babf36e55f6d05bb3c7998 From 540589fc2259b8e5355564c9ab530d1ad8c28601 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Mon, 27 Jul 2020 09:58:24 +0200 Subject: [PATCH 11/13] SUBMODULE: visualization installation prefix on older ubuntu (#1757) --- modules/visualization | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/visualization b/modules/visualization index e426bad603..766c82b8d9 160000 --- a/modules/visualization +++ b/modules/visualization @@ -1 +1 @@ -Subproject commit e426bad603eecd5bc6babf36e55f6d05bb3c7998 +Subproject commit 766c82b8d98576aa315416d422645ef0ffc90272 From 3455d556c431582474872e00ab85c0812f54ec51 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Mon, 27 Jul 2020 10:00:58 +0200 Subject: [PATCH 12/13] BUG: potential memory leaks in HashPtrTable::set (#1787) - backported fix from develop COMP: incorrect variable names in PtrListOpsTemplates.C --- .../HashTables/HashPtrTable/HashPtrTableI.H | 16 ++++++++++++++-- .../PtrLists/PtrListOps/PtrListOpsTemplates.C | 6 +++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTableI.H b/src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTableI.H index 5c76321ab6..733c11cd06 100644 --- a/src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTableI.H +++ b/src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTableI.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2018 OpenCFD Ltd. + Copyright (C) 2018-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -86,7 +86,19 @@ inline bool Foam::HashPtrTable::set T* ptr ) { - return this->parent_type::set(key, ptr); + // Newer: const T* old = this->get(key); + + iterator iter(this->find(key)); + const T* old = (iter.good() ? iter.val() : nullptr); + + const bool ok = this->parent_type::set(key, ptr); + + if (ok && old != ptr) + { + delete const_cast(old); + } + + return ok; } diff --git a/src/OpenFOAM/containers/PtrLists/PtrListOps/PtrListOpsTemplates.C b/src/OpenFOAM/containers/PtrLists/PtrListOps/PtrListOpsTemplates.C index 7d5471ebb2..0feeb4bba8 100644 --- a/src/OpenFOAM/containers/PtrLists/PtrListOps/PtrListOpsTemplates.C +++ b/src/OpenFOAM/containers/PtrLists/PtrListOps/PtrListOpsTemplates.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -79,7 +79,7 @@ void Foam::sortedOrder template void Foam::sort(UPtrList& list) { - labelList order(input.size()); + labelList order(list.size()); sortedOrder(list, order); list.sortOrder(order, false); // false = allow nullptr } @@ -88,7 +88,7 @@ void Foam::sort(UPtrList& list) template void Foam::sort(UPtrList& list, const Compare& comp) { - labelList order(input.size()); + labelList order(list.size()); sortedOrder(list, order, comp); list.sortOrder(order, false); // false = allow nullptr } From 6461eec886359ded3dd1c30346c513606b93e205 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Mon, 27 Jul 2020 10:23:53 +0200 Subject: [PATCH 13/13] CONFIG: increment patch level --- META-INFO/api-info | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/META-INFO/api-info b/META-INFO/api-info index a4e87634fc..638af73f3f 100644 --- a/META-INFO/api-info +++ b/META-INFO/api-info @@ -1,2 +1,2 @@ api=2006 -patch=0 +patch=200727