From 3416151deed918de563586f3ecdb91d566a30a2f Mon Sep 17 00:00:00 2001 From: Mark Olesen <Mark.Olesen@esi-group.com> Date: Wed, 14 Jul 2021 11:12:08 +0200 Subject: [PATCH 1/6] ENH: improve isolation of basicThermo internals (as private) - getThermoOrDie: returns constructor pointer, or FatalError. Better isolation and avoids additional template/typename previously needed with ambiguous method name (lookupThermo). - makeThermoName: centralize dictionary -> stringified name - splitThermoName: use stringOps functionality --- .../combustionModelTemplates.C | 95 +++++---- .../basic/basicThermo/basicThermo.C | 186 +++++++++++----- .../basic/basicThermo/basicThermo.H | 92 +++++--- .../basic/basicThermo/basicThermoTemplates.C | 199 ++++++------------ .../chemistryReductionMethodNew.C | 73 ++++--- .../chemistryTabulationMethodNew.C | 75 +++---- .../basicChemistryModelTemplates.C | 93 ++++---- .../basicSolidChemistryModel.H | 8 +- .../basicSolidChemistryModelNew.C | 77 +++---- 9 files changed, 471 insertions(+), 427 deletions(-) diff --git a/src/combustionModels/combustionModel/combustionModelTemplates.C b/src/combustionModels/combustionModel/combustionModelTemplates.C index e4576b87aa1..fcf4d4a059d 100644 --- a/src/combustionModels/combustionModel/combustionModelTemplates.C +++ b/src/combustionModels/combustionModel/combustionModelTemplates.C @@ -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. @@ -73,6 +73,7 @@ Foam::autoPtr<CombustionModel> Foam::combustionModel::New << "combustion model " << combModelName << "." << endl; } + const word compCombModelName ( combModelName + '<' + CombustionModel::reactionThermo::typeName + '>' @@ -87,20 +88,27 @@ Foam::autoPtr<CombustionModel> Foam::combustionModel::New const auto& cnstrTable = *(CombustionModel::dictionaryConstructorTablePtr_); - auto compCstrIter = cnstrTable.cfind(compCombModelName); - - auto thermoCstrIter = cnstrTable.cfind(thermoCombModelName); + auto ctorIter = cnstrTable.cfind(thermoCombModelName); - if (!compCstrIter.found() && !thermoCstrIter.found()) + if (!ctorIter.found()) { - wordList thisCmpts; - thisCmpts.append(word::null); - thisCmpts.append(CombustionModel::reactionThermo::typeName); - thisCmpts.append(basicThermo::splitThermoName(thermo.thermoName(), 5)); - - wordList validNames; + ctorIter = cnstrTable.cfind(compCombModelName); + } - List<wordList> validCmpts2; + if (!ctorIter.found()) + { + const wordList names(cnstrTable.sortedToc()); + + /// DynamicList<word> thisCmpts(6); + /// thisCmpts.append(CombustionModel::reactionThermo::typeName); + /// thisCmpts.append(basicThermo::splitThermoName + /// ( + /// basicThermo::splitThermoName(thermo.thermoName(), 5) + /// ); + /// + /// DynamicList<word> validNames; + + DynamicList<wordList> validCmpts2; validCmpts2.append ( // Header @@ -112,7 +120,7 @@ Foam::autoPtr<CombustionModel> Foam::combustionModel::New }) ); - List<wordList> validCmpts7; + DynamicList<wordList> validCmpts7; validCmpts7.append ( // Header @@ -129,61 +137,56 @@ Foam::autoPtr<CombustionModel> Foam::combustionModel::New }) ); - for (const word& validName : cnstrTable.sortedToc()) + for (const word& validName : names) { - wordList cmpts(basicThermo::splitThermoName(validName, 2)); + wordList cmpts(basicThermo::splitThermoName(validName, 0)); if (cmpts.size() == 2) { - validCmpts2.append(cmpts); + validCmpts2.append(std::move(cmpts)); } - else + else if (cmpts.size() == 7) { - cmpts = basicThermo::splitThermoName(validName, 7); - if (cmpts.size() == 7) - { - validCmpts7.append(cmpts); - } - } - - bool isValid = true; - for (label i = 1; i < cmpts.size() && isValid; ++i) - { - isValid = isValid && cmpts[i] == thisCmpts[i]; - } - - if (isValid) - { - validNames.append(cmpts[0]); + /// if (thisCmpts == SubList<word>(cmpts, 6, 1)) + /// { + /// validNames.append(cmpts[0]); + /// } + validCmpts7.append(std::move(cmpts)); } } - FatalErrorInLookup ( combustionModel::typeName, combModelName, cnstrTable - ) - << "All " << validCmpts2[0][0] << '/' << validCmpts2[0][1] - << " combinations are:" << nl << nl; + ); - printTable(validCmpts2, FatalErrorInFunction) - << nl; + if (validCmpts2.size() > 1) + { + FatalError + << "All " << validCmpts2[0][0] << '/' << validCmpts2[0][1] + << " combinations are:" << nl << nl; - FatalErrorInFunction - << "All " << validCmpts7[0][0] << '/' << validCmpts7[0][1] - << "/thermoPhysics combinations are:" << nl << nl; + printTable(validCmpts2, FatalError) << nl; + } + + if (validCmpts7.size() > 1) + { + FatalError + << "All " << validCmpts7[0][0] << '/' << validCmpts7[0][1] + << "/thermoPhysics combinations are:" << nl << nl; + + printTable(validCmpts7, FatalError) << nl; + } - printTable(validCmpts7, FatalErrorInFunction) + FatalError << exit(FatalError); } return autoPtr<CombustionModel> ( - thermoCstrIter.found() - ? thermoCstrIter()(combModelName, thermo, turb, combustionProperties) - : compCstrIter()(combModelName, thermo, turb, combustionProperties) + ctorIter()(combModelName, thermo, turb, combustionProperties) ); } diff --git a/src/thermophysicalModels/basic/basicThermo/basicThermo.C b/src/thermophysicalModels/basic/basicThermo/basicThermo.C index b25fd1d8911..b2204d0d420 100644 --- a/src/thermophysicalModels/basic/basicThermo/basicThermo.C +++ b/src/thermophysicalModels/basic/basicThermo/basicThermo.C @@ -27,6 +27,8 @@ License \*---------------------------------------------------------------------------*/ #include "basicThermo.H" +#include "stringOps.H" +#include "wordIOList.H" #include "zeroGradientFvPatchFields.H" #include "fixedEnergyFvPatchScalarField.H" #include "gradientEnergyFvPatchScalarField.H" @@ -47,6 +49,115 @@ namespace Foam const Foam::word Foam::basicThermo::dictName("thermophysicalProperties"); +const Foam::wordList Foam::basicThermo::componentHeader4 +({ + "type", + "mixture", + "properties", + "energy" +}); + +const Foam::wordList Foam::basicThermo::componentHeader7 +({ + "type", + "mixture", + "transport", + "thermo", + "equationOfState", + "specie", + "energy" +}); + + +// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * // + +Foam::Ostream& Foam::basicThermo::printThermoNames +( + Ostream& os, + const wordList& cmptNames, + const wordList& thermoNames +) +{ + const int nCmpt = cmptNames.size(); + + // Build a table of constituent parts by split name into constituent parts + // - remove incompatible entries from the list + // - note: row-0 contains the names of constituent parts (ie, the header) + + DynamicList<wordList> outputTbl; + outputTbl.resize(thermoNames.size()+1); + + label rowi = 0; + + // Header + outputTbl[rowi] = cmptNames; + if (!outputTbl[rowi].empty()) + { + ++rowi; + } + + for (const word& thermoName : thermoNames) + { + outputTbl[rowi] = basicThermo::splitThermoName(thermoName, nCmpt); + if (!outputTbl[rowi].empty()) + { + ++rowi; + } + } + + if (rowi > 1) + { + outputTbl.resize(rowi); + Foam::printTable(outputTbl, os); + } + + return os; +} + + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +Foam::word Foam::basicThermo::makeThermoName +( + const dictionary& thermoTypeDict, + const wordList*& cmptHeaderPtr +) +{ + if (thermoTypeDict.found("properties")) + { + if (cmptHeaderPtr) + { + cmptHeaderPtr = &(componentHeader4); + } + + return word + ( + thermoTypeDict.get<word>("type") + '<' + + thermoTypeDict.get<word>("mixture") + '<' + + thermoTypeDict.get<word>("properties") + ',' + + thermoTypeDict.get<word>("energy") + ">>" + ); + } + else + { + if (cmptHeaderPtr) + { + cmptHeaderPtr = &(componentHeader7); + } + + return word + ( + thermoTypeDict.get<word>("type") + '<' + + thermoTypeDict.get<word>("mixture") + '<' + + thermoTypeDict.get<word>("transport") + '<' + + thermoTypeDict.get<word>("thermo") + '<' + + thermoTypeDict.get<word>("equationOfState") + '<' + + thermoTypeDict.get<word>("specie") + ">>," + + thermoTypeDict.get<word>("energy") + ">>>" + ); + } +} + // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // @@ -60,14 +171,17 @@ Foam::wordList Foam::basicThermo::heBoundaryBaseTypes() { if (isA<fixedJumpFvPatchScalarField>(tbf[patchi])) { - const fixedJumpFvPatchScalarField& pf = - dynamic_cast<const fixedJumpFvPatchScalarField&>(tbf[patchi]); + const auto& pf = + dynamic_cast<const fixedJumpFvPatchScalarField&> + ( + tbf[patchi] + ); hbt[patchi] = pf.interfaceFieldType(); } else if (isA<fixedJumpAMIFvPatchScalarField>(tbf[patchi])) { - const fixedJumpAMIFvPatchScalarField& pf = + const auto& pf = dynamic_cast<const fixedJumpAMIFvPatchScalarField&> ( tbf[patchi] @@ -345,13 +459,14 @@ const Foam::basicThermo& Foam::basicThermo::lookupThermo forAllConstIters(thermos, iter) { + thermo = iter.val(); if ( - &(iter()->he().internalField()) + &(thermo->he().internalField()) == &(pf.internalField()) ) { - return *iter(); + return *thermo; } } @@ -455,60 +570,29 @@ void Foam::basicThermo::validate Foam::wordList Foam::basicThermo::splitThermoName ( - const word& thermoName, - const int nCmpt + const std::string& thermoName, + const int nExpectedCmpts ) { - wordList cmpts(nCmpt); + // Split on ",<>" but include space for good measure. + // Splits things like + // "hePsiThermo<pureMixture<const<hConst<perfectGas<specie>>,enthalpy>>>" - string::size_type beg=0, end=0, endb=0, endc=0; - int i = 0; + const auto parsed = stringOps::splitAny<std::string>(thermoName, " ,<>"); + const int nParsed(parsed.size()); - while - ( - (endb = thermoName.find('<', beg)) != string::npos - || (endc = thermoName.find(',', beg)) != string::npos - ) + wordList cmpts; + + if (!nExpectedCmpts || nParsed == nExpectedCmpts) { - if (endb == string::npos) - { - end = endc; - } - else if ((endc = thermoName.find(',', beg)) != string::npos) - { - end = std::min(endb, endc); - } - else - { - end = endb; - } + cmpts.resize(nParsed); - if (beg < end) + auto iter = cmpts.begin(); + for (const auto& sub : parsed) { - cmpts[i] = thermoName.substr(beg, end-beg); - cmpts[i++].replaceAll(">",""); - - // If the number of number of components in the name - // is greater than nCmpt return an empty list - if (i == nCmpt) - { - return wordList::null(); - } + *iter = word(sub.str()); + ++iter; } - beg = end + 1; - } - - // If the number of number of components in the name is not equal to nCmpt - // return an empty list - if (i + 1 != nCmpt) - { - return wordList::null(); - } - - if (beg < thermoName.size()) - { - cmpts[i] = thermoName.substr(beg, string::npos); - cmpts[i].replaceAll(">",""); } return cmpts; diff --git a/src/thermophysicalModels/basic/basicThermo/basicThermo.H b/src/thermophysicalModels/basic/basicThermo/basicThermo.H index dcd7dce5dfe..f4ffb6491f7 100644 --- a/src/thermophysicalModels/basic/basicThermo/basicThermo.H +++ b/src/thermophysicalModels/basic/basicThermo/basicThermo.H @@ -65,6 +65,55 @@ class basicThermo : public IOdictionary { + // Private Data + + //- Components names/order + static const wordList componentHeader4; + + //- Components names/order + static const wordList componentHeader7; + + + // Private Member Functions + + //- Construct name of thermo package from dictionary components + static word makeThermoName + ( + const dictionary& dict, + const wordList*& cmptHeaderPtr + ); + + //- Look up field from registry or construct and store + static volScalarField& lookupOrConstruct + ( + const fvMesh& mesh, + const word& fieldName, + bool& isOwner //!< Stored to registry by this instance + ); + + //- Generic lookup for thermodynamics package thermoTypeName + // \return constructor pointer, or FatalError + template<class Thermo, class ThermoConstructTable> + static typename ThermoConstructTable::mapped_type + getThermoOrDie + ( + const dictionary& thermoTypeDict, + ThermoConstructTable& thermoTable, + const word& thermoTypeName, + const wordList& cmptNames + ); + + //- Generic lookup for each of the related thermodynamics packages + // \return constructor pointer, or FatalError + template<class Thermo, class ThermoConstructTable> + static typename ThermoConstructTable::mapped_type + getThermoOrDie + ( + const dictionary& thermoDict, + ThermoConstructTable& thermoTable + ); + + protected: // Protected Data @@ -96,14 +145,6 @@ protected: // Protected Member Functions - //- Look up field from registry or construct and store - static volScalarField& lookupOrConstruct - ( - const fvMesh& mesh, - const word& fieldName, - bool& isOwner //!< Stored to registry by this instance - ); - //- Return the enthalpy/internal energy field boundary types //- by interrogating the temperature field boundary types wordList heBoundaryTypes(); @@ -173,24 +214,6 @@ public: // Selectors - //- Generic lookup for thermodynamics package thermoTypeName - template<class Thermo, class Table> - static typename Table::iterator lookupThermo - ( - const dictionary& thermoTypeDict, - Table* tablePtr, - std::initializer_list<const char*> cmptNames, - const word& thermoTypeName - ); - - //- Generic lookup for each of the related thermodynamics packages - template<class Thermo, class Table> - static typename Table::iterator lookupThermo - ( - const dictionary& thermoDict, - Table* tablePtr - ); - //- Generic New for each of the related thermodynamics packages template<class Thermo> static autoPtr<Thermo> New @@ -249,6 +272,14 @@ public: static const basicThermo& lookupThermo(const fvPatchScalarField& pf); + //- Print (filtered) table of thermo names, splits on \c " ,<>" + static Ostream& printThermoNames + ( + Ostream& os, + const wordList& cmptNames, + const wordList& thermoNames + ); + //- Check that the thermodynamics package is consistent // with energy forms supported by the application void validate @@ -287,11 +318,14 @@ public: const word& ) const; - //- Split name of thermo package into a list of the components names + //- Split thermo package name into a list of components names + // Splits on \c " ,<>" + // \return empty list if the split name does not have the + // expected number of components (non-zero). static wordList splitThermoName ( - const word& thermoName, - const int nCmpt + const std::string& thermoName, + const int nExpectedCmpts ); //- Update properties diff --git a/src/thermophysicalModels/basic/basicThermo/basicThermoTemplates.C b/src/thermophysicalModels/basic/basicThermo/basicThermoTemplates.C index 38351182af2..084e6269962 100644 --- a/src/thermophysicalModels/basic/basicThermo/basicThermoTemplates.C +++ b/src/thermophysicalModels/basic/basicThermo/basicThermoTemplates.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2012-2017 OpenFOAM Foundation - Copyright (C) 2017-2019 OpenCFD Ltd. + Copyright (C) 2017-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -28,140 +28,78 @@ License #include "basicThermo.H" -// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -template<class Thermo, class Table> -typename Table::iterator Foam::basicThermo::lookupThermo +template<class Thermo, class ThermoConstructTable> +typename ThermoConstructTable::mapped_type +Foam::basicThermo::getThermoOrDie ( const dictionary& thermoTypeDict, - Table* tablePtr, - std::initializer_list<const char*> cmptNames, - const word& thermoTypeName + ThermoConstructTable& thermoTable, + const word& thermoTypeName, + const wordList& cmptNames ) { // Lookup the thermo package - // Table iterator, not const_iterator - auto cstrIter = tablePtr->find(thermoTypeName); + auto ctorIter = thermoTable.cfind(thermoTypeName); // Print error message if package not found in the table - if (!cstrIter.found()) + if (!ctorIter.found()) { - const int nCmpt = cmptNames.size(); - - // Build a table of the thermo packages constituent parts - // Note: row-0 contains the names of constituent parts - List<wordList> validCmpts(tablePtr->size()+1); - - // Header (row 0) - validCmpts[0].resize(nCmpt); - std::copy(cmptNames.begin(), cmptNames.end(), validCmpts[0].begin()); - - // Split the thermo package names into their constituent parts - // Removing incompatible entries from the list - label rowi = 1; - for (const word& validName : tablePtr->sortedToc()) - { - validCmpts[rowi] = Thermo::splitThermoName(validName, nCmpt); - - if (validCmpts[rowi].size()) - { - ++rowi; - } - } - validCmpts.resize(rowi); - - FatalIOErrorInLookup ( thermoTypeDict, Thermo::typeName, word::null, // Suppress long name? Just output dictionary (above) - *tablePtr + thermoTable ); - // Table of available packages (as constituent parts) - printTable(validCmpts, FatalIOError) - << exit(FatalIOError); + basicThermo::printThermoNames + ( + FatalIOError, + cmptNames, + thermoTable.sortedToc() + ) << exit(FatalIOError); + + // return nullptr; } - return cstrIter; + return ctorIter.val(); } -template<class Thermo, class Table> -typename Table::iterator Foam::basicThermo::lookupThermo +template<class Thermo, class ThermoConstructTable> +typename ThermoConstructTable::mapped_type +Foam::basicThermo::getThermoOrDie ( const dictionary& thermoDict, - Table* tablePtr + ThermoConstructTable& thermoTable ) { - if (thermoDict.isDict("thermoType")) + const dictionary* dictptr = thermoDict.findDict("thermoType"); + + if (dictptr) { - const dictionary& thermoTypeDict = thermoDict.subDict("thermoType"); + const auto& thermoTypeDict = *dictptr; - Info<< "Selecting thermodynamics package " << thermoTypeDict << endl; + const wordList* cmptHeaderPtr = &(wordList::null()); - if (thermoTypeDict.found("properties")) - { - std::initializer_list<const char*> cmptNames - { - "type", - "mixture", - "properties", - "energy" - }; - - // Construct the name of the thermo package from the components - const word thermoTypeName - ( - thermoTypeDict.get<word>("type") + '<' - + thermoTypeDict.get<word>("mixture") + '<' - + thermoTypeDict.get<word>("properties") + ',' - + thermoTypeDict.get<word>("energy") + ">>" - ); + // Thermo package name, constructed from components + const word thermoTypeName + ( + basicThermo::makeThermoName(thermoTypeDict, cmptHeaderPtr) + ); - return lookupThermo<Thermo, Table> - ( - thermoTypeDict, - tablePtr, - cmptNames, - thermoTypeName - ); - } - else - { - std::initializer_list<const char*> cmptNames - { - "type", - "mixture", - "transport", - "thermo", - "equationOfState", - "specie", - "energy" - }; - - // Construct the name of the thermo package from the components - const word thermoTypeName - ( - thermoTypeDict.get<word>("type") + '<' - + thermoTypeDict.get<word>("mixture") + '<' - + thermoTypeDict.get<word>("transport") + '<' - + thermoTypeDict.get<word>("thermo") + '<' - + thermoTypeDict.get<word>("equationOfState") + '<' - + thermoTypeDict.get<word>("specie") + ">>," - + thermoTypeDict.get<word>("energy") + ">>>" - ); - - return lookupThermo<Thermo, Table> - ( - thermoTypeDict, - tablePtr, - cmptNames, - thermoTypeName - ); - } + Info<< "Selecting thermodynamics package " << thermoTypeDict << endl; + + return getThermoOrDie<Thermo, ThermoConstructTable> + ( + thermoTypeDict, + thermoTable, + thermoTypeName, + *cmptHeaderPtr + ); } else { @@ -169,25 +107,26 @@ typename Table::iterator Foam::basicThermo::lookupThermo Info<< "Selecting thermodynamics package " << thermoTypeName << endl; - // Table iterator, not const_iterator - auto cstrIter = tablePtr->find(thermoTypeName); + auto ctorIter = thermoTable.cfind(thermoTypeName); - if (!cstrIter.found()) + if (!ctorIter.found()) { FatalIOErrorInLookup ( thermoDict, Thermo::typeName, thermoTypeName, - *tablePtr + thermoTable ) << exit(FatalIOError); } - return cstrIter; + return ctorIter.val(); } } +// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // + template<class Thermo> Foam::autoPtr<Thermo> Foam::basicThermo::New ( @@ -208,14 +147,13 @@ Foam::autoPtr<Thermo> Foam::basicThermo::New ) ); - auto cstrIter = - lookupThermo<Thermo, typename Thermo::fvMeshConstructorTable> - ( - thermoDict, - Thermo::fvMeshConstructorTablePtr_ - ); + auto* ctorPtr = getThermoOrDie<Thermo> + ( + thermoDict, + *(Thermo::fvMeshConstructorTablePtr_) + ); - return autoPtr<Thermo>(cstrIter()(mesh, phaseName)); + return autoPtr<Thermo>(ctorPtr(mesh, phaseName)); } @@ -227,14 +165,13 @@ Foam::autoPtr<Thermo> Foam::basicThermo::New const word& phaseName ) { - auto cstrIter = - lookupThermo<Thermo, typename Thermo::dictionaryConstructorTable> - ( - dict, - Thermo::dictionaryConstructorTablePtr_ - ); + auto* ctorPtr = getThermoOrDie<Thermo> + ( + dict, + *(Thermo::dictionaryConstructorTablePtr_) + ); - return autoPtr<Thermo>(cstrIter()(mesh, dict, phaseName)); + return autoPtr<Thermo>(ctorPtr(mesh, dict, phaseName)); } @@ -259,16 +196,14 @@ Foam::autoPtr<Thermo> Foam::basicThermo::New ) ); - auto cstrIter = - lookupThermo<Thermo, typename Thermo::fvMeshDictPhaseConstructorTable> - ( - thermoDict, - Thermo::fvMeshDictPhaseConstructorTablePtr_ - ); + auto* ctorPtr = getThermoOrDie<Thermo> + ( + thermoDict, + *(Thermo::fvMeshDictPhaseConstructorTablePtr_) + ); - return autoPtr<Thermo>(cstrIter()(mesh, phaseName, dictName)); + return autoPtr<Thermo>(ctorPtr(mesh, phaseName, dictName)); } - // ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/chemistryReductionMethod/chemistryReductionMethodNew.C b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/chemistryReductionMethod/chemistryReductionMethodNew.C index a42f3a37f59..e2fe6396510 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/chemistryReductionMethod/chemistryReductionMethodNew.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/chemistryReductionMethod/chemistryReductionMethodNew.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2016-2017 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -51,23 +51,26 @@ Foam::chemistryReductionMethod<CompType, ThermoType>::New + '<' + CompType::typeName + ',' + ThermoType::typeName() + '>' ); - auto cstrIter = dictionaryConstructorTablePtr_->cfind(methodTypeName); + const auto& cnstrTable = *(dictionaryConstructorTablePtr_); + + auto cstrIter = cnstrTable.cfind(methodTypeName); if (!cstrIter.found()) { - constexpr const int nCmpt = 7; + const wordList names(cnstrTable.sortedToc()); - wordList thisCmpts; - thisCmpts.append(word::null); - thisCmpts.append(CompType::typeName); - thisCmpts.append - ( - basicThermo::splitThermoName(ThermoType::typeName(), 5) - ); + constexpr const int nCmpt = 7; - wordList validNames; + /// DynamicList<word> thisCmpts(6); + /// thisCmpts.append(CompType::typeName); + /// thisCmpts.append + /// ( + /// basicThermo::splitThermoName(ThermoType::typeName(), 5) + /// ); + /// + /// DynamicList<word> validNames; - List<wordList> validCmpts; + DynamicList<wordList> validCmpts; validCmpts.append ( // Header @@ -83,42 +86,38 @@ Foam::chemistryReductionMethod<CompType, ThermoType>::New }) ); - for - ( - const word& validName - : dictionaryConstructorTablePtr_->sortedToc() - ) + for (const word& validName : names) { - validCmpts.append - ( - basicThermo::splitThermoName(validName, nCmpt) - ); - const wordList& cmpts = validCmpts.last(); - - bool isValid = true; - for (label i = 1; i < cmpts.size() && isValid; ++i) - { - isValid = isValid && cmpts[i] == thisCmpts[i]; - } + wordList cmpts(basicThermo::splitThermoName(validName, nCmpt)); - if (isValid) + if (!cmpts.empty()) { - validNames.append(cmpts[0]); + /// if (thisCmpts == SubList<word>(cmpts, 6, 1)) + /// { + /// validNames.append(cmpts[0]); + /// } + validCmpts.append(std::move(cmpts)); } } - FatalErrorInLookup ( typeName_(), methodName, - *dictionaryConstructorTablePtr_ - ) - << "All " << validCmpts[0][0] << '/' << validCmpts[0][1] - << "/thermoPhysics combinations:" << nl << nl; + cnstrTable + ); + + if (validCmpts.size() > 1) + { + FatalError + << "All " << validCmpts[0][0] << '/' << validCmpts[0][1] + << "/thermoPhysics combinations:" << nl << nl; + + // Table of available packages (as constituent parts) + printTable(validCmpts, FatalError) << nl; + } - // Table of available packages (as constituent parts) - printTable(validCmpts, FatalErrorInFunction) + FatalError << exit(FatalError); } diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/chemistryTabulationMethod/chemistryTabulationMethodNew.C b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/chemistryTabulationMethod/chemistryTabulationMethodNew.C index 09ac87d9062..78217af1220 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/chemistryTabulationMethod/chemistryTabulationMethodNew.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/chemistryTabulationMethod/chemistryTabulationMethodNew.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2016-2017 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -39,7 +39,7 @@ Foam::chemistryTabulationMethod<CompType, ThermoType>::New TDACChemistryModel<CompType, ThermoType>& chemistry ) { - const dictionary& tabulationDict(dict.subDict("tabulation")); + const dictionary& tabulationDict = dict.subDict("tabulation"); const word methodName(tabulationDict.get<word>("method")); @@ -50,21 +50,26 @@ Foam::chemistryTabulationMethod<CompType, ThermoType>::New + '<' + CompType::typeName + ',' + ThermoType::typeName() + '>' ); - auto cstrIter = dictionaryConstructorTablePtr_->cfind(methodTypeName); + const auto& cnstrTable = *(dictionaryConstructorTablePtr_); + + auto cstrIter = cnstrTable.cfind(methodTypeName); if (!cstrIter.found()) { - wordList thisCmpts; - thisCmpts.append(word::null); - thisCmpts.append(CompType::typeName); - thisCmpts.append - ( - basicThermo::splitThermoName(ThermoType::typeName(), 5) - ); + const wordList names(cnstrTable.sortedToc()); + + constexpr const int nCmpt = 7; - wordList validNames; + /// DynamicList<word> thisCmpts(6); + /// thisCmpts.append(CompType::typeName); + /// thisCmpts.append + /// ( + /// basicThermo::splitThermoName(ThermoType::typeName(), 5) + /// ); + /// + /// DynamicList<word> validNames; - List<wordList> validCmpts; + DynamicList<wordList> validCmpts; validCmpts.append ( wordList @@ -79,27 +84,17 @@ Foam::chemistryTabulationMethod<CompType, ThermoType>::New }) ); - for - ( - const word& validName - : dictionaryConstructorTablePtr_->sortedToc() - ) + for (const word& validName : names) { - validCmpts.append - ( - basicThermo::splitThermoName(validName, 7) - ); - const wordList& cmpts = validCmpts.last(); - - bool isValid = true; - for (label i = 1; i < cmpts.size() && isValid; ++i) - { - isValid = isValid && cmpts[i] == thisCmpts[i]; - } + wordList cmpts(basicThermo::splitThermoName(validName, nCmpt)); - if (isValid) + if (!cmpts.empty()) { - validNames.append(cmpts[0]); + /// if (thisCmpts == SubList<word>(cmpts, 6, 1)) + /// { + /// validNames.append(cmpts[0]); + /// } + validCmpts.append(std::move(cmpts)); } } @@ -108,13 +103,20 @@ Foam::chemistryTabulationMethod<CompType, ThermoType>::New ( typeName_(), methodName, - *dictionaryConstructorTablePtr_ - ) - << "All " << validCmpts[0][0] << '/' << validCmpts[0][1] - << "/thermoPhysics combinations:" << nl << nl; + cnstrTable + ); + + if (validCmpts.size() > 1) + { + FatalError + << "All " << validCmpts[0][0] << '/' << validCmpts[0][1] + << "/thermoPhysics combinations:" << nl << nl; - // Table of available packages (as constituent parts) - printTable(validCmpts, FatalErrorInFunction) + // Table of available packages (as constituent parts) + printTable(validCmpts, FatalError) << nl; + } + + FatalError << exit(FatalError); } @@ -122,7 +124,6 @@ Foam::chemistryTabulationMethod<CompType, ThermoType>::New ( cstrIter()(dict, chemistry) ); - } diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModelTemplates.C b/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModelTemplates.C index b6293541dd4..1dff300bf74 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModelTemplates.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModelTemplates.C @@ -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. @@ -87,13 +87,14 @@ Foam::autoPtr<ChemistryModel> Foam::basicChemistryModel::New ) ); - dictionary chemistryTypeDictNew; - chemistryTypeDictNew.add("solver", solverName); - chemistryTypeDictNew.add("method", methodName); + { + dictionary chemistryTypeDictNew; - Info<< "Selecting chemistry solver " << chemistryTypeDictNew << endl; + chemistryTypeDictNew.add("solver", solverName); + chemistryTypeDictNew.add("method", methodName); - const auto& cnstrTable = *(ChemistryModel::thermoConstructorTablePtr_); + Info<< "Selecting chemistry solver " << chemistryTypeDictNew << endl; + } const word chemSolverCompThermoName ( @@ -102,30 +103,32 @@ Foam::autoPtr<ChemistryModel> Foam::basicChemistryModel::New + thermo.thermoName() + ">>" ); - auto cstrIter = cnstrTable.cfind(chemSolverCompThermoName); - if (!cstrIter.found()) + const auto& cnstrTable = *(ChemistryModel::thermoConstructorTablePtr_); + + auto ctorIter = cnstrTable.cfind(chemSolverCompThermoName); + + if (!ctorIter.found()) { + const wordList names(cnstrTable.sortedToc()); + constexpr const int nCmpt = 8; - wordList thisCmpts; - thisCmpts.append(word::null); - thisCmpts.append(word::null); + DynamicList<word> thisCmpts(6); thisCmpts.append(ChemistryModel::reactionThermo::typeName); thisCmpts.append ( basicThermo::splitThermoName(thermo.thermoName(), 5) ); - List<wordList> validNames; - + DynamicList<wordList> validNames; validNames.append ( // Header wordList({"solver", "method"}) ); - List<wordList> validCmpts; + DynamicList<wordList> validCmpts(names.size() + 1); validCmpts.append ( // Header @@ -142,48 +145,50 @@ Foam::autoPtr<ChemistryModel> Foam::basicChemistryModel::New }) ); - for (const word& validName : cnstrTable.sortedToc()) + for (const word& validName : names) { - validCmpts.append - ( - basicThermo::splitThermoName(validName, nCmpt) - ); - - const wordList& cmpts = validCmpts.last(); - - bool isValid = true; - for (label i = 2; i < cmpts.size() && isValid; ++i) - { - isValid = isValid && cmpts[i] == thisCmpts[i]; - } + wordList cmpts(basicThermo::splitThermoName(validName, nCmpt)); - if (isValid) + if (!cmpts.empty()) { - validNames.append(SubList<word>(cmpts, 2)); + if (thisCmpts == SubList<word>(cmpts, 6, 2)) + { + validNames.append(SubList<word>(cmpts, 2)); + } + validCmpts.append(std::move(cmpts)); } } - FatalErrorInFunction << "Unknown " << typeName_() << " type " << solverName << nl << nl; - FatalErrorInFunction - << "All " << validNames[0][0] << '/' << validNames[0][1] - << "combinations for this thermodynamic model:" << nl << nl; - - // Table of available packages (as constituent parts) - printTable(validNames, FatalErrorInFunction) - << nl - << "All " << validCmpts[0][0] << '/' << validCmpts[0][1] << '/' - << validCmpts[0][2] << "/thermoPhysics combinations are:" - << nl << nl; - - // Table of available packages (as constituent parts) - printTable(validCmpts, FatalErrorInFunction) + if (validNames.size() > 1) + { + FatalError + << "All " << validNames[0][0] << '/' << validNames[0][1] + << " combinations for this thermodynamic model:" + << nl << nl; + + // Table of available packages (as constituent parts) + printTable(validNames, FatalError) << nl; + } + + if (validCmpts.size() > 1) + { + FatalError + << "All " << validCmpts[0][0] << '/' << validCmpts[0][1] << '/' + << validCmpts[0][2] << "/thermoPhysics combinations:" + << nl << nl; + + // Table of available packages (as constituent parts) + printTable(validCmpts, FatalError) << nl; + } + + FatalError << exit(FatalError); } - return autoPtr<ChemistryModel>(cstrIter()(thermo)); + return autoPtr<ChemistryModel>(ctorIter()(thermo)); } // ************************************************************************* // diff --git a/src/thermophysicalModels/solidChemistryModel/basicSolidChemistryModel/basicSolidChemistryModel.H b/src/thermophysicalModels/solidChemistryModel/basicSolidChemistryModel/basicSolidChemistryModel.H index 5f54dfbfcc1..f704e843a4e 100644 --- a/src/thermophysicalModels/solidChemistryModel/basicSolidChemistryModel/basicSolidChemistryModel.H +++ b/src/thermophysicalModels/solidChemistryModel/basicSolidChemistryModel/basicSolidChemistryModel.H @@ -32,7 +32,7 @@ Description SourceFiles basicSolidChemistryModelI.H basicSolidChemistryModel.C - newChemistrySolidModel.C + basicSolidChemistryModelNew.C \*---------------------------------------------------------------------------*/ @@ -50,11 +50,11 @@ SourceFiles namespace Foam { -// Forward declaration of classes +// Forward Declarations class fvMesh; /*---------------------------------------------------------------------------*\ - class basicSolidChemistryModel Declaration + Class basicSolidChemistryModel Declaration \*---------------------------------------------------------------------------*/ class basicSolidChemistryModel @@ -72,7 +72,7 @@ class basicSolidChemistryModel protected: - // Protected data + // Protected Data //- Solid thermo solidReactionThermo& solidThermo_; diff --git a/src/thermophysicalModels/solidChemistryModel/basicSolidChemistryModel/basicSolidChemistryModelNew.C b/src/thermophysicalModels/solidChemistryModel/basicSolidChemistryModel/basicSolidChemistryModelNew.C index 7170f2cb76f..83e272847ac 100644 --- a/src/thermophysicalModels/solidChemistryModel/basicSolidChemistryModel/basicSolidChemistryModelNew.C +++ b/src/thermophysicalModels/solidChemistryModel/basicSolidChemistryModel/basicSolidChemistryModelNew.C @@ -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. @@ -51,23 +51,6 @@ Foam::basicSolidChemistryModel::New(solidReactionThermo& thermo) Info<< "Selecting chemistry type " << chemistryTypeDict << endl; - std::initializer_list<const char*> cmptNames - { - "chemistrySolver", - "chemistryThermo", - "baseChemistry", - "transport", - "thermo", - "equationOfState", - "specie", - "energy", - "transport", - "thermo", - "equationOfState", - "specie", - "energy" - }; - const IOdictionary thermoDict ( IOobject @@ -112,48 +95,48 @@ Foam::basicSolidChemistryModel::New(solidReactionThermo& thermo) Info<< "chemistryTypeName " << chemistryTypeName << endl; - auto cstrIter = thermoConstructorTablePtr_->cfind(chemistryTypeName); - - if (!cstrIter.found()) - { - const int nCmpt = cmptNames.size(); - - // Build a table of the thermo packages constituent parts - // Note: row-0 contains the names of constituent parts - List<wordList> validCmpts(thermoConstructorTablePtr_->size()+1); - - // Header (row 0) - validCmpts[0].resize(nCmpt); - std::copy(cmptNames.begin(), cmptNames.end(), validCmpts[0].begin()); - - label rowi = 1; - for (const word& validName : thermoConstructorTablePtr_->sortedToc()) - { - validCmpts[rowi] = basicThermo::splitThermoName(validName, nCmpt); - - if (validCmpts[rowi].size()) - { - ++rowi; - } - } - validCmpts.resize(rowi); + const auto& cnstrTable = *(thermoConstructorTablePtr_); + auto ctorIter = cnstrTable.cfind(chemistryTypeName); + if (!ctorIter.found()) + { FatalIOErrorInLookup ( chemistryTypeDict, typeName, word::null, // Suppress long name? Just output dictionary (above) - *thermoConstructorTablePtr_ + cnstrTable ); // Table of available packages (as constituent parts) - printTable(validCmpts, FatalIOError) + basicThermo::printThermoNames + ( + FatalIOError, + wordList + ({ + "chemistrySolver", + "chemistryThermo", + "baseChemistry", + "transport", + "thermo", // solid + "equationOfState", + "specie", + "energy", + "transport", + "thermo", // gas + "equationOfState", + "specie", + "energy" + }), + cnstrTable.sortedToc() + ); + + FatalIOError << exit(FatalIOError); } - return - autoPtr<basicSolidChemistryModel>(cstrIter()(thermo)); + return autoPtr<basicSolidChemistryModel>(ctorIter()(thermo)); } -- GitLab From 7f8ecd98f5a5c9d5034dbc66105d642a470632fa Mon Sep 17 00:00:00 2001 From: Mark Olesen <Mark.Olesen@esi-group.com> Date: Wed, 14 Jul 2021 21:15:51 +0200 Subject: [PATCH 2/6] ENH: rename runTime selection typedefs - better distinction between content and storage type by appending 'Type' to the typedef. old: 'Class::abcConstructorTable* tablePtr' new: 'Class::abcConstructorTableType* tablePtr' Was rarely used in any exposed code. BREAKING: LESdelta::New with additional table - parameter change to dictionaryConstructorTableType (was dictionaryConstructorTable) --- .../construction/runTimeSelectionTables.H | 24 +++++++------- .../memberFunctionSelectionTables.H | 14 ++++---- .../LES/LESdeltas/LESdelta/LESdelta.C | 32 +++++++++++-------- .../LES/LESdeltas/LESdelta/LESdelta.H | 7 ++-- 4 files changed, 40 insertions(+), 37 deletions(-) diff --git a/src/OpenFOAM/db/runTimeSelection/construction/runTimeSelectionTables.H b/src/OpenFOAM/db/runTimeSelection/construction/runTimeSelectionTables.H index a6a2a528df6..51b615a76bd 100644 --- a/src/OpenFOAM/db/runTimeSelection/construction/runTimeSelectionTables.H +++ b/src/OpenFOAM/db/runTimeSelection/construction/runTimeSelectionTables.H @@ -51,16 +51,16 @@ Description /* Construct from argList function pointer type */ \ typedef autoPtr<baseType> (*argNames##ConstructorPtr)argList; \ \ - /* Construct from argList function table type */ \ - typedef HashTable \ + /* Function table type: construct from argList */ \ + typedef ::Foam::HashTable \ < \ argNames##ConstructorPtr, \ ::Foam::word, \ ::Foam::string::hasher \ - > argNames##ConstructorTable; \ + > argNames##ConstructorTableType; \ \ /* Construct from argList function pointer table pointer */ \ - static argNames##ConstructorTable* argNames##ConstructorTablePtr_; \ + static argNames##ConstructorTableType* argNames##ConstructorTablePtr_; \ \ /* Table constructor called from the table add function */ \ static void construct##argNames##ConstructorTables(); \ @@ -155,16 +155,16 @@ Description /* Construct from argList function pointer type */ \ typedef autoPtr<baseType> (*argNames##ConstructorPtr)argList; \ \ - /* Construct from argList function table type */ \ - typedef HashTable \ + /* Function table type: construct from argList */ \ + typedef ::Foam::HashTable \ < \ argNames##ConstructorPtr, \ ::Foam::word, \ ::Foam::string::hasher \ - > argNames##ConstructorTable; \ + > argNames##ConstructorTableType; \ \ /* Construct from argList function pointer table pointer */ \ - static argNames##ConstructorTable* argNames##ConstructorTablePtr_; \ + static argNames##ConstructorTableType* argNames##ConstructorTablePtr_; \ \ /* Table constructor called from the table add function */ \ static void construct##argNames##ConstructorTables(); \ @@ -272,7 +272,7 @@ Description { \ constructed = true; \ baseType::argNames##ConstructorTablePtr_ \ - = new baseType::argNames##ConstructorTable; \ + = new baseType::argNames##ConstructorTableType; \ } \ } @@ -295,7 +295,7 @@ Description #define defineRunTimeSelectionTablePtr(baseType,argNames) \ \ /* Define the constructor function table */ \ - baseType::argNames##ConstructorTable* \ + baseType::argNames##ConstructorTableType* \ baseType::argNames##ConstructorTablePtr_(nullptr) @@ -335,7 +335,7 @@ Description { \ constructed = true; \ baseType<Targ>::argNames##ConstructorTablePtr_ \ - = new baseType<Targ>::argNames##ConstructorTable; \ + = new baseType<Targ>::argNames##ConstructorTableType; \ } \ } @@ -359,7 +359,7 @@ Description #define defineTemplatedRunTimeSelectionTablePtr(baseType,argNames,Targ) \ \ /* Define the constructor function table */ \ - baseType<Targ>::argNames##ConstructorTable* \ + baseType<Targ>::argNames##ConstructorTableType* \ baseType<Targ>::argNames##ConstructorTablePtr_(nullptr) diff --git a/src/OpenFOAM/db/runTimeSelection/memberFunctions/memberFunctionSelectionTables.H b/src/OpenFOAM/db/runTimeSelection/memberFunctions/memberFunctionSelectionTables.H index df70160dad3..b807c40f699 100644 --- a/src/OpenFOAM/db/runTimeSelection/memberFunctions/memberFunctionSelectionTables.H +++ b/src/OpenFOAM/db/runTimeSelection/memberFunctions/memberFunctionSelectionTables.H @@ -46,15 +46,15 @@ Description typedef returnType (*memberFunction##argNames##MemberFunctionPtr)argList; \ \ /* Construct from argList function table type */ \ - typedef HashTable \ + typedef ::Foam::HashTable \ < \ memberFunction##argNames##MemberFunctionPtr, \ ::Foam::word, \ ::Foam::string::hasher \ - > memberFunction##argNames##MemberFunctionTable; \ + > memberFunction##argNames##MemberFunctionTableType; \ \ /* Construct from argList function pointer table pointer */ \ - static memberFunction##argNames##MemberFunctionTable* \ + static memberFunction##argNames##MemberFunctionTableType* \ memberFunction##argNames##MemberFunctionTablePtr_; \ \ /* Class to add constructor from argList to table */ \ @@ -101,7 +101,7 @@ Description { \ constructed = true; \ baseType::memberFunction##argNames##MemberFunctionTablePtr_ \ - = new baseType::memberFunction##argNames##MemberFunctionTable; \ + = new baseType::memberFunction##argNames##MemberFunctionTableType; \ } \ } @@ -127,7 +127,7 @@ Description #define defineMemberFunctionSelectionTablePtr(baseType,memberFunction,argNames)\ \ /* Define the memberFunction table */ \ - baseType::memberFunction##argNames##MemberFunctionTable* \ + baseType::memberFunction##argNames##MemberFunctionTableType* \ baseType::memberFunction##argNames##MemberFunctionTablePtr_(nullptr) @@ -176,7 +176,7 @@ Description constructed = true; \ baseType<Targ>::memberFunction##argNames##MemberFunctionTablePtr_ \ = new baseType<Targ>::memberFunction##argNames## \ - MemberFunctionTable; \ + MemberFunctionTableType; \ } \ } @@ -206,7 +206,7 @@ Description baseType,memberFunction,argNames,Targ) \ \ /* Define the memberFunction table */ \ - baseType<Targ>::memberFunction##argNames##MemberFunctionTable* \ + baseType<Targ>::memberFunction##argNames##MemberFunctionTableType* \ baseType<Targ>::memberFunction##argNames## \ MemberFunctionTablePtr_(nullptr) diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C index bdc8a8a1166..554def6e991 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C +++ b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C @@ -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. @@ -99,7 +99,7 @@ Foam::autoPtr<Foam::LESdelta> Foam::LESdelta::New const word& name, const turbulenceModel& turbulence, const dictionary& dict, - const dictionaryConstructorTable& additionalConstructors, + const dictionaryConstructorTableType& additionalConstructors, const word& lookupName ) { @@ -107,18 +107,15 @@ Foam::autoPtr<Foam::LESdelta> Foam::LESdelta::New Info<< "Selecting LES " << lookupName << " type " << deltaType << endl; - // First any additional ones - { - auto cstrIter = additionalConstructors.cfind(deltaType); + // Additional ones first + auto cstrIter = additionalConstructors.cfind(deltaType); - if (cstrIter.found()) - { - return autoPtr<LESdelta>(cstrIter()(name, turbulence, dict)); - } + // Regular ones + if (!cstrIter.found()) + { + cstrIter = dictionaryConstructorTablePtr_->cfind(deltaType); } - auto cstrIter = dictionaryConstructorTablePtr_->cfind(deltaType); - if (!cstrIter.found()) { FatalIOErrorInLookup @@ -126,9 +123,16 @@ Foam::autoPtr<Foam::LESdelta> Foam::LESdelta::New dict, "LESdelta", deltaType, - additionalConstructors - ) - << " and " << dictionaryConstructorTablePtr_->sortedToc() + *dictionaryConstructorTablePtr_ + ); + + if (additionalConstructors.size()) + { + FatalIOError + << " and " << additionalConstructors.sortedToc() << nl; + } + + FatalIOError << exit(FatalIOError); } diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.H b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.H index ba2edbcc9d9..52f1679e84f 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.H +++ b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.H @@ -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. @@ -53,10 +53,9 @@ namespace Foam class LESdelta { - protected: - // Protected data + // Protected Data const turbulenceModel& turbulenceModel_; @@ -121,7 +120,7 @@ public: const word& name, const turbulenceModel& turbulence, const dictionary& dict, - const dictionaryConstructorTable& additionalConstructors, + const dictionaryConstructorTableType& additionalConstructors, const word& lookupName = "delta" ); -- GitLab From 0bd113f537b2c4891782be2eb605acdf13de5c99 Mon Sep 17 00:00:00 2001 From: Mark Olesen <Mark.Olesen@esi-group.com> Date: Thu, 16 Sep 2021 10:48:08 +0200 Subject: [PATCH 3/6] ENH: refactored and simplified runtime declaration macros - improves future maintenance, avoids code/macro duplication --- .../construction/addToRunTimeSelectionTable.H | 71 +++-- .../construction/runTimeSelectionTables.H | 297 +++++++----------- .../addToMemberFunctionSelectionTable.H | 118 +++---- .../memberFunctionSelectionTables.H | 232 +++++--------- 4 files changed, 271 insertions(+), 447 deletions(-) diff --git a/src/OpenFOAM/db/runTimeSelection/construction/addToRunTimeSelectionTable.H b/src/OpenFOAM/db/runTimeSelection/construction/addToRunTimeSelectionTable.H index 56579765c86..dc839d6dab3 100644 --- a/src/OpenFOAM/db/runTimeSelection/construction/addToRunTimeSelectionTable.H +++ b/src/OpenFOAM/db/runTimeSelection/construction/addToRunTimeSelectionTable.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation + Copyright (C) 2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -26,6 +27,10 @@ License Description Macros for easy insertion into run-time selection tables +Note + The helper macro names used here must remain synchronized with + definitions in runTimeSelectionTables.H + \*---------------------------------------------------------------------------*/ #ifndef addToRunTimeSelectionTable_H @@ -33,88 +38,88 @@ Description // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -//- Add to hash-table of functions with typename as the key +//- Add to construction table with typeName as the key #define addToRunTimeSelectionTable\ (baseType,thisType,argNames) \ \ - /* Add the thisType constructor function to the table */ \ + /* Add thisType factory method to the table */ \ baseType::add##argNames##ConstructorToTable<thisType> \ add##thisType##argNames##ConstructorTo##baseType##Table_ -//- Add to hash-table of functions with 'lookup' as the key -#define addNamedToRunTimeSelectionTable\ -(baseType,thisType,argNames,lookup) \ - \ - /* Add the thisType constructor function to the table, find by lookup */ \ - baseType::add##argNames##ConstructorToTable<thisType> \ - add_##lookup##_##thisType##argNames##ConstructorTo##baseType##Table_ \ - (#lookup) - - -//- Add to hash-table of functions with typename as the key +//- Add to construction table with typeName as the key #define addRemovableToRunTimeSelectionTable\ (baseType,thisType,argNames) \ \ - /* Add the thisType constructor function to the table */ \ + /* Add thisType factory method to the table */ \ baseType::addRemovable##argNames##ConstructorToTable<thisType> \ addRemovable##thisType##argNames##ConstructorTo##baseType##Table_ -//- Add to hash-table of functions with 'lookup' as the key +//- Add to construction table with 'lookupName' as the key +#define addNamedToRunTimeSelectionTable\ +(baseType,thisType,argNames,lookupName) \ + \ + /* Add thisType factory method to the table, find by lookupName */ \ + baseType::add##argNames##ConstructorToTable<thisType> \ + add##thisType##argNames##ConstructorTo## \ + baseType##Table_##lookupName##_(#lookupName) + + +//- Add to construction table with 'lookupName' as the key #define addRemovableNamedToRunTimeSelectionTable\ -(baseType,thisType,argNames,lookup) \ +(baseType,thisType,argNames,lookupName) \ \ - /* Add the thisType constructor function to the table, find by lookup */ \ + /* Add thisType factory method to the table, find by lookupName */ \ baseType::addRemovable##argNames##ConstructorToTable<thisType> \ - addRemovable_##lookup##_##thisType##argNames##ConstructorTo \ - ##baseType##Table_(#lookup) + addRemovable##thisType##argNames##ConstructorTo## \ + baseType##Table_##lookupName##_(#lookupName) // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -//- Add to hash-table of functions with typename as the key. +//- Add to construction table with typeName as the key. // Use when baseType doesn't need a template argument (eg, is a typedef) #define addTemplateToRunTimeSelectionTable\ (baseType,thisType,Targ,argNames) \ \ - /* Add the thisType constructor function to the table */ \ + /* Add thisType factory method to the table */ \ baseType::add##argNames##ConstructorToTable<thisType<Targ>> \ add##thisType##Targ##argNames##ConstructorTo##baseType##Table_ -//- Add to hash-table of functions with 'lookup' as the key. +//- Add to construction table with 'lookupName' as the key. // Use when baseType doesn't need a template argument (eg, is a typedef) #define addNamedTemplateToRunTimeSelectionTable\ -(baseType,thisType,Targ,argNames,lookup) \ +(baseType,thisType,Targ,argNames,lookupName) \ \ - /* Add the thisType constructor function to the table, find by lookup */ \ + /* Add thisType factory method to the table, find by lookupName */ \ baseType::add##argNames##ConstructorToTable<thisType<Targ>> \ - add_##lookup##_##thisType##Targ##argNames##ConstructorTo##baseType \ - ##Table_(#lookup) + add##thisType##Targ##argNames##ConstructorTo## \ + baseType##Table_##lookupName##_(#lookupName) // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -//- Add to hash-table of functions with typename as the key. +//- Add to construction table with typeName as the key. // Use when baseType requires the Targ template argument as well #define addTemplatedToRunTimeSelectionTable\ (baseType,thisType,Targ,argNames) \ \ - /* Add the thisType constructor function to the table */ \ + /* Add thisType factory method to the table */ \ baseType<Targ>::add##argNames##ConstructorToTable<thisType<Targ>> \ add##thisType##Targ##argNames##ConstructorTo##baseType##Targ##Table_ -//- Add to hash-table of functions with 'lookup' as the key. +//- Add to construction table with 'lookupName' as the key. // Use when baseType requires the Targ template argument as well #define addNamedTemplatedToRunTimeSelectionTable\ -(baseType,thisType,Targ,argNames,lookup) \ +(baseType,thisType,Targ,argNames,lookupName) \ \ - /* Add the thisType constructor function to the table, find by lookup */ \ + /* Add thisType factory method to the table, find by lookupName */ \ baseType<Targ>::add##argNames##ConstructorToTable<thisType<Targ>> \ - add_##lookup##_##thisType##Targ##argNames##ConstructorTo##baseType## \ - Targ##Table_(#lookup) + add##thisType##Targ##argNames##ConstructorTo## \ + baseType##Targ##Table_##lookupName##_(#lookupName) // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/db/runTimeSelection/construction/runTimeSelectionTables.H b/src/OpenFOAM/db/runTimeSelection/construction/runTimeSelectionTables.H index 51b615a76bd..0fa16f0e6f3 100644 --- a/src/OpenFOAM/db/runTimeSelection/construction/runTimeSelectionTables.H +++ b/src/OpenFOAM/db/runTimeSelection/construction/runTimeSelectionTables.H @@ -45,58 +45,97 @@ Description // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -//- Declare a run-time selection -#define declareRunTimeSelectionTable(autoPtr,baseType,argNames,argList,parList)\ +// Common infrastructure + +// Not used directly: declare run-time selection (variables and methods) +#define declareRunTimeSelectionTableBase(returnType,prefix,argList) \ \ - /* Construct from argList function pointer type */ \ - typedef autoPtr<baseType> (*argNames##ConstructorPtr)argList; \ + /* Function pointer type: construct from argList */ \ + typedef returnType (*prefix##Ptr)argList; \ \ /* Function table type: construct from argList */ \ typedef ::Foam::HashTable \ < \ - argNames##ConstructorPtr, \ + prefix##Ptr, \ ::Foam::word, \ ::Foam::string::hasher \ - > argNames##ConstructorTableType; \ + > prefix##TableType; \ \ - /* Construct from argList function pointer table pointer */ \ - static argNames##ConstructorTableType* argNames##ConstructorTablePtr_; \ + /* Table singleton (storage) */ \ + static prefix##TableType* prefix##TablePtr_; \ \ - /* Table constructor called from the table add function */ \ - static void construct##argNames##ConstructorTables(); \ + /* Table construct/destruct helper */ \ + static void prefix##TablePtr_construct(bool load) + + +// Not used directly: storage and helper methods for runtime tables +#define defineRunTimeSelectionTableBase(baseType,prefix,Tspecialize) \ \ - /* Table destructor called from the table add function destructor */ \ - static void destroy##argNames##ConstructorTables(); \ + /* Define table singleton (storage) */ \ + Tspecialize prefix##TableType* prefix##TablePtr_(nullptr); \ \ - /* Class to add constructor from argList to table */ \ - template<class baseType##Type> \ - class add##argNames##ConstructorToTable \ + /* Table construct/destruct helper */ \ + Tspecialize void prefix##TablePtr_construct(bool load) \ { \ - public: \ + static bool constructed = false; \ + if (load) \ + { \ + if (!constructed) \ + { \ + prefix##TablePtr_ = new prefix##TableType; \ + constructed = true; \ + } \ + } \ + else if (prefix##TablePtr_) \ + { \ + delete prefix##TablePtr_; \ + prefix##TablePtr_ = nullptr; \ + constructed = false; \ + } \ + } + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +// +// Declaration Macros +// + +//- Declare a run-time selection (variables and adder classes) +// The ptrWrapper is typically a Foam::autoPtr or a Foam::tmp container. +#define declareRunTimeSelectionTable\ +(ptrWrapper,baseType,argNames,argList,parList) \ \ - static autoPtr<baseType> New argList \ + declareRunTimeSelectionTableBase( \ + ptrWrapper<baseType>, argNames##Constructor, argList); \ + \ + /* Helper to add constructor from argList to table */ \ + template<class baseType##Type> \ + struct add##argNames##ConstructorToTable \ + { \ + static ptrWrapper<baseType> New argList \ { \ - return autoPtr<baseType>(new baseType##Type parList); \ + return ptrWrapper<baseType>(new baseType##Type parList); \ } \ \ explicit add##argNames##ConstructorToTable \ ( \ - const ::Foam::word& lookup = baseType##Type::typeName \ + const ::Foam::word& k = baseType##Type::typeName \ ) \ { \ - construct##argNames##ConstructorTables(); \ - if (!argNames##ConstructorTablePtr_->insert(lookup, New)) \ + argNames##ConstructorTablePtr_construct(true); \ + if (!argNames##ConstructorTablePtr_->insert(k, New)) \ { \ - std::cerr<< "Duplicate entry " << lookup \ - << " in runtime selection table " << #baseType \ - << std::endl; \ - error::safePrintStack(std::cerr); \ + std::cerr \ + << "Duplicate entry " << k << " in runtime table " \ + << #baseType << std::endl; \ + ::Foam::error::safePrintStack(std::cerr); \ } \ } \ \ ~add##argNames##ConstructorToTable() \ { \ - destroy##argNames##ConstructorTables(); \ + argNames##ConstructorTablePtr_construct(false); \ } \ \ add##argNames##ConstructorToTable \ @@ -106,29 +145,27 @@ Description (const add##argNames##ConstructorToTable&) = delete; \ }; \ \ - /* Class to add constructor from argList to table */ \ + /* Helper to add constructor from argList to table */ \ /* Remove only the entry (not the table) upon destruction */ \ template<class baseType##Type> \ - class addRemovable##argNames##ConstructorToTable \ + struct addRemovable##argNames##ConstructorToTable \ { \ - public: \ - \ const ::Foam::word name; /* Lookup name for later removal */ \ \ - static autoPtr<baseType> New argList \ + static ptrWrapper<baseType> New argList \ { \ - return autoPtr<baseType>(new baseType##Type parList); \ + return ptrWrapper<baseType>(new baseType##Type parList); \ } \ \ explicit addRemovable##argNames##ConstructorToTable \ ( \ - const ::Foam::word& lookup = baseType##Type::typeName \ + const ::Foam::word& k = baseType##Type::typeName \ ) \ : \ - name(lookup) \ + name(k) \ { \ - construct##argNames##ConstructorTables(); \ - argNames##ConstructorTablePtr_->set(lookup, New); \ + argNames##ConstructorTablePtr_construct(true); \ + argNames##ConstructorTablePtr_->set(k, New); \ } \ \ ~addRemovable##argNames##ConstructorToTable() \ @@ -147,67 +184,40 @@ Description }; - //- Declare a run-time selection for derived classes -#define declareRunTimeNewSelectionTable( \ - autoPtr,baseType,argNames,argList,parList) \ - \ - /* Construct from argList function pointer type */ \ - typedef autoPtr<baseType> (*argNames##ConstructorPtr)argList; \ - \ - /* Function table type: construct from argList */ \ - typedef ::Foam::HashTable \ - < \ - argNames##ConstructorPtr, \ - ::Foam::word, \ - ::Foam::string::hasher \ - > argNames##ConstructorTableType; \ +#define declareRunTimeNewSelectionTable\ +(ptrWrapper,baseType,argNames,argList,parList) \ \ - /* Construct from argList function pointer table pointer */ \ - static argNames##ConstructorTableType* argNames##ConstructorTablePtr_; \ + declareRunTimeSelectionTableBase( \ + ptrWrapper<baseType>,argNames##Constructor,argList); \ \ - /* Table constructor called from the table add function */ \ - static void construct##argNames##ConstructorTables(); \ - \ - /* Table destructor called from the table add function destructor */ \ - static void destroy##argNames##ConstructorTables(); \ - \ - /* Class to add constructor from argList to table */ \ + /* Helper to add constructor from argList to table */ \ template<class baseType##Type> \ - class add##argNames##ConstructorToTable \ + struct add##argNames##ConstructorToTable \ { \ - public: \ - \ - static autoPtr<baseType> New##baseType argList \ + static ptrWrapper<baseType> New##baseType argList \ { \ - return autoPtr<baseType>(baseType##Type::New parList.ptr()); \ + return ptrWrapper<baseType>(baseType##Type::New parList.ptr()); \ } \ \ explicit add##argNames##ConstructorToTable \ ( \ - const ::Foam::word& lookup = baseType##Type::typeName \ + const ::Foam::word& k = baseType##Type::typeName \ ) \ { \ - construct##argNames##ConstructorTables(); \ - if \ - ( \ - !argNames##ConstructorTablePtr_->insert \ - ( \ - lookup, \ - New##baseType \ - ) \ - ) \ + argNames##ConstructorTablePtr_construct(true); \ + if (!argNames##ConstructorTablePtr_->insert(k, New##baseType)) \ { \ - std::cerr<< "Duplicate entry " << lookup \ - << " in runtime selection table " << #baseType \ - << std::endl; \ - error::safePrintStack(std::cerr); \ + std::cerr \ + << "Duplicate entry " << k << " in runtime table " \ + << #baseType << std::endl; \ + ::Foam::error::safePrintStack(std::cerr); \ } \ } \ \ ~add##argNames##ConstructorToTable() \ { \ - destroy##argNames##ConstructorTables(); \ + argNames##ConstructorTablePtr_construct(false); \ } \ \ add##argNames##ConstructorToTable \ @@ -217,32 +227,26 @@ Description (const add##argNames##ConstructorToTable&) = delete; \ }; \ \ - /* Class to add constructor from argList to table */ \ + /* Helper to add constructor from argList to table */ \ template<class baseType##Type> \ - class addRemovable##argNames##ConstructorToTable \ + struct addRemovable##argNames##ConstructorToTable \ { \ - public: \ - \ - const ::Foam::word name; /* Lookup name for later removal */ \ + const ::Foam::word name; /* Retain name for later removal */ \ \ - static autoPtr<baseType> New##baseType argList \ + static ptrWrapper<baseType> New##baseType argList \ { \ - return autoPtr<baseType>(baseType##Type::New parList.ptr()); \ + return ptrWrapper<baseType>(baseType##Type::New parList.ptr()); \ } \ \ explicit addRemovable##argNames##ConstructorToTable \ ( \ - const ::Foam::word& lookup = baseType##Type::typeName \ + const ::Foam::word& k = baseType##Type::typeName \ ) \ : \ - name(lookup) \ + name(k) \ { \ - construct##argNames##ConstructorTables(); \ - argNames##ConstructorTablePtr_->set \ - ( \ - lookup, \ - New##baseType \ - ); \ + argNames##ConstructorTablePtr_construct(true); \ + argNames##ConstructorTablePtr_->set(k, New##baseType); \ } \ \ ~addRemovable##argNames##ConstructorToTable() \ @@ -261,118 +265,33 @@ Description }; -// Constructor aid -#define defineRunTimeSelectionTableConstructor(baseType,argNames) \ - \ - /* Table constructor called from the table add function */ \ - void baseType::construct##argNames##ConstructorTables() \ - { \ - static bool constructed = false; \ - if (!constructed) \ - { \ - constructed = true; \ - baseType::argNames##ConstructorTablePtr_ \ - = new baseType::argNames##ConstructorTableType; \ - } \ - } - - -// Destructor aid -#define defineRunTimeSelectionTableDestructor(baseType,argNames) \ - \ - /* Table destructor called from the table add function destructor */ \ - void baseType::destroy##argNames##ConstructorTables() \ - { \ - if (baseType::argNames##ConstructorTablePtr_) \ - { \ - delete baseType::argNames##ConstructorTablePtr_; \ - baseType::argNames##ConstructorTablePtr_ = nullptr; \ - } \ - } - - -// Create pointer to hash-table of functions -#define defineRunTimeSelectionTablePtr(baseType,argNames) \ - \ - /* Define the constructor function table */ \ - baseType::argNames##ConstructorTableType* \ - baseType::argNames##ConstructorTablePtr_(nullptr) - - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// +// Definition Macros +// + //- Define run-time selection table #define defineRunTimeSelectionTable(baseType,argNames) \ \ - defineRunTimeSelectionTablePtr(baseType,argNames); \ - defineRunTimeSelectionTableConstructor(baseType,argNames); \ - defineRunTimeSelectionTableDestructor(baseType,argNames) + defineRunTimeSelectionTableBase( \ + baseType,baseType::argNames##Constructor,) //- Define run-time selection table for template classes // use when baseType doesn't need a template argument (eg, is a typedef) #define defineTemplateRunTimeSelectionTable(baseType,argNames) \ \ - template<> \ - defineRunTimeSelectionTablePtr(baseType,argNames); \ - template<> \ - defineRunTimeSelectionTableConstructor(baseType,argNames); \ - template<> \ - defineRunTimeSelectionTableDestructor(baseType,argNames) - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -// Constructor aid: use when baseType requires the Targ template argument -#define defineTemplatedRunTimeSelectionTableConstructor(baseType,argNames,Targ)\ - \ - /* Table constructor called from the table add function */ \ - void baseType<Targ>::construct##argNames##ConstructorTables() \ - { \ - static bool constructed = false; \ - if (!constructed) \ - { \ - constructed = true; \ - baseType<Targ>::argNames##ConstructorTablePtr_ \ - = new baseType<Targ>::argNames##ConstructorTableType; \ - } \ - } - - -// Destructor aid: use when baseType requires the Targ template argument -#define defineTemplatedRunTimeSelectionTableDestructor(baseType,argNames,Targ) \ - \ - /* Table destructor called from the table add function destructor */ \ - void baseType<Targ>::destroy##argNames##ConstructorTables() \ - { \ - if (baseType<Targ>::argNames##ConstructorTablePtr_) \ - { \ - delete baseType<Targ>::argNames##ConstructorTablePtr_; \ - baseType<Targ>::argNames##ConstructorTablePtr_ = nullptr; \ - } \ - } - - -//- Create pointer to hash-table of functions -// use when baseType requires the Targ template argument -#define defineTemplatedRunTimeSelectionTablePtr(baseType,argNames,Targ) \ - \ - /* Define the constructor function table */ \ - baseType<Targ>::argNames##ConstructorTableType* \ - baseType<Targ>::argNames##ConstructorTablePtr_(nullptr) + defineRunTimeSelectionTableBase( \ + baseType,baseType::argNames##Constructor,template<>) //- Define run-time selection table for template classes // use when baseType requires the Targ template argument #define defineTemplatedRunTimeSelectionTable(baseType,argNames,Targ) \ \ - template<> \ - defineTemplatedRunTimeSelectionTablePtr(baseType,argNames,Targ); \ - template<> \ - defineTemplatedRunTimeSelectionTableConstructor(baseType,argNames,Targ); \ - template<> \ - defineTemplatedRunTimeSelectionTableDestructor(baseType,argNames,Targ) + defineRunTimeSelectionTableBase( \ + baseType,baseType<Targ>::argNames##Constructor,template<>) // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/db/runTimeSelection/memberFunctions/addToMemberFunctionSelectionTable.H b/src/OpenFOAM/db/runTimeSelection/memberFunctions/addToMemberFunctionSelectionTable.H index 07f83717d7c..1fc559276f2 100644 --- a/src/OpenFOAM/db/runTimeSelection/memberFunctions/addToMemberFunctionSelectionTable.H +++ b/src/OpenFOAM/db/runTimeSelection/memberFunctions/addToMemberFunctionSelectionTable.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation + Copyright (C) 2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -29,6 +30,10 @@ InClass Description Macros for easy insertion into member function selection tables +Note + The helper macro names used here must remain synchronized with + definitions in memberFunctionSelectionTables.H + \*---------------------------------------------------------------------------*/ #ifndef addToMemberFunctionSelectionTable_H @@ -36,99 +41,70 @@ Description // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -// add to hash-table of functions with typename as the key +//- Add to hash-table of functions with typeName as the key. #define addToMemberFunctionSelectionTable\ -(baseType,thisType,memberFunction,argNames) \ +(baseType,thisType,funcName,argNames) \ \ - /* Add the thisType memberFunction to the table */ \ - baseType::add##memberFunction##argNames##MemberFunctionToTable<thisType> \ - add##thisType##memberFunction##argNames##MemberFunctionTo##baseType##Table_ + /* Add thisType funcName to the table */ \ + baseType::add##funcName##argNames##MemberFunctionToTable<thisType> \ + add##thisType##funcName##argNames##MemberFunctionTo##baseType##Table_ - -// add to hash-table of functions with 'lookup' as the key +//- Add to hash-table of functions with 'lookupName' as the key. #define addNamedToMemberFunctionSelectionTable\ -(baseType,thisType,memberFunction,argNames,lookup) \ +(baseType,thisType,funcName,argNames,lookupName) \ \ - /* Add the thisType memberFunction to the table, find by lookup name */ \ - baseType::add##memberFunction##argNames##MemberFunctionToTable<thisType> \ - add_##lookup##_##thisType##memberFunction##argNames##MemberFunctionTo## \ - baseType##Table_(#lookup) + /* Add thisType funcName to the table, find by lookup name */ \ + baseType::add##funcName##argNames##MemberFunctionToTable<thisType> \ + add##thisType##funcName##argNames##MemberFunctionTo## \ + baseType##Table_##lookupName##_(#lookupName) // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -// add to hash-table of functions with typename as the key -// use when baseType doesn't need a template argument (eg, is a typedef) +//- Add to hash-table of functions with typeName as the key. +// Use when baseType doesn't need a template argument (eg, is a typedef) #define addTemplateToMemberFunctionSelectionTable\ -(baseType,thisType,Targ,memberFunction,argNames) \ +(baseType,thisType,Targ,funcName,argNames) \ \ - /* Add the thisType memberFunction to the table */ \ - baseType::add##memberFunction##argNames## \ - MemberFunctionToTable<thisType<Targ>> \ - add##thisType##Targ##memberFunction##argNames##MemberFunctionTo## \ - baseType##Table_ + /* Add thisType funcName to the table */ \ + baseType::add##funcName##argNames##MemberFunctionToTable<thisType<Targ>> \ + add##thisType##Targ##funcName##argNames##MemberFunctionTo## \ + baseType##Table_ -// add to hash-table of functions with 'lookup' as the key -// use when baseType doesn't need a template argument (eg, is a typedef) +//- Add to hash-table of functions with 'lookupName' as the key. +// Use when baseType doesn't need a template argument (eg, is a typedef) #define addNamedTemplateToMemberFunctionSelectionTable\ -(baseType,thisType,Targ,memberFunction,argNames,lookup) \ +(baseType,thisType,Targ,funcName,argNames,lookupName) \ \ - /* Add the thisType memberFunction to the table, find by lookup name */ \ - baseType::add##memberFunction##argNames## \ - MemberFunctionToTable<thisType<Targ>> \ - add_##lookup##_##thisType##Targ##memberFunction##argNames## \ - MemberFunctionTo##baseType##Table_(#lookup) + /* Add thisType funcName to the table, find by lookupName */ \ + baseType::add##funcName##argNames##MemberFunctionToTable<thisType<Targ>> \ + add##thisType##Targ##funcName##argNames##MemberFunctionTo## \ + baseType##Table_##lookupName##_(#lookupName) -// use when baseType requires the Targ template argument as well -#define addTemplatedToMemberFunctionSelectionTable\ -(baseType,thisType,Targ,memberFunction,argNames) \ - \ - /* Add the thisType memberFunction to the table */ \ - baseType<Targ>::add##memberFunction##argNames## \ - MemberFunctionToTable<thisType<Targ>> \ - add##thisType##Targ##memberFunction##argNames##MemberFunctionTo## \ - baseType##Targ##Table_ -// use when baseType requires the Targ template argument as well -#define addNamedTemplatedToMemberFunctionSelectionTable\ -(baseType,thisType,Targ,memberFunction,argNames,lookup) \ - \ - /* Add the thisType memberFunction to the table, find by lookup name */ \ - baseType<Targ>::add##memberFunction##argNames## \ - MemberFunctionToTable<thisType<Targ>> \ - add_##lookup##_##thisType##Targ##memberFunction##argNames## \ - MemberFunctionTo##baseType##Targ##Table_(#lookup) - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - - -// add to hash-table of functions with typename as the key -// use when baseType requires the Targ template argument as well +//- Add to hash-table of functions with typeName as the key. +// Use when baseType requires the Targ template argument as well #define addTemplatedToMemberFunctionSelectionTable\ -(baseType,thisType,Targ,memberFunction,argNames) \ +(baseType,thisType,Targ,funcName,argNames) \ \ - /* Add the thisType memberFunction to the table */ \ - baseType<Targ>::add##memberFunction##argNames## \ - MemberFunctionToTable<thisType<Targ>> \ - add##thisType##Targ##memberFunction##argNames##MemberFunctionTo## \ - baseType##Targ##Table_ - - -// add to hash-table of functions with 'lookup' as the key -// use when baseType requires the Targ template argument as well + /* Add thisType funcName to the table */ \ + baseType<Targ>::add##funcName##argNames##MemberFunctionToTable \ + <thisType<Targ>> \ + add##thisType##Targ##funcName##argNames##MemberFunctionTo## \ + baseType##Targ##Table_ + +//- Add to hash-table of functions with 'lookupName' as the key. +// Use when baseType requires the Targ template argument as well #define addNamedTemplatedToMemberFunctionSelectionTable\ -(baseType,thisType,Targ,memberFunction,argNames,lookup) \ +(baseType,thisType,Targ,funcName,argNames,lookupName) \ \ - /* Add the thisType memberFunction to the table, find by lookup name */ \ - baseType<Targ>::add##memberFunction##argNames## \ - MemberFunctionToTable<thisType<Targ>> \ - add_##lookup##_##thisType##Targ##memberFunction##argNames## \ - MemberFunctionTo##baseType##Targ##Table_(#lookup) + /* Add thisType funcName to the table, find by lookupName */ \ + baseType<Targ>::add##funcName##argNames##MemberFunctionToTable \ + <thisType<Targ>> \ + add##thisType##Targ##funcName##argNames##MemberFunctionTo## \ + baseType##Targ##Table_##lookupName##_(#lookupName) // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/db/runTimeSelection/memberFunctions/memberFunctionSelectionTables.H b/src/OpenFOAM/db/runTimeSelection/memberFunctions/memberFunctionSelectionTables.H index b807c40f699..206007a9b2a 100644 --- a/src/OpenFOAM/db/runTimeSelection/memberFunctions/memberFunctionSelectionTables.H +++ b/src/OpenFOAM/db/runTimeSelection/memberFunctions/memberFunctionSelectionTables.H @@ -25,206 +25,130 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Description - Macros to enable the easy declaration of member function selection tables. + Macros to ease declaration of member function selection tables. -\*---------------------------------------------------------------------------*/ +Note + Uses macros from runTimeSelectionTables.H -#include "token.H" +\*---------------------------------------------------------------------------*/ #ifndef memberFunctionSelectionTables_H #define memberFunctionSelectionTables_H -#include "HashTable.H" +#include "runTimeSelectionTables.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -//- Declare a run-time selection: -#define declareMemberFunctionSelectionTable( \ - returnType,baseType,memberFunction,argNames,argList,parList) \ - \ - /* Construct from argList function pointer type */ \ - typedef returnType (*memberFunction##argNames##MemberFunctionPtr)argList; \ - \ - /* Construct from argList function table type */ \ - typedef ::Foam::HashTable \ - < \ - memberFunction##argNames##MemberFunctionPtr, \ - ::Foam::word, \ - ::Foam::string::hasher \ - > memberFunction##argNames##MemberFunctionTableType; \ +// +// Declaration Macros +// + +//- Declare a run-time member-function selection (variables and adder classes) +#define declareMemberFunctionSelectionTable\ +(returnType,baseType,funcName,argNames,argList,parListUnused) \ \ - /* Construct from argList function pointer table pointer */ \ - static memberFunction##argNames##MemberFunctionTableType* \ - memberFunction##argNames##MemberFunctionTablePtr_; \ + declareRunTimeSelectionTableBase( \ + returnType, funcName##argNames##MemberFunction, argList); \ \ - /* Class to add constructor from argList to table */ \ + /* Helper to add funcName to table */ \ template<class baseType##Type> \ - class add##memberFunction##argNames##MemberFunctionToTable \ + struct add##funcName##argNames##MemberFunctionToTable \ { \ - public: \ - \ - explicit add##memberFunction##argNames##MemberFunctionToTable \ + explicit add##funcName##argNames##MemberFunctionToTable \ ( \ - const ::Foam::word& lookup = baseType##Type::typeName \ + const ::Foam::word& k = baseType##Type::typeName \ ) \ { \ - construct##memberFunction##argNames##MemberFunctionTables(); \ - memberFunction##argNames##MemberFunctionTablePtr_->insert \ + funcName##argNames##MemberFunctionTablePtr_construct(true); \ + if \ ( \ - lookup, \ - baseType##Type::memberFunction \ - ); \ + !funcName##argNames##MemberFunctionTablePtr_ \ + ->insert(k, baseType##Type::funcName) \ + ) \ + { \ + std::cerr \ + << "Duplicate entry " << k << " in member table " \ + << #baseType << std::endl; \ + ::Foam::error::safePrintStack(std::cerr); \ + } \ } \ \ - ~add##memberFunction##argNames##MemberFunctionToTable() \ + ~add##funcName##argNames##MemberFunctionToTable() \ { \ - destroy##memberFunction##argNames##MemberFunctionTables(); \ + funcName##argNames##MemberFunctionTablePtr_construct(false); \ } \ - }; \ - \ - /* Table memberFunction called from the table add function */ \ - static void construct##memberFunction##argNames##MemberFunctionTables(); \ \ - /* Table destructor called from the table add function destructor */ \ - static void destroy##memberFunction##argNames##MemberFunctionTables() - - -// Constructor aid -#define defineMemberFunctionSelectionTableMemberFunction( \ - baseType,memberFunction,argNames) \ + add##funcName##argNames##MemberFunctionToTable \ + (const add##funcName##argNames##MemberFunctionToTable&) \ + = delete; \ + void operator= \ + (const add##funcName##argNames##MemberFunctionToTable&) \ + = delete; \ + }; \ \ - /* Table memberFunction called from the table add function */ \ - void baseType::construct##memberFunction##argNames##MemberFunctionTables() \ + /* Helper to add funcName to table */ \ + template<class baseType##Type> \ + struct addRemovable##funcName##argNames##MemberFunctionToTable \ { \ - static bool constructed = false; \ - if (!constructed) \ + const ::Foam::word name; /* Retain name for later removal */ \ + \ + explicit addRemovable##funcName##argNames##MemberFunctionToTable \ + ( \ + const ::Foam::word& k = baseType##Type::typeName \ + ) \ + : \ + name(k) \ { \ - constructed = true; \ - baseType::memberFunction##argNames##MemberFunctionTablePtr_ \ - = new baseType::memberFunction##argNames##MemberFunctionTableType; \ + funcName##argNames##MemberFunctionTablePtr_construct(true); \ + funcName##argNames##MemberFunctionTablePtr_ \ + ->set(k, baseType##Type::funcName); \ } \ - } - - -// Destructor aid -#define defineMemberFunctionSelectionTableDestructor( \ - baseType,memberFunction,argNames) \ \ - /* Table destructor called from the table add function destructor */ \ - void baseType::destroy##memberFunction##argNames##MemberFunctionTables() \ - { \ - if (baseType::memberFunction##argNames##MemberFunctionTablePtr_) \ + ~addRemovable##funcName##argNames##MemberFunctionToTable() \ { \ - delete baseType::memberFunction##argNames## \ - MemberFunctionTablePtr_; \ - baseType::memberFunction##argNames## \ - MemberFunctionTablePtr_ = nullptr; \ + if (funcName##argNames##MemberFunctionTablePtr_) \ + { \ + funcName##argNames##MemberFunctionTablePtr_->erase(name); \ + } \ } \ - } - - -// Create pointer to hash-table of functions -#define defineMemberFunctionSelectionTablePtr(baseType,memberFunction,argNames)\ \ - /* Define the memberFunction table */ \ - baseType::memberFunction##argNames##MemberFunctionTableType* \ - baseType::memberFunction##argNames##MemberFunctionTablePtr_(nullptr) + addRemovable##funcName##argNames##MemberFunctionToTable \ + (const addRemovable##funcName##argNames##MemberFunctionToTable&) \ + = delete; \ + void operator= \ + (const addRemovable##funcName##argNames##MemberFunctionToTable&) \ + = delete; \ + }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// +// Definition Macros +// + //- Define run-time selection table -#define defineMemberFunctionSelectionTable(baseType,memberFunction,argNames) \ +#define defineMemberFunctionSelectionTable(baseType,funcName,argNames) \ \ - defineMemberFunctionSelectionTablePtr \ - (baseType,memberFunction,argNames); \ - defineMemberFunctionSelectionTableMemberFunction \ - (baseType,memberFunction,argNames) \ - defineMemberFunctionSelectionTableDestructor \ - (baseType,memberFunction,argNames) + declareRunTimeSelectionTableBase( \ + baseType,baseType::funcName##argNames##MemberFunction,) //- Define run-time selection table for template classes // use when baseType doesn't need a template argument (eg, is a typedef) -#define defineTemplateMemberFunctionSelectionTable( \ - baseType,memberFunction,argNames) \ - \ - template<> \ - defineMemberFunctionSelectionTablePtr \ - (baseType,memberFunction,argNames); \ - template<> \ - defineMemberFunctionSelectionTableMemberFunction \ - (baseType,memberFunction,argNames) \ - template<> \ - defineMemberFunctionSelectionTableDestructor \ - (baseType,memberFunction,argNames) - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -// Constructor aid: use when baseType requires the Targ template argument -#define defineTemplatedMemberFunctionSelectionTableMemberFunction( \ - baseType,memberFunction,argNames,Targ) \ - \ - /* Table memberFunction called from the table add function */ \ - void baseType<Targ>::construct##memberFunction##argNames## \ - MemberFunctionTables() \ - { \ - static bool constructed = false; \ - if (!constructed) \ - { \ - constructed = true; \ - baseType<Targ>::memberFunction##argNames##MemberFunctionTablePtr_ \ - = new baseType<Targ>::memberFunction##argNames## \ - MemberFunctionTableType; \ - } \ - } - - -// Destructor aid -// use when baseType requires the Targ template argument -#define defineTemplatedMemberFunctionSelectionTableDestructor( \ - baseType,memberFunction,argNames,Targ) \ - \ - /* Table destructor called from the table add function destructor */ \ - void baseType<Targ>::destroy##memberFunction##argNames## \ - MemberFunctionTables() \ - { \ - if (baseType<Targ>::memberFunction##argNames##MemberFunctionTablePtr_) \ - { \ - delete baseType<Targ>::memberFunction##argNames## \ - MemberFunctionTablePtr_; \ - baseType<Targ>::memberFunction##argNames## \ - MemberFunctionTablePtr_ = nullptr; \ - } \ - } - - -// Create pointer to hash-table of functions -// use when baseType requires the Targ template argument -#define defineTemplatedMemberFunctionSelectionTablePtr( \ - baseType,memberFunction,argNames,Targ) \ +#define defineTemplateMemberFunctionSelectionTable(baseType,funcName,argNames) \ \ - /* Define the memberFunction table */ \ - baseType<Targ>::memberFunction##argNames##MemberFunctionTableType* \ - baseType<Targ>::memberFunction##argNames## \ - MemberFunctionTablePtr_(nullptr) + declareRunTimeSelectionTableBase( \ + baseType,baseType::funcName##argNames##MemberFunction,template<>) //- Define run-time selection table for template classes // use when baseType requires the Targ template argument -#define defineTemplatedMemberFunctionSelectionTable( \ - baseType,memberFunction,argNames,Targ) \ +#define defineTemplatedMemberFunctionSelectionTable\ +(baseType,funcName,argNames,Targ) \ \ - template<> \ - defineTemplatedMemberFunctionSelectionTablePtr \ - (baseType,memberFunction,argNames,Targ); \ - template<> \ - defineTemplatedMemberFunctionSelectionTableMemberFunction \ - (baseType,memberFunction,argNames,Targ) \ - template<> \ - defineTemplatedMemberFunctionSelectionTableDestructor \ - (baseType,memberFunction,argNames,Targ) + declareRunTimeSelectionTableBase( \ + baseType,baseType<Targ>::funcName##argNames##MemberFunction,template<>) // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -- GitLab From 794e23e083fe3412cc6e5054e906af5290c3e9e6 Mon Sep 17 00:00:00 2001 From: Mark Olesen <Mark.Olesen@esi-group.com> Date: Thu, 4 Nov 2021 11:39:39 +0100 Subject: [PATCH 4/6] ENH: add error::master() static for low-level messages - a Pstream::master with a Pstream::parRun guard in case Pstream has not yet been initialised, as will be the case for low-level messages during startup. - propagate relativeName handling into IOstreams --- src/OpenFOAM/db/IOobject/IOobjectReadHeader.C | 10 ++--- .../decomposedBlockData/decomposedBlockData.C | 12 +++--- .../db/IOstreams/IOstreams/IOstream.C | 10 ++++- .../db/IOstreams/IOstreams/IOstream.H | 4 ++ src/OpenFOAM/db/dictionary/dictionary.C | 41 ++++++++++--------- src/OpenFOAM/db/dictionary/dictionaryCompat.C | 13 ++---- .../dictionaryEntry/dictionaryEntry.H | 8 +++- src/OpenFOAM/db/dictionary/entry/entry.C | 26 +++++++++--- src/OpenFOAM/db/dictionary/entry/entry.H | 13 +++++- src/OpenFOAM/db/dictionary/entry/entryIO.C | 3 +- .../functionEntries/calcEntry/calcEntry.C | 5 ++- .../functionEntries/codeStream/codeStream.C | 2 +- .../functionEntries/evalEntry/evalEntry.C | 39 +++++++----------- .../functionEntry/functionEntry.C | 15 +++---- .../functionEntry/functionEntry.H | 22 +++++----- .../functionEntries/ifeqEntry/ifeqEntry.C | 4 +- .../includeEntry/includeEntry.C | 6 +-- .../includeEtcEntry/includeEtcEntry.C | 6 +-- .../primitiveEntry/primitiveEntry.H | 6 +++ .../primitiveEntry/primitiveEntryIO.C | 31 +++----------- src/OpenFOAM/db/error/IOerror.C | 15 ++++--- src/OpenFOAM/db/error/error.C | 24 ++++++++--- src/OpenFOAM/db/error/error.H | 11 ++++- src/OpenFOAM/db/error/messageStream.C | 4 +- src/OpenFOAM/global/argList/argList.C | 2 + .../primitives/strings/stringOps/stringOps.C | 6 +-- .../coordinate/systems/coordinateSystemNew.C | 30 +++++++------- .../coordinate/systems/coordinateSystems.C | 15 ++++--- .../coordinate/systems/cylindricalCS.C | 4 +- 29 files changed, 214 insertions(+), 173 deletions(-) diff --git a/src/OpenFOAM/db/IOobject/IOobjectReadHeader.C b/src/OpenFOAM/db/IOobject/IOobjectReadHeader.C index 04e9dac79b5..099b2d7e30e 100644 --- a/src/OpenFOAM/db/IOobject/IOobjectReadHeader.C +++ b/src/OpenFOAM/db/IOobject/IOobjectReadHeader.C @@ -84,7 +84,7 @@ bool Foam::IOobject::readHeader(dictionary& headerDict, Istream& is) { FatalIOErrorInFunction(is) << " stream not open for reading essential object from file " - << is.name() + << is.relativeName() << exit(FatalIOError); } @@ -92,7 +92,7 @@ bool Foam::IOobject::readHeader(dictionary& headerDict, Istream& is) { SeriousIOErrorInFunction(is) << " stream not open for reading from file " - << is.name() << endl; + << is.relativeName() << endl; } return false; @@ -135,8 +135,8 @@ bool Foam::IOobject::readHeader(dictionary& headerDict, Istream& is) FatalIOErrorInFunction(is) << " stream failure while reading header" << " on line " << is.lineNumber() - << " of file " << is.name() - << " for essential object" << name() + << " of file " << is.relativeName() + << " for essential object:" << name() << exit(FatalIOError); } @@ -145,7 +145,7 @@ bool Foam::IOobject::readHeader(dictionary& headerDict, Istream& is) InfoInFunction << "Stream failure while reading header" << " on line " << is.lineNumber() - << " of file " << is.name() << endl; + << " of file " << is.relativeName() << endl; } objState_ = BAD; diff --git a/src/OpenFOAM/db/IOobjects/decomposedBlockData/decomposedBlockData.C b/src/OpenFOAM/db/IOobjects/decomposedBlockData/decomposedBlockData.C index ac00d96cca4..f91e5d83a93 100644 --- a/src/OpenFOAM/db/IOobjects/decomposedBlockData/decomposedBlockData.C +++ b/src/OpenFOAM/db/IOobjects/decomposedBlockData/decomposedBlockData.C @@ -259,8 +259,8 @@ Foam::decomposedBlockData::readBlock if (!headerIO.readHeader(*realIsPtr)) { FatalIOErrorInFunction(*realIsPtr) - << "Problem while reading header for object " - << is.name() << nl + << "Problem while reading object header " + << is.relativeName() << nl << exit(FatalIOError); } } @@ -273,8 +273,8 @@ Foam::decomposedBlockData::readBlock if (!headerIO.readHeader(headerStream)) { FatalIOErrorInFunction(headerStream) - << "Problem while reading header for object " - << is.name() << nl + << "Problem while reading object header " + << is.relativeName() << nl << exit(FatalIOError); } streamOptData = static_cast<IOstreamOption>(headerStream); @@ -447,8 +447,8 @@ Foam::autoPtr<Foam::ISstream> Foam::decomposedBlockData::readBlocks if (!headerIO.readHeader(*realIsPtr)) { FatalIOErrorInFunction(*realIsPtr) - << "Problem while reading header for object " - << is.name() << nl + << "Problem while reading object header " + << is.relativeName() << nl << exit(FatalIOError); } } diff --git a/src/OpenFOAM/db/IOstreams/IOstreams/IOstream.C b/src/OpenFOAM/db/IOstreams/IOstreams/IOstream.C index a824586944c..66c6ff87f22 100644 --- a/src/OpenFOAM/db/IOstreams/IOstreams/IOstream.C +++ b/src/OpenFOAM/db/IOstreams/IOstreams/IOstream.C @@ -28,6 +28,7 @@ License #include "IOstream.H" #include "error.H" +#include "argList.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -48,6 +49,12 @@ Foam::fileName& Foam::IOstream::name() } +Foam::fileName Foam::IOstream::relativeName() const +{ + return argList::envRelativePath(this->name()); +} + + bool Foam::IOstream::check(const char* operation) const { return fatalCheck(operation); @@ -61,7 +68,8 @@ bool Foam::IOstream::fatalCheck(const char* operation) const if (!ok) { FatalIOErrorInFunction(*this) - << "error in IOstream " << name() << " for operation " << operation + << "error in IOstream " << relativeName() + << " for operation " << operation << exit(FatalIOError); } diff --git a/src/OpenFOAM/db/IOstreams/IOstreams/IOstream.H b/src/OpenFOAM/db/IOstreams/IOstreams/IOstream.H index 2ac6ca0b8e8..415fd7d8625 100644 --- a/src/OpenFOAM/db/IOstreams/IOstreams/IOstream.H +++ b/src/OpenFOAM/db/IOstreams/IOstreams/IOstream.H @@ -201,6 +201,10 @@ public: //- Return stream name for modification virtual fileName& name(); + //- Return the name of the stream relative to the current case. + // Uses argList::envRelativePath() + fileName relativeName() const; + // Check diff --git a/src/OpenFOAM/db/dictionary/dictionary.C b/src/OpenFOAM/db/dictionary/dictionary.C index 9ef4d995d68..cef7f9ea244 100644 --- a/src/OpenFOAM/db/dictionary/dictionary.C +++ b/src/OpenFOAM/db/dictionary/dictionary.C @@ -262,7 +262,7 @@ void Foam::dictionary::checkITstream "", // functionName "", // sourceFileName 0, // sourceFileLineNumber - this->name(), // ioFileName + relativeName(), // ioFileName == dictionary name is.lineNumber() // ioStartLineNumber ); @@ -284,7 +284,8 @@ void Foam::dictionary::checkITstream << remaining << " excess tokens in stream" << nl << nl; std::cerr - << "file: " << this->name() + // ioFileName == dictionary name + << "file: " << relativeName() << " at line " << is.lineNumber() << '.' << nl << std::endl; @@ -301,7 +302,7 @@ void Foam::dictionary::checkITstream "", // functionName "", // sourceFileName 0, // sourceFileLineNumber - this->name(), // ioFileName + relativeName(), // ioFileName == dictionary name is.lineNumber() // ioStartLineNumber ) << "Entry '" << keyword @@ -317,7 +318,8 @@ void Foam::dictionary::checkITstream << "' had no tokens in stream" << nl << nl; std::cerr - << "file: " << this->name() + // ioFileName == dictionary name + << "file: " << relativeName() << " at line " << is.lineNumber() << '.' << nl << std::endl; @@ -340,7 +342,7 @@ void Foam::dictionary::raiseBadInput "", // functionName "", // sourceFileName 0, // sourceFileLineNumber - this->name(), // ioFileName + relativeName(), // ioFileName == dictionary name is.lineNumber(), // ioStartLineNumber -1 // ioEndLineNumber ) @@ -401,7 +403,7 @@ const Foam::entry& Foam::dictionary::lookupEntry { FatalIOErrorInFunction(*this) << "Entry '" << keyword << "' not found in dictionary " - << name() << nl + << relativeName() << nl << exit(FatalIOError); } @@ -525,7 +527,7 @@ const Foam::dictionary& Foam::dictionary::subDict { FatalIOErrorInFunction(*this) << "Entry '" << keyword << "' not found in dictionary " - << name() << nl + << relativeName() << nl << exit(FatalIOError); } @@ -545,7 +547,7 @@ Foam::dictionary& Foam::dictionary::subDict { FatalIOErrorInFunction(*this) << "Entry '" << keyword << "' not found in dictionary " - << name() << nl + << relativeName() << nl << exit(FatalIOError); } @@ -574,7 +576,7 @@ Foam::dictionary& Foam::dictionary::subDictOrAdd FatalIOErrorInFunction(*this) << "Entry '" << keyword << "' is not a sub-dictionary in dictionary " - << name() << nl + << relativeName() << nl << exit(FatalIOError); } @@ -585,7 +587,7 @@ Foam::dictionary& Foam::dictionary::subDictOrAdd FatalIOErrorInFunction(*this) << "Failed to insert sub-dictionary '" << keyword << "' in dictionary " - << name() << nl + << relativeName() << nl << exit(FatalIOError); } @@ -613,7 +615,7 @@ Foam::dictionary Foam::dictionary::subOrEmptyDict FatalIOErrorInFunction(*this) << "Entry '" << keyword << "' is not a sub-dictionary in dictionary " - << name() << nl + << relativeName() << nl << exit(FatalIOError); } @@ -622,7 +624,7 @@ Foam::dictionary Foam::dictionary::subOrEmptyDict IOWarningInFunction(*this) << "Entry '" << keyword << "' found but not a sub-dictionary in dictionary " - << name() << endl; + << relativeName() << endl; } // The move constructor properly qualifies the dictionary name @@ -649,7 +651,7 @@ const Foam::dictionary& Foam::dictionary::optionalSubDict IOWarningInFunction(*this) << "Entry '" << keyword << "' found but not a sub-dictionary in dictionary " - << name() << endl; + << relativeName() << endl; } return *this; @@ -737,7 +739,7 @@ Foam::entry* Foam::dictionary::add(entry* entryPtr, bool mergeEntry) IOWarningInFunction(*this) << "Problem replacing entry "<< entryPtr->keyword() - << " in dictionary " << name() << endl; + << " in dictionary " << relativeName() << endl; parent_type::remove(entryPtr); @@ -765,7 +767,8 @@ Foam::entry* Foam::dictionary::add(entry* entryPtr, bool mergeEntry) IOWarningInFunction(*this) << "Attempt to add entry " << entryPtr->keyword() - << " which already exists in dictionary " << name() << endl; + << " which already exists in dictionary " + << relativeName() << endl; delete entryPtr; return nullptr; @@ -871,7 +874,7 @@ bool Foam::dictionary::merge(const dictionary& dict) { FatalIOErrorInFunction(*this) << "Attempted merge to self, for dictionary " - << name() << nl + << relativeName() << nl << abort(FatalIOError); } @@ -960,7 +963,7 @@ void Foam::dictionary::operator+=(const dictionary& rhs) { FatalIOErrorInFunction(*this) << "Attempted addition to self, for dictionary " - << name() << nl + << relativeName() << nl << abort(FatalIOError); } @@ -977,7 +980,7 @@ void Foam::dictionary::operator|=(const dictionary& rhs) { FatalIOErrorInFunction(*this) << "Attempted |= merging to self, for dictionary " - << name() << nl + << relativeName() << nl << abort(FatalIOError); } @@ -997,7 +1000,7 @@ void Foam::dictionary::operator<<=(const dictionary& rhs) { FatalIOErrorInFunction(*this) << "Attempted addition to self, for dictionary " - << name() << nl + << relativeName() << nl << abort(FatalIOError); } diff --git a/src/OpenFOAM/db/dictionary/dictionaryCompat.C b/src/OpenFOAM/db/dictionary/dictionaryCompat.C index c4668e57bf9..67fc7778667 100644 --- a/src/OpenFOAM/db/dictionary/dictionaryCompat.C +++ b/src/OpenFOAM/db/dictionary/dictionaryCompat.C @@ -50,21 +50,14 @@ Foam::dictionary::const_searcher Foam::dictionary::csearchCompat if (finder.good()) { - // Want single warning (on master), but guard with parRun to avoid - // Pstream::master() when Pstream has not yet been initialized - if - ( - (Pstream::parRun() ? Pstream::master() : true) - && error::warnAboutAge(alt.second) - ) + if (error::warnAboutAge(alt.second) && error::master()) { std::cerr << "--> FOAM IOWarning :" << nl << " Found [v" << alt.second << "] '" << alt.first << "' entry instead of '" << keyword.c_str() << "' in dictionary \"" - << name().c_str() << "\" " - << nl + << relativeName() << '"' << nl << std::endl; error::warnAboutAge("keyword", alt.second); @@ -113,7 +106,7 @@ const Foam::entry& Foam::dictionary::lookupEntryCompat { FatalIOErrorInFunction(*this) << "Entry '" << keyword << "' not found in dictionary " - << name() + << relativeName() << exit(FatalIOError); } diff --git a/src/OpenFOAM/db/dictionary/dictionaryEntry/dictionaryEntry.H b/src/OpenFOAM/db/dictionary/dictionaryEntry/dictionaryEntry.H index 21ed4be264a..1380f427d67 100644 --- a/src/OpenFOAM/db/dictionary/dictionaryEntry/dictionaryEntry.H +++ b/src/OpenFOAM/db/dictionary/dictionaryEntry/dictionaryEntry.H @@ -125,6 +125,12 @@ public: return dictionary::name(); } + //- Return scoped dictionary name relative to the current case + virtual fileName relativeName() const + { + return dictionary::relativeName(); + } + //- Return line number of first token in dictionary virtual label startLineNumber() const; @@ -132,7 +138,7 @@ public: virtual label endLineNumber() const; //- This entry is not a primitive, - // calling this function generates a FatalError + //- calling this function generates a FatalError virtual ITstream& stream() const; diff --git a/src/OpenFOAM/db/dictionary/entry/entry.C b/src/OpenFOAM/db/dictionary/entry/entry.C index 3e5fe338773..a357421a7fd 100644 --- a/src/OpenFOAM/db/dictionary/entry/entry.C +++ b/src/OpenFOAM/db/dictionary/entry/entry.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2015 OpenFOAM Foundation - Copyright (C) 2017-2019 OpenCFD Ltd. + Copyright (C) 2017-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -44,6 +44,20 @@ Foam::entry::inputMode Foam::entry::globalInputMode = inputMode::MERGE; // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * // +void Foam::entry::reportReadWarning +( + const IOstream& is, + const std::string& msg +) +{ + std::cerr + << "--> FOAM Warning :\n" + << " Reading \"" << is.relativeName() + << "\" at line " << is.lineNumber() << '\n' + << " " << msg << std::endl; +} + + void Foam::entry::resetInputMode() { globalInputMode = inputMode::MERGE; @@ -85,7 +99,7 @@ void Foam::entry::raiseBadInput(const ITstream& is) const "", // functionName "", // sourceFileName 0, // sourceFileLineNumber - this->name(), // ioFileName + this->relativeName(), // ioFileName is.lineNumber() // ioStartLineNumber ) << "Entry '" << keyword << "' with invalid input" << nl << nl @@ -110,7 +124,7 @@ void Foam::entry::checkITstream(const ITstream& is) const "", // functionName "", // sourceFileName 0, // sourceFileLineNumber - this->name(), // ioFileName + this->relativeName(), // ioFileName is.lineNumber() // ioStartLineNumber ); @@ -132,7 +146,7 @@ void Foam::entry::checkITstream(const ITstream& is) const << remaining << " excess tokens in stream" << nl << nl; std::cerr - << "file: " << this->name() + << "file: " << this->relativeName() << " at line " << is.lineNumber() << '.' << nl << std::endl; @@ -149,7 +163,7 @@ void Foam::entry::checkITstream(const ITstream& is) const "", // functionName "", // sourceFileName 0, // sourceFileLineNumber - this->name(), // ioFileName + this->relativeName(), // ioFileName is.lineNumber() // ioStartLineNumber ) << "Entry '" << keyword @@ -165,7 +179,7 @@ void Foam::entry::checkITstream(const ITstream& is) const << "' had no tokens in stream" << nl << nl; std::cerr - << "file: " << this->name() + << "file: " << this->relativeName() << " at line " << is.lineNumber() << '.' << nl << std::endl; diff --git a/src/OpenFOAM/db/dictionary/entry/entry.H b/src/OpenFOAM/db/dictionary/entry/entry.H index a180e93c236..e91f8aaca10 100644 --- a/src/OpenFOAM/db/dictionary/entry/entry.H +++ b/src/OpenFOAM/db/dictionary/entry/entry.H @@ -87,7 +87,7 @@ public: private: - // Private data + // Private Data //- Keyword of entry keyType keyword_; @@ -114,6 +114,14 @@ private: void raiseBadInput(const ITstream& is) const; +protected: + + // Protected Member Functions + + //- Report a read warning (on std::cerr) + static void reportReadWarning(const IOstream&, const std::string&); + + public: //- Enable or disable use of function entries and variable expansions. @@ -202,6 +210,9 @@ public: //- Return the entry name for modification virtual fileName& name() = 0; + //- Return the entry name relative to the current case + virtual fileName relativeName() const = 0; + //- Return line number of first token in dictionary virtual label startLineNumber() const = 0; diff --git a/src/OpenFOAM/db/dictionary/entry/entryIO.C b/src/OpenFOAM/db/dictionary/entry/entryIO.C index 48a0d9d83a6..886458d77f8 100644 --- a/src/OpenFOAM/db/dictionary/entry/entryIO.C +++ b/src/OpenFOAM/db/dictionary/entry/entryIO.C @@ -92,10 +92,11 @@ bool Foam::entry::getKeyword(keyType& keyword, Istream& is) << "--> FOAM Warning :" << nl << " From function " << FUNCTION_NAME << nl << " in file " << __FILE__ << " at line " << __LINE__ << nl - << " Reading " << is.name() << nl + << " Reading " << is.relativeName() << nl << " found " << keyToken << nl << " expected either " << token::END_BLOCK << " or EOF" << std::endl; + return false; } diff --git a/src/OpenFOAM/db/dictionary/functionEntries/calcEntry/calcEntry.C b/src/OpenFOAM/db/dictionary/functionEntries/calcEntry/calcEntry.C index 94c128ef7d2..cf3b0734de9 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/calcEntry/calcEntry.C +++ b/src/OpenFOAM/db/dictionary/functionEntries/calcEntry/calcEntry.C @@ -68,8 +68,9 @@ Foam::string Foam::functionEntries::calcEntry::evaluate ) { DetailInfo - << "Using #calc at line " << is.lineNumber() - << " in file " << parentDict.name() << endl; + << "Using #calc - line " + << is.lineNumber() << " in file " + << parentDict.relativeName() << nl; dynamicCode::checkSecurity ( diff --git a/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.C b/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.C index 78d33f45537..2eedd92ce76 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.C +++ b/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.C @@ -356,7 +356,7 @@ Foam::string Foam::functionEntries::codeStream::evaluate { DetailInfo << "Using #codeStream at line " << is.lineNumber() - << " in file " << parentDict.name() << endl; + << " in file " << parentDict.relativeName() << endl; dynamicCode::checkSecurity ( diff --git a/src/OpenFOAM/db/dictionary/functionEntries/evalEntry/evalEntry.C b/src/OpenFOAM/db/dictionary/functionEntries/evalEntry/evalEntry.C index efce884ea61..89d153a31ae 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/evalEntry/evalEntry.C +++ b/src/OpenFOAM/db/dictionary/functionEntries/evalEntry/evalEntry.C @@ -58,25 +58,6 @@ namespace functionEntries // * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * // -namespace -{ - // This is akin to a SafeIOWarning, which does not yet exist - inline void safeIOWarning - ( - const Foam::IOstream& is, - const std::string& msg - ) - { - std::cerr - << "--> FOAM Warning :\n" - << " Reading \"" << is.name() << "\" at line " - << is.lineNumber() << '\n' - << " " << msg << std::endl; - } - -} // End anonymous namespace - - namespace Foam { @@ -158,8 +139,6 @@ static bool slurpUntilBalancedBrace(ISstream& is, std::string& str) str.append(buf, nChar); // Finalize pending content - safeIOWarning(is, "Premature end while reading expression - missing '}'?"); - is.fatalCheck(FUNCTION_NAME); return false; } @@ -252,7 +231,8 @@ Foam::tokenList Foam::functionEntries::evalEntry::evaluate { InfoErr << "Empty #eval - line " - << is.lineNumber() << " in file " << parentDict.name() << nl; + << is.lineNumber() << " in file " + << parentDict.relativeName() << nl; return tokenList(); } @@ -268,7 +248,8 @@ Foam::tokenList Foam::functionEntries::evalEntry::evaluate { InfoErr << "Failed #eval - line " - << is.lineNumber() << " in file " << parentDict.name() << nl; + << is.lineNumber() << " in file " + << parentDict.relativeName() << nl; return tokenList(); } @@ -296,7 +277,8 @@ Foam::tokenList Foam::functionEntries::evalEntry::evaluate #ifdef FULLDEBUG DetailInfo << "Using #eval - line " - << is.lineNumber() << " in file " << parentDict.name() << nl; + << is.lineNumber() << " in file " + << parentDict.relativeName() << nl; #endif token tok(is); @@ -321,7 +303,14 @@ Foam::tokenList Foam::functionEntries::evalEntry::evaluate else if (tok.isPunctuation(token::BEGIN_BLOCK)) { // - #eval { expr } - slurpUntilBalancedBrace(dynamic_cast<ISstream&>(is), str); + if (!slurpUntilBalancedBrace(dynamic_cast<ISstream&>(is), str)) + { + reportReadWarning + ( + is, + "Premature end while reading expression - missing '}'?" + ); + } } else { diff --git a/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.C b/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.C index 837221ad306..62664f00dfe 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.C +++ b/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation + Copyright (C) 2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -71,7 +72,7 @@ Foam::functionEntry::functionEntry : primitiveEntry ( - word(key+dict.name()+Foam::name(is.lineNumber())), + word(key + dict.name() + Foam::name(is.lineNumber())), readLine(key, is) ) {} @@ -106,9 +107,9 @@ bool Foam::functionEntry::execute { FatalErrorInFunction << "Unknown functionEntry '" << functionName - << "' in " << is.name() << " near line " << is.lineNumber() - << nl << nl - << "Valid functionEntries :" << endl + << "' in " << is.relativeName() + << " near line " << is.lineNumber() << nl << nl + << "Valid functionEntries :" << nl << executedictionaryIstreamMemberFunctionTablePtr_->sortedToc() << exit(FatalError); } @@ -148,9 +149,9 @@ bool Foam::functionEntry::execute { FatalErrorInFunction << "Unknown functionEntry '" << functionName - << "' in " << is.name() << " near line " << is.lineNumber() - << nl << nl - << "Valid functionEntries :" << endl + << "' in " << is.relativeName() + << " near line " << is.lineNumber() << nl << nl + << "Valid functionEntries :" << nl << executeprimitiveEntryIstreamMemberFunctionTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.H b/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.H index 8eaca871562..9b796f3f60c 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.H +++ b/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation + Copyright (C) 2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -48,15 +49,15 @@ SourceFiles #ifndef functionEntry_H #define functionEntry_H -#include "word.H" -#include "memberFunctionSelectionTables.H" #include "primitiveEntry.H" +#include "memberFunctionSelectionTables.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { +// Forward Declarations class dictionary; /*---------------------------------------------------------------------------*\ @@ -67,17 +68,10 @@ class functionEntry : public primitiveEntry { - // Private Member Functions - - //- No copy construct - functionEntry(const functionEntry&) = delete; - - //- No copy assignment - void operator=(const functionEntry&) = delete; - - protected: + // Protected Member Functions + //- Read line and return as a string token static token readLine(const word& key, Istream& is); @@ -86,6 +80,12 @@ protected: template<class StringType> static List<StringType> readStringList(Istream& is); + //- No copy construct + functionEntry(const functionEntry&) = delete; + + //- No copy assignment + void operator=(const functionEntry&) = delete; + public: // Constructors diff --git a/src/OpenFOAM/db/dictionary/functionEntries/ifeqEntry/ifeqEntry.C b/src/OpenFOAM/db/dictionary/functionEntries/ifeqEntry/ifeqEntry.C index ab4979f5a93..5e77c6c68a9 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/ifeqEntry/ifeqEntry.C +++ b/src/OpenFOAM/db/dictionary/functionEntries/ifeqEntry/ifeqEntry.C @@ -391,8 +391,8 @@ bool Foam::functionEntries::ifeqEntry::execute if (ifEntry::isTrue(e.stream())) { - // Info<< "Using #elif " << doIf << " at line " << lineNo - // << " in file " << is.name() << endl; + // Info<< "Using #elif " << doIf << " - line " << lineNo + // << " in file " << is.relativeName() << endl; break; } } diff --git a/src/OpenFOAM/db/dictionary/functionEntries/includeEntry/includeEntry.C b/src/OpenFOAM/db/dictionary/functionEntries/includeEntry/includeEntry.C index 6e7fd29ab8b..78620c7da3e 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/includeEntry/includeEntry.C +++ b/src/OpenFOAM/db/dictionary/functionEntries/includeEntry/includeEntry.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2018-2020 OpenCFD Ltd. + Copyright (C) 2018-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -170,7 +170,7 @@ bool Foam::functionEntries::includeEntry::execute FatalIOErrorInFunction(is) << "Cannot open include file " << (ifs.name().size() ? ifs.name() : rawName) - << " while reading dictionary " << parentDict.name() + << " while reading dictionary " << parentDict.relativeName() << exit(FatalIOError); return false; @@ -222,7 +222,7 @@ bool Foam::functionEntries::includeEntry::execute FatalIOErrorInFunction(is) << "Cannot open include file " << (ifs.name().size() ? ifs.name() : rawName) - << " while reading dictionary " << parentDict.name() + << " while reading dictionary " << parentDict.relativeName() << exit(FatalIOError); return false; diff --git a/src/OpenFOAM/db/dictionary/functionEntries/includeEtcEntry/includeEtcEntry.C b/src/OpenFOAM/db/dictionary/functionEntries/includeEtcEntry/includeEtcEntry.C index 9431a57a922..9c55a6f0c92 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/includeEtcEntry/includeEtcEntry.C +++ b/src/OpenFOAM/db/dictionary/functionEntries/includeEtcEntry/includeEtcEntry.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2015-2017 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -138,7 +138,7 @@ bool Foam::functionEntries::includeEtcEntry::execute FatalIOErrorInFunction(is) << "Cannot open etc file " << (ifs.name().size() ? ifs.name() : rawName) - << " while reading dictionary " << parentDict.name() + << " while reading dictionary " << parentDict.relativeName() << exit(FatalIOError); return false; @@ -178,7 +178,7 @@ bool Foam::functionEntries::includeEtcEntry::execute FatalIOErrorInFunction(is) << "Cannot open etc file " << (ifs.name().size() ? ifs.name() : rawName) - << " while reading dictionary " << parentDict.name() + << " while reading dictionary " << parentDict.relativeName() << exit(FatalIOError); return false; diff --git a/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntry.H b/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntry.H index f05a9b19c65..14e0dfb5baa 100644 --- a/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntry.H +++ b/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntry.H @@ -155,6 +155,12 @@ public: return ITstream::name(); } + //- Return token stream name relative to the current case + virtual fileName relativeName() const + { + return ITstream::relativeName(); + } + //- Return line number of first token in dictionary virtual label startLineNumber() const; diff --git a/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntryIO.C b/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntryIO.C index 5dccf2fb0ab..713351dc12a 100644 --- a/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntryIO.C +++ b/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntryIO.C @@ -30,27 +30,6 @@ License #include "functionEntry.H" #include "evalEntry.H" -// * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * // - -namespace -{ - // This is akin to a SafeIOWarning, which does not yet exist - inline void safeIOWarning - ( - const Foam::IOstream& is, - const std::string& msg - ) - { - std::cerr - << "--> FOAM Warning :\n" - << " Reading \"" << is.name() << "\" at line " - << is.lineNumber() << '\n' - << " " << msg << std::endl; - } - -} // End anonymous namespace - - // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // bool Foam::primitiveEntry::acceptToken @@ -182,7 +161,7 @@ bool Foam::primitiveEntry::read(const dictionary& dict, Istream& is) --depth; if (depth < 0) { - safeIOWarning + reportReadWarning ( is, "Too many closing ')' ... was a ';' forgotten?" @@ -191,7 +170,7 @@ bool Foam::primitiveEntry::read(const dictionary& dict, Istream& is) else if (depth < 61 && ((balanced >> depth) & 1u)) { // Bit was set, but expected it to be unset. - safeIOWarning(is, "Imbalanced '{' with ')'"); + reportReadWarning(is, "Imbalanced '{' with ')'"); } } break; @@ -201,7 +180,7 @@ bool Foam::primitiveEntry::read(const dictionary& dict, Istream& is) --depth; if (depth < 0) { - safeIOWarning + reportReadWarning ( is, "Too many closing '}' ... was a ';' forgotten?" @@ -210,7 +189,7 @@ bool Foam::primitiveEntry::read(const dictionary& dict, Istream& is) else if (depth < 61 && !((balanced >> depth) & 1u)) { // Bit was unset, but expected it to be set. - safeIOWarning(is, "Imbalanced '(' with '}'"); + reportReadWarning(is, "Imbalanced '(' with '}'"); } } break; @@ -230,7 +209,7 @@ bool Foam::primitiveEntry::read(const dictionary& dict, Istream& is) if (depth) { - safeIOWarning(is, "Imbalanced brackets"); + reportReadWarning(is, "Imbalanced brackets"); } is.fatalCheck(FUNCTION_NAME); diff --git a/src/OpenFOAM/db/error/IOerror.C b/src/OpenFOAM/db/error/IOerror.C index ec1c7836d2b..7f1084498dd 100644 --- a/src/OpenFOAM/db/error/IOerror.C +++ b/src/OpenFOAM/db/error/IOerror.C @@ -27,7 +27,6 @@ License \*---------------------------------------------------------------------------*/ #include "error.H" -#include "argList.H" #include "StringStream.H" #include "fileName.H" #include "dictionary.H" @@ -100,7 +99,7 @@ Foam::OSstream& Foam::IOerror::operator() functionName, sourceFileName, sourceFileLineNumber, - argList::envRelativePath(ioStream.name()), + ioStream.relativeName(), ioStream.lineNumber(), -1 // No known endLineNumber ); @@ -137,8 +136,8 @@ Foam::OSstream& Foam::IOerror::operator() ( where.c_str(), "", // No source file - 1, // Non-zero to ensure that 'where' is reported - argList::envRelativePath(ioStream.name()), + -1, // Non-zero to ensure 'where' is reported + ioStream.relativeName(), ioStream.lineNumber(), -1 // No known endLineNumber ); @@ -155,7 +154,7 @@ Foam::OSstream& Foam::IOerror::operator() ( where.c_str(), "", // No source file - 1, // Non-zero to ensure that 'where' is reported + -1, // Non-zero to ensure 'where' is reported dict.relativeName(), dict.startLineNumber(), dict.endLineNumber() @@ -188,7 +187,7 @@ void Foam::IOerror::SafeFatalIOError << nl << "--> FOAM FATAL IO ERROR:" << nl << msg << nl - << "file: " << ioStream.name() + << "file: " << ioStream.relativeName() << " at line " << ioStream.lineNumber() << '.' << nl << nl << " From " << functionName << nl << " in file " << sourceFileName @@ -253,7 +252,7 @@ void Foam::IOerror::abort() } -void Foam::IOerror::write(Ostream& os, const bool includeTitle) const +void Foam::IOerror::write(Ostream& os, const bool withTitle) const { if (os.bad()) { @@ -261,7 +260,7 @@ void Foam::IOerror::write(Ostream& os, const bool includeTitle) const } os << nl; - if (includeTitle && !title().empty()) + if (withTitle && !title().empty()) { os << title().c_str() << "(openfoam-" << foamVersion::api; diff --git a/src/OpenFOAM/db/error/error.C b/src/OpenFOAM/db/error/error.C index 50aebea8160..c3acb23a03d 100644 --- a/src/OpenFOAM/db/error/error.C +++ b/src/OpenFOAM/db/error/error.C @@ -38,6 +38,20 @@ License // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * // +bool Foam::error::master(const label communicator) +{ + // Trap negative value for comm as 'default'. This avoids direct use + // of Pstream::worldComm which may not have been initialised + + return + ( + UPstream::parRun() + ? (communicator < 0 ? UPstream::master() : UPstream::master(communicator)) + : true + ); +} + + bool Foam::error::warnAboutAge(const int version) noexcept { // No warning for 0 (unversioned) or -ve values (silent versioning) @@ -245,20 +259,20 @@ void Foam::error::simpleExit(const int errNo, const bool isAbort) error::printStack(Perr); std::abort(); } - else if (Pstream::parRun()) + else if (UPstream::parRun()) { if (isAbort) { Perr<< nl << *this << nl << "\nFOAM parallel run aborting\n" << endl; error::printStack(Perr); - Pstream::abort(); + UPstream::abort(); } else { Perr<< nl << *this << nl << "\nFOAM parallel run exiting\n" << endl; - Pstream::exit(errNo); + UPstream::exit(errNo); } } else @@ -326,7 +340,7 @@ void Foam::error::abort() } -void Foam::error::write(Ostream& os, const bool includeTitle) const +void Foam::error::write(Ostream& os, const bool withTitle) const { if (os.bad()) { @@ -334,7 +348,7 @@ void Foam::error::write(Ostream& os, const bool includeTitle) const } os << nl; - if (includeTitle && !title().empty()) + if (withTitle && !title().empty()) { os << title().c_str() << "(openfoam-" << foamVersion::api; diff --git a/src/OpenFOAM/db/error/error.H b/src/OpenFOAM/db/error/error.H index 931896bf071..22fe3ad136a 100644 --- a/src/OpenFOAM/db/error/error.H +++ b/src/OpenFOAM/db/error/error.H @@ -119,6 +119,13 @@ public: // Static Functions + //- Like Pstream::master but with a Pstream::parRun guard in case + //- Pstream has not yet been initialised. + // + // \param communicator is the numbered MPI communicator. + // By default it uses UPstream::worldComm + static bool master(const label communicator = -1); + //- Test if an age warning should be emitted. // \param version is the old version (YYMM) for determining the // age in months compared to the current OpenFOAM version @@ -244,7 +251,7 @@ public: void abort(); //- Print error message - virtual void write(Ostream& os, const bool includeTitle = true) const; + virtual void write(Ostream& os, const bool withTitle = true) const; // Housekeeping @@ -405,7 +412,7 @@ public: void abort(); //- Print error message - virtual void write(Ostream& os, const bool includeTitle = true) const; + virtual void write(Ostream& os, const bool withTitle = true) const; }; diff --git a/src/OpenFOAM/db/error/messageStream.C b/src/OpenFOAM/db/error/messageStream.C index c0fdd7d6c7a..064a95ea879 100644 --- a/src/OpenFOAM/db/error/messageStream.C +++ b/src/OpenFOAM/db/error/messageStream.C @@ -80,10 +80,10 @@ Foam::OSstream& Foam::messageStream::stream(OSstream* alternative) || severity_ == INFO_STDERR || severity_ == WARNING ) - || !Pstream::parRun() + || !UPstream::parRun() ); - if (serialOnly && (Pstream::parRun() && !Pstream::master())) + if (serialOnly && (UPstream::parRun() && !UPstream::master())) { return Snull; // Non-serial, non-master: exit early } diff --git a/src/OpenFOAM/global/argList/argList.C b/src/OpenFOAM/global/argList/argList.C index ddeb11f77f7..8179f39dd28 100644 --- a/src/OpenFOAM/global/argList/argList.C +++ b/src/OpenFOAM/global/argList/argList.C @@ -571,6 +571,7 @@ Foam::word Foam::argList::optionCompat(const word& optName) { const auto& alt = fnd.val(); + // No error::master() guard - only called on master anyhow if (error::warnAboutAge(alt.second)) { std::cerr @@ -609,6 +610,7 @@ int Foam::argList::optionIgnore(const word& optName) // '-option ARG' or '-option' const int nskip = (alt.first ? 2 : 1); + // No error::master() guard - only called on master anyhow if (error::warnAboutAge(alt.second)) { std::cerr diff --git a/src/OpenFOAM/primitives/strings/stringOps/stringOps.C b/src/OpenFOAM/primitives/strings/stringOps/stringOps.C index 63a7a5a60c7..c544b1ad998 100644 --- a/src/OpenFOAM/primitives/strings/stringOps/stringOps.C +++ b/src/OpenFOAM/primitives/strings/stringOps/stringOps.C @@ -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. @@ -161,9 +161,7 @@ static void expandLeadingTilde(std::string& s) // Compat Warning const int version(1806); - // Single warning (on master) with guard to avoid Pstream::master() - // when Pstream has not yet been initialized - if (UPstream::parRun() ? UPstream::master() : true) + if (error::master()) { std::cerr << nl diff --git a/src/meshTools/coordinate/systems/coordinateSystemNew.C b/src/meshTools/coordinate/systems/coordinateSystemNew.C index 4db528d396e..834f1b4183c 100644 --- a/src/meshTools/coordinate/systems/coordinateSystemNew.C +++ b/src/meshTools/coordinate/systems/coordinateSystemNew.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2015 OpenFOAM Foundation - Copyright (C) 2018-2020 OpenCFD Ltd. + Copyright (C) 2018-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -56,19 +56,21 @@ const Foam::dictionary* Foam::coordinateSystem::subDictCompat const word csName(finder.ref().stream()); // Deprecated, unsupported syntax - - std::cerr - << "--> FOAM IOWarning :" << nl - << " Ignoring 'coordinateSystem' as a keyword." - " Perhaps you meant this instead?" << nl - << '{' << nl - << " type " << coordSystem::indirect::typeName_() - << ';' << nl - << " name " << csName << ';' << nl - << '}' << nl - << std::endl; - - error::warnAboutAge("syntax change", 1806); + if (error::master()) + { + std::cerr + << "--> FOAM IOWarning :" << nl + << " Ignoring 'coordinateSystem' as a keyword." + " Perhaps you meant this instead?" << nl + << '{' << nl + << " type " << coordSystem::indirect::typeName_() + << ';' << nl + << " name " << csName << ';' << nl + << '}' << nl + << std::endl; + + error::warnAboutAge("syntax change", 1806); + } } } diff --git a/src/meshTools/coordinate/systems/coordinateSystems.C b/src/meshTools/coordinate/systems/coordinateSystems.C index ce9eb81152b..0581a897a93 100644 --- a/src/meshTools/coordinate/systems/coordinateSystems.C +++ b/src/meshTools/coordinate/systems/coordinateSystems.C @@ -60,12 +60,15 @@ void Foam::coordinateSystems::readFromStream(const bool valid) else if (headerClassName() == headerTypeCompat) { // Older (1806 and earlier) header name - std::cerr - << "--> FOAM IOWarning :" << nl - << " Found header class name '" << headerTypeCompat - << "' instead of '" << typeName << "'" << nl; - - error::warnAboutAge("header class", 1806); + if (error::master()) + { + std::cerr + << "--> FOAM IOWarning :" << nl + << " Found header class name '" << headerTypeCompat + << "' instead of '" << typeName << "'" << nl; + + error::warnAboutAge("header class", 1806); + } this->readIstream(is, coordinateSystem::iNew()); close(); diff --git a/src/meshTools/coordinate/systems/cylindricalCS.C b/src/meshTools/coordinate/systems/cylindricalCS.C index a4884af3e1f..6b75f35a90f 100644 --- a/src/meshTools/coordinate/systems/cylindricalCS.C +++ b/src/meshTools/coordinate/systems/cylindricalCS.C @@ -55,12 +55,12 @@ namespace Foam static inline void warnCompatDegrees(const Foam::dictionary& dict) { - if (Pstream::parRun() ? Pstream::master() : true) + if (error::master()) { std::cerr << "--> FOAM IOWarning :" << nl << " Found [v1806] 'degrees' keyword in dictionary \"" - << dict.name().c_str() << "\" Ignored, now radians only." << nl + << dict.relativeName() << "\" Ignored, now radians only." << nl << std::endl; } } -- GitLab From 4fc6ec1d1d1c6cd4a537de21e34caa23255f8450 Mon Sep 17 00:00:00 2001 From: Mark Olesen <Mark.Olesen@esi-group.com> Date: Thu, 15 Jul 2021 01:05:30 +0200 Subject: [PATCH 5/6] ENH: define singleton-style lookups for runTime selection, alias handling - this makes the lookup and use of tables slightly cleaner and provides a hook for update (compat) messages The singleton-style method returns the function pointer directly, or nullptr on not-found. NEW access method (mnemonic: 'ctor' prefix for constructors) ``` auto* ctorPtr = dictionaryConstructorTable(modelType); if (!ctorPtr) { ... } return autoPtr<myModel>(ctorPtr(dict, ...)); ``` OLD method, which also still works, but without any compat handling: ``` auto ctorIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!ctorIter.found()) { ... } return autoPtr<myModel>(ctorIter()(dict, ...)); ``` --- .../construction/addToRunTimeSelectionTable.H | 31 ++++++ .../construction/runTimeSelectionTables.H | 102 +++++++++++++++++- .../addToMemberFunctionSelectionTable.H | 33 ++++++ .../memberFunctionSelectionTables.H | 22 +++- 4 files changed, 184 insertions(+), 4 deletions(-) diff --git a/src/OpenFOAM/db/runTimeSelection/construction/addToRunTimeSelectionTable.H b/src/OpenFOAM/db/runTimeSelection/construction/addToRunTimeSelectionTable.H index dc839d6dab3..885c8bcab40 100644 --- a/src/OpenFOAM/db/runTimeSelection/construction/addToRunTimeSelectionTable.H +++ b/src/OpenFOAM/db/runTimeSelection/construction/addToRunTimeSelectionTable.H @@ -76,6 +76,16 @@ Note baseType##Table_##lookupName##_(#lookupName) +//- Add lookup alias for runTime selection +#define addAliasToRunTimeSelectionTable\ +(baseType,thisType,argNames,lookup,other,ver) \ + \ + /* Add thisType constructor function to the table, find by lookup */ \ + baseType::addAlias##argNames##ConstructorToTable<thisType> \ + add##thisType##argNames##ConstructorTo##baseType##Table_ \ + ##lookup##_##other##_(#lookup,#other,ver) + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // //- Add to construction table with typeName as the key. @@ -99,6 +109,16 @@ Note baseType##Table_##lookupName##_(#lookupName) +//- Add lookup alias for for runTime selection +#define addAliasTemplateToRunTimeSelectionTable\ +(baseType,thisType,Targ,argNames,lookup,other,ver) \ + \ + /* Add thisType constructor function to the table, find by lookup */ \ + baseType::addAlias##argNames##ConstructorToTable<thisType<Targ>> \ + add##thisType##Targs##argNames##ConstructorTo##baseType##Table_ \ + ##lookup##_##other##_(#lookup,#other,ver) + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // //- Add to construction table with typeName as the key. @@ -122,6 +142,17 @@ Note baseType##Targ##Table_##lookupName##_(#lookupName) +//- Add lookup alias for for runTime selection +// Use when baseType requires the Targ template argument as well +#define addAliasTemplatedToRunTimeSelectionTable\ +(baseType,thisType,Targ,argNames,lookup,other,ver) \ + \ + /* Add the thisType constructor function to the table, find by lookup */ \ + baseType<Targ>::add##argNames##ConstructorToTable<thisType<Targ>> \ + add##thisType##Targ##argNames##ConstructorTo##baseType##Targ## \ + Table_##lookup##_##other##_(#lookup,#other,ver) + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif diff --git a/src/OpenFOAM/db/runTimeSelection/construction/runTimeSelectionTables.H b/src/OpenFOAM/db/runTimeSelection/construction/runTimeSelectionTables.H index 0fa16f0e6f3..976bd6e7df9 100644 --- a/src/OpenFOAM/db/runTimeSelection/construction/runTimeSelectionTables.H +++ b/src/OpenFOAM/db/runTimeSelection/construction/runTimeSelectionTables.H @@ -40,6 +40,9 @@ Description #ifndef runTimeSelectionTables_H #define runTimeSelectionTables_H +#include <memory> // For std::unique_ptr +#include <utility> // For std::pair + #include "autoPtr.H" #include "HashTable.H" @@ -61,11 +64,28 @@ Description ::Foam::string::hasher \ > prefix##TableType; \ \ + /* Lookup aliases for constructors */ \ + typedef ::Foam::HashTable \ + < \ + std::pair<::Foam::word,int>, \ + ::Foam::word, \ + ::Foam::string::hasher \ + > prefix##CompatTableType; \ + \ /* Table singleton (storage) */ \ static prefix##TableType* prefix##TablePtr_; \ \ + /* Lookup aliases singleton (storage) */ \ + static std::unique_ptr<prefix##CompatTableType> prefix##CompatTablePtr_; \ + \ + /* Aliases singleton (access) */ \ + static prefix##CompatTableType& prefix##CompatTable(); \ + \ /* Table construct/destruct helper */ \ - static void prefix##TablePtr_construct(bool load) + static void prefix##TablePtr_construct(bool load); \ + \ + /* Lookup function pointer from singleton, nullptr if not found */ \ + static prefix##Ptr prefix##Table(const ::Foam::word& k) // Not used directly: storage and helper methods for runtime tables @@ -74,6 +94,20 @@ Description /* Define table singleton (storage) */ \ Tspecialize prefix##TableType* prefix##TablePtr_(nullptr); \ \ + /* Define aliases singleton (storage) */ \ + Tspecialize \ + std::unique_ptr<prefix##CompatTableType> prefix##CompatTablePtr_(nullptr); \ + \ + /* Define table singleton (access) for aliases */ \ + Tspecialize prefix##CompatTableType& prefix##CompatTable() \ + { \ + if (!prefix##CompatTablePtr_) \ + { \ + prefix##CompatTablePtr_.reset(new prefix##CompatTableType(16)); \ + } \ + return *(prefix##CompatTablePtr_); \ + } \ + \ /* Table construct/destruct helper */ \ Tspecialize void prefix##TablePtr_construct(bool load) \ { \ @@ -90,8 +124,42 @@ Description { \ delete prefix##TablePtr_; \ prefix##TablePtr_ = nullptr; \ + prefix##CompatTablePtr_.reset(nullptr); \ constructed = false; \ } \ + } \ + \ + /* Define lookup function pointer (singleton) */ \ + Tspecialize prefix##Ptr prefix##Table(const ::Foam::word& k) \ + { \ + if (prefix##TablePtr_) \ + { \ + const auto& tbl = *prefix##TablePtr_; \ + auto iter = tbl.cfind(k); \ + if (!iter.found() && prefix##CompatTablePtr_) \ + { \ + const auto altIter = prefix##CompatTablePtr_->cfind(k); \ + if (altIter.found()) \ + { \ + const auto& alt = altIter.val(); /* <word,int> */ \ + iter = tbl.cfind(alt.first); \ + if (::Foam::error::warnAboutAge(alt.second)) \ + { \ + std::cerr \ + << "Using [v" << alt.second << "] '" << k \ + << "' instead of '" << alt.first \ + << " in runtime selection table: " \ + << #baseType << '\n' << std::endl; \ + ::Foam::error::warnAboutAge("lookup", alt.second); \ + } \ + } \ + } \ + if (iter.found()) \ + { \ + return iter.val(); \ + } \ + } \ + return nullptr; \ } @@ -109,6 +177,22 @@ Description declareRunTimeSelectionTableBase( \ ptrWrapper<baseType>, argNames##Constructor, argList); \ \ + /* Helper to add compatibility/alias for runtime selection table */ \ + template<class baseType##Type> \ + struct addAlias##argNames##ConstructorToTable \ + { \ + explicit addAlias##argNames##ConstructorToTable \ + ( \ + const ::Foam::word& k, \ + const ::Foam::word& alias, \ + const int ver \ + ) \ + { \ + argNames##ConstructorCompatTable() \ + .set(alias, std::pair<::Foam::word,int>(k,ver)); \ + } \ + }; \ + \ /* Helper to add constructor from argList to table */ \ template<class baseType##Type> \ struct add##argNames##ConstructorToTable \ @@ -191,6 +275,22 @@ Description declareRunTimeSelectionTableBase( \ ptrWrapper<baseType>,argNames##Constructor,argList); \ \ + /* Helper to add compatibility/alias for runtime selection table */ \ + template<class baseType##Type> \ + struct addAlias##argNames##ConstructorToTable \ + { \ + explicit addAlias##argNames##ConstructorToTable \ + ( \ + const ::Foam::word& k, \ + const ::Foam::word& alias, \ + const int ver \ + ) \ + { \ + argNames##ConstructorCompatTable() \ + .set(alias, std::pair<::Foam::word,int>(k,ver)); \ + } \ + }; \ + \ /* Helper to add constructor from argList to table */ \ template<class baseType##Type> \ struct add##argNames##ConstructorToTable \ diff --git a/src/OpenFOAM/db/runTimeSelection/memberFunctions/addToMemberFunctionSelectionTable.H b/src/OpenFOAM/db/runTimeSelection/memberFunctions/addToMemberFunctionSelectionTable.H index 1fc559276f2..4bd87c3fe43 100644 --- a/src/OpenFOAM/db/runTimeSelection/memberFunctions/addToMemberFunctionSelectionTable.H +++ b/src/OpenFOAM/db/runTimeSelection/memberFunctions/addToMemberFunctionSelectionTable.H @@ -60,6 +60,16 @@ Note baseType##Table_##lookupName##_(#lookupName) +//- Add lookup alias for runTime member selection. +#define addAliasToMemberFunctionSelectionTable\ +(baseType,thisType,funcName,argNames,lookup,other,ver) \ + \ + /* Add thisType funcName to the table, find by lookup name */ \ + baseType::addAlias##funcName##argNames##MemberFunctionToTable<thisType> \ + add##thisType##funcName##argNames##MemberFunctionTo##baseType##Table_ \ + ##lookup##_##other##_(#lookup,#other,ver) + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // //- Add to hash-table of functions with typeName as the key. @@ -84,6 +94,19 @@ Note baseType##Table_##lookupName##_(#lookupName) +//- Add lookup alias for runTime member selection. +#define addAliasTemplateToMemberFunctionSelectionTable\ +(baseType,thisType,Targ,funcName,argNames,lookup,other,ver) \ + \ + /* Add thisType funcName to the table, find by lookup name */ \ + baseType::addAlias##funcName##argNames##MemberFunctionToTable \ + <thisType<Targ>> \ + add##thisType##Targ##funcName##argNames##MemberFunctionTo##baseType \ + ##lookup##_##other##_(#lookup,#other,ver) + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + //- Add to hash-table of functions with typeName as the key. // Use when baseType requires the Targ template argument as well #define addTemplatedToMemberFunctionSelectionTable\ @@ -106,6 +129,16 @@ Note add##thisType##Targ##funcName##argNames##MemberFunctionTo## \ baseType##Targ##Table_##lookupName##_(#lookupName) +//- Add lookup alias for runTime member selection. +#define addAliasTemplatedToMemberFunctionSelectionTable\ +(baseType,thisType,Targ,funcName,argNames,lookup,other,ver) \ + \ + /* Add thisType funcName to the table, find by lookup name */ \ + baseType<Targ>::addAlias##funcName##argNames##MemberFunctionToTable \ + <thisType<Targ>> \ + add##thisType##Targ##funcName##argNames##MemberFunctionTo##baseType## \ + Targ##Table_##lookup##_##other##_(#lookup,#other,ver) + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/db/runTimeSelection/memberFunctions/memberFunctionSelectionTables.H b/src/OpenFOAM/db/runTimeSelection/memberFunctions/memberFunctionSelectionTables.H index 206007a9b2a..bab205eff70 100644 --- a/src/OpenFOAM/db/runTimeSelection/memberFunctions/memberFunctionSelectionTables.H +++ b/src/OpenFOAM/db/runTimeSelection/memberFunctions/memberFunctionSelectionTables.H @@ -118,6 +118,22 @@ Note void operator= \ (const addRemovable##funcName##argNames##MemberFunctionToTable&) \ = delete; \ + }; \ + \ + /* Helper to add alias for funcName to table */ \ + template<class baseType##Type> \ + struct addAlias##funcName##argNames##MemberFunctionToTable \ + { \ + explicit addAlias##funcName##argNames##MemberFunctionToTable \ + ( \ + const ::Foam::word& k, \ + const ::Foam::word& alias, \ + const int ver \ + ) \ + { \ + funcName##argNames##MemberFunctionCompatTable() \ + .set(alias, std::pair<::Foam::word,int>(k,ver)); \ + } \ }; @@ -130,7 +146,7 @@ Note //- Define run-time selection table #define defineMemberFunctionSelectionTable(baseType,funcName,argNames) \ \ - declareRunTimeSelectionTableBase( \ + defineRunTimeSelectionTableBase( \ baseType,baseType::funcName##argNames##MemberFunction,) @@ -138,7 +154,7 @@ Note // use when baseType doesn't need a template argument (eg, is a typedef) #define defineTemplateMemberFunctionSelectionTable(baseType,funcName,argNames) \ \ - declareRunTimeSelectionTableBase( \ + defineRunTimeSelectionTableBase( \ baseType,baseType::funcName##argNames##MemberFunction,template<>) @@ -147,7 +163,7 @@ Note #define defineTemplatedMemberFunctionSelectionTable\ (baseType,funcName,argNames,Targ) \ \ - declareRunTimeSelectionTableBase( \ + defineRunTimeSelectionTableBase( \ baseType,baseType<Targ>::funcName##argNames##MemberFunction,template<>) -- GitLab From ba8d6bddcc0209cc242525b5e95d8f132d2995f9 Mon Sep 17 00:00:00 2001 From: Mark Olesen <Mark.Olesen@esi-group.com> Date: Tue, 12 Oct 2021 19:44:00 +0200 Subject: [PATCH 6/6] ENH: use singleton method for accessing runtime selection STYLE: use alias to mark partialFaceAreaWeightAMI deprecation after v2012 --- .../dragModels/PDRDragModel/PDRDragModelNew.C | 10 +++-- .../XiEqModels/XiEqModel/XiEqModelNew.C | 8 ++-- .../XiModels/XiGModels/XiGModel/XiGModelNew.C | 8 ++-- .../PDRFoam/XiModels/XiModel/XiModelNew.C | 10 +++-- .../mixtureViscosityModelNew.C | 10 +++-- .../relativeVelocityModel.C | 8 ++-- .../reflectionModel/reflectionModelNew.C | 8 ++-- ...temperaturePhaseChangeTwoPhaseMixtureNew.C | 8 ++-- .../phaseChangeTwoPhaseMixtureNew.C | 8 ++-- .../cellSizeAndAlignmentControl.C | 8 ++-- .../cellSizeFunction/cellSizeFunction.C | 8 ++-- .../cellSizeCalculationType.C | 8 ++-- .../surfaceCellSizeFunction.C | 8 ++-- .../faceAreaWeightModel/faceAreaWeightModel.C | 8 ++-- .../initialPointsMethod/initialPointsMethod.C | 8 ++-- .../relaxationModel/relaxationModel.C | 8 ++-- .../searchableSurfaceFeatures.C | 8 ++-- .../faceSelection/faceSelection.C | 8 ++-- .../helpBoundary/helpBoundaryTemplates.C | 1 + .../foamHelp/helpTypes/helpType/helpTypeNew.C | 7 +-- .../PDR/pdrFields/obstacles/PDRobstacle.C | 4 +- .../PDR/pdrFields/obstacles/PDRobstacle.H | 4 +- .../PDR/pdrFields/obstacles/PDRobstacleIO.C | 20 +++++---- .../pdrFields/obstacles/PDRobstacleTypes.C | 4 +- .../implicitFunctions/implicitFunction.C | 8 ++-- .../tabulatedWallFunctionNew.C | 8 ++-- .../surfaceFeaturesExtraction.C | 8 ++-- .../searchableSurfaceModifier.C | 8 ++-- src/ODE/ODESolvers/ODESolver/ODESolverNew.C | 8 ++-- src/OpenFOAM/db/IOstreams/token/token.C | 6 +-- .../functionEntry/functionEntry.C | 19 ++++---- .../functionObject/functionObject.C | 8 ++-- .../expressions/exprEntry/expressionEntry.C | 8 ++-- .../expressions/exprResult/exprResult.C | 12 ++--- .../calculated/calculatedPointPatchField.C | 8 ++-- .../pointPatchField/pointPatchFieldNew.C | 36 +++++++-------- .../fileOperation/fileOperation.C | 6 +-- .../fileOperationInitialise.C | 6 +-- src/OpenFOAM/graph/graph.C | 8 ++-- .../tableReaders/tableReader.C | 8 ++-- .../interpolationWeights.C | 8 ++-- .../LduMatrix/LduMatrixPreconditioner.C | 16 +++---- .../LduMatrix/LduMatrix/LduMatrixSmoother.C | 14 +++--- .../LduMatrix/LduMatrix/LduMatrixSolver.C | 12 ++--- .../lduMatrix/lduMatrixPreconditioner.C | 14 +++--- .../lduMatrix/lduMatrix/lduMatrixSmoother.C | 14 +++--- .../lduMatrix/lduMatrix/lduMatrixSolver.C | 12 ++--- .../GAMGAgglomeration/GAMGAgglomeration.C | 25 +++++------ .../GAMGProcAgglomeration.C | 7 +-- .../GAMGInterfaceFieldNew.C | 14 +++--- .../GAMGInterface/GAMGInterfaceNew.C | 14 +++--- .../facePointPatch/facePointPatchNew.C | 8 ++-- .../polyPatches/polyPatch/polyPatch.C | 16 ++++--- .../polyPatches/polyPatch/polyPatchNew.C | 18 ++++---- .../polyMesh/zones/cellZone/cellZoneNew.C | 8 ++-- .../polyMesh/zones/faceZone/faceZoneNew.C | 8 ++-- .../polyMesh/zones/pointZone/pointZoneNew.C | 8 ++-- .../Function1/Function1/Function1New.C | 6 +-- .../turbulenceModels/LES/LESModel/LESModel.C | 6 +-- .../LES/LESdeltas/LESdelta/LESdelta.C | 27 +++++++----- .../LES/LESfilters/LESfilter/LESfilter.C | 8 ++-- .../turbulenceModels/RAS/RASModel/RASModel.C | 6 +-- .../TurbulenceModel/TurbulenceModel.C | 8 ++-- .../generalizedNewtonianViscosityModelNew.C | 8 ++-- .../laminar/laminarModel/laminarModel.C | 8 ++-- .../reactionRateFlameAreaNew.C | 8 ++-- .../combustionModelTemplates.C | 2 +- .../dynamicFvMesh/dynamicFvMeshNew.C | 13 +++--- .../simplifiedDynamicFvMesh.C | 8 ++-- .../meshCut/cellLooper/cellLooper.C | 8 ++-- .../displacement/displacementMotionSolver.C | 8 ++-- .../solidBodyMotionFunctionNew.C | 8 ++-- .../motionSolvers/motionSolver/motionSolver.C | 6 +-- .../polyMeshModifier/polyMeshModifierNew.C | 8 ++-- .../engineMesh/engineMesh/engineMeshNew.C | 8 ++-- .../engineTime/engineTime/engineTimeNew.C | 8 ++-- src/faOptions/faOption/faOption.C | 6 +-- src/fileFormats/sampledSetWriters/writer.C | 8 ++-- .../faMesh/faPatches/faPatch/faPatchNew.C | 8 ++-- .../basic/calculated/calculatedFaPatchField.C | 8 ++-- .../faPatchField/faPatchFieldNew.C | 44 +++++++++---------- .../calculated/calculatedFaePatchField.C | 8 ++-- .../faePatchField/faePatchFieldNew.C | 40 ++++++++--------- .../faConvectionScheme/faConvectionScheme.C | 8 ++-- .../faD2dt2Scheme/faD2dt2Scheme.C | 8 ++-- .../ddtSchemes/faDdtScheme/faDdtScheme.C | 8 ++-- .../divSchemes/faDivScheme/faDivScheme.C | 8 ++-- .../gradSchemes/faGradScheme/faGradScheme.C | 8 ++-- .../faLaplacianScheme/faLaplacianScheme.C | 8 ++-- .../lnGradSchemes/lnGradScheme/lnGradScheme.C | 8 ++-- .../edgeInterpolationScheme.C | 14 +++--- .../SRF/SRFModel/SRFModel/SRFModelNew.C | 8 ++-- .../cfdTools/general/fvOptions/fvOption.C | 6 +-- .../porosityModel/porosityModelNew.C | 8 ++-- .../expressions/base/fvExprDriverNew.C | 14 +++--- .../basic/calculated/calculatedFvPatchField.C | 7 +-- .../fvPatchField/fvPatchFieldNew.C | 39 ++++++++-------- .../calculated/calculatedFvsPatchField.C | 7 +-- .../fvsPatchField/fvsPatchFieldNew.C | 41 +++++++++-------- .../convectionScheme/convectionScheme.C | 14 +++--- .../d2dt2Schemes/d2dt2Scheme/d2dt2Scheme.C | 8 ++-- .../ddtSchemes/ddtScheme/ddtScheme.C | 8 ++-- .../divSchemes/divScheme/divScheme.C | 7 +-- .../gradSchemes/gradScheme/gradScheme.C | 8 ++-- .../laplacianScheme/laplacianScheme.C | 8 ++-- .../snGradSchemes/snGradScheme/snGradScheme.C | 8 ++-- .../multiDimPolyFunctions.C | 7 +-- .../fvGeometryScheme/fvGeometryScheme.C | 8 ++-- .../fvMesh/fvPatches/fvPatch/fvPatch.C | 18 +++++--- .../fvMesh/fvPatches/fvPatch/fvPatchNew.C | 8 ++-- .../simplifiedFvMesh/simplifiedFvMesh.C | 17 +++---- .../patchDistMethod/patchDistMethod.C | 6 +-- .../interpolation/interpolationNew.C | 8 ++-- .../limitedSurfaceInterpolationScheme.C | 14 +++--- .../multivariateSurfaceInterpolationScheme.C | 8 ++-- .../surfaceInterpolationScheme.C | 14 +++--- .../DMD/DMDModels/DMDModel/DMDModelNew.C | 6 +-- .../fieldValues/fieldValue/fieldValueNew.C | 8 ++-- .../heatTransferCoeffModelNew.C | 8 ++-- .../runTimeCondition/runTimeConditionNew.C | 8 ++-- .../motionDiffusivity/motionDiffusivity.C | 8 ++-- .../motionInterpolation/motionInterpolation.C | 8 ++-- .../profileModel/profileModel.C | 6 +-- .../trimModel/trimModel/trimModelNew.C | 8 ++-- .../BinaryCollisionModelNew.C | 8 ++-- .../InflowBoundaryModelNew.C | 8 ++-- .../WallInteractionModelNew.C | 8 ++-- .../distributionModel/distributionModelNew.C | 8 ++-- .../integrationScheme/integrationSchemeNew.C | 8 ++-- .../CloudFunctionObjectNew.C | 8 ++-- .../HeterogeneousReactingModelNew.C | 8 ++-- .../CollisionModel/CollisionModelNew.C | 8 ++-- .../PairModel/PairModel/PairModelNew.C | 8 ++-- .../WallModel/WallModel/WallModelNew.C | 8 ++-- .../DispersionModel/DispersionModelNew.C | 8 ++-- .../InjectionModel/InjectionModelNew.C | 14 +++--- .../ParticleForce/ParticleForceNew.C | 8 ++-- .../PatchInteractionModelNew.C | 8 ++-- .../StochasticCollisionModelNew.C | 9 ++-- .../SurfaceFilmModel/SurfaceFilmModelNew.C | 8 ++-- .../AveragingMethod/AveragingMethod.C | 8 ++-- .../CorrectionLimitingMethod.C | 8 ++-- .../DampingModels/DampingModel/DampingModel.C | 8 ++-- .../IsotropyModel/IsotropyModel.C | 8 ++-- .../PackingModels/PackingModel/PackingModel.C | 8 ++-- .../ParticleStressModel/ParticleStressModel.C | 8 ++-- .../TimeScaleModel/TimeScaleModel.C | 8 ++-- .../CompositionModel/CompositionModelNew.C | 8 ++-- .../PhaseChangeModel/PhaseChangeModelNew.C | 8 ++-- .../DevolatilisationModelNew.C | 8 ++-- .../SurfaceReactionModelNew.C | 8 ++-- .../HeatTransferModel/HeatTransferModelNew.C | 8 ++-- .../basic/energyScalingFunctionNew.C | 8 ++-- .../pairPotential/basic/pairPotentialNew.C | 8 ++-- .../basic/tetherPotentialNew.C | 8 ++-- .../AtomizationModel/AtomizationModelNew.C | 8 ++-- .../BreakupModel/BreakupModelNew.C | 8 ++-- .../blockEdges/blockEdge/blockEdge.C | 8 ++-- .../blockFaces/blockFace/blockFace.C | 8 ++-- .../blockVertices/blockVertex/blockVertex.C | 6 +-- src/mesh/blockMesh/blocks/block/block.C | 8 ++-- .../extrudeModel/extrudeModelNew.C | 8 ++-- .../externalDisplacementMeshMover.C | 8 ++-- .../AMIInterpolation/AMIInterpolationNew.C | 14 +++--- .../faceAreaWeightAMI/faceAreaWeightAMI.C | 10 +++-- .../PatchFunction1/PatchFunction1New.C | 6 +-- .../PatchFunction1/makePatchFunction1s.C | 6 +-- .../coordinate/rotation/coordinateRotation.C | 6 +-- .../coordinate/systems/coordinateSystemNew.C | 21 ++++----- src/meshTools/edgeMesh/edgeMesh.C | 2 +- src/meshTools/edgeMesh/edgeMeshIO.C | 6 +-- src/meshTools/edgeMesh/edgeMeshNew.C | 8 ++-- .../extendedEdgeMesh/extendedEdgeMesh.C | 2 +- .../extendedEdgeMesh/extendedEdgeMeshNew.C | 8 ++-- .../searchableSurface/searchableSurface.C | 8 ++-- .../topoSetCellSource/topoSetCellSource.C | 12 ++--- .../topoSetCellZoneSource.C | 12 ++--- .../topoSetFaceSource/topoSetFaceSource.C | 12 ++--- .../topoSetFaceZoneSource.C | 12 ++--- .../topoSetPointSource/topoSetPointSource.C | 12 ++--- .../topoSetPointZoneSource.C | 12 ++--- .../sets/topoSetSource/topoSetSource.C | 12 ++--- src/meshTools/sets/topoSets/topoSet.C | 18 ++++---- .../adjoint/ATCModel/ATCModel/ATCModel.C | 8 ++-- .../zeroATCcells/zeroATCcells/zeroATCcells.C | 8 ++-- .../boundaryAdjointContribution.C | 8 ++-- .../displacementMethod/displacementMethod.C | 8 ++-- .../objectiveManager/objectiveManager.C | 8 ++-- .../objectiveIncompressible.C | 8 ++-- .../adjoint/objectives/objective/objective.C | 8 ++-- .../adjointSensitivityIncompressible.C | 8 ++-- .../lineSearch/lineSearch/lineSearch.C | 8 ++-- .../stepUpdate/stepUpdate/stepUpdate.C | 8 ++-- .../optMeshMovement/optMeshMovement.C | 8 ++-- .../optimisationManager/optimisationManager.C | 8 ++-- .../optimisationTypeIncompressible.C | 8 ++-- .../updateMethod/updateMethod/updateMethod.C | 8 ++-- .../NURBS3DVolume/NURBS3DVolume.C | 8 ++-- .../controlPointsDefinition.C | 7 +-- .../adjointSolver/adjointSolver.C | 8 ++-- .../incompressibleAdjointSolver.C | 8 ++-- .../incompressiblePrimalSolver.C | 8 ++-- .../primalSolvers/primalSolver/primalSolver.C | 8 ++-- .../SIMPLEControl/SIMPLEControl.C | 8 ++-- .../adjointRASModel/adjointRASModel.C | 8 ++-- .../adjointTurbulenceModel.C | 9 ++-- .../RAS/RASModelVariables/RASModelVariables.C | 8 ++-- .../cellCellStencil/cellCellStencil.C | 8 ++-- .../decompositionConstraint.C | 6 +-- .../decompositionMethod/decompositionMethod.C | 6 +-- .../diameterModel/diameterModel.C | 8 ++-- .../dragModels/dragModel/dragModel.C | 8 ++-- .../heatTransferModel/heatTransferModel.C | 8 ++-- .../interfaceCompositionModel.C | 8 ++-- .../porousModels/porousModel/porousModel.C | 8 ++-- .../surfaceTensionModel/surfaceTensionModel.C | 8 ++-- .../multiphaseSystem/multiphaseSystemNew.C | 8 ++-- .../phaseModel/phaseModel/phaseModel.C | 8 ++-- .../blendingMethod/blendingMethod.C | 8 ++-- .../CHFModels/CHFModel/CHFModel.C | 8 ++-- .../CHFSubCoolModel/CHFSubCoolModel.C | 8 ++-- .../LeidenfrostModel/LeidenfrostModel.C | 8 ++-- .../MHFModels/MHFModel/MHFModel.C | 8 ++-- .../TDNBModels/TDNBModel/TDNBModel.C | 8 ++-- .../departureDiameterModel.C | 8 ++-- .../departureFrequencyModel.C | 8 ++-- .../filmBoilingModel/filmBoilingModel.C | 8 ++-- .../nucleationSiteModel/nucleationSiteModel.C | 8 ++-- .../partitioningModel/partitioningModel.C | 8 ++-- .../diameterModel/diameterModel.C | 9 ++-- .../interfaceCompositionModel.C | 7 +-- .../massTransferModel/massTransferModel.C | 8 ++-- .../saturationModel/saturationModel.C | 8 ++-- .../surfaceTensionModel/surfaceTensionModel.C | 8 ++-- .../aspectRatioModel/aspectRatioModel.C | 8 ++-- .../dragModels/dragModel/dragModel.C | 8 ++-- .../heatTransferModel/heatTransferModel.C | 8 ++-- .../liftModels/liftModel/liftModel.C | 8 ++-- .../phaseTransferModel/phaseTransferModel.C | 8 ++-- .../swarmCorrection/swarmCorrection.C | 8 ++-- .../turbulentDispersionModel.C | 8 ++-- .../virtualMassModel/virtualMassModel.C | 8 ++-- .../wallDampingModel/wallDampingModel.C | 8 ++-- .../wallLubricationModel.C | 8 ++-- .../multiphaseSystem/multiphaseSystemNew.C | 8 ++-- .../phaseModel/phaseModel/phaseModel.C | 8 ++-- .../binaryBreakupModel/binaryBreakupModel.C | 8 ++-- .../breakupModels/breakupModel/breakupModel.C | 8 ++-- .../coalescenceModel/coalescenceModel.C | 8 ++-- .../daughterSizeDistributionModel.C | 8 ++-- .../driftModels/driftModel/driftModel.C | 8 ++-- .../nucleationModel/nucleationModel.C | 8 ++-- .../conductivityModel/conductivityModel.C | 8 ++-- .../frictionalStressModel.C | 8 ++-- .../granularPressureModel.C | 8 ++-- .../radialModel/radialModel/radialModel.C | 8 ++-- .../viscosityModel/viscosityModel.C | 8 ++-- .../IATE/IATEsources/IATEsource/IATEsource.C | 8 ++-- .../twoPhaseSystem/twoPhaseSystemNew.C | 8 ++-- .../conductivityModel/conductivityModel.C | 8 ++-- .../frictionalStressModel.C | 8 ++-- .../granularPressureModel.C | 8 ++-- .../radialModel/radialModel/radialModel.C | 8 ++-- .../viscosityModel/viscosityModel.C | 8 ++-- .../blendingMethod/blendingMethod.C | 8 ++-- .../IATE/IATEsources/IATEsource/IATEsource.C | 8 ++-- .../diameterModel/diameterModel.C | 8 ++-- .../aspectRatioModel/aspectRatioModel.C | 8 ++-- .../dragModels/dragModel/dragModel.C | 8 ++-- .../heatTransferModel/heatTransferModel.C | 8 ++-- .../liftModels/liftModel/liftModel.C | 8 ++-- .../swarmCorrection/swarmCorrection.C | 8 ++-- .../turbulentDispersionModel.C | 8 ++-- .../virtualMassModel/virtualMassModel.C | 8 ++-- .../wallLubricationModel.C | 8 ++-- .../noiseModels/noiseModel/noiseModelNew.C | 8 ++-- .../windowModels/windowModel/windowModelNew.C | 8 ++-- .../liquidFilm/liquidFilmBaseNew.C | 23 +++++----- .../filmTurbulenceModelNew.C | 8 ++-- .../kinematic/force/force/forceNew.C | 8 ++-- .../injectionModel/injectionModelNew.C | 6 +-- .../thermalShellModel/thermalShellModelNew.C | 8 ++-- .../vibrationShellModelNew.C | 8 ++-- .../pyrolysisModel/pyrolysisModelNew.C | 14 +++--- .../regionModelFunctionObjectNew.C | 8 ++-- .../filmThermoModel/filmThermoModelNew.C | 9 ++-- .../filmTurbulenceModelNew.C | 8 ++-- .../kinematic/force/force/forceNew.C | 8 ++-- .../injectionModel/injectionModelNew.C | 8 ++-- .../transferModel/transferModelNew.C | 8 ++-- .../filmRadiationModelNew.C | 8 ++-- .../filmViscosityModelNew.C | 8 ++-- .../heatTransferModel/heatTransferModelNew.C | 8 ++-- .../phaseChangeModel/phaseChangeModelNew.C | 8 ++-- .../surfaceFilmModel/surfaceFilmModelNew.C | 8 ++-- .../thermalBaffleModelNew.C | 14 +++--- .../renumberMethod/renumberMethod.C | 8 ++-- .../bodies/rigidBody/rigidBody.C | 8 ++-- src/rigidBodyDynamics/joints/joint/joint.C | 8 ++-- .../restraint/rigidBodyRestraintNew.C | 8 ++-- .../rigidBodySolver/rigidBodySolverNew.C | 8 ++-- .../meshToMeshMethod/meshToMeshMethodNew.C | 8 ++-- .../sampledSet/sampledSet/sampledSet.C | 8 ++-- .../sampledSurface/readers/surfaceReaderNew.C | 8 ++-- .../sampledSurface/sampledSurface.C | 6 +-- .../sixDoFRigidBodyMotionConstraintNew.C | 8 ++-- .../sixDoFRigidBodyMotionRestraintNew.C | 8 ++-- .../sixDoFSolver/sixDoFSolverNew.C | 8 ++-- src/surfMesh/MeshedSurface/MeshedSurface.C | 6 +-- src/surfMesh/MeshedSurface/MeshedSurfaceNew.C | 8 ++-- .../MeshedSurfaceProxy/MeshedSurfaceProxy.C | 8 ++-- .../UnsortedMeshedSurface.C | 8 ++-- .../UnsortedMeshedSurfaceNew.C | 8 ++-- src/surfMesh/writers/surfaceWriter.C | 23 +++++----- .../barotropicCompressibilityModelNew.C | 8 ++-- .../chemistryReductionMethodNew.C | 6 +-- .../chemistryTabulationMethodNew.C | 6 +-- .../basicChemistryModelTemplates.C | 6 +-- .../laminarFlameSpeed/laminarFlameSpeedNew.C | 8 ++-- .../radiationModel/radiationModelNew.C | 14 +++--- .../absorptionEmissionModelNew.C | 8 ++-- .../boundaryRadiationPropertiesPatch.C | 8 ++-- .../scatterModel/scatterModelNew.C | 8 ++-- .../sootModel/sootModel/sootModelNew.C | 8 ++-- .../wallAbsorptionEmissionModelNew.C | 8 ++-- .../wallTransmissivityModelNew.C | 8 ++-- .../chemistryReader/chemistryReader.C | 8 ++-- .../basicSolidChemistryModelNew.C | 6 +-- .../reaction/Reactions/Reaction/Reaction.C | 8 ++-- .../liquidProperties/liquidProperties.C | 23 +++++----- .../solidProperties/solidPropertiesNew.C | 14 +++--- .../thermophysicalFunction.C | 14 +++--- .../thermophysicalProperties.C | 14 +++--- .../reconstructionSchemesNew.C | 7 +-- .../viscosityModel/viscosityModelNew.C | 8 ++-- .../surfaceTensionModelNew.C | 8 ++-- src/waveModels/waveModel/waveModelNew.C | 8 ++-- 337 files changed, 1554 insertions(+), 1541 deletions(-) diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C b/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C index b7bfbd08ae8..80c429419d9 100644 --- a/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C +++ b/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C @@ -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) + ); } diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModelNew.C b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModelNew.C index ff1f3ccbdff..3cb2daa4b8b 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModelNew.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModelNew.C @@ -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)); } diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModelNew.C b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModelNew.C index 1061ae392ae..f8f6d355d83 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModelNew.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModelNew.C @@ -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)); } diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModelNew.C b/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModelNew.C index eb2d92eebcb..46a23d41fd4 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModelNew.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModelNew.C @@ -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) + ); } diff --git a/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/mixtureViscosityModel/mixtureViscosityModelNew.C b/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/mixtureViscosityModel/mixtureViscosityModelNew.C index 40fb18ef6ce..6fc82c54bb3 100644 --- a/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/mixtureViscosityModel/mixtureViscosityModelNew.C +++ b/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/mixtureViscosityModel/mixtureViscosityModelNew.C @@ -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) + ); } diff --git a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C index 13ac5c1d7d6..2cdf9d76267 100644 --- a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C +++ b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C @@ -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 diff --git a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/laserDTRM/reflectionModel/reflectionModel/reflectionModelNew.C b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/laserDTRM/reflectionModel/reflectionModel/reflectionModelNew.C index 62bc9642182..ae30ffd4b18 100644 --- a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/laserDTRM/reflectionModel/reflectionModel/reflectionModelNew.C +++ b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/laserDTRM/reflectionModel/reflectionModel/reflectionModelNew.C @@ -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)); } diff --git a/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtureNew.C b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtureNew.C index 02bb89045ae..0de3d22ae38 100644 --- a/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtureNew.C +++ b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtureNew.C @@ -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) ); } diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixtureNew.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixtureNew.C index eb7b80d04d8..db6564ffa17 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixtureNew.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixtureNew.C @@ -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)); } diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellSizeAndAlignmentControl/cellSizeAndAlignmentControl/cellSizeAndAlignmentControl.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellSizeAndAlignmentControl/cellSizeAndAlignmentControl/cellSizeAndAlignmentControl.C index 441f5391d51..150135ba9a3 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellSizeAndAlignmentControl/cellSizeAndAlignmentControl/cellSizeAndAlignmentControl.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellSizeAndAlignmentControl/cellSizeAndAlignmentControl/cellSizeAndAlignmentControl.C @@ -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, diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/cellSizeFunction/cellSizeFunction/cellSizeFunction.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/cellSizeFunction/cellSizeFunction/cellSizeFunction.C index a7a4e673f17..7d0aa355853 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/cellSizeFunction/cellSizeFunction/cellSizeFunction.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/cellSizeFunction/cellSizeFunction/cellSizeFunction.C @@ -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, diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/cellSizeCalculationType/cellSizeCalculationType.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/cellSizeCalculationType/cellSizeCalculationType.C index 322c0f19b57..0435c3fc43c 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/cellSizeCalculationType/cellSizeCalculationType.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/cellSizeCalculationType/cellSizeCalculationType.C @@ -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) ); } diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/surfaceCellSizeFunction/surfaceCellSizeFunction.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/surfaceCellSizeFunction/surfaceCellSizeFunction.C index da5e87dda5c..905739ea93b 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/surfaceCellSizeFunction/surfaceCellSizeFunction.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/surfaceCellSizeFunction/surfaceCellSizeFunction.C @@ -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) ); } diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/faceAreaWeightModel/faceAreaWeightModel/faceAreaWeightModel.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/faceAreaWeightModel/faceAreaWeightModel/faceAreaWeightModel.C index a3da8a6c8c3..6ca72fdce88 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/faceAreaWeightModel/faceAreaWeightModel/faceAreaWeightModel.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/faceAreaWeightModel/faceAreaWeightModel/faceAreaWeightModel.C @@ -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)); } diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/initialPointsMethod/initialPointsMethod/initialPointsMethod.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/initialPointsMethod/initialPointsMethod/initialPointsMethod.C index 7c16c948bc2..1ed3f52e014 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/initialPointsMethod/initialPointsMethod/initialPointsMethod.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/initialPointsMethod/initialPointsMethod/initialPointsMethod.C @@ -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, diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/relaxationModel/relaxationModel/relaxationModel.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/relaxationModel/relaxationModel/relaxationModel.C index 9121d9792fc..fa9ac3b1244 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/relaxationModel/relaxationModel/relaxationModel.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/relaxationModel/relaxationModel/relaxationModel.C @@ -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)); } diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/searchableSurfaceFeatures/searchableSurfaceFeatures.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/searchableSurfaceFeatures/searchableSurfaceFeatures.C index 17b7cb14c45..c26412f0692 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/searchableSurfaceFeatures/searchableSurfaceFeatures.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/searchableSurfaceFeatures/searchableSurfaceFeatures.C @@ -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)); } diff --git a/applications/utilities/mesh/manipulation/createBaffles/faceSelection/faceSelection.C b/applications/utilities/mesh/manipulation/createBaffles/faceSelection/faceSelection.C index bc30bb2c8aa..015be958222 100644 --- a/applications/utilities/mesh/manipulation/createBaffles/faceSelection/faceSelection.C +++ b/applications/utilities/mesh/manipulation/createBaffles/faceSelection/faceSelection.C @@ -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)); } diff --git a/applications/utilities/miscellaneous/foamHelp/helpTypes/helpBoundary/helpBoundaryTemplates.C b/applications/utilities/miscellaneous/foamHelp/helpTypes/helpBoundary/helpBoundaryTemplates.C index 43fa15d7920..9e2faa1794b 100644 --- a/applications/utilities/miscellaneous/foamHelp/helpTypes/helpBoundary/helpBoundaryTemplates.C +++ b/applications/utilities/miscellaneous/foamHelp/helpTypes/helpBoundary/helpBoundaryTemplates.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2012-2017 OpenFOAM Foundation + Copyright (C) 2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/utilities/miscellaneous/foamHelp/helpTypes/helpType/helpTypeNew.C b/applications/utilities/miscellaneous/foamHelp/helpTypes/helpType/helpTypeNew.C index c6c65b47b41..59a8851c405 100644 --- a/applications/utilities/miscellaneous/foamHelp/helpTypes/helpType/helpTypeNew.C +++ b/applications/utilities/miscellaneous/foamHelp/helpTypes/helpType/helpTypeNew.C @@ -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()); } diff --git a/applications/utilities/preProcessing/PDR/pdrFields/obstacles/PDRobstacle.C b/applications/utilities/preProcessing/PDR/pdrFields/obstacles/PDRobstacle.C index a13bba92bc3..1625ad1d3fe 100644 --- a/applications/utilities/preProcessing/PDR/pdrFields/obstacles/PDRobstacle.C +++ b/applications/utilities/preProcessing/PDR/pdrFields/obstacles/PDRobstacle.C @@ -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); } diff --git a/applications/utilities/preProcessing/PDR/pdrFields/obstacles/PDRobstacle.H b/applications/utilities/preProcessing/PDR/pdrFields/obstacles/PDRobstacle.H index 7328b7ecb0b..d0dede5418a 100644 --- a/applications/utilities/preProcessing/PDR/pdrFields/obstacles/PDRobstacle.H +++ b/applications/utilities/preProcessing/PDR/pdrFields/obstacles/PDRobstacle.H @@ -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 diff --git a/applications/utilities/preProcessing/PDR/pdrFields/obstacles/PDRobstacleIO.C b/applications/utilities/preProcessing/PDR/pdrFields/obstacles/PDRobstacleIO.C index 342a3175cfc..dfd1bcd39a5 100644 --- a/applications/utilities/preProcessing/PDR/pdrFields/obstacles/PDRobstacleIO.C +++ b/applications/utilities/preProcessing/PDR/pdrFields/obstacles/PDRobstacleIO.C @@ -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; } diff --git a/applications/utilities/preProcessing/PDR/pdrFields/obstacles/PDRobstacleTypes.C b/applications/utilities/preProcessing/PDR/pdrFields/obstacles/PDRobstacleTypes.C index 3fc8275f46f..078b5a7df03 100644 --- a/applications/utilities/preProcessing/PDR/pdrFields/obstacles/PDRobstacleTypes.C +++ b/applications/utilities/preProcessing/PDR/pdrFields/obstacles/PDRobstacleTypes.C @@ -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 \ ); \ } \ diff --git a/applications/utilities/preProcessing/setAlphaField/alphaFieldFunctions/implicitFunctions/implicitFunction.C b/applications/utilities/preProcessing/setAlphaField/alphaFieldFunctions/implicitFunctions/implicitFunction.C index fb5e1220f67..bc6b33f4264 100644 --- a/applications/utilities/preProcessing/setAlphaField/alphaFieldFunctions/implicitFunctions/implicitFunction.C +++ b/applications/utilities/preProcessing/setAlphaField/alphaFieldFunctions/implicitFunctions/implicitFunction.C @@ -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)); } diff --git a/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/tabulatedWallFunction/tabulatedWallFunctionNew.C b/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/tabulatedWallFunction/tabulatedWallFunctionNew.C index cb862e61c0d..5ee26060e3d 100644 --- a/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/tabulatedWallFunction/tabulatedWallFunctionNew.C +++ b/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/tabulatedWallFunction/tabulatedWallFunctionNew.C @@ -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)); } diff --git a/applications/utilities/surface/surfaceFeatureExtract/extractionMethod/surfaceFeaturesExtraction.C b/applications/utilities/surface/surfaceFeatureExtract/extractionMethod/surfaceFeaturesExtraction.C index 3e924b4e007..b5723df239d 100644 --- a/applications/utilities/surface/surfaceFeatureExtract/extractionMethod/surfaceFeaturesExtraction.C +++ b/applications/utilities/surface/surfaceFeatureExtract/extractionMethod/surfaceFeaturesExtraction.C @@ -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)); } diff --git a/applications/utilities/surface/surfacePatch/searchableSurfaceModifier/searchableSurfaceModifier.C b/applications/utilities/surface/surfacePatch/searchableSurfaceModifier/searchableSurfaceModifier.C index dcd295f0010..0b3b028fe14 100644 --- a/applications/utilities/surface/surfacePatch/searchableSurfaceModifier/searchableSurfaceModifier.C +++ b/applications/utilities/surface/surfacePatch/searchableSurfaceModifier/searchableSurfaceModifier.C @@ -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)); } diff --git a/src/ODE/ODESolvers/ODESolver/ODESolverNew.C b/src/ODE/ODESolvers/ODESolver/ODESolverNew.C index 1ed2d81c875..b9a88f2aeb4 100644 --- a/src/ODE/ODESolvers/ODESolver/ODESolverNew.C +++ b/src/ODE/ODESolvers/ODESolver/ODESolverNew.C @@ -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)); } diff --git a/src/OpenFOAM/db/IOstreams/token/token.C b/src/OpenFOAM/db/IOstreams/token/token.C index 313ca75fd18..5cfbdfb8fd8 100644 --- a/src/OpenFOAM/db/IOstreams/token/token.C +++ b/src/OpenFOAM/db/IOstreams/token/token.C @@ -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)); } diff --git a/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.C b/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.C index 62664f00dfe..c363b63f875 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.C +++ b/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.C @@ -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); } diff --git a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C index edabdf8d0aa..2229135ae3f 100644 --- a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C +++ b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C @@ -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)); } diff --git a/src/OpenFOAM/expressions/exprEntry/expressionEntry.C b/src/OpenFOAM/expressions/exprEntry/expressionEntry.C index 6e83f0b7384..652572b5ed7 100644 --- a/src/OpenFOAM/expressions/exprEntry/expressionEntry.C +++ b/src/OpenFOAM/expressions/exprEntry/expressionEntry.C @@ -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()); } diff --git a/src/OpenFOAM/expressions/exprResult/exprResult.C b/src/OpenFOAM/expressions/exprResult/exprResult.C index 2b43da245fc..a2085021983 100644 --- a/src/OpenFOAM/expressions/exprResult/exprResult.C +++ b/src/OpenFOAM/expressions/exprResult/exprResult.C @@ -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)); } diff --git a/src/OpenFOAM/fields/pointPatchFields/basic/calculated/calculatedPointPatchField.C b/src/OpenFOAM/fields/pointPatchFields/basic/calculated/calculatedPointPatchField.C index 60a2a4b7ebd..34002cc3834 100644 --- a/src/OpenFOAM/fields/pointPatchFields/basic/calculated/calculatedPointPatchField.C +++ b/src/OpenFOAM/fields/pointPatchFields/basic/calculated/calculatedPointPatchField.C @@ -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() diff --git a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldNew.C b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldNew.C index 42dafa64190..38efd74909e 100644 --- a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldNew.C +++ b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldNew.C @@ -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); } diff --git a/src/OpenFOAM/global/fileOperations/fileOperation/fileOperation.C b/src/OpenFOAM/global/fileOperations/fileOperation/fileOperation.C index 3919c92f963..94d9adf1b10 100644 --- a/src/OpenFOAM/global/fileOperations/fileOperation/fileOperation.C +++ b/src/OpenFOAM/global/fileOperations/fileOperation/fileOperation.C @@ -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)); } diff --git a/src/OpenFOAM/global/fileOperations/fileOperationInitialise/fileOperationInitialise.C b/src/OpenFOAM/global/fileOperations/fileOperationInitialise/fileOperationInitialise.C index ff83c578452..562fc7c2665 100644 --- a/src/OpenFOAM/global/fileOperations/fileOperationInitialise/fileOperationInitialise.C +++ b/src/OpenFOAM/global/fileOperations/fileOperationInitialise/fileOperationInitialise.C @@ -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)); } diff --git a/src/OpenFOAM/graph/graph.C b/src/OpenFOAM/graph/graph.C index 0e0f18dac53..eaa4a7b1cd0 100644 --- a/src/OpenFOAM/graph/graph.C +++ b/src/OpenFOAM/graph/graph.C @@ -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()); } diff --git a/src/OpenFOAM/interpolations/interpolationTable/tableReaders/tableReader.C b/src/OpenFOAM/interpolations/interpolationTable/tableReaders/tableReader.C index c3d2423de6e..c11f5df2713 100644 --- a/src/OpenFOAM/interpolations/interpolationTable/tableReaders/tableReader.C +++ b/src/OpenFOAM/interpolations/interpolationTable/tableReaders/tableReader.C @@ -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)); } diff --git a/src/OpenFOAM/interpolations/interpolationWeights/interpolationWeights/interpolationWeights.C b/src/OpenFOAM/interpolations/interpolationWeights/interpolationWeights/interpolationWeights.C index 540fa01f795..c64c815d882 100644 --- a/src/OpenFOAM/interpolations/interpolationWeights/interpolationWeights/interpolationWeights.C +++ b/src/OpenFOAM/interpolations/interpolationWeights/interpolationWeights/interpolationWeights.C @@ -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)); } diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixPreconditioner.C b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixPreconditioner.C index 31a359ee072..c61d8b6a762 100644 --- a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixPreconditioner.C +++ b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixPreconditioner.C @@ -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 diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSmoother.C b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSmoother.C index 7796bfea81c..69f5073f093 100644 --- a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSmoother.C +++ b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSmoother.C @@ -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 diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSolver.C b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSolver.C index f8d88c2c4bc..59d117381e1 100644 --- a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSolver.C +++ b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSolver.C @@ -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, diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixPreconditioner.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixPreconditioner.C index fe87a93f412..8cf87893388 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixPreconditioner.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixPreconditioner.C @@ -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 diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSmoother.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSmoother.C index a66348f2459..901d4ea8809 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSmoother.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSmoother.C @@ -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, diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C index 2a7bb5ec6e4..bae0f3d9e74 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C @@ -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, diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C index 645cfaa152a..4a5ffe33fe6 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C @@ -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, diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGProcAgglomerations/GAMGProcAgglomeration/GAMGProcAgglomeration.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGProcAgglomerations/GAMGProcAgglomeration/GAMGProcAgglomeration.C index 7fb23ff19c2..47681853c00 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGProcAgglomerations/GAMGProcAgglomeration/GAMGProcAgglomeration.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGProcAgglomerations/GAMGProcAgglomeration/GAMGProcAgglomeration.C @@ -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)); } diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/GAMGInterfaceField/GAMGInterfaceFieldNew.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/GAMGInterfaceField/GAMGInterfaceFieldNew.C index 76558437813..59ffcde8565 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/GAMGInterfaceField/GAMGInterfaceFieldNew.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/GAMGInterfaceField/GAMGInterfaceFieldNew.C @@ -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)); } diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/GAMGInterfaceNew.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/GAMGInterfaceNew.C index 5cae89551b4..7d8b855edab 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/GAMGInterfaceNew.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/GAMGInterfaceNew.C @@ -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)); } diff --git a/src/OpenFOAM/meshes/pointMesh/pointPatches/facePointPatch/facePointPatchNew.C b/src/OpenFOAM/meshes/pointMesh/pointPatches/facePointPatch/facePointPatchNew.C index 02640b41798..21261cfe566 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointPatches/facePointPatch/facePointPatchNew.C +++ b/src/OpenFOAM/meshes/pointMesh/pointPatches/facePointPatch/facePointPatchNew.C @@ -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)); } diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.C index d466d6f174f..61be2728178 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.C @@ -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(); } } diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatchNew.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatchNew.C index 4d9b0a18b2e..cf1bfde74bd 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatchNew.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatchNew.C @@ -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)); } diff --git a/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZoneNew.C b/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZoneNew.C index 6e48eb2a7e1..d3106b938e3 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZoneNew.C +++ b/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZoneNew.C @@ -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)); } diff --git a/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZoneNew.C b/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZoneNew.C index 14ff989c766..05725ffe6a6 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZoneNew.C +++ b/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZoneNew.C @@ -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)); } diff --git a/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZoneNew.C b/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZoneNew.C index f8cbf189fbe..97c5da6bd3b 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZoneNew.C +++ b/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZoneNew.C @@ -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)); } diff --git a/src/OpenFOAM/primitives/functions/Function1/Function1/Function1New.C b/src/OpenFOAM/primitives/functions/Function1/Function1/Function1New.C index ae20893b4a3..3e8727606aa 100644 --- a/src/OpenFOAM/primitives/functions/Function1/Function1/Function1New.C +++ b/src/OpenFOAM/primitives/functions/Function1/Function1/Function1New.C @@ -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); } diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.C b/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.C index d93635c97a8..1608a5682a7 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.C +++ b/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.C @@ -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) ); } diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C index 554def6e991..168c538e669 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C +++ b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C @@ -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)); } diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESfilters/LESfilter/LESfilter.C b/src/TurbulenceModels/turbulenceModels/LES/LESfilters/LESfilter/LESfilter.C index 51811d6f2cb..87b5232ea0a 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESfilters/LESfilter/LESfilter.C +++ b/src/TurbulenceModels/turbulenceModels/LES/LESfilters/LESfilter/LESfilter.C @@ -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)); } diff --git a/src/TurbulenceModels/turbulenceModels/RAS/RASModel/RASModel.C b/src/TurbulenceModels/turbulenceModels/RAS/RASModel/RASModel.C index 90f9a15d6b0..43b5745d880 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/RASModel/RASModel.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/RASModel/RASModel.C @@ -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) ); } diff --git a/src/TurbulenceModels/turbulenceModels/TurbulenceModel/TurbulenceModel.C b/src/TurbulenceModels/turbulenceModels/TurbulenceModel/TurbulenceModel.C index 7eaf600c9fe..8400b981c89 100644 --- a/src/TurbulenceModels/turbulenceModels/TurbulenceModel/TurbulenceModel.C +++ b/src/TurbulenceModels/turbulenceModels/TurbulenceModel/TurbulenceModel.C @@ -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) ); } diff --git a/src/TurbulenceModels/turbulenceModels/laminar/generalizedNewtonian/generalizedNewtonianViscosityModels/generalizedNewtonianViscosityModel/generalizedNewtonianViscosityModelNew.C b/src/TurbulenceModels/turbulenceModels/laminar/generalizedNewtonian/generalizedNewtonianViscosityModels/generalizedNewtonianViscosityModel/generalizedNewtonianViscosityModelNew.C index 17ff06d3703..6d6a2180932 100644 --- a/src/TurbulenceModels/turbulenceModels/laminar/generalizedNewtonian/generalizedNewtonianViscosityModels/generalizedNewtonianViscosityModel/generalizedNewtonianViscosityModelNew.C +++ b/src/TurbulenceModels/turbulenceModels/laminar/generalizedNewtonian/generalizedNewtonianViscosityModels/generalizedNewtonianViscosityModel/generalizedNewtonianViscosityModelNew.C @@ -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)); } diff --git a/src/TurbulenceModels/turbulenceModels/laminar/laminarModel/laminarModel.C b/src/TurbulenceModels/turbulenceModels/laminar/laminarModel/laminarModel.C index 3b2b179b366..3e9eba5d0f3 100644 --- a/src/TurbulenceModels/turbulenceModels/laminar/laminarModel/laminarModel.C +++ b/src/TurbulenceModels/turbulenceModels/laminar/laminarModel/laminarModel.C @@ -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, diff --git a/src/combustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameAreaNew.C b/src/combustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameAreaNew.C index a9f404289b5..c70d377a158 100644 --- a/src/combustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameAreaNew.C +++ b/src/combustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameAreaNew.C @@ -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)); } diff --git a/src/combustionModels/combustionModel/combustionModelTemplates.C b/src/combustionModels/combustionModel/combustionModelTemplates.C index fcf4d4a059d..7473db02708 100644 --- a/src/combustionModels/combustionModel/combustionModelTemplates.C +++ b/src/combustionModels/combustionModel/combustionModelTemplates.C @@ -186,7 +186,7 @@ Foam::autoPtr<CombustionModel> Foam::combustionModel::New return autoPtr<CombustionModel> ( - ctorIter()(combModelName, thermo, turb, combustionProperties) + ctorIter.val()(combModelName, thermo, turb, combustionProperties) ); } diff --git a/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMeshNew.C b/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMeshNew.C index 0ae2fd5c1f6..ea6a5d9a020 100644 --- a/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMeshNew.C +++ b/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMeshNew.C @@ -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 diff --git a/src/dynamicFvMesh/simplifiedDynamicFvMesh/simplifiedDynamicFvMesh.C b/src/dynamicFvMesh/simplifiedDynamicFvMesh/simplifiedDynamicFvMesh.C index 7bc324253ae..92403dedf1b 100644 --- a/src/dynamicFvMesh/simplifiedDynamicFvMesh/simplifiedDynamicFvMesh.C +++ b/src/dynamicFvMesh/simplifiedDynamicFvMesh/simplifiedDynamicFvMesh.C @@ -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())); } } diff --git a/src/dynamicMesh/meshCut/cellLooper/cellLooper.C b/src/dynamicMesh/meshCut/cellLooper/cellLooper.C index e96bd7d725d..457ffc491f6 100644 --- a/src/dynamicMesh/meshCut/cellLooper/cellLooper.C +++ b/src/dynamicMesh/meshCut/cellLooper/cellLooper.C @@ -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)); } diff --git a/src/dynamicMesh/motionSolvers/displacement/displacement/displacementMotionSolver.C b/src/dynamicMesh/motionSolvers/displacement/displacement/displacementMotionSolver.C index 3217fff6a11..39d26546859 100644 --- a/src/dynamicMesh/motionSolvers/displacement/displacement/displacementMotionSolver.C +++ b/src/dynamicMesh/motionSolvers/displacement/displacement/displacementMotionSolver.C @@ -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, diff --git a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunctionNew.C b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunctionNew.C index 7fb8dae3155..41f59990b36 100644 --- a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunctionNew.C +++ b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunctionNew.C @@ -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)); } diff --git a/src/dynamicMesh/motionSolvers/motionSolver/motionSolver.C b/src/dynamicMesh/motionSolvers/motionSolver/motionSolver.C index d8952dd77ee..8ec04241826 100644 --- a/src/dynamicMesh/motionSolvers/motionSolver/motionSolver.C +++ b/src/dynamicMesh/motionSolvers/motionSolver/motionSolver.C @@ -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)); } diff --git a/src/dynamicMesh/polyTopoChange/polyMeshModifier/polyMeshModifierNew.C b/src/dynamicMesh/polyTopoChange/polyMeshModifier/polyMeshModifierNew.C index c0407cc7b61..4cfafc59be8 100644 --- a/src/dynamicMesh/polyTopoChange/polyMeshModifier/polyMeshModifierNew.C +++ b/src/dynamicMesh/polyTopoChange/polyMeshModifier/polyMeshModifierNew.C @@ -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)); } diff --git a/src/engine/engineMesh/engineMesh/engineMeshNew.C b/src/engine/engineMesh/engineMesh/engineMeshNew.C index aa7cbedf12e..9cb427c8da2 100644 --- a/src/engine/engineMesh/engineMesh/engineMeshNew.C +++ b/src/engine/engineMesh/engineMesh/engineMeshNew.C @@ -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)); } diff --git a/src/engine/engineTime/engineTime/engineTimeNew.C b/src/engine/engineTime/engineTime/engineTimeNew.C index 66a33553830..2d4cba2a656 100644 --- a/src/engine/engineTime/engineTime/engineTimeNew.C +++ b/src/engine/engineTime/engineTime/engineTimeNew.C @@ -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, diff --git a/src/faOptions/faOption/faOption.C b/src/faOptions/faOption/faOption.C index b043867f818..89632a88c0a 100644 --- a/src/faOptions/faOption/faOption.C +++ b/src/faOptions/faOption/faOption.C @@ -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)); } diff --git a/src/fileFormats/sampledSetWriters/writer.C b/src/fileFormats/sampledSetWriters/writer.C index be045ea2f02..ea142332876 100644 --- a/src/fileFormats/sampledSetWriters/writer.C +++ b/src/fileFormats/sampledSetWriters/writer.C @@ -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()); } diff --git a/src/finiteArea/faMesh/faPatches/faPatch/faPatchNew.C b/src/finiteArea/faMesh/faPatches/faPatch/faPatchNew.C index 814ff01b0a1..2d06659ae3e 100644 --- a/src/finiteArea/faMesh/faPatches/faPatch/faPatchNew.C +++ b/src/finiteArea/faMesh/faPatches/faPatch/faPatchNew.C @@ -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)); } diff --git a/src/finiteArea/fields/faPatchFields/basic/calculated/calculatedFaPatchField.C b/src/finiteArea/fields/faPatchFields/basic/calculated/calculatedFaPatchField.C index 8a4a4c7b253..0ec6a8bdaaa 100644 --- a/src/finiteArea/fields/faPatchFields/basic/calculated/calculatedFaPatchField.C +++ b/src/finiteArea/fields/faPatchFields/basic/calculated/calculatedFaPatchField.C @@ -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() diff --git a/src/finiteArea/fields/faPatchFields/faPatchField/faPatchFieldNew.C b/src/finiteArea/fields/faPatchFields/faPatchField/faPatchFieldNew.C index 04550acbb1c..4ce72902d74 100644 --- a/src/finiteArea/fields/faPatchFields/faPatchField/faPatchFieldNew.C +++ b/src/finiteArea/fields/faPatchFields/faPatchField/faPatchFieldNew.C @@ -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); } diff --git a/src/finiteArea/fields/faePatchFields/basic/calculated/calculatedFaePatchField.C b/src/finiteArea/fields/faePatchFields/basic/calculated/calculatedFaePatchField.C index 07ab7a28512..f1424829e39 100644 --- a/src/finiteArea/fields/faePatchFields/basic/calculated/calculatedFaePatchField.C +++ b/src/finiteArea/fields/faePatchFields/basic/calculated/calculatedFaePatchField.C @@ -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() diff --git a/src/finiteArea/fields/faePatchFields/faePatchField/faePatchFieldNew.C b/src/finiteArea/fields/faePatchFields/faePatchField/faePatchFieldNew.C index df961bbefb9..b8b80f29eac 100644 --- a/src/finiteArea/fields/faePatchFields/faePatchField/faePatchFieldNew.C +++ b/src/finiteArea/fields/faePatchFields/faePatchField/faePatchFieldNew.C @@ -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); } diff --git a/src/finiteArea/finiteArea/convectionSchemes/faConvectionScheme/faConvectionScheme.C b/src/finiteArea/finiteArea/convectionSchemes/faConvectionScheme/faConvectionScheme.C index f922400f5dd..4e4ea5072a8 100644 --- a/src/finiteArea/finiteArea/convectionSchemes/faConvectionScheme/faConvectionScheme.C +++ b/src/finiteArea/finiteArea/convectionSchemes/faConvectionScheme/faConvectionScheme.C @@ -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); } diff --git a/src/finiteArea/finiteArea/d2dt2Schemes/faD2dt2Scheme/faD2dt2Scheme.C b/src/finiteArea/finiteArea/d2dt2Schemes/faD2dt2Scheme/faD2dt2Scheme.C index 3e05a6c6d20..2f33acefcf4 100644 --- a/src/finiteArea/finiteArea/d2dt2Schemes/faD2dt2Scheme/faD2dt2Scheme.C +++ b/src/finiteArea/finiteArea/d2dt2Schemes/faD2dt2Scheme/faD2dt2Scheme.C @@ -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); } diff --git a/src/finiteArea/finiteArea/ddtSchemes/faDdtScheme/faDdtScheme.C b/src/finiteArea/finiteArea/ddtSchemes/faDdtScheme/faDdtScheme.C index 20bb75dd5d6..9c18bf8f16c 100644 --- a/src/finiteArea/finiteArea/ddtSchemes/faDdtScheme/faDdtScheme.C +++ b/src/finiteArea/finiteArea/ddtSchemes/faDdtScheme/faDdtScheme.C @@ -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); } diff --git a/src/finiteArea/finiteArea/divSchemes/faDivScheme/faDivScheme.C b/src/finiteArea/finiteArea/divSchemes/faDivScheme/faDivScheme.C index 9f1054087bb..ee05ffe259f 100644 --- a/src/finiteArea/finiteArea/divSchemes/faDivScheme/faDivScheme.C +++ b/src/finiteArea/finiteArea/divSchemes/faDivScheme/faDivScheme.C @@ -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); } diff --git a/src/finiteArea/finiteArea/gradSchemes/faGradScheme/faGradScheme.C b/src/finiteArea/finiteArea/gradSchemes/faGradScheme/faGradScheme.C index 45d88a5e539..a5aef3b13fe 100644 --- a/src/finiteArea/finiteArea/gradSchemes/faGradScheme/faGradScheme.C +++ b/src/finiteArea/finiteArea/gradSchemes/faGradScheme/faGradScheme.C @@ -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); } diff --git a/src/finiteArea/finiteArea/laplacianSchemes/faLaplacianScheme/faLaplacianScheme.C b/src/finiteArea/finiteArea/laplacianSchemes/faLaplacianScheme/faLaplacianScheme.C index 0022bcc5cfb..821f2c74e3d 100644 --- a/src/finiteArea/finiteArea/laplacianSchemes/faLaplacianScheme/faLaplacianScheme.C +++ b/src/finiteArea/finiteArea/laplacianSchemes/faLaplacianScheme/faLaplacianScheme.C @@ -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); } diff --git a/src/finiteArea/finiteArea/lnGradSchemes/lnGradScheme/lnGradScheme.C b/src/finiteArea/finiteArea/lnGradSchemes/lnGradScheme/lnGradScheme.C index 9c9a54da7d2..d499b741924 100644 --- a/src/finiteArea/finiteArea/lnGradSchemes/lnGradScheme/lnGradScheme.C +++ b/src/finiteArea/finiteArea/lnGradSchemes/lnGradScheme/lnGradScheme.C @@ -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); } diff --git a/src/finiteArea/interpolation/edgeInterpolation/edgeInterpolationScheme/edgeInterpolationScheme.C b/src/finiteArea/interpolation/edgeInterpolation/edgeInterpolationScheme/edgeInterpolationScheme.C index 3f8bcd76f8e..d41009dcd8a 100644 --- a/src/finiteArea/interpolation/edgeInterpolation/edgeInterpolationScheme/edgeInterpolationScheme.C +++ b/src/finiteArea/interpolation/edgeInterpolation/edgeInterpolationScheme/edgeInterpolationScheme.C @@ -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); } diff --git a/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModelNew.C b/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModelNew.C index 81baac71a1c..c476c65b05e 100644 --- a/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModelNew.C +++ b/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModelNew.C @@ -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)); } diff --git a/src/finiteVolume/cfdTools/general/fvOptions/fvOption.C b/src/finiteVolume/cfdTools/general/fvOptions/fvOption.C index a3aa2f6dadd..d58183d00b2 100644 --- a/src/finiteVolume/cfdTools/general/fvOptions/fvOption.C +++ b/src/finiteVolume/cfdTools/general/fvOptions/fvOption.C @@ -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)); } diff --git a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModelNew.C b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModelNew.C index 052f3d397d6..b57b151f1c1 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModelNew.C +++ b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModelNew.C @@ -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, diff --git a/src/finiteVolume/expressions/base/fvExprDriverNew.C b/src/finiteVolume/expressions/base/fvExprDriverNew.C index 98c5fae422b..83ea392fdd2 100644 --- a/src/finiteVolume/expressions/base/fvExprDriverNew.C +++ b/src/finiteVolume/expressions/base/fvExprDriverNew.C @@ -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)); } diff --git a/src/finiteVolume/fields/fvPatchFields/basic/calculated/calculatedFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/basic/calculated/calculatedFvPatchField.C index ba4c35d5ce4..47a1c224b23 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/calculated/calculatedFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/basic/calculated/calculatedFvPatchField.C @@ -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() diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchFieldNew.C b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchFieldNew.C index d1331e288c1..75c8170cbaa 100644 --- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchFieldNew.C +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchFieldNew.C @@ -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); } diff --git a/src/finiteVolume/fields/fvsPatchFields/basic/calculated/calculatedFvsPatchField.C b/src/finiteVolume/fields/fvsPatchFields/basic/calculated/calculatedFvsPatchField.C index c7650fe9229..f3d2a56818b 100644 --- a/src/finiteVolume/fields/fvsPatchFields/basic/calculated/calculatedFvsPatchField.C +++ b/src/finiteVolume/fields/fvsPatchFields/basic/calculated/calculatedFvsPatchField.C @@ -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() diff --git a/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchFieldNew.C b/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchFieldNew.C index 07778620637..eba528f84c7 100644 --- a/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchFieldNew.C +++ b/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchFieldNew.C @@ -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); } diff --git a/src/finiteVolume/finiteVolume/convectionSchemes/convectionScheme/convectionScheme.C b/src/finiteVolume/finiteVolume/convectionSchemes/convectionScheme/convectionScheme.C index f21e3254db3..aada459a2b0 100644 --- a/src/finiteVolume/finiteVolume/convectionSchemes/convectionScheme/convectionScheme.C +++ b/src/finiteVolume/finiteVolume/convectionSchemes/convectionScheme/convectionScheme.C @@ -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); } diff --git a/src/finiteVolume/finiteVolume/d2dt2Schemes/d2dt2Scheme/d2dt2Scheme.C b/src/finiteVolume/finiteVolume/d2dt2Schemes/d2dt2Scheme/d2dt2Scheme.C index 1159a127a14..2dc13070925 100644 --- a/src/finiteVolume/finiteVolume/d2dt2Schemes/d2dt2Scheme/d2dt2Scheme.C +++ b/src/finiteVolume/finiteVolume/d2dt2Schemes/d2dt2Scheme/d2dt2Scheme.C @@ -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. @@ -64,9 +64,9 @@ tmp<d2dt2Scheme<Type>> d2dt2Scheme<Type>::New const word schemeName(schemeData); - auto cstrIter = IstreamConstructorTablePtr_->cfind(schemeName); + auto* ctorPtr = IstreamConstructorTable(schemeName); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -77,7 +77,7 @@ tmp<d2dt2Scheme<Type>> d2dt2Scheme<Type>::New ) << exit(FatalIOError); } - return cstrIter()(mesh, schemeData); + return ctorPtr(mesh, schemeData); } diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C index 6ce56fc73c4..aeb6a14587c 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2018 OpenFOAM Foundation - Copyright (C) 2017-2019 OpenCFD Ltd. + Copyright (C) 2017-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -68,9 +68,9 @@ tmp<ddtScheme<Type>> ddtScheme<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<ddtScheme<Type>> ddtScheme<Type>::New ) << exit(FatalIOError); } - return cstrIter()(mesh, schemeData); + return ctorPtr(mesh, schemeData); } diff --git a/src/finiteVolume/finiteVolume/divSchemes/divScheme/divScheme.C b/src/finiteVolume/finiteVolume/divSchemes/divScheme/divScheme.C index 322a00d188e..9c231529b2a 100644 --- a/src/finiteVolume/finiteVolume/divSchemes/divScheme/divScheme.C +++ b/src/finiteVolume/finiteVolume/divSchemes/divScheme/divScheme.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation + Copyright (C) 2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -67,9 +68,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) { FatalIOErrorInFunction(schemeData) << "unknown div scheme " @@ -79,7 +80,7 @@ tmp<divScheme<Type>> divScheme<Type>::New << exit(FatalIOError); } - return cstrIter()(mesh, schemeData); + return ctorPtr(mesh, schemeData); } diff --git a/src/finiteVolume/finiteVolume/gradSchemes/gradScheme/gradScheme.C b/src/finiteVolume/finiteVolume/gradSchemes/gradScheme/gradScheme.C index a91833ee10e..37bd371ff88 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/gradScheme/gradScheme.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/gradScheme/gradScheme.C @@ -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. @@ -55,9 +55,9 @@ Foam::tmp<Foam::fv::gradScheme<Type>> Foam::fv::gradScheme<Type>::New const word schemeName(schemeData); - auto cstrIter = IstreamConstructorTablePtr_->cfind(schemeName); + auto* ctorPtr = IstreamConstructorTable(schemeName); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -68,7 +68,7 @@ Foam::tmp<Foam::fv::gradScheme<Type>> Foam::fv::gradScheme<Type>::New ) << exit(FatalIOError); } - return cstrIter()(mesh, schemeData); + return ctorPtr(mesh, schemeData); } diff --git a/src/finiteVolume/finiteVolume/laplacianSchemes/laplacianScheme/laplacianScheme.C b/src/finiteVolume/finiteVolume/laplacianSchemes/laplacianScheme/laplacianScheme.C index 44f1fcc637e..8e032da8cc4 100644 --- a/src/finiteVolume/finiteVolume/laplacianSchemes/laplacianScheme/laplacianScheme.C +++ b/src/finiteVolume/finiteVolume/laplacianSchemes/laplacianScheme/laplacianScheme.C @@ -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. @@ -66,9 +66,9 @@ tmp<laplacianScheme<Type, GType>> laplacianScheme<Type, GType>::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<laplacianScheme<Type, GType>> laplacianScheme<Type, GType>::New ) << exit(FatalIOError); } - return cstrIter()(mesh, schemeData); + return ctorPtr(mesh, schemeData); } diff --git a/src/finiteVolume/finiteVolume/snGradSchemes/snGradScheme/snGradScheme.C b/src/finiteVolume/finiteVolume/snGradSchemes/snGradScheme/snGradScheme.C index c9cecd23ebc..0dc584dcfb1 100644 --- a/src/finiteVolume/finiteVolume/snGradSchemes/snGradScheme/snGradScheme.C +++ b/src/finiteVolume/finiteVolume/snGradSchemes/snGradScheme/snGradScheme.C @@ -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. @@ -68,9 +68,9 @@ tmp<snGradScheme<Type>> snGradScheme<Type>::New const word schemeName(schemeData); - auto cstrIter = MeshConstructorTablePtr_->cfind(schemeName); + auto* ctorPtr = MeshConstructorTable(schemeName); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -81,7 +81,7 @@ tmp<snGradScheme<Type>> snGradScheme<Type>::New ) << exit(FatalIOError); } - return cstrIter()(mesh, schemeData); + return ctorPtr(mesh, schemeData); } diff --git a/src/finiteVolume/fvMatrices/solvers/multiDimPolyFitter/multiDimPolyFunctions/multiDimPolyFunctions.C b/src/finiteVolume/fvMatrices/solvers/multiDimPolyFitter/multiDimPolyFunctions/multiDimPolyFunctions.C index 07df3230b5a..67a72e824db 100644 --- a/src/finiteVolume/fvMatrices/solvers/multiDimPolyFitter/multiDimPolyFunctions/multiDimPolyFunctions.C +++ b/src/finiteVolume/fvMatrices/solvers/multiDimPolyFitter/multiDimPolyFunctions/multiDimPolyFunctions.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2020 DLR + Copyright (C) 2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -45,9 +46,9 @@ Foam::autoPtr<Foam::multiDimPolyFunctions> Foam::multiDimPolyFunctions::New const labelVector& dirs ) { - auto cstrIter = wordConstructorTablePtr_->cfind(multiDimPolyFunctionsType); + auto* ctorPtr = wordConstructorTable(multiDimPolyFunctionsType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInLookup ( @@ -57,7 +58,7 @@ Foam::autoPtr<Foam::multiDimPolyFunctions> Foam::multiDimPolyFunctions::New ) << exit(FatalError); } - return autoPtr<multiDimPolyFunctions>(cstrIter()(dirs)); + return autoPtr<multiDimPolyFunctions>(ctorPtr(dirs)); } diff --git a/src/finiteVolume/fvMesh/fvGeometryScheme/fvGeometryScheme/fvGeometryScheme.C b/src/finiteVolume/fvMesh/fvGeometryScheme/fvGeometryScheme/fvGeometryScheme.C index a0eab850175..250576f0507 100644 --- a/src/finiteVolume/fvMesh/fvGeometryScheme/fvGeometryScheme/fvGeometryScheme.C +++ b/src/finiteVolume/fvMesh/fvGeometryScheme/fvGeometryScheme/fvGeometryScheme.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2020 OpenCFD Ltd. + Copyright (C) 2020-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -60,9 +60,9 @@ Foam::fvGeometryScheme::New InfoInFunction << "Geometry scheme = " << schemeName << endl; } - auto cstrIter = dictConstructorTablePtr_->cfind(schemeName); + auto* ctorPtr = dictConstructorTable(schemeName); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -73,7 +73,7 @@ Foam::fvGeometryScheme::New ) << exit(FatalIOError); } - return cstrIter()(mesh, dict); + return ctorPtr(mesh, dict); } diff --git a/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatch.C b/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatch.C index b100323976d..6d85301a440 100644 --- a/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatch.C +++ b/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatch.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2020 OpenCFD Ltd. + Copyright (C) 2020-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -80,21 +80,27 @@ Foam::fvPatch::~fvPatch() bool Foam::fvPatch::constraintType(const word& pt) { - return fvPatchField<scalar>::patchConstructorTablePtr_->found(pt); + return + ( + fvPatchField<scalar>::patchConstructorTablePtr_ + && fvPatchField<scalar>::patchConstructorTablePtr_->found(pt) + ); } Foam::wordList Foam::fvPatch::constraintTypes() { - wordList cTypes(polyPatchConstructorTablePtr_->size()); + const auto& cnstrTable = *polyPatchConstructorTablePtr_; + + wordList cTypes(cnstrTable.size()); label i = 0; - forAllConstIters(*polyPatchConstructorTablePtr_, cstrIter) + forAllConstIters(cnstrTable, iter) { - if (constraintType(cstrIter.key())) + if (constraintType(iter.key())) { - cTypes[i++] = cstrIter.key(); + cTypes[i++] = iter.key(); } } diff --git a/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatchNew.C b/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatchNew.C index af1846faff6..30940b57502 100644 --- a/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatchNew.C +++ b/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatchNew.C @@ -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::fvPatch> Foam::fvPatch::New { DebugInFunction << "Constructing fvPatch" << endl; - auto cstrIter = polyPatchConstructorTablePtr_->cfind(patch.type()); + auto* ctorPtr = polyPatchConstructorTable(patch.type()); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInLookup ( @@ -51,7 +51,7 @@ Foam::autoPtr<Foam::fvPatch> Foam::fvPatch::New ) << exit(FatalError); } - return autoPtr<fvPatch>(cstrIter()(patch, bm)); + return autoPtr<fvPatch>(ctorPtr(patch, bm)); } diff --git a/src/finiteVolume/fvMesh/simplifiedFvMesh/simplifiedFvMesh/simplifiedFvMesh.C b/src/finiteVolume/fvMesh/simplifiedFvMesh/simplifiedFvMesh/simplifiedFvMesh.C index 5e22e9eabe2..bda4e688f83 100644 --- a/src/finiteVolume/fvMesh/simplifiedFvMesh/simplifiedFvMesh/simplifiedFvMesh.C +++ b/src/finiteVolume/fvMesh/simplifiedFvMesh/simplifiedFvMesh/simplifiedFvMesh.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2018-2019 OpenCFD Ltd. + Copyright (C) 2018-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -42,7 +42,7 @@ defineRunTimeSelectionTable(simplifiedFvMesh, time); bool Foam::simplifiedFvMesh::fvPatchFieldExists(const word& patchType) { - if + return ( fvPatchField<scalar>::dictionaryConstructorTablePtr_->found(patchType) || fvPatchField<vector>::dictionaryConstructorTablePtr_->found(patchType) @@ -51,12 +51,7 @@ bool Foam::simplifiedFvMesh::fvPatchFieldExists(const word& patchType) || fvPatchField<symmTensor>:: dictionaryConstructorTablePtr_->found(patchType) || fvPatchField<tensor>::dictionaryConstructorTablePtr_->found(patchType) - ) - { - return true; - } - - return false; + ); } @@ -90,9 +85,9 @@ Foam::autoPtr<Foam::simplifiedFvMesh> Foam::simplifiedFvMesh::New { Info<< "Selecting simplified mesh model " << modelType << endl; - auto cstrIter = timeConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = timeConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInLookup ( @@ -102,7 +97,7 @@ Foam::autoPtr<Foam::simplifiedFvMesh> Foam::simplifiedFvMesh::New ) << exit(FatalError); } - return autoPtr<simplifiedFvMesh>(cstrIter()(runTime)); + return autoPtr<simplifiedFvMesh>(ctorPtr(runTime)); } diff --git a/src/finiteVolume/fvMesh/wallDist/patchDistMethods/patchDistMethod/patchDistMethod.C b/src/finiteVolume/fvMesh/wallDist/patchDistMethods/patchDistMethod/patchDistMethod.C index e0d7ee43d4d..f656529c113 100644 --- a/src/finiteVolume/fvMesh/wallDist/patchDistMethods/patchDistMethod/patchDistMethod.C +++ b/src/finiteVolume/fvMesh/wallDist/patchDistMethods/patchDistMethod/patchDistMethod.C @@ -71,9 +71,9 @@ Foam::patchDistMethod::New ); Info<< "Selecting patchDistMethod " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -84,7 +84,7 @@ Foam::patchDistMethod::New ) << exit(FatalIOError); } - return cstrIter()(dict, mesh, patchIDs); + return ctorPtr(dict, mesh, patchIDs); } diff --git a/src/finiteVolume/interpolation/interpolation/interpolation/interpolationNew.C b/src/finiteVolume/interpolation/interpolation/interpolation/interpolationNew.C index ca8411ac1f5..4eaf949e523 100644 --- a/src/finiteVolume/interpolation/interpolation/interpolation/interpolationNew.C +++ b/src/finiteVolume/interpolation/interpolation/interpolation/interpolationNew.C @@ -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::interpolation<Type>> Foam::interpolation<Type>::New const GeometricField<Type, fvPatchField, volMesh>& psi ) { - auto cstrIter = dictionaryConstructorTablePtr_->cfind(interpolationType); + auto* ctorPtr = dictionaryConstructorTable(interpolationType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInLookup ( @@ -50,7 +50,7 @@ Foam::autoPtr<Foam::interpolation<Type>> Foam::interpolation<Type>::New ) << exit(FatalError); } - return autoPtr<interpolation<Type>>(cstrIter()(psi)); + return autoPtr<interpolation<Type>>(ctorPtr(psi)); } diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/limitedSurfaceInterpolationScheme/limitedSurfaceInterpolationScheme.C b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/limitedSurfaceInterpolationScheme/limitedSurfaceInterpolationScheme.C index be18b1f5b50..740d268f73b 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/limitedSurfaceInterpolationScheme/limitedSurfaceInterpolationScheme.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/limitedSurfaceInterpolationScheme/limitedSurfaceInterpolationScheme.C @@ -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. @@ -59,9 +59,9 @@ Foam::limitedSurfaceInterpolationScheme<Type>::New const word schemeName(schemeData); - auto cstrIter = MeshConstructorTablePtr_->cfind(schemeName); + auto* ctorPtr = MeshConstructorTable(schemeName); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -72,7 +72,7 @@ Foam::limitedSurfaceInterpolationScheme<Type>::New ) << exit(FatalIOError); } - return cstrIter()(mesh, schemeData); + return ctorPtr(mesh, schemeData); } @@ -104,9 +104,9 @@ Foam::limitedSurfaceInterpolationScheme<Type>::New const word schemeName(schemeData); - auto cstrIter = MeshFluxConstructorTablePtr_->cfind(schemeName); + auto* ctorPtr = MeshFluxConstructorTable(schemeName); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -117,7 +117,7 @@ Foam::limitedSurfaceInterpolationScheme<Type>::New ) << exit(FatalIOError); } - return cstrIter()(mesh, faceFlux, schemeData); + return ctorPtr(mesh, faceFlux, schemeData); } diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/multivariateSchemes/multivariateSurfaceInterpolationScheme/multivariateSurfaceInterpolationScheme.C b/src/finiteVolume/interpolation/surfaceInterpolation/multivariateSchemes/multivariateSurfaceInterpolationScheme/multivariateSurfaceInterpolationScheme.C index 908b7299401..80701cc446b 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/multivariateSchemes/multivariateSurfaceInterpolationScheme/multivariateSurfaceInterpolationScheme.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/multivariateSchemes/multivariateSurfaceInterpolationScheme/multivariateSurfaceInterpolationScheme.C @@ -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. @@ -68,9 +68,9 @@ Foam::multivariateSurfaceInterpolationScheme<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 @@ Foam::multivariateSurfaceInterpolationScheme<Type>::New ) << exit(FatalIOError); } - return cstrIter()(mesh, vtfs, faceFlux, schemeData); + return ctorPtr(mesh, vtfs, faceFlux, schemeData); } diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolationScheme/surfaceInterpolationScheme.C b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolationScheme/surfaceInterpolationScheme.C index ef00d578586..a34888d71ca 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolationScheme/surfaceInterpolationScheme.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolationScheme/surfaceInterpolationScheme.C @@ -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. @@ -58,9 +58,9 @@ Foam::surfaceInterpolationScheme<Type>::New InfoInFunction << "Discretisation scheme = " << schemeName << endl; } - auto cstrIter = MeshConstructorTablePtr_->cfind(schemeName); + auto* ctorPtr = MeshConstructorTable(schemeName); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -71,7 +71,7 @@ Foam::surfaceInterpolationScheme<Type>::New ) << exit(FatalIOError); } - return cstrIter()(mesh, schemeData); + return ctorPtr(mesh, schemeData); } @@ -101,9 +101,9 @@ Foam::surfaceInterpolationScheme<Type>::New InfoInFunction << "Discretisation scheme = " << schemeName << endl; } - auto cstrIter = MeshFluxConstructorTablePtr_->cfind(schemeName); + auto* ctorPtr = MeshFluxConstructorTable(schemeName); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -114,7 +114,7 @@ Foam::surfaceInterpolationScheme<Type>::New ) << exit(FatalIOError); } - return cstrIter()(mesh, faceFlux, schemeData); + return ctorPtr(mesh, faceFlux, schemeData); } diff --git a/src/functionObjects/field/DMD/DMDModels/DMDModel/DMDModelNew.C b/src/functionObjects/field/DMD/DMDModels/DMDModel/DMDModelNew.C index e3a72a4a5c2..5c4be6455b5 100644 --- a/src/functionObjects/field/DMD/DMDModels/DMDModel/DMDModelNew.C +++ b/src/functionObjects/field/DMD/DMDModels/DMDModel/DMDModelNew.C @@ -38,9 +38,9 @@ Foam::autoPtr<Foam::DMDModel> Foam::DMDModel::New { const word modelType(dict.get<word>("DMDModel")); - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -51,7 +51,7 @@ Foam::autoPtr<Foam::DMDModel> Foam::DMDModel::New ) << exit(FatalIOError); } - return autoPtr<DMDModel>(cstrIter()(mesh, name, dict)); + return autoPtr<DMDModel>(ctorPtr(mesh, name, dict)); } diff --git a/src/functionObjects/field/fieldValues/fieldValue/fieldValueNew.C b/src/functionObjects/field/fieldValues/fieldValue/fieldValueNew.C index 0868e0b86fe..6702e9403a2 100644 --- a/src/functionObjects/field/fieldValues/fieldValue/fieldValueNew.C +++ b/src/functionObjects/field/fieldValues/fieldValue/fieldValueNew.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2012-2016 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::functionObjects::fieldValue::New Info<< "Selecting " << typeName << ' ' << modelType << endl; } - auto cstrIter = runTimeConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = runTimeConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -59,7 +59,7 @@ Foam::functionObjects::fieldValue::New ) << exit(FatalIOError); } - return autoPtr<fieldValue>(cstrIter()(name, runTime, dict)); + return autoPtr<fieldValue>(ctorPtr(name, runTime, dict)); } diff --git a/src/functionObjects/field/heatTransferCoeff/heatTransferCoeffModels/heatTransferCoeffModel/heatTransferCoeffModelNew.C b/src/functionObjects/field/heatTransferCoeff/heatTransferCoeffModels/heatTransferCoeffModel/heatTransferCoeffModelNew.C index 6b800bc4630..1ac7532f66b 100644 --- a/src/functionObjects/field/heatTransferCoeff/heatTransferCoeffModels/heatTransferCoeffModel/heatTransferCoeffModelNew.C +++ b/src/functionObjects/field/heatTransferCoeff/heatTransferCoeffModels/heatTransferCoeffModel/heatTransferCoeffModelNew.C @@ -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. @@ -42,9 +42,9 @@ Foam::autoPtr<Foam::heatTransferCoeffModel> Foam::heatTransferCoeffModel::New Info<< "Selecting heat transfer coefficient 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::heatTransferCoeffModel> Foam::heatTransferCoeffModel::New ) << exit(FatalIOError); } - return autoPtr<heatTransferCoeffModel>(cstrIter()(dict, mesh, TName)); + return autoPtr<heatTransferCoeffModel>(ctorPtr(dict, mesh, TName)); } diff --git a/src/functionObjects/utilities/runTimeControl/runTimeCondition/runTimeCondition/runTimeConditionNew.C b/src/functionObjects/utilities/runTimeControl/runTimeCondition/runTimeCondition/runTimeConditionNew.C index a7e3d2b155d..c852ce5bad2 100644 --- a/src/functionObjects/utilities/runTimeControl/runTimeCondition/runTimeCondition/runTimeConditionNew.C +++ b/src/functionObjects/utilities/runTimeControl/runTimeCondition/runTimeCondition/runTimeConditionNew.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2015 OpenFOAM Foundation - Copyright (C) 2015-2019 OpenCFD Ltd. + Copyright (C) 2015-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -43,9 +43,9 @@ Foam::functionObjects::runTimeControls::runTimeCondition::New Info<< "Selecting runTimeCondition " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -59,7 +59,7 @@ Foam::functionObjects::runTimeControls::runTimeCondition::New return autoPtr<runTimeCondition> ( - cstrIter()(conditionName, obr, dict, state) + ctorPtr(conditionName, obr, dict, state) ); } diff --git a/src/fvMotionSolver/motionDiffusivity/motionDiffusivity/motionDiffusivity.C b/src/fvMotionSolver/motionDiffusivity/motionDiffusivity/motionDiffusivity.C index 35742f23284..38276e2f48e 100644 --- a/src/fvMotionSolver/motionDiffusivity/motionDiffusivity/motionDiffusivity.C +++ b/src/fvMotionSolver/motionDiffusivity/motionDiffusivity/motionDiffusivity.C @@ -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. @@ -57,9 +57,9 @@ Foam::autoPtr<Foam::motionDiffusivity> Foam::motionDiffusivity::New Info<< "Selecting motion diffusion: " << modelType << endl; - auto cstrIter = IstreamConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = IstreamConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -70,7 +70,7 @@ Foam::autoPtr<Foam::motionDiffusivity> Foam::motionDiffusivity::New ) << exit(FatalIOError); } - return autoPtr<motionDiffusivity>(cstrIter()(mesh, is)); + return autoPtr<motionDiffusivity>(ctorPtr(mesh, is)); } diff --git a/src/fvMotionSolver/motionInterpolation/motionInterpolation/motionInterpolation.C b/src/fvMotionSolver/motionInterpolation/motionInterpolation/motionInterpolation.C index c6c1fe2317a..b676cc53864 100644 --- a/src/fvMotionSolver/motionInterpolation/motionInterpolation/motionInterpolation.C +++ b/src/fvMotionSolver/motionInterpolation/motionInterpolation/motionInterpolation.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2015 OpenFOAM Foundation - Copyright (C) 2015-2019 OpenCFD Ltd. + Copyright (C) 2015-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -76,9 +76,9 @@ Foam::motionInterpolation::New(const fvMesh& mesh, Istream& is) Info<< "Selecting motion interpolation: " << modelType << endl; - auto cstrIter = IstreamConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = IstreamConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -89,7 +89,7 @@ Foam::motionInterpolation::New(const fvMesh& mesh, Istream& is) ) << exit(FatalIOError); } - return autoPtr<motionInterpolation>(cstrIter()(mesh, is)); + return autoPtr<motionInterpolation>(ctorPtr(mesh, is)); } diff --git a/src/fvOptions/sources/derived/rotorDiskSource/profileModel/profileModel.C b/src/fvOptions/sources/derived/rotorDiskSource/profileModel/profileModel.C index 41de57780e3..ce5cff75f28 100644 --- a/src/fvOptions/sources/derived/rotorDiskSource/profileModel/profileModel.C +++ b/src/fvOptions/sources/derived/rotorDiskSource/profileModel/profileModel.C @@ -75,9 +75,9 @@ Foam::autoPtr<Foam::profileModel> Foam::profileModel::New Info<< " - creating " << modelType << " profile " << modelName << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -88,7 +88,7 @@ Foam::autoPtr<Foam::profileModel> Foam::profileModel::New ) << exit(FatalIOError); } - return autoPtr<profileModel>(cstrIter()(dict, modelName)); + return autoPtr<profileModel>(ctorPtr(dict, modelName)); } diff --git a/src/fvOptions/sources/derived/rotorDiskSource/trimModel/trimModel/trimModelNew.C b/src/fvOptions/sources/derived/rotorDiskSource/trimModel/trimModel/trimModelNew.C index 063d27fd589..684f3a1e458 100644 --- a/src/fvOptions/sources/derived/rotorDiskSource/trimModel/trimModel/trimModelNew.C +++ b/src/fvOptions/sources/derived/rotorDiskSource/trimModel/trimModel/trimModelNew.C @@ -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. @@ -40,9 +40,9 @@ Foam::autoPtr<Foam::trimModel> Foam::trimModel::New Info<< " Selecting " << typeName << " " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -53,7 +53,7 @@ Foam::autoPtr<Foam::trimModel> Foam::trimModel::New ) << exit(FatalIOError); } - return autoPtr<trimModel>(cstrIter()(rotor, dict)); + return autoPtr<trimModel>(ctorPtr(rotor, dict)); } diff --git a/src/lagrangian/DSMC/submodels/BinaryCollisionModel/BinaryCollisionModel/BinaryCollisionModelNew.C b/src/lagrangian/DSMC/submodels/BinaryCollisionModel/BinaryCollisionModel/BinaryCollisionModelNew.C index c08105f35cb..568f83af9d7 100644 --- a/src/lagrangian/DSMC/submodels/BinaryCollisionModel/BinaryCollisionModel/BinaryCollisionModelNew.C +++ b/src/lagrangian/DSMC/submodels/BinaryCollisionModel/BinaryCollisionModel/BinaryCollisionModelNew.C @@ -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. @@ -42,9 +42,9 @@ Foam::BinaryCollisionModel<CloudType>::New Info<< "Selecting BinaryCollisionModel " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -57,7 +57,7 @@ Foam::BinaryCollisionModel<CloudType>::New return autoPtr<BinaryCollisionModel<CloudType>> ( - cstrIter()(dict, owner) + ctorPtr(dict, owner) ); } diff --git a/src/lagrangian/DSMC/submodels/InflowBoundaryModel/InflowBoundaryModel/InflowBoundaryModelNew.C b/src/lagrangian/DSMC/submodels/InflowBoundaryModel/InflowBoundaryModel/InflowBoundaryModelNew.C index 33d3cb9fd58..097a519312d 100644 --- a/src/lagrangian/DSMC/submodels/InflowBoundaryModel/InflowBoundaryModel/InflowBoundaryModelNew.C +++ b/src/lagrangian/DSMC/submodels/InflowBoundaryModel/InflowBoundaryModel/InflowBoundaryModelNew.C @@ -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. @@ -42,9 +42,9 @@ Foam::InflowBoundaryModel<CloudType>::New Info<< "Selecting InflowBoundaryModel " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -55,7 +55,7 @@ Foam::InflowBoundaryModel<CloudType>::New ) << exit(FatalIOError); } - return autoPtr<InflowBoundaryModel<CloudType>>(cstrIter()(dict, owner)); + return autoPtr<InflowBoundaryModel<CloudType>>(ctorPtr(dict, owner)); } diff --git a/src/lagrangian/DSMC/submodels/WallInteractionModel/WallInteractionModel/WallInteractionModelNew.C b/src/lagrangian/DSMC/submodels/WallInteractionModel/WallInteractionModel/WallInteractionModelNew.C index f6016644a85..9dfd290ced2 100644 --- a/src/lagrangian/DSMC/submodels/WallInteractionModel/WallInteractionModel/WallInteractionModelNew.C +++ b/src/lagrangian/DSMC/submodels/WallInteractionModel/WallInteractionModel/WallInteractionModelNew.C @@ -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. @@ -42,9 +42,9 @@ Foam::WallInteractionModel<CloudType>::New Info<< "Selecting WallInteractionModel " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -55,7 +55,7 @@ Foam::WallInteractionModel<CloudType>::New ) << exit(FatalIOError); } - return autoPtr<WallInteractionModel<CloudType>>(cstrIter()(dict, owner)); + return autoPtr<WallInteractionModel<CloudType>>(ctorPtr(dict, owner)); } diff --git a/src/lagrangian/distributionModels/distributionModel/distributionModelNew.C b/src/lagrangian/distributionModels/distributionModel/distributionModelNew.C index 2921a837d08..a46ef9dc2d0 100644 --- a/src/lagrangian/distributionModels/distributionModel/distributionModelNew.C +++ b/src/lagrangian/distributionModels/distributionModel/distributionModelNew.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2016-2019 OpenCFD Ltd. + Copyright (C) 2016-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -40,9 +40,9 @@ Foam::autoPtr<Foam::distributionModel> Foam::distributionModel::New Info<< "Selecting distribution model " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -56,7 +56,7 @@ Foam::autoPtr<Foam::distributionModel> Foam::distributionModel::New const dictionary distributionDict = dict.subOrEmptyDict(modelType & "Distribution"); - return autoPtr<distributionModel>(cstrIter()(distributionDict, rndGen)); + return autoPtr<distributionModel>(ctorPtr(distributionDict, rndGen)); } diff --git a/src/lagrangian/intermediate/integrationScheme/integrationScheme/integrationSchemeNew.C b/src/lagrangian/intermediate/integrationScheme/integrationScheme/integrationSchemeNew.C index 91b89d42712..3335ab69aa7 100644 --- a/src/lagrangian/intermediate/integrationScheme/integrationScheme/integrationSchemeNew.C +++ b/src/lagrangian/intermediate/integrationScheme/integrationScheme/integrationSchemeNew.C @@ -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. @@ -42,9 +42,9 @@ Foam::autoPtr<Foam::integrationScheme> Foam::integrationScheme::New Info<< "Selecting " << phiName << " integration scheme " << modelType << endl; - auto cstrIter = wordConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = wordConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -55,7 +55,7 @@ Foam::autoPtr<Foam::integrationScheme> Foam::integrationScheme::New ) << abort(FatalIOError); } - return autoPtr<integrationScheme>(cstrIter()()); + return autoPtr<integrationScheme>(ctorPtr()); } // ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObject/CloudFunctionObjectNew.C b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObject/CloudFunctionObjectNew.C index 09f061a2655..36791c76898 100644 --- a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObject/CloudFunctionObjectNew.C +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObject/CloudFunctionObjectNew.C @@ -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::CloudFunctionObject<CloudType>::New Info<< " Selecting cloud function " << modelName << " of type " << objectType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(objectType); + auto* ctorPtr = dictionaryConstructorTable(objectType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -58,7 +58,7 @@ Foam::CloudFunctionObject<CloudType>::New return autoPtr<CloudFunctionObject<CloudType>> ( - cstrIter() + ctorPtr ( dict, owner, diff --git a/src/lagrangian/intermediate/submodels/HeterogeneousReactingModel/HeterogeneousReactingModel/HeterogeneousReactingModelNew.C b/src/lagrangian/intermediate/submodels/HeterogeneousReactingModel/HeterogeneousReactingModel/HeterogeneousReactingModelNew.C index b66dfb3db7c..dfce351b3e6 100644 --- a/src/lagrangian/intermediate/submodels/HeterogeneousReactingModel/HeterogeneousReactingModel/HeterogeneousReactingModelNew.C +++ b/src/lagrangian/intermediate/submodels/HeterogeneousReactingModel/HeterogeneousReactingModel/HeterogeneousReactingModelNew.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2018-2019 OpenCFD Ltd. + Copyright (C) 2018-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -41,9 +41,9 @@ Foam::HeterogeneousReactingModel<CloudType>::New Info<< "Selecting surface reaction model " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -56,7 +56,7 @@ Foam::HeterogeneousReactingModel<CloudType>::New return autoPtr<HeterogeneousReactingModel<CloudType>> ( - cstrIter()(dict, owner) + ctorPtr(dict, owner) ); } diff --git a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/CollisionModelNew.C b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/CollisionModelNew.C index 7ad78f6b6b3..35cbb940a2c 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/CollisionModelNew.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/CollisionModelNew.C @@ -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. @@ -42,9 +42,9 @@ Foam::CollisionModel<CloudType>::New Info<< "Selecting collision model " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -55,7 +55,7 @@ Foam::CollisionModel<CloudType>::New ) << exit(FatalIOError); } - return autoPtr<CollisionModel<CloudType>>(cstrIter()(dict, owner)); + return autoPtr<CollisionModel<CloudType>>(ctorPtr(dict, owner)); } diff --git a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairModel/PairModelNew.C b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairModel/PairModelNew.C index 1c2546914cf..2d796343ad0 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairModel/PairModelNew.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairModel/PairModelNew.C @@ -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. @@ -42,9 +42,9 @@ Foam::PairModel<CloudType>::New Info<< "Selecting pair model " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -55,7 +55,7 @@ Foam::PairModel<CloudType>::New ) << exit(FatalIOError); } - return autoPtr<PairModel<CloudType>>(cstrIter()(dict, owner)); + return autoPtr<PairModel<CloudType>>(ctorPtr(dict, owner)); } diff --git a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallModel/WallModelNew.C b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallModel/WallModelNew.C index 82b484c3908..b1ebde48535 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallModel/WallModelNew.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallModel/WallModelNew.C @@ -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. @@ -42,9 +42,9 @@ Foam::WallModel<CloudType>::New Info<< "Selecting wall model " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -55,7 +55,7 @@ Foam::WallModel<CloudType>::New ) << exit(FatalIOError); } - return autoPtr<WallModel<CloudType>>(cstrIter()(dict, owner)); + return autoPtr<WallModel<CloudType>>(ctorPtr(dict, owner)); } diff --git a/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/DispersionModel/DispersionModelNew.C b/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/DispersionModel/DispersionModelNew.C index a72f6836997..e8e8ed57324 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/DispersionModel/DispersionModelNew.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/DispersionModel/DispersionModelNew.C @@ -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. @@ -42,9 +42,9 @@ Foam::DispersionModel<CloudType>::New Info<< "Selecting dispersion model " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -55,7 +55,7 @@ Foam::DispersionModel<CloudType>::New ) << exit(FatalIOError); } - return autoPtr<DispersionModel<CloudType>>(cstrIter()(dict, owner)); + return autoPtr<DispersionModel<CloudType>>(ctorPtr(dict, owner)); } diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModelNew.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModelNew.C index ac53f888c9a..2739dfa66df 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModelNew.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModelNew.C @@ -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. @@ -42,9 +42,9 @@ Foam::InjectionModel<CloudType>::New Info<< "Selecting injection model " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -55,7 +55,7 @@ Foam::InjectionModel<CloudType>::New ) << exit(FatalIOError); } - return autoPtr<InjectionModel<CloudType>>(cstrIter()(dict, owner)); + return autoPtr<InjectionModel<CloudType>>(ctorPtr(dict, owner)); } @@ -71,9 +71,9 @@ Foam::InjectionModel<CloudType>::New { Info<< "Selecting injection model " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -87,7 +87,7 @@ Foam::InjectionModel<CloudType>::New return autoPtr<InjectionModel<CloudType>> ( - cstrIter() + ctorPtr ( dict, owner, diff --git a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/ParticleForce/ParticleForceNew.C b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/ParticleForce/ParticleForceNew.C index f7f103f1ddb..9ef6fdceb8f 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/ParticleForce/ParticleForceNew.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/ParticleForce/ParticleForceNew.C @@ -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. @@ -42,9 +42,9 @@ Foam::ParticleForce<CloudType>::New { Info<< " Selecting particle force " << forceType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(forceType); + auto* ctorPtr = dictionaryConstructorTable(forceType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -57,7 +57,7 @@ Foam::ParticleForce<CloudType>::New return autoPtr<ParticleForce<CloudType>> ( - cstrIter() + ctorPtr ( owner, mesh, diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModelNew.C b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModelNew.C index d029226f404..38dfcf28783 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModelNew.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModelNew.C @@ -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. @@ -42,9 +42,9 @@ Foam::PatchInteractionModel<CloudType>::New Info<< "Selecting patch interaction model " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -55,7 +55,7 @@ Foam::PatchInteractionModel<CloudType>::New ) << abort(FatalIOError); } - return autoPtr<PatchInteractionModel<CloudType>>(cstrIter()(dict, owner)); + return autoPtr<PatchInteractionModel<CloudType>>(ctorPtr(dict, owner)); } diff --git a/src/lagrangian/intermediate/submodels/Kinematic/StochasticCollision/StochasticCollisionModel/StochasticCollisionModelNew.C b/src/lagrangian/intermediate/submodels/Kinematic/StochasticCollision/StochasticCollisionModel/StochasticCollisionModelNew.C index 65098016a73..a1bb7b2f849 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/StochasticCollision/StochasticCollisionModel/StochasticCollisionModelNew.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/StochasticCollision/StochasticCollisionModel/StochasticCollisionModelNew.C @@ -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. @@ -42,10 +42,9 @@ Foam::StochasticCollisionModel<CloudType>::New Info<< "Selecting stochastic collision model " << modelType << endl; - auto cstrIter = - dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -58,7 +57,7 @@ Foam::StochasticCollisionModel<CloudType>::New return autoPtr<StochasticCollisionModel<CloudType>> ( - cstrIter()(dict, owner) + ctorPtr(dict, owner) ); } diff --git a/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModelNew.C b/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModelNew.C index 7066c00cc3f..9c46fd5642f 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModelNew.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModelNew.C @@ -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. @@ -42,9 +42,9 @@ Foam::SurfaceFilmModel<CloudType>::New Info<< "Selecting surface film model " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -55,7 +55,7 @@ Foam::SurfaceFilmModel<CloudType>::New ) << exit(FatalIOError); } - return autoPtr<SurfaceFilmModel<CloudType>>(cstrIter()(dict, owner)); + return autoPtr<SurfaceFilmModel<CloudType>>(ctorPtr(dict, owner)); } diff --git a/src/lagrangian/intermediate/submodels/MPPIC/AveragingMethods/AveragingMethod/AveragingMethod.C b/src/lagrangian/intermediate/submodels/MPPIC/AveragingMethods/AveragingMethod/AveragingMethod.C index 0b7489306b8..00fdc15b52b 100644 --- a/src/lagrangian/intermediate/submodels/MPPIC/AveragingMethods/AveragingMethod/AveragingMethod.C +++ b/src/lagrangian/intermediate/submodels/MPPIC/AveragingMethods/AveragingMethod/AveragingMethod.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2013-2017 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -92,9 +92,9 @@ Foam::AveragingMethod<Type>::New dict.template getOrDefault<word>(typeName, "basic") ); - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -105,7 +105,7 @@ Foam::AveragingMethod<Type>::New ) << abort(FatalIOError); } - return autoPtr<AveragingMethod<Type>>(cstrIter()(io, dict, mesh)); + return autoPtr<AveragingMethod<Type>>(ctorPtr(io, dict, mesh)); } diff --git a/src/lagrangian/intermediate/submodels/MPPIC/CorrectionLimitingMethods/CorrectionLimitingMethod/CorrectionLimitingMethod.C b/src/lagrangian/intermediate/submodels/MPPIC/CorrectionLimitingMethods/CorrectionLimitingMethod/CorrectionLimitingMethod.C index c3ffdf9669b..b5564f06b90 100644 --- a/src/lagrangian/intermediate/submodels/MPPIC/CorrectionLimitingMethods/CorrectionLimitingMethod/CorrectionLimitingMethod.C +++ b/src/lagrangian/intermediate/submodels/MPPIC/CorrectionLimitingMethods/CorrectionLimitingMethod/CorrectionLimitingMethod.C @@ -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. @@ -63,9 +63,9 @@ Foam::CorrectionLimitingMethod::New Info<< "Selecting correction limiter " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -76,7 +76,7 @@ Foam::CorrectionLimitingMethod::New ) << abort(FatalIOError); } - return autoPtr<CorrectionLimitingMethod>(cstrIter()(dict)); + return autoPtr<CorrectionLimitingMethod>(ctorPtr(dict)); } diff --git a/src/lagrangian/intermediate/submodels/MPPIC/DampingModels/DampingModel/DampingModel.C b/src/lagrangian/intermediate/submodels/MPPIC/DampingModels/DampingModel/DampingModel.C index 8c09c223251..8567e2d6945 100644 --- a/src/lagrangian/intermediate/submodels/MPPIC/DampingModels/DampingModel/DampingModel.C +++ b/src/lagrangian/intermediate/submodels/MPPIC/DampingModels/DampingModel/DampingModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2013-2016 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -90,9 +90,9 @@ Foam::DampingModel<CloudType>::New Info<< "Selecting damping model " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -103,7 +103,7 @@ Foam::DampingModel<CloudType>::New ) << abort(FatalIOError); } - return autoPtr<DampingModel<CloudType>>(cstrIter()(dict, owner)); + return autoPtr<DampingModel<CloudType>>(ctorPtr(dict, owner)); } diff --git a/src/lagrangian/intermediate/submodels/MPPIC/IsotropyModels/IsotropyModel/IsotropyModel.C b/src/lagrangian/intermediate/submodels/MPPIC/IsotropyModels/IsotropyModel/IsotropyModel.C index 1178e63947e..84451e53fa9 100644 --- a/src/lagrangian/intermediate/submodels/MPPIC/IsotropyModels/IsotropyModel/IsotropyModel.C +++ b/src/lagrangian/intermediate/submodels/MPPIC/IsotropyModels/IsotropyModel/IsotropyModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2013-2016 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -93,9 +93,9 @@ Foam::IsotropyModel<CloudType>::New Info<< "Selecting isotropy model " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -106,7 +106,7 @@ Foam::IsotropyModel<CloudType>::New ) << abort(FatalIOError); } - return autoPtr<IsotropyModel<CloudType>>(cstrIter()(dict, owner)); + return autoPtr<IsotropyModel<CloudType>>(ctorPtr(dict, owner)); } diff --git a/src/lagrangian/intermediate/submodels/MPPIC/PackingModels/PackingModel/PackingModel.C b/src/lagrangian/intermediate/submodels/MPPIC/PackingModels/PackingModel/PackingModel.C index d6df6f22f73..efc25cfd122 100644 --- a/src/lagrangian/intermediate/submodels/MPPIC/PackingModels/PackingModel/PackingModel.C +++ b/src/lagrangian/intermediate/submodels/MPPIC/PackingModels/PackingModel/PackingModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2013-2016 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -91,9 +91,9 @@ Foam::PackingModel<CloudType>::New ); Info<< "Selecting packing model " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -104,7 +104,7 @@ Foam::PackingModel<CloudType>::New ) << abort(FatalIOError); } - return autoPtr<PackingModel<CloudType>>(cstrIter()(dict, owner)); + return autoPtr<PackingModel<CloudType>>(ctorPtr(dict, owner)); } diff --git a/src/lagrangian/intermediate/submodels/MPPIC/ParticleStressModels/ParticleStressModel/ParticleStressModel.C b/src/lagrangian/intermediate/submodels/MPPIC/ParticleStressModels/ParticleStressModel/ParticleStressModel.C index d21080a89bb..77db614098d 100644 --- a/src/lagrangian/intermediate/submodels/MPPIC/ParticleStressModels/ParticleStressModel/ParticleStressModel.C +++ b/src/lagrangian/intermediate/submodels/MPPIC/ParticleStressModels/ParticleStressModel/ParticleStressModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2013-2016 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -68,9 +68,9 @@ Foam::autoPtr<Foam::ParticleStressModel> Foam::ParticleStressModel::New Info<< "Selecting particle stress model " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -81,7 +81,7 @@ Foam::autoPtr<Foam::ParticleStressModel> Foam::ParticleStressModel::New ) << abort(FatalIOError); } - return autoPtr<ParticleStressModel>(cstrIter()(dict)); + return autoPtr<ParticleStressModel>(ctorPtr(dict)); } diff --git a/src/lagrangian/intermediate/submodels/MPPIC/TimeScaleModels/TimeScaleModel/TimeScaleModel.C b/src/lagrangian/intermediate/submodels/MPPIC/TimeScaleModels/TimeScaleModel/TimeScaleModel.C index 55ebdd231ea..4867d2c0d7e 100644 --- a/src/lagrangian/intermediate/submodels/MPPIC/TimeScaleModels/TimeScaleModel/TimeScaleModel.C +++ b/src/lagrangian/intermediate/submodels/MPPIC/TimeScaleModels/TimeScaleModel/TimeScaleModel.C @@ -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. @@ -72,9 +72,9 @@ Foam::autoPtr<Foam::TimeScaleModel> Foam::TimeScaleModel::New Info<< "Selecting time scale model " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -85,7 +85,7 @@ Foam::autoPtr<Foam::TimeScaleModel> Foam::TimeScaleModel::New ) << abort(FatalIOError); } - return autoPtr<TimeScaleModel>(cstrIter()(dict)); + return autoPtr<TimeScaleModel>(ctorPtr(dict)); } diff --git a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModelNew.C b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModelNew.C index 7ec29013a83..fc654907551 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModelNew.C +++ b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModelNew.C @@ -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. @@ -42,9 +42,9 @@ Foam::CompositionModel<CloudType>::New Info<< "Selecting composition model " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -55,7 +55,7 @@ Foam::CompositionModel<CloudType>::New ) << exit(FatalIOError); } - return autoPtr<CompositionModel<CloudType>>(cstrIter()(dict, owner)); + return autoPtr<CompositionModel<CloudType>>(ctorPtr(dict, owner)); } diff --git a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModelNew.C b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModelNew.C index 114edd90dfd..1a23ebd98a8 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModelNew.C +++ b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModelNew.C @@ -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. @@ -42,9 +42,9 @@ Foam::PhaseChangeModel<CloudType>::New Info<< "Selecting phase change model " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -55,7 +55,7 @@ Foam::PhaseChangeModel<CloudType>::New ) << exit(FatalIOError); } - return autoPtr<PhaseChangeModel<CloudType>>(cstrIter()(dict, owner)); + return autoPtr<PhaseChangeModel<CloudType>>(ctorPtr(dict, owner)); } diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModelNew.C b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModelNew.C index 8cbfdcd450e..cb12e471734 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModelNew.C +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModelNew.C @@ -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. @@ -42,9 +42,9 @@ Foam::DevolatilisationModel<CloudType>::New Info<< "Selecting devolatilisation model " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -55,7 +55,7 @@ Foam::DevolatilisationModel<CloudType>::New ) << exit(FatalIOError); } - return autoPtr<DevolatilisationModel<CloudType>>(cstrIter()(dict, owner)); + return autoPtr<DevolatilisationModel<CloudType>>(ctorPtr(dict, owner)); } diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/SurfaceReactionModel/SurfaceReactionModel/SurfaceReactionModelNew.C b/src/lagrangian/intermediate/submodels/ReactingMultiphase/SurfaceReactionModel/SurfaceReactionModel/SurfaceReactionModelNew.C index 8a11546944e..8b953360650 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/SurfaceReactionModel/SurfaceReactionModel/SurfaceReactionModelNew.C +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/SurfaceReactionModel/SurfaceReactionModel/SurfaceReactionModelNew.C @@ -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. @@ -42,9 +42,9 @@ Foam::SurfaceReactionModel<CloudType>::New Info<< "Selecting surface reaction model " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -55,7 +55,7 @@ Foam::SurfaceReactionModel<CloudType>::New ) << exit(FatalIOError); } - return autoPtr<SurfaceReactionModel<CloudType>>(cstrIter()(dict, owner)); + return autoPtr<SurfaceReactionModel<CloudType>>(ctorPtr(dict, owner)); } diff --git a/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModelNew.C b/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModelNew.C index 0d70b8363f0..6a13db0d4c4 100644 --- a/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModelNew.C +++ b/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModelNew.C @@ -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. @@ -42,9 +42,9 @@ Foam::HeatTransferModel<CloudType>::New Info<< "Selecting heat transfer model " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -55,7 +55,7 @@ Foam::HeatTransferModel<CloudType>::New ) << exit(FatalIOError); } - return autoPtr<HeatTransferModel<CloudType>>(cstrIter()(dict, owner)); + return autoPtr<HeatTransferModel<CloudType>>(ctorPtr(dict, owner)); } diff --git a/src/lagrangian/molecularDynamics/potential/energyScalingFunction/basic/energyScalingFunctionNew.C b/src/lagrangian/molecularDynamics/potential/energyScalingFunction/basic/energyScalingFunctionNew.C index bce038241cd..236d5f2353a 100644 --- a/src/lagrangian/molecularDynamics/potential/energyScalingFunction/basic/energyScalingFunctionNew.C +++ b/src/lagrangian/molecularDynamics/potential/energyScalingFunction/basic/energyScalingFunctionNew.C @@ -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. @@ -44,9 +44,9 @@ Foam::autoPtr<Foam::energyScalingFunction> Foam::energyScalingFunction::New << modelType << " for " << name << " potential energy." << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -57,7 +57,7 @@ Foam::autoPtr<Foam::energyScalingFunction> Foam::energyScalingFunction::New ) << exit(FatalIOError); } - return autoPtr<energyScalingFunction>(cstrIter()(name, dict, pairPot)); + return autoPtr<energyScalingFunction>(ctorPtr(name, dict, pairPot)); } diff --git a/src/lagrangian/molecularDynamics/potential/pairPotential/basic/pairPotentialNew.C b/src/lagrangian/molecularDynamics/potential/pairPotential/basic/pairPotentialNew.C index 451c3a9cf51..8aef62459ba 100644 --- a/src/lagrangian/molecularDynamics/potential/pairPotential/basic/pairPotentialNew.C +++ b/src/lagrangian/molecularDynamics/potential/pairPotential/basic/pairPotentialNew.C @@ -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::pairPotential> Foam::pairPotential::New << modelType << " for " << name << " interaction." << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -56,7 +56,7 @@ Foam::autoPtr<Foam::pairPotential> Foam::pairPotential::New ) << exit(FatalIOError); } - return autoPtr<pairPotential>(cstrIter()(name, dict)); + return autoPtr<pairPotential>(ctorPtr(name, dict)); } diff --git a/src/lagrangian/molecularDynamics/potential/tetherPotential/basic/tetherPotentialNew.C b/src/lagrangian/molecularDynamics/potential/tetherPotential/basic/tetherPotentialNew.C index aeb1471fdf1..a3815afc353 100644 --- a/src/lagrangian/molecularDynamics/potential/tetherPotential/basic/tetherPotentialNew.C +++ b/src/lagrangian/molecularDynamics/potential/tetherPotential/basic/tetherPotentialNew.C @@ -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::autoPtr<Foam::tetherPotential> Foam::tetherPotential::New Info<< nl << "Selecting tether potential " << modelType << " for " << name << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -54,7 +54,7 @@ Foam::autoPtr<Foam::tetherPotential> Foam::tetherPotential::New ) << exit(FatalIOError); } - return autoPtr<tetherPotential>(cstrIter()(name, dict)); + return autoPtr<tetherPotential>(ctorPtr(name, dict)); } diff --git a/src/lagrangian/spray/submodels/AtomizationModel/AtomizationModel/AtomizationModelNew.C b/src/lagrangian/spray/submodels/AtomizationModel/AtomizationModel/AtomizationModelNew.C index a761991833b..83cbf0503dd 100644 --- a/src/lagrangian/spray/submodels/AtomizationModel/AtomizationModel/AtomizationModelNew.C +++ b/src/lagrangian/spray/submodels/AtomizationModel/AtomizationModel/AtomizationModelNew.C @@ -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. @@ -42,9 +42,9 @@ Foam::AtomizationModel<CloudType>::New Info<< "Selecting atomizationModel " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -55,7 +55,7 @@ Foam::AtomizationModel<CloudType>::New ) << exit(FatalIOError); } - return autoPtr<AtomizationModel<CloudType>>(cstrIter()(dict, owner)); + return autoPtr<AtomizationModel<CloudType>>(ctorPtr(dict, owner)); } diff --git a/src/lagrangian/spray/submodels/BreakupModel/BreakupModel/BreakupModelNew.C b/src/lagrangian/spray/submodels/BreakupModel/BreakupModel/BreakupModelNew.C index 81955b2fbba..3e9a436ed66 100644 --- a/src/lagrangian/spray/submodels/BreakupModel/BreakupModel/BreakupModelNew.C +++ b/src/lagrangian/spray/submodels/BreakupModel/BreakupModel/BreakupModelNew.C @@ -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. @@ -42,9 +42,9 @@ Foam::BreakupModel<CloudType>::New Info<< "Selecting breakupModel " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -55,7 +55,7 @@ Foam::BreakupModel<CloudType>::New ) << exit(FatalIOError); } - return autoPtr<BreakupModel<CloudType>>(cstrIter()(dict, owner)); + return autoPtr<BreakupModel<CloudType>>(ctorPtr(dict, owner)); } diff --git a/src/mesh/blockMesh/blockEdges/blockEdge/blockEdge.C b/src/mesh/blockMesh/blockEdges/blockEdge/blockEdge.C index ece247bf14a..871b064cbfb 100644 --- a/src/mesh/blockMesh/blockEdges/blockEdge/blockEdge.C +++ b/src/mesh/blockMesh/blockEdges/blockEdge/blockEdge.C @@ -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. @@ -88,9 +88,9 @@ Foam::autoPtr<Foam::blockEdge> Foam::blockEdge::New const word edgeType(is); - auto cstrIter = IstreamConstructorTablePtr_->cfind(edgeType); + auto* ctorPtr = IstreamConstructorTable(edgeType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -101,7 +101,7 @@ Foam::autoPtr<Foam::blockEdge> Foam::blockEdge::New ) << abort(FatalIOError); } - return autoPtr<blockEdge>(cstrIter()(dict, index, geometry, points, is)); + return autoPtr<blockEdge>(ctorPtr(dict, index, geometry, points, is)); } diff --git a/src/mesh/blockMesh/blockFaces/blockFace/blockFace.C b/src/mesh/blockMesh/blockFaces/blockFace/blockFace.C index 3f1299be04b..a9ccc51e748 100644 --- a/src/mesh/blockMesh/blockFaces/blockFace/blockFace.C +++ b/src/mesh/blockMesh/blockFaces/blockFace/blockFace.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2016 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::blockFace> Foam::blockFace::New const word faceType(is); - auto cstrIter = IstreamConstructorTablePtr_->cfind(faceType); + auto* ctorPtr = IstreamConstructorTable(faceType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -97,7 +97,7 @@ Foam::autoPtr<Foam::blockFace> Foam::blockFace::New ) << abort(FatalIOError); } - return autoPtr<blockFace>(cstrIter()(dict, index, geometry, is)); + return autoPtr<blockFace>(ctorPtr(dict, index, geometry, is)); } diff --git a/src/mesh/blockMesh/blockVertices/blockVertex/blockVertex.C b/src/mesh/blockMesh/blockVertices/blockVertex/blockVertex.C index 7f1e99575ab..48b92e22779 100644 --- a/src/mesh/blockMesh/blockVertices/blockVertex/blockVertex.C +++ b/src/mesh/blockMesh/blockVertices/blockVertex/blockVertex.C @@ -74,9 +74,9 @@ Foam::autoPtr<Foam::blockVertex> Foam::blockVertex::New { const word faceType(firstToken.wordToken()); - auto cstrIter = IstreamConstructorTablePtr_->cfind(faceType); + auto* ctorPtr = IstreamConstructorTable(faceType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -87,7 +87,7 @@ Foam::autoPtr<Foam::blockVertex> Foam::blockVertex::New ) << abort(FatalIOError); } - return autoPtr<blockVertex>(cstrIter()(dict, index, geometry, is)); + return autoPtr<blockVertex>(ctorPtr(dict, index, geometry, is)); } FatalIOErrorInFunction(is) diff --git a/src/mesh/blockMesh/blocks/block/block.C b/src/mesh/blockMesh/blocks/block/block.C index 16888dabd2d..da87335619a 100644 --- a/src/mesh/blockMesh/blocks/block/block.C +++ b/src/mesh/blockMesh/blocks/block/block.C @@ -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. @@ -110,15 +110,15 @@ Foam::autoPtr<Foam::block> Foam::block::New const word blockOrCellShapeType(is); - auto cstrIter = IstreamConstructorTablePtr_->cfind(blockOrCellShapeType); + auto* ctorPtr = IstreamConstructorTable(blockOrCellShapeType); - if (!cstrIter.found()) + if (!ctorPtr) { is.putBack(token(blockOrCellShapeType)); return autoPtr<block>::New(dict, index, points, edges, faces, is); } - return autoPtr<block>(cstrIter()(dict, index, points, edges, faces, is)); + return autoPtr<block>(ctorPtr(dict, index, points, edges, faces, is)); } diff --git a/src/mesh/extrudeModel/extrudeModel/extrudeModelNew.C b/src/mesh/extrudeModel/extrudeModel/extrudeModelNew.C index db1d737baa5..71b772883d1 100644 --- a/src/mesh/extrudeModel/extrudeModel/extrudeModelNew.C +++ b/src/mesh/extrudeModel/extrudeModel/extrudeModelNew.C @@ -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. @@ -39,9 +39,9 @@ Foam::autoPtr<Foam::extrudeModel> Foam::extrudeModel::New Info<< "Selecting extrudeModel " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -52,7 +52,7 @@ Foam::autoPtr<Foam::extrudeModel> Foam::extrudeModel::New ) << exit(FatalIOError); } - return autoPtr<extrudeModel>(cstrIter()(dict)); + return autoPtr<extrudeModel>(ctorPtr(dict)); } diff --git a/src/mesh/snappyHexMesh/externalDisplacementMeshMover/externalDisplacementMeshMover.C b/src/mesh/snappyHexMesh/externalDisplacementMeshMover/externalDisplacementMeshMover.C index f58795c2aa9..d11bc4d486b 100644 --- a/src/mesh/snappyHexMesh/externalDisplacementMeshMover/externalDisplacementMeshMover.C +++ b/src/mesh/snappyHexMesh/externalDisplacementMeshMover/externalDisplacementMeshMover.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2013-2015 OpenFOAM Foundation - Copyright (C) 2015-2019 OpenCFD Ltd. + Copyright (C) 2015-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -144,9 +144,9 @@ Foam::externalDisplacementMeshMover::New { Info<< "Selecting externalDisplacementMeshMover " << type << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(type); + auto* ctorPtr = dictionaryConstructorTable(type); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -159,7 +159,7 @@ Foam::externalDisplacementMeshMover::New return autoPtr<externalDisplacementMeshMover> ( - cstrIter()(dict, baffles, pointDisplacement, dryRun) + ctorPtr(dict, baffles, pointDisplacement, dryRun) ); } diff --git a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolationNew.C b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolationNew.C index 6bc4ba2c2e6..6a7320ebd54 100644 --- a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolationNew.C +++ b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolationNew.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2020 OpenCFD Ltd. + Copyright (C) 2020-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -38,9 +38,9 @@ Foam::autoPtr<Foam::AMIInterpolation> Foam::AMIInterpolation::New { DebugInfo << "Selecting model " << modelName << endl; - auto cstrIter = dictConstructorTablePtr_->cfind(modelName); + auto* ctorPtr = dictConstructorTable(modelName); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInLookup ( @@ -50,7 +50,7 @@ Foam::autoPtr<Foam::AMIInterpolation> Foam::AMIInterpolation::New ) << exit(FatalError); } - return autoPtr<AMIInterpolation>(cstrIter()(dict, reverseTarget)); + return autoPtr<AMIInterpolation>(ctorPtr(dict, reverseTarget)); } @@ -64,9 +64,9 @@ Foam::autoPtr<Foam::AMIInterpolation> Foam::AMIInterpolation::New { DebugInfo << "Selecting model " << modelName << endl; - auto cstrIter = componentConstructorTablePtr_->cfind(modelName); + auto* ctorPtr = componentConstructorTable(modelName); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInLookup ( @@ -78,7 +78,7 @@ Foam::autoPtr<Foam::AMIInterpolation> Foam::AMIInterpolation::New return autoPtr<AMIInterpolation> ( - cstrIter() + ctorPtr ( requireMatch, reverseTarget, diff --git a/src/meshTools/AMIInterpolation/AMIInterpolation/faceAreaWeightAMI/faceAreaWeightAMI.C b/src/meshTools/AMIInterpolation/AMIInterpolation/faceAreaWeightAMI/faceAreaWeightAMI.C index 6163d56812f..53063cce633 100644 --- a/src/meshTools/AMIInterpolation/AMIInterpolation/faceAreaWeightAMI/faceAreaWeightAMI.C +++ b/src/meshTools/AMIInterpolation/AMIInterpolation/faceAreaWeightAMI/faceAreaWeightAMI.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2013-2016 OpenFOAM Foundation - Copyright (C) 2018-2020 OpenCFD Ltd. + Copyright (C) 2018-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -41,16 +41,18 @@ namespace Foam // Backwards compatibility for pre v2106 versions // - partialFaceAreaWeightAMI deprecated in v2106 - addNamedToRunTimeSelectionTable + addAliasToRunTimeSelectionTable ( AMIInterpolation, faceAreaWeightAMI, dict, - partialFaceAreaWeightAMI + faceAreaWeightAMI, + partialFaceAreaWeightAMI, + 2012 ); - } + // * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // /* diff --git a/src/meshTools/PatchFunction1/PatchFunction1/PatchFunction1New.C b/src/meshTools/PatchFunction1/PatchFunction1/PatchFunction1New.C index 62ceceb3897..93372133130 100644 --- a/src/meshTools/PatchFunction1/PatchFunction1/PatchFunction1New.C +++ b/src/meshTools/PatchFunction1/PatchFunction1/PatchFunction1New.C @@ -145,9 +145,9 @@ Foam::PatchFunction1<Type>::New } - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInFunction(dict) << "Unknown PatchFunction1 type " @@ -157,7 +157,7 @@ Foam::PatchFunction1<Type>::New << exit(FatalIOError); } - return cstrIter()(pp, modelType, entryName, *coeffs, faceValues); + return ctorPtr(pp, modelType, entryName, *coeffs, faceValues); } diff --git a/src/meshTools/PatchFunction1/makePatchFunction1s.C b/src/meshTools/PatchFunction1/makePatchFunction1s.C index 88aa2946d91..d2c3e324de2 100644 --- a/src/meshTools/PatchFunction1/makePatchFunction1s.C +++ b/src/meshTools/PatchFunction1/makePatchFunction1s.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2018-2020 OpenCFD Ltd. + Copyright (C) 2018-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -141,7 +141,7 @@ namespace Foam // *PatchFunction1<Type>::dictionaryConstructorTablePtr_; // // // Get the UniformValueField constructor - // auto cstrIter = PF1Table.cfind + // auto ctorIter = PF1Table.cfind // ( // PatchFunction1Types::UniformValueField<Type>::typeName // ); @@ -149,7 +149,7 @@ namespace Foam // // Add the UniformValueField under the Function1 name // forAllConstIters(F1Table, iter) // { - // PF1Table.insert(iter.key(), cstrIter()); + // PF1Table.insert(iter.key(), ctorIter.val()); // } // } //}; diff --git a/src/meshTools/coordinate/rotation/coordinateRotation.C b/src/meshTools/coordinate/rotation/coordinateRotation.C index 0ea09c00b26..4e57f88a817 100644 --- a/src/meshTools/coordinate/rotation/coordinateRotation.C +++ b/src/meshTools/coordinate/rotation/coordinateRotation.C @@ -74,9 +74,9 @@ Foam::autoPtr<Foam::coordinateRotation> Foam::coordinateRotation::New { const word modelType(dict.get<word>("type")); - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -87,7 +87,7 @@ Foam::autoPtr<Foam::coordinateRotation> Foam::coordinateRotation::New ) << exit(FatalIOError); } - return autoPtr<coordinateRotation>(cstrIter()(dict)); + return autoPtr<coordinateRotation>(ctorPtr(dict)); } diff --git a/src/meshTools/coordinate/systems/coordinateSystemNew.C b/src/meshTools/coordinate/systems/coordinateSystemNew.C index 834f1b4183c..2bb73a732be 100644 --- a/src/meshTools/coordinate/systems/coordinateSystemNew.C +++ b/src/meshTools/coordinate/systems/coordinateSystemNew.C @@ -92,18 +92,19 @@ Foam::autoPtr<Foam::coordinateSystem> Foam::coordinateSystem::New modelType = coordSystem::cartesian::typeName_(); } - auto cstrIter1 = registryConstructorTablePtr_->cfind(modelType); - - if (cstrIter1.found()) { - return autoPtr<coordinateSystem>(cstrIter1()(obr, dict)); + auto* ctorPtr = registryConstructorTable(modelType); + if (ctorPtr) + { + return autoPtr<coordinateSystem>(ctorPtr(obr, dict)); + } } - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); // Everything with a registry constructor also has a dictionary // constructor, so just need to print those. - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -114,7 +115,7 @@ Foam::autoPtr<Foam::coordinateSystem> Foam::coordinateSystem::New ) << exit(FatalIOError); } - return autoPtr<coordinateSystem>(cstrIter()(dict)); + return autoPtr<coordinateSystem>(ctorPtr(dict)); } @@ -129,9 +130,9 @@ Foam::autoPtr<Foam::coordinateSystem> Foam::coordinateSystem::New modelType = coordSystem::cartesian::typeName_(); } - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -142,7 +143,7 @@ Foam::autoPtr<Foam::coordinateSystem> Foam::coordinateSystem::New ) << exit(FatalIOError); } - return autoPtr<coordinateSystem>(cstrIter()(dict)); + return autoPtr<coordinateSystem>(ctorPtr(dict)); } diff --git a/src/meshTools/edgeMesh/edgeMesh.C b/src/meshTools/edgeMesh/edgeMesh.C index 724e3cb431b..70b657359f3 100644 --- a/src/meshTools/edgeMesh/edgeMesh.C +++ b/src/meshTools/edgeMesh/edgeMesh.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2015-2020 OpenCFD Ltd. + Copyright (C) 2015-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/src/meshTools/edgeMesh/edgeMeshIO.C b/src/meshTools/edgeMesh/edgeMeshIO.C index fe0a08b819b..120daf79b72 100644 --- a/src/meshTools/edgeMesh/edgeMeshIO.C +++ b/src/meshTools/edgeMesh/edgeMeshIO.C @@ -94,9 +94,9 @@ void Foam::edgeMesh::write { DebugInFunction << "Writing to " << name << endl; - auto mfIter = writefileExtensionMemberFunctionTablePtr_->cfind(fileType); + auto* mfuncPtr = writefileExtensionMemberFunctionTable(fileType); - if (!mfIter.found()) + if (!mfuncPtr) { FatalErrorInLookup ( @@ -106,7 +106,7 @@ void Foam::edgeMesh::write ) << exit(FatalError); } - mfIter()(name, mesh, streamOpt, options); + mfuncPtr(name, mesh, streamOpt, options); } diff --git a/src/meshTools/edgeMesh/edgeMeshNew.C b/src/meshTools/edgeMesh/edgeMeshNew.C index bd791e52e3d..9ac28ffbff8 100644 --- a/src/meshTools/edgeMesh/edgeMeshNew.C +++ b/src/meshTools/edgeMesh/edgeMeshNew.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2020 OpenCFD Ltd. + Copyright (C) 2020-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -36,9 +36,9 @@ Foam::autoPtr<Foam::edgeMesh> Foam::edgeMesh::New const word& fileType ) { - auto cstrIter = fileExtensionConstructorTablePtr_->cfind(fileType); + auto* ctorPtr = fileExtensionConstructorTable(fileType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInFunction << "Unknown edge format " << fileType @@ -48,7 +48,7 @@ Foam::autoPtr<Foam::edgeMesh> Foam::edgeMesh::New << exit(FatalError); } - return autoPtr<edgeMesh>(cstrIter()(name)); + return autoPtr<edgeMesh>(ctorPtr(name)); } diff --git a/src/meshTools/edgeMesh/extendedEdgeMesh/extendedEdgeMesh.C b/src/meshTools/edgeMesh/extendedEdgeMesh/extendedEdgeMesh.C index 8fe226fe54c..6091da9d64c 100644 --- a/src/meshTools/edgeMesh/extendedEdgeMesh/extendedEdgeMesh.C +++ b/src/meshTools/edgeMesh/extendedEdgeMesh/extendedEdgeMesh.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2015-2020 OpenCFD Ltd. + Copyright (C) 2015-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/src/meshTools/edgeMesh/extendedEdgeMesh/extendedEdgeMeshNew.C b/src/meshTools/edgeMesh/extendedEdgeMesh/extendedEdgeMeshNew.C index 6888b0dff0c..713a379766d 100644 --- a/src/meshTools/edgeMesh/extendedEdgeMesh/extendedEdgeMeshNew.C +++ b/src/meshTools/edgeMesh/extendedEdgeMesh/extendedEdgeMeshNew.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2013-2017 OpenFOAM Foundation - Copyright (C) 2020 OpenCFD Ltd. + Copyright (C) 2020-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -44,9 +44,9 @@ Foam::autoPtr<Foam::extendedEdgeMesh> Foam::extendedEdgeMesh::New const word& fileType ) { - auto cstrIter = fileExtensionConstructorTablePtr_->cfind(fileType); + auto* ctorPtr = fileExtensionConstructorTable(fileType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInFunction << "Unknown edge format " << fileType @@ -56,7 +56,7 @@ Foam::autoPtr<Foam::extendedEdgeMesh> Foam::extendedEdgeMesh::New << exit(FatalError); } - return autoPtr<extendedEdgeMesh>(cstrIter()(name)); + return autoPtr<extendedEdgeMesh>(ctorPtr(name)); } diff --git a/src/meshTools/searchableSurfaces/searchableSurface/searchableSurface.C b/src/meshTools/searchableSurfaces/searchableSurface/searchableSurface.C index f6de6eb3afc..41e47a9b95d 100644 --- a/src/meshTools/searchableSurfaces/searchableSurface/searchableSurface.C +++ b/src/meshTools/searchableSurfaces/searchableSurface/searchableSurface.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2015 OpenFOAM Foundation - Copyright (C) 2018-2019 OpenCFD Ltd. + Copyright (C) 2018-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -46,9 +46,9 @@ Foam::autoPtr<Foam::searchableSurface> Foam::searchableSurface::New const dictionary& dict ) { - auto cstrIter = dictConstructorTablePtr_->cfind(searchableSurfaceType); + auto* ctorPtr = dictConstructorTable(searchableSurfaceType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -59,7 +59,7 @@ Foam::autoPtr<Foam::searchableSurface> Foam::searchableSurface::New ) << exit(FatalIOError); } - return autoPtr<searchableSurface>(cstrIter()(io, dict)); + return autoPtr<searchableSurface>(ctorPtr(io, dict)); } diff --git a/src/meshTools/sets/cellSources/topoSetCellSource/topoSetCellSource.C b/src/meshTools/sets/cellSources/topoSetCellSource/topoSetCellSource.C index 0206eb6c90b..a94871d7e47 100644 --- a/src/meshTools/sets/cellSources/topoSetCellSource/topoSetCellSource.C +++ b/src/meshTools/sets/cellSources/topoSetCellSource/topoSetCellSource.C @@ -65,9 +65,9 @@ Foam::topoSetCellSource::New const dictionary& dict ) { - auto cstrIter = wordConstructorTablePtr_->cfind(sourceType); + auto* ctorPtr = wordConstructorTable(sourceType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -78,7 +78,7 @@ Foam::topoSetCellSource::New ) << exit(FatalIOError); } - return autoPtr<topoSetCellSource>(cstrIter()(mesh, dict)); + return autoPtr<topoSetCellSource>(ctorPtr(mesh, dict)); } @@ -90,9 +90,9 @@ Foam::topoSetCellSource::New Istream& is ) { - auto cstrIter = istreamConstructorTablePtr_->cfind(sourceType); + auto* ctorPtr = istreamConstructorTable(sourceType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInLookup ( @@ -102,7 +102,7 @@ Foam::topoSetCellSource::New ) << exit(FatalError); } - return autoPtr<topoSetCellSource>(cstrIter()(mesh, is)); + return autoPtr<topoSetCellSource>(ctorPtr(mesh, is)); } diff --git a/src/meshTools/sets/cellZoneSources/topoSetCellZoneSource/topoSetCellZoneSource.C b/src/meshTools/sets/cellZoneSources/topoSetCellZoneSource/topoSetCellZoneSource.C index f757459efc5..e77ccee1b9f 100644 --- a/src/meshTools/sets/cellZoneSources/topoSetCellZoneSource/topoSetCellZoneSource.C +++ b/src/meshTools/sets/cellZoneSources/topoSetCellZoneSource/topoSetCellZoneSource.C @@ -65,9 +65,9 @@ Foam::topoSetCellZoneSource::New const dictionary& dict ) { - auto cstrIter = wordConstructorTablePtr_->cfind(sourceType); + auto* ctorPtr = wordConstructorTable(sourceType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -78,7 +78,7 @@ Foam::topoSetCellZoneSource::New ) << exit(FatalIOError); } - return autoPtr<topoSetCellZoneSource>(cstrIter()(mesh, dict)); + return autoPtr<topoSetCellZoneSource>(ctorPtr(mesh, dict)); } @@ -90,9 +90,9 @@ Foam::topoSetCellZoneSource::New Istream& is ) { - auto cstrIter = istreamConstructorTablePtr_->cfind(sourceType); + auto* ctorPtr = istreamConstructorTable(sourceType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInLookup ( @@ -102,7 +102,7 @@ Foam::topoSetCellZoneSource::New ) << exit(FatalError); } - return autoPtr<topoSetCellZoneSource>(cstrIter()(mesh, is)); + return autoPtr<topoSetCellZoneSource>(ctorPtr(mesh, is)); } diff --git a/src/meshTools/sets/faceSources/topoSetFaceSource/topoSetFaceSource.C b/src/meshTools/sets/faceSources/topoSetFaceSource/topoSetFaceSource.C index 206a7aa9e37..74374e50661 100644 --- a/src/meshTools/sets/faceSources/topoSetFaceSource/topoSetFaceSource.C +++ b/src/meshTools/sets/faceSources/topoSetFaceSource/topoSetFaceSource.C @@ -65,9 +65,9 @@ Foam::topoSetFaceSource::New const dictionary& dict ) { - auto cstrIter = wordConstructorTablePtr_->cfind(sourceType); + auto* ctorPtr = wordConstructorTable(sourceType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -78,7 +78,7 @@ Foam::topoSetFaceSource::New ) << exit(FatalIOError); } - return autoPtr<topoSetFaceSource>(cstrIter()(mesh, dict)); + return autoPtr<topoSetFaceSource>(ctorPtr(mesh, dict)); } @@ -90,9 +90,9 @@ Foam::topoSetFaceSource::New Istream& is ) { - auto cstrIter = istreamConstructorTablePtr_->cfind(sourceType); + auto* ctorPtr = istreamConstructorTable(sourceType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInLookup ( @@ -102,7 +102,7 @@ Foam::topoSetFaceSource::New ) << exit(FatalError); } - return autoPtr<topoSetFaceSource>(cstrIter()(mesh, is)); + return autoPtr<topoSetFaceSource>(ctorPtr(mesh, is)); } diff --git a/src/meshTools/sets/faceZoneSources/topoSetFaceZoneSource/topoSetFaceZoneSource.C b/src/meshTools/sets/faceZoneSources/topoSetFaceZoneSource/topoSetFaceZoneSource.C index d4a31973236..96d640ce010 100644 --- a/src/meshTools/sets/faceZoneSources/topoSetFaceZoneSource/topoSetFaceZoneSource.C +++ b/src/meshTools/sets/faceZoneSources/topoSetFaceZoneSource/topoSetFaceZoneSource.C @@ -65,9 +65,9 @@ Foam::topoSetFaceZoneSource::New const dictionary& dict ) { - auto cstrIter = wordConstructorTablePtr_->cfind(sourceType); + auto* ctorPtr = wordConstructorTable(sourceType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -78,7 +78,7 @@ Foam::topoSetFaceZoneSource::New ) << exit(FatalIOError); } - return autoPtr<topoSetFaceZoneSource>(cstrIter()(mesh, dict)); + return autoPtr<topoSetFaceZoneSource>(ctorPtr(mesh, dict)); } @@ -90,9 +90,9 @@ Foam::topoSetFaceZoneSource::New Istream& is ) { - auto cstrIter = istreamConstructorTablePtr_->cfind(sourceType); + auto* ctorPtr = istreamConstructorTable(sourceType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInLookup ( @@ -102,7 +102,7 @@ Foam::topoSetFaceZoneSource::New ) << exit(FatalError); } - return autoPtr<topoSetFaceZoneSource>(cstrIter()(mesh, is)); + return autoPtr<topoSetFaceZoneSource>(ctorPtr(mesh, is)); } diff --git a/src/meshTools/sets/pointSources/topoSetPointSource/topoSetPointSource.C b/src/meshTools/sets/pointSources/topoSetPointSource/topoSetPointSource.C index 6483209386b..ff637c67d02 100644 --- a/src/meshTools/sets/pointSources/topoSetPointSource/topoSetPointSource.C +++ b/src/meshTools/sets/pointSources/topoSetPointSource/topoSetPointSource.C @@ -65,9 +65,9 @@ Foam::topoSetPointSource::New const dictionary& dict ) { - auto cstrIter = wordConstructorTablePtr_->cfind(sourceType); + auto* ctorPtr = wordConstructorTable(sourceType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -78,7 +78,7 @@ Foam::topoSetPointSource::New ) << exit(FatalIOError); } - return autoPtr<topoSetPointSource>(cstrIter()(mesh, dict)); + return autoPtr<topoSetPointSource>(ctorPtr(mesh, dict)); } @@ -89,9 +89,9 @@ Foam::autoPtr<Foam::topoSetPointSource> Foam::topoSetPointSource::New Istream& is ) { - auto cstrIter = istreamConstructorTablePtr_->cfind(sourceType); + auto* ctorPtr = istreamConstructorTable(sourceType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInLookup ( @@ -101,7 +101,7 @@ Foam::autoPtr<Foam::topoSetPointSource> Foam::topoSetPointSource::New ) << exit(FatalError); } - return autoPtr<topoSetPointSource>(cstrIter()(mesh, is)); + return autoPtr<topoSetPointSource>(ctorPtr(mesh, is)); } diff --git a/src/meshTools/sets/pointZoneSources/topoSetPointZoneSource/topoSetPointZoneSource.C b/src/meshTools/sets/pointZoneSources/topoSetPointZoneSource/topoSetPointZoneSource.C index cbda72836b3..22aa9599e3b 100644 --- a/src/meshTools/sets/pointZoneSources/topoSetPointZoneSource/topoSetPointZoneSource.C +++ b/src/meshTools/sets/pointZoneSources/topoSetPointZoneSource/topoSetPointZoneSource.C @@ -65,9 +65,9 @@ Foam::topoSetPointZoneSource::New const dictionary& dict ) { - auto cstrIter = wordConstructorTablePtr_->cfind(sourceType); + auto* ctorPtr = wordConstructorTable(sourceType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -78,7 +78,7 @@ Foam::topoSetPointZoneSource::New ) << exit(FatalIOError); } - return autoPtr<topoSetPointZoneSource>(cstrIter()(mesh, dict)); + return autoPtr<topoSetPointZoneSource>(ctorPtr(mesh, dict)); } @@ -90,9 +90,9 @@ Foam::topoSetPointZoneSource::New Istream& is ) { - auto cstrIter = istreamConstructorTablePtr_->cfind(sourceType); + auto* ctorPtr = istreamConstructorTable(sourceType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInLookup ( @@ -102,7 +102,7 @@ Foam::topoSetPointZoneSource::New ) << exit(FatalError); } - return autoPtr<topoSetPointZoneSource>(cstrIter()(mesh, is)); + return autoPtr<topoSetPointZoneSource>(ctorPtr(mesh, is)); } diff --git a/src/meshTools/sets/topoSetSource/topoSetSource.C b/src/meshTools/sets/topoSetSource/topoSetSource.C index f87a8af58cf..e518dda227b 100644 --- a/src/meshTools/sets/topoSetSource/topoSetSource.C +++ b/src/meshTools/sets/topoSetSource/topoSetSource.C @@ -113,9 +113,9 @@ Foam::autoPtr<Foam::topoSetSource> Foam::topoSetSource::New const dictionary& dict ) { - auto cstrIter = wordConstructorTablePtr_->cfind(topoSetSourceType); + auto* ctorPtr = wordConstructorTable(topoSetSourceType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -126,7 +126,7 @@ Foam::autoPtr<Foam::topoSetSource> Foam::topoSetSource::New ) << exit(FatalIOError); } - return autoPtr<topoSetSource>(cstrIter()(mesh, dict)); + return autoPtr<topoSetSource>(ctorPtr(mesh, dict)); } @@ -137,9 +137,9 @@ Foam::autoPtr<Foam::topoSetSource> Foam::topoSetSource::New Istream& is ) { - auto cstrIter = istreamConstructorTablePtr_->cfind(topoSetSourceType); + auto* ctorPtr = istreamConstructorTable(topoSetSourceType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInLookup ( @@ -149,7 +149,7 @@ Foam::autoPtr<Foam::topoSetSource> Foam::topoSetSource::New ) << exit(FatalError); } - return autoPtr<topoSetSource>(cstrIter()(mesh, is)); + return autoPtr<topoSetSource>(ctorPtr(mesh, is)); } diff --git a/src/meshTools/sets/topoSets/topoSet.C b/src/meshTools/sets/topoSets/topoSet.C index 9e0bcbb0754..2b7a3772e94 100644 --- a/src/meshTools/sets/topoSets/topoSet.C +++ b/src/meshTools/sets/topoSets/topoSet.C @@ -60,9 +60,9 @@ Foam::topoSet::New writeOption w ) { - auto cstrIter = wordConstructorTablePtr_->cfind(setType); + auto* ctorPtr = wordConstructorTable(setType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInLookup ( @@ -72,7 +72,7 @@ Foam::topoSet::New ) << exit(FatalError); } - return autoPtr<topoSet>(cstrIter()(mesh, name, r, w)); + return autoPtr<topoSet>(ctorPtr(mesh, name, r, w)); } @@ -86,9 +86,9 @@ Foam::topoSet::New writeOption w ) { - auto cstrIter = sizeConstructorTablePtr_->cfind(setType); + auto* ctorPtr = sizeConstructorTable(setType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInLookup ( @@ -98,7 +98,7 @@ Foam::topoSet::New ) << exit(FatalError); } - return autoPtr<topoSet>(cstrIter()(mesh, name, size, w)); + return autoPtr<topoSet>(ctorPtr(mesh, name, size, w)); } @@ -112,9 +112,9 @@ Foam::topoSet::New writeOption w ) { - auto cstrIter = setConstructorTablePtr_->cfind(setType); + auto* ctorPtr = setConstructorTable(setType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInLookup ( @@ -124,7 +124,7 @@ Foam::topoSet::New ) << exit(FatalError); } - return autoPtr<topoSet>(cstrIter()(mesh, name, set, w)); + return autoPtr<topoSet>(ctorPtr(mesh, name, set, w)); } diff --git a/src/optimisation/adjointOptimisation/adjoint/ATCModel/ATCModel/ATCModel.C b/src/optimisation/adjointOptimisation/adjoint/ATCModel/ATCModel/ATCModel.C index 99c574434ee..2be1febb350 100644 --- a/src/optimisation/adjointOptimisation/adjoint/ATCModel/ATCModel/ATCModel.C +++ b/src/optimisation/adjointOptimisation/adjoint/ATCModel/ATCModel/ATCModel.C @@ -7,7 +7,7 @@ ------------------------------------------------------------------------------- Copyright (C) 2007-2019 PCOpt/NTUA Copyright (C) 2013-2019 FOSS GP - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -135,11 +135,11 @@ autoPtr<ATCModel> ATCModel::New { const word modelType(dict.get<word>("ATCModel")); - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); Info<< "ATCModel type " << modelType << endl; - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -152,7 +152,7 @@ autoPtr<ATCModel> ATCModel::New return autoPtr<ATCModel> ( - cstrIter()(mesh, primalVars, adjointVars, dict) + ctorPtr(mesh, primalVars, adjointVars, dict) ); } diff --git a/src/optimisation/adjointOptimisation/adjoint/ATCModel/zeroATCcells/zeroATCcells/zeroATCcells.C b/src/optimisation/adjointOptimisation/adjoint/ATCModel/zeroATCcells/zeroATCcells/zeroATCcells.C index 8bebf6357fa..8d00e265db4 100644 --- a/src/optimisation/adjointOptimisation/adjoint/ATCModel/zeroATCcells/zeroATCcells/zeroATCcells.C +++ b/src/optimisation/adjointOptimisation/adjoint/ATCModel/zeroATCcells/zeroATCcells/zeroATCcells.C @@ -7,7 +7,7 @@ ------------------------------------------------------------------------------- Copyright (C) 2007-2019 PCOpt/NTUA Copyright (C) 2013-2019 FOSS GP - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -93,9 +93,9 @@ autoPtr<zeroATCcells> zeroATCcells::New dict.getOrDefault<word>("maskType", "faceCells") ); - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -106,7 +106,7 @@ autoPtr<zeroATCcells> zeroATCcells::New ) << exit(FatalIOError); } - return autoPtr<zeroATCcells> (cstrIter()(mesh,dict)); + return autoPtr<zeroATCcells> (ctorPtr(mesh,dict)); } diff --git a/src/optimisation/adjointOptimisation/adjoint/boundaryAdjointContributions/boundaryAdjointContribution/boundaryAdjointContribution.C b/src/optimisation/adjointOptimisation/adjoint/boundaryAdjointContributions/boundaryAdjointContribution/boundaryAdjointContribution.C index 065d8bbf048..d1696041de7 100644 --- a/src/optimisation/adjointOptimisation/adjoint/boundaryAdjointContributions/boundaryAdjointContribution/boundaryAdjointContribution.C +++ b/src/optimisation/adjointOptimisation/adjoint/boundaryAdjointContributions/boundaryAdjointContribution/boundaryAdjointContribution.C @@ -7,7 +7,7 @@ ------------------------------------------------------------------------------- Copyright (C) 2007-2019 PCOpt/NTUA Copyright (C) 2013-2019 FOSS GP - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -63,9 +63,9 @@ autoPtr<boundaryAdjointContribution> boundaryAdjointContribution::New const fvPatch& patch ) { - auto cstrIter = dictionaryConstructorTablePtr_->cfind(simulationType); + auto* ctorPtr = dictionaryConstructorTable(simulationType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInLookup ( @@ -78,7 +78,7 @@ autoPtr<boundaryAdjointContribution> boundaryAdjointContribution::New return autoPtr<boundaryAdjointContribution> ( - cstrIter() + ctorPtr ( managerName, adjointSolverName, diff --git a/src/optimisation/adjointOptimisation/adjoint/displacementMethod/displacementMethod/displacementMethod.C b/src/optimisation/adjointOptimisation/adjoint/displacementMethod/displacementMethod/displacementMethod.C index 9ac5a2812c5..58f2586a15d 100644 --- a/src/optimisation/adjointOptimisation/adjoint/displacementMethod/displacementMethod/displacementMethod.C +++ b/src/optimisation/adjointOptimisation/adjoint/displacementMethod/displacementMethod/displacementMethod.C @@ -7,7 +7,7 @@ ------------------------------------------------------------------------------- Copyright (C) 2007-2019 PCOpt/NTUA Copyright (C) 2013-2019 FOSS GP - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -79,9 +79,9 @@ Foam::autoPtr<Foam::displacementMethod> Foam::displacementMethod::New Info<< "displacementMethod type : " << solverType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(solverType); + auto* ctorPtr = dictionaryConstructorTable(solverType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -91,7 +91,7 @@ Foam::autoPtr<Foam::displacementMethod> Foam::displacementMethod::New *dictionaryConstructorTablePtr_ ) << exit(FatalIOError); } - return autoPtr<displacementMethod>(cstrIter()(mesh, patchIDs)); + return autoPtr<displacementMethod>(ctorPtr(mesh, patchIDs)); } diff --git a/src/optimisation/adjointOptimisation/adjoint/objectiveManager/objectiveManager/objectiveManager.C b/src/optimisation/adjointOptimisation/adjoint/objectiveManager/objectiveManager/objectiveManager.C index 5a379c1ed05..c84fa257b09 100644 --- a/src/optimisation/adjointOptimisation/adjoint/objectiveManager/objectiveManager/objectiveManager.C +++ b/src/optimisation/adjointOptimisation/adjoint/objectiveManager/objectiveManager/objectiveManager.C @@ -7,7 +7,7 @@ ------------------------------------------------------------------------------- Copyright (C) 2007-2021 PCOpt/NTUA Copyright (C) 2013-2021 FOSS GP - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -146,9 +146,9 @@ autoPtr<objectiveManager> objectiveManager::New const word objectiveType(dict.get<word>("type")); const word managerType("objectiveManager" & objectiveType); - auto cstrIter = dictionaryConstructorTablePtr_->cfind(managerType); + auto* ctorPtr = dictionaryConstructorTable(managerType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -161,7 +161,7 @@ autoPtr<objectiveManager> objectiveManager::New return autoPtr<objectiveManager> ( - cstrIter()(mesh, dict, adjointSolverName, primalSolverName) + ctorPtr(mesh, dict, adjointSolverName, primalSolverName) ); } diff --git a/src/optimisation/adjointOptimisation/adjoint/objectives/incompressible/objectiveIncompressible/objectiveIncompressible.C b/src/optimisation/adjointOptimisation/adjoint/objectives/incompressible/objectiveIncompressible/objectiveIncompressible.C index 46eee718a72..af2ae64ee97 100644 --- a/src/optimisation/adjointOptimisation/adjoint/objectives/incompressible/objectiveIncompressible/objectiveIncompressible.C +++ b/src/optimisation/adjointOptimisation/adjoint/objectives/incompressible/objectiveIncompressible/objectiveIncompressible.C @@ -7,7 +7,7 @@ ------------------------------------------------------------------------------- Copyright (C) 2007-2019 PCOpt/NTUA Copyright (C) 2013-2019 FOSS GP - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -106,9 +106,9 @@ autoPtr<objectiveIncompressible> objectiveIncompressible::New Info<< "Creating objective function : " << dict.dictName() << " of type " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -121,7 +121,7 @@ autoPtr<objectiveIncompressible> objectiveIncompressible::New return autoPtr<objectiveIncompressible> ( - cstrIter()(mesh, dict, adjointSolverName, primalSolverName) + ctorPtr(mesh, dict, adjointSolverName, primalSolverName) ); } diff --git a/src/optimisation/adjointOptimisation/adjoint/objectives/objective/objective.C b/src/optimisation/adjointOptimisation/adjoint/objectives/objective/objective.C index 28d9d79d1b8..0eb776d1d3b 100644 --- a/src/optimisation/adjointOptimisation/adjoint/objectives/objective/objective.C +++ b/src/optimisation/adjointOptimisation/adjoint/objectives/objective/objective.C @@ -7,7 +7,7 @@ ------------------------------------------------------------------------------- Copyright (C) 2007-2020 PCOpt/NTUA Copyright (C) 2013-2020 FOSS GP - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -211,9 +211,9 @@ autoPtr<objective> objective::New const word& primalSolverName ) { - auto cstrIter = objectiveConstructorTablePtr_->cfind(objectiveType); + auto* ctorPtr = objectiveConstructorTable(objectiveType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -226,7 +226,7 @@ autoPtr<objective> objective::New return autoPtr<objective> ( - cstrIter() + ctorPtr ( mesh, dict, diff --git a/src/optimisation/adjointOptimisation/adjoint/optimisation/adjointSensitivity/incompressible/adjointSensitivity/adjointSensitivityIncompressible.C b/src/optimisation/adjointOptimisation/adjoint/optimisation/adjointSensitivity/incompressible/adjointSensitivity/adjointSensitivityIncompressible.C index 493794b4466..a30eba293cc 100644 --- a/src/optimisation/adjointOptimisation/adjoint/optimisation/adjointSensitivity/incompressible/adjointSensitivity/adjointSensitivityIncompressible.C +++ b/src/optimisation/adjointOptimisation/adjoint/optimisation/adjointSensitivity/incompressible/adjointSensitivity/adjointSensitivityIncompressible.C @@ -7,7 +7,7 @@ ------------------------------------------------------------------------------- Copyright (C) 2007-2020 PCOpt/NTUA Copyright (C) 2013-2020 FOSS GP - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -81,9 +81,9 @@ autoPtr<adjointSensitivity> adjointSensitivity::New Info<< "adjointSensitivity type : " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -96,7 +96,7 @@ autoPtr<adjointSensitivity> adjointSensitivity::New return autoPtr<adjointSensitivity> ( - cstrIter() + ctorPtr ( mesh, dict, diff --git a/src/optimisation/adjointOptimisation/adjoint/optimisation/lineSearch/lineSearch/lineSearch.C b/src/optimisation/adjointOptimisation/adjoint/optimisation/lineSearch/lineSearch/lineSearch.C index 7c88923ca0e..1dec8cda810 100644 --- a/src/optimisation/adjointOptimisation/adjoint/optimisation/lineSearch/lineSearch/lineSearch.C +++ b/src/optimisation/adjointOptimisation/adjoint/optimisation/lineSearch/lineSearch/lineSearch.C @@ -7,7 +7,7 @@ ------------------------------------------------------------------------------- Copyright (C) 2007-2019 PCOpt/NTUA Copyright (C) 2013-2019 FOSS GP - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -106,9 +106,9 @@ Foam::autoPtr<Foam::lineSearch> Foam::lineSearch::New if (modelType != "none") { - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -119,7 +119,7 @@ Foam::autoPtr<Foam::lineSearch> Foam::lineSearch::New ) << exit(FatalIOError); } - lineSrch.reset((cstrIter()(dict, time)).ptr()); + lineSrch.reset((ctorPtr(dict, time)).ptr()); } else { diff --git a/src/optimisation/adjointOptimisation/adjoint/optimisation/lineSearch/stepUpdate/stepUpdate/stepUpdate.C b/src/optimisation/adjointOptimisation/adjoint/optimisation/lineSearch/stepUpdate/stepUpdate/stepUpdate.C index f4b7c2c64d8..de6ea4db716 100644 --- a/src/optimisation/adjointOptimisation/adjoint/optimisation/lineSearch/stepUpdate/stepUpdate/stepUpdate.C +++ b/src/optimisation/adjointOptimisation/adjoint/optimisation/lineSearch/stepUpdate/stepUpdate/stepUpdate.C @@ -7,7 +7,7 @@ ------------------------------------------------------------------------------- Copyright (C) 2007-2019 PCOpt/NTUA Copyright (C) 2013-2019 FOSS GP - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -63,9 +63,9 @@ Foam::autoPtr<Foam::stepUpdate> Foam::stepUpdate::New(const dictionary& dict) Info<< "stepUpdate type : " << type << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(type); + auto* ctorPtr = dictionaryConstructorTable(type); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -76,7 +76,7 @@ Foam::autoPtr<Foam::stepUpdate> Foam::stepUpdate::New(const dictionary& dict) ) << exit(FatalIOError); } - return autoPtr<stepUpdate>(cstrIter()(dict)); + return autoPtr<stepUpdate>(ctorPtr(dict)); } diff --git a/src/optimisation/adjointOptimisation/adjoint/optimisation/optMeshMovement/optMeshMovement/optMeshMovement.C b/src/optimisation/adjointOptimisation/adjoint/optimisation/optMeshMovement/optMeshMovement/optMeshMovement.C index 566165c67f6..42465983eb9 100644 --- a/src/optimisation/adjointOptimisation/adjoint/optimisation/optMeshMovement/optMeshMovement/optMeshMovement.C +++ b/src/optimisation/adjointOptimisation/adjoint/optimisation/optMeshMovement/optMeshMovement/optMeshMovement.C @@ -7,7 +7,7 @@ ------------------------------------------------------------------------------- Copyright (C) 2007-2019 PCOpt/NTUA Copyright (C) 2013-2019 FOSS GP - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -100,9 +100,9 @@ Foam::autoPtr<Foam::optMeshMovement> Foam::optMeshMovement::New Info<< "optMeshMovement type : " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -113,7 +113,7 @@ Foam::autoPtr<Foam::optMeshMovement> Foam::optMeshMovement::New ) << exit(FatalIOError); } - return autoPtr<optMeshMovement>(cstrIter()(mesh, dict, patchIDs)); + return autoPtr<optMeshMovement>(ctorPtr(mesh, dict, patchIDs)); } diff --git a/src/optimisation/adjointOptimisation/adjoint/optimisation/optimisationManager/optimisationManager/optimisationManager.C b/src/optimisation/adjointOptimisation/adjoint/optimisation/optimisationManager/optimisationManager/optimisationManager.C index 3e94ae8ac9c..0af90e4b7f4 100644 --- a/src/optimisation/adjointOptimisation/adjoint/optimisation/optimisationManager/optimisationManager/optimisationManager.C +++ b/src/optimisation/adjointOptimisation/adjoint/optimisation/optimisationManager/optimisationManager/optimisationManager.C @@ -7,7 +7,7 @@ ------------------------------------------------------------------------------- Copyright (C) 2007-2019 PCOpt/NTUA Copyright (C) 2013-2019 FOSS GP - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -164,9 +164,9 @@ Foam::autoPtr<Foam::optimisationManager> Foam::optimisationManager::New Info<< "optimisationManager type : " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -177,7 +177,7 @@ Foam::autoPtr<Foam::optimisationManager> Foam::optimisationManager::New ) << exit(FatalIOError); } - return autoPtr<optimisationManager>(cstrIter()(mesh)); + return autoPtr<optimisationManager>(ctorPtr(mesh)); } diff --git a/src/optimisation/adjointOptimisation/adjoint/optimisation/optimisationType/incompressible/optimisationType/optimisationTypeIncompressible.C b/src/optimisation/adjointOptimisation/adjoint/optimisation/optimisationType/incompressible/optimisationType/optimisationTypeIncompressible.C index 55f81cd01c2..ccbf08f466c 100644 --- a/src/optimisation/adjointOptimisation/adjoint/optimisation/optimisationType/incompressible/optimisationType/optimisationTypeIncompressible.C +++ b/src/optimisation/adjointOptimisation/adjoint/optimisation/optimisationType/incompressible/optimisationType/optimisationTypeIncompressible.C @@ -7,7 +7,7 @@ ------------------------------------------------------------------------------- Copyright (C) 2007-2020 PCOpt/NTUA Copyright (C) 2013-2020 FOSS GP - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -134,9 +134,9 @@ autoPtr<optimisationType> optimisationType::New Info<< "optimisationType type : " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -149,7 +149,7 @@ autoPtr<optimisationType> optimisationType::New return autoPtr<optimisationType> ( - cstrIter()(mesh, dict, adjointSolverManagers) + ctorPtr(mesh, dict, adjointSolverManagers) ); } diff --git a/src/optimisation/adjointOptimisation/adjoint/optimisation/updateMethod/updateMethod/updateMethod.C b/src/optimisation/adjointOptimisation/adjoint/optimisation/updateMethod/updateMethod/updateMethod.C index 5c3fef24a9d..a77baf884eb 100644 --- a/src/optimisation/adjointOptimisation/adjoint/optimisation/updateMethod/updateMethod/updateMethod.C +++ b/src/optimisation/adjointOptimisation/adjoint/optimisation/updateMethod/updateMethod/updateMethod.C @@ -7,7 +7,7 @@ ------------------------------------------------------------------------------- Copyright (C) 2007-2019 PCOpt/NTUA Copyright (C) 2013-2019 FOSS GP - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -269,9 +269,9 @@ Foam::autoPtr<Foam::updateMethod> Foam::updateMethod::New Info<< "updateMethod type : " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -282,7 +282,7 @@ Foam::autoPtr<Foam::updateMethod> Foam::updateMethod::New ) << exit(FatalIOError); } - return autoPtr<updateMethod>(cstrIter()(mesh, dict)); + return autoPtr<updateMethod>(ctorPtr(mesh, dict)); } diff --git a/src/optimisation/adjointOptimisation/adjoint/parameterization/NURBS/NURBS3DVolume/NURBS3DVolume/NURBS3DVolume.C b/src/optimisation/adjointOptimisation/adjoint/parameterization/NURBS/NURBS3DVolume/NURBS3DVolume/NURBS3DVolume.C index 3187585eb59..d364114daa2 100644 --- a/src/optimisation/adjointOptimisation/adjoint/parameterization/NURBS/NURBS3DVolume/NURBS3DVolume/NURBS3DVolume.C +++ b/src/optimisation/adjointOptimisation/adjoint/parameterization/NURBS/NURBS3DVolume/NURBS3DVolume/NURBS3DVolume.C @@ -7,7 +7,7 @@ ------------------------------------------------------------------------------- Copyright (C) 2007-2020 PCOpt/NTUA Copyright (C) 2013-2020 FOSS GP - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -757,9 +757,9 @@ Foam::autoPtr<Foam::NURBS3DVolume> Foam::NURBS3DVolume::New Info<< "NURBS3DVolume type : " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -770,7 +770,7 @@ Foam::autoPtr<Foam::NURBS3DVolume> Foam::NURBS3DVolume::New ) << exit(FatalIOError); } - return autoPtr<NURBS3DVolume>(cstrIter()(dict, mesh, computeParamCoors)); + return autoPtr<NURBS3DVolume>(ctorPtr(dict, mesh, computeParamCoors)); } diff --git a/src/optimisation/adjointOptimisation/adjoint/parameterization/NURBS/NURBS3DVolume/controlPointsDefinition/controlPointsDefinition/controlPointsDefinition.C b/src/optimisation/adjointOptimisation/adjoint/parameterization/NURBS/NURBS3DVolume/controlPointsDefinition/controlPointsDefinition/controlPointsDefinition.C index 143c28c7822..13e46aff6ec 100644 --- a/src/optimisation/adjointOptimisation/adjoint/parameterization/NURBS/NURBS3DVolume/controlPointsDefinition/controlPointsDefinition/controlPointsDefinition.C +++ b/src/optimisation/adjointOptimisation/adjoint/parameterization/NURBS/NURBS3DVolume/controlPointsDefinition/controlPointsDefinition/controlPointsDefinition.C @@ -7,6 +7,7 @@ ------------------------------------------------------------------------------- Copyright (C) 2020 PCOpt/NTUA Copyright (C) 2020 FOSS GP + Copyright (C) 2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -120,9 +121,9 @@ Foam::autoPtr<Foam::controlPointsDefinition> Foam::controlPointsDefinition::New Info<< "controlPointsDefinition type : " << type << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(type); + auto* ctorPtr = dictionaryConstructorTable(type); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -133,7 +134,7 @@ Foam::autoPtr<Foam::controlPointsDefinition> Foam::controlPointsDefinition::New ) << exit(FatalIOError); } - return autoPtr<controlPointsDefinition>(cstrIter()(box)); + return autoPtr<controlPointsDefinition>(ctorPtr(box)); } diff --git a/src/optimisation/adjointOptimisation/adjoint/solvers/adjointSolvers/adjointSolver/adjointSolver.C b/src/optimisation/adjointOptimisation/adjoint/solvers/adjointSolvers/adjointSolver/adjointSolver.C index c8abc35f60d..01d88cb0d0a 100644 --- a/src/optimisation/adjointOptimisation/adjoint/solvers/adjointSolvers/adjointSolver/adjointSolver.C +++ b/src/optimisation/adjointOptimisation/adjoint/solvers/adjointSolvers/adjointSolver/adjointSolver.C @@ -7,7 +7,7 @@ ------------------------------------------------------------------------------- Copyright (C) 2007-2019 PCOpt/NTUA Copyright (C) 2013-2019 FOSS GP - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -85,9 +85,9 @@ Foam::autoPtr<Foam::adjointSolver> Foam::adjointSolver::New { const word solverType(dict.get<word>("type")); - auto cstrIter = adjointSolverConstructorTablePtr_->cfind(solverType); + auto* ctorPtr = adjointSolverConstructorTable(solverType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -100,7 +100,7 @@ Foam::autoPtr<Foam::adjointSolver> Foam::adjointSolver::New return autoPtr<adjointSolver> ( - cstrIter()(mesh, managerType, dict, primalSolverName) + ctorPtr(mesh, managerType, dict, primalSolverName) ); } diff --git a/src/optimisation/adjointOptimisation/adjoint/solvers/adjointSolvers/incompressible/incompressibleAdjointSolver/incompressibleAdjointSolver.C b/src/optimisation/adjointOptimisation/adjoint/solvers/adjointSolvers/incompressible/incompressibleAdjointSolver/incompressibleAdjointSolver.C index 6700162b5bf..2a3c2d31c74 100644 --- a/src/optimisation/adjointOptimisation/adjoint/solvers/adjointSolvers/incompressible/incompressibleAdjointSolver/incompressibleAdjointSolver.C +++ b/src/optimisation/adjointOptimisation/adjoint/solvers/adjointSolvers/incompressible/incompressibleAdjointSolver/incompressibleAdjointSolver.C @@ -7,7 +7,7 @@ ------------------------------------------------------------------------------- Copyright (C) 2007-2020 PCOpt/NTUA Copyright (C) 2013-2020 FOSS GP - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -78,9 +78,9 @@ Foam::incompressibleAdjointSolver::New ) { const word solverType(dict.get<word>("solver")); - auto cstrIter = dictionaryConstructorTablePtr_->cfind(solverType); + auto* ctorPtr = dictionaryConstructorTable(solverType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -94,7 +94,7 @@ Foam::incompressibleAdjointSolver::New return autoPtr<incompressibleAdjointSolver> ( - cstrIter()(mesh, managerType, dict, primalSolverName) + ctorPtr(mesh, managerType, dict, primalSolverName) ); } diff --git a/src/optimisation/adjointOptimisation/adjoint/solvers/primalSolvers/incompressible/incompressiblePrimalSolver/incompressiblePrimalSolver.C b/src/optimisation/adjointOptimisation/adjoint/solvers/primalSolvers/incompressible/incompressiblePrimalSolver/incompressiblePrimalSolver.C index 3cffe23bfb3..5fa3f120c84 100644 --- a/src/optimisation/adjointOptimisation/adjoint/solvers/primalSolvers/incompressible/incompressiblePrimalSolver/incompressiblePrimalSolver.C +++ b/src/optimisation/adjointOptimisation/adjoint/solvers/primalSolvers/incompressible/incompressiblePrimalSolver/incompressiblePrimalSolver.C @@ -7,7 +7,7 @@ ------------------------------------------------------------------------------- Copyright (C) 2007-2020 PCOpt/NTUA Copyright (C) 2013-2020 FOSS GP - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -83,9 +83,9 @@ Foam::incompressiblePrimalSolver::New ) { const word solverType(dict.get<word>("solver")); - auto cstrIter = dictionaryConstructorTablePtr_->cfind(solverType); + auto* ctorPtr = dictionaryConstructorTable(solverType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -99,7 +99,7 @@ Foam::incompressiblePrimalSolver::New return autoPtr<incompressiblePrimalSolver> ( - cstrIter()(mesh, managerType, dict) + ctorPtr(mesh, managerType, dict) ); } diff --git a/src/optimisation/adjointOptimisation/adjoint/solvers/primalSolvers/primalSolver/primalSolver.C b/src/optimisation/adjointOptimisation/adjoint/solvers/primalSolvers/primalSolver/primalSolver.C index d8b81d89bfd..1f4c9e43f17 100644 --- a/src/optimisation/adjointOptimisation/adjoint/solvers/primalSolvers/primalSolver/primalSolver.C +++ b/src/optimisation/adjointOptimisation/adjoint/solvers/primalSolvers/primalSolver/primalSolver.C @@ -7,7 +7,7 @@ ------------------------------------------------------------------------------- Copyright (C) 2007-2019 PCOpt/NTUA Copyright (C) 2013-2019 FOSS GP - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -64,9 +64,9 @@ Foam::autoPtr<Foam::primalSolver> Foam::primalSolver::New { const word solverType(dict.get<word>("type")); - auto cstrIter = primalSolverConstructorTablePtr_->cfind(solverType); + auto* ctorPtr = primalSolverConstructorTable(solverType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -77,7 +77,7 @@ Foam::autoPtr<Foam::primalSolver> Foam::primalSolver::New ) << exit(FatalIOError); } - return autoPtr<primalSolver>(cstrIter()(mesh, managerType, dict)); + return autoPtr<primalSolver>(ctorPtr(mesh, managerType, dict)); } diff --git a/src/optimisation/adjointOptimisation/adjoint/solvers/solverControl/SIMPLEControl/SIMPLEControl/SIMPLEControl.C b/src/optimisation/adjointOptimisation/adjoint/solvers/solverControl/SIMPLEControl/SIMPLEControl/SIMPLEControl.C index c0d6ddf059a..6059ba45c7a 100644 --- a/src/optimisation/adjointOptimisation/adjoint/solvers/solverControl/SIMPLEControl/SIMPLEControl/SIMPLEControl.C +++ b/src/optimisation/adjointOptimisation/adjoint/solvers/solverControl/SIMPLEControl/SIMPLEControl/SIMPLEControl.C @@ -7,7 +7,7 @@ ------------------------------------------------------------------------------- Copyright (C) 2007-2019 PCOpt/NTUA Copyright (C) 2013-2019 FOSS GP - 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::SIMPLEControl> Foam::SIMPLEControl::New const solver& solver ) { - auto cstrIter = dictionaryConstructorTablePtr_->cfind(managerType); + auto* ctorPtr = dictionaryConstructorTable(managerType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInLookup ( @@ -79,7 +79,7 @@ Foam::autoPtr<Foam::SIMPLEControl> Foam::SIMPLEControl::New ) << exit(FatalError); } - return autoPtr<SIMPLEControl>(cstrIter()(mesh, managerType, solver)); + return autoPtr<SIMPLEControl>(ctorPtr(mesh, managerType, solver)); } diff --git a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/adjointRASModel/adjointRASModel.C b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/adjointRASModel/adjointRASModel.C index 9412083eb0e..15ea65c8b1f 100644 --- a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/adjointRASModel/adjointRASModel.C +++ b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/adjointRASModel/adjointRASModel.C @@ -7,7 +7,7 @@ ------------------------------------------------------------------------------- Copyright (C) 2007-2019 PCOpt/NTUA Copyright (C) 2013-2019 FOSS GP - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -184,9 +184,9 @@ autoPtr<adjointRASModel> adjointRASModel::New Info<< "Selecting adjointRAS turbulence model " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -199,7 +199,7 @@ autoPtr<adjointRASModel> adjointRASModel::New return autoPtr<adjointRASModel> ( - cstrIter() + ctorPtr ( primalVars, adjointVars, diff --git a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointTurbulenceModel/adjointTurbulenceModel.C b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointTurbulenceModel/adjointTurbulenceModel.C index 56e04d829bd..8b56a910ef6 100644 --- a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointTurbulenceModel/adjointTurbulenceModel.C +++ b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointTurbulenceModel/adjointTurbulenceModel.C @@ -7,7 +7,7 @@ ------------------------------------------------------------------------------- Copyright (C) 2007-2019 PCOpt/NTUA Copyright (C) 2013-2019 FOSS GP - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -99,10 +99,9 @@ autoPtr<adjointTurbulenceModel> adjointTurbulenceModel::New Info<< "Selecting turbulence model type " << modelType << endl; - auto cstrIter = - adjointTurbulenceModelConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = adjointTurbulenceModelConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInLookup ( @@ -114,7 +113,7 @@ autoPtr<adjointTurbulenceModel> adjointTurbulenceModel::New return autoPtr<adjointTurbulenceModel> ( - cstrIter() + ctorPtr ( primalVars, adjointVars, diff --git a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/turbulenceModelVariables/RAS/RASModelVariables/RASModelVariables.C b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/turbulenceModelVariables/RAS/RASModelVariables/RASModelVariables.C index 8e132401ee1..96733c8c3df 100644 --- a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/turbulenceModelVariables/RAS/RASModelVariables/RASModelVariables.C +++ b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/turbulenceModelVariables/RAS/RASModelVariables/RASModelVariables.C @@ -7,7 +7,7 @@ ------------------------------------------------------------------------------- Copyright (C) 2007-2019 PCOpt/NTUA Copyright (C) 2013-2019 FOSS GP - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -277,9 +277,9 @@ autoPtr<RASModelVariables> RASModelVariables::New Info<< "Creating references for RASModel variables : " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -290,7 +290,7 @@ autoPtr<RASModelVariables> RASModelVariables::New ) << exit(FatalIOError); } - return autoPtr<RASModelVariables>(cstrIter()(mesh, SolverControl)); + return autoPtr<RASModelVariables>(ctorPtr(mesh, SolverControl)); } diff --git a/src/overset/cellCellStencil/cellCellStencil/cellCellStencil.C b/src/overset/cellCellStencil/cellCellStencil/cellCellStencil.C index 1f4f60e708d..833bb2fd6df 100644 --- a/src/overset/cellCellStencil/cellCellStencil/cellCellStencil.C +++ b/src/overset/cellCellStencil/cellCellStencil/cellCellStencil.C @@ -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. @@ -71,9 +71,9 @@ Foam::autoPtr<Foam::cellCellStencil> Foam::cellCellStencil::New const word stencilType(dict.get<word>("method")); - auto cstrIter = meshConstructorTablePtr_->cfind(stencilType); + auto* ctorPtr = meshConstructorTable(stencilType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -84,7 +84,7 @@ Foam::autoPtr<Foam::cellCellStencil> Foam::cellCellStencil::New ) << exit(FatalIOError); } - return autoPtr<cellCellStencil>(cstrIter()(mesh, dict, update)); + return autoPtr<cellCellStencil>(ctorPtr(mesh, dict, update)); } diff --git a/src/parallel/decompose/decompositionMethods/decompositionConstraints/decompositionConstraint/decompositionConstraint.C b/src/parallel/decompose/decompositionMethods/decompositionConstraints/decompositionConstraint/decompositionConstraint.C index 12f8a316c65..e4ec1fd6137 100644 --- a/src/parallel/decompose/decompositionMethods/decompositionConstraints/decompositionConstraint/decompositionConstraint.C +++ b/src/parallel/decompose/decompositionMethods/decompositionConstraints/decompositionConstraint/decompositionConstraint.C @@ -173,9 +173,9 @@ Foam::decompositionConstraint::New { Info<< "Selecting decompositionConstraint " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -186,7 +186,7 @@ Foam::decompositionConstraint::New ) << exit(FatalIOError); } - return autoPtr<decompositionConstraint>(cstrIter()(dict)); + return autoPtr<decompositionConstraint>(ctorPtr(dict)); } diff --git a/src/parallel/decompose/decompositionMethods/decompositionMethod/decompositionMethod.C b/src/parallel/decompose/decompositionMethods/decompositionMethod/decompositionMethod.C index f629687da7b..47812e64a53 100644 --- a/src/parallel/decompose/decompositionMethods/decompositionMethod/decompositionMethod.C +++ b/src/parallel/decompose/decompositionMethods/decompositionMethod/decompositionMethod.C @@ -351,9 +351,9 @@ Foam::autoPtr<Foam::decompositionMethod> Foam::decompositionMethod::New const dictionary& regionDict = optionalRegionDict(decompDict, regionName); regionDict.readIfPresent("method", methodType); - auto cstrIter = dictionaryConstructorTablePtr_->cfind(methodType); + auto* ctorPtr = dictionaryConstructorTable(methodType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -376,7 +376,7 @@ Foam::autoPtr<Foam::decompositionMethod> Foam::decompositionMethod::New Info<< endl; } - return autoPtr<decompositionMethod>(cstrIter()(decompDict, regionName)); + return autoPtr<decompositionMethod>(ctorPtr(decompDict, regionName)); } diff --git a/src/phaseSystemModels/multiphaseEuler/multiphaseSystem/diameterModels/diameterModel/diameterModel.C b/src/phaseSystemModels/multiphaseEuler/multiphaseSystem/diameterModels/diameterModel/diameterModel.C index 4a8be8ea37d..da3d0e8f8dd 100644 --- a/src/phaseSystemModels/multiphaseEuler/multiphaseSystem/diameterModels/diameterModel/diameterModel.C +++ b/src/phaseSystemModels/multiphaseEuler/multiphaseSystem/diameterModels/diameterModel/diameterModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2013 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -65,9 +65,9 @@ Foam::autoPtr<Foam::diameterModel> Foam::diameterModel::New << ": " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -78,7 +78,7 @@ Foam::autoPtr<Foam::diameterModel> Foam::diameterModel::New ) << exit(FatalIOError); } - return cstrIter() + return ctorPtr ( dict.optionalSubDict(modelType + "Coeffs"), phase diff --git a/src/phaseSystemModels/multiphaseEuler/multiphaseSystem/interfacialModels/dragModels/dragModel/dragModel.C b/src/phaseSystemModels/multiphaseEuler/multiphaseSystem/interfacialModels/dragModels/dragModel/dragModel.C index 98dcc4e4269..026152379b8 100644 --- a/src/phaseSystemModels/multiphaseEuler/multiphaseSystem/interfacialModels/dragModels/dragModel/dragModel.C +++ b/src/phaseSystemModels/multiphaseEuler/multiphaseSystem/interfacialModels/dragModels/dragModel/dragModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -70,9 +70,9 @@ Foam::autoPtr<Foam::dragModel> Foam::dragModel::New << ": " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -83,7 +83,7 @@ Foam::autoPtr<Foam::dragModel> Foam::dragModel::New ) << exit(FatalIOError); } - return cstrIter()(dict, phase1, phase2); + return ctorPtr(dict, phase1, phase2); } diff --git a/src/phaseSystemModels/multiphaseEuler/multiphaseSystem/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.C b/src/phaseSystemModels/multiphaseEuler/multiphaseSystem/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.C index eafd274b280..44b8e6928d9 100644 --- a/src/phaseSystemModels/multiphaseEuler/multiphaseSystem/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.C +++ b/src/phaseSystemModels/multiphaseEuler/multiphaseSystem/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2012 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -74,9 +74,9 @@ Foam::autoPtr<Foam::heatTransferModel> Foam::heatTransferModel::New << ": " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -87,7 +87,7 @@ Foam::autoPtr<Foam::heatTransferModel> Foam::heatTransferModel::New ) << exit(FatalIOError); } - return cstrIter()(dict, alpha1, phase1, phase2); + return ctorPtr(dict, alpha1, phase1, phase2); } diff --git a/src/phaseSystemModels/multiphaseInter/phasesSystem/interfaceCompositionModel/interfaceCompositionModel.C b/src/phaseSystemModels/multiphaseInter/phasesSystem/interfaceCompositionModel/interfaceCompositionModel.C index 320a0fcc88b..aced6c86f8b 100644 --- a/src/phaseSystemModels/multiphaseInter/phasesSystem/interfaceCompositionModel/interfaceCompositionModel.C +++ b/src/phaseSystemModels/multiphaseInter/phasesSystem/interfaceCompositionModel/interfaceCompositionModel.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2017-2020 OpenCFD Ltd. + Copyright (C) 2017-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -94,9 +94,9 @@ Foam::interfaceCompositionModel::New Info<< "Selecting interfaceCompositionModel for " << pair << ": " << modelType << endl; - const auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -107,7 +107,7 @@ Foam::interfaceCompositionModel::New ) << exit(FatalIOError); } - return cstrIter()(dict, pair); + return ctorPtr(dict, pair); } diff --git a/src/phaseSystemModels/multiphaseInter/phasesSystem/interfaceModels/porousModels/porousModel/porousModel.C b/src/phaseSystemModels/multiphaseInter/phasesSystem/interfaceModels/porousModels/porousModel/porousModel.C index dc3fe364083..8a22281d472 100644 --- a/src/phaseSystemModels/multiphaseInter/phasesSystem/interfaceModels/porousModels/porousModel/porousModel.C +++ b/src/phaseSystemModels/multiphaseInter/phasesSystem/interfaceModels/porousModels/porousModel/porousModel.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2017-2020 OpenCFD Ltd. + Copyright (C) 2017-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -74,9 +74,9 @@ Foam::porousModel::New Info<< "Selecting porousModel for " << ": " << modelType << endl; - const auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -87,7 +87,7 @@ Foam::porousModel::New ) << exit(FatalIOError); } - return cstrIter()(dict, mesh); + return ctorPtr(dict, mesh); } diff --git a/src/phaseSystemModels/multiphaseInter/phasesSystem/interfaceModels/surfaceTensionModels/surfaceTensionModel/surfaceTensionModel.C b/src/phaseSystemModels/multiphaseInter/phasesSystem/interfaceModels/surfaceTensionModels/surfaceTensionModel/surfaceTensionModel.C index dc293dc08ac..9dfc6008177 100644 --- a/src/phaseSystemModels/multiphaseInter/phasesSystem/interfaceModels/surfaceTensionModels/surfaceTensionModel/surfaceTensionModel.C +++ b/src/phaseSystemModels/multiphaseInter/phasesSystem/interfaceModels/surfaceTensionModels/surfaceTensionModel/surfaceTensionModel.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2017-2020 OpenCFD Ltd. + Copyright (C) 2017-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -76,9 +76,9 @@ Foam::surfaceTensionModel::New Info<< "Selecting surfaceTensionModel for " << pair << ": " << modelType << endl; - const auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -89,7 +89,7 @@ Foam::surfaceTensionModel::New ) << exit(FatalIOError); } - return cstrIter()(dict, pair, true); + return ctorPtr(dict, pair, true); } diff --git a/src/phaseSystemModels/multiphaseInter/phasesSystem/multiphaseSystem/multiphaseSystemNew.C b/src/phaseSystemModels/multiphaseInter/phasesSystem/multiphaseSystem/multiphaseSystemNew.C index 6481e01a9d4..8535ddd031c 100644 --- a/src/phaseSystemModels/multiphaseInter/phasesSystem/multiphaseSystem/multiphaseSystemNew.C +++ b/src/phaseSystemModels/multiphaseInter/phasesSystem/multiphaseSystem/multiphaseSystemNew.C @@ -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. @@ -51,9 +51,9 @@ Foam::autoPtr<Foam::multiphaseSystem> Foam::multiphaseSystem::New Info<< "Selecting multiphaseSystem " << systemType << endl; - const auto cstrIter = dictionaryConstructorTablePtr_->cfind(systemType); + auto* ctorPtr = dictionaryConstructorTable(systemType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -64,7 +64,7 @@ Foam::autoPtr<Foam::multiphaseSystem> Foam::multiphaseSystem::New ) << exit(FatalIOError); } - return autoPtr<multiphaseSystem>(cstrIter()(mesh)); + return autoPtr<multiphaseSystem>(ctorPtr(mesh)); } diff --git a/src/phaseSystemModels/multiphaseInter/phasesSystem/phaseModel/phaseModel/phaseModel.C b/src/phaseSystemModels/multiphaseInter/phasesSystem/phaseModel/phaseModel/phaseModel.C index 4e3d0ea34d1..4bbe1e30535 100644 --- a/src/phaseSystemModels/multiphaseInter/phasesSystem/phaseModel/phaseModel/phaseModel.C +++ b/src/phaseSystemModels/multiphaseInter/phasesSystem/phaseModel/phaseModel/phaseModel.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2017-2020 OpenCFD Ltd. + Copyright (C) 2017-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -78,9 +78,9 @@ Foam::phaseModel::New Info<< "Selecting phaseModel for " << phaseName << ": " << modelType << endl; - const auto cstrIter = phaseSystemConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = phaseSystemConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -91,7 +91,7 @@ Foam::phaseModel::New ) << exit(FatalIOError); } - return cstrIter()(fluid, phaseName); + return ctorPtr(fluid, phaseName); } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/BlendedInterfacialModel/blendingMethods/blendingMethod/blendingMethod.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/BlendedInterfacialModel/blendingMethods/blendingMethod/blendingMethod.C index 0e78a9ee682..ce807a4c35a 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/BlendedInterfacialModel/blendingMethods/blendingMethod/blendingMethod.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/BlendedInterfacialModel/blendingMethods/blendingMethod/blendingMethod.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2014-2018 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -61,9 +61,9 @@ Foam::blendingMethod::New Info<< "Selecting " << modelName << " blending method: " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -74,7 +74,7 @@ Foam::blendingMethod::New ) << abort(FatalIOError); } - return cstrIter()(dict, phaseNames); + return ctorPtr(dict, phaseNames); } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/wallBoilingSubModels/CHFModels/CHFModel/CHFModel.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/wallBoilingSubModels/CHFModels/CHFModel/CHFModel.C index 186ab4e7d35..3e2d745b44f 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/wallBoilingSubModels/CHFModels/CHFModel/CHFModel.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/wallBoilingSubModels/CHFModels/CHFModel/CHFModel.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2018-2020 OpenCFD Ltd + Copyright (C) 2018-2021 OpenCFD Ltd ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -51,9 +51,9 @@ Foam::wallBoilingModels::CHFModel::New Info<< "Selecting CHFModel: " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -64,7 +64,7 @@ Foam::wallBoilingModels::CHFModel::New ) << abort(FatalIOError); } - return cstrIter()(dict); + return ctorPtr(dict); } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/wallBoilingSubModels/CHFSubCoolModels/CHFSubCoolModel/CHFSubCoolModel.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/wallBoilingSubModels/CHFSubCoolModels/CHFSubCoolModel/CHFSubCoolModel.C index 16b589d52e4..e4572905196 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/wallBoilingSubModels/CHFSubCoolModels/CHFSubCoolModel/CHFSubCoolModel.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/wallBoilingSubModels/CHFSubCoolModels/CHFSubCoolModel/CHFSubCoolModel.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2018-2020 OpenCFD Ltd + Copyright (C) 2018-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -51,9 +51,9 @@ Foam::wallBoilingModels::CHFSubCoolModel::New Info<< "Selecting CHFSubCoolModel: " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -64,7 +64,7 @@ Foam::wallBoilingModels::CHFSubCoolModel::New ) << abort(FatalIOError); } - return cstrIter()(dict); + return ctorPtr(dict); } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/wallBoilingSubModels/LeidenfrostModels/LeidenfrostModel/LeidenfrostModel.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/wallBoilingSubModels/LeidenfrostModels/LeidenfrostModel/LeidenfrostModel.C index 48f285671fe..f9135c58144 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/wallBoilingSubModels/LeidenfrostModels/LeidenfrostModel/LeidenfrostModel.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/wallBoilingSubModels/LeidenfrostModels/LeidenfrostModel/LeidenfrostModel.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2018-2020 OpenCFD Ltd + Copyright (C) 2018-2021 OpenCFD Ltd ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -51,9 +51,9 @@ Foam::wallBoilingModels::LeidenfrostModel::New Info<< "Selecting LeidenfrostModel: " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -64,7 +64,7 @@ Foam::wallBoilingModels::LeidenfrostModel::New ) << abort(FatalIOError); } - return cstrIter()(dict); + return ctorPtr(dict); } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/wallBoilingSubModels/MHFModels/MHFModel/MHFModel.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/wallBoilingSubModels/MHFModels/MHFModel/MHFModel.C index 59bf0f27d33..268109c4c81 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/wallBoilingSubModels/MHFModels/MHFModel/MHFModel.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/wallBoilingSubModels/MHFModels/MHFModel/MHFModel.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2018-2020 OpenCFD Ltd + Copyright (C) 2018-2021 OpenCFD Ltd ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -51,9 +51,9 @@ Foam::wallBoilingModels::MHFModel::New Info<< "Selecting MHFModel: " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -64,7 +64,7 @@ Foam::wallBoilingModels::MHFModel::New ) << abort(FatalIOError); } - return cstrIter()(dict); + return ctorPtr(dict); } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/wallBoilingSubModels/TDNBModels/TDNBModel/TDNBModel.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/wallBoilingSubModels/TDNBModels/TDNBModel/TDNBModel.C index de8829274e7..ac8277cb2ed 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/wallBoilingSubModels/TDNBModels/TDNBModel/TDNBModel.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/wallBoilingSubModels/TDNBModels/TDNBModel/TDNBModel.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2018-2020 OpenCFD Ltd + Copyright (C) 2018-2021 OpenCFD Ltd ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -51,9 +51,9 @@ Foam::wallBoilingModels::TDNBModel::New Info<< "Selecting TDNBModel: " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -64,7 +64,7 @@ Foam::wallBoilingModels::TDNBModel::New ) << abort(FatalIOError); } - return cstrIter()(dict); + return ctorPtr(dict); } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModel.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModel.C index 5e3a45c090e..7d2aab377d4 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModel.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2016-2019 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -52,9 +52,9 @@ Foam::wallBoilingModels::departureDiameterModel::New Info<< "Selecting departureDiameterModel: " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -65,7 +65,7 @@ Foam::wallBoilingModels::departureDiameterModel::New ) << abort(FatalIOError); } - return cstrIter()(dict); + return ctorPtr(dict); } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/departureFrequencyModel.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/departureFrequencyModel.C index b57a67a2800..70109170303 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/departureFrequencyModel.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/departureFrequencyModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2016-2019 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -52,9 +52,9 @@ Foam::wallBoilingModels::departureFrequencyModel::New Info<< "Selecting departureFrequencyModel: " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -65,7 +65,7 @@ Foam::wallBoilingModels::departureFrequencyModel::New ) << abort(FatalIOError); } - return cstrIter()(dict); + return ctorPtr(dict); } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/wallBoilingSubModels/filmBoilingModels/filmBoilingModel/filmBoilingModel.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/wallBoilingSubModels/filmBoilingModels/filmBoilingModel/filmBoilingModel.C index a52610fcf78..2ffcfea4d98 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/wallBoilingSubModels/filmBoilingModels/filmBoilingModel/filmBoilingModel.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/wallBoilingSubModels/filmBoilingModels/filmBoilingModel/filmBoilingModel.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2018-2020 OpenCFD Ltd + Copyright (C) 2018-2021 OpenCFD Ltd ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -51,9 +51,9 @@ Foam::wallBoilingModels::filmBoilingModel::New Info<< "Selecting filmBoilingModel: " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -64,7 +64,7 @@ Foam::wallBoilingModels::filmBoilingModel::New ) << abort(FatalIOError); } - return cstrIter()(dict); + return ctorPtr(dict); } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModel.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModel.C index 271add0486c..e6cf913c119 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModel.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2016-2019 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -52,9 +52,9 @@ Foam::wallBoilingModels::nucleationSiteModel::New Info<< "Selecting nucleationSiteModel: " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -65,7 +65,7 @@ Foam::wallBoilingModels::nucleationSiteModel::New ) << abort(FatalIOError); } - return cstrIter()(dict); + return ctorPtr(dict); } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/partitioningModel.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/partitioningModel.C index 363c3bb9c92..c56b69db71c 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/partitioningModel.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/partitioningModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2016-2019 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -53,9 +53,9 @@ Foam::wallBoilingModels::partitioningModel::New Info<< "Selecting partitioningModel: " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -66,7 +66,7 @@ Foam::wallBoilingModels::partitioningModel::New ) << abort(FatalIOError); } - return cstrIter()(dict); + return ctorPtr(dict); } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/diameterModels/diameterModel/diameterModel.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/diameterModels/diameterModel/diameterModel.C index 1db424aa502..02d716b849e 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/diameterModels/diameterModel/diameterModel.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/diameterModels/diameterModel/diameterModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2019 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -66,10 +66,9 @@ Foam::diameterModel::New << ": " << modelType << endl; - auto cstrIter = - dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -80,7 +79,7 @@ Foam::diameterModel::New ) << abort(FatalIOError); } - return cstrIter() + return ctorPtr ( dict.optionalSubDict(modelType + "Coeffs"), phase diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/interfaceCompositionModel.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/interfaceCompositionModel.C index a13a892f4cb..9b428109994 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/interfaceCompositionModel.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/interfaceCompositionModel.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2015-2018 OpenFOAM Foundation + Copyright (C) 2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -73,9 +74,9 @@ Foam::interfaceCompositionModel::New Info<< "Selecting interfaceCompositionModel for " << pair << ": " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -86,7 +87,7 @@ Foam::interfaceCompositionModel::New ) << abort(FatalIOError); } - return cstrIter()(dict, pair); + return ctorPtr(dict, pair); } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialCompositionModels/massTransferModels/massTransferModel/massTransferModel.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialCompositionModels/massTransferModels/massTransferModel/massTransferModel.C index 175874f5f9a..8486fd836d7 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialCompositionModels/massTransferModels/massTransferModel/massTransferModel.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialCompositionModels/massTransferModels/massTransferModel/massTransferModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2015-2018 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -68,9 +68,9 @@ Foam::massTransferModel::New Info<< "Selecting massTransferModel for " << pair << ": " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -81,7 +81,7 @@ Foam::massTransferModel::New ) << abort(FatalIOError); } - return cstrIter()(dict, pair); + return ctorPtr(dict, pair); } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialCompositionModels/saturationModels/saturationModel/saturationModel.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialCompositionModels/saturationModels/saturationModel/saturationModel.C index 4bf5636786b..a540e3fcced 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialCompositionModels/saturationModels/saturationModel/saturationModel.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialCompositionModels/saturationModels/saturationModel/saturationModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2015-2018 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -66,9 +66,9 @@ Foam::saturationModel::New Info<< "Selecting saturationModel: " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -79,7 +79,7 @@ Foam::saturationModel::New ) << abort(FatalIOError); } - return cstrIter()(dict, db); + return ctorPtr(dict, db); } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/surfaceTensionModel.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/surfaceTensionModel.C index 820af3496ba..e8c06831111 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/surfaceTensionModel.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/surfaceTensionModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2015-2018 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -79,9 +79,9 @@ Foam::surfaceTensionModel::New Info<< "Selecting surfaceTensionModel for " << pair << ": " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -92,7 +92,7 @@ Foam::surfaceTensionModel::New ) << abort(FatalIOError); } - return cstrIter()(dict, pair, true); + return ctorPtr(dict, pair, true); } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialModels/aspectRatioModels/aspectRatioModel/aspectRatioModel.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialModels/aspectRatioModels/aspectRatioModel/aspectRatioModel.C index 044acc247dc..7eb974d5f7b 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialModels/aspectRatioModels/aspectRatioModel/aspectRatioModel.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialModels/aspectRatioModels/aspectRatioModel/aspectRatioModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2014-2018 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -64,9 +64,9 @@ Foam::aspectRatioModel::New Info<< "Selecting aspectRatioModel for " << pair << ": " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -77,7 +77,7 @@ Foam::aspectRatioModel::New ) << abort(FatalIOError); } - return cstrIter()(dict, pair); + return ctorPtr(dict, pair); } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialModels/dragModels/dragModel/dragModel.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialModels/dragModels/dragModel/dragModel.C index 27fe7cad543..27eaf3b0d9a 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialModels/dragModels/dragModel/dragModel.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialModels/dragModels/dragModel/dragModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2018 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -113,9 +113,9 @@ Foam::dragModel::New Info<< "Selecting dragModel for " << pair << ": " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -126,7 +126,7 @@ Foam::dragModel::New ) << abort(FatalIOError); } - return cstrIter()(dict, pair, true); + return ctorPtr(dict, pair, true); } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.C index 6e883c83f59..4dfa443d59c 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2018 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -79,9 +79,9 @@ Foam::heatTransferModel::New Info<< "Selecting heatTransferModel for " << pair << ": " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -92,7 +92,7 @@ Foam::heatTransferModel::New ) << abort(FatalIOError); } - return cstrIter()(dict, pair); + return ctorPtr(dict, pair); } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialModels/liftModels/liftModel/liftModel.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialModels/liftModels/liftModel/liftModel.C index ba837f3ce9d..dd275ac18a7 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialModels/liftModels/liftModel/liftModel.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialModels/liftModels/liftModel/liftModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2014-2018 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::liftModel::New Info<< "Selecting liftModel for " << pair << ": " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -84,7 +84,7 @@ Foam::liftModel::New ) << abort(FatalIOError); } - return cstrIter()(dict, pair); + return ctorPtr(dict, pair); } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialModels/phaseTransferModels/phaseTransferModel/phaseTransferModel.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialModels/phaseTransferModels/phaseTransferModel/phaseTransferModel.C index 8adad768326..0dceccfc0d3 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialModels/phaseTransferModels/phaseTransferModel/phaseTransferModel.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialModels/phaseTransferModels/phaseTransferModel/phaseTransferModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2018 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -69,9 +69,9 @@ Foam::phaseTransferModel::New Info<< "Selecting phaseTransferModel for " << pair << ": " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -82,7 +82,7 @@ Foam::phaseTransferModel::New ) << abort(FatalIOError); } - return cstrIter()(dict, pair); + return ctorPtr(dict, pair); } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialModels/swarmCorrections/swarmCorrection/swarmCorrection.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialModels/swarmCorrections/swarmCorrection/swarmCorrection.C index b27085ba023..490e7d68bb6 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialModels/swarmCorrections/swarmCorrection/swarmCorrection.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialModels/swarmCorrections/swarmCorrection/swarmCorrection.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2014-2018 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -64,9 +64,9 @@ Foam::swarmCorrection::New Info<< "Selecting swarmCorrection for " << pair << ": " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -77,7 +77,7 @@ Foam::swarmCorrection::New ) << abort(FatalIOError); } - return cstrIter()(dict, pair); + return ctorPtr(dict, pair); } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.C index fdbf94e100f..dbd9b38247b 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2014-2018 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -73,9 +73,9 @@ Foam::turbulentDispersionModel::New Info<< "Selecting turbulentDispersionModel for " << pair << ": " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -86,7 +86,7 @@ Foam::turbulentDispersionModel::New ) << abort(FatalIOError); } - return cstrIter()(dict, pair); + return ctorPtr(dict, pair); } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialModels/virtualMassModels/virtualMassModel/virtualMassModel.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialModels/virtualMassModels/virtualMassModel/virtualMassModel.C index 660f3811b1c..aeccb73157f 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialModels/virtualMassModels/virtualMassModel/virtualMassModel.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialModels/virtualMassModels/virtualMassModel/virtualMassModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2014-2018 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -82,9 +82,9 @@ Foam::virtualMassModel::New Info<< "Selecting virtualMassModel for " << pair << ": " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -95,7 +95,7 @@ Foam::virtualMassModel::New ) << abort(FatalIOError); } - return cstrIter()(dict, pair, true); + return ctorPtr(dict, pair, true); } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialModels/wallDampingModels/wallDampingModel/wallDampingModel.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialModels/wallDampingModels/wallDampingModel/wallDampingModel.C index 7a5b35cfb72..0b057d83343 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialModels/wallDampingModels/wallDampingModel/wallDampingModel.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialModels/wallDampingModels/wallDampingModel/wallDampingModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2015-2018 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -67,9 +67,9 @@ Foam::wallDampingModel::New Info<< "Selecting wallDampingModel for " << pair << ": " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -80,7 +80,7 @@ Foam::wallDampingModel::New ) << abort(FatalIOError); } - return cstrIter()(dict, pair); + return ctorPtr(dict, pair); } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.C index 4374e749d24..c8f7622dc20 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2014-2018 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -97,9 +97,9 @@ Foam::wallLubricationModel::New Info<< "Selecting wallLubricationModel for " << pair << ": " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -110,7 +110,7 @@ Foam::wallLubricationModel::New ) << abort(FatalIOError); } - return cstrIter()(dict, pair); + return ctorPtr(dict, pair); } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/multiphaseSystem/multiphaseSystemNew.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/multiphaseSystem/multiphaseSystemNew.C index c2ebebe5ba9..3baa96c41ad 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/multiphaseSystem/multiphaseSystemNew.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/multiphaseSystem/multiphaseSystemNew.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2015-2018 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::multiphaseSystem> Foam::multiphaseSystem::New Info<< "Selecting multiphaseSystem " << systemType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(systemType); + auto* ctorPtr = dictionaryConstructorTable(systemType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -65,7 +65,7 @@ Foam::autoPtr<Foam::multiphaseSystem> Foam::multiphaseSystem::New ) << exit(FatalIOError); } - return cstrIter()(mesh); + return ctorPtr(mesh); } // ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/phaseModel/phaseModel/phaseModel.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/phaseModel/phaseModel/phaseModel.C index 8773b2cc9e6..9cb69181e48 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/phaseModel/phaseModel/phaseModel.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/phaseModel/phaseModel/phaseModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2015-2019 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -102,9 +102,9 @@ Foam::phaseModel::New Info<< "Selecting phaseModel for " << phaseName << ": " << modelType << endl; - auto cstrIter = phaseSystemConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = phaseSystemConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -115,7 +115,7 @@ Foam::phaseModel::New ) << abort(FatalIOError); } - return cstrIter()(fluid, phaseName, index); + return ctorPtr(fluid, phaseName, index); } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/populationBalanceModel/binaryBreakupModels/binaryBreakupModel/binaryBreakupModel.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/populationBalanceModel/binaryBreakupModels/binaryBreakupModel/binaryBreakupModel.C index 36fb59f603d..16402433fe9 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/populationBalanceModel/binaryBreakupModels/binaryBreakupModel/binaryBreakupModel.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/populationBalanceModel/binaryBreakupModels/binaryBreakupModel/binaryBreakupModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2017-2018 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::diameterModels::binaryBreakupModel::New const dictionary& dict ) { - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -63,7 +63,7 @@ Foam::diameterModels::binaryBreakupModel::New ) << abort(FatalIOError); } - return autoPtr<binaryBreakupModel>(cstrIter()(popBal, dict)); + return autoPtr<binaryBreakupModel>(ctorPtr(popBal, dict)); } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/populationBalanceModel/breakupModels/breakupModel/breakupModel.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/populationBalanceModel/breakupModels/breakupModel/breakupModel.C index 98f0df2cc13..a06980b7a8e 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/populationBalanceModel/breakupModels/breakupModel/breakupModel.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/populationBalanceModel/breakupModels/breakupModel/breakupModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2017-2018 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::diameterModels::breakupModel::New const dictionary& dict ) { - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -63,7 +63,7 @@ Foam::diameterModels::breakupModel::New ) << abort(FatalIOError); } - return autoPtr<breakupModel>(cstrIter()(popBal, dict)); + return autoPtr<breakupModel>(ctorPtr(popBal, dict)); } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/populationBalanceModel/coalescenceModels/coalescenceModel/coalescenceModel.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/populationBalanceModel/coalescenceModels/coalescenceModel/coalescenceModel.C index 0642c0ff2a2..069eb6b19ed 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/populationBalanceModel/coalescenceModels/coalescenceModel/coalescenceModel.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/populationBalanceModel/coalescenceModels/coalescenceModel/coalescenceModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2017-2018 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::diameterModels::coalescenceModel::New const dictionary& dict ) { - auto cstrIter = dictionaryConstructorTablePtr_->cfind(type); + auto* ctorPtr = dictionaryConstructorTable(type); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -63,7 +63,7 @@ Foam::diameterModels::coalescenceModel::New ) << exit(FatalIOError); } - return autoPtr<coalescenceModel>(cstrIter()(popBal, dict)); + return autoPtr<coalescenceModel>(ctorPtr(popBal, dict)); } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/populationBalanceModel/daughterSizeDistributionModels/daughterSizeDistributionModel/daughterSizeDistributionModel.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/populationBalanceModel/daughterSizeDistributionModels/daughterSizeDistributionModel/daughterSizeDistributionModel.C index a341bd68497..ae986a95429 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/populationBalanceModel/daughterSizeDistributionModels/daughterSizeDistributionModel/daughterSizeDistributionModel.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/populationBalanceModel/daughterSizeDistributionModels/daughterSizeDistributionModel/daughterSizeDistributionModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2017-2018 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -55,9 +55,9 @@ Foam::diameterModels::daughterSizeDistributionModel::New dict.get<word>("daughterSizeDistributionModel") ); - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -68,7 +68,7 @@ Foam::diameterModels::daughterSizeDistributionModel::New ) << exit(FatalIOError); } - return cstrIter()(breakup, dict); + return ctorPtr(breakup, dict); } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/populationBalanceModel/driftModels/driftModel/driftModel.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/populationBalanceModel/driftModels/driftModel/driftModel.C index a01030ba4f1..98e775c0146 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/populationBalanceModel/driftModels/driftModel/driftModel.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/populationBalanceModel/driftModels/driftModel/driftModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2017-2018 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -51,9 +51,9 @@ Foam::diameterModels::driftModel::New const dictionary& dict ) { - auto cstrIter = dictionaryConstructorTablePtr_->cfind(type); + auto* ctorPtr = dictionaryConstructorTable(type); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -64,7 +64,7 @@ Foam::diameterModels::driftModel::New ) << exit(FatalIOError); } - return autoPtr<driftModel>(cstrIter()(popBal, dict)); + return autoPtr<driftModel>(ctorPtr(popBal, dict)); } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/populationBalanceModel/nucleationModels/nucleationModel/nucleationModel.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/populationBalanceModel/nucleationModels/nucleationModel/nucleationModel.C index 9a8c2c81528..d36d90d34d8 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/populationBalanceModel/nucleationModels/nucleationModel/nucleationModel.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/populationBalanceModel/nucleationModels/nucleationModel/nucleationModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2018 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -51,9 +51,9 @@ Foam::diameterModels::nucleationModel::New const dictionary& dict ) { - auto cstrIter = dictionaryConstructorTablePtr_->cfind(type); + auto* ctorPtr = dictionaryConstructorTable(type); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -64,7 +64,7 @@ Foam::diameterModels::nucleationModel::New ) << exit(FatalIOError); } - return autoPtr<nucleationModel>(cstrIter()(popBal, dict)); + return autoPtr<nucleationModel>(ctorPtr(popBal, dict)); } diff --git a/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModel.C b/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModel.C index ed74dd2f582..d0121826f31 100644 --- a/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModel.C +++ b/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2018 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -63,9 +63,9 @@ Foam::kineticTheoryModels::conductivityModel::New Info<< "Selecting conductivityModel " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -76,7 +76,7 @@ Foam::kineticTheoryModels::conductivityModel::New ) << abort(FatalIOError); } - return autoPtr<conductivityModel>(cstrIter()(dict)); + return autoPtr<conductivityModel>(ctorPtr(dict)); } diff --git a/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModel.C b/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModel.C index 3765dc3a38c..41681fae71d 100644 --- a/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModel.C +++ b/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2018 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -63,9 +63,9 @@ Foam::kineticTheoryModels::frictionalStressModel::New Info<< "Selecting frictionalStressModel " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -76,7 +76,7 @@ Foam::kineticTheoryModels::frictionalStressModel::New ) << abort(FatalIOError); } - return autoPtr<frictionalStressModel>(cstrIter()(dict)); + return autoPtr<frictionalStressModel>(ctorPtr(dict)); } diff --git a/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModel.C b/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModel.C index 982ce455bec..3714dde3a23 100644 --- a/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModel.C +++ b/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2018 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -64,9 +64,9 @@ Foam::kineticTheoryModels::granularPressureModel::New Info<< "Selecting granularPressureModel " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -77,7 +77,7 @@ Foam::kineticTheoryModels::granularPressureModel::New ) << abort(FatalIOError); } - return autoPtr<granularPressureModel>(cstrIter()(dict)); + return autoPtr<granularPressureModel>(ctorPtr(dict)); } diff --git a/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/radialModel.C b/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/radialModel.C index 829e404d984..714167849b0 100644 --- a/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/radialModel.C +++ b/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/radialModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2018 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -63,9 +63,9 @@ Foam::kineticTheoryModels::radialModel::New Info<< "Selecting radialModel " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -76,7 +76,7 @@ Foam::kineticTheoryModels::radialModel::New ) << abort(FatalIOError); } - return autoPtr<radialModel>(cstrIter()(dict)); + return autoPtr<radialModel>(ctorPtr(dict)); } diff --git a/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModel.C b/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModel.C index f210716a1f1..339ab1331dc 100644 --- a/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModel.C +++ b/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2018 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -63,9 +63,9 @@ Foam::kineticTheoryModels::viscosityModel::New Info<< "Selecting viscosityModel " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -76,7 +76,7 @@ Foam::kineticTheoryModels::viscosityModel::New ) << abort(FatalIOError); } - return autoPtr<viscosityModel>(cstrIter()(dict)); + return autoPtr<viscosityModel>(ctorPtr(dict)); } diff --git a/src/phaseSystemModels/reactingEuler/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.C b/src/phaseSystemModels/reactingEuler/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.C index 133c27b7807..cdb0561a4d6 100644 --- a/src/phaseSystemModels/reactingEuler/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.C +++ b/src/phaseSystemModels/reactingEuler/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2018 OpenFOAM Foundation - Copyright (C) 2018-2019 OpenCFD Ltd. + Copyright (C) 2018-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -53,9 +53,9 @@ Foam::diameterModels::IATEsource::New const dictionary& dict ) { - auto cstrIter = dictionaryConstructorTablePtr_->cfind(type); + auto* ctorPtr = dictionaryConstructorTable(type); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -66,7 +66,7 @@ Foam::diameterModels::IATEsource::New ) << exit(FatalIOError); } - return autoPtr<IATEsource>(cstrIter()(iate, dict)); + return autoPtr<IATEsource>(ctorPtr(iate, dict)); } diff --git a/src/phaseSystemModels/reactingEuler/twoPhaseSystem/twoPhaseSystemNew.C b/src/phaseSystemModels/reactingEuler/twoPhaseSystem/twoPhaseSystemNew.C index 776c25741c9..a5a759abf3d 100644 --- a/src/phaseSystemModels/reactingEuler/twoPhaseSystem/twoPhaseSystemNew.C +++ b/src/phaseSystemModels/reactingEuler/twoPhaseSystem/twoPhaseSystemNew.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2015-2018 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -53,9 +53,9 @@ Foam::twoPhaseSystem::New Info<< "Selecting twoPhaseSystem " << systemType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(systemType); + auto* ctorPtr = dictionaryConstructorTable(systemType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -66,7 +66,7 @@ Foam::twoPhaseSystem::New ) << exit(FatalIOError); } - return cstrIter()(mesh); + return ctorPtr(mesh); } // ************************************************************************* // diff --git a/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModel.C b/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModel.C index c3f3c0b467a..53fe02cb4df 100644 --- a/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModel.C +++ b/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModel.C @@ -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. @@ -64,9 +64,9 @@ Foam::kineticTheoryModels::conductivityModel::New Info<< "Selecting conductivityModel " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -77,7 +77,7 @@ Foam::kineticTheoryModels::conductivityModel::New ) << exit(FatalIOError); } - return autoPtr<conductivityModel>(cstrIter()(dict)); + return autoPtr<conductivityModel>(ctorPtr(dict)); } diff --git a/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModel.C b/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModel.C index e443ebda142..553af9553e8 100644 --- a/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModel.C +++ b/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModel.C @@ -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. @@ -64,9 +64,9 @@ Foam::kineticTheoryModels::frictionalStressModel::New Info<< "Selecting frictionalStressModel " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -77,7 +77,7 @@ Foam::kineticTheoryModels::frictionalStressModel::New ) << exit(FatalIOError); } - return autoPtr<frictionalStressModel>(cstrIter()(dict)); + return autoPtr<frictionalStressModel>(ctorPtr(dict)); } diff --git a/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModel.C b/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModel.C index 2ace80c165f..b4eefd3fe6c 100644 --- a/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModel.C +++ b/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModel.C @@ -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. @@ -64,9 +64,9 @@ Foam::kineticTheoryModels::granularPressureModel::New Info<< "Selecting granularPressureModel " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -77,7 +77,7 @@ Foam::kineticTheoryModels::granularPressureModel::New ) << exit(FatalIOError); } - return autoPtr<granularPressureModel>(cstrIter()(dict)); + return autoPtr<granularPressureModel>(ctorPtr(dict)); } diff --git a/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/radialModel.C b/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/radialModel.C index af48bfd9095..756e1cd5dec 100644 --- a/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/radialModel.C +++ b/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/radialModel.C @@ -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. @@ -64,9 +64,9 @@ Foam::kineticTheoryModels::radialModel::New Info<< "Selecting radialModel " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -77,7 +77,7 @@ Foam::kineticTheoryModels::radialModel::New ) << exit(FatalIOError); } - return autoPtr<radialModel>(cstrIter()(dict)); + return autoPtr<radialModel>(ctorPtr(dict)); } diff --git a/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModel.C b/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModel.C index abac1de23d5..304108524b2 100644 --- a/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModel.C +++ b/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModel.C @@ -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. @@ -63,9 +63,9 @@ Foam::kineticTheoryModels::viscosityModel::New Info<< "Selecting viscosityModel " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -76,7 +76,7 @@ Foam::kineticTheoryModels::viscosityModel::New ) << exit(FatalIOError); } - return autoPtr<viscosityModel>(cstrIter()(dict)); + return autoPtr<viscosityModel>(ctorPtr(dict)); } diff --git a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/blendingMethod/blendingMethod.C b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/blendingMethod/blendingMethod.C index ebcac853ed0..bfc787c3761 100644 --- a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/blendingMethod/blendingMethod.C +++ b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/blendingMethod/blendingMethod.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2014 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -60,9 +60,9 @@ Foam::blendingMethod::New Info<< "Selecting " << dict.dictName() << " blending method: " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -73,7 +73,7 @@ Foam::blendingMethod::New ) << exit(FatalIOError); } - return cstrIter()(dict, phaseNames); + return ctorPtr(dict, phaseNames); } diff --git a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.C b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.C index 7dcfef0d8b7..943e66153c5 100644 --- a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.C +++ b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2015 OpenFOAM Foundation - Copyright (C) 2018-2019 OpenCFD Ltd. + Copyright (C) 2018-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -54,9 +54,9 @@ Foam::diameterModels::IATEsource::New const dictionary& dict ) { - auto cstrIter = dictionaryConstructorTablePtr_->cfind(type); + auto* ctorPtr = dictionaryConstructorTable(type); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -67,7 +67,7 @@ Foam::diameterModels::IATEsource::New ) << exit(FatalIOError); } - return autoPtr<IATEsource>(cstrIter()(iate, dict)); + return autoPtr<IATEsource>(ctorPtr(iate, dict)); } diff --git a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/diameterModels/diameterModel/diameterModel.C b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/diameterModels/diameterModel/diameterModel.C index 86ae26aed0d..69a5aea3bdb 100644 --- a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/diameterModels/diameterModel/diameterModel.C +++ b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/diameterModels/diameterModel/diameterModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -66,9 +66,9 @@ Foam::diameterModel::New << ": " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -79,7 +79,7 @@ Foam::diameterModel::New ) << exit(FatalIOError); } - return cstrIter() + return ctorPtr ( dict.optionalSubDict(modelType + "Coeffs"), phase diff --git a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/aspectRatioModels/aspectRatioModel/aspectRatioModel.C b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/aspectRatioModels/aspectRatioModel/aspectRatioModel.C index 5119a1c06c1..37d73220bf5 100644 --- a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/aspectRatioModels/aspectRatioModel/aspectRatioModel.C +++ b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/aspectRatioModels/aspectRatioModel/aspectRatioModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2014-2015 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -64,9 +64,9 @@ Foam::aspectRatioModel::New Info<< "Selecting aspectRatioModel for " << pair << ": " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -77,7 +77,7 @@ Foam::aspectRatioModel::New ) << exit(FatalIOError); } - return cstrIter()(dict, pair); + return ctorPtr(dict, pair); } diff --git a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/dragModels/dragModel/dragModel.C b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/dragModels/dragModel/dragModel.C index 76c29e4388b..1d98c2e9c6b 100644 --- a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/dragModels/dragModel/dragModel.C +++ b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/dragModels/dragModel/dragModel.C @@ -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. @@ -111,9 +111,9 @@ Foam::dragModel::New Info<< "Selecting dragModel for " << pair << ": " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -124,7 +124,7 @@ Foam::dragModel::New ) << exit(FatalIOError); } - return cstrIter()(dict, pair, true); + return ctorPtr(dict, pair, true); } diff --git a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.C b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.C index ea01a38f4d4..de6a5408bb7 100644 --- a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.C +++ b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.C @@ -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. @@ -73,9 +73,9 @@ Foam::heatTransferModel::New Info<< "Selecting heatTransferModel for " << pair << ": " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -86,7 +86,7 @@ Foam::heatTransferModel::New ) << exit(FatalIOError); } - return cstrIter()(dict, pair); + return ctorPtr(dict, pair); } diff --git a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/liftModels/liftModel/liftModel.C b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/liftModels/liftModel/liftModel.C index 348b7ce3f76..dec06b3e50a 100644 --- a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/liftModels/liftModel/liftModel.C +++ b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/liftModels/liftModel/liftModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2014-2016 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -69,9 +69,9 @@ Foam::liftModel::New Info<< "Selecting liftModel for " << pair << ": " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -82,7 +82,7 @@ Foam::liftModel::New ) << exit(FatalIOError); } - return cstrIter()(dict, pair); + return ctorPtr(dict, pair); } diff --git a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/swarmCorrections/swarmCorrection/swarmCorrection.C b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/swarmCorrections/swarmCorrection/swarmCorrection.C index 884ddbf0eb3..dc71b45a078 100644 --- a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/swarmCorrections/swarmCorrection/swarmCorrection.C +++ b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/swarmCorrections/swarmCorrection/swarmCorrection.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2014 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -64,9 +64,9 @@ Foam::swarmCorrection::New Info<< "Selecting swarmCorrection for " << pair << ": " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -77,7 +77,7 @@ Foam::swarmCorrection::New ) << exit(FatalIOError); } - return cstrIter()(dict, pair); + return ctorPtr(dict, pair); } diff --git a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.C b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.C index a281363b044..de9f0cce223 100644 --- a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.C +++ b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2014-2015 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -68,9 +68,9 @@ Foam::turbulentDispersionModel::New Info<< "Selecting turbulentDispersionModel for " << pair << ": " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -81,7 +81,7 @@ Foam::turbulentDispersionModel::New ) << exit(FatalIOError); } - return cstrIter()(dict, pair); + return ctorPtr(dict, pair); } diff --git a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/virtualMassModels/virtualMassModel/virtualMassModel.C b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/virtualMassModels/virtualMassModel/virtualMassModel.C index 1486d8a7d22..d13e1502fcd 100644 --- a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/virtualMassModels/virtualMassModel/virtualMassModel.C +++ b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/virtualMassModels/virtualMassModel/virtualMassModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2014-2015 OpenFOAM Foundation - Copyright (C) 2020 OpenCFD Ltd. + Copyright (C) 2020-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -80,9 +80,9 @@ Foam::virtualMassModel::New Info<< "Selecting virtualMassModel for " << pair << ": " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -93,7 +93,7 @@ Foam::virtualMassModel::New ) << exit(FatalIOError); } - return cstrIter()(dict, pair, true); + return ctorPtr(dict, pair, true); } diff --git a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.C b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.C index 9aed2d28b20..4b6cdb6d5f9 100644 --- a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.C +++ b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2014-2016 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -69,9 +69,9 @@ Foam::wallLubricationModel::New Info<< "Selecting wallLubricationModel for " << pair << ": " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -82,7 +82,7 @@ Foam::wallLubricationModel::New ) << exit(FatalIOError); } - return cstrIter()(dict, pair); + return ctorPtr(dict, pair); } diff --git a/src/randomProcesses/noise/noiseModels/noiseModel/noiseModelNew.C b/src/randomProcesses/noise/noiseModels/noiseModel/noiseModelNew.C index aae106dd51b..b5188b59a8e 100644 --- a/src/randomProcesses/noise/noiseModels/noiseModel/noiseModelNew.C +++ b/src/randomProcesses/noise/noiseModels/noiseModel/noiseModelNew.C @@ -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. @@ -35,9 +35,9 @@ Foam::autoPtr<Foam::noiseModel> Foam::noiseModel::New(const dictionary& dict) Info<< "Selecting noiseModel " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -48,7 +48,7 @@ Foam::autoPtr<Foam::noiseModel> Foam::noiseModel::New(const dictionary& dict) ) << exit(FatalIOError); } - return autoPtr<noiseModel>(cstrIter()(dict.subDict(modelType + "Coeffs"))); + return autoPtr<noiseModel>(ctorPtr(dict.subDict(modelType + "Coeffs"))); } diff --git a/src/randomProcesses/windowModels/windowModel/windowModelNew.C b/src/randomProcesses/windowModels/windowModel/windowModelNew.C index b5613f83927..9e85a6951bb 100644 --- a/src/randomProcesses/windowModels/windowModel/windowModelNew.C +++ b/src/randomProcesses/windowModels/windowModel/windowModelNew.C @@ -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. @@ -39,9 +39,9 @@ Foam::autoPtr<Foam::windowModel> Foam::windowModel::New Info<< "Selecting windowModel " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -54,7 +54,7 @@ Foam::autoPtr<Foam::windowModel> Foam::windowModel::New return autoPtr<windowModel> ( - cstrIter()(dict.subDict(modelType + "Coeffs"), nSamples) + ctorPtr(dict.subDict(modelType + "Coeffs"), nSamples) ); } diff --git a/src/regionFaModels/liquidFilm/liquidFilmBaseNew.C b/src/regionFaModels/liquidFilm/liquidFilmBaseNew.C index 738345c437b..4949232ad31 100644 --- a/src/regionFaModels/liquidFilm/liquidFilmBaseNew.C +++ b/src/regionFaModels/liquidFilm/liquidFilmBaseNew.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2020 OpenCFD Ltd. + Copyright (C) 2020-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -44,21 +44,22 @@ autoPtr<liquidFilmBase> liquidFilmBase::New const dictionary& dict ) { - word modelType = dict.get<word>("liquidFilmModel"); + const word modelType = dict.get<word>("liquidFilmModel"); - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { - FatalErrorInFunction - << "Unknown liquidFilmBase type " - << modelType << nl << nl - << "Valid liquidFilmBase types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalIOErrorInLookup + ( + dict, + "liquidFilmModel", + modelType, + *dictionaryConstructorTablePtr_ + ) << exit(FatalIOError); } - return autoPtr<liquidFilmBase>(cstrIter()(modelType, p, dict)); + return autoPtr<liquidFilmBase>(ctorPtr(modelType, p, dict)); } diff --git a/src/regionFaModels/liquidFilm/subModels/kinematic/filmTurbulenceModel/filmTurbulenceModel/filmTurbulenceModelNew.C b/src/regionFaModels/liquidFilm/subModels/kinematic/filmTurbulenceModel/filmTurbulenceModel/filmTurbulenceModelNew.C index 446e59250ab..4f147b995a2 100644 --- a/src/regionFaModels/liquidFilm/subModels/kinematic/filmTurbulenceModel/filmTurbulenceModel/filmTurbulenceModelNew.C +++ b/src/regionFaModels/liquidFilm/subModels/kinematic/filmTurbulenceModel/filmTurbulenceModel/filmTurbulenceModelNew.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2020 OpenCFD Ltd. + Copyright (C) 2020-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -48,9 +48,9 @@ autoPtr<filmTurbulenceModel> filmTurbulenceModel::New Info<< " Selecting filmTurbulenceModel " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -61,7 +61,7 @@ autoPtr<filmTurbulenceModel> filmTurbulenceModel::New ) << exit(FatalIOError); } - return autoPtr<filmTurbulenceModel>(cstrIter()(model, dict)); + return autoPtr<filmTurbulenceModel>(ctorPtr(model, dict)); } diff --git a/src/regionFaModels/liquidFilm/subModels/kinematic/force/force/forceNew.C b/src/regionFaModels/liquidFilm/subModels/kinematic/force/force/forceNew.C index 8a90e47ee83..263ca150ca4 100644 --- a/src/regionFaModels/liquidFilm/subModels/kinematic/force/force/forceNew.C +++ b/src/regionFaModels/liquidFilm/subModels/kinematic/force/force/forceNew.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2020 OpenCFD Ltd. + Copyright (C) 2020-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -47,9 +47,9 @@ autoPtr<force> force::New { Info<< " " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -60,7 +60,7 @@ autoPtr<force> force::New ) << exit(FatalIOError); } - return autoPtr<force>(cstrIter()(model, dict)); + return autoPtr<force>(ctorPtr(model, dict)); } diff --git a/src/regionFaModels/liquidFilm/subModels/kinematic/injectionModel/injectionModel/injectionModelNew.C b/src/regionFaModels/liquidFilm/subModels/kinematic/injectionModel/injectionModel/injectionModelNew.C index e4497446937..49673f0cfdb 100644 --- a/src/regionFaModels/liquidFilm/subModels/kinematic/injectionModel/injectionModel/injectionModelNew.C +++ b/src/regionFaModels/liquidFilm/subModels/kinematic/injectionModel/injectionModel/injectionModelNew.C @@ -47,9 +47,9 @@ autoPtr<injectionModel> injectionModel::New { Info<< " " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -60,7 +60,7 @@ autoPtr<injectionModel> injectionModel::New ) << exit(FatalIOError); } - return autoPtr<injectionModel>(cstrIter()(model, dict)); + return autoPtr<injectionModel>(ctorPtr(model, dict)); } diff --git a/src/regionFaModels/thermalShellModel/thermalShellModelNew.C b/src/regionFaModels/thermalShellModel/thermalShellModelNew.C index 71848973d93..29712839e5f 100644 --- a/src/regionFaModels/thermalShellModel/thermalShellModelNew.C +++ b/src/regionFaModels/thermalShellModel/thermalShellModelNew.C @@ -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. @@ -45,9 +45,9 @@ autoPtr<thermalShellModel> thermalShellModel::New const word modelType = dict.getOrDefault<word>("thermalShellModel", "thermalShell"); - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInFunction << "Unknown thermalShellModel type " @@ -57,7 +57,7 @@ autoPtr<thermalShellModel> thermalShellModel::New << exit(FatalError); } - return autoPtr<thermalShellModel>(cstrIter()(modelType, p, dict)); + return autoPtr<thermalShellModel>(ctorPtr(modelType, p, dict)); } diff --git a/src/regionFaModels/vibrationShellModel/vibrationShellModelNew.C b/src/regionFaModels/vibrationShellModel/vibrationShellModelNew.C index 01234e34511..c914ef7e7c6 100644 --- a/src/regionFaModels/vibrationShellModel/vibrationShellModelNew.C +++ b/src/regionFaModels/vibrationShellModel/vibrationShellModelNew.C @@ -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. @@ -44,9 +44,9 @@ autoPtr<vibrationShellModel> vibrationShellModel::New { const word modelType = dict.get<word>("vibrationShellModel"); - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInFunction << "Unknown vibrationShellModel type " @@ -56,7 +56,7 @@ autoPtr<vibrationShellModel> vibrationShellModel::New << exit(FatalError); } - return autoPtr<vibrationShellModel>(cstrIter()(modelType, p, dict)); + return autoPtr<vibrationShellModel>(ctorPtr(modelType, p, dict)); } diff --git a/src/regionModels/pyrolysisModels/pyrolysisModel/pyrolysisModelNew.C b/src/regionModels/pyrolysisModels/pyrolysisModel/pyrolysisModelNew.C index f3f802d4b44..2becf98f139 100644 --- a/src/regionModels/pyrolysisModels/pyrolysisModel/pyrolysisModelNew.C +++ b/src/regionModels/pyrolysisModels/pyrolysisModel/pyrolysisModelNew.C @@ -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. @@ -64,9 +64,9 @@ autoPtr<pyrolysisModel> pyrolysisModel::New Info<< "Selecting pyrolysisModel " << modelType << endl; - auto cstrIter = meshConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = meshConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -77,7 +77,7 @@ autoPtr<pyrolysisModel> pyrolysisModel::New ) << exit(FatalIOError); } - return autoPtr<pyrolysisModel>(cstrIter()(modelType, mesh, regionType)); + return autoPtr<pyrolysisModel>(ctorPtr(modelType, mesh, regionType)); } @@ -93,9 +93,9 @@ autoPtr<pyrolysisModel> pyrolysisModel::New Info<< "Selecting pyrolysisModel " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -108,7 +108,7 @@ autoPtr<pyrolysisModel> pyrolysisModel::New return autoPtr<pyrolysisModel> ( - cstrIter() + ctorPtr ( modelType, mesh, diff --git a/src/regionModels/regionModel/regionModelFunctionObject/regionModelFunctionObject/regionModelFunctionObjectNew.C b/src/regionModels/regionModel/regionModelFunctionObject/regionModelFunctionObject/regionModelFunctionObjectNew.C index fbe3c035afd..9e76f5bbff9 100644 --- a/src/regionModels/regionModel/regionModelFunctionObject/regionModelFunctionObject/regionModelFunctionObjectNew.C +++ b/src/regionModels/regionModel/regionModelFunctionObject/regionModelFunctionObject/regionModelFunctionObjectNew.C @@ -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. @@ -42,9 +42,9 @@ Foam::regionModels::regionModelFunctionObject::New Info<< " " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -58,7 +58,7 @@ Foam::regionModels::regionModelFunctionObject::New return autoPtr<regionModelFunctionObject> ( - cstrIter() + ctorPtr ( dict.subDict(modelName), region diff --git a/src/regionModels/surfaceFilmModels/submodels/kinematic/filmThermoModel/filmThermoModel/filmThermoModelNew.C b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmThermoModel/filmThermoModel/filmThermoModelNew.C index 989e5a63676..3e0cc8b8195 100644 --- a/src/regionModels/surfaceFilmModels/submodels/kinematic/filmThermoModel/filmThermoModel/filmThermoModelNew.C +++ b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmThermoModel/filmThermoModel/filmThermoModelNew.C @@ -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. @@ -49,10 +49,9 @@ autoPtr<filmThermoModel> filmThermoModel::New Info<< " Selecting filmThermoModel " << modelType << endl; - auto cstrIter = - dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -63,7 +62,7 @@ autoPtr<filmThermoModel> filmThermoModel::New ) << exit(FatalIOError); } - return autoPtr<filmThermoModel>(cstrIter()(model, dict)); + return autoPtr<filmThermoModel>(ctorPtr(model, dict)); } diff --git a/src/regionModels/surfaceFilmModels/submodels/kinematic/filmTurbulenceModel/filmTurbulenceModel/filmTurbulenceModelNew.C b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmTurbulenceModel/filmTurbulenceModel/filmTurbulenceModelNew.C index 598cae824e8..79117ee73f7 100644 --- a/src/regionModels/surfaceFilmModels/submodels/kinematic/filmTurbulenceModel/filmTurbulenceModel/filmTurbulenceModelNew.C +++ b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmTurbulenceModel/filmTurbulenceModel/filmTurbulenceModelNew.C @@ -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. @@ -49,9 +49,9 @@ autoPtr<filmTurbulenceModel> filmTurbulenceModel::New Info<< " Selecting filmTurbulenceModel " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -62,7 +62,7 @@ autoPtr<filmTurbulenceModel> filmTurbulenceModel::New ) << exit(FatalIOError); } - return autoPtr<filmTurbulenceModel>(cstrIter()(model, dict)); + return autoPtr<filmTurbulenceModel>(ctorPtr(model, dict)); } diff --git a/src/regionModels/surfaceFilmModels/submodels/kinematic/force/force/forceNew.C b/src/regionModels/surfaceFilmModels/submodels/kinematic/force/force/forceNew.C index c2fa76b579f..6f99ecb8e08 100644 --- a/src/regionModels/surfaceFilmModels/submodels/kinematic/force/force/forceNew.C +++ b/src/regionModels/surfaceFilmModels/submodels/kinematic/force/force/forceNew.C @@ -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. @@ -48,9 +48,9 @@ autoPtr<force> force::New { Info<< " " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -61,7 +61,7 @@ autoPtr<force> force::New ) << exit(FatalIOError); } - return autoPtr<force>(cstrIter()(model, dict)); + return autoPtr<force>(ctorPtr(model, dict)); } diff --git a/src/regionModels/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModelNew.C b/src/regionModels/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModelNew.C index 0029cec78a9..1fbddee4281 100644 --- a/src/regionModels/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModelNew.C +++ b/src/regionModels/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModelNew.C @@ -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. @@ -48,9 +48,9 @@ autoPtr<injectionModel> injectionModel::New { Info<< " " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -61,7 +61,7 @@ autoPtr<injectionModel> injectionModel::New ) << exit(FatalIOError); } - return autoPtr<injectionModel>(cstrIter()(model, dict)); + return autoPtr<injectionModel>(ctorPtr(model, dict)); } diff --git a/src/regionModels/surfaceFilmModels/submodels/kinematic/transferModels/transferModel/transferModelNew.C b/src/regionModels/surfaceFilmModels/submodels/kinematic/transferModels/transferModel/transferModelNew.C index 6dd890fa67b..aa8d4375f34 100644 --- a/src/regionModels/surfaceFilmModels/submodels/kinematic/transferModels/transferModel/transferModelNew.C +++ b/src/regionModels/surfaceFilmModels/submodels/kinematic/transferModels/transferModel/transferModelNew.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2017 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -48,9 +48,9 @@ autoPtr<transferModel> transferModel::New { Info<< " " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -61,7 +61,7 @@ autoPtr<transferModel> transferModel::New ) << exit(FatalIOError); } - return autoPtr<transferModel>(cstrIter()(model, dict)); + return autoPtr<transferModel>(ctorPtr(model, dict)); } diff --git a/src/regionModels/surfaceFilmModels/submodels/thermo/filmRadiationModel/filmRadiationModel/filmRadiationModelNew.C b/src/regionModels/surfaceFilmModels/submodels/thermo/filmRadiationModel/filmRadiationModel/filmRadiationModelNew.C index 333d82d9c86..930318d6576 100644 --- a/src/regionModels/surfaceFilmModels/submodels/thermo/filmRadiationModel/filmRadiationModel/filmRadiationModelNew.C +++ b/src/regionModels/surfaceFilmModels/submodels/thermo/filmRadiationModel/filmRadiationModel/filmRadiationModelNew.C @@ -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. @@ -49,9 +49,9 @@ autoPtr<filmRadiationModel> filmRadiationModel::New Info<< " Selecting radiationModel " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -62,7 +62,7 @@ autoPtr<filmRadiationModel> filmRadiationModel::New ) << exit(FatalIOError); } - return autoPtr<filmRadiationModel>(cstrIter()(model, dict)); + return autoPtr<filmRadiationModel>(ctorPtr(model, dict)); } diff --git a/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/filmViscosityModel/filmViscosityModelNew.C b/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/filmViscosityModel/filmViscosityModelNew.C index 35591a631ea..a8546e61e01 100644 --- a/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/filmViscosityModel/filmViscosityModelNew.C +++ b/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/filmViscosityModel/filmViscosityModelNew.C @@ -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. @@ -50,9 +50,9 @@ autoPtr<filmViscosityModel> filmViscosityModel::New Info<< " Selecting filmViscosityModel " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -63,7 +63,7 @@ autoPtr<filmViscosityModel> filmViscosityModel::New ) << exit(FatalIOError); } - return autoPtr<filmViscosityModel>(cstrIter()(model, dict, mu)); + return autoPtr<filmViscosityModel>(ctorPtr(model, dict, mu)); } diff --git a/src/regionModels/surfaceFilmModels/submodels/thermo/heatTransferModel/heatTransferModel/heatTransferModelNew.C b/src/regionModels/surfaceFilmModels/submodels/thermo/heatTransferModel/heatTransferModel/heatTransferModelNew.C index 2f3741baa84..53d54a6f4a6 100644 --- a/src/regionModels/surfaceFilmModels/submodels/thermo/heatTransferModel/heatTransferModel/heatTransferModelNew.C +++ b/src/regionModels/surfaceFilmModels/submodels/thermo/heatTransferModel/heatTransferModel/heatTransferModelNew.C @@ -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. @@ -49,9 +49,9 @@ autoPtr<heatTransferModel> heatTransferModel::New Info<< " Selecting heatTransferModel " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -62,7 +62,7 @@ autoPtr<heatTransferModel> heatTransferModel::New ) << exit(FatalIOError); } - return autoPtr<heatTransferModel>(cstrIter()(model, dict)); + return autoPtr<heatTransferModel>(ctorPtr(model, dict)); } diff --git a/src/regionModels/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModelNew.C b/src/regionModels/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModelNew.C index e5dbe553b41..86814074dca 100644 --- a/src/regionModels/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModelNew.C +++ b/src/regionModels/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModelNew.C @@ -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. @@ -49,9 +49,9 @@ autoPtr<phaseChangeModel> phaseChangeModel::New Info<< " Selecting phaseChangeModel " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -62,7 +62,7 @@ autoPtr<phaseChangeModel> phaseChangeModel::New ) << exit(FatalIOError); } - return autoPtr<phaseChangeModel>(cstrIter()(model, dict)); + return autoPtr<phaseChangeModel>(ctorPtr(model, dict)); } diff --git a/src/regionModels/surfaceFilmModels/surfaceFilmModel/surfaceFilmModelNew.C b/src/regionModels/surfaceFilmModels/surfaceFilmModel/surfaceFilmModelNew.C index 01e6e91b47e..9227b5d3b56 100644 --- a/src/regionModels/surfaceFilmModels/surfaceFilmModel/surfaceFilmModelNew.C +++ b/src/regionModels/surfaceFilmModels/surfaceFilmModel/surfaceFilmModelNew.C @@ -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. @@ -70,9 +70,9 @@ autoPtr<surfaceFilmModel> surfaceFilmModel::New Info<< "Selecting surfaceFilmModel " << modelType << endl; - auto cstrIter = meshConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = meshConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -85,7 +85,7 @@ autoPtr<surfaceFilmModel> surfaceFilmModel::New return autoPtr<surfaceFilmModel> ( - cstrIter() + ctorPtr ( modelType, mesh, diff --git a/src/regionModels/thermalBaffleModels/thermalBaffleModel/thermalBaffleModelNew.C b/src/regionModels/thermalBaffleModels/thermalBaffleModel/thermalBaffleModelNew.C index 7f088e54c93..e0df412934f 100644 --- a/src/regionModels/thermalBaffleModels/thermalBaffleModel/thermalBaffleModelNew.C +++ b/src/regionModels/thermalBaffleModels/thermalBaffleModel/thermalBaffleModelNew.C @@ -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. @@ -59,9 +59,9 @@ autoPtr<thermalBaffleModel> thermalBaffleModel::New(const fvMesh& mesh) dict.getOrDefault<word>("thermalBaffleModel", "thermalBaffle") ); - auto cstrIter = meshConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = meshConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -72,7 +72,7 @@ autoPtr<thermalBaffleModel> thermalBaffleModel::New(const fvMesh& mesh) ) << exit(FatalIOError); } - return autoPtr<thermalBaffleModel>(cstrIter()(modelType, mesh)); + return autoPtr<thermalBaffleModel>(ctorPtr(modelType, mesh)); } @@ -87,9 +87,9 @@ autoPtr<thermalBaffleModel> thermalBaffleModel::New dict.getOrDefault<word>("thermalBaffleModel", "thermalBaffle") ); - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -100,7 +100,7 @@ autoPtr<thermalBaffleModel> thermalBaffleModel::New ) << exit(FatalIOError); } - return autoPtr<thermalBaffleModel>(cstrIter()(modelType, mesh, dict)); + return autoPtr<thermalBaffleModel>(ctorPtr(modelType, mesh, dict)); } diff --git a/src/renumber/renumberMethods/renumberMethod/renumberMethod.C b/src/renumber/renumberMethods/renumberMethod/renumberMethod.C index 665c31a8b77..bdf3f4af303 100644 --- a/src/renumber/renumberMethods/renumberMethod/renumberMethod.C +++ b/src/renumber/renumberMethods/renumberMethod/renumberMethod.C @@ -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. @@ -51,9 +51,9 @@ Foam::autoPtr<Foam::renumberMethod> Foam::renumberMethod::New //Info<< "Selecting renumberMethod " << methodType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(methodType); + auto* ctorPtr = dictionaryConstructorTable(methodType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -64,7 +64,7 @@ Foam::autoPtr<Foam::renumberMethod> Foam::renumberMethod::New ) << exit(FatalIOError); } - return autoPtr<renumberMethod>(cstrIter()(dict)); + return autoPtr<renumberMethod>(ctorPtr(dict)); } diff --git a/src/rigidBodyDynamics/bodies/rigidBody/rigidBody.C b/src/rigidBodyDynamics/bodies/rigidBody/rigidBody.C index 3fd5fb02cfa..4de00c8d6f4 100644 --- a/src/rigidBodyDynamics/bodies/rigidBody/rigidBody.C +++ b/src/rigidBodyDynamics/bodies/rigidBody/rigidBody.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2016 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -79,9 +79,9 @@ Foam::autoPtr<Foam::RBD::rigidBody> Foam::RBD::rigidBody::New { const word bodyType(dict.get<word>("type")); - auto cstrIter = dictionaryConstructorTablePtr_->cfind(bodyType); + auto* ctorPtr = dictionaryConstructorTable(bodyType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -92,7 +92,7 @@ Foam::autoPtr<Foam::RBD::rigidBody> Foam::RBD::rigidBody::New ) << exit(FatalIOError); } - return autoPtr<rigidBody>(cstrIter()(name, dict)); + return autoPtr<rigidBody>(ctorPtr(name, dict)); } diff --git a/src/rigidBodyDynamics/joints/joint/joint.C b/src/rigidBodyDynamics/joints/joint/joint.C index 7b205a7a83b..46874f8f95c 100644 --- a/src/rigidBodyDynamics/joints/joint/joint.C +++ b/src/rigidBodyDynamics/joints/joint/joint.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2016 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::autoPtr<Foam::RBD::joint> Foam::RBD::joint::New { const word bodyType(dict.get<word>("type")); - auto cstrIter = dictionaryConstructorTablePtr_->cfind(bodyType); + auto* ctorPtr = dictionaryConstructorTable(bodyType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -69,7 +69,7 @@ Foam::autoPtr<Foam::RBD::joint> Foam::RBD::joint::New ) << exit(FatalIOError); } - return autoPtr<joint>(cstrIter()(dict)); + return autoPtr<joint>(ctorPtr(dict)); } diff --git a/src/rigidBodyDynamics/restraints/restraint/rigidBodyRestraintNew.C b/src/rigidBodyDynamics/restraints/restraint/rigidBodyRestraintNew.C index 1cc7334817e..788e2e4117b 100644 --- a/src/rigidBodyDynamics/restraints/restraint/rigidBodyRestraintNew.C +++ b/src/rigidBodyDynamics/restraints/restraint/rigidBodyRestraintNew.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 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::RBD::restraint::New { const word restraintType(dict.get<word>("type")); - auto cstrIter = dictionaryConstructorTablePtr_->cfind(restraintType); + auto* ctorPtr = dictionaryConstructorTable(restraintType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -53,7 +53,7 @@ Foam::RBD::restraint::New ) << exit(FatalIOError); } - return autoPtr<restraint>(cstrIter()(name, dict, model)); + return autoPtr<restraint>(ctorPtr(name, dict, model)); } diff --git a/src/rigidBodyDynamics/rigidBodySolvers/rigidBodySolver/rigidBodySolverNew.C b/src/rigidBodyDynamics/rigidBodySolvers/rigidBodySolver/rigidBodySolverNew.C index 5716647dd3f..d9a525ddf9e 100644 --- a/src/rigidBodyDynamics/rigidBodySolvers/rigidBodySolver/rigidBodySolverNew.C +++ b/src/rigidBodyDynamics/rigidBodySolvers/rigidBodySolver/rigidBodySolverNew.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 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::RBD::rigidBodySolver> Foam::RBD::rigidBodySolver::New Info<< "Selecting rigidBodySolver " << solverType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(solverType); + auto* ctorPtr = dictionaryConstructorTable(solverType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -53,7 +53,7 @@ Foam::autoPtr<Foam::RBD::rigidBodySolver> Foam::RBD::rigidBodySolver::New ) << exit(FatalIOError); } - return cstrIter()(body, dict); + return ctorPtr(body, dict); } diff --git a/src/sampling/meshToMesh/calcMethod/meshToMeshMethod/meshToMeshMethodNew.C b/src/sampling/meshToMesh/calcMethod/meshToMeshMethod/meshToMeshMethodNew.C index d279a3e9473..ccc8366a13b 100644 --- a/src/sampling/meshToMesh/calcMethod/meshToMeshMethod/meshToMeshMethodNew.C +++ b/src/sampling/meshToMesh/calcMethod/meshToMeshMethod/meshToMeshMethodNew.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2013-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::meshToMeshMethod> Foam::meshToMeshMethod::New { DebugInfo << "Selecting AMIMethod " << methodName << endl; - auto cstrIter = componentsConstructorTablePtr_->cfind(methodName); + auto* ctorPtr = componentsConstructorTable(methodName); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInLookup ( @@ -51,7 +51,7 @@ Foam::autoPtr<Foam::meshToMeshMethod> Foam::meshToMeshMethod::New ) << exit(FatalError); } - return autoPtr<meshToMeshMethod>(cstrIter()(src, tgt)); + return autoPtr<meshToMeshMethod>(ctorPtr(src, tgt)); } diff --git a/src/sampling/sampledSet/sampledSet/sampledSet.C b/src/sampling/sampledSet/sampledSet/sampledSet.C index 8cde03411c1..f48f4fc4004 100644 --- a/src/sampling/sampledSet/sampledSet/sampledSet.C +++ b/src/sampling/sampledSet/sampledSet/sampledSet.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2018-2020 OpenCFD Ltd. + Copyright (C) 2018-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -525,9 +525,9 @@ Foam::autoPtr<Foam::sampledSet> Foam::sampledSet::New { const word sampleType(dict.get<word>("type")); - auto cstrIter = wordConstructorTablePtr_->cfind(sampleType); + auto* ctorPtr = wordConstructorTable(sampleType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -540,7 +540,7 @@ Foam::autoPtr<Foam::sampledSet> Foam::sampledSet::New return autoPtr<sampledSet> ( - cstrIter() + ctorPtr ( name, mesh, diff --git a/src/sampling/sampledSurface/readers/surfaceReaderNew.C b/src/sampling/sampledSurface/readers/surfaceReaderNew.C index 01ccd48d519..c2371b7401a 100644 --- a/src/sampling/sampledSurface/readers/surfaceReaderNew.C +++ b/src/sampling/sampledSurface/readers/surfaceReaderNew.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2015-2019 OpenCFD Ltd. + Copyright (C) 2015-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -35,9 +35,9 @@ Foam::autoPtr<Foam::surfaceReader> Foam::surfaceReader::New const fileName& fName ) { - auto cstrIter = fileNameConstructorTablePtr_->cfind(readerType); + auto* ctorPtr = fileNameConstructorTable(readerType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInLookup ( @@ -47,7 +47,7 @@ Foam::autoPtr<Foam::surfaceReader> Foam::surfaceReader::New ) << exit(FatalError); } - return autoPtr<surfaceReader>(cstrIter()(fName)); + return autoPtr<surfaceReader>(ctorPtr(fName)); } diff --git a/src/sampling/sampledSurface/sampledSurface/sampledSurface.C b/src/sampling/sampledSurface/sampledSurface/sampledSurface.C index 9d9fd19cec8..8a45daa9196 100644 --- a/src/sampling/sampledSurface/sampledSurface/sampledSurface.C +++ b/src/sampling/sampledSurface/sampledSurface/sampledSurface.C @@ -70,9 +70,9 @@ Foam::autoPtr<Foam::sampledSurface> Foam::sampledSurface::New DebugInfo << "Selecting sampledType " << sampleType << endl; - auto cstrIter = wordConstructorTablePtr_->cfind(sampleType); + auto* ctorPtr = wordConstructorTable(sampleType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -83,7 +83,7 @@ Foam::autoPtr<Foam::sampledSurface> Foam::sampledSurface::New ) << exit(FatalIOError); } - return autoPtr<sampledSurface>(cstrIter()(name, mesh, dict)); + return autoPtr<sampledSurface>(ctorPtr(name, mesh, dict)); } diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraintNew.C b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraintNew.C index d1cd21923ef..969420691ac 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraintNew.C +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraintNew.C @@ -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::sixDoFRigidBodyMotionConstraint::New dict.get<word>("sixDoFRigidBodyMotionConstraint") ); - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -58,7 +58,7 @@ Foam::sixDoFRigidBodyMotionConstraint::New return autoPtr<sixDoFRigidBodyMotionConstraint> ( - cstrIter()(name, dict, motion) + ctorPtr(name, dict, motion) ); } diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraintNew.C b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraintNew.C index b4c501a17f8..b6f19e47a95 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraintNew.C +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraintNew.C @@ -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::sixDoFRigidBodyMotionRestraint::New dict.get<word>("sixDoFRigidBodyMotionRestraint") ); - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -57,7 +57,7 @@ Foam::sixDoFRigidBodyMotionRestraint::New return autoPtr<sixDoFRigidBodyMotionRestraint> ( - cstrIter()(name, dict) + ctorPtr(name, dict) ); } diff --git a/src/sixDoFRigidBodyMotion/sixDoFSolvers/sixDoFSolver/sixDoFSolverNew.C b/src/sixDoFRigidBodyMotion/sixDoFSolvers/sixDoFSolver/sixDoFSolverNew.C index 325b4c98ba6..3fd7c7ec120 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFSolvers/sixDoFSolver/sixDoFSolverNew.C +++ b/src/sixDoFRigidBodyMotion/sixDoFSolvers/sixDoFSolver/sixDoFSolverNew.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2015 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::sixDoFSolver> Foam::sixDoFSolver::New Info<< "Selecting sixDoFSolver " << solverType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(solverType); + auto* ctorPtr = dictionaryConstructorTable(solverType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -53,7 +53,7 @@ Foam::autoPtr<Foam::sixDoFSolver> Foam::sixDoFSolver::New ) << exit(FatalIOError); } - return cstrIter()(dict, body); + return ctorPtr(dict, body); } diff --git a/src/surfMesh/MeshedSurface/MeshedSurface.C b/src/surfMesh/MeshedSurface/MeshedSurface.C index 37433f884a0..ef90d677716 100644 --- a/src/surfMesh/MeshedSurface/MeshedSurface.C +++ b/src/surfMesh/MeshedSurface/MeshedSurface.C @@ -149,9 +149,9 @@ void Foam::MeshedSurface<Face>::write DebugInFunction << "Writing to " << name << nl; - auto mfIter = writefileExtensionMemberFunctionTablePtr_->cfind(fileType); + auto* mfuncPtr = writefileExtensionMemberFunctionTable(fileType); - if (!mfIter.found()) + if (!mfuncPtr) { // Delegate to proxy if possible const wordHashSet delegate(ProxyType::writeTypes()); @@ -172,7 +172,7 @@ void Foam::MeshedSurface<Face>::write } else { - mfIter()(name, surf, streamOpt, options); + mfuncPtr(name, surf, streamOpt, options); } } diff --git a/src/surfMesh/MeshedSurface/MeshedSurfaceNew.C b/src/surfMesh/MeshedSurface/MeshedSurfaceNew.C index d1dac5fa90e..b9799551e96 100644 --- a/src/surfMesh/MeshedSurface/MeshedSurfaceNew.C +++ b/src/surfMesh/MeshedSurface/MeshedSurfaceNew.C @@ -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. @@ -80,11 +80,11 @@ Foam::MeshedSurface<Face>::New DebugInFunction << "Construct MeshedSurface (" << fileType << ")\n"; - auto cstrIter = fileExtensionConstructorTablePtr_->cfind(fileType); + auto* ctorPtr = fileExtensionConstructorTable(fileType); - if (cstrIter.found()) + if (ctorPtr) { - return autoPtr<MeshedSurface<Face>>(cstrIter()(name)); + return autoPtr<MeshedSurface<Face>>(ctorPtr(name)); } diff --git a/src/surfMesh/MeshedSurfaceProxy/MeshedSurfaceProxy.C b/src/surfMesh/MeshedSurfaceProxy/MeshedSurfaceProxy.C index 4f560f67d2d..a9496ef54f3 100644 --- a/src/surfMesh/MeshedSurfaceProxy/MeshedSurfaceProxy.C +++ b/src/surfMesh/MeshedSurfaceProxy/MeshedSurfaceProxy.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2016-2020 OpenCFD Ltd. + Copyright (C) 2016-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -103,9 +103,9 @@ void Foam::MeshedSurfaceProxy<Face>::write DebugInFunction << "Writing to " << name << nl; - auto mfIter = writefileExtensionMemberFunctionTablePtr_->cfind(fileType); + auto* mfuncPtr = writefileExtensionMemberFunctionTable(fileType); - if (!mfIter.found()) + if (!mfuncPtr) { FatalErrorInFunction << "Unknown file type " << fileType << nl << nl @@ -114,7 +114,7 @@ void Foam::MeshedSurfaceProxy<Face>::write << exit(FatalError); } - mfIter()(name, surf, streamOpt, options); + mfuncPtr(name, surf, streamOpt, options); } diff --git a/src/surfMesh/UnsortedMeshedSurface/UnsortedMeshedSurface.C b/src/surfMesh/UnsortedMeshedSurface/UnsortedMeshedSurface.C index d82c263250c..1f16337bad4 100644 --- a/src/surfMesh/UnsortedMeshedSurface/UnsortedMeshedSurface.C +++ b/src/surfMesh/UnsortedMeshedSurface/UnsortedMeshedSurface.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2016-2020 OpenCFD Ltd. + Copyright (C) 2016-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -145,9 +145,9 @@ void Foam::UnsortedMeshedSurface<Face>::write DebugInFunction << "Writing to " << name << nl; - auto mfIter = writefileExtensionMemberFunctionTablePtr_->cfind(fileType); + auto* mfuncPtr = writefileExtensionMemberFunctionTable(fileType); - if (!mfIter.found()) + if (!mfuncPtr) { // Delegate to proxy if possible const wordHashSet delegate(ProxyType::writeTypes()); @@ -168,7 +168,7 @@ void Foam::UnsortedMeshedSurface<Face>::write } else { - mfIter()(name, surf, streamOpt, options); + mfuncPtr(name, surf, streamOpt, options); } } diff --git a/src/surfMesh/UnsortedMeshedSurface/UnsortedMeshedSurfaceNew.C b/src/surfMesh/UnsortedMeshedSurface/UnsortedMeshedSurfaceNew.C index d09be53b62b..581000016d6 100644 --- a/src/surfMesh/UnsortedMeshedSurface/UnsortedMeshedSurfaceNew.C +++ b/src/surfMesh/UnsortedMeshedSurface/UnsortedMeshedSurfaceNew.C @@ -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. @@ -78,11 +78,11 @@ Foam::UnsortedMeshedSurface<Face>::New DebugInFunction << "Construct UnsortedMeshedSurface (" << fileType << ")\n"; - auto cstrIter = fileExtensionConstructorTablePtr_->cfind(fileType); + auto* ctorPtr = fileExtensionConstructorTable(fileType); - if (cstrIter.found()) + if (ctorPtr) { - return autoPtr<UnsortedMeshedSurface<Face>>(cstrIter()(name)); + return autoPtr<UnsortedMeshedSurface<Face>>(ctorPtr(name)); } diff --git a/src/surfMesh/writers/surfaceWriter.C b/src/surfMesh/writers/surfaceWriter.C index 52364b4b082..4fbdb2db4af 100644 --- a/src/surfMesh/writers/surfaceWriter.C +++ b/src/surfMesh/writers/surfaceWriter.C @@ -64,9 +64,9 @@ Foam::autoPtr<Foam::surfaceWriter> Foam::surfaceWriter::New(const word& writeType) { // Constructors without dictionary options - auto cstrIter = wordConstructorTablePtr_->cfind(writeType); + auto* ctorPtr = wordConstructorTable(writeType); - if (!cstrIter.found()) + if (!ctorPtr) { if (MeshedSurfaceProxy<face>::canWriteType(writeType)) { @@ -86,7 +86,7 @@ Foam::surfaceWriter::New(const word& writeType) << exit(FatalError); } - return autoPtr<surfaceWriter>(cstrIter()()); + return autoPtr<surfaceWriter>(ctorPtr()); } @@ -98,17 +98,20 @@ Foam::surfaceWriter::New ) { // Constructors with dictionary options - auto cstrIter2 = wordDictConstructorTablePtr_->cfind(writeType); - - if (cstrIter2.found()) { - return autoPtr<surfaceWriter>(cstrIter2()(writeOpts)); + auto* ctorPtr = wordDictConstructorTable(writeType); + + if (ctorPtr) + { + return autoPtr<surfaceWriter>(ctorPtr(writeOpts)); + } } + // Constructors without dictionary options - auto cstrIter = wordConstructorTablePtr_->cfind(writeType); + auto* ctorPtr = wordConstructorTable(writeType); - if (!cstrIter.found()) + if (!ctorPtr) { if (MeshedSurfaceProxy<face>::canWriteType(writeType)) { @@ -128,7 +131,7 @@ Foam::surfaceWriter::New << exit(FatalError); } - return autoPtr<surfaceWriter>(cstrIter()()); + return autoPtr<surfaceWriter>(ctorPtr()); } diff --git a/src/thermophysicalModels/barotropicCompressibilityModel/barotropicCompressibilityModel/barotropicCompressibilityModelNew.C b/src/thermophysicalModels/barotropicCompressibilityModel/barotropicCompressibilityModel/barotropicCompressibilityModelNew.C index f8cad65d218..179c37178ee 100644 --- a/src/thermophysicalModels/barotropicCompressibilityModel/barotropicCompressibilityModel/barotropicCompressibilityModelNew.C +++ b/src/thermophysicalModels/barotropicCompressibilityModel/barotropicCompressibilityModel/barotropicCompressibilityModelNew.C @@ -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::barotropicCompressibilityModel::New Info<< "Selecting compressibility model " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -60,7 +60,7 @@ Foam::barotropicCompressibilityModel::New return autoPtr<barotropicCompressibilityModel> ( - cstrIter()(dict, gamma, psiName) + ctorPtr(dict, gamma, psiName) ); } diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/chemistryReductionMethod/chemistryReductionMethodNew.C b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/chemistryReductionMethod/chemistryReductionMethodNew.C index e2fe6396510..a1a5405992a 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/chemistryReductionMethod/chemistryReductionMethodNew.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/chemistryReductionMethod/chemistryReductionMethodNew.C @@ -53,9 +53,9 @@ Foam::chemistryReductionMethod<CompType, ThermoType>::New const auto& cnstrTable = *(dictionaryConstructorTablePtr_); - auto cstrIter = cnstrTable.cfind(methodTypeName); + auto* ctorPtr = cnstrTable.lookup(methodTypeName, nullptr); - if (!cstrIter.found()) + if (!ctorPtr) { const wordList names(cnstrTable.sortedToc()); @@ -123,7 +123,7 @@ Foam::chemistryReductionMethod<CompType, ThermoType>::New return autoPtr<chemistryReductionMethod<CompType, ThermoType>> ( - cstrIter()(dict, chemistry) + ctorPtr(dict, chemistry) ); } diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/chemistryTabulationMethod/chemistryTabulationMethodNew.C b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/chemistryTabulationMethod/chemistryTabulationMethodNew.C index 78217af1220..b2e2f8bd06f 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/chemistryTabulationMethod/chemistryTabulationMethodNew.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/chemistryTabulationMethod/chemistryTabulationMethodNew.C @@ -52,9 +52,9 @@ Foam::chemistryTabulationMethod<CompType, ThermoType>::New const auto& cnstrTable = *(dictionaryConstructorTablePtr_); - auto cstrIter = cnstrTable.cfind(methodTypeName); + auto* ctorPtr = cnstrTable.lookup(methodTypeName, nullptr); - if (!cstrIter.found()) + if (!ctorPtr) { const wordList names(cnstrTable.sortedToc()); @@ -122,7 +122,7 @@ Foam::chemistryTabulationMethod<CompType, ThermoType>::New return autoPtr<chemistryTabulationMethod<CompType, ThermoType>> ( - cstrIter()(dict, chemistry) + ctorPtr(dict, chemistry) ); } diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModelTemplates.C b/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModelTemplates.C index 1dff300bf74..f312d86240c 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModelTemplates.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModelTemplates.C @@ -106,9 +106,9 @@ Foam::autoPtr<ChemistryModel> Foam::basicChemistryModel::New const auto& cnstrTable = *(ChemistryModel::thermoConstructorTablePtr_); - auto ctorIter = cnstrTable.cfind(chemSolverCompThermoName); + auto* ctorPtr = cnstrTable.lookup(chemSolverCompThermoName, nullptr); - if (!ctorIter.found()) + if (!ctorPtr) { const wordList names(cnstrTable.sortedToc()); @@ -188,7 +188,7 @@ Foam::autoPtr<ChemistryModel> Foam::basicChemistryModel::New << exit(FatalError); } - return autoPtr<ChemistryModel>(ctorIter()(thermo)); + return autoPtr<ChemistryModel>(ctorPtr(thermo)); } // ************************************************************************* // diff --git a/src/thermophysicalModels/laminarFlameSpeed/laminarFlameSpeed/laminarFlameSpeedNew.C b/src/thermophysicalModels/laminarFlameSpeed/laminarFlameSpeed/laminarFlameSpeedNew.C index 9a6e9a655ce..eb1b021db7b 100644 --- a/src/thermophysicalModels/laminarFlameSpeed/laminarFlameSpeed/laminarFlameSpeedNew.C +++ b/src/thermophysicalModels/laminarFlameSpeed/laminarFlameSpeed/laminarFlameSpeedNew.C @@ -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::laminarFlameSpeed> Foam::laminarFlameSpeed::New Info<< "Selecting laminar flame speed correlation " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -65,7 +65,7 @@ Foam::autoPtr<Foam::laminarFlameSpeed> Foam::laminarFlameSpeed::New ) << exit(FatalIOError); } - return autoPtr<laminarFlameSpeed>(cstrIter()(propDict, ct)); + return autoPtr<laminarFlameSpeed>(ctorPtr(propDict, ct)); } diff --git a/src/thermophysicalModels/radiation/radiationModels/radiationModel/radiationModelNew.C b/src/thermophysicalModels/radiation/radiationModels/radiationModel/radiationModelNew.C index 84192182890..01d416d0358 100644 --- a/src/thermophysicalModels/radiation/radiationModels/radiationModel/radiationModelNew.C +++ b/src/thermophysicalModels/radiation/radiationModels/radiationModel/radiationModelNew.C @@ -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. @@ -67,9 +67,9 @@ Foam::radiation::radiationModel::New Info<< "Selecting radiationModel " << modelType << endl; - auto cstrIter = TConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = TConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -80,7 +80,7 @@ Foam::radiation::radiationModel::New ) << exit(FatalIOError); } - return autoPtr<radiationModel>(cstrIter()(T)); + return autoPtr<radiationModel>(ctorPtr(T)); } @@ -95,9 +95,9 @@ Foam::radiation::radiationModel::New Info<< "Selecting radiationModel " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -108,7 +108,7 @@ Foam::radiation::radiationModel::New ) << exit(FatalIOError); } - return autoPtr<radiationModel>(cstrIter()(dict, T)); + return autoPtr<radiationModel>(ctorPtr(dict, T)); } diff --git a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/absorptionEmissionModel/absorptionEmissionModelNew.C b/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/absorptionEmissionModel/absorptionEmissionModelNew.C index 691b7a1476d..7b3cae45b30 100644 --- a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/absorptionEmissionModel/absorptionEmissionModelNew.C +++ b/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/absorptionEmissionModel/absorptionEmissionModelNew.C @@ -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::radiation::absorptionEmissionModel::New Info<< "Selecting absorptionEmissionModel " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -55,7 +55,7 @@ Foam::radiation::absorptionEmissionModel::New ) << exit(FatalIOError); } - return autoPtr<absorptionEmissionModel>(cstrIter()(dict, mesh)); + return autoPtr<absorptionEmissionModel>(ctorPtr(dict, mesh)); } diff --git a/src/thermophysicalModels/radiation/submodels/boundaryRadiationProperties/boundaryRadiationPropertiesPatch.C b/src/thermophysicalModels/radiation/submodels/boundaryRadiationProperties/boundaryRadiationPropertiesPatch.C index 3eeebc6cfa8..ac1e0550c8a 100644 --- a/src/thermophysicalModels/radiation/submodels/boundaryRadiationProperties/boundaryRadiationPropertiesPatch.C +++ b/src/thermophysicalModels/radiation/submodels/boundaryRadiationProperties/boundaryRadiationPropertiesPatch.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2015-2019 OpenCFD Ltd. + Copyright (C) 2015-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -58,9 +58,9 @@ Foam::radiation::boundaryRadiationPropertiesPatch::New Info<< "Selecting boundary radiation Model: " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -71,7 +71,7 @@ Foam::radiation::boundaryRadiationPropertiesPatch::New ) << exit(FatalIOError); } - return cstrIter()(dict, pp); + return ctorPtr(dict, pp); } diff --git a/src/thermophysicalModels/radiation/submodels/scatterModel/scatterModel/scatterModelNew.C b/src/thermophysicalModels/radiation/submodels/scatterModel/scatterModel/scatterModelNew.C index 7feb97f1a73..86f948bc06f 100644 --- a/src/thermophysicalModels/radiation/submodels/scatterModel/scatterModel/scatterModelNew.C +++ b/src/thermophysicalModels/radiation/submodels/scatterModel/scatterModel/scatterModelNew.C @@ -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::autoPtr<Foam::radiation::scatterModel> Foam::radiation::scatterModel::New Info<< "Selecting scatterModel " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -54,7 +54,7 @@ Foam::autoPtr<Foam::radiation::scatterModel> Foam::radiation::scatterModel::New ) << exit(FatalIOError); } - return autoPtr<scatterModel>(cstrIter()(dict, mesh)); + return autoPtr<scatterModel>(ctorPtr(dict, mesh)); } diff --git a/src/thermophysicalModels/radiation/submodels/sootModel/sootModel/sootModelNew.C b/src/thermophysicalModels/radiation/submodels/sootModel/sootModel/sootModelNew.C index 470e0a2ec9c..b51e1b64229 100644 --- a/src/thermophysicalModels/radiation/submodels/sootModel/sootModel/sootModelNew.C +++ b/src/thermophysicalModels/radiation/submodels/sootModel/sootModel/sootModelNew.C @@ -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. @@ -45,9 +45,9 @@ Foam::radiation::sootModel::New Info<< "Selecting sootModel " << modelType << endl; } - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -60,7 +60,7 @@ Foam::radiation::sootModel::New const word className = modelType.substr(0, modelType.find('<')); - return autoPtr<sootModel>(cstrIter()(dict, mesh, className)); + return autoPtr<sootModel>(ctorPtr(dict, mesh, className)); } diff --git a/src/thermophysicalModels/radiation/submodels/wallAbsorptionEmissionModel/wallAbsorptionEmissionModel/wallAbsorptionEmissionModelNew.C b/src/thermophysicalModels/radiation/submodels/wallAbsorptionEmissionModel/wallAbsorptionEmissionModel/wallAbsorptionEmissionModelNew.C index d6ff16cae75..42fae3c9734 100644 --- a/src/thermophysicalModels/radiation/submodels/wallAbsorptionEmissionModel/wallAbsorptionEmissionModel/wallAbsorptionEmissionModelNew.C +++ b/src/thermophysicalModels/radiation/submodels/wallAbsorptionEmissionModel/wallAbsorptionEmissionModel/wallAbsorptionEmissionModelNew.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2018-2019 OpenCFD Ltd. + Copyright (C) 2018-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -39,9 +39,9 @@ wallAbsorptionEmissionModel::New { const word modelType(dict.get<word>("type")); - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -52,7 +52,7 @@ wallAbsorptionEmissionModel::New ) << exit(FatalIOError); } - return autoPtr<wallAbsorptionEmissionModel>(cstrIter()(dict, pp)); + return autoPtr<wallAbsorptionEmissionModel>(ctorPtr(dict, pp)); } diff --git a/src/thermophysicalModels/radiation/submodels/wallTransmissivityModel/wallTransmissivityModel/wallTransmissivityModelNew.C b/src/thermophysicalModels/radiation/submodels/wallTransmissivityModel/wallTransmissivityModel/wallTransmissivityModelNew.C index f7fba30102a..c3fdd68ad6a 100644 --- a/src/thermophysicalModels/radiation/submodels/wallTransmissivityModel/wallTransmissivityModel/wallTransmissivityModelNew.C +++ b/src/thermophysicalModels/radiation/submodels/wallTransmissivityModel/wallTransmissivityModel/wallTransmissivityModelNew.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2018-2019 OpenCFD Ltd. + Copyright (C) 2018-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -39,9 +39,9 @@ wallTransmissivityModel::New { const word modelType(dict.get<word>("wallTransmissivityModel")); - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -52,7 +52,7 @@ wallTransmissivityModel::New ) << exit(FatalIOError); } - return autoPtr<wallTransmissivityModel>(cstrIter()(dict, pp)); + return autoPtr<wallTransmissivityModel>(ctorPtr(dict, pp)); } diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.C b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.C index efaa88021be..efc703359f9 100644 --- a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.C +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.C @@ -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. @@ -46,9 +46,9 @@ Foam::chemistryReader<ThermoType>::New Info<< "Selecting chemistryReader " << readerName << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(readerName); + auto* ctorPtr = dictionaryConstructorTable(readerName); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -61,7 +61,7 @@ Foam::chemistryReader<ThermoType>::New return autoPtr<chemistryReader<ThermoType>> ( - cstrIter()(thermoDict, species) + ctorPtr(thermoDict, species) ); } diff --git a/src/thermophysicalModels/solidChemistryModel/basicSolidChemistryModel/basicSolidChemistryModelNew.C b/src/thermophysicalModels/solidChemistryModel/basicSolidChemistryModel/basicSolidChemistryModelNew.C index 83e272847ac..1820bebfa27 100644 --- a/src/thermophysicalModels/solidChemistryModel/basicSolidChemistryModel/basicSolidChemistryModelNew.C +++ b/src/thermophysicalModels/solidChemistryModel/basicSolidChemistryModel/basicSolidChemistryModelNew.C @@ -97,9 +97,9 @@ Foam::basicSolidChemistryModel::New(solidReactionThermo& thermo) const auto& cnstrTable = *(thermoConstructorTablePtr_); - auto ctorIter = cnstrTable.cfind(chemistryTypeName); + auto* ctorPtr = cnstrTable.lookup(chemistryTypeName, nullptr); - if (!ctorIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -136,7 +136,7 @@ Foam::basicSolidChemistryModel::New(solidReactionThermo& thermo) << exit(FatalIOError); } - return autoPtr<basicSolidChemistryModel>(ctorIter()(thermo)); + return autoPtr<basicSolidChemistryModel>(ctorPtr(thermo)); } diff --git a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.C b/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.C index cdf1af95e17..ee9908f7fb5 100644 --- a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.C +++ b/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2017-2019 OpenCFD Ltd + Copyright (C) 2017-2021 OpenCFD Ltd ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -358,9 +358,9 @@ Foam::Reaction<ReactionThermo>::New { const word reactionTypeName(dict.get<word>("type")); - auto cstrIter = dictionaryConstructorTablePtr_->cfind(reactionTypeName); + auto* ctorPtr = dictionaryConstructorTable(reactionTypeName); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -373,7 +373,7 @@ Foam::Reaction<ReactionThermo>::New return autoPtr<Reaction<ReactionThermo>> ( - cstrIter()(species, thermoDatabase, dict) + ctorPtr(species, thermoDatabase, dict) ); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/liquidProperties/liquidProperties.C b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/liquidProperties/liquidProperties.C index 499c15aa58a..3df7af91b84 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/liquidProperties/liquidProperties.C +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/liquidProperties/liquidProperties.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -94,9 +94,9 @@ Foam::autoPtr<Foam::liquidProperties> Foam::liquidProperties::New { DebugInFunction << "Constructing liquidProperties" << nl; - auto cstrIter = ConstructorTablePtr_->cfind(name); + auto* ctorPtr = ConstructorTable(name); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInLookup ( @@ -106,7 +106,7 @@ Foam::autoPtr<Foam::liquidProperties> Foam::liquidProperties::New ) << exit(FatalError); } - return autoPtr<liquidProperties>(cstrIter()()); + return autoPtr<liquidProperties>(ctorPtr()); } @@ -128,9 +128,9 @@ Foam::autoPtr<Foam::liquidProperties> Foam::liquidProperties::New return New(liquidType); } - auto cstrIter = dictionaryConstructorTablePtr_->cfind(liquidType); + auto* ctorPtr = dictionaryConstructorTable(liquidType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -143,16 +143,13 @@ Foam::autoPtr<Foam::liquidProperties> Foam::liquidProperties::New return autoPtr<liquidProperties> ( - cstrIter() - ( - dict.optionalSubDict(liquidType + "Coeffs") - ) + ctorPtr(dict.optionalSubDict(liquidType + "Coeffs")) ); } - auto cstrIter = dictionaryConstructorTablePtr_->cfind(liquidType); + auto* ctorPtr = dictionaryConstructorTable(liquidType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -163,7 +160,7 @@ Foam::autoPtr<Foam::liquidProperties> Foam::liquidProperties::New ) << exit(FatalIOError); } - return autoPtr<liquidProperties>(cstrIter()(dict)); + return autoPtr<liquidProperties>(ctorPtr(dict)); } diff --git a/src/thermophysicalModels/thermophysicalProperties/solidProperties/solidProperties/solidPropertiesNew.C b/src/thermophysicalModels/thermophysicalProperties/solidProperties/solidProperties/solidPropertiesNew.C index aa563c2ad2a..07f1ae9cb30 100644 --- a/src/thermophysicalModels/thermophysicalProperties/solidProperties/solidProperties/solidPropertiesNew.C +++ b/src/thermophysicalModels/thermophysicalProperties/solidProperties/solidProperties/solidPropertiesNew.C @@ -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. @@ -38,9 +38,9 @@ Foam::autoPtr<Foam::solidProperties> Foam::solidProperties::New { DebugInFunction << "Constructing solidProperties" << endl; - auto cstrIter = ConstructorTablePtr_->cfind(name); + auto* ctorPtr = ConstructorTable(name); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInLookup ( @@ -50,7 +50,7 @@ Foam::autoPtr<Foam::solidProperties> Foam::solidProperties::New ) << exit(FatalError); } - return autoPtr<solidProperties>(cstrIter()()); + return autoPtr<solidProperties>(ctorPtr()); } @@ -78,9 +78,9 @@ Foam::autoPtr<Foam::solidProperties> Foam::solidProperties::New ); } - auto cstrIter = dictionaryConstructorTablePtr_->cfind(solidType); + auto* ctorPtr = dictionaryConstructorTable(solidType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -91,7 +91,7 @@ Foam::autoPtr<Foam::solidProperties> Foam::solidProperties::New ) << exit(FatalIOError); } - return autoPtr<solidProperties>(cstrIter()(dict)); + return autoPtr<solidProperties>(ctorPtr(dict)); } diff --git a/src/thermophysicalModels/thermophysicalProperties/thermophysicalFunctions/thermophysicalFunction/thermophysicalFunction.C b/src/thermophysicalModels/thermophysicalProperties/thermophysicalFunctions/thermophysicalFunction/thermophysicalFunction.C index 4fb8b811a00..b5c97484bbf 100644 --- a/src/thermophysicalModels/thermophysicalProperties/thermophysicalFunctions/thermophysicalFunction/thermophysicalFunction.C +++ b/src/thermophysicalModels/thermophysicalProperties/thermophysicalFunctions/thermophysicalFunction/thermophysicalFunction.C @@ -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. @@ -50,9 +50,9 @@ Foam::autoPtr<Foam::thermophysicalFunction> Foam::thermophysicalFunction::New const word functionType(is); - auto cstrIter = IstreamConstructorTablePtr_->cfind(functionType); + auto* ctorPtr = IstreamConstructorTable(functionType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInLookup ( @@ -62,7 +62,7 @@ Foam::autoPtr<Foam::thermophysicalFunction> Foam::thermophysicalFunction::New ) << abort(FatalError); } - return autoPtr<thermophysicalFunction>(cstrIter()(is)); + return autoPtr<thermophysicalFunction>(ctorPtr(is)); } @@ -75,9 +75,9 @@ Foam::autoPtr<Foam::thermophysicalFunction> Foam::thermophysicalFunction::New const word functionType(dict.get<word>("functionType")); - auto cstrIter = dictionaryConstructorTablePtr_->cfind(functionType); + auto* ctorPtr = dictionaryConstructorTable(functionType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -88,7 +88,7 @@ Foam::autoPtr<Foam::thermophysicalFunction> Foam::thermophysicalFunction::New ) << abort(FatalIOError); } - return autoPtr<thermophysicalFunction>(cstrIter()(dict)); + return autoPtr<thermophysicalFunction>(ctorPtr(dict)); } diff --git a/src/thermophysicalModels/thermophysicalProperties/thermophysicalProperties/thermophysicalProperties.C b/src/thermophysicalModels/thermophysicalProperties/thermophysicalProperties/thermophysicalProperties.C index 6ef4bad3c9d..270e8bca43b 100644 --- a/src/thermophysicalModels/thermophysicalProperties/thermophysicalProperties/thermophysicalProperties.C +++ b/src/thermophysicalModels/thermophysicalProperties/thermophysicalProperties/thermophysicalProperties.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 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::thermophysicalProperties::New { DebugInFunction << "Constructing thermophysicalProperties" << endl; - auto cstrIter = ConstructorTablePtr_->cfind(name); + auto* ctorPtr = ConstructorTable(name); - if (!cstrIter.found()) + if (!ctorPtr) { FatalErrorInLookup ( @@ -73,7 +73,7 @@ Foam::thermophysicalProperties::New ) << exit(FatalError); } - return autoPtr<thermophysicalProperties>(cstrIter()()); + return autoPtr<thermophysicalProperties>(ctorPtr()); } @@ -87,9 +87,9 @@ Foam::thermophysicalProperties::New const word& modelType = dict.dictName(); - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -100,7 +100,7 @@ Foam::thermophysicalProperties::New ) << exit(FatalIOError); } - return autoPtr<thermophysicalProperties>(cstrIter()(dict)); + return autoPtr<thermophysicalProperties>(ctorPtr(dict)); } diff --git a/src/transportModels/geometricVoF/reconstructionSchemes/reconstructionSchemesNew.C b/src/transportModels/geometricVoF/reconstructionSchemes/reconstructionSchemesNew.C index 20a9f037978..e5a800db2a7 100644 --- a/src/transportModels/geometricVoF/reconstructionSchemes/reconstructionSchemesNew.C +++ b/src/transportModels/geometricVoF/reconstructionSchemes/reconstructionSchemesNew.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2019-2020 DLR + Copyright (C) 2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -51,9 +52,9 @@ Foam::reconstructionSchemes::New Info<< "Selecting reconstructionScheme: " << schemeType << endl; - auto cstrIter = componentsConstructorTablePtr_->cfind(schemeType); + auto* ctorPtr = componentsConstructorTable(schemeType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -64,7 +65,7 @@ Foam::reconstructionSchemes::New ) << exit(FatalIOError); } - return autoPtr<reconstructionSchemes>(cstrIter()(alpha1, phi, U, dict)); + return autoPtr<reconstructionSchemes>(ctorPtr(alpha1, phi, U, dict)); } diff --git a/src/transportModels/incompressible/viscosityModels/viscosityModel/viscosityModelNew.C b/src/transportModels/incompressible/viscosityModels/viscosityModel/viscosityModelNew.C index 43a81e02450..03c63686ea0 100644 --- a/src/transportModels/incompressible/viscosityModels/viscosityModel/viscosityModelNew.C +++ b/src/transportModels/incompressible/viscosityModels/viscosityModel/viscosityModelNew.C @@ -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. @@ -44,9 +44,9 @@ Foam::autoPtr<Foam::viscosityModel> Foam::viscosityModel::New Info<< "Selecting incompressible transport model " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -57,7 +57,7 @@ Foam::autoPtr<Foam::viscosityModel> Foam::viscosityModel::New ) << exit(FatalIOError); } - return autoPtr<viscosityModel>(cstrIter()(name, dict, U, phi)); + return autoPtr<viscosityModel>(ctorPtr(name, dict, U, phi)); } diff --git a/src/transportModels/interfaceProperties/surfaceTensionModels/surfaceTensionModel/surfaceTensionModelNew.C b/src/transportModels/interfaceProperties/surfaceTensionModels/surfaceTensionModel/surfaceTensionModelNew.C index ba690051f0f..e6c1f680af2 100644 --- a/src/transportModels/interfaceProperties/surfaceTensionModels/surfaceTensionModel/surfaceTensionModelNew.C +++ b/src/transportModels/interfaceProperties/surfaceTensionModels/surfaceTensionModel/surfaceTensionModelNew.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2017 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::surfaceTensionModel> Foam::surfaceTensionModel::New Info<< "Selecting surfaceTensionModel " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = dictionaryConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -58,7 +58,7 @@ Foam::autoPtr<Foam::surfaceTensionModel> Foam::surfaceTensionModel::New ) << exit(FatalIOError); } - return cstrIter()(sigmaDict, mesh); + return ctorPtr(sigmaDict, mesh); } return autoPtr<surfaceTensionModel> diff --git a/src/waveModels/waveModel/waveModelNew.C b/src/waveModels/waveModel/waveModelNew.C index 55c4b661353..ad37d25c3b1 100644 --- a/src/waveModels/waveModel/waveModelNew.C +++ b/src/waveModels/waveModel/waveModelNew.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2015 IH-Cantabria - Copyright (C) 2016-2019 OpenCFD Ltd. + Copyright (C) 2016-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -65,9 +65,9 @@ Foam::autoPtr<Foam::waveModel> Foam::waveModel::New Info<< "Selecting waveModel " << modelType << endl; - auto cstrIter = patchConstructorTablePtr_->cfind(modelType); + auto* ctorPtr = patchConstructorTable(modelType); - if (!cstrIter.found()) + if (!ctorPtr) { FatalIOErrorInLookup ( @@ -78,7 +78,7 @@ Foam::autoPtr<Foam::waveModel> Foam::waveModel::New ) << exit(FatalIOError); } - return autoPtr<waveModel>(cstrIter()(patchDict, mesh, patch)); + return autoPtr<waveModel>(ctorPtr(patchDict, mesh, patch)); } -- GitLab