ENH: use singleton method for accessing runtime selection
STYLE: use alias to mark partialFaceAreaWeightAMI deprecation after v2012
This commit is contained in:
parent
4fc6ec1d1d
commit
ba8d6bddcc
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -43,9 +43,9 @@ Foam::autoPtr<Foam::PDRDragModel> Foam::PDRDragModel::New
|
||||
|
||||
Info<< "Selecting drag model " << modelType << endl;
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -57,7 +57,9 @@ Foam::autoPtr<Foam::PDRDragModel> Foam::PDRDragModel::New
|
||||
}
|
||||
|
||||
return autoPtr<PDRDragModel>
|
||||
(cstrIter()(dict, turbulence, rho, U, phi));
|
||||
(
|
||||
ctorPtr(dict, turbulence, rho, U, phi)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -42,9 +42,9 @@ Foam::autoPtr<Foam::XiEqModel> Foam::XiEqModel::New
|
||||
|
||||
Info<< "Selecting flame-wrinkling model " << modelType << endl;
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -55,7 +55,7 @@ Foam::autoPtr<Foam::XiEqModel> Foam::XiEqModel::New
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return autoPtr<XiEqModel>(cstrIter()(dict, thermo, turbulence, Su));
|
||||
return autoPtr<XiEqModel>(ctorPtr(dict, thermo, turbulence, Su));
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -42,9 +42,9 @@ Foam::autoPtr<Foam::XiGModel> Foam::XiGModel::New
|
||||
|
||||
Info<< "Selecting flame-wrinkling model " << modelType << endl;
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -55,7 +55,7 @@ Foam::autoPtr<Foam::XiGModel> Foam::XiGModel::New
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return autoPtr<XiGModel>(cstrIter()(dict, thermo, turbulence, Su));
|
||||
return autoPtr<XiGModel>(ctorPtr(dict, thermo, turbulence, Su));
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -45,9 +45,9 @@ Foam::autoPtr<Foam::XiModel> Foam::XiModel::New
|
||||
|
||||
Info<< "Selecting flame-wrinkling model " << modelType << endl;
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -59,7 +59,9 @@ Foam::autoPtr<Foam::XiModel> Foam::XiModel::New
|
||||
}
|
||||
|
||||
return autoPtr<XiModel>
|
||||
(cstrIter()(dict, thermo, turbulence, Su, rho, b, phi));
|
||||
(
|
||||
ctorPtr(dict, thermo, turbulence, Su, rho, b, phi)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2014-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -44,9 +44,9 @@ Foam::autoPtr<Foam::mixtureViscosityModel> Foam::mixtureViscosityModel::New
|
||||
|
||||
Info<< "Selecting incompressible transport model " << modelType << endl;
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -58,7 +58,9 @@ Foam::autoPtr<Foam::mixtureViscosityModel> Foam::mixtureViscosityModel::New
|
||||
}
|
||||
|
||||
return autoPtr<mixtureViscosityModel>
|
||||
(cstrIter()(name, dict, U, phi));
|
||||
(
|
||||
ctorPtr(name, dict, U, phi)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2014-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -111,9 +111,9 @@ Foam::autoPtr<Foam::relativeVelocityModel> Foam::relativeVelocityModel::New
|
||||
|
||||
Info<< "Selecting relative velocity model " << modelType << endl;
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -127,7 +127,7 @@ Foam::autoPtr<Foam::relativeVelocityModel> Foam::relativeVelocityModel::New
|
||||
return
|
||||
autoPtr<relativeVelocityModel>
|
||||
(
|
||||
cstrIter()
|
||||
ctorPtr
|
||||
(
|
||||
dict.optionalSubDict(modelType + "Coeffs"),
|
||||
mixture
|
||||
|
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017-2019 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -41,9 +41,9 @@ Foam::radiation::reflectionModel::New
|
||||
|
||||
Info<< "Selecting reflectionModel " << modelType << endl;
|
||||
|
||||
const auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -54,7 +54,7 @@ Foam::radiation::reflectionModel::New
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return autoPtr<reflectionModel>(cstrIter()(dict, mesh));
|
||||
return autoPtr<reflectionModel>(ctorPtr(dict, mesh));
|
||||
}
|
||||
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2019 OpenCFD Ltd.
|
||||
Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -54,9 +54,9 @@ Foam::temperaturePhaseChangeTwoPhaseMixture::New
|
||||
|
||||
Info<< "Selecting phaseChange model " << modelType << endl;
|
||||
|
||||
auto cstrIter = componentsConstructorTablePtr_->cfind(modelType);
|
||||
auto* ctorPtr = componentsConstructorTable(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -70,7 +70,7 @@ Foam::temperaturePhaseChangeTwoPhaseMixture::New
|
||||
return
|
||||
autoPtr<temperaturePhaseChangeTwoPhaseMixture>
|
||||
(
|
||||
cstrIter()(thermo, mesh)
|
||||
ctorPtr(thermo, mesh)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -56,9 +56,9 @@ Foam::phaseChangeTwoPhaseMixture::New
|
||||
|
||||
Info<< "Selecting phaseChange model " << modelType << endl;
|
||||
|
||||
auto cstrIter = componentsConstructorTablePtr_->cfind(modelType);
|
||||
auto* ctorPtr = componentsConstructorTable(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -69,7 +69,7 @@ Foam::phaseChangeTwoPhaseMixture::New
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return autoPtr<phaseChangeTwoPhaseMixture>(cstrIter()(U, phi));
|
||||
return autoPtr<phaseChangeTwoPhaseMixture>(ctorPtr(U, phi));
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -80,9 +80,9 @@ Foam::cellSizeAndAlignmentControl::New
|
||||
Info<< indent << "Selecting cellSizeAndAlignmentControl "
|
||||
<< modelType << endl;
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -95,7 +95,7 @@ Foam::cellSizeAndAlignmentControl::New
|
||||
|
||||
return autoPtr<cellSizeAndAlignmentControl>
|
||||
(
|
||||
cstrIter()
|
||||
ctorPtr
|
||||
(
|
||||
runTime,
|
||||
name,
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2012-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -134,9 +134,9 @@ Foam::autoPtr<Foam::cellSizeFunction> Foam::cellSizeFunction::New
|
||||
|
||||
Info<< indent << "Selecting cellSizeFunction " << modelType << endl;
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -149,7 +149,7 @@ Foam::autoPtr<Foam::cellSizeFunction> Foam::cellSizeFunction::New
|
||||
|
||||
return autoPtr<cellSizeFunction>
|
||||
(
|
||||
cstrIter()
|
||||
ctorPtr
|
||||
(
|
||||
dict,
|
||||
surface,
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -67,9 +67,9 @@ Foam::autoPtr<Foam::cellSizeCalculationType> Foam::cellSizeCalculationType::New
|
||||
|
||||
Info<< indent << "Selecting cellSizeCalculationType " << modelType << endl;
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -82,7 +82,7 @@ Foam::autoPtr<Foam::cellSizeCalculationType> Foam::cellSizeCalculationType::New
|
||||
|
||||
return autoPtr<cellSizeCalculationType>
|
||||
(
|
||||
cstrIter()(dict, surface, defaultCellSize)
|
||||
ctorPtr(dict, surface, defaultCellSize)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2012-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -72,9 +72,9 @@ Foam::autoPtr<Foam::surfaceCellSizeFunction> Foam::surfaceCellSizeFunction::New
|
||||
|
||||
Info<< indent << "Selecting surfaceCellSizeFunction " << modelType << endl;
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -87,7 +87,7 @@ Foam::autoPtr<Foam::surfaceCellSizeFunction> Foam::surfaceCellSizeFunction::New
|
||||
|
||||
return autoPtr<surfaceCellSizeFunction>
|
||||
(
|
||||
cstrIter()(dict, surface, defaultCellSize)
|
||||
ctorPtr(dict, surface, defaultCellSize)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2012-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -61,9 +61,9 @@ Foam::autoPtr<Foam::faceAreaWeightModel> Foam::faceAreaWeightModel::New
|
||||
|
||||
Info<< nl << "Selecting faceAreaWeightModel " << modelType << endl;
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -74,7 +74,7 @@ Foam::autoPtr<Foam::faceAreaWeightModel> Foam::faceAreaWeightModel::New
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return autoPtr<faceAreaWeightModel>(cstrIter()(dict));
|
||||
return autoPtr<faceAreaWeightModel>(ctorPtr(dict));
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2012-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -84,9 +84,9 @@ Foam::autoPtr<Foam::initialPointsMethod> Foam::initialPointsMethod::New
|
||||
|
||||
Info<< nl << "Selecting initialPointsMethod " << modelType << endl;
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -100,7 +100,7 @@ Foam::autoPtr<Foam::initialPointsMethod> Foam::initialPointsMethod::New
|
||||
return
|
||||
autoPtr<initialPointsMethod>
|
||||
(
|
||||
cstrIter()
|
||||
ctorPtr
|
||||
(
|
||||
dict,
|
||||
runTime,
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2012-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -65,9 +65,9 @@ Foam::autoPtr<Foam::relaxationModel> Foam::relaxationModel::New
|
||||
|
||||
Info<< nl << "Selecting relaxationModel " << modelType << endl;
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -78,7 +78,7 @@ Foam::autoPtr<Foam::relaxationModel> Foam::relaxationModel::New
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return autoPtr<relaxationModel>(cstrIter()(dict, runTime));
|
||||
return autoPtr<relaxationModel>(ctorPtr(dict, runTime));
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2013-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -48,9 +48,9 @@ Foam::searchableSurfaceFeatures::New
|
||||
{
|
||||
const word modelType(surface.type() + "Features");
|
||||
|
||||
auto cstrIter = dictConstructorTablePtr_->cfind(modelType);
|
||||
auto* ctorPtr = dictConstructorTable(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -61,7 +61,7 @@ Foam::searchableSurfaceFeatures::New
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return autoPtr<searchableSurfaceFeatures>(cstrIter()(surface, dict));
|
||||
return autoPtr<searchableSurfaceFeatures>(ctorPtr(surface, dict));
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -71,9 +71,9 @@ Foam::autoPtr<Foam::faceSelection> Foam::faceSelection::New
|
||||
{
|
||||
const word modelType(dict.get<word>("type"));
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -84,7 +84,7 @@ Foam::autoPtr<Foam::faceSelection> Foam::faceSelection::New
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return autoPtr<faceSelection>(cstrIter()(name, mesh, dict));
|
||||
return autoPtr<faceSelection>(ctorPtr(name, mesh, dict));
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2012-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -34,9 +35,9 @@ Foam::autoPtr<Foam::helpType> Foam::helpType::New
|
||||
const word& helpTypeName
|
||||
)
|
||||
{
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(helpTypeName);
|
||||
auto* ctorPtr = dictionaryConstructorTable(helpTypeName);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
// special treatment for -help
|
||||
// exit without stack trace
|
||||
@ -61,7 +62,7 @@ Foam::autoPtr<Foam::helpType> Foam::helpType::New
|
||||
|
||||
Info<< "Selecting helpType '" << helpTypeName << "'" << endl;
|
||||
|
||||
return autoPtr<helpType>(cstrIter()());
|
||||
return autoPtr<helpType>(ctorPtr());
|
||||
}
|
||||
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -40,7 +40,7 @@ using namespace Foam::constant;
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineMemberFunctionSelectionTable(PDRobstacle, read, dictRead);
|
||||
defineMemberFunctionSelectionTable(PDRobstacle, read, dictionary);
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016 Shell Research Ltd.
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -178,7 +178,7 @@ public:
|
||||
void,
|
||||
PDRobstacle,
|
||||
read,
|
||||
dictRead,
|
||||
dictionary,
|
||||
(
|
||||
PDRobstacle& obs,
|
||||
const dictionary& dict
|
||||
|
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -41,18 +41,20 @@ bool Foam::PDRobstacle::read(Istream& is)
|
||||
const word obsType(is);
|
||||
const dictionary dict(is);
|
||||
|
||||
const auto mfIter = readdictReadMemberFunctionTablePtr_->cfind(obsType);
|
||||
auto* mfuncPtr = readdictionaryMemberFunctionTable(obsType);
|
||||
|
||||
if (!mfIter.good())
|
||||
if (!mfuncPtr)
|
||||
{
|
||||
FatalIOErrorInFunction(is)
|
||||
<< "Unknown obstacle type: " << obsType << nl
|
||||
<< "Valid types:" << nl
|
||||
<< readdictReadMemberFunctionTablePtr_->sortedToc() << nl
|
||||
<< exit(FatalIOError);
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
is,
|
||||
"obstacle",
|
||||
obsType,
|
||||
*readdictionaryMemberFunctionTablePtr_
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
mfIter()(*this, dict);
|
||||
mfuncPtr(*this, dict);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -45,7 +45,7 @@ using namespace Foam::constant;
|
||||
PDRobstacle, \
|
||||
obsType, \
|
||||
read, \
|
||||
dictRead, \
|
||||
dictionary, \
|
||||
obsName \
|
||||
); \
|
||||
} \
|
||||
|
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2020 DLR
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -46,9 +46,9 @@ Foam::autoPtr<Foam::implicitFunction> Foam::implicitFunction::New
|
||||
const dictionary& dict
|
||||
)
|
||||
{
|
||||
auto cstrIter = dictConstructorTablePtr_->cfind(implicitFunctionType);
|
||||
auto* ctorPtr = dictConstructorTable(implicitFunctionType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -59,7 +59,7 @@ Foam::autoPtr<Foam::implicitFunction> Foam::implicitFunction::New
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return autoPtr<implicitFunction>(cstrIter()(dict));
|
||||
return autoPtr<implicitFunction>(ctorPtr(dict));
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -41,9 +41,9 @@ Foam::tabulatedWallFunctions::tabulatedWallFunction::New
|
||||
|
||||
Info<< "Selecting tabulatedWallFunction " << functionName << endl;
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(functionName);
|
||||
auto* ctorPtr = dictionaryConstructorTable(functionName);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -54,7 +54,7 @@ Foam::tabulatedWallFunctions::tabulatedWallFunction::New
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return autoPtr<tabulatedWallFunction>(cstrIter()(dict, mesh));
|
||||
return autoPtr<tabulatedWallFunction>(ctorPtr(dict, mesh));
|
||||
}
|
||||
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -72,9 +72,9 @@ Foam::surfaceFeaturesExtraction::method::New
|
||||
{
|
||||
const word modelType(dict.get<word>("extractionMethod"));
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -85,7 +85,7 @@ Foam::surfaceFeaturesExtraction::method::New
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return autoPtr<method>(cstrIter.val()(dict));
|
||||
return autoPtr<method>(ctorPtr(dict));
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2014 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -67,9 +67,9 @@ Foam::searchableSurfaceModifier::New
|
||||
const dictionary& dict
|
||||
)
|
||||
{
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(type);
|
||||
auto* ctorPtr = dictionaryConstructorTable(type);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -80,7 +80,7 @@ Foam::searchableSurfaceModifier::New
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return autoPtr<searchableSurfaceModifier>(cstrIter()(geometry, dict));
|
||||
return autoPtr<searchableSurfaceModifier>(ctorPtr(geometry, dict));
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -39,9 +39,9 @@ Foam::autoPtr<Foam::ODESolver> Foam::ODESolver::New
|
||||
const word solverType(dict.get<word>("solver"));
|
||||
Info<< "Selecting ODE solver " << solverType << endl;
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(solverType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(solverType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -52,7 +52,7 @@ Foam::autoPtr<Foam::ODESolver> Foam::ODESolver::New
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return autoPtr<ODESolver>(cstrIter()(odes, dict));
|
||||
return autoPtr<ODESolver>(ctorPtr(odes, dict));
|
||||
}
|
||||
|
||||
|
||||
|
@ -58,9 +58,9 @@ Foam::autoPtr<Foam::token::compound> Foam::token::compound::New
|
||||
Istream& is
|
||||
)
|
||||
{
|
||||
auto cstrIter = IstreamConstructorTablePtr_->cfind(compoundType);
|
||||
auto* ctorPtr = IstreamConstructorTable(compoundType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -71,7 +71,7 @@ Foam::autoPtr<Foam::token::compound> Foam::token::compound::New
|
||||
) << abort(FatalIOError);
|
||||
}
|
||||
|
||||
return autoPtr<Foam::token::compound>(cstrIter()(is));
|
||||
return autoPtr<Foam::token::compound>(ctorPtr(is));
|
||||
}
|
||||
|
||||
|
||||
|
@ -100,10 +100,10 @@ bool Foam::functionEntry::execute
|
||||
return true;
|
||||
}
|
||||
|
||||
auto mfIter =
|
||||
executedictionaryIstreamMemberFunctionTablePtr_->cfind(functionName);
|
||||
auto* mfuncPtr =
|
||||
executedictionaryIstreamMemberFunctionTable(functionName);
|
||||
|
||||
if (!mfIter.found())
|
||||
if (!mfuncPtr)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unknown functionEntry '" << functionName
|
||||
@ -114,7 +114,7 @@ bool Foam::functionEntry::execute
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
return mfIter()(parentDict, is);
|
||||
return mfuncPtr(parentDict, is);
|
||||
}
|
||||
|
||||
|
||||
@ -139,13 +139,10 @@ bool Foam::functionEntry::execute
|
||||
return true;
|
||||
}
|
||||
|
||||
auto mfIter =
|
||||
executeprimitiveEntryIstreamMemberFunctionTablePtr_->cfind
|
||||
(
|
||||
functionName
|
||||
);
|
||||
auto* mfuncPtr =
|
||||
executeprimitiveEntryIstreamMemberFunctionTable(functionName);
|
||||
|
||||
if (!mfIter.found())
|
||||
if (!mfuncPtr)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unknown functionEntry '" << functionName
|
||||
@ -156,7 +153,7 @@ bool Foam::functionEntry::execute
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
return mfIter()(parentDict, entry, is);
|
||||
return mfuncPtr(parentDict, entry, is);
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -108,9 +108,9 @@ Foam::autoPtr<Foam::functionObject> Foam::functionObject::New
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(functionType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(functionType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
// FatalError (not FatalIOError) to ensure it can be caught
|
||||
// as an exception and ignored
|
||||
@ -122,7 +122,7 @@ Foam::autoPtr<Foam::functionObject> Foam::functionObject::New
|
||||
) << exit(FatalError);
|
||||
}
|
||||
|
||||
return autoPtr<functionObject>(cstrIter()(name, runTime, dict));
|
||||
return autoPtr<functionObject>(ctorPtr(name, runTime, dict));
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Original code Copyright (C) 2014-2018 Bernhard Gschaider
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -119,9 +119,9 @@ Foam::exprTools::expressionEntry::New
|
||||
const word& name
|
||||
)
|
||||
{
|
||||
auto cstrIter = emptyConstructorTablePtr_->cfind(name);
|
||||
auto* ctorPtr = emptyConstructorTable(name);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalErrorInLookup
|
||||
(
|
||||
@ -131,7 +131,7 @@ Foam::exprTools::expressionEntry::New
|
||||
) << exit(FatalError);
|
||||
}
|
||||
|
||||
return autoPtr<expressionEntry>(cstrIter()());
|
||||
return autoPtr<expressionEntry>(ctorPtr());
|
||||
}
|
||||
|
||||
|
||||
|
@ -314,9 +314,9 @@ Foam::expressions::exprResult::New
|
||||
|
||||
if (dict.getOrDefault("unsetValue", false))
|
||||
{
|
||||
auto cstrIter = emptyConstructorTablePtr_->cfind(resultType);
|
||||
auto* ctorPtr = emptyConstructorTable(resultType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -330,13 +330,13 @@ Foam::expressions::exprResult::New
|
||||
DebugInfo
|
||||
<< "Creating unset result of type " << resultType << nl;
|
||||
|
||||
return autoPtr<exprResult>(cstrIter()());
|
||||
return autoPtr<exprResult>(ctorPtr());
|
||||
}
|
||||
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(resultType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(resultType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -350,7 +350,7 @@ Foam::expressions::exprResult::New
|
||||
DebugInfo
|
||||
<< "Creating result of type " << resultType << nl;
|
||||
|
||||
return autoPtr<exprResult>(cstrIter()(dict));
|
||||
return autoPtr<exprResult>(ctorPtr(dict));
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -93,14 +94,13 @@ Foam::pointPatchField<Type>::NewCalculatedType
|
||||
const pointPatchField<Type2>& pf
|
||||
)
|
||||
{
|
||||
auto patchTypeCstrIter =
|
||||
pointPatchConstructorTablePtr_->cfind(pf.patch().type());
|
||||
auto* patchTypeCtor = pointPatchConstructorTable(pf.patch().type());
|
||||
|
||||
if (patchTypeCstrIter.found())
|
||||
if (patchTypeCtor)
|
||||
{
|
||||
return autoPtr<pointPatchField<Type>>
|
||||
(
|
||||
patchTypeCstrIter()
|
||||
patchTypeCtor
|
||||
(
|
||||
pf.patch(),
|
||||
Field<Type>::null()
|
||||
|
@ -39,9 +39,9 @@ Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::New
|
||||
{
|
||||
DebugInFunction << "Constructing pointPatchField<Type>" << endl;
|
||||
|
||||
auto cstrIter = pointPatchConstructorTablePtr_->cfind(patchFieldType);
|
||||
auto* ctorPtr = pointPatchConstructorTable(patchFieldType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalErrorInLookup
|
||||
(
|
||||
@ -51,7 +51,7 @@ Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::New
|
||||
) << exit(FatalError);
|
||||
}
|
||||
|
||||
autoPtr<pointPatchField<Type>> pfPtr(cstrIter()(p, iF));
|
||||
autoPtr<pointPatchField<Type>> pfPtr(ctorPtr(p, iF));
|
||||
|
||||
if
|
||||
(
|
||||
@ -64,10 +64,9 @@ Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::New
|
||||
// Incompatible (constraint-wise) with the patch type
|
||||
// - use default constraint type
|
||||
|
||||
auto patchTypeCstrIter =
|
||||
pointPatchConstructorTablePtr_->cfind(p.type());
|
||||
auto* patchTypeCtor = pointPatchConstructorTable(p.type());
|
||||
|
||||
if (!patchTypeCstrIter.found())
|
||||
if (!patchTypeCtor)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Inconsistent patch and patchField types for\n"
|
||||
@ -76,7 +75,7 @@ Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::New
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
return patchTypeCstrIter()(p, iF);
|
||||
return patchTypeCtor(p, iF);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -115,16 +114,16 @@ Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::New
|
||||
|
||||
const word patchFieldType(dict.get<word>("type"));
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(patchFieldType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(patchFieldType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
if (!disallowGenericPointPatchField)
|
||||
{
|
||||
cstrIter = dictionaryConstructorTablePtr_->cfind("generic");
|
||||
ctorPtr = dictionaryConstructorTable("generic");
|
||||
}
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInFunction(dict)
|
||||
<< "Unknown patchField type " << patchFieldType
|
||||
@ -136,7 +135,7 @@ Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::New
|
||||
}
|
||||
|
||||
// Construct (but not necessarily returned)
|
||||
autoPtr<pointPatchField<Type>> pfPtr(cstrIter()(p, iF, dict));
|
||||
autoPtr<pointPatchField<Type>> pfPtr(ctorPtr(p, iF, dict));
|
||||
|
||||
if
|
||||
(
|
||||
@ -149,10 +148,9 @@ Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::New
|
||||
// Incompatible (constraint-wise) with the patch type
|
||||
// - use default constraint type
|
||||
|
||||
auto patchTypeCstrIter =
|
||||
dictionaryConstructorTablePtr_->cfind(p.type());
|
||||
auto* patchTypeCtor = dictionaryConstructorTable(p.type());
|
||||
|
||||
if (!patchTypeCstrIter.found())
|
||||
if (!patchTypeCtor)
|
||||
{
|
||||
FatalIOErrorInFunction(dict)
|
||||
<< "Inconsistent patch and patchField types for\n"
|
||||
@ -161,7 +159,7 @@ Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::New
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
|
||||
return patchTypeCstrIter()(p, iF, dict);
|
||||
return patchTypeCtor(p, iF, dict);
|
||||
}
|
||||
}
|
||||
|
||||
@ -180,9 +178,9 @@ Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::New
|
||||
{
|
||||
DebugInFunction << "Constructing pointPatchField<Type>" << endl;
|
||||
|
||||
auto cstrIter = patchMapperConstructorTablePtr_->cfind(ptf.type());
|
||||
auto* ctorPtr = patchMapperConstructorTable(ptf.type());
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalErrorInLookup
|
||||
(
|
||||
@ -192,7 +190,7 @@ Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::New
|
||||
) << exit(FatalError);
|
||||
}
|
||||
|
||||
return cstrIter()(ptf, p, iF, pfMapper);
|
||||
return ctorPtr(ptf, p, iF, pfMapper);
|
||||
}
|
||||
|
||||
|
||||
|
@ -711,9 +711,9 @@ Foam::fileOperation::New
|
||||
DebugInFunction
|
||||
<< "Constructing fileHandler" << endl;
|
||||
|
||||
auto cstrIter = wordConstructorTablePtr_->cfind(handlerType);
|
||||
auto* ctorPtr = wordConstructorTable(handlerType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalErrorInLookup
|
||||
(
|
||||
@ -723,7 +723,7 @@ Foam::fileOperation::New
|
||||
) << abort(FatalError);
|
||||
}
|
||||
|
||||
return autoPtr<fileOperation>(cstrIter()(verbose));
|
||||
return autoPtr<fileOperation>(ctorPtr(verbose));
|
||||
}
|
||||
|
||||
|
||||
|
@ -85,9 +85,9 @@ Foam::fileOperations::fileOperationInitialise::New
|
||||
{
|
||||
DebugInFunction << "Constructing fileOperationInitialise" << endl;
|
||||
|
||||
auto cstrIter = wordConstructorTablePtr_->cfind(type);
|
||||
auto* ctorPtr = wordConstructorTable(type);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalErrorInLookup
|
||||
(
|
||||
@ -97,7 +97,7 @@ Foam::fileOperations::fileOperationInitialise::New
|
||||
) << abort(FatalError);
|
||||
}
|
||||
|
||||
return autoPtr<fileOperationInitialise>(cstrIter()(argc, argv));
|
||||
return autoPtr<fileOperationInitialise>(ctorPtr(argc, argv));
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -219,9 +219,9 @@ Foam::autoPtr<Foam::graph::writer> Foam::graph::writer::New
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
auto cstrIter = wordConstructorTablePtr_->cfind(graphFormat);
|
||||
auto* ctorPtr = wordConstructorTable(graphFormat);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalErrorInLookup
|
||||
(
|
||||
@ -231,7 +231,7 @@ Foam::autoPtr<Foam::graph::writer> Foam::graph::writer::New
|
||||
) << exit(FatalError);
|
||||
}
|
||||
|
||||
return autoPtr<graph::writer>(cstrIter()());
|
||||
return autoPtr<graph::writer>(ctorPtr());
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -42,9 +42,9 @@ Foam::autoPtr<Foam::tableReader<Type>> Foam::tableReader<Type>::New
|
||||
"openFoam"
|
||||
);
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(readerType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(readerType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -55,7 +55,7 @@ Foam::autoPtr<Foam::tableReader<Type>> Foam::tableReader<Type>::New
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return autoPtr<tableReader<Type>>(cstrIter()(spec));
|
||||
return autoPtr<tableReader<Type>>(ctorPtr(spec));
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -57,9 +57,9 @@ Foam::autoPtr<Foam::interpolationWeights> Foam::interpolationWeights::New
|
||||
{
|
||||
DebugInFunction << "Selecting interpolationWeights " << type << endl;
|
||||
|
||||
auto cstrIter = wordConstructorTablePtr_->cfind(type);
|
||||
auto* ctorPtr = wordConstructorTable(type);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalErrorInLookup
|
||||
(
|
||||
@ -69,7 +69,7 @@ Foam::autoPtr<Foam::interpolationWeights> Foam::interpolationWeights::New
|
||||
) << exit(FatalError);
|
||||
}
|
||||
|
||||
return autoPtr<interpolationWeights>(cstrIter()(samples));
|
||||
return autoPtr<interpolationWeights>(ctorPtr(samples));
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -45,10 +45,9 @@ Foam::LduMatrix<Type, DType, LUType>::preconditioner::New
|
||||
|
||||
if (sol.matrix().symmetric())
|
||||
{
|
||||
auto cstrIter =
|
||||
symMatrixConstructorTablePtr_->cfind(preconditionerName);
|
||||
auto* ctorPtr = symMatrixConstructorTable(preconditionerName);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -61,7 +60,7 @@ Foam::LduMatrix<Type, DType, LUType>::preconditioner::New
|
||||
|
||||
return autoPtr<typename LduMatrix<Type, DType, LUType>::preconditioner>
|
||||
(
|
||||
cstrIter()
|
||||
ctorPtr
|
||||
(
|
||||
sol,
|
||||
preconditionerDict
|
||||
@ -70,10 +69,9 @@ Foam::LduMatrix<Type, DType, LUType>::preconditioner::New
|
||||
}
|
||||
else if (sol.matrix().asymmetric())
|
||||
{
|
||||
auto cstrIter =
|
||||
asymMatrixConstructorTablePtr_->cfind(preconditionerName);
|
||||
auto* ctorPtr = asymMatrixConstructorTable(preconditionerName);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -86,7 +84,7 @@ Foam::LduMatrix<Type, DType, LUType>::preconditioner::New
|
||||
|
||||
return autoPtr<typename LduMatrix<Type, DType, LUType>::preconditioner>
|
||||
(
|
||||
cstrIter()
|
||||
ctorPtr
|
||||
(
|
||||
sol,
|
||||
preconditionerDict
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -43,9 +43,9 @@ Foam::LduMatrix<Type, DType, LUType>::smoother::New
|
||||
|
||||
if (matrix.symmetric())
|
||||
{
|
||||
auto cstrIter = symMatrixConstructorTablePtr_->cfind(smootherName);
|
||||
auto* ctorPtr = symMatrixConstructorTable(smootherName);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -58,7 +58,7 @@ Foam::LduMatrix<Type, DType, LUType>::smoother::New
|
||||
|
||||
return autoPtr<typename LduMatrix<Type, DType, LUType>::smoother>
|
||||
(
|
||||
cstrIter()
|
||||
ctorPtr
|
||||
(
|
||||
fieldName,
|
||||
matrix
|
||||
@ -67,9 +67,9 @@ Foam::LduMatrix<Type, DType, LUType>::smoother::New
|
||||
}
|
||||
else if (matrix.asymmetric())
|
||||
{
|
||||
auto cstrIter = asymMatrixConstructorTablePtr_->cfind(smootherName);
|
||||
auto* ctorPtr = asymMatrixConstructorTable(smootherName);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -82,7 +82,7 @@ Foam::LduMatrix<Type, DType, LUType>::smoother::New
|
||||
|
||||
return autoPtr<typename LduMatrix<Type, DType, LUType>::smoother>
|
||||
(
|
||||
cstrIter()
|
||||
ctorPtr
|
||||
(
|
||||
fieldName,
|
||||
matrix
|
||||
|
@ -56,9 +56,9 @@ Foam::LduMatrix<Type, DType, LUType>::solver::New
|
||||
}
|
||||
else if (matrix.symmetric())
|
||||
{
|
||||
auto cstrIter = symMatrixConstructorTablePtr_->cfind(solverName);
|
||||
auto* ctorPtr = symMatrixConstructorTable(solverName);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -71,7 +71,7 @@ Foam::LduMatrix<Type, DType, LUType>::solver::New
|
||||
|
||||
return autoPtr<typename LduMatrix<Type, DType, LUType>::solver>
|
||||
(
|
||||
cstrIter()
|
||||
ctorPtr
|
||||
(
|
||||
fieldName,
|
||||
matrix,
|
||||
@ -81,9 +81,9 @@ Foam::LduMatrix<Type, DType, LUType>::solver::New
|
||||
}
|
||||
else if (matrix.asymmetric())
|
||||
{
|
||||
auto cstrIter = asymMatrixConstructorTablePtr_->cfind(solverName);
|
||||
auto* ctorPtr = asymMatrixConstructorTable(solverName);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -96,7 +96,7 @@ Foam::LduMatrix<Type, DType, LUType>::solver::New
|
||||
|
||||
return autoPtr<typename LduMatrix<Type, DType, LUType>::solver>
|
||||
(
|
||||
cstrIter()
|
||||
ctorPtr
|
||||
(
|
||||
fieldName,
|
||||
matrix,
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -90,9 +90,9 @@ Foam::lduMatrix::preconditioner::New
|
||||
|
||||
if (sol.matrix().symmetric())
|
||||
{
|
||||
auto cstrIter = symMatrixConstructorTablePtr_->cfind(name);
|
||||
auto* ctorPtr = symMatrixConstructorTable(name);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -105,7 +105,7 @@ Foam::lduMatrix::preconditioner::New
|
||||
|
||||
return autoPtr<lduMatrix::preconditioner>
|
||||
(
|
||||
cstrIter()
|
||||
ctorPtr
|
||||
(
|
||||
sol,
|
||||
controls
|
||||
@ -114,9 +114,9 @@ Foam::lduMatrix::preconditioner::New
|
||||
}
|
||||
else if (sol.matrix().asymmetric())
|
||||
{
|
||||
auto cstrIter = asymMatrixConstructorTablePtr_->cfind(name);
|
||||
auto* ctorPtr = asymMatrixConstructorTable(name);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -129,7 +129,7 @@ Foam::lduMatrix::preconditioner::New
|
||||
|
||||
return autoPtr<lduMatrix::preconditioner>
|
||||
(
|
||||
cstrIter()
|
||||
ctorPtr
|
||||
(
|
||||
sol,
|
||||
controls
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -93,9 +93,9 @@ Foam::autoPtr<Foam::lduMatrix::smoother> Foam::lduMatrix::smoother::New
|
||||
|
||||
if (matrix.symmetric())
|
||||
{
|
||||
auto cstrIter = symMatrixConstructorTablePtr_->cfind(name);
|
||||
auto* ctorPtr = symMatrixConstructorTable(name);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -108,7 +108,7 @@ Foam::autoPtr<Foam::lduMatrix::smoother> Foam::lduMatrix::smoother::New
|
||||
|
||||
return autoPtr<lduMatrix::smoother>
|
||||
(
|
||||
cstrIter()
|
||||
ctorPtr
|
||||
(
|
||||
fieldName,
|
||||
matrix,
|
||||
@ -120,9 +120,9 @@ Foam::autoPtr<Foam::lduMatrix::smoother> Foam::lduMatrix::smoother::New
|
||||
}
|
||||
else if (matrix.asymmetric())
|
||||
{
|
||||
auto cstrIter = asymMatrixConstructorTablePtr_->cfind(name);
|
||||
auto* ctorPtr = asymMatrixConstructorTable(name);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -135,7 +135,7 @@ Foam::autoPtr<Foam::lduMatrix::smoother> Foam::lduMatrix::smoother::New
|
||||
|
||||
return autoPtr<lduMatrix::smoother>
|
||||
(
|
||||
cstrIter()
|
||||
ctorPtr
|
||||
(
|
||||
fieldName,
|
||||
matrix,
|
||||
|
@ -70,9 +70,9 @@ Foam::autoPtr<Foam::lduMatrix::solver> Foam::lduMatrix::solver::New
|
||||
}
|
||||
else if (matrix.symmetric())
|
||||
{
|
||||
auto cstrIter = symMatrixConstructorTablePtr_->cfind(name);
|
||||
auto* ctorPtr = symMatrixConstructorTable(name);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -85,7 +85,7 @@ Foam::autoPtr<Foam::lduMatrix::solver> Foam::lduMatrix::solver::New
|
||||
|
||||
return autoPtr<lduMatrix::solver>
|
||||
(
|
||||
cstrIter()
|
||||
ctorPtr
|
||||
(
|
||||
fieldName,
|
||||
matrix,
|
||||
@ -98,9 +98,9 @@ Foam::autoPtr<Foam::lduMatrix::solver> Foam::lduMatrix::solver::New
|
||||
}
|
||||
else if (matrix.asymmetric())
|
||||
{
|
||||
auto cstrIter = asymMatrixConstructorTablePtr_->cfind(name);
|
||||
auto* ctorPtr = asymMatrixConstructorTable(name);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -113,7 +113,7 @@ Foam::autoPtr<Foam::lduMatrix::solver> Foam::lduMatrix::solver::New
|
||||
|
||||
return autoPtr<lduMatrix::solver>
|
||||
(
|
||||
cstrIter()
|
||||
ctorPtr
|
||||
(
|
||||
fieldName,
|
||||
matrix,
|
||||
|
@ -319,9 +319,9 @@ const Foam::GAMGAgglomeration& Foam::GAMGAgglomeration::New
|
||||
lduMeshConstructorTablePtr_
|
||||
);
|
||||
|
||||
auto cstrIter = lduMeshConstructorTablePtr_->cfind(agglomeratorType);
|
||||
auto* ctorPtr = lduMeshConstructorTable(agglomeratorType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unknown GAMGAgglomeration type "
|
||||
@ -333,7 +333,7 @@ const Foam::GAMGAgglomeration& Foam::GAMGAgglomeration::New
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
return store(cstrIter()(mesh, controlDict).ptr());
|
||||
return store(ctorPtr(mesh, controlDict).ptr());
|
||||
}
|
||||
}
|
||||
|
||||
@ -370,20 +370,15 @@ const Foam::GAMGAgglomeration& Foam::GAMGAgglomeration::New
|
||||
lduMatrixConstructorTablePtr_
|
||||
);
|
||||
|
||||
if
|
||||
(
|
||||
!lduMatrixConstructorTablePtr_
|
||||
|| !lduMatrixConstructorTablePtr_->found(agglomeratorType)
|
||||
)
|
||||
auto* ctorPtr = lduMatrixConstructorTable(agglomeratorType);
|
||||
|
||||
if (!ctorPtr)
|
||||
{
|
||||
return New(mesh, controlDict);
|
||||
}
|
||||
else
|
||||
{
|
||||
auto cstrIter =
|
||||
lduMatrixConstructorTablePtr_->cfind(agglomeratorType);
|
||||
|
||||
return store(cstrIter()(matrix, controlDict).ptr());
|
||||
return store(ctorPtr(matrix, controlDict).ptr());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -422,9 +417,9 @@ const Foam::GAMGAgglomeration& Foam::GAMGAgglomeration::New
|
||||
geometryConstructorTablePtr_
|
||||
);
|
||||
|
||||
auto cstrIter = geometryConstructorTablePtr_->cfind(agglomeratorType);
|
||||
auto* ctorPtr = geometryConstructorTable(agglomeratorType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unknown GAMGAgglomeration type "
|
||||
@ -436,7 +431,7 @@ const Foam::GAMGAgglomeration& Foam::GAMGAgglomeration::New
|
||||
|
||||
return store
|
||||
(
|
||||
cstrIter()
|
||||
ctorPtr
|
||||
(
|
||||
mesh,
|
||||
cellVolumes,
|
||||
|
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2013-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -364,9 +365,9 @@ Foam::autoPtr<Foam::GAMGProcAgglomeration> Foam::GAMGProcAgglomeration::New
|
||||
{
|
||||
DebugInFunction << "Constructing GAMGProcAgglomeration" << endl;
|
||||
|
||||
auto cstrIter = GAMGAgglomerationConstructorTablePtr_->cfind(type);
|
||||
auto* ctorPtr = GAMGAgglomerationConstructorTable(type);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unknown GAMGProcAgglomeration type "
|
||||
@ -376,7 +377,7 @@ Foam::autoPtr<Foam::GAMGProcAgglomeration> Foam::GAMGProcAgglomeration::New
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
return autoPtr<GAMGProcAgglomeration>(cstrIter()(agglom, controlDict));
|
||||
return autoPtr<GAMGProcAgglomeration>(ctorPtr(agglom, controlDict));
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -38,9 +38,9 @@ Foam::autoPtr<Foam::GAMGInterfaceField> Foam::GAMGInterfaceField::New
|
||||
{
|
||||
const word coupleType(fineInterface.interfaceFieldType());
|
||||
|
||||
auto cstrIter = lduInterfaceFieldConstructorTablePtr_->cfind(coupleType);
|
||||
auto* ctorPtr = lduInterfaceFieldConstructorTable(coupleType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalErrorInLookup
|
||||
(
|
||||
@ -50,7 +50,7 @@ Foam::autoPtr<Foam::GAMGInterfaceField> Foam::GAMGInterfaceField::New
|
||||
) << exit(FatalError);
|
||||
}
|
||||
|
||||
return autoPtr<GAMGInterfaceField>(cstrIter()(GAMGCp, fineInterface));
|
||||
return autoPtr<GAMGInterfaceField>(ctorPtr(GAMGCp, fineInterface));
|
||||
}
|
||||
|
||||
|
||||
@ -63,9 +63,9 @@ Foam::autoPtr<Foam::GAMGInterfaceField> Foam::GAMGInterfaceField::New
|
||||
{
|
||||
const word coupleType(GAMGCp.type());
|
||||
|
||||
auto cstrIter = lduInterfaceConstructorTablePtr_->cfind(coupleType);
|
||||
auto* ctorPtr = lduInterfaceConstructorTable(coupleType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalErrorInLookup
|
||||
(
|
||||
@ -75,7 +75,7 @@ Foam::autoPtr<Foam::GAMGInterfaceField> Foam::GAMGInterfaceField::New
|
||||
) << exit(FatalError);
|
||||
}
|
||||
|
||||
return autoPtr<GAMGInterfaceField>(cstrIter()(GAMGCp, doTransform, rank));
|
||||
return autoPtr<GAMGInterfaceField>(ctorPtr(GAMGCp, doTransform, rank));
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -46,9 +46,9 @@ Foam::autoPtr<Foam::GAMGInterface> Foam::GAMGInterface::New
|
||||
{
|
||||
const word coupleType(fineInterface.type());
|
||||
|
||||
auto cstrIter = lduInterfaceConstructorTablePtr_->cfind(coupleType);
|
||||
auto* ctorPtr = lduInterfaceConstructorTable(coupleType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalErrorInLookup
|
||||
(
|
||||
@ -60,7 +60,7 @@ Foam::autoPtr<Foam::GAMGInterface> Foam::GAMGInterface::New
|
||||
|
||||
return autoPtr<GAMGInterface>
|
||||
(
|
||||
cstrIter()
|
||||
ctorPtr
|
||||
(
|
||||
index,
|
||||
coarseInterfaces,
|
||||
@ -82,9 +82,9 @@ Foam::autoPtr<Foam::GAMGInterface> Foam::GAMGInterface::New
|
||||
Istream& is
|
||||
)
|
||||
{
|
||||
auto cstrIter = IstreamConstructorTablePtr_->cfind(coupleType);
|
||||
auto* ctorPtr = IstreamConstructorTable(coupleType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalErrorInLookup
|
||||
(
|
||||
@ -94,7 +94,7 @@ Foam::autoPtr<Foam::GAMGInterface> Foam::GAMGInterface::New
|
||||
) << exit(FatalError);
|
||||
}
|
||||
|
||||
return autoPtr<GAMGInterface>(cstrIter()(index, coarseInterfaces, is));
|
||||
return autoPtr<GAMGInterface>(ctorPtr(index, coarseInterfaces, is));
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -38,9 +38,9 @@ Foam::autoPtr<Foam::facePointPatch> Foam::facePointPatch::New
|
||||
{
|
||||
DebugInFunction << "Constructing facePointPatch" << endl;
|
||||
|
||||
auto cstrIter = polyPatchConstructorTablePtr_->cfind(patch.type());
|
||||
auto* ctorPtr = polyPatchConstructorTable(patch.type());
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalErrorInLookup
|
||||
(
|
||||
@ -50,7 +50,7 @@ Foam::autoPtr<Foam::facePointPatch> Foam::facePointPatch::New
|
||||
) << exit(FatalError);
|
||||
}
|
||||
|
||||
return autoPtr<facePointPatch>(cstrIter()(patch, bm));
|
||||
return autoPtr<facePointPatch>(ctorPtr(patch, bm));
|
||||
}
|
||||
|
||||
|
||||
|
@ -276,21 +276,27 @@ Foam::polyPatch::~polyPatch()
|
||||
|
||||
bool Foam::polyPatch::constraintType(const word& pt)
|
||||
{
|
||||
return pointPatchField<scalar>::pointPatchConstructorTablePtr_->found(pt);
|
||||
return
|
||||
(
|
||||
pointPatchField<scalar>::pointPatchConstructorTablePtr_
|
||||
&& pointPatchField<scalar>::pointPatchConstructorTablePtr_->found(pt)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Foam::wordList Foam::polyPatch::constraintTypes()
|
||||
{
|
||||
wordList cTypes(dictionaryConstructorTablePtr_->size());
|
||||
const auto& cnstrTable = *dictionaryConstructorTablePtr_;
|
||||
|
||||
wordList cTypes(cnstrTable.size());
|
||||
|
||||
label i = 0;
|
||||
|
||||
forAllConstIters(*dictionaryConstructorTablePtr_, cstrIter)
|
||||
forAllConstIters(cnstrTable, iter)
|
||||
{
|
||||
if (constraintType(cstrIter.key()))
|
||||
if (constraintType(iter.key()))
|
||||
{
|
||||
cTypes[i++] = cstrIter.key();
|
||||
cTypes[i++] = iter.key();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -43,9 +43,9 @@ Foam::autoPtr<Foam::polyPatch> Foam::polyPatch::New
|
||||
{
|
||||
DebugInFunction << "Constructing polyPatch" << endl;
|
||||
|
||||
auto cstrIter = wordConstructorTablePtr_->cfind(patchType);
|
||||
auto* ctorPtr = wordConstructorTable(patchType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalErrorInLookup
|
||||
(
|
||||
@ -57,7 +57,7 @@ Foam::autoPtr<Foam::polyPatch> Foam::polyPatch::New
|
||||
|
||||
return autoPtr<polyPatch>
|
||||
(
|
||||
cstrIter()
|
||||
ctorPtr
|
||||
(
|
||||
name,
|
||||
size,
|
||||
@ -98,16 +98,16 @@ Foam::autoPtr<Foam::polyPatch> Foam::polyPatch::New
|
||||
{
|
||||
DebugInFunction << "Constructing polyPatch" << endl;
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(patchType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(patchType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
if (!disallowGenericPolyPatch)
|
||||
{
|
||||
cstrIter = dictionaryConstructorTablePtr_->cfind("genericPatch");
|
||||
ctorPtr = dictionaryConstructorTable("genericPatch");
|
||||
}
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -119,7 +119,7 @@ Foam::autoPtr<Foam::polyPatch> Foam::polyPatch::New
|
||||
}
|
||||
}
|
||||
|
||||
return autoPtr<polyPatch>(cstrIter()(name, dict, index, bm, patchType));
|
||||
return autoPtr<polyPatch>(ctorPtr(name, dict, index, bm, patchType));
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -43,9 +43,9 @@ Foam::autoPtr<Foam::cellZone> Foam::cellZone::New
|
||||
|
||||
const word zoneType(dict.get<word>("type"));
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(zoneType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(zoneType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -56,7 +56,7 @@ Foam::autoPtr<Foam::cellZone> Foam::cellZone::New
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return autoPtr<cellZone>(cstrIter()(name, dict, index, zm));
|
||||
return autoPtr<cellZone>(ctorPtr(name, dict, index, zm));
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -43,9 +43,9 @@ Foam::autoPtr<Foam::faceZone> Foam::faceZone::New
|
||||
|
||||
const word zoneType(dict.get<word>("type"));
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(zoneType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(zoneType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -56,7 +56,7 @@ Foam::autoPtr<Foam::faceZone> Foam::faceZone::New
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return autoPtr<faceZone>(cstrIter()(name, dict, index, zm));
|
||||
return autoPtr<faceZone>(ctorPtr(name, dict, index, zm));
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -43,9 +43,9 @@ Foam::autoPtr<Foam::pointZone> Foam::pointZone::New
|
||||
|
||||
const word zoneType(dict.get<word>("type"));
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(zoneType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(zoneType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -56,7 +56,7 @@ Foam::autoPtr<Foam::pointZone> Foam::pointZone::New
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return autoPtr<pointZone>(cstrIter()(name, dict, index, zm));
|
||||
return autoPtr<pointZone>(ctorPtr(name, dict, index, zm));
|
||||
}
|
||||
|
||||
|
||||
|
@ -123,9 +123,9 @@ Foam::Function1<Type>::New
|
||||
}
|
||||
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInFunction(dict)
|
||||
<< "Unknown Function1 type "
|
||||
@ -135,7 +135,7 @@ Foam::Function1<Type>::New
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
|
||||
return cstrIter()(entryName, *coeffs);
|
||||
return ctorPtr(entryName, *coeffs);
|
||||
}
|
||||
|
||||
|
||||
|
@ -163,9 +163,9 @@ Foam::LESModel<BasicTurbulenceModel>::New
|
||||
|
||||
Info<< "Selecting LES turbulence model " << modelType << endl;
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -178,7 +178,7 @@ Foam::LESModel<BasicTurbulenceModel>::New
|
||||
|
||||
return autoPtr<LESModel>
|
||||
(
|
||||
cstrIter()(alpha, rho, U, alphaRhoPhi, phi, transport, propertiesName)
|
||||
ctorPtr(alpha, rho, U, alphaRhoPhi, phi, transport, propertiesName)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -77,9 +77,9 @@ Foam::autoPtr<Foam::LESdelta> Foam::LESdelta::New
|
||||
|
||||
Info<< "Selecting LES " << lookupName << " type " << deltaType << endl;
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(deltaType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(deltaType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -90,7 +90,7 @@ Foam::autoPtr<Foam::LESdelta> Foam::LESdelta::New
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return autoPtr<LESdelta>(cstrIter()(name, turbulence, dict));
|
||||
return autoPtr<LESdelta>(ctorPtr(name, turbulence, dict));
|
||||
}
|
||||
|
||||
|
||||
@ -107,16 +107,19 @@ Foam::autoPtr<Foam::LESdelta> Foam::LESdelta::New
|
||||
|
||||
Info<< "Selecting LES " << lookupName << " type " << deltaType << endl;
|
||||
|
||||
// Additional ones first
|
||||
auto cstrIter = additionalConstructors.cfind(deltaType);
|
||||
|
||||
// Regular ones
|
||||
if (!cstrIter.found())
|
||||
// First any additional ones
|
||||
{
|
||||
cstrIter = dictionaryConstructorTablePtr_->cfind(deltaType);
|
||||
auto ctorIter = additionalConstructors.cfind(deltaType);
|
||||
|
||||
if (ctorIter.found())
|
||||
{
|
||||
return autoPtr<LESdelta>(ctorIter.val()(name, turbulence, dict));
|
||||
}
|
||||
}
|
||||
|
||||
if (!cstrIter.found())
|
||||
auto* ctorPtr = dictionaryConstructorTable(deltaType);
|
||||
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -126,7 +129,7 @@ Foam::autoPtr<Foam::LESdelta> Foam::LESdelta::New
|
||||
*dictionaryConstructorTablePtr_
|
||||
);
|
||||
|
||||
if (additionalConstructors.size())
|
||||
if (!additionalConstructors.empty())
|
||||
{
|
||||
FatalIOError
|
||||
<< " and " << additionalConstructors.sortedToc() << nl;
|
||||
@ -136,7 +139,7 @@ Foam::autoPtr<Foam::LESdelta> Foam::LESdelta::New
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
|
||||
return autoPtr<LESdelta>(cstrIter()(name, turbulence, dict));
|
||||
return autoPtr<LESdelta>(ctorPtr(name, turbulence, dict));
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -49,9 +49,9 @@ Foam::autoPtr<Foam::LESfilter> Foam::LESfilter::New
|
||||
{
|
||||
const word filterType(dict.get<word>(filterDictName));
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(filterType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(filterType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -62,7 +62,7 @@ Foam::autoPtr<Foam::LESfilter> Foam::LESfilter::New
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return autoPtr<LESfilter>(cstrIter()(mesh, dict));
|
||||
return autoPtr<LESfilter>(ctorPtr(mesh, dict));
|
||||
}
|
||||
|
||||
|
||||
|
@ -145,9 +145,9 @@ Foam::RASModel<BasicTurbulenceModel>::New
|
||||
|
||||
Info<< "Selecting RAS turbulence model " << modelType << endl;
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -160,7 +160,7 @@ Foam::RASModel<BasicTurbulenceModel>::New
|
||||
|
||||
return autoPtr<RASModel>
|
||||
(
|
||||
cstrIter()(alpha, rho, U, alphaRhoPhi, phi, transport, propertiesName)
|
||||
ctorPtr(alpha, rho, U, alphaRhoPhi, phi, transport, propertiesName)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2013-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -105,9 +105,9 @@ Foam::TurbulenceModel<Alpha, Rho, BasicTurbulenceModel, TransportModel>::New
|
||||
|
||||
Info<< "Selecting turbulence model type " << modelType << endl;
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -120,7 +120,7 @@ Foam::TurbulenceModel<Alpha, Rho, BasicTurbulenceModel, TransportModel>::New
|
||||
|
||||
return autoPtr<TurbulenceModel>
|
||||
(
|
||||
cstrIter()(alpha, rho, U, alphaRhoPhi, phi, transport, propertiesName)
|
||||
ctorPtr(alpha, rho, U, alphaRhoPhi, phi, transport, propertiesName)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2018-2020 OpenFOAM Foundation
|
||||
Copyright (C) 2020 OpenCFD Ltd.
|
||||
Copyright (C) 2020-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -40,9 +40,9 @@ Foam::laminarModels::generalizedNewtonianViscosityModel::New
|
||||
|
||||
Info<< "Selecting generalized Newtonian model " << modelType << endl;
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->find(modelType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -53,7 +53,7 @@ Foam::laminarModels::generalizedNewtonianViscosityModel::New
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return autoPtr<generalizedNewtonianViscosityModel>(cstrIter()(dict));
|
||||
return autoPtr<generalizedNewtonianViscosityModel>(ctorPtr(dict));
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -120,9 +120,9 @@ Foam::laminarModel<BasicTurbulenceModel>::New
|
||||
|
||||
Info<< "Selecting laminar stress model " << modelType << endl;
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -135,7 +135,7 @@ Foam::laminarModel<BasicTurbulenceModel>::New
|
||||
|
||||
return autoPtr<laminarModel>
|
||||
(
|
||||
cstrIter()
|
||||
ctorPtr
|
||||
(
|
||||
alpha,
|
||||
rho,
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -45,9 +45,9 @@ Foam::autoPtr<Foam::reactionRateFlameArea> Foam::reactionRateFlameArea::New
|
||||
Info<< "Selecting reaction rate flame area correlation "
|
||||
<< modelType << endl;
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -61,7 +61,7 @@ Foam::autoPtr<Foam::reactionRateFlameArea> Foam::reactionRateFlameArea::New
|
||||
const word className = modelType.substr(0, modelType.find('<'));
|
||||
|
||||
return autoPtr<reactionRateFlameArea>
|
||||
(cstrIter()(className, dict, mesh, combModel));
|
||||
(ctorPtr(className, dict, mesh, combModel));
|
||||
}
|
||||
|
||||
|
||||
|
@ -186,7 +186,7 @@ Foam::autoPtr<CombustionModel> Foam::combustionModel::New
|
||||
|
||||
return autoPtr<CombustionModel>
|
||||
(
|
||||
ctorIter()(combModelName, thermo, turb, combustionProperties)
|
||||
ctorIter.val()(combModelName, thermo, turb, combustionProperties)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -72,9 +72,8 @@ Foam::autoPtr<Foam::dynamicFvMesh> Foam::dynamicFvMesh::New(const IOobject& io)
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
auto doInitCstrIter = doInitConstructorTablePtr_->cfind(modelType);
|
||||
|
||||
if (doInitCstrIter.found())
|
||||
auto* doInitCtor = doInitConstructorTable(modelType);
|
||||
if (doInitCtor)
|
||||
{
|
||||
DebugInfo
|
||||
<< "Constructing dynamicFvMesh with explicit initialisation"
|
||||
@ -82,7 +81,7 @@ Foam::autoPtr<Foam::dynamicFvMesh> Foam::dynamicFvMesh::New(const IOobject& io)
|
||||
|
||||
// Two-step constructor
|
||||
// 1. Construct mesh, do not initialise
|
||||
autoPtr<dynamicFvMesh> meshPtr(doInitCstrIter()(io, false));
|
||||
autoPtr<dynamicFvMesh> meshPtr(doInitCtor(io, false));
|
||||
|
||||
// 2. Initialise parents and itself
|
||||
meshPtr().init(true);
|
||||
@ -90,9 +89,9 @@ Foam::autoPtr<Foam::dynamicFvMesh> Foam::dynamicFvMesh::New(const IOobject& io)
|
||||
return meshPtr;
|
||||
}
|
||||
|
||||
auto cstrIter = IOobjectConstructorTablePtr_->cfind(modelType);
|
||||
auto* ctorPtr = IOobjectConstructorTable(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -103,7 +102,7 @@ Foam::autoPtr<Foam::dynamicFvMesh> Foam::dynamicFvMesh::New(const IOobject& io)
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return autoPtr<dynamicFvMesh>(cstrIter()(io));
|
||||
return autoPtr<dynamicFvMesh>(ctorPtr(io));
|
||||
}
|
||||
|
||||
DebugInfo
|
||||
|
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2018 OpenCFD Ltd.
|
||||
Copyright (C) 2018-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -64,12 +64,12 @@ Foam::simplifiedMeshes::simplifiedDynamicFvMeshBase::New
|
||||
|
||||
const word modelType(dict.get<word>("dynamicFvMesh"));
|
||||
|
||||
auto cstrIter = timeConstructorTablePtr_->cfind(modelType);
|
||||
auto* ctorPtr = timeConstructorTable(modelType);
|
||||
|
||||
if (cstrIter.found())
|
||||
if (ctorPtr)
|
||||
{
|
||||
Info<< "Selecting simplified mesh model " << modelType << endl;
|
||||
return autoPtr<dynamicFvMesh>(cstrIter()(io.time(), io.name()));
|
||||
return autoPtr<dynamicFvMesh>(ctorPtr(io.time(), io.name()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -48,9 +48,9 @@ Foam::autoPtr<Foam::cellLooper> Foam::cellLooper::New
|
||||
const polyMesh& mesh
|
||||
)
|
||||
{
|
||||
auto cstrIter = wordConstructorTablePtr_->cfind(type);
|
||||
auto* ctorPtr = wordConstructorTable(type);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalErrorInLookup
|
||||
(
|
||||
@ -60,7 +60,7 @@ Foam::autoPtr<Foam::cellLooper> Foam::cellLooper::New
|
||||
) << exit(FatalError);
|
||||
}
|
||||
|
||||
return autoPtr<cellLooper>(cstrIter()(mesh));
|
||||
return autoPtr<cellLooper>(ctorPtr(mesh));
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2016-2019 OpenCFD Ltd.
|
||||
Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -108,9 +108,9 @@ Foam::displacementMotionSolver::New
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
auto cstrIter = displacementConstructorTablePtr_->cfind(solverTypeName);
|
||||
auto* ctorPtr = displacementConstructorTable(solverTypeName);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -123,7 +123,7 @@ Foam::displacementMotionSolver::New
|
||||
|
||||
return autoPtr<displacementMotionSolver>
|
||||
(
|
||||
cstrIter()
|
||||
ctorPtr
|
||||
(
|
||||
mesh,
|
||||
solverDict,
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -40,9 +40,9 @@ Foam::autoPtr<Foam::solidBodyMotionFunction> Foam::solidBodyMotionFunction::New
|
||||
|
||||
Info<< "Selecting solid-body motion function " << motionType << endl;
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(motionType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(motionType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -53,7 +53,7 @@ Foam::autoPtr<Foam::solidBodyMotionFunction> Foam::solidBodyMotionFunction::New
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return autoPtr<solidBodyMotionFunction>(cstrIter()(dict, runTime));
|
||||
return autoPtr<solidBodyMotionFunction>(ctorPtr(dict, runTime));
|
||||
}
|
||||
|
||||
|
||||
|
@ -130,9 +130,9 @@ Foam::autoPtr<Foam::motionSolver> Foam::motionSolver::New
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(solverName);
|
||||
auto* ctorPtr = dictionaryConstructorTable(solverName);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -143,7 +143,7 @@ Foam::autoPtr<Foam::motionSolver> Foam::motionSolver::New
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return autoPtr<motionSolver>(cstrIter()(mesh, solverDict));
|
||||
return autoPtr<motionSolver>(ctorPtr(mesh, solverDict));
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -43,9 +43,9 @@ Foam::autoPtr<Foam::polyMeshModifier> Foam::polyMeshModifier::New
|
||||
|
||||
const word modelType(dict.get<word>("type"));
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -56,7 +56,7 @@ Foam::autoPtr<Foam::polyMeshModifier> Foam::polyMeshModifier::New
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return autoPtr<polyMeshModifier>(cstrIter()(name, dict, index, mme));
|
||||
return autoPtr<polyMeshModifier>(ctorPtr(name, dict, index, mme));
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -50,9 +50,9 @@ Foam::autoPtr<Foam::engineMesh> Foam::engineMesh::New(const IOobject& io)
|
||||
|
||||
Info<< "Selecting engineMesh " << modelType << endl;
|
||||
|
||||
auto cstrIter = IOobjectConstructorTablePtr_->cfind(modelType);
|
||||
auto* ctorPtr = IOobjectConstructorTable(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -63,7 +63,7 @@ Foam::autoPtr<Foam::engineMesh> Foam::engineMesh::New(const IOobject& io)
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return autoPtr<engineMesh>(cstrIter()(io));
|
||||
return autoPtr<engineMesh>(ctorPtr(io));
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -52,9 +52,9 @@ Foam::autoPtr<Foam::engineTime> Foam::engineTime::New
|
||||
|
||||
Info<< "Selecting engine type " << engineType << endl;
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(engineType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(engineType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -67,7 +67,7 @@ Foam::autoPtr<Foam::engineTime> Foam::engineTime::New
|
||||
|
||||
return autoPtr<engineTime>
|
||||
(
|
||||
cstrIter()
|
||||
ctorPtr
|
||||
(
|
||||
name,
|
||||
rootPath,
|
||||
|
@ -98,9 +98,9 @@ Foam::autoPtr<Foam::fa::option> Foam::fa::option::New
|
||||
dictionaryConstructorTablePtr_
|
||||
);
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unknown faOption model type "
|
||||
@ -110,7 +110,7 @@ Foam::autoPtr<Foam::fa::option> Foam::fa::option::New
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
return autoPtr<option>(cstrIter()(name, modelType, coeffs, patch));
|
||||
return autoPtr<option>(ctorPtr(name, modelType, coeffs, patch));
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -39,9 +39,9 @@ Foam::autoPtr<Foam::writer<Type>> Foam::writer<Type>::New
|
||||
const word& writeType
|
||||
)
|
||||
{
|
||||
auto cstrIter = wordConstructorTablePtr_->cfind(writeType);
|
||||
auto* ctorPtr = wordConstructorTable(writeType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalErrorInLookup
|
||||
(
|
||||
@ -51,7 +51,7 @@ Foam::autoPtr<Foam::writer<Type>> Foam::writer<Type>::New
|
||||
) << exit(FatalError);
|
||||
}
|
||||
|
||||
return autoPtr<writer<Type>>(cstrIter()());
|
||||
return autoPtr<writer<Type>>(ctorPtr());
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 Wikki Ltd
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -43,9 +43,9 @@ Foam::autoPtr<Foam::faPatch> Foam::faPatch::New
|
||||
|
||||
const word patchType(dict.get<word>("type"));
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(patchType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(patchType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -56,7 +56,7 @@ Foam::autoPtr<Foam::faPatch> Foam::faPatch::New
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return autoPtr<faPatch>(cstrIter()(name, dict, index, bm));
|
||||
return autoPtr<faPatch>(ctorPtr(name, dict, index, bm));
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 Wikki Ltd
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -103,12 +104,11 @@ Foam::tmp<Foam::faPatchField<Type>> Foam::faPatchField<Type>::NewCalculatedType
|
||||
const faPatchField<Type2>& pf
|
||||
)
|
||||
{
|
||||
auto patchTypeCstrIter =
|
||||
patchConstructorTablePtr_->cfind(pf.patch().type());
|
||||
auto* patchTypeCtor = patchConstructorTable(pf.patch().type());
|
||||
|
||||
if (patchTypeCstrIter.found())
|
||||
if (patchTypeCtor)
|
||||
{
|
||||
return patchTypeCstrIter()
|
||||
return patchTypeCtor
|
||||
(
|
||||
pf.patch(),
|
||||
DimensionedField<Type, areaMesh>::null()
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 Wikki Ltd
|
||||
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -44,9 +44,9 @@ Foam::tmp<Foam::faPatchField<Type>> Foam::faPatchField<Type>::New
|
||||
<< "p.Type():" << p.type()
|
||||
<< endl;
|
||||
|
||||
auto cstrIter = patchConstructorTablePtr_->cfind(patchFieldType);
|
||||
auto* ctorPtr = patchConstructorTable(patchFieldType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalErrorInLookup
|
||||
(
|
||||
@ -56,7 +56,7 @@ Foam::tmp<Foam::faPatchField<Type>> Foam::faPatchField<Type>::New
|
||||
) << exit(FatalError);
|
||||
}
|
||||
|
||||
auto patchTypeCstrIter = patchConstructorTablePtr_->cfind(p.type());
|
||||
auto* patchTypeCtor = patchConstructorTable(p.type());
|
||||
|
||||
if
|
||||
(
|
||||
@ -64,21 +64,21 @@ Foam::tmp<Foam::faPatchField<Type>> Foam::faPatchField<Type>::New
|
||||
|| actualPatchType != p.type()
|
||||
)
|
||||
{
|
||||
if (patchTypeCstrIter.found())
|
||||
if (patchTypeCtor)
|
||||
{
|
||||
return patchTypeCstrIter()(p, iF);
|
||||
return patchTypeCtor(p, iF);
|
||||
}
|
||||
else
|
||||
{
|
||||
return cstrIter()(p, iF);
|
||||
return ctorPtr(p, iF);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
tmp<faPatchField<Type>> tfap = cstrIter()(p, iF);
|
||||
tmp<faPatchField<Type>> tfap = ctorPtr(p, iF);
|
||||
|
||||
// Check if constraint type override and store patchType if so
|
||||
if (patchTypeCstrIter.found())
|
||||
if (patchTypeCtor)
|
||||
{
|
||||
tfap.ref().patchType() = actualPatchType;
|
||||
}
|
||||
@ -110,16 +110,16 @@ Foam::tmp<Foam::faPatchField<Type>> Foam::faPatchField<Type>::New
|
||||
|
||||
const word patchFieldType(dict.get<word>("type"));
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(patchFieldType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(patchFieldType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
if (!disallowGenericFaPatchField)
|
||||
{
|
||||
cstrIter = dictionaryConstructorTablePtr_->cfind("generic");
|
||||
ctorPtr = dictionaryConstructorTable("generic");
|
||||
}
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInFunction(dict)
|
||||
<< "Unknown patchField type " << patchFieldType
|
||||
@ -130,9 +130,9 @@ Foam::tmp<Foam::faPatchField<Type>> Foam::faPatchField<Type>::New
|
||||
}
|
||||
}
|
||||
|
||||
auto patchTypeCstrIter = dictionaryConstructorTablePtr_->cfind(p.type());
|
||||
auto* patchTypeCtor = dictionaryConstructorTable(p.type());
|
||||
|
||||
if (patchTypeCstrIter.found() && *patchTypeCstrIter != *cstrIter)
|
||||
if (patchTypeCtor && patchTypeCtor != ctorPtr)
|
||||
{
|
||||
FatalIOErrorInFunction(dict)
|
||||
<< "inconsistent patch and patchField types for \n"
|
||||
@ -141,7 +141,7 @@ Foam::tmp<Foam::faPatchField<Type>> Foam::faPatchField<Type>::New
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
|
||||
return cstrIter()(p, iF, dict);
|
||||
return ctorPtr(p, iF, dict);
|
||||
}
|
||||
|
||||
|
||||
@ -156,9 +156,9 @@ Foam::tmp<Foam::faPatchField<Type>> Foam::faPatchField<Type>::New
|
||||
{
|
||||
DebugInFunction << "Constructing faPatchField<Type>" << endl;
|
||||
|
||||
auto cstrIter = patchMapperConstructorTablePtr_->cfind(ptf.type());
|
||||
auto* ctorPtr = patchMapperConstructorTable(ptf.type());
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalErrorInLookup
|
||||
(
|
||||
@ -168,14 +168,14 @@ Foam::tmp<Foam::faPatchField<Type>> Foam::faPatchField<Type>::New
|
||||
) << exit(FatalError);
|
||||
}
|
||||
|
||||
auto patchTypeCstrIter = patchMapperConstructorTablePtr_->cfind(p.type());
|
||||
auto* patchTypeCtor = patchMapperConstructorTable(p.type());
|
||||
|
||||
if (patchTypeCstrIter.found())
|
||||
if (patchTypeCtor)
|
||||
{
|
||||
return patchTypeCstrIter()(ptf, p, iF, pfMapper);
|
||||
return patchTypeCtor(ptf, p, iF, pfMapper);
|
||||
}
|
||||
|
||||
return cstrIter()(ptf, p, iF, pfMapper);
|
||||
return ctorPtr(ptf, p, iF, pfMapper);
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 Wikki Ltd
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -103,12 +104,11 @@ Foam::faePatchField<Type>::NewCalculatedType
|
||||
const faePatchField<Type2>& pf
|
||||
)
|
||||
{
|
||||
auto patchTypeCstrIter =
|
||||
patchConstructorTablePtr_->cfind(pf.patch().type());
|
||||
auto* patchTypeCtor = patchConstructorTable(pf.patch().type());
|
||||
|
||||
if (patchTypeCstrIter.found())
|
||||
if (patchTypeCtor)
|
||||
{
|
||||
return patchTypeCstrIter()
|
||||
return patchTypeCtor
|
||||
(
|
||||
pf.patch(),
|
||||
DimensionedField<Type, edgeMesh>::null()
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 Wikki Ltd
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -38,9 +38,9 @@ Foam::tmp<Foam::faePatchField<Type>> Foam::faePatchField<Type>::New
|
||||
{
|
||||
DebugInFunction << "Constructing faePatchField" << endl;
|
||||
|
||||
auto cstrIter = patchConstructorTablePtr_->cfind(patchFieldType);
|
||||
auto* ctorPtr = patchConstructorTable(patchFieldType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalErrorInLookup
|
||||
(
|
||||
@ -50,15 +50,15 @@ Foam::tmp<Foam::faePatchField<Type>> Foam::faePatchField<Type>::New
|
||||
) << exit(FatalError);
|
||||
}
|
||||
|
||||
auto patchTypeCstrIter = patchConstructorTablePtr_->cfind(p.type());
|
||||
auto* patchTypeCtor = patchConstructorTable(p.type());
|
||||
|
||||
if (patchTypeCstrIter.found())
|
||||
if (patchTypeCtor)
|
||||
{
|
||||
return patchTypeCstrIter()(p, iF);
|
||||
return patchTypeCtor(p, iF);
|
||||
}
|
||||
else
|
||||
{
|
||||
return cstrIter()(p, iF);
|
||||
return ctorPtr(p, iF);
|
||||
}
|
||||
}
|
||||
|
||||
@ -75,16 +75,16 @@ Foam::tmp<Foam::faePatchField<Type>> Foam::faePatchField<Type>::New
|
||||
|
||||
const word patchFieldType(dict.get<word>("type"));
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(patchFieldType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(patchFieldType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
if (!disallowGenericFaePatchField)
|
||||
{
|
||||
cstrIter = dictionaryConstructorTablePtr_->cfind("generic");
|
||||
ctorPtr = dictionaryConstructorTable("generic");
|
||||
}
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInFunction(dict)
|
||||
<< "Unknown patchField type " << patchFieldType
|
||||
@ -95,9 +95,9 @@ Foam::tmp<Foam::faePatchField<Type>> Foam::faePatchField<Type>::New
|
||||
}
|
||||
}
|
||||
|
||||
auto patchTypeCstrIter = dictionaryConstructorTablePtr_->cfind(p.type());
|
||||
auto* patchTypeCtor = dictionaryConstructorTable(p.type());
|
||||
|
||||
if (patchTypeCstrIter.found() && *patchTypeCstrIter != *cstrIter)
|
||||
if (patchTypeCtor && patchTypeCtor != ctorPtr)
|
||||
{
|
||||
FatalIOErrorInFunction(dict)
|
||||
<< "inconsistent patch and patchField types for \n"
|
||||
@ -106,7 +106,7 @@ Foam::tmp<Foam::faePatchField<Type>> Foam::faePatchField<Type>::New
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
|
||||
return cstrIter()(p, iF, dict);
|
||||
return ctorPtr(p, iF, dict);
|
||||
}
|
||||
|
||||
|
||||
@ -121,9 +121,9 @@ Foam::tmp<Foam::faePatchField<Type>> Foam::faePatchField<Type>::New
|
||||
{
|
||||
DebugInFunction << "Constructing faePatchField<Type>" << endl;
|
||||
|
||||
auto cstrIter = patchMapperConstructorTablePtr_->cfind(ptf.type());
|
||||
auto* ctorPtr = patchMapperConstructorTable(ptf.type());
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalErrorInLookup
|
||||
(
|
||||
@ -133,14 +133,14 @@ Foam::tmp<Foam::faePatchField<Type>> Foam::faePatchField<Type>::New
|
||||
) << exit(FatalError);
|
||||
}
|
||||
|
||||
auto patchTypeCstrIter = patchMapperConstructorTablePtr_->cfind(p.type());
|
||||
auto* patchTypeCtor = patchMapperConstructorTable(p.type());
|
||||
|
||||
if (patchTypeCstrIter.found())
|
||||
if (patchTypeCtor)
|
||||
{
|
||||
return patchTypeCstrIter()(ptf, p, iF, pfMapper);
|
||||
return patchTypeCtor(ptf, p, iF, pfMapper);
|
||||
}
|
||||
|
||||
return cstrIter()(ptf, p, iF, pfMapper);
|
||||
return ctorPtr(ptf, p, iF, pfMapper);
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 Wikki Ltd
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -58,9 +58,9 @@ Foam::fa::convectionScheme<Type>::New
|
||||
|
||||
const word schemeName(schemeData);
|
||||
|
||||
auto cstrIter = IstreamConstructorTablePtr_->cfind(schemeName);
|
||||
auto* ctorPtr = IstreamConstructorTable(schemeName);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -71,7 +71,7 @@ Foam::fa::convectionScheme<Type>::New
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return cstrIter()(mesh, faceFlux, schemeData);
|
||||
return ctorPtr(mesh, faceFlux, schemeData);
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017 Volkswagen AG
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -68,9 +68,9 @@ tmp<faD2dt2Scheme<Type>> faD2dt2Scheme<Type>::New
|
||||
|
||||
const word schemeName(schemeData);
|
||||
|
||||
auto cstrIter = IstreamConstructorTablePtr_->cfind(schemeName);
|
||||
auto* ctorPtr = IstreamConstructorTable(schemeName);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -81,7 +81,7 @@ tmp<faD2dt2Scheme<Type>> faD2dt2Scheme<Type>::New
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return cstrIter()(mesh, schemeData);
|
||||
return ctorPtr(mesh, schemeData);
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 Wikki Ltd
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -66,9 +66,9 @@ tmp<faDdtScheme<Type>> faDdtScheme<Type>::New
|
||||
|
||||
const word schemeName(schemeData);
|
||||
|
||||
auto cstrIter = IstreamConstructorTablePtr_->cfind(schemeName);
|
||||
auto* ctorPtr = IstreamConstructorTable(schemeName);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -79,7 +79,7 @@ tmp<faDdtScheme<Type>> faDdtScheme<Type>::New
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return cstrIter()(mesh, schemeData);
|
||||
return ctorPtr(mesh, schemeData);
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 Wikki Ltd
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -67,9 +67,9 @@ tmp<divScheme<Type>> divScheme<Type>::New
|
||||
|
||||
const word schemeName(schemeData);
|
||||
|
||||
auto cstrIter = IstreamConstructorTablePtr_->cfind(schemeName);
|
||||
auto* ctorPtr = IstreamConstructorTable(schemeName);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -80,7 +80,7 @@ tmp<divScheme<Type>> divScheme<Type>::New
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return cstrIter()(mesh, schemeData);
|
||||
return ctorPtr(mesh, schemeData);
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 Wikki Ltd
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -66,9 +66,9 @@ tmp<gradScheme<Type>> gradScheme<Type>::New
|
||||
|
||||
const word schemeName(schemeData);
|
||||
|
||||
auto cstrIter = IstreamConstructorTablePtr_->cfind(schemeName);
|
||||
auto* ctorPtr = IstreamConstructorTable(schemeName);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -79,7 +79,7 @@ tmp<gradScheme<Type>> gradScheme<Type>::New
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return cstrIter()(mesh, schemeData);
|
||||
return ctorPtr(mesh, schemeData);
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 Wikki Ltd
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -67,9 +67,9 @@ tmp<laplacianScheme<Type>> laplacianScheme<Type>::New
|
||||
|
||||
const word schemeName(schemeData);
|
||||
|
||||
auto cstrIter = IstreamConstructorTablePtr_->cfind(schemeName);
|
||||
auto* ctorPtr = IstreamConstructorTable(schemeName);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -80,7 +80,7 @@ tmp<laplacianScheme<Type>> laplacianScheme<Type>::New
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return cstrIter()(mesh, schemeData);
|
||||
return ctorPtr(mesh, schemeData);
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 Wikki Ltd
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -69,9 +69,9 @@ tmp<lnGradScheme<Type>> lnGradScheme<Type>::New
|
||||
|
||||
const word schemeName(schemeData);
|
||||
|
||||
auto cstrIter = MeshConstructorTablePtr_->cfind(schemeName);
|
||||
auto* ctorPtr = MeshConstructorTable(schemeName);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -82,7 +82,7 @@ tmp<lnGradScheme<Type>> lnGradScheme<Type>::New
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return cstrIter()(mesh, schemeData);
|
||||
return ctorPtr(mesh, schemeData);
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 Wikki Ltd
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -61,9 +61,9 @@ Foam::edgeInterpolationScheme<Type>::New
|
||||
|
||||
const word schemeName(schemeData);
|
||||
|
||||
auto cstrIter = MeshConstructorTablePtr_->cfind(schemeName);
|
||||
auto* ctorPtr = MeshConstructorTable(schemeName);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -74,7 +74,7 @@ Foam::edgeInterpolationScheme<Type>::New
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return cstrIter()(mesh, schemeData);
|
||||
return ctorPtr(mesh, schemeData);
|
||||
}
|
||||
|
||||
|
||||
@ -106,9 +106,9 @@ Foam::edgeInterpolationScheme<Type>::New
|
||||
|
||||
const word schemeName(schemeData);
|
||||
|
||||
auto cstrIter = MeshFluxConstructorTablePtr_->cfind(schemeName);
|
||||
auto* ctorPtr = MeshFluxConstructorTable(schemeName);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -119,7 +119,7 @@ Foam::edgeInterpolationScheme<Type>::New
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return cstrIter()(mesh, faceFlux, schemeData);
|
||||
return ctorPtr(mesh, faceFlux, schemeData);
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -52,9 +52,9 @@ Foam::autoPtr<Foam::SRF::SRFModel> Foam::SRF::SRFModel::New
|
||||
|
||||
Info<< "Selecting SRFModel " << modelType << endl;
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -65,7 +65,7 @@ Foam::autoPtr<Foam::SRF::SRFModel> Foam::SRF::SRFModel::New
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return autoPtr<SRFModel>(cstrIter()(Urel));
|
||||
return autoPtr<SRFModel>(ctorPtr(Urel));
|
||||
}
|
||||
|
||||
|
||||
|
@ -97,9 +97,9 @@ Foam::autoPtr<Foam::fv::option> Foam::fv::option::New
|
||||
dictionaryConstructorTablePtr_
|
||||
);
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -110,7 +110,7 @@ Foam::autoPtr<Foam::fv::option> Foam::fv::option::New
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return autoPtr<fv::option>(cstrIter()(name, modelType, coeffs, mesh));
|
||||
return autoPtr<fv::option>(ctorPtr(name, modelType, coeffs, mesh));
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -43,9 +43,9 @@ Foam::autoPtr<Foam::porosityModel> Foam::porosityModel::New
|
||||
Info<< "Porosity region " << name << ":" << nl
|
||||
<< " selecting model: " << modelType << endl;
|
||||
|
||||
auto cstrIter = meshConstructorTablePtr_->cfind(modelType);
|
||||
auto* ctorPtr = meshConstructorTable(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -58,7 +58,7 @@ Foam::autoPtr<Foam::porosityModel> Foam::porosityModel::New
|
||||
|
||||
return autoPtr<porosityModel>
|
||||
(
|
||||
cstrIter()
|
||||
ctorPtr
|
||||
(
|
||||
name,
|
||||
modelType,
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2010-2018 Bernhard Gschaider
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -53,9 +53,9 @@ Foam::expressions::fvExprDriver::New
|
||||
{
|
||||
const word driverType(dict.get<word>("valueType"));
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(driverType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(driverType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -70,7 +70,7 @@ Foam::expressions::fvExprDriver::New
|
||||
|
||||
resetDefaultMesh(mesh, false); // lazy
|
||||
|
||||
return autoPtr<fvExprDriver>(cstrIter()(dict, mesh));
|
||||
return autoPtr<fvExprDriver>(ctorPtr(dict, mesh));
|
||||
}
|
||||
|
||||
|
||||
@ -82,9 +82,9 @@ Foam::expressions::fvExprDriver::New
|
||||
const fvMesh& mesh
|
||||
)
|
||||
{
|
||||
auto cstrIter = idNameConstructorTablePtr_->cfind(driverType);
|
||||
auto* ctorPtr = idNameConstructorTable(driverType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalErrorInLookup
|
||||
(
|
||||
@ -98,7 +98,7 @@ Foam::expressions::fvExprDriver::New
|
||||
|
||||
resetDefaultMesh(mesh, false); // lazy
|
||||
|
||||
return autoPtr<fvExprDriver>(cstrIter()(id, mesh));
|
||||
return autoPtr<fvExprDriver>(ctorPtr(id, mesh));
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -104,11 +105,11 @@ Foam::fvPatchField<Type>::NewCalculatedType
|
||||
const fvPatch& p
|
||||
)
|
||||
{
|
||||
auto patchTypeCstrIter = patchConstructorTablePtr_->cfind(p.type());
|
||||
auto* patchTypeCtor = patchConstructorTable(p.type());
|
||||
|
||||
if (patchTypeCstrIter.found())
|
||||
if (patchTypeCtor)
|
||||
{
|
||||
return patchTypeCstrIter()
|
||||
return patchTypeCtor
|
||||
(
|
||||
p,
|
||||
DimensionedField<Type, volMesh>::null()
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -41,9 +41,9 @@ Foam::tmp<Foam::fvPatchField<Type>> Foam::fvPatchField<Type>::New
|
||||
<< "patchFieldType = " << patchFieldType
|
||||
<< " : " << p.type() << nl;
|
||||
|
||||
auto cstrIter = patchConstructorTablePtr_->cfind(patchFieldType);
|
||||
auto* ctorPtr = patchConstructorTable(patchFieldType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalErrorInLookup
|
||||
(
|
||||
@ -53,7 +53,7 @@ Foam::tmp<Foam::fvPatchField<Type>> Foam::fvPatchField<Type>::New
|
||||
) << exit(FatalError);
|
||||
}
|
||||
|
||||
auto patchTypeCstrIter = patchConstructorTablePtr_->cfind(p.type());
|
||||
auto* patchTypeCtor = patchConstructorTable(p.type());
|
||||
|
||||
if
|
||||
(
|
||||
@ -61,21 +61,21 @@ Foam::tmp<Foam::fvPatchField<Type>> Foam::fvPatchField<Type>::New
|
||||
|| actualPatchType != p.type()
|
||||
)
|
||||
{
|
||||
if (patchTypeCstrIter.found())
|
||||
if (patchTypeCtor)
|
||||
{
|
||||
return patchTypeCstrIter()(p, iF);
|
||||
return patchTypeCtor(p, iF);
|
||||
}
|
||||
else
|
||||
{
|
||||
return cstrIter()(p, iF);
|
||||
return ctorPtr(p, iF);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
tmp<fvPatchField<Type>> tfvp = cstrIter()(p, iF);
|
||||
tmp<fvPatchField<Type>> tfvp = ctorPtr(p, iF);
|
||||
|
||||
// Check if constraint type override and store patchType if so
|
||||
if (patchTypeCstrIter.found())
|
||||
if (patchTypeCtor)
|
||||
{
|
||||
tfvp.ref().patchType() = actualPatchType;
|
||||
}
|
||||
@ -108,16 +108,16 @@ Foam::tmp<Foam::fvPatchField<Type>> Foam::fvPatchField<Type>::New
|
||||
DebugInFunction
|
||||
<< "patchFieldType = " << patchFieldType << nl;
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(patchFieldType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(patchFieldType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
if (!disallowGenericFvPatchField)
|
||||
{
|
||||
cstrIter = dictionaryConstructorTablePtr_->cfind("generic");
|
||||
ctorPtr = dictionaryConstructorTable("generic");
|
||||
}
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInFunction(dict)
|
||||
<< "Unknown patchField type " << patchFieldType
|
||||
@ -134,10 +134,9 @@ Foam::tmp<Foam::fvPatchField<Type>> Foam::fvPatchField<Type>::New
|
||||
|| dict.get<word>("patchType") != p.type()
|
||||
)
|
||||
{
|
||||
auto patchTypeCstrIter
|
||||
= dictionaryConstructorTablePtr_->cfind(p.type());
|
||||
auto* patchTypeCtor = dictionaryConstructorTable(p.type());
|
||||
|
||||
if (patchTypeCstrIter.found() && patchTypeCstrIter() != cstrIter())
|
||||
if (patchTypeCtor && patchTypeCtor != ctorPtr)
|
||||
{
|
||||
FatalIOErrorInFunction(dict)
|
||||
<< "inconsistent patch and patchField types for\n"
|
||||
@ -147,7 +146,7 @@ Foam::tmp<Foam::fvPatchField<Type>> Foam::fvPatchField<Type>::New
|
||||
}
|
||||
}
|
||||
|
||||
return cstrIter()(p, iF, dict);
|
||||
return ctorPtr(p, iF, dict);
|
||||
}
|
||||
|
||||
|
||||
@ -163,9 +162,9 @@ Foam::tmp<Foam::fvPatchField<Type>> Foam::fvPatchField<Type>::New
|
||||
DebugInFunction
|
||||
<< "Constructing fvPatchField<Type>" << nl;
|
||||
|
||||
auto cstrIter = patchMapperConstructorTablePtr_->cfind(ptf.type());
|
||||
auto* ctorPtr = patchMapperConstructorTable(ptf.type());
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalErrorInLookup
|
||||
(
|
||||
@ -175,7 +174,7 @@ Foam::tmp<Foam::fvPatchField<Type>> Foam::fvPatchField<Type>::New
|
||||
) << exit(FatalError);
|
||||
}
|
||||
|
||||
return cstrIter()(ptf, p, iF, pfMapper);
|
||||
return ctorPtr(ptf, p, iF, pfMapper);
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -102,11 +103,11 @@ Foam::fvsPatchField<Type>::NewCalculatedType
|
||||
const fvPatch& p
|
||||
)
|
||||
{
|
||||
auto patchTypeCstrIter = patchConstructorTablePtr_->cfind(p.type());
|
||||
auto* patchTypeCtor = patchConstructorTable(p.type());
|
||||
|
||||
if (patchTypeCstrIter.found())
|
||||
if (patchTypeCtor)
|
||||
{
|
||||
return patchTypeCstrIter()
|
||||
return patchTypeCtor
|
||||
(
|
||||
p,
|
||||
DimensionedField<Type, surfaceMesh>::null()
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -39,9 +39,9 @@ Foam::tmp<Foam::fvsPatchField<Type>> Foam::fvsPatchField<Type>::New
|
||||
{
|
||||
DebugInFunction << "Constructing fvsPatchField" << endl;
|
||||
|
||||
auto cstrIter = patchConstructorTablePtr_->cfind(patchFieldType);
|
||||
auto* ctorPtr = patchConstructorTable(patchFieldType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalErrorInLookup
|
||||
(
|
||||
@ -57,15 +57,15 @@ Foam::tmp<Foam::fvsPatchField<Type>> Foam::fvsPatchField<Type>::New
|
||||
|| actualPatchType != p.type()
|
||||
)
|
||||
{
|
||||
auto patchTypeCstrIter = patchConstructorTablePtr_->cfind(p.type());
|
||||
auto* patchTypeCtor = patchConstructorTable(p.type());
|
||||
|
||||
if (patchTypeCstrIter.found())
|
||||
if (patchTypeCtor)
|
||||
{
|
||||
return patchTypeCstrIter()(p, iF);
|
||||
return patchTypeCtor(p, iF);
|
||||
}
|
||||
}
|
||||
|
||||
return cstrIter()(p, iF);
|
||||
return ctorPtr(p, iF);
|
||||
}
|
||||
|
||||
|
||||
@ -93,16 +93,16 @@ Foam::tmp<Foam::fvsPatchField<Type>> Foam::fvsPatchField<Type>::New
|
||||
|
||||
const word patchFieldType(dict.get<word>("type"));
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(patchFieldType);
|
||||
auto* ctorPtr = dictionaryConstructorTable(patchFieldType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
if (!disallowGenericFvsPatchField)
|
||||
{
|
||||
cstrIter = dictionaryConstructorTablePtr_->cfind("generic");
|
||||
ctorPtr = dictionaryConstructorTable("generic");
|
||||
}
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInFunction(dict)
|
||||
<< "Unknown patchField type " << patchFieldType
|
||||
@ -119,10 +119,9 @@ Foam::tmp<Foam::fvsPatchField<Type>> Foam::fvsPatchField<Type>::New
|
||||
|| dict.get<word>("patchType") != p.type()
|
||||
)
|
||||
{
|
||||
auto patchTypeCstrIter
|
||||
= dictionaryConstructorTablePtr_->cfind(p.type());
|
||||
auto* patchTypeCtor = dictionaryConstructorTable(p.type());
|
||||
|
||||
if (patchTypeCstrIter.found() && patchTypeCstrIter() != cstrIter())
|
||||
if (patchTypeCtor && patchTypeCtor != ctorPtr)
|
||||
{
|
||||
FatalIOErrorInFunction(dict)
|
||||
<< "inconsistent patch and patchField types for\n"
|
||||
@ -132,7 +131,7 @@ Foam::tmp<Foam::fvsPatchField<Type>> Foam::fvsPatchField<Type>::New
|
||||
}
|
||||
}
|
||||
|
||||
return cstrIter()(p, iF, dict);
|
||||
return ctorPtr(p, iF, dict);
|
||||
}
|
||||
|
||||
|
||||
@ -147,9 +146,9 @@ Foam::tmp<Foam::fvsPatchField<Type>> Foam::fvsPatchField<Type>::New
|
||||
{
|
||||
DebugInFunction << "Constructing fvsPatchField" << endl;
|
||||
|
||||
auto cstrIter = patchMapperConstructorTablePtr_->cfind(ptf.type());
|
||||
auto* ctorPtr = patchMapperConstructorTable(ptf.type());
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalErrorInLookup
|
||||
(
|
||||
@ -159,14 +158,14 @@ Foam::tmp<Foam::fvsPatchField<Type>> Foam::fvsPatchField<Type>::New
|
||||
) << exit(FatalError);
|
||||
}
|
||||
|
||||
auto patchTypeCstrIter = patchMapperConstructorTablePtr_->cfind(p.type());
|
||||
auto* patchTypeCtor = patchMapperConstructorTable(p.type());
|
||||
|
||||
if (patchTypeCstrIter.found())
|
||||
if (patchTypeCtor)
|
||||
{
|
||||
return patchTypeCstrIter()(ptf, p, iF, pfMapper);
|
||||
return patchTypeCtor(ptf, p, iF, pfMapper);
|
||||
}
|
||||
|
||||
return cstrIter()(ptf, p, iF, pfMapper);
|
||||
return ctorPtr(ptf, p, iF, pfMapper);
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -85,9 +85,9 @@ tmp<convectionScheme<Type>> convectionScheme<Type>::New
|
||||
InfoInFunction << "schemeName:" << schemeName << endl;
|
||||
}
|
||||
|
||||
auto cstrIter = IstreamConstructorTablePtr_->cfind(schemeName);
|
||||
auto* ctorPtr = IstreamConstructorTable(schemeName);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -98,7 +98,7 @@ tmp<convectionScheme<Type>> convectionScheme<Type>::New
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return cstrIter()(mesh, faceFlux, schemeData);
|
||||
return ctorPtr(mesh, faceFlux, schemeData);
|
||||
}
|
||||
|
||||
|
||||
@ -128,9 +128,9 @@ tmp<convectionScheme<Type>> convectionScheme<Type>::New
|
||||
|
||||
const word schemeName(schemeData);
|
||||
|
||||
auto cstrIter = MultivariateConstructorTablePtr_->cfind(schemeName);
|
||||
auto* ctorPtr = MultivariateConstructorTable(schemeName);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (!ctorPtr)
|
||||
{
|
||||
FatalIOErrorInLookup
|
||||
(
|
||||
@ -141,7 +141,7 @@ tmp<convectionScheme<Type>> convectionScheme<Type>::New
|
||||
) << exit(FatalIOError);
|
||||
}
|
||||
|
||||
return cstrIter()(mesh, fields, faceFlux, schemeData);
|
||||
return ctorPtr(mesh, fields, faceFlux, schemeData);
|
||||
}
|
||||
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user