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

@ -64,7 +64,7 @@ void Foam::functionObjects::fieldExtents::calcFieldExtents
auto extents = [this](const scalarField& mask, const vectorField& C)
{
boundBox extents(boundBox::invertedBox);
boundBox extents;
forAll(mask, i)
{
if (mask[i] > 0.5)
@ -77,7 +77,7 @@ void Foam::functionObjects::fieldExtents::calcFieldExtents
if (extents.empty())
{
extents.add(point::zero);
extents.reset(point::zero);
}
return extents;
@ -97,7 +97,7 @@ void Foam::functionObjects::fieldExtents::calcFieldExtents
Log << " internal field: " << bb << nl;
file() << bb;
this->setResult(fieldName + "_internal_min" , bb.min());
this->setResult(fieldName + "_internal_min", bb.min());
this->setResult(fieldName + "_internal_max", bb.max());
}

View File

@ -927,7 +927,7 @@ bool Foam::functionObjects::streamLineBase::read(const dictionary& dict)
}
bounds_ = boundBox::invertedBox;
bounds_.reset();
if (dict.readIfPresent("bounds", bounds_) && !bounds_.empty())
{
Info<< " clipping all segments to " << bounds_ << nl << endl;