ENH: use FatalIOErrorInLookup instead of FatalErrorInLookup

This commit is contained in:
Mark Olesen
2019-07-16 10:26:51 +02:00
committed by Andrew Heather
parent 5d0f1788e1
commit f94be1bebb
221 changed files with 1214 additions and 988 deletions

View File

@ -83,12 +83,13 @@ Foam::cellSizeAndAlignmentControl::New
if (!cstrIter.found())
{
FatalErrorInLookup
FatalIOErrorInLookup
(
dict,
"cellSizeAndAlignmentControl",
modelType,
*dictionaryConstructorTablePtr_
) << exit(FatalError);
) << exit(FatalIOError);
}
return autoPtr<cellSizeAndAlignmentControl>

View File

@ -137,12 +137,13 @@ Foam::autoPtr<Foam::cellSizeFunction> Foam::cellSizeFunction::New
if (!cstrIter.found())
{
FatalErrorInLookup
FatalIOErrorInLookup
(
dict,
"cellSizeFunction",
modelType,
*dictionaryConstructorTablePtr_
) << exit(FatalError);
) << exit(FatalIOError);
}
return autoPtr<cellSizeFunction>

View File

@ -70,12 +70,13 @@ Foam::autoPtr<Foam::cellSizeCalculationType> Foam::cellSizeCalculationType::New
if (!cstrIter.found())
{
FatalErrorInLookup
FatalIOErrorInLookup
(
dict,
"cellSizeCalculationType",
modelType,
*dictionaryConstructorTablePtr_
) << exit(FatalError);
) << exit(FatalIOError);
}
return autoPtr<cellSizeCalculationType>

View File

@ -67,10 +67,7 @@ Foam::autoPtr<Foam::surfaceCellSizeFunction> Foam::surfaceCellSizeFunction::New
const scalar& defaultCellSize
)
{
const word modelType
(
dict.get<word>("surfaceCellSizeFunction")
);
const word modelType(dict.get<word>("surfaceCellSizeFunction"));
Info<< indent << "Selecting surfaceCellSizeFunction " << modelType << endl;
@ -78,12 +75,13 @@ Foam::autoPtr<Foam::surfaceCellSizeFunction> Foam::surfaceCellSizeFunction::New
if (!cstrIter.found())
{
FatalErrorInLookup
FatalIOErrorInLookup
(
dict,
"surfaceCellSizeFunction",
modelType,
*dictionaryConstructorTablePtr_
) << exit(FatalError);
) << exit(FatalIOError);
}
return autoPtr<surfaceCellSizeFunction>

View File

@ -41,10 +41,10 @@ defineRunTimeSelectionTable(faceAreaWeightModel, dictionary);
Foam::faceAreaWeightModel::faceAreaWeightModel
(
const word& type,
const dictionary& relaxationDict
const dictionary& dict
)
:
dictionary(relaxationDict),
dictionary(dict),
coeffDict_(optionalSubDict(type + "Coeffs"))
{}
@ -53,10 +53,10 @@ Foam::faceAreaWeightModel::faceAreaWeightModel
Foam::autoPtr<Foam::faceAreaWeightModel> Foam::faceAreaWeightModel::New
(
const dictionary& relaxationDict
const dictionary& dict
)
{
const word modelType(relaxationDict.get<word>("faceAreaWeightModel"));
const word modelType(dict.get<word>("faceAreaWeightModel"));
Info<< nl << "Selecting faceAreaWeightModel " << modelType << endl;
@ -64,15 +64,16 @@ Foam::autoPtr<Foam::faceAreaWeightModel> Foam::faceAreaWeightModel::New
if (!cstrIter.found())
{
FatalErrorInLookup
FatalIOErrorInLookup
(
dict,
"faceAreaWeightModel",
modelType,
*dictionaryConstructorTablePtr_
) << exit(FatalError);
) << exit(FatalIOError);
}
return autoPtr<faceAreaWeightModel>(cstrIter()(relaxationDict));
return autoPtr<faceAreaWeightModel>(cstrIter()(dict));
}

View File

@ -71,7 +71,7 @@ Foam::initialPointsMethod::initialPointsMethod
Foam::autoPtr<Foam::initialPointsMethod> Foam::initialPointsMethod::New
(
const dictionary& initialPointsDict,
const dictionary& dict,
const Time& runTime,
Random& rndGen,
const conformationSurfaces& geometryToConformTo,
@ -79,7 +79,7 @@ Foam::autoPtr<Foam::initialPointsMethod> Foam::initialPointsMethod::New
const autoPtr<backgroundMeshDecomposition>& decomposition
)
{
const word modelType(initialPointsDict.get<word>("initialPointsMethod"));
const word modelType(dict.get<word>("initialPointsMethod"));
Info<< nl << "Selecting initialPointsMethod " << modelType << endl;
@ -87,12 +87,13 @@ Foam::autoPtr<Foam::initialPointsMethod> Foam::initialPointsMethod::New
if (!cstrIter.found())
{
FatalErrorInLookup
FatalIOErrorInLookup
(
dict,
"initialPointsMethod",
modelType,
*dictionaryConstructorTablePtr_
) << exit(FatalError);
) << exit(FatalIOError);
}
return
@ -100,7 +101,7 @@ Foam::autoPtr<Foam::initialPointsMethod> Foam::initialPointsMethod::New
(
cstrIter()
(
initialPointsDict,
dict,
runTime,
rndGen,
geometryToConformTo,

View File

@ -42,11 +42,11 @@ defineRunTimeSelectionTable(relaxationModel, dictionary);
Foam::relaxationModel::relaxationModel
(
const word& type,
const dictionary& relaxationDict,
const dictionary& dict,
const Time& runTime
)
:
dictionary(relaxationDict),
dictionary(dict),
runTime_(runTime),
coeffDict_(optionalSubDict(type + "Coeffs"))
{}
@ -56,11 +56,11 @@ Foam::relaxationModel::relaxationModel
Foam::autoPtr<Foam::relaxationModel> Foam::relaxationModel::New
(
const dictionary& relaxationDict,
const dictionary& dict,
const Time& runTime
)
{
const word modelType(relaxationDict.get<word>("relaxationModel"));
const word modelType(dict.get<word>("relaxationModel"));
Info<< nl << "Selecting relaxationModel " << modelType << endl;
@ -68,15 +68,16 @@ Foam::autoPtr<Foam::relaxationModel> Foam::relaxationModel::New
if (!cstrIter.found())
{
FatalErrorInLookup
FatalIOErrorInLookup
(
dict,
"relaxationModel",
modelType,
*dictionaryConstructorTablePtr_
) << exit(FatalError);
) << exit(FatalIOError);
}
return autoPtr<relaxationModel>(cstrIter()(relaxationDict, runTime));
return autoPtr<relaxationModel>(cstrIter()(dict, runTime));
}

View File

@ -51,12 +51,13 @@ Foam::searchableSurfaceFeatures::New
if (!cstrIter.found())
{
FatalErrorInLookup
FatalIOErrorInLookup
(
dict,
"searchableSurfaceFeatures",
modelType,
*dictConstructorTablePtr_
) << exit(FatalError);
) << exit(FatalIOError);
}
return autoPtr<searchableSurfaceFeatures>(cstrIter()(surface, dict));
@ -82,7 +83,4 @@ Foam::searchableSurfaceFeatures::~searchableSurfaceFeatures()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// ************************************************************************* //

View File

@ -74,12 +74,13 @@ Foam::autoPtr<Foam::faceSelection> Foam::faceSelection::New
if (!cstrIter.found())
{
FatalErrorInLookup
FatalIOErrorInLookup
(
dict,
"faceSelection",
modelType,
*dictionaryConstructorTablePtr_
) << exit(FatalError);
) << exit(FatalIOError);
}
return autoPtr<faceSelection>(cstrIter()(name, mesh, dict));

View File

@ -45,8 +45,7 @@ Foam::autoPtr<Foam::helpType> Foam::helpType::New
FatalErrorInFunction
<< "Valid helpType selections:" << nl
<< " "
<< flatOutput(dictionaryConstructorTablePtr_->sortedToc())
<< endl
<< flatOutput(dictionaryConstructorTablePtr_->sortedToc()) << nl
<< exit(FatalError);
}
else
@ -55,8 +54,7 @@ Foam::autoPtr<Foam::helpType> Foam::helpType::New
<< "Unknown helpType type '" << helpTypeName << "'" << nl << nl
<< "Valid helpType selections:" << nl
<< " "
<< flatOutput(dictionaryConstructorTablePtr_->sortedToc())
<< endl
<< flatOutput(dictionaryConstructorTablePtr_->sortedToc()) << nl
<< abort(FatalError);
}
}

View File

@ -44,12 +44,13 @@ Foam::tabulatedWallFunctions::tabulatedWallFunction::New
if (!cstrIter.found())
{
FatalErrorInLookup
FatalIOErrorInLookup
(
dict,
"tabulatedWallFunction",
functionName,
*dictionaryConstructorTablePtr_
) << exit(FatalError);
) << exit(FatalIOError);
}
return autoPtr<tabulatedWallFunction>(cstrIter()(dict, mesh));

View File

@ -70,12 +70,13 @@ Foam::searchableSurfaceModifier::New
if (!cstrIter.found())
{
FatalErrorInLookup
FatalIOErrorInLookup
(
dict,
"searchableSurfaceModifier",
type,
*dictionaryConstructorTablePtr_
) << exit(FatalError);
) << exit(FatalIOError);
}
return autoPtr<searchableSurfaceModifier>(cstrIter()(geometry, dict));