Merge remote-tracking branch 'origin/master' into develop

This commit is contained in:
Andrew Heather
2021-03-18 16:56:54 +00:00
3 changed files with 30 additions and 7 deletions

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2017-2020 OpenCFD Ltd. Copyright (C) 2017-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -220,6 +220,9 @@ bool Foam::functionObjects::Curle::execute()
sum((pp*sqr(invMagR) + invMagR/c0_*dpdtp)*(Sfp & r)); sum((pp*sqr(invMagR) + invMagR/c0_*dpdtp)*(Sfp & r));
} }
} }
pDash /= 4*mathematical::pi;
Pstream::listCombineGather(pDash, plusEqOp<scalar>()); Pstream::listCombineGather(pDash, plusEqOp<scalar>());
Pstream::listCombineScatter(pDash); Pstream::listCombineScatter(pDash);

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2015 OpenFOAM Foundation Copyright (C) 2015 OpenFOAM Foundation
Copyright (C) 2016-2017 OpenCFD Ltd. Copyright (C) 2016-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -396,22 +396,43 @@ Foam::AABBTree<Type>::AABBTree
// transfer flattened tree to persistent storage // transfer flattened tree to persistent storage
DynamicList<treeBoundBox> boundBoxes(2*bbs.size()); DynamicList<treeBoundBox> boundBoxes(2*bbs.size());
DynamicList<labelList> addressing(2*addr.size()); DynamicList<labelList> addressing(2*addr.size());
forAll(nodes, nodeI) forAll(nodes, nodeI)
{ {
if (nodes[nodeI].first() < 0) if (nodes[nodeI].first() < 0)
{ {
boundBoxes.append(bbs[nodeI].first()); boundBoxes.append(bbs[nodeI].first());
addressing.append(addr[nodeI + 1]); addressing.append(addr[-(nodes[nodeI].first() + 1)]);
} }
if (nodes[nodeI].second() < 0) if (nodes[nodeI].second() < 0)
{ {
boundBoxes.append(bbs[nodeI].second()); boundBoxes.append(bbs[nodeI].second());
addressing.append(addr[nodeI + 1]); addressing.append(addr[-(nodes[nodeI].second() + 1)]);
} }
} }
boundBoxes_.transfer(boundBoxes); boundBoxes_.transfer(boundBoxes);
addressing_.transfer(addressing); 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;
}
}
} }

View File

@ -142,8 +142,7 @@ public:
AABBTree(); AABBTree();
//- Construct from components //- Construct from components
// equalBinSize: divide into equal number of elements or // equalBinSize: divide into equal number of elements or equal span
// equal span
AABBTree AABBTree
( (
const UList<Type>& objects, const UList<Type>& objects,
@ -171,7 +170,7 @@ public:
bool pointInside(const point& pt) const; bool pointInside(const point& pt) const;
//- Determine whether a bounding box overlaps the tree bounding //- Determine whether a bounding box overlaps the tree bounding
// boxes //- boxes
bool overlaps(const boundBox& bbIn) const; bool overlaps(const boundBox& bbIn) const;