ENH: use static to define default blockMesh verbosity

- make handling of verbosity more consistent.

  Make all setter return the old value, remove (unused) default
  parameter as being counter-intuitive.  This makes it easier to
  restore the original values.

  For example,

     const bool oldVerbose = sampler.verbose(false);
     ...
     sampler.verbose(oldVerbose);
This commit is contained in:
Mark Olesen
2020-10-25 21:45:21 +01:00
parent f959c8eb36
commit f999013f41
22 changed files with 115 additions and 67 deletions

View File

@ -169,7 +169,7 @@ bool Foam::functionObjects::Curle::read(const dictionary& dict)
);
// Use outputDir/TIME/surface-name
surfaceWriterPtr_->useTimeDir() = true;
surfaceWriterPtr_->useTimeDir(true);
}
}

View File

@ -969,7 +969,7 @@ bool Foam::functionObjects::fieldValues::surfaceFieldValue::read
if (debug)
{
surfaceWriterPtr_->verbose() = true;
surfaceWriterPtr_->verbose(true);
}
if (surfaceWriterPtr_->enabled())

View File

@ -109,9 +109,11 @@ Foam::areaWrite::areaWrite
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::areaWrite::verbose(const bool verbosity)
bool Foam::areaWrite::verbose(const bool on)
{
verbose_ = verbosity;
bool old(verbose_);
verbose_ = on;
return old;
}
@ -188,8 +190,8 @@ bool Foam::areaWrite::read(const dictionary& dict)
auto surfWriter = surfaceWriter::New(writerType, writerOptions);
// Use outputDir/TIME/surface-name
surfWriter->useTimeDir() = true;
surfWriter->verbose() = verbose_;
surfWriter->useTimeDir(true);
surfWriter->verbose(verbose_);
writers_.set(areaName, surfWriter);
}

View File

@ -205,8 +205,9 @@ public:
// Member Functions
//- Set verbosity level
void verbose(const bool verbosity = true);
//- Enable/disable verbose output
// \return old value
bool verbose(const bool on);
//- Read the areaWrite dictionary
virtual bool read(const dictionary& dict);