ENH: use simpler boundBox handling

- use default initialize boundBox instead of invertedBox
- reset() instead of assigning from invertedBox
- extend (three parameter version) and grow method
- inflate(Random) instead of extend + re-assigning
This commit is contained in:
Mark Olesen
2022-11-01 12:15:08 +01:00
committed by Andrew Heather
parent 1339c3357b
commit e5006a62d7
60 changed files with 189 additions and 353 deletions

View File

@ -152,8 +152,8 @@ bool Foam::functionObjects::energySpectrum::read(const dictionary& dict)
// Assume all cells are the same size...
boundBox cellBb(mesh_.cellBb(0));
const vector L(meshBb.max() - meshBb.min());
const vector nCellXYZ(cmptDivide(L, cellBb.max() - cellBb.min()));
const vector L(meshBb.span());
const vector nCellXYZ(cmptDivide(L, cellBb.span()));
N_ = Vector<int>
(
@ -163,7 +163,7 @@ bool Foam::functionObjects::energySpectrum::read(const dictionary& dict)
);
// Check that the mesh is a structured box
vector cellDx(cellBb.max() - cellBb.min());
vector cellDx(cellBb.span());
vector expectedMax(N_.x()*cellDx.x(), N_.y()*cellDx.y(), N_.z()*cellDx.z());
vector relativeSize(cmptDivide(L, expectedMax));
for (direction i = 0; i < 3; ++i)
@ -183,8 +183,8 @@ bool Foam::functionObjects::energySpectrum::read(const dictionary& dict)
// Map into i-j-k co-ordinates
const vectorField& C = mesh_.C();
c0_ = returnReduce(min(C), minOp<vector>());
const vector cMax = returnReduce(max(C), maxOp<vector>());
deltaC_ = cMax - c0_;
deltaC_ = returnReduce(max(C), maxOp<vector>());
deltaC_ -= c0_;
forAll(C, celli)
{