ENH: use typed lookup versions instead of xyz::typeName literals

This commit is contained in:
Mark Olesen
2022-05-16 17:33:01 +02:00
parent 95e2a2e887
commit b712e7289e
12 changed files with 76 additions and 116 deletions

View File

@ -131,7 +131,7 @@ void doCorrectBoundaryConditions
template<class FieldType>
bool Foam::functionObjects::fvExpressionField::loadAndStore(const IOobject& io)
{
if (FieldType::typeName == io.headerClassName())
if (io.isHeaderClass<FieldType>())
{
// Store field on mesh database
Log << " Reading " << io.name()

View File

@ -167,10 +167,10 @@ void Foam::functionObjects::streamLineBase::initInterpolations
{
FatalErrorInFunction
<< "Cannot find field " << fieldName << nl
<< "Valid scalar fields are:"
<< flatOutput(mesh_.names(volScalarField::typeName)) << nl
<< "Valid vector fields are:"
<< flatOutput(mesh_.names(volVectorField::typeName))
<< "Valid scalar fields: "
<< flatOutput(mesh_.sortedNames<volScalarField>()) << nl
<< "Valid vector fields: "
<< flatOutput(mesh_.sortedNames<volVectorField>()) << nl
<< exit(FatalError);
}
}