ENH: use FatalErrorInLookup macros (#1362)

This commit is contained in:
Mark Olesen
2019-07-12 18:00:00 +02:00
committed by Andrew Heather
parent 1d86fc4f6b
commit fb09f56aba
290 changed files with 2634 additions and 2736 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2012-2016 OpenFOAM Foundation
@ -42,19 +42,19 @@ Foam::functionObjects::fieldValue::New
if (output)
{
Info<< "Selecting " << typeName << " " << modelType << endl;
Info<< "Selecting " << typeName << ' ' << modelType << endl;
}
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown " << typeName << " type "
<< modelType << nl << nl
<< "Valid " << typeName << " types :" << nl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
FatalErrorInLookup
(
typeName,
modelType,
*dictionaryConstructorTablePtr_
) << exit(FatalError);
}
return autoPtr<fieldValue>(cstrIter()(name, obr, dict));

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2017-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -44,12 +44,12 @@ Foam::autoPtr<Foam::heatTransferCoeffModel> Foam::heatTransferCoeffModel::New
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown heatTransferCoeffModel type "
<< modelType << nl << nl
<< "Valid heatTransferCoeffModels :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
FatalErrorInLookup
(
"heatTransferCoeffModel",
modelType,
*dictionaryConstructorTablePtr_
) << exit(FatalError);
}
return autoPtr<heatTransferCoeffModel>(cstrIter()(dict, mesh, TName));

View File

@ -180,12 +180,12 @@ Foam::functionObjects::runTimePostPro::pathline::New
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown pathline type "
<< pathlineType << nl << nl
<< "Valid pathline types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
FatalErrorInLookup
(
"pathline",
pathlineType,
*dictionaryConstructorTablePtr_
) << exit(FatalError);
}
return autoPtr<pathline>(cstrIter()(parent, dict, colours));

View File

@ -143,12 +143,12 @@ Foam::functionObjects::runTimePostPro::pointData::New
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown pointData type "
<< pointDataType << nl << nl
<< "Valid pointData types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
FatalErrorInLookup
(
"pointData",
pointDataType,
*dictionaryConstructorTablePtr_
) << exit(FatalError);
}
return autoPtr<pointData>(cstrIter()(parent, dict, colours));

View File

@ -256,12 +256,12 @@ Foam::functionObjects::runTimePostPro::surface::New
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown surface type "
<< surfaceType << nl << nl
<< "Valid surface types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
FatalErrorInLookup
(
"surface",
surfaceType,
*dictionaryConstructorTablePtr_
) << exit(FatalError);
}
return autoPtr<surface>(cstrIter()(parent, dict, colours));

View File

@ -2,10 +2,8 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2015-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -38,20 +36,20 @@ Foam::functionObjects::runTimeControls::runTimeCondition::New
stateFunctionObject& state
)
{
const word conditionType(dict.get<word>("type"));
const word modelType(dict.get<word>("type"));
Info<< "Selecting runTimeCondition " << conditionType << endl;
Info<< "Selecting runTimeCondition " << modelType << endl;
auto cstrIter = dictionaryConstructorTablePtr_->cfind(conditionType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown runTimeCondition type "
<< conditionType << nl << nl
<< "Valid runTimeCondition types :" << nl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
FatalErrorInLookup
(
"runTimeCondition",
modelType,
*dictionaryConstructorTablePtr_
) << exit(FatalError);
}
return