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) 2011-2016 OpenFOAM Foundation
@ -51,12 +51,12 @@ Foam::autoPtr<Foam::cellLooper> Foam::cellLooper::New
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown cellLooper type "
<< type << nl << nl
<< "Valid cellLooper types :" << endl
<< wordConstructorTablePtr_->sortedToc()
<< exit(FatalError);
FatalErrorInLookup
(
"cellLooper",
type,
*wordConstructorTablePtr_
) << exit(FatalError);
}
return autoPtr<cellLooper>(cstrIter()(mesh));

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2016-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2012-2016 OpenFOAM Foundation
@ -113,12 +113,12 @@ Foam::displacementMotionSolver::New
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown solver type "
<< solverTypeName << nl << nl
<< "Valid solver types :" << endl
<< displacementConstructorTablePtr_->sortedToc()
<< exit(FatalError);
FatalErrorInLookup
(
"solver",
solverTypeName,
*displacementConstructorTablePtr_
) << exit(FatalError);
}
return autoPtr<displacementMotionSolver>

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) 2011-2016 OpenFOAM Foundation
@ -43,12 +43,12 @@ Foam::autoPtr<Foam::solidBodyMotionFunction> Foam::solidBodyMotionFunction::New
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown solidBodyMotionFunction type "
<< motionType << nl << nl
<< "Valid solidBodyMotionFunction types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
FatalErrorInLookup
(
"solidBodyMotionFunction",
motionType,
*dictionaryConstructorTablePtr_
) << exit(FatalError);
}
return autoPtr<solidBodyMotionFunction>(cstrIter()(SBMFCoeffs, runTime));

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) 2011-2017 OpenFOAM Foundation
@ -134,12 +134,12 @@ Foam::autoPtr<Foam::motionSolver> Foam::motionSolver::New
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown solver type "
<< solverName << nl << nl
<< "Valid solver types :" << nl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
FatalErrorInLookup
(
"solver",
solverName,
*dictionaryConstructorTablePtr_
) << exit(FatalError);
}
return autoPtr<motionSolver>(cstrIter()(mesh, solverDict));

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) 2011-2016 OpenFOAM Foundation
@ -38,23 +38,21 @@ Foam::autoPtr<Foam::polyMeshModifier> Foam::polyMeshModifier::New
const polyTopoChanger& mme
)
{
if (debug)
{
InfoInFunction << "Constructing polyMeshModifier" << endl;
}
DebugInFunction << "Constructing polyMeshModifier" << endl;
const word modifierType(dict.get<word>("type"));
const word modelType(dict.get<word>("type"));
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modifierType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalIOErrorInFunction(dict)
<< "Unknown polyMeshModifier type "
<< modifierType << nl << nl
<< "Valid polyMeshModifier types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalIOError);
FatalIOErrorInLookup
(
dict,
"polyMeshModifier",
modelType,
*dictionaryConstructorTablePtr_
) << exit(FatalIOError);
}
return autoPtr<polyMeshModifier>(cstrIter()(name, dict, index, mme));