fvOptions: Added method for querying application to a field
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -136,6 +136,24 @@ void Foam::fv::optionList::reset(const dictionary& dict)
|
||||
}
|
||||
|
||||
|
||||
bool Foam::fv::optionList::appliesToField(const word& fieldName) const
|
||||
{
|
||||
forAll(*this, i)
|
||||
{
|
||||
const option& source = this->operator[](i);
|
||||
|
||||
label fieldi = source.applyToField(fieldName);
|
||||
|
||||
if (fieldi != -1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::fv::optionList::read(const dictionary& dict)
|
||||
{
|
||||
return readOptions(optionsDict(dict));
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -129,6 +129,9 @@ public:
|
||||
//- Reset the source list
|
||||
void reset(const dictionary& dict);
|
||||
|
||||
//- Return whether there is something to apply to the field
|
||||
bool appliesToField(const word& fieldName) const;
|
||||
|
||||
|
||||
// Sources
|
||||
|
||||
|
||||
Reference in New Issue
Block a user