diff --git a/src/fieldSources/basicSource/basicSource.C b/src/fieldSources/basicSource/basicSource.C index 2d218de752afdf67cd63e169d01a2e714924edd3..9ebcdc5834f30cf42cab164395a404db33206693 100644 --- a/src/fieldSources/basicSource/basicSource.C +++ b/src/fieldSources/basicSource/basicSource.C @@ -56,6 +56,12 @@ namespace Foam // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // +bool Foam::basicSource::alwaysApply() const +{ + return false; +} + + void Foam::basicSource::setSelection(const dictionary& dict) { switch (selectionMode_) @@ -314,6 +320,7 @@ Foam::basicSource::~basicSource() } } + // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // bool Foam::basicSource::isActive() @@ -341,6 +348,11 @@ bool Foam::basicSource::isActive() Foam::label Foam::basicSource::applyToField(const word& fieldName) const { + if (alwaysApply()) + { + return 0; + } + forAll(fieldNames_, i) { if (fieldNames_[i] == fieldName) diff --git a/src/fieldSources/basicSource/basicSource.H b/src/fieldSources/basicSource/basicSource.H index ca105f90b1883bf444bc9588556e123d3d306101..69e9dcf408b9588b8ef24eea9007afca51bb7e42 100644 --- a/src/fieldSources/basicSource/basicSource.H +++ b/src/fieldSources/basicSource/basicSource.H @@ -150,6 +150,9 @@ protected: // Protected functions + //- Flag to bypass the apply flag list checking + virtual bool alwaysApply() const; + //- Set the cellSet or points selection void setSelection(const dictionary& dict);