mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Suppress warnings if no models active
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user