mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: prefer isHeaderClass<Type>() check instead of Type::typeName
- use typeHeaderOk<regIOobject>(false) for some generic file existence checks. Often had something like labelIOField as a placeholder, but that may be construed to have a particular something.
This commit is contained in:
@ -191,8 +191,7 @@ Foam::label Foam::functionObjects::fvExpressionField::loadFields
|
||||
|
||||
const bool ok =
|
||||
(
|
||||
io.typeHeaderOk<regIOobject>(false) // Preload header info
|
||||
&& io.hasHeaderClass() // Extra safety
|
||||
io.typeHeaderOk<regIOobject>(false)
|
||||
&&
|
||||
(
|
||||
loadField<scalar>(io)
|
||||
|
||||
@ -117,8 +117,7 @@ bool Foam::functionObjects::readFields::execute()
|
||||
|
||||
const bool ok =
|
||||
(
|
||||
io.typeHeaderOk<regIOobject>(false) // Preload header info
|
||||
&& io.hasHeaderClass() // Extra safety
|
||||
io.typeHeaderOk<regIOobject>(false)
|
||||
&&
|
||||
(
|
||||
loadField<scalar>(io)
|
||||
|
||||
@ -36,11 +36,11 @@ License
|
||||
template<class FieldType>
|
||||
bool Foam::functionObjects::readFields::loadAndStore(const IOobject& io)
|
||||
{
|
||||
if (FieldType::typeName == io.headerClassName())
|
||||
if (io.isHeaderClass<FieldType>())
|
||||
{
|
||||
// Store field on mesh database
|
||||
Log << " Reading " << io.name()
|
||||
<< " (" << FieldType::typeName << ')' << endl;
|
||||
<< " (" << io.headerClassName() << ')' << endl;
|
||||
|
||||
mesh_.objectRegistry::store(new FieldType(io, mesh_));
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user