From a8c9b5936e6ea3313e6c0c253405328afda34537 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Thu, 25 Feb 2021 08:29:15 +0100 Subject: [PATCH 1/3] BUG: cannot set expression from command-line (fixes #2012) --- .../utilities/preProcessing/setExprFields/setExprFields.C | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/applications/utilities/preProcessing/setExprFields/setExprFields.C b/applications/utilities/preProcessing/setExprFields/setExprFields.C index 57e05ad4cb..222120bf5b 100644 --- a/applications/utilities/preProcessing/setExprFields/setExprFields.C +++ b/applications/utilities/preProcessing/setExprFields/setExprFields.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -771,7 +771,7 @@ int main(int argc, char *argv[]) expressions::exprString expression ( - args[expression], + args["expression"], dictionary::null ); From 8d3efa1cb94d48ec9cb74b2db155738d10e43b7c Mon Sep 17 00:00:00 2001 From: Andrew Heather <> Date: Tue, 16 Mar 2021 12:27:38 +0000 Subject: [PATCH 2/3] BUG: AABBTree - corrected addressing. Fixes #2028 --- src/meshTools/AABBTree/AABBTree.C | 27 ++++++++++++++++++++++++--- src/meshTools/AABBTree/AABBTree.H | 5 ++--- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/src/meshTools/AABBTree/AABBTree.C b/src/meshTools/AABBTree/AABBTree.C index 9f28ec5569..07004f79c3 100644 --- a/src/meshTools/AABBTree/AABBTree.C +++ b/src/meshTools/AABBTree/AABBTree.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2015 OpenFOAM Foundation - Copyright (C) 2016-2017 OpenCFD Ltd. + Copyright (C) 2016-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -396,22 +396,43 @@ Foam::AABBTree::AABBTree // transfer flattened tree to persistent storage DynamicList boundBoxes(2*bbs.size()); DynamicList addressing(2*addr.size()); + forAll(nodes, nodeI) { if (nodes[nodeI].first() < 0) { boundBoxes.append(bbs[nodeI].first()); - addressing.append(addr[nodeI + 1]); + addressing.append(addr[-(nodes[nodeI].first() + 1)]); } if (nodes[nodeI].second() < 0) { boundBoxes.append(bbs[nodeI].second()); - addressing.append(addr[nodeI + 1]); + addressing.append(addr[-(nodes[nodeI].second() + 1)]); } } boundBoxes_.transfer(boundBoxes); addressing_.transfer(addressing); + + + if (0) + { + bitSet checked(objects.size()); + for (const auto& box : addressing_) + { + for (const auto& id : box) + { + checked.set(id); + } + } + + const label unsetSize = checked.count(false); + + if (unsetSize) + { + Info<< "*** Problem: IDs not set: " << unsetSize << endl; + } + } } diff --git a/src/meshTools/AABBTree/AABBTree.H b/src/meshTools/AABBTree/AABBTree.H index ffbf72d820..1cfa78b819 100644 --- a/src/meshTools/AABBTree/AABBTree.H +++ b/src/meshTools/AABBTree/AABBTree.H @@ -142,8 +142,7 @@ public: AABBTree(); //- Construct from components - // equalBinSize: divide into equal number of elements or - // equal span + // equalBinSize: divide into equal number of elements or equal span AABBTree ( const UList& objects, @@ -171,7 +170,7 @@ public: bool pointInside(const point& pt) const; //- Determine whether a bounding box overlaps the tree bounding - // boxes + //- boxes bool overlaps(const boundBox& bbIn) const; From dbed3a0602d258c4d62d822e8297381304a5c67c Mon Sep 17 00:00:00 2001 From: Andrew Heather <> Date: Thu, 18 Mar 2021 16:41:40 +0000 Subject: [PATCH 3/3] BUG: Curle FO - corrected division by 4pi. Fixes #2035 --- src/functionObjects/field/Curle/Curle.C | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/functionObjects/field/Curle/Curle.C b/src/functionObjects/field/Curle/Curle.C index ad5c382efb..39f38def4e 100644 --- a/src/functionObjects/field/Curle/Curle.C +++ b/src/functionObjects/field/Curle/Curle.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2017-2020 OpenCFD Ltd. + Copyright (C) 2017-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -220,6 +220,9 @@ bool Foam::functionObjects::Curle::execute() sum((pp*sqr(invMagR) + invMagR/c0_*dpdtp)*(Sfp & r)); } } + + pDash /= 4*mathematical::pi; + Pstream::listCombineGather(pDash, plusEqOp()); Pstream::listCombineScatter(pDash);