mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: add IOobjectList::findObject() method
- naming similar to objectRegistry, with unambiguous resolution.
The lookup() methods have different return types depending on the
calling parameter.
STYLE: use IOobjectListTemplates.C for implementations
- previously included as local definition within IOobjectList.C,
but will be adding more templated methods soon.
- adjust parameters (eg, matchName instead of matcher) to show their
function
ENH: handle objectRegistry::names<void>(...)
- this is equivalent to no Type restriction, and can be used when
filtering names. Eg,
obr.names<void>(wordRe..);
This commit is contained in:
@ -32,7 +32,7 @@ bool Foam::fieldOk(const IOobjectList& cloudObjs, const word& name)
|
||||
{
|
||||
IOobjectList objects(cloudObjs.lookupClass(IOField<Type>::typeName));
|
||||
|
||||
return (objects.lookup(name) != nullptr);
|
||||
return (objects.findObject(name) != nullptr);
|
||||
}
|
||||
|
||||
|
||||
@ -45,7 +45,7 @@ Foam::tmp<Foam::Field<Type>> Foam::readParticleField
|
||||
{
|
||||
IOobjectList objects(cloudObjs.lookupClass(IOField<Type>::typeName));
|
||||
|
||||
const IOobject* obj = objects.lookup(name);
|
||||
const IOobject* obj = objects.findObject(name);
|
||||
if (obj != nullptr)
|
||||
{
|
||||
IOField<Type> newField(*obj);
|
||||
@ -72,7 +72,7 @@ void Foam::readFields
|
||||
|
||||
forAll(fieldNames, j)
|
||||
{
|
||||
const IOobject* obj = objects.lookup(fieldNames[j]);
|
||||
const IOobject* obj = objects.findObject(fieldNames[j]);
|
||||
if (obj != nullptr)
|
||||
{
|
||||
Info<< " reading field " << fieldNames[j] << endl;
|
||||
@ -158,7 +158,7 @@ void Foam::processFields
|
||||
DynamicList<word> fieldNames(objects.size());
|
||||
forAll(userFieldNames, i)
|
||||
{
|
||||
IOobject* obj = objects.lookup(userFieldNames[i]);
|
||||
IOobject* obj = objects.findObject(userFieldNames[i]);
|
||||
if (obj != nullptr)
|
||||
{
|
||||
fieldNames.append(obj->name());
|
||||
|
||||
Reference in New Issue
Block a user