ENH: use invertedBox instead of greatBox for signalling no clipping

- more stable/predictable to check for a bounding box !empty() rather
  than comparing to greatBox directly.
This commit is contained in:
Mark Olesen
2017-02-01 14:31:09 +00:00
parent 0ffae6461a
commit e76d5ce567
13 changed files with 34 additions and 34 deletions

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -76,7 +76,7 @@ Usage
trackLength | Tracking segment length | no |
nSubCycle | Number of tracking steps per cell | no|
cloudName | Cloud name to use | yes |
bounds | Bounding box to trim tracks | no | greatBox
bounds | Bounding box to trim tracks | no | invertedBox
seedSampleSet| Seeding method (see below)| yes |
\endtable
@ -136,10 +136,10 @@ class streamLine
// Private Member Functions
//- Disallow default bitwise copy construct
streamLine(const streamLine&);
streamLine(const streamLine&) = delete;
//- Disallow default bitwise assignment
void operator=(const streamLine&);
void operator=(const streamLine&) = delete;
public:

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -545,8 +545,8 @@ bool Foam::functionObjects::streamLineBase::read(const dictionary& dict)
}
bounds_ = boundBox::greatBox;
if (dict.readIfPresent("bounds", bounds_))
bounds_ = boundBox::invertedBox;
if (dict.readIfPresent("bounds", bounds_) && !bounds_.empty())
{
Info<< " clipping all segments to " << bounds_ << nl << endl;
}
@ -701,7 +701,7 @@ bool Foam::functionObjects::streamLineBase::write()
if (Pstream::master())
{
if (bounds_ != boundBox::greatBox)
if (!bounds_.empty())
{
// Clip to bounding box
trimToBox(treeBoundBox(bounds_));