ENH: Suppress warnings if no models active

This commit is contained in:
andy
2012-11-20 17:19:48 +00:00
parent ec5c3c448d
commit 4fa148f431
4 changed files with 9 additions and 7 deletions

View File

@ -39,7 +39,7 @@ Foam::MRFZoneList::MRFZoneList
{
reset(dict);
active();
active(true);
}
@ -51,7 +51,7 @@ Foam::MRFZoneList::~MRFZoneList()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::MRFZoneList::active() const
bool Foam::MRFZoneList::active(const bool warn) const
{
bool a = false;
forAll(*this, i)
@ -59,7 +59,7 @@ bool Foam::MRFZoneList::active() const
a = a || this->operator[](i).active();
}
if (!a)
if (warn && this->size() && !a)
{
Info<< " No MRF zones active" << endl;
}

View File

@ -88,7 +88,7 @@ public:
// Member Functions
//- Return active status
bool active() const;
bool active(const bool warn = false) const;
//- Reset the source list
void reset(const dictionary& dict);

View File

@ -38,6 +38,8 @@ Foam::porosityModelList::porosityModelList
mesh_(mesh)
{
reset(dict);
active(true);
}
@ -49,7 +51,7 @@ Foam::porosityModelList::~porosityModelList()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::porosityModelList::active() const
bool Foam::porosityModelList::active(const bool warn) const
{
bool a = false;
forAll(*this, i)
@ -57,7 +59,7 @@ bool Foam::porosityModelList::active() const
a = a || this->operator[](i).active();
}
if (!a)
if (warn && this->size() && !a)
{
Info<< "No porosity models active" << endl;
}

View File

@ -88,7 +88,7 @@ public:
// Member Functions
//- Return active status
bool active() const;
bool active(const bool active = false) const;
//- Reset the source list
void reset(const dictionary& dict);