From bc1f2fa97e96be6ac5ca68e0cf7bf2b24a91b622 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Mon, 3 Jul 2017 10:36:03 +0200 Subject: [PATCH 01/50] STYLE: use auto and cfind to simplify selector usage (issue #512) --- .../dragModels/PDRDragModel/PDRDragModelNew.C | 5 +- .../XiEqModels/XiEqModel/XiEqModelNew.C | 5 +- .../XiModels/XiGModels/XiGModel/XiGModelNew.C | 5 +- .../PDRFoam/XiModels/XiModel/XiModelNew.C | 5 +- .../mixtureViscosityModelNew.C | 5 +- .../relativeVelocityModel.C | 15 +++--- ...newtemperaturePhaseChangeTwoPhaseMixture.C | 13 ++--- .../newPhaseChangeTwoPhaseMixture.C | 13 ++--- .../dragModels/dragModel/newDragModel.C | 13 +++-- .../heatTransferModel/newHeatTransferModel.C | 13 +++-- .../diameterModel/newDiameterModel.C | 18 +++---- .../newInterfaceCompositionModel.C | 13 +++-- .../massTransferModel/newMassTransferModel.C | 13 +++-- .../saturationModel/newSaturationModel.C | 14 +++--- .../newSurfaceTensionModel.C | 13 +++-- .../aspectRatioModel/newAspectRatioModel.C | 13 +++-- .../dragModels/dragModel/newDragModel.C | 13 +++-- .../heatTransferModel/newHeatTransferModel.C | 13 +++-- .../liftModels/liftModel/newLiftModel.C | 13 +++-- .../swarmCorrection/newSwarmCorrection.C | 13 +++-- .../newTurbulentDispersionModel.C | 13 +++-- .../virtualMassModel/newVirtualMassModel.C | 13 +++-- .../wallDampingModel/newWallDampingModel.C | 13 +++-- .../newWallLubricationModel.C | 13 +++-- .../blendingMethod/newBlendingMethod.C | 13 +++-- .../diameterModel/newDiameterModel.C | 18 +++---- .../phaseModel/phaseModel/newPhaseModel.C | 13 +++-- .../multiphaseSystem/newMultiphaseSystem.C | 14 +++--- .../newDepartureDiameterModel.C | 14 +++--- .../newDepartureFrequencyModel.C | 14 +++--- .../newNucleationSiteModel.C | 14 +++--- .../partitioningModel/newPartitioningModel.C | 14 +++--- .../conductivityModel/newConductivityModel.C | 21 ++++---- .../newFrictionalStressModel.C | 22 ++++----- .../newGranularPressureModel.C | 22 ++++----- .../radialModel/radialModel/newRadialModel.C | 22 ++++----- .../viscosityModel/newViscosityModel.C | 21 ++++---- .../IATE/IATEsources/IATEsource/IATEsource.C | 5 +- .../twoPhaseSystem/newTwoPhaseSystem.C | 14 +++--- .../aspectRatioModel/newAspectRatioModel.C | 13 +++-- .../dragModels/dragModel/newDragModel.C | 13 +++-- .../heatTransferModel/newHeatTransferModel.C | 13 +++-- .../liftModels/liftModel/newLiftModel.C | 13 +++-- .../swarmCorrection/newSwarmCorrection.C | 13 +++-- .../newTurbulentDispersionModel.C | 13 +++-- .../virtualMassModel/newVirtualMassModel.C | 13 +++-- .../newWallLubricationModel.C | 13 +++-- .../conductivityModel/newConductivityModel.C | 21 ++++---- .../newFrictionalStressModel.C | 22 ++++----- .../newGranularPressureModel.C | 22 ++++----- .../radialModel/radialModel/newRadialModel.C | 22 ++++----- .../viscosityModel/newViscosityModel.C | 21 ++++---- .../blendingMethod/newBlendingMethod.C | 13 +++-- .../IATE/IATEsources/IATEsource/IATEsource.C | 5 +- .../diameterModel/newDiameterModel.C | 18 +++---- .../cellSizeAndAlignmentControl.C | 30 +++--------- .../cellSizeFunction/cellSizeFunction.C | 21 ++++---- .../cellSizeCalculationType.C | 14 +++--- .../surfaceCellSizeFunction.C | 15 +++--- .../faceAreaWeightModel/faceAreaWeightModel.C | 35 +++++--------- .../initialPointsMethod/initialPointsMethod.C | 34 +++++-------- .../relaxationModel/relaxationModel.C | 34 +++++-------- .../searchableSurfaceFeatures.C | 9 ++-- .../faceSelection/faceSelection.C | 5 +- .../foamHelp/helpTypes/helpType/helpTypeNew.C | 3 +- .../tabulatedWallFunctionNew.C | 26 +++------- .../searchableSurfaceModifier.C | 5 +- src/ODE/ODESolvers/ODESolver/ODESolverNew.C | 11 ++--- src/OpenFOAM/db/IOstreams/token/token.C | 6 +-- .../functionEntry/functionEntry.C | 19 ++++---- .../functionObject/functionObject.C | 5 +- .../calculated/calculatedPointPatchField.C | 4 +- .../pointPatchField/pointPatchFieldNew.C | 25 +++++----- src/OpenFOAM/graph/graph.C | 9 ++-- .../tableReaders/tableReader.C | 13 ++--- .../interpolationWeights.C | 27 ++++------- .../LduMatrix/LduMatrixPreconditioner.C | 22 ++++----- .../LduMatrix/LduMatrix/LduMatrixSmoother.C | 18 ++++--- .../LduMatrix/LduMatrix/LduMatrixSolver.C | 20 ++++---- .../lduMatrix/lduMatrixPreconditioner.C | 14 +++--- .../lduMatrix/lduMatrix/lduMatrixSmoother.C | 14 +++--- .../lduMatrix/lduMatrix/lduMatrixSolver.C | 14 +++--- .../GAMGAgglomeration/GAMGAgglomeration.C | 16 +++---- .../GAMGProcAgglomeration.C | 5 +- .../GAMGInterfaceFieldNew.C | 10 ++-- .../GAMGInterface/GAMGInterfaceNew.C | 10 ++-- .../facePointPatch/facePointPatchNew.C | 8 ++-- .../polyPatches/polyPatch/polyPatch.C | 8 +--- .../polyPatches/polyPatch/polyPatchNew.C | 12 ++--- .../polyMesh/zones/cellZone/cellZoneNew.C | 5 +- .../polyMesh/zones/faceZone/faceZoneNew.C | 5 +- .../polyMesh/zones/pointZone/pointZoneNew.C | 5 +- .../Function1/Function1/Function1New.C | 10 ++-- .../turbulenceModels/LES/LESModel/LESModel.C | 3 +- .../LES/LESdeltas/LESdelta/LESdelta.C | 48 ++++++++----------- .../LES/LESfilters/LESfilter/LESfilter.C | 5 +- .../turbulenceModels/RAS/RASModel/RASModel.C | 3 +- .../TurbulenceModel/TurbulenceModel.C | 7 ++- .../laminar/laminarModel/laminarModel.C | 5 +- .../reactionRateFlameAreaNew.C | 10 ++-- .../psiCombustionModelNew.C | 7 ++- .../rhoCombustionModelNew.C | 7 ++- .../dynamicFvMesh/dynamicFvMeshNew.C | 5 +- .../meshCut/cellLooper/cellLooper.C | 7 ++- .../displacement/displacementMotionSolver.C | 5 +- .../solidBodyMotionFunctionNew.C | 5 +- .../motionSolvers/motionSolver/motionSolver.C | 11 ++--- .../polyMeshModifier/polyMeshModifierNew.C | 5 +- .../engineMesh/engineMesh/engineMeshNew.C | 5 +- src/fileFormats/sampledSetWriters/writer.C | 5 +- .../SRF/SRFModel/SRFModel/SRFModelNew.C | 5 +- .../cfdTools/general/fvOptions/fvOption.C | 12 ++--- .../porosityModel/porosityModelNew.C | 3 +- .../basic/calculated/calculatedFvPatchField.C | 3 +- .../fvPatchField/fvPatchFieldNew.C | 24 ++++------ .../calculated/calculatedFvsPatchField.C | 3 +- .../fvsPatchField/fvsPatchFieldNew.C | 27 +++++------ .../convectionScheme/convectionScheme.C | 12 ++--- .../d2dt2Schemes/d2dt2Scheme/d2dt2Scheme.C | 6 +-- .../ddtSchemes/ddtScheme/ddtScheme.C | 6 +-- .../divSchemes/divScheme/divScheme.C | 3 +- .../gradSchemes/gradScheme/gradScheme.C | 6 +-- .../laplacianScheme/laplacianScheme.C | 6 +-- .../snGradSchemes/snGradScheme/snGradScheme.C | 7 ++- .../fvMesh/fvPatches/fvPatch/fvPatch.C | 8 +--- .../fvMesh/fvPatches/fvPatch/fvPatchNew.C | 5 +- .../patchDistMethod/patchDistMethod.C | 26 +++++----- .../interpolation/interpolationNew.C | 3 +- .../limitedSurfaceInterpolationScheme.C | 14 +++--- .../multivariateSurfaceInterpolationScheme.C | 7 ++- .../surfaceInterpolationScheme.C | 17 +++---- .../fieldValues/fieldValue/fieldValueNew.C | 5 +- .../graphics/runTimePostProcessing/pathline.C | 5 +- .../runTimePostProcessing/pointData.C | 5 +- .../graphics/runTimePostProcessing/surface.C | 5 +- .../runTimeCondition/runTimeConditionNew.C | 7 ++- .../motionDiffusivity/motionDiffusivity.C | 5 +- .../motionInterpolation/motionInterpolation.C | 6 +-- .../profileModel/profileModel.C | 11 ++--- .../trimModel/trimModel/trimModelNew.C | 5 +- .../BinaryCollisionModelNew.C | 5 +- .../InflowBoundaryModelNew.C | 5 +- .../WallInteractionModelNew.C | 5 +- .../distributionModel/distributionModelNew.C | 8 ++-- .../IntegrationScheme/IntegrationSchemeNew.C | 5 +- .../CloudFunctionObjectNew.C | 5 +- .../CollisionModel/CollisionModelNew.C | 14 +++--- .../PairModel/PairModel/PairModelNew.C | 17 ++++--- .../WallModel/WallModel/WallModelNew.C | 16 +++---- .../DispersionModel/DispersionModelNew.C | 7 ++- .../InjectionModel/InjectionModelNew.C | 18 +++---- .../ParticleForce/ParticleForceNew.C | 8 ++-- .../PatchInteractionModelNew.C | 5 +- .../StochasticCollisionModelNew.C | 15 +++--- .../SurfaceFilmModel/SurfaceFilmModelNew.C | 7 ++- .../AveragingMethod/AveragingMethod.C | 11 ++--- .../CorrectionLimitingMethod.C | 9 ++-- .../DampingModels/DampingModel/DampingModel.C | 9 ++-- .../IsotropyModel/IsotropyModel.C | 9 ++-- .../PackingModels/PackingModel/PackingModel.C | 9 ++-- .../ParticleStressModel/ParticleStressModel.C | 11 ++--- .../TimeScaleModel/TimeScaleModel.C | 11 ++--- .../CompositionModel/CompositionModelNew.C | 7 ++- .../PhaseChangeModel/PhaseChangeModelNew.C | 7 ++- .../DevolatilisationModelNew.C | 7 ++- .../SurfaceReactionModelNew.C | 7 ++- .../HeatTransferModel/HeatTransferModelNew.C | 7 ++- .../basic/energyScalingFunctionNew.C | 5 +- .../pairPotential/basic/pairPotentialNew.C | 5 +- .../basic/tetherPotentialNew.C | 5 +- .../AtomizationModel/AtomizationModelNew.C | 17 ++++--- .../BreakupModel/BreakupModelNew.C | 17 ++++--- .../blockEdges/blockEdge/blockEdge.C | 5 +- .../blockFaces/blockFace/blockFace.C | 5 +- .../blockVertices/blockVertex/blockVertex.C | 5 +- src/mesh/blockMesh/blocks/block/block.C | 3 +- .../extrudeModel/extrudeModelNew.C | 5 +- .../externalDisplacementMeshMover.C | 3 +- .../AMIMethod/AMIMethod/AMIMethodNew.C | 8 ++-- .../coordinateRotationNew.C | 4 +- .../coordinateRotation/cylindrical.C | 6 +-- .../coordinateRotation/cylindrical.H | 2 +- .../coordinateSystems/coordinateSystemNew.C | 2 +- src/meshTools/edgeMesh/edgeMeshIO.C | 5 +- src/meshTools/edgeMesh/edgeMeshNew.C | 5 +- .../extendedEdgeMesh/extendedEdgeMeshNew.C | 5 +- .../searchableSurface/searchableSurface.C | 9 ++-- .../sets/topoSetSource/topoSetSource.C | 18 ++++--- src/meshTools/sets/topoSets/topoSet.C | 27 +++++------ .../cellCellStencil/cellCellStencil.C | 10 ++-- .../decompositionConstraint.C | 5 +- .../decompositionMethod/decompositionMethod.C | 7 ++- .../noiseModels/noiseModel/noiseModelNew.C | 5 +- .../windowModels/windowModel/windowModelNew.C | 5 +- .../pyrolysisModel/pyrolysisModelNew.C | 16 +++---- .../regionModelFunctionObjectNew.C | 5 +- .../filmThermoModel/filmThermoModelNew.C | 11 +++-- .../filmTurbulenceModelNew.C | 10 ++-- .../kinematic/force/force/forceNew.C | 11 ++--- .../injectionModel/injectionModelNew.C | 10 ++-- .../filmRadiationModelNew.C | 12 ++--- .../filmViscosityModelNew.C | 12 ++--- .../heatTransferModel/heatTransferModelNew.C | 12 ++--- .../phaseChangeModel/phaseChangeModelNew.C | 12 ++--- .../surfaceFilmModel/surfaceFilmModelNew.C | 10 ++-- .../thermalBaffleModelNew.C | 19 ++++---- .../renumberMethod/renumberMethod.C | 3 +- .../bodies/rigidBody/rigidBody.C | 5 +- src/rigidBodyDynamics/joints/joint/joint.C | 5 +- .../restraint/rigidBodyRestraintNew.C | 5 +- .../rigidBodySolver/newRigidBodySolver.C | 11 ++--- .../meshToMeshMethod/meshToMeshMethodNew.C | 8 ++-- .../sampledSet/sampledSet/sampledSet.C | 3 +- .../sampledSurface/readers/surfaceReaderNew.C | 3 +- .../sampledSurface/sampledSurface.C | 5 +- .../sampledSurface/writers/surfaceWriter.C | 6 +-- .../surfMeshSampler/surfMeshSampler.C | 3 +- .../sixDoFRigidBodyMotionConstraintNew.C | 5 +- .../sixDoFRigidBodyMotionRestraintNew.C | 5 +- .../sixDoFSolver/newSixDoFSolver.C | 13 +++-- src/surfMesh/MeshedSurface/MeshedSurface.C | 2 +- src/surfMesh/MeshedSurface/MeshedSurfaceNew.C | 2 +- .../MeshedSurfaceProxy/MeshedSurfaceProxy.C | 2 +- .../UnsortedMeshedSurface.C | 2 +- .../UnsortedMeshedSurfaceNew.C | 2 +- .../barotropicCompressibilityModelNew.C | 5 +- .../basic/basicThermo/basicThermoTemplates.C | 8 ++-- .../chemistryReductionMethodNew.C | 14 +++--- .../chemistryTabulationMethodNew.C | 12 ++--- .../basicChemistryModelTemplates.C | 16 ++++--- .../laminarFlameSpeed/laminarFlameSpeedNew.C | 5 +- .../radiationModel/radiationModelNew.C | 10 ++-- .../absorptionEmissionModelNew.C | 8 ++-- .../scatterModel/scatterModelNew.C | 5 +- .../sootModel/sootModel/sootModelNew.C | 8 ++-- .../transmissivityModelNew.C | 5 +- .../chemistryReader/chemistryReader.C | 13 +++-- .../basicSolidChemistryModelNew.C | 3 +- .../reaction/Reactions/Reaction/Reaction.C | 5 +- .../liquidProperties/liquidProperties.C | 24 +++++----- .../solidProperties/solidPropertiesNew.C | 9 ++-- .../thermophysicalFunction.C | 18 +++---- .../thermophysicalProperties.C | 11 ++--- .../viscosityModel/viscosityModelNew.C | 5 +- .../surfaceTensionModelNew.C | 14 +++--- src/waveModels/waveModel/waveModelNew.C | 5 +- 246 files changed, 1109 insertions(+), 1481 deletions(-) diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C b/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C index 6a6581182b..25a4a2098e 100644 --- a/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C +++ b/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C @@ -40,15 +40,14 @@ Foam::autoPtr Foam::PDRDragModel::New Info<< "Selecting flame-wrinkling model " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown PDRDragModel type " << modelType << nl << nl - << "Valid PDRDragModels are : " << endl + << "Valid PDRDragModel types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModelNew.C b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModelNew.C index 932080e717..251d429c8f 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModelNew.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModelNew.C @@ -39,15 +39,14 @@ Foam::autoPtr Foam::XiEqModel::New Info<< "Selecting flame-wrinkling model " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown XiEqModel type " << modelType << nl << nl - << "Valid XiEqModels are : " << endl + << "Valid XiEqModel types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModelNew.C b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModelNew.C index 27fe3f5e17..b46192ea38 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModelNew.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModelNew.C @@ -39,15 +39,14 @@ Foam::autoPtr Foam::XiGModel::New Info<< "Selecting flame-wrinkling model " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown XiGModel type " << modelType << nl << nl - << "Valid XiGModels are : " << endl + << "Valid XiGModel types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModelNew.C b/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModelNew.C index ed9dfb2fb3..c2dccb0180 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModelNew.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModelNew.C @@ -42,15 +42,14 @@ Foam::autoPtr Foam::XiModel::New Info<< "Selecting flame-wrinkling model " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown XiModel type " << modelType << nl << nl - << "Valid XiModels are : " << endl + << "Valid XiModel types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/mixtureViscosityModel/mixtureViscosityModelNew.C b/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/mixtureViscosityModel/mixtureViscosityModelNew.C index 99c33123e8..b21c4b7b51 100644 --- a/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/mixtureViscosityModel/mixtureViscosityModelNew.C +++ b/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/mixtureViscosityModel/mixtureViscosityModelNew.C @@ -41,15 +41,14 @@ Foam::autoPtr Foam::mixtureViscosityModel::New Info<< "Selecting incompressible transport model " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown mixtureViscosityModel type " << modelType << nl << nl - << "Valid mixtureViscosityModels are : " << endl + << "Valid mixtureViscosityModel types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C index cf8abd2e6e..f497b3c988 100644 --- a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C +++ b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C @@ -104,19 +104,18 @@ Foam::autoPtr Foam::relativeVelocityModel::New const incompressibleTwoPhaseInteractingMixture& mixture ) { - word modelType(dict.lookup(typeName)); + const word modelType(dict.lookup(typeName)); Info<< "Selecting relative velocity model " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown time scale model type " << modelType - << ", constructor not in hash table" << nl << nl - << " Valid time scale model types are:" << nl + << "Unknown time scale model type " + << modelType << nl << nl + << "Valid time scale model types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); } @@ -141,13 +140,13 @@ Foam::relativeVelocityModel::~relativeVelocityModel() // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // -tmp Foam::relativeVelocityModel::rho() const +Foam::tmp Foam::relativeVelocityModel::rho() const { return alphac_*rhoc_ + alphad_*rhod_; } -tmp Foam::relativeVelocityModel::tauDm() const +Foam::tmp Foam::relativeVelocityModel::tauDm() const { volScalarField betac(alphac_*rhoc_); volScalarField betad(alphad_*rhod_); diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/newtemperaturePhaseChangeTwoPhaseMixture.C b/applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/newtemperaturePhaseChangeTwoPhaseMixture.C index e4d71d2397..137710d217 100644 --- a/applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/newtemperaturePhaseChangeTwoPhaseMixture.C +++ b/applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/newtemperaturePhaseChangeTwoPhaseMixture.C @@ -48,7 +48,7 @@ Foam::temperaturePhaseChangeTwoPhaseMixture::New ) ); - word temperaturePhaseChangeTwoPhaseMixtureTypeName + const word modelType ( phaseChangePropertiesDict.lookup ( @@ -56,19 +56,16 @@ Foam::temperaturePhaseChangeTwoPhaseMixture::New ) ); - Info<< "Selecting phaseChange model " - << temperaturePhaseChangeTwoPhaseMixtureTypeName << endl; + Info<< "Selecting phaseChange model " << modelType << endl; - componentsConstructorTable::iterator cstrIter = - componentsConstructorTablePtr_ - ->find(temperaturePhaseChangeTwoPhaseMixtureTypeName); + auto cstrIter = componentsConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown temperaturePhaseChangeTwoPhaseMixture type " - << temperaturePhaseChangeTwoPhaseMixtureTypeName << endl << endl - << "Valid temperaturePhaseChangeTwoPhaseMixtures are : " << endl + << modelType << nl << nl + << "Valid temperaturePhaseChangeTwoPhaseMixture types :" << endl << componentsConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C index c14fa08d59..534c1383e2 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C @@ -48,24 +48,21 @@ Foam::phaseChangeTwoPhaseMixture::New ) ); - word phaseChangeTwoPhaseMixtureTypeName + const word modelType ( transportPropertiesDict.lookup("phaseChangeTwoPhaseMixture") ); - Info<< "Selecting phaseChange model " - << phaseChangeTwoPhaseMixtureTypeName << endl; + Info<< "Selecting phaseChange model " << modelType << endl; - componentsConstructorTable::iterator cstrIter = - componentsConstructorTablePtr_ - ->find(phaseChangeTwoPhaseMixtureTypeName); + auto cstrIter = componentsConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown phaseChangeTwoPhaseMixture type " - << phaseChangeTwoPhaseMixtureTypeName << endl << endl - << "Valid phaseChangeTwoPhaseMixtures are : " << endl + << modelType << nl << nl + << "Valid phaseChangeTwoPhaseMixture types :" << endl << componentsConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C index b880c4a6d3..36765ebc3c 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C @@ -34,22 +34,21 @@ Foam::autoPtr Foam::dragModel::New const phaseModel& phase2 ) { - word dragModelType(interfaceDict.lookup("type")); + const word modelType(interfaceDict.lookup("type")); Info << "Selecting dragModel for phase " << phase1.name() << ": " - << dragModelType << endl; + << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(dragModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown dragModelType type " - << dragModelType << endl << endl - << "Valid dragModel types are : " << endl + << "Unknown dragModel type " + << modelType << nl << nl + << "Valid dragModel types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C index b43d46f8a3..db5d68f829 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C @@ -35,7 +35,7 @@ Foam::autoPtr Foam::heatTransferModel::New const phaseModel& phase2 ) { - word heatTransferModelType + const word modelType ( interfaceDict.lookup("heatTransferModel" + phase1.name()) ); @@ -43,17 +43,16 @@ Foam::autoPtr Foam::heatTransferModel::New Info<< "Selecting heatTransferModel for phase " << phase1.name() << ": " - << heatTransferModelType << endl; + << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(heatTransferModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown heatTransferModelType type " - << heatTransferModelType << endl << endl - << "Valid heatTransferModel types are : " << endl + << "Unknown heatTransferModel type " + << modelType << nl << nl + << "Valid heatTransferModel types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/diameterModels/diameterModel/newDiameterModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/diameterModels/diameterModel/newDiameterModel.C index 963ad160f7..fc4000975d 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/diameterModels/diameterModel/newDiameterModel.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/diameterModels/diameterModel/newDiameterModel.C @@ -33,32 +33,28 @@ Foam::autoPtr Foam::diameterModel::New const phaseModel& phase ) { - word diameterModelType - ( - dict.lookup("diameterModel") - ); + const word modelType(dict.lookup("diameterModel")); Info << "Selecting diameterModel for phase " << phase.name() << ": " - << diameterModelType << endl; + << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(diameterModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown diameterModelType type " - << diameterModelType << endl << endl - << "Valid diameterModel types are : " << endl + << "Unknown diameterModel type " + << modelType << nl << nl + << "Valid diameterModel types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } return cstrIter() ( - dict.optionalSubDict(diameterModelType + "Coeffs"), + dict.optionalSubDict(modelType + "Coeffs"), phase ); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/newInterfaceCompositionModel.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/newInterfaceCompositionModel.C index fee1253108..9b55bb0358 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/newInterfaceCompositionModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/newInterfaceCompositionModel.C @@ -36,7 +36,7 @@ Foam::interfaceCompositionModel::New const phasePair& pair ) { - word interfaceCompositionModelType + const word modelType ( word(dict.lookup("type")) + "<" @@ -47,17 +47,16 @@ Foam::interfaceCompositionModel::New ); Info<< "Selecting interfaceCompositionModel for " - << pair << ": " << interfaceCompositionModelType << endl; + << pair << ": " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(interfaceCompositionModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown interfaceCompositionModelType type " - << interfaceCompositionModelType << endl << endl - << "Valid interfaceCompositionModel types are : " << endl + << "Unknown interfaceCompositionModel type " + << modelType << nl << nl + << "Valid interfaceCompositionModel types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/massTransferModels/massTransferModel/newMassTransferModel.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/massTransferModels/massTransferModel/newMassTransferModel.C index 3b349be693..8ae0f6f552 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/massTransferModels/massTransferModel/newMassTransferModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/massTransferModels/massTransferModel/newMassTransferModel.C @@ -34,20 +34,19 @@ Foam::autoPtr Foam::massTransferModel::New const phasePair& pair ) { - word massTransferModelType(dict.lookup("type")); + const word modelType(dict.lookup("type")); Info<< "Selecting massTransferModel for " - << pair << ": " << massTransferModelType << endl; + << pair << ": " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(massTransferModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown massTransferModelType type " - << massTransferModelType << endl << endl - << "Valid massTransferModel types are : " << endl + << "Unknown massTransferModel type " + << modelType << nl << nl + << "Valid massTransferModel types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/saturationModel/newSaturationModel.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/saturationModel/newSaturationModel.C index 17fc43cac4..fb59ed2574 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/saturationModel/newSaturationModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/saturationModel/newSaturationModel.C @@ -32,20 +32,18 @@ Foam::autoPtr Foam::saturationModel::New const dictionary& dict ) { - word saturationModelType(dict.lookup("type")); + const word modelType(dict.lookup("type")); - Info<< "Selecting saturationModel: " - << saturationModelType << endl; + Info<< "Selecting saturationModel: " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(saturationModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown saturationModelType type " - << saturationModelType << endl << endl - << "Valid saturationModel types are : " << endl + << "Unknown saturationModel type " + << modelType << nl << nl + << "Valid saturationModel types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/newSurfaceTensionModel.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/newSurfaceTensionModel.C index f2c28eeb5d..57be04722d 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/newSurfaceTensionModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/newSurfaceTensionModel.C @@ -35,20 +35,19 @@ Foam::surfaceTensionModel::New const phasePair& pair ) { - word surfaceTensionModelType(dict.lookup("type")); + const word modelType(dict.lookup("type")); Info<< "Selecting surfaceTensionModel for " - << pair << ": " << surfaceTensionModelType << endl; + << pair << ": " << modelType << endl; - multiphaseConstructorTable::iterator cstrIter = - multiphaseConstructorTablePtr_->find(surfaceTensionModelType); + auto cstrIter = multiphaseConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown surfaceTensionModelType type " - << surfaceTensionModelType << endl << endl - << "Valid surfaceTensionModel types are : " << endl + << "Unknown surfaceTensionModel type " + << modelType << nl << nl + << "Valid surfaceTensionModel types :" << endl << multiphaseConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/newAspectRatioModel.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/newAspectRatioModel.C index 2946810cf5..5b44995b4e 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/newAspectRatioModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/newAspectRatioModel.C @@ -35,20 +35,19 @@ Foam::aspectRatioModel::New const phasePair& pair ) { - word aspectRatioModelType(dict.lookup("type")); + const word modelType(dict.lookup("type")); Info<< "Selecting aspectRatioModel for " - << pair << ": " << aspectRatioModelType << endl; + << pair << ": " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(aspectRatioModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown aspectRatioModelType type " - << aspectRatioModelType << endl << endl - << "Valid aspectRatioModel types are : " << endl + << "Unknown aspectRatioModel type " + << modelType << nl << nl + << "Valid aspectRatioModel types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C index c2a5f4074e..de8bc17cda 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C @@ -34,20 +34,19 @@ Foam::autoPtr Foam::dragModel::New const phasePair& pair ) { - word dragModelType(dict.lookup("type")); + const word modelType(dict.lookup("type")); Info<< "Selecting dragModel for " - << pair << ": " << dragModelType << endl; + << pair << ": " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(dragModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown dragModelType type " - << dragModelType << endl << endl - << "Valid dragModel types are : " << endl + << "Unknown dragModel type " + << modelType << nl << nl + << "Valid dragModel types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C index 46e43f6b11..71654baea6 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C @@ -34,20 +34,19 @@ Foam::autoPtr Foam::heatTransferModel::New const phasePair& pair ) { - word heatTransferModelType(dict.lookup("type")); + const word modelType(dict.lookup("type")); Info<< "Selecting heatTransferModel for " - << pair << ": " << heatTransferModelType << endl; + << pair << ": " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(heatTransferModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown heatTransferModelType type " - << heatTransferModelType << endl << endl - << "Valid heatTransferModel types are : " << endl + << "Unknown heatTransferModel type " + << modelType << nl << nl + << "Valid heatTransferModel types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/liftModel/newLiftModel.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/liftModel/newLiftModel.C index 8dbdd5479c..a0fd721dfb 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/liftModel/newLiftModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/liftModel/newLiftModel.C @@ -34,20 +34,19 @@ Foam::autoPtr Foam::liftModel::New const phasePair& pair ) { - word liftModelType(dict.lookup("type")); + const word modelType(dict.lookup("type")); Info<< "Selecting liftModel for " - << pair << ": " << liftModelType << endl; + << pair << ": " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(liftModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown liftModelType type " - << liftModelType << endl << endl - << "Valid liftModel types are : " << endl + << "Unknown liftModel type " + << modelType << nl << nl + << "Valid liftModel types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/newSwarmCorrection.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/newSwarmCorrection.C index fb16d05418..a3f312de8f 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/newSwarmCorrection.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/newSwarmCorrection.C @@ -35,20 +35,19 @@ Foam::swarmCorrection::New const phasePair& pair ) { - word swarmCorrectionType(dict.lookup("type")); + const word correctionType(dict.lookup("type")); Info<< "Selecting swarmCorrection for " - << pair << ": " << swarmCorrectionType << endl; + << pair << ": " << correctionType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(swarmCorrectionType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(correctionType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown swarmCorrectionType type " - << swarmCorrectionType << endl << endl - << "Valid swarmCorrection types are : " << endl + << "Unknown swarmCorrection type " + << correctionType << nl << nl + << "Valid swarmCorrection types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/newTurbulentDispersionModel.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/newTurbulentDispersionModel.C index 53266ae6b2..123bad7691 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/newTurbulentDispersionModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/newTurbulentDispersionModel.C @@ -35,20 +35,19 @@ Foam::turbulentDispersionModel::New const phasePair& pair ) { - word turbulentDispersionModelType(dict.lookup("type")); + const word modelType(dict.lookup("type")); Info<< "Selecting turbulentDispersionModel for " - << pair << ": " << turbulentDispersionModelType << endl; + << pair << ": " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(turbulentDispersionModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown turbulentDispersionModelType type " - << turbulentDispersionModelType << endl << endl - << "Valid turbulentDispersionModel types are : " << endl + << "Unknown turbulentDispersionModel type " + << modelType << nl << nl + << "Valid turbulentDispersionModel types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/newVirtualMassModel.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/newVirtualMassModel.C index 1b092c197e..6884a6b3be 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/newVirtualMassModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/newVirtualMassModel.C @@ -34,20 +34,19 @@ Foam::autoPtr Foam::virtualMassModel::New const phasePair& pair ) { - word virtualMassModelType(dict.lookup("type")); + const word modelType(dict.lookup("type")); Info<< "Selecting virtualMassModel for " - << pair << ": " << virtualMassModelType << endl; + << pair << ": " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(virtualMassModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown virtualMassModelType type " - << virtualMassModelType << endl << endl - << "Valid virtualMassModel types are : " << endl + << "Unknown virtualMassModel type " + << modelType << nl << nl + << "Valid virtualMassModel types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/wallDampingModel/newWallDampingModel.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/wallDampingModel/newWallDampingModel.C index 83ad7b42e5..bb59931dc1 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/wallDampingModel/newWallDampingModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/wallDampingModel/newWallDampingModel.C @@ -34,20 +34,19 @@ Foam::autoPtr Foam::wallDampingModel::New const phasePair& pair ) { - word wallDampingModelType(dict.lookup("type")); + const word modelType(dict.lookup("type")); Info<< "Selecting wallDampingModel for " - << pair << ": " << wallDampingModelType << endl; + << pair << ": " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(wallDampingModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown wallDampingModelType type " - << wallDampingModelType << endl << endl - << "Valid wallDampingModel types are : " << endl + << "Unknown wallDampingModel type " + << modelType << nl << nl + << "Valid wallDampingModel types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/newWallLubricationModel.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/newWallLubricationModel.C index 806a1dd3b3..2cfddbd92c 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/newWallLubricationModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/newWallLubricationModel.C @@ -34,20 +34,19 @@ Foam::autoPtr Foam::wallLubricationModel::New const phasePair& pair ) { - word wallLubricationModelType(dict.lookup("type")); + const word modelType(dict.lookup("type")); Info<< "Selecting wallLubricationModel for " - << pair << ": " << wallLubricationModelType << endl; + << pair << ": " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(wallLubricationModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown wallLubricationModelType type " - << wallLubricationModelType << endl << endl - << "Valid wallLubricationModel types are : " << endl + << "Unknown wallLubricationModel type " + << modelType << nl << nl + << "Valid wallLubricationModel types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/blendingMethod/newBlendingMethod.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/blendingMethod/newBlendingMethod.C index cbb33a5fbd..8324dc52bc 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/blendingMethod/newBlendingMethod.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/blendingMethod/newBlendingMethod.C @@ -33,20 +33,19 @@ Foam::autoPtr Foam::blendingMethod::New const wordList& phaseNames ) { - word blendingMethodType(dict.lookup("type")); + const word methodType(dict.lookup("type")); Info<< "Selecting " << dict.dictName() << " blending method: " - << blendingMethodType << endl; + << methodType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(blendingMethodType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(methodType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown blendingMethodType type " - << blendingMethodType << endl << endl - << "Valid blendingMethod types are : " << endl + << "Unknown blendingMethod type " + << methodType << nl << nl + << "Valid blendingMethod types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/newDiameterModel.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/newDiameterModel.C index 963ad160f7..fc4000975d 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/newDiameterModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/newDiameterModel.C @@ -33,32 +33,28 @@ Foam::autoPtr Foam::diameterModel::New const phaseModel& phase ) { - word diameterModelType - ( - dict.lookup("diameterModel") - ); + const word modelType(dict.lookup("diameterModel")); Info << "Selecting diameterModel for phase " << phase.name() << ": " - << diameterModelType << endl; + << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(diameterModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown diameterModelType type " - << diameterModelType << endl << endl - << "Valid diameterModel types are : " << endl + << "Unknown diameterModel type " + << modelType << nl << nl + << "Valid diameterModel types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } return cstrIter() ( - dict.optionalSubDict(diameterModelType + "Coeffs"), + dict.optionalSubDict(modelType + "Coeffs"), phase ); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/newPhaseModel.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/newPhaseModel.C index c42b86070d..d78fdbba5a 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/newPhaseModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/newPhaseModel.C @@ -35,20 +35,19 @@ Foam::autoPtr Foam::phaseModel::New const label index ) { - word phaseModelType(fluid.subDict(phaseName).lookup("type")); + const word modelType(fluid.subDict(phaseName).lookup("type")); Info<< "Selecting phaseModel for " - << phaseName << ": " << phaseModelType << endl; + << phaseName << ": " << modelType << endl; - phaseSystemConstructorTable::iterator cstrIter = - phaseSystemConstructorTablePtr_->find(phaseModelType); + auto cstrIter = phaseSystemConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown phaseModelType type " - << phaseModelType << endl << endl - << "Valid phaseModel types are : " << endl + << "Unknown phaseModel type " + << modelType << nl << nl + << "Valid phaseModel types :" << endl << phaseSystemConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/newMultiphaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/newMultiphaseSystem.C index 0f116c7040..ae09589634 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/newMultiphaseSystem.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/newMultiphaseSystem.C @@ -32,7 +32,7 @@ Foam::autoPtr Foam::multiphaseSystem::New const fvMesh& mesh ) { - const word multiphaseSystemType + const word systemType ( IOdictionary ( @@ -48,18 +48,16 @@ Foam::autoPtr Foam::multiphaseSystem::New ).lookup("type") ); - Info<< "Selecting multiphaseSystem " - << multiphaseSystemType << endl; + Info<< "Selecting multiphaseSystem " << systemType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(multiphaseSystemType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(systemType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown multiphaseSystemType type " - << multiphaseSystemType << endl << endl - << "Valid multiphaseSystem types are : " << endl + << "Unknown multiphaseSystem type " + << systemType << nl << nl + << "Valid multiphaseSystem types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/newDepartureDiameterModel.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/newDepartureDiameterModel.C index dcc0cc0d0f..94bbba3212 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/newDepartureDiameterModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/newDepartureDiameterModel.C @@ -33,20 +33,18 @@ Foam::wallBoilingModels::departureDiameterModel::New const dictionary& dict ) { - word departureDiameterModelType(dict.lookup("type")); + const word modelType(dict.lookup("type")); - Info<< "Selecting departureDiameterModel: " - << departureDiameterModelType << endl; + Info<< "Selecting departureDiameterModel: " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(departureDiameterModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown departureDiameterModelType type " - << departureDiameterModelType << endl << endl - << "Valid departureDiameterModel types are : " << endl + << "Unknown departureDiameterModel type " + << modelType << nl << nl + << "Valid departureDiameterModel types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/newDepartureFrequencyModel.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/newDepartureFrequencyModel.C index 13987ff4b0..136224813a 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/newDepartureFrequencyModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/newDepartureFrequencyModel.C @@ -33,20 +33,18 @@ Foam::wallBoilingModels::departureFrequencyModel::New const dictionary& dict ) { - word departureFrequencyModelType(dict.lookup("type")); + const word modelType(dict.lookup("type")); - Info<< "Selecting departureFrequencyModel: " - << departureFrequencyModelType << endl; + Info<< "Selecting departureFrequencyModel: " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(departureFrequencyModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown departureFrequencyModelType type " - << departureFrequencyModelType << endl << endl - << "Valid departureFrequencyModel types are : " << endl + << "Unknown departureFrequencyModel type " + << modelType << nl << nl + << "Valid departureFrequencyModel types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/newNucleationSiteModel.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/newNucleationSiteModel.C index 32f2d5a520..6338ab6669 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/newNucleationSiteModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/newNucleationSiteModel.C @@ -33,20 +33,18 @@ Foam::wallBoilingModels::nucleationSiteModel::New const dictionary& dict ) { - word nucleationSiteModelType(dict.lookup("type")); + const word modelType(dict.lookup("type")); - Info<< "Selecting nucleationSiteModel: " - << nucleationSiteModelType << endl; + Info<< "Selecting nucleationSiteModel: " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(nucleationSiteModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown nucleationSiteModelType type " - << nucleationSiteModelType << endl << endl - << "Valid nucleationSiteModel types are : " << endl + << "Unknown nucleationSiteModel type " + << modelType << nl << nl + << "Valid nucleationSiteModel types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/newPartitioningModel.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/newPartitioningModel.C index 6cf6d1d64c..ddc57a3e65 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/newPartitioningModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/newPartitioningModel.C @@ -33,20 +33,18 @@ Foam::wallBoilingModels::partitioningModel::New const dictionary& dict ) { - word partitioningModelType(dict.lookup("type")); + const word modelType(dict.lookup("type")); - Info<< "Selecting partitioningModel: " - << partitioningModelType << endl; + Info<< "Selecting partitioningModel: " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(partitioningModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown partitioningModelType type " - << partitioningModelType << endl << endl - << "Valid partitioningModel types are : " << endl + << "Unknown partitioningModel type " + << modelType << nl << nl + << "Valid partitioningModel types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C index bfadfc6399..e4a3a64634 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C @@ -33,23 +33,20 @@ Foam::kineticTheoryModels::conductivityModel::New const dictionary& dict ) { - word conductivityModelType(dict.lookup("conductivityModel")); + const word modelType(dict.lookup("conductivityModel")); - Info<< "Selecting conductivityModel " - << conductivityModelType << endl; + Info<< "Selecting conductivityModel " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(conductivityModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalError - << "conductivityModel::New(const dictionary&) : " << endl - << " unknown conductivityModelType type " - << conductivityModelType - << ", constructor not in hash table" << endl << endl - << " Valid conductivityModelType types are :" << endl; - Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); + FatalErrorInFunction + << "Unknown conductivityModel type " + << modelType << nl << nl + << "Valid conductivityModel types :" << endl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); } return autoPtr(cstrIter()(dict)); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C index b68c03470f..608cd1178d 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C @@ -33,24 +33,20 @@ Foam::kineticTheoryModels::frictionalStressModel::New const dictionary& dict ) { - word frictionalStressModelType(dict.lookup("frictionalStressModel")); + const word modelType(dict.lookup("frictionalStressModel")); - Info<< "Selecting frictionalStressModel " - << frictionalStressModelType << endl; + Info<< "Selecting frictionalStressModel " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(frictionalStressModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalError - << "frictionalStressModel::New(const dictionary&) : " << endl - << " unknown frictionalStressModelType type " - << frictionalStressModelType - << ", constructor not in hash table" << endl << endl - << " Valid frictionalStressModelType types are :" << endl; - Info<< dictionaryConstructorTablePtr_->sortedToc() - << abort(FatalError); + FatalErrorInFunction + << "Unknown frictionalStressModel type " + << modelType << nl << nl + << "Valid frictionalStressModel types :" << endl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); } return autoPtr(cstrIter()(dict)); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C index a1ce25337f..1810e248bf 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C @@ -33,24 +33,20 @@ Foam::kineticTheoryModels::granularPressureModel::New const dictionary& dict ) { - word granularPressureModelType(dict.lookup("granularPressureModel")); + const word modelType(dict.lookup("granularPressureModel")); - Info<< "Selecting granularPressureModel " - << granularPressureModelType << endl; + Info<< "Selecting granularPressureModel " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(granularPressureModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalError - << "granularPressureModel::New(const dictionary&) : " << endl - << " unknown granularPressureModelType type " - << granularPressureModelType - << ", constructor not in hash table" << endl << endl - << " Valid granularPressureModelType types are :" << endl; - Info<< dictionaryConstructorTablePtr_->sortedToc() - << abort(FatalError); + FatalErrorInFunction + << "Unknown granularPressureModel type " + << modelType << nl << nl + << "Valid granularPressureModel types : " << nl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); } return autoPtr(cstrIter()(dict)); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/newRadialModel.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/newRadialModel.C index 583ce1c3ad..0ac0a36afe 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/newRadialModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/newRadialModel.C @@ -33,24 +33,20 @@ Foam::kineticTheoryModels::radialModel::New const dictionary& dict ) { - word radialModelType(dict.lookup("radialModel")); + const word modelType(dict.lookup("radialModel")); - Info<< "Selecting radialModel " - << radialModelType << endl; + Info<< "Selecting radialModel " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(radialModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalError - << "radialModel::New(const dictionary&) : " << endl - << " unknown radialModelType type " - << radialModelType - << ", constructor not in hash table" << endl << endl - << " Valid radialModelType types are :" << endl; - Info<< dictionaryConstructorTablePtr_->sortedToc() - << abort(FatalError); + FatalErrorInFunction + << "Unknown radialModel type " + << modelType << nl << nl + << "Valid radialModel types :" << endl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); } return autoPtr(cstrIter()(dict)); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C index 361850b414..0120b2a1b4 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C @@ -33,23 +33,20 @@ Foam::kineticTheoryModels::viscosityModel::New const dictionary& dict ) { - word viscosityModelType(dict.lookup("viscosityModel")); + const word modelType(dict.lookup("viscosityModel")); - Info<< "Selecting viscosityModel " - << viscosityModelType << endl; + Info<< "Selecting viscosityModel " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(viscosityModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalError - << "viscosityModel::New(const dictionary&) : " << endl - << " unknown viscosityModelType type " - << viscosityModelType - << ", constructor not in hash table" << endl << endl - << " Valid viscosityModelType types are :" << endl; - Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); + FatalErrorInFunction + << "Unknown viscosityModel type " + << modelType << nl << nl + << "Valid viscosityModel types :" << nl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); } return autoPtr(cstrIter()(dict)); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.C index dfbd95e6b2..18a941099a 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.C @@ -50,15 +50,14 @@ Foam::diameterModels::IATEsource::New const dictionary& dict ) { - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(type); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(type); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown IATE source type " << type << nl << nl - << "Valid IATE source types : " << endl + << "Valid IATE source types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/newTwoPhaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/newTwoPhaseSystem.C index c2ca635873..50a2f015a7 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/newTwoPhaseSystem.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/newTwoPhaseSystem.C @@ -32,7 +32,7 @@ Foam::autoPtr Foam::twoPhaseSystem::New const fvMesh& mesh ) { - const word twoPhaseSystemType + const word systemType ( IOdictionary ( @@ -48,18 +48,16 @@ Foam::autoPtr Foam::twoPhaseSystem::New ).lookup("type") ); - Info<< "Selecting twoPhaseSystem " - << twoPhaseSystemType << endl; + Info<< "Selecting twoPhaseSystem " << systemType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(twoPhaseSystemType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(systemType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown twoPhaseSystemType type " - << twoPhaseSystemType << endl << endl - << "Valid twoPhaseSystem types are : " << endl + << "Unknown twoPhaseSystem type " + << systemType << nl << nl + << "Valid twoPhaseSystem types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/newAspectRatioModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/newAspectRatioModel.C index 2946810cf5..5b44995b4e 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/newAspectRatioModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/newAspectRatioModel.C @@ -35,20 +35,19 @@ Foam::aspectRatioModel::New const phasePair& pair ) { - word aspectRatioModelType(dict.lookup("type")); + const word modelType(dict.lookup("type")); Info<< "Selecting aspectRatioModel for " - << pair << ": " << aspectRatioModelType << endl; + << pair << ": " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(aspectRatioModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown aspectRatioModelType type " - << aspectRatioModelType << endl << endl - << "Valid aspectRatioModel types are : " << endl + << "Unknown aspectRatioModel type " + << modelType << nl << nl + << "Valid aspectRatioModel types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C index c2a5f4074e..de8bc17cda 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C @@ -34,20 +34,19 @@ Foam::autoPtr Foam::dragModel::New const phasePair& pair ) { - word dragModelType(dict.lookup("type")); + const word modelType(dict.lookup("type")); Info<< "Selecting dragModel for " - << pair << ": " << dragModelType << endl; + << pair << ": " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(dragModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown dragModelType type " - << dragModelType << endl << endl - << "Valid dragModel types are : " << endl + << "Unknown dragModel type " + << modelType << nl << nl + << "Valid dragModel types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C index 46e43f6b11..71654baea6 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C @@ -34,20 +34,19 @@ Foam::autoPtr Foam::heatTransferModel::New const phasePair& pair ) { - word heatTransferModelType(dict.lookup("type")); + const word modelType(dict.lookup("type")); Info<< "Selecting heatTransferModel for " - << pair << ": " << heatTransferModelType << endl; + << pair << ": " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(heatTransferModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown heatTransferModelType type " - << heatTransferModelType << endl << endl - << "Valid heatTransferModel types are : " << endl + << "Unknown heatTransferModel type " + << modelType << nl << nl + << "Valid heatTransferModel types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/liftModel/newLiftModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/liftModel/newLiftModel.C index 8dbdd5479c..a0fd721dfb 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/liftModel/newLiftModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/liftModel/newLiftModel.C @@ -34,20 +34,19 @@ Foam::autoPtr Foam::liftModel::New const phasePair& pair ) { - word liftModelType(dict.lookup("type")); + const word modelType(dict.lookup("type")); Info<< "Selecting liftModel for " - << pair << ": " << liftModelType << endl; + << pair << ": " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(liftModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown liftModelType type " - << liftModelType << endl << endl - << "Valid liftModel types are : " << endl + << "Unknown liftModel type " + << modelType << nl << nl + << "Valid liftModel types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/newSwarmCorrection.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/newSwarmCorrection.C index fb16d05418..5462b768a2 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/newSwarmCorrection.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/newSwarmCorrection.C @@ -35,20 +35,19 @@ Foam::swarmCorrection::New const phasePair& pair ) { - word swarmCorrectionType(dict.lookup("type")); + const word modelType(dict.lookup("type")); Info<< "Selecting swarmCorrection for " - << pair << ": " << swarmCorrectionType << endl; + << pair << ": " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(swarmCorrectionType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown swarmCorrectionType type " - << swarmCorrectionType << endl << endl - << "Valid swarmCorrection types are : " << endl + << "Unknown swarmCorrection type " + << modelType << nl << nl + << "Valid swarmCorrection types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/newTurbulentDispersionModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/newTurbulentDispersionModel.C index 53266ae6b2..123bad7691 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/newTurbulentDispersionModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/newTurbulentDispersionModel.C @@ -35,20 +35,19 @@ Foam::turbulentDispersionModel::New const phasePair& pair ) { - word turbulentDispersionModelType(dict.lookup("type")); + const word modelType(dict.lookup("type")); Info<< "Selecting turbulentDispersionModel for " - << pair << ": " << turbulentDispersionModelType << endl; + << pair << ": " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(turbulentDispersionModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown turbulentDispersionModelType type " - << turbulentDispersionModelType << endl << endl - << "Valid turbulentDispersionModel types are : " << endl + << "Unknown turbulentDispersionModel type " + << modelType << nl << nl + << "Valid turbulentDispersionModel types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/newVirtualMassModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/newVirtualMassModel.C index 1b092c197e..6884a6b3be 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/newVirtualMassModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/newVirtualMassModel.C @@ -34,20 +34,19 @@ Foam::autoPtr Foam::virtualMassModel::New const phasePair& pair ) { - word virtualMassModelType(dict.lookup("type")); + const word modelType(dict.lookup("type")); Info<< "Selecting virtualMassModel for " - << pair << ": " << virtualMassModelType << endl; + << pair << ": " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(virtualMassModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown virtualMassModelType type " - << virtualMassModelType << endl << endl - << "Valid virtualMassModel types are : " << endl + << "Unknown virtualMassModel type " + << modelType << nl << nl + << "Valid virtualMassModel types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/newWallLubricationModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/newWallLubricationModel.C index 806a1dd3b3..2cfddbd92c 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/newWallLubricationModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/newWallLubricationModel.C @@ -34,20 +34,19 @@ Foam::autoPtr Foam::wallLubricationModel::New const phasePair& pair ) { - word wallLubricationModelType(dict.lookup("type")); + const word modelType(dict.lookup("type")); Info<< "Selecting wallLubricationModel for " - << pair << ": " << wallLubricationModelType << endl; + << pair << ": " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(wallLubricationModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown wallLubricationModelType type " - << wallLubricationModelType << endl << endl - << "Valid wallLubricationModel types are : " << endl + << "Unknown wallLubricationModel type " + << modelType << nl << nl + << "Valid wallLubricationModel types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C index bfadfc6399..e4a3a64634 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C @@ -33,23 +33,20 @@ Foam::kineticTheoryModels::conductivityModel::New const dictionary& dict ) { - word conductivityModelType(dict.lookup("conductivityModel")); + const word modelType(dict.lookup("conductivityModel")); - Info<< "Selecting conductivityModel " - << conductivityModelType << endl; + Info<< "Selecting conductivityModel " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(conductivityModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalError - << "conductivityModel::New(const dictionary&) : " << endl - << " unknown conductivityModelType type " - << conductivityModelType - << ", constructor not in hash table" << endl << endl - << " Valid conductivityModelType types are :" << endl; - Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); + FatalErrorInFunction + << "Unknown conductivityModel type " + << modelType << nl << nl + << "Valid conductivityModel types :" << endl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); } return autoPtr(cstrIter()(dict)); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C index b68c03470f..255b15593a 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C @@ -33,24 +33,20 @@ Foam::kineticTheoryModels::frictionalStressModel::New const dictionary& dict ) { - word frictionalStressModelType(dict.lookup("frictionalStressModel")); + const word modelType(dict.lookup("frictionalStressModel")); - Info<< "Selecting frictionalStressModel " - << frictionalStressModelType << endl; + Info<< "Selecting frictionalStressModel " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(frictionalStressModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalError - << "frictionalStressModel::New(const dictionary&) : " << endl - << " unknown frictionalStressModelType type " - << frictionalStressModelType - << ", constructor not in hash table" << endl << endl - << " Valid frictionalStressModelType types are :" << endl; - Info<< dictionaryConstructorTablePtr_->sortedToc() - << abort(FatalError); + FatalErrorInFunction + << "Unknown frictionalStressModel type " + << modelType << nl << nl + << "Valid frictionalStressModelType types :" << endl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); } return autoPtr(cstrIter()(dict)); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C index a1ce25337f..7898a94cca 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C @@ -33,24 +33,20 @@ Foam::kineticTheoryModels::granularPressureModel::New const dictionary& dict ) { - word granularPressureModelType(dict.lookup("granularPressureModel")); + const word modelType(dict.lookup("granularPressureModel")); - Info<< "Selecting granularPressureModel " - << granularPressureModelType << endl; + Info<< "Selecting granularPressureModel " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(granularPressureModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalError - << "granularPressureModel::New(const dictionary&) : " << endl - << " unknown granularPressureModelType type " - << granularPressureModelType - << ", constructor not in hash table" << endl << endl - << " Valid granularPressureModelType types are :" << endl; - Info<< dictionaryConstructorTablePtr_->sortedToc() - << abort(FatalError); + FatalErrorInFunction + << "Unknown granularPressureModel type " + << modelType << nl << nl + << "Valid granularPressureModel types :" << nl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); } return autoPtr(cstrIter()(dict)); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/newRadialModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/newRadialModel.C index 583ce1c3ad..0ac0a36afe 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/newRadialModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/newRadialModel.C @@ -33,24 +33,20 @@ Foam::kineticTheoryModels::radialModel::New const dictionary& dict ) { - word radialModelType(dict.lookup("radialModel")); + const word modelType(dict.lookup("radialModel")); - Info<< "Selecting radialModel " - << radialModelType << endl; + Info<< "Selecting radialModel " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(radialModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalError - << "radialModel::New(const dictionary&) : " << endl - << " unknown radialModelType type " - << radialModelType - << ", constructor not in hash table" << endl << endl - << " Valid radialModelType types are :" << endl; - Info<< dictionaryConstructorTablePtr_->sortedToc() - << abort(FatalError); + FatalErrorInFunction + << "Unknown radialModel type " + << modelType << nl << nl + << "Valid radialModel types :" << endl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); } return autoPtr(cstrIter()(dict)); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C index 361850b414..83067ea6ee 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C @@ -33,23 +33,20 @@ Foam::kineticTheoryModels::viscosityModel::New const dictionary& dict ) { - word viscosityModelType(dict.lookup("viscosityModel")); + const word modelName(dict.lookup("viscosityModel")); - Info<< "Selecting viscosityModel " - << viscosityModelType << endl; + Info<< "Selecting viscosityModel " << modelName << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(viscosityModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelName); if (!cstrIter.found()) { - FatalError - << "viscosityModel::New(const dictionary&) : " << endl - << " unknown viscosityModelType type " - << viscosityModelType - << ", constructor not in hash table" << endl << endl - << " Valid viscosityModelType types are :" << endl; - Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); + FatalErrorInFunction + << "Unknown viscosityModel type " + << modelName << nl << nl + << "Valid viscosityModel types :" << nl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); } return autoPtr(cstrIter()(dict)); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/blendingMethod/newBlendingMethod.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/blendingMethod/newBlendingMethod.C index cbb33a5fbd..f4419b735e 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/blendingMethod/newBlendingMethod.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/blendingMethod/newBlendingMethod.C @@ -33,20 +33,19 @@ Foam::autoPtr Foam::blendingMethod::New const wordList& phaseNames ) { - word blendingMethodType(dict.lookup("type")); + const word methodName(dict.lookup("type")); Info<< "Selecting " << dict.dictName() << " blending method: " - << blendingMethodType << endl; + << methodName << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(blendingMethodType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(methodName); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown blendingMethodType type " - << blendingMethodType << endl << endl - << "Valid blendingMethod types are : " << endl + << "Unknown blendingMethod type " + << methodName << nl << nl + << "Valid blendingMethod types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.C index fc011ece0c..c77c7e7e99 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.C @@ -51,15 +51,14 @@ Foam::diameterModels::IATEsource::New const dictionary& dict ) { - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(type); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(type); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown IATE source type " << type << nl << nl - << "Valid IATE source types : " << endl + << "Valid IATE source types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/diameterModel/newDiameterModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/diameterModel/newDiameterModel.C index 963ad160f7..fc4000975d 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/diameterModel/newDiameterModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/diameterModel/newDiameterModel.C @@ -33,32 +33,28 @@ Foam::autoPtr Foam::diameterModel::New const phaseModel& phase ) { - word diameterModelType - ( - dict.lookup("diameterModel") - ); + const word modelType(dict.lookup("diameterModel")); Info << "Selecting diameterModel for phase " << phase.name() << ": " - << diameterModelType << endl; + << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(diameterModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown diameterModelType type " - << diameterModelType << endl << endl - << "Valid diameterModel types are : " << endl + << "Unknown diameterModel type " + << modelType << nl << nl + << "Valid diameterModel types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } return cstrIter() ( - dict.optionalSubDict(diameterModelType + "Coeffs"), + dict.optionalSubDict(modelType + "Coeffs"), phase ); } 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 15604c8867..c37b1ee0cc 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 @@ -35,10 +35,6 @@ defineRunTimeSelectionTable(cellSizeAndAlignmentControl, dictionary); } -// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // - - - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::cellSizeAndAlignmentControl::cellSizeAndAlignmentControl @@ -57,7 +53,7 @@ Foam::cellSizeAndAlignmentControl::cellSizeAndAlignmentControl controlFunctionDict.lookupOrDefault ( "forceInitialPointInsertion", - "off" + Switch::OFF ) ), name_(name) @@ -76,28 +72,20 @@ Foam::cellSizeAndAlignmentControl::New const scalar& defaultCellSize ) { - word cellSizeAndAlignmentControlTypeName - ( - controlFunctionDict.lookup("type") - ); + const word controlType(controlFunctionDict.lookup("type")); Info<< indent << "Selecting cellSizeAndAlignmentControl " - << cellSizeAndAlignmentControlTypeName << endl; + << controlType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find - ( - cellSizeAndAlignmentControlTypeName - ); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(controlType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown cellSizeAndAlignmentControl type " - << cellSizeAndAlignmentControlTypeName - << endl << endl - << "Valid cellSizeAndAlignmentControl types are :" << endl - << dictionaryConstructorTablePtr_->toc() + << controlType << nl << nl + << "Valid cellSizeAndAlignmentControl types :" << endl + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } @@ -121,8 +109,4 @@ Foam::cellSizeAndAlignmentControl::~cellSizeAndAlignmentControl() {} -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - - - // ************************************************************************* // 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 9a0333e970..77316af0a9 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 @@ -32,10 +32,11 @@ namespace Foam { defineTypeNameAndDebug(cellSizeFunction, 0); defineRunTimeSelectionTable(cellSizeFunction, dictionary); - - scalar cellSizeFunction::snapToSurfaceTol_ = 1e-10; } +Foam::scalar Foam::cellSizeFunction::snapToSurfaceTol_ = 1e-10; + + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::cellSizeFunction::cellSizeFunction @@ -122,25 +123,23 @@ Foam::autoPtr Foam::cellSizeFunction::New const labelList regionIndices ) { - word cellSizeFunctionTypeName + const word functionName ( cellSizeFunctionDict.lookup("cellSizeFunction") ); - Info<< indent << "Selecting cellSizeFunction " << cellSizeFunctionTypeName - << endl; + Info<< indent << "Selecting cellSizeFunction " + << functionName << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(cellSizeFunctionTypeName); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(functionName); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown cellSizeFunction type " - << cellSizeFunctionTypeName - << endl << endl - << "Valid cellSizeFunction types are :" << endl - << dictionaryConstructorTablePtr_->toc() + << functionName << nl << nl + << "Valid cellSizeFunction types :" << endl + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } 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 93aa04c5ab..2f4447d505 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 @@ -60,25 +60,23 @@ Foam::autoPtr Foam::cellSizeCalculationType::New const scalar& defaultCellSize ) { - word cellSizeCalculationTypeTypeName + const word calculationType ( cellSizeCalculationTypeDict.lookup("cellSizeCalculationType") ); Info<< indent << "Selecting cellSizeCalculationType " - << cellSizeCalculationTypeTypeName << endl; + << calculationType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(cellSizeCalculationTypeTypeName); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(calculationType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown cellSizeCalculationType type " - << cellSizeCalculationTypeTypeName - << endl << endl - << "Valid cellSizeCalculationType types are :" << endl - << dictionaryConstructorTablePtr_->toc() + << calculationType << nl << nl + << "Valid cellSizeCalculationType types :" << endl + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } 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 ac6c12ce6b..ac72678573 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 @@ -34,6 +34,7 @@ namespace Foam defineRunTimeSelectionTable(surfaceCellSizeFunction, dictionary); } + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::surfaceCellSizeFunction::surfaceCellSizeFunction @@ -64,25 +65,23 @@ Foam::autoPtr Foam::surfaceCellSizeFunction::New const scalar& defaultCellSize ) { - word surfaceCellSizeFunctionTypeName + const word functionName ( surfaceCellSizeFunctionDict.lookup("surfaceCellSizeFunction") ); Info<< indent << "Selecting surfaceCellSizeFunction " - << surfaceCellSizeFunctionTypeName << endl; + << functionName << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(surfaceCellSizeFunctionTypeName); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(functionName); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown surfaceCellSizeFunction type " - << surfaceCellSizeFunctionTypeName - << endl << endl - << "Valid surfaceCellSizeFunction types are :" << endl - << dictionaryConstructorTablePtr_->toc() + << functionName << nl << nl + << "Valid surfaceCellSizeFunction types :" << endl + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } 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 151a0b7884..49c62fa66d 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/faceAreaWeightModel/faceAreaWeightModel/faceAreaWeightModel.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/faceAreaWeightModel/faceAreaWeightModel/faceAreaWeightModel.C @@ -26,20 +26,17 @@ License #include "faceAreaWeightModel.H" #include "addToRunTimeSelectionTable.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - defineTypeNameAndDebug(faceAreaWeightModel, 0); defineRunTimeSelectionTable(faceAreaWeightModel, dictionary); - +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -faceAreaWeightModel::faceAreaWeightModel +Foam::faceAreaWeightModel::faceAreaWeightModel ( const word& type, const dictionary& relaxationDict @@ -52,30 +49,24 @@ faceAreaWeightModel::faceAreaWeightModel // * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * // -autoPtr faceAreaWeightModel::New +Foam::autoPtr Foam::faceAreaWeightModel::New ( const dictionary& relaxationDict ) { - word faceAreaWeightModelTypeName - ( - relaxationDict.lookup("faceAreaWeightModel") - ); + const word modelType(relaxationDict.lookup("faceAreaWeightModel")); - Info<< nl << "Selecting faceAreaWeightModel " - << faceAreaWeightModelTypeName << endl; + Info<< nl << "Selecting faceAreaWeightModel " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(faceAreaWeightModelTypeName); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown faceAreaWeightModel type " - << faceAreaWeightModelTypeName - << endl << endl - << "Valid faceAreaWeightModel types are :" << endl - << dictionaryConstructorTablePtr_->toc() + << modelType << nl << nl + << "Valid faceAreaWeightModel types :" << endl + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } @@ -85,12 +76,8 @@ autoPtr faceAreaWeightModel::New // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -faceAreaWeightModel::~faceAreaWeightModel() +Foam::faceAreaWeightModel::~faceAreaWeightModel() {} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // 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 3cca22c751..48e45954fb 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/initialPointsMethod/initialPointsMethod/initialPointsMethod.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/initialPointsMethod/initialPointsMethod/initialPointsMethod.C @@ -26,20 +26,17 @@ License #include "initialPointsMethod.H" #include "addToRunTimeSelectionTable.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - defineTypeNameAndDebug(initialPointsMethod, 0); defineRunTimeSelectionTable(initialPointsMethod, dictionary); - +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -initialPointsMethod::initialPointsMethod +Foam::initialPointsMethod::initialPointsMethod ( const word& type, const dictionary& initialPointsDict, @@ -73,7 +70,7 @@ initialPointsMethod::initialPointsMethod // * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * // -autoPtr initialPointsMethod::New +Foam::autoPtr Foam::initialPointsMethod::New ( const dictionary& initialPointsDict, const Time& runTime, @@ -83,25 +80,20 @@ autoPtr initialPointsMethod::New const autoPtr& decomposition ) { - word initialPointsMethodTypeName - ( - initialPointsDict.lookup("initialPointsMethod") - ); + const word methodName(initialPointsDict.lookup("initialPointsMethod")); Info<< nl << "Selecting initialPointsMethod " - << initialPointsMethodTypeName << endl; + << methodName << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(initialPointsMethodTypeName); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(methodName); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown initialPointsMethod type " - << initialPointsMethodTypeName - << endl << endl - << "Valid initialPointsMethod types are :" << endl - << dictionaryConstructorTablePtr_->toc() + << methodName << nl << nl + << "Valid initialPointsMethod types :" << endl + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } @@ -123,12 +115,8 @@ autoPtr initialPointsMethod::New // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -initialPointsMethod::~initialPointsMethod() +Foam::initialPointsMethod::~initialPointsMethod() {} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // 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 b968dd2ebe..5f0fd95993 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/relaxationModel/relaxationModel/relaxationModel.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/relaxationModel/relaxationModel/relaxationModel.C @@ -26,20 +26,18 @@ License #include "relaxationModel.H" #include "addToRunTimeSelectionTable.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - defineTypeNameAndDebug(relaxationModel, 0); defineRunTimeSelectionTable(relaxationModel, dictionary); +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -relaxationModel::relaxationModel +Foam::relaxationModel::relaxationModel ( const word& type, const dictionary& relaxationDict, @@ -54,31 +52,25 @@ relaxationModel::relaxationModel // * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * // -autoPtr relaxationModel::New +Foam::autoPtr Foam::relaxationModel::New ( const dictionary& relaxationDict, const Time& runTime ) { - word relaxationModelTypeName - ( - relaxationDict.lookup("relaxationModel") - ); + const word modelType(relaxationDict.lookup("relaxationModel")); - Info<< nl << "Selecting relaxationModel " - << relaxationModelTypeName << endl; + Info<< nl << "Selecting relaxationModel " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(relaxationModelTypeName); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown relaxationModel type " - << relaxationModelTypeName - << endl << endl - << "Valid relaxationModel types are :" << endl - << dictionaryConstructorTablePtr_->toc() + << modelType << nl << nl + << "Valid relaxationModel types :" << endl + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } @@ -88,12 +80,8 @@ autoPtr relaxationModel::New // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -relaxationModel::~relaxationModel() +Foam::relaxationModel::~relaxationModel() {} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/searchableSurfaceFeatures/searchableSurfaceFeatures.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/searchableSurfaceFeatures/searchableSurfaceFeatures.C index b35c37df1a..946f15ccae 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/searchableSurfaceFeatures/searchableSurfaceFeatures.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/searchableSurfaceFeatures/searchableSurfaceFeatures.C @@ -43,17 +43,16 @@ Foam::searchableSurfaceFeatures::New const dictionary& dict ) { - word searchableSurfaceFeaturesType = surface.type() + "Features"; + const word featuresType = surface.type() + "Features"; - dictConstructorTable::iterator cstrIter = - dictConstructorTablePtr_->find(searchableSurfaceFeaturesType); + auto cstrIter = dictConstructorTablePtr_->cfind(featuresType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown searchableSurfaceFeatures type " - << searchableSurfaceFeaturesType << endl << endl - << "Valid searchableSurfaceFeatures types : " << endl + << featuresType << nl << nl + << "Valid searchableSurfaceFeatures types :" << endl << dictConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/utilities/mesh/manipulation/createBaffles/faceSelection/faceSelection.C b/applications/utilities/mesh/manipulation/createBaffles/faceSelection/faceSelection.C index dd66f694aa..5c42ba3596 100644 --- a/applications/utilities/mesh/manipulation/createBaffles/faceSelection/faceSelection.C +++ b/applications/utilities/mesh/manipulation/createBaffles/faceSelection/faceSelection.C @@ -68,15 +68,14 @@ Foam::autoPtr Foam::faceSelection::New { const word sampleType(dict.lookup("type")); - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(sampleType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(sampleType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown faceSelection type " << sampleType << nl << nl - << "Valid faceSelection types : " << endl + << "Valid faceSelection types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/utilities/miscellaneous/foamHelp/helpTypes/helpType/helpTypeNew.C b/applications/utilities/miscellaneous/foamHelp/helpTypes/helpType/helpTypeNew.C index 3feb5f8659..dff74bf277 100644 --- a/applications/utilities/miscellaneous/foamHelp/helpTypes/helpType/helpTypeNew.C +++ b/applications/utilities/miscellaneous/foamHelp/helpTypes/helpType/helpTypeNew.C @@ -34,8 +34,7 @@ Foam::autoPtr Foam::helpType::New { Info<< "Selecting helpType " << helpTypeName << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(helpTypeName); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(helpTypeName); if (!cstrIter.found()) { diff --git a/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/tabulatedWallFunction/tabulatedWallFunctionNew.C b/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/tabulatedWallFunction/tabulatedWallFunctionNew.C index b4d67de9e2..2f6cfa09fc 100644 --- a/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/tabulatedWallFunction/tabulatedWallFunctionNew.C +++ b/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/tabulatedWallFunction/tabulatedWallFunctionNew.C @@ -25,34 +25,27 @@ License #include "tabulatedWallFunction.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace tabulatedWallFunctions -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -autoPtr tabulatedWallFunction::New +Foam::autoPtr +Foam::tabulatedWallFunctions::tabulatedWallFunction::New ( const dictionary& dict, const polyMesh& mesh ) { - word twfTypeName = dict.lookup("tabulatedWallFunction"); + const word functionName = dict.lookup("tabulatedWallFunction"); - Info<< "Selecting tabulatedWallFunction " << twfTypeName << endl; + Info<< "Selecting tabulatedWallFunction " << functionName << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(twfTypeName); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(functionName); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown tabulatedWallFunction type " << twfTypeName + << "Unknown tabulatedWallFunction type " << functionName << nl << nl << "Valid tabulatedWallFunction types are:" << nl - << dictionaryConstructorTablePtr_->toc() + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } @@ -60,9 +53,4 @@ autoPtr tabulatedWallFunction::New } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace tabulatedWallFunctions -} // End namespace Foam - // ************************************************************************* // diff --git a/applications/utilities/surface/surfacePatch/searchableSurfaceModifier/searchableSurfaceModifier.C b/applications/utilities/surface/surfacePatch/searchableSurfaceModifier/searchableSurfaceModifier.C index a3dc719dc8..67a47a6de3 100644 --- a/applications/utilities/surface/surfacePatch/searchableSurfaceModifier/searchableSurfaceModifier.C +++ b/applications/utilities/surface/surfacePatch/searchableSurfaceModifier/searchableSurfaceModifier.C @@ -64,15 +64,14 @@ Foam::searchableSurfaceModifier::New const dictionary& dict ) { - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(type); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(type); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown searchableSurfaceModifier type " << type << nl << nl - << "Valid searchableSurfaceModifier types : " << endl + << "Valid searchableSurfaceModifier types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/ODE/ODESolvers/ODESolver/ODESolverNew.C b/src/ODE/ODESolvers/ODESolver/ODESolverNew.C index 20d6bc8831..f4cfc95a2f 100644 --- a/src/ODE/ODESolvers/ODESolver/ODESolverNew.C +++ b/src/ODE/ODESolvers/ODESolver/ODESolverNew.C @@ -33,18 +33,17 @@ Foam::autoPtr Foam::ODESolver::New const dictionary& dict ) { - word ODESolverTypeName(dict.lookup("solver")); - Info<< "Selecting ODE solver " << ODESolverTypeName << endl; + const word solverType(dict.lookup("solver")); + Info<< "Selecting ODE solver " << solverType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(ODESolverTypeName); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(solverType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown ODESolver type " - << ODESolverTypeName << nl << nl - << "Valid ODESolvers are : " << endl + << solverType << nl << nl + << "Valid ODESolver types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/OpenFOAM/db/IOstreams/token/token.C b/src/OpenFOAM/db/IOstreams/token/token.C index 7e8b7ed141..4246fc80e7 100644 --- a/src/OpenFOAM/db/IOstreams/token/token.C +++ b/src/OpenFOAM/db/IOstreams/token/token.C @@ -62,13 +62,13 @@ Foam::autoPtr Foam::token::compound::New Istream& is ) { - IstreamConstructorTable::iterator cstrIter = - IstreamConstructorTablePtr_->find(compoundType); + auto cstrIter = IstreamConstructorTablePtr_->cfind(compoundType); if (!cstrIter.found()) { FatalIOErrorInFunction(is) - << "Unknown compound type " << compoundType << nl << nl + << "Unknown compound type " + << compoundType << nl << nl << "Valid compound types:" << endl << IstreamConstructorTablePtr_->sortedToc() << abort(FatalIOError); diff --git a/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.C b/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.C index d72a67791f..2798b924e3 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.C +++ b/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.C @@ -97,8 +97,8 @@ bool Foam::functionEntry::execute return true; } - executedictionaryIstreamMemberFunctionTable::iterator mfIter = - executedictionaryIstreamMemberFunctionTablePtr_->find(functionName); + auto mfIter = + executedictionaryIstreamMemberFunctionTablePtr_->cfind(functionName); if (!mfIter.found()) { @@ -106,8 +106,8 @@ bool Foam::functionEntry::execute << "Unknown functionEntry '" << functionName << "' in " << is.name() << " near line " << is.lineNumber() << nl << nl - << "Valid functionEntries are :" << endl - << executedictionaryIstreamMemberFunctionTablePtr_->toc() + << "Valid functionEntries :" << endl + << executedictionaryIstreamMemberFunctionTablePtr_->sortedToc() << exit(FatalError); } @@ -136,8 +136,11 @@ bool Foam::functionEntry::execute return true; } - executeprimitiveEntryIstreamMemberFunctionTable::iterator mfIter = - executeprimitiveEntryIstreamMemberFunctionTablePtr_->find(functionName); + auto mfIter = + executeprimitiveEntryIstreamMemberFunctionTablePtr_->cfind + ( + functionName + ); if (!mfIter.found()) { @@ -145,8 +148,8 @@ bool Foam::functionEntry::execute << "Unknown functionEntry '" << functionName << "' in " << is.name() << " near line " << is.lineNumber() << nl << nl - << "Valid functionEntries are :" << endl - << executeprimitiveEntryIstreamMemberFunctionTablePtr_->toc() + << "Valid functionEntries :" << endl + << executeprimitiveEntryIstreamMemberFunctionTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C index a3141abb91..51e1323ec8 100644 --- a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C +++ b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C @@ -100,15 +100,14 @@ Foam::autoPtr Foam::functionObject::New << exit(FatalError); } - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(functionType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(functionType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown function type " << functionType << nl << nl - << "Valid functions are : " << nl + << "Valid function types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << endl << exit(FatalError); } diff --git a/src/OpenFOAM/fields/pointPatchFields/basic/calculated/calculatedPointPatchField.C b/src/OpenFOAM/fields/pointPatchFields/basic/calculated/calculatedPointPatchField.C index 47a8a8c3ce..1dcbd94279 100644 --- a/src/OpenFOAM/fields/pointPatchFields/basic/calculated/calculatedPointPatchField.C +++ b/src/OpenFOAM/fields/pointPatchFields/basic/calculated/calculatedPointPatchField.C @@ -91,8 +91,8 @@ Foam::pointPatchField::NewCalculatedType const pointPatchField& pf ) { - typename pointPatchConstructorTable::iterator patchTypeCstrIter = - pointPatchConstructorTablePtr_->find(pf.patch().type()); + auto patchTypeCstrIter = + pointPatchConstructorTablePtr_->cfind(pf.patch().type()); if (patchTypeCstrIter.found()) { diff --git a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldNew.C b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldNew.C index 79d90cf3a2..666ccc2fde 100644 --- a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldNew.C +++ b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldNew.C @@ -39,15 +39,14 @@ Foam::autoPtr> Foam::pointPatchField::New InfoInFunction << "Constructing pointPatchField" << endl; } - typename pointPatchConstructorTable::iterator cstrIter = - pointPatchConstructorTablePtr_->find(patchFieldType); + auto cstrIter = pointPatchConstructorTablePtr_->cfind(patchFieldType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown patchFieldType type " << patchFieldType << nl << nl - << "Valid patchField types are :" << endl + << "Valid patchField types :" << endl << pointPatchConstructorTablePtr_->sortedToc() << exit(FatalError); } @@ -63,8 +62,8 @@ Foam::autoPtr> Foam::pointPatchField::New if (pfPtr().constraintType() != p.constraintType()) { // Use default constraint type - typename pointPatchConstructorTable::iterator patchTypeCstrIter = - pointPatchConstructorTablePtr_->find(p.type()); + auto patchTypeCstrIter = + pointPatchConstructorTablePtr_->cfind(p.type()); if (!patchTypeCstrIter.found()) { @@ -117,14 +116,13 @@ Foam::autoPtr> Foam::pointPatchField::New word patchFieldType(dict.lookup("type")); - typename dictionaryConstructorTable::iterator cstrIter - = dictionaryConstructorTablePtr_->find(patchFieldType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(patchFieldType); if (!cstrIter.found()) { if (!disallowGenericPointPatchField) { - cstrIter = dictionaryConstructorTablePtr_->find("generic"); + cstrIter = dictionaryConstructorTablePtr_->cfind("generic"); } if (!cstrIter.found()) @@ -134,7 +132,7 @@ Foam::autoPtr> Foam::pointPatchField::New dict ) << "Unknown patchField type " << patchFieldType << " for patch type " << p.type() << nl << nl - << "Valid patchField types are :" << endl + << "Valid patchField types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalIOError); } @@ -157,8 +155,8 @@ Foam::autoPtr> Foam::pointPatchField::New else { // Use default constraint type - typename dictionaryConstructorTable::iterator patchTypeCstrIter - = dictionaryConstructorTablePtr_->find(p.type()); + auto patchTypeCstrIter + = dictionaryConstructorTablePtr_->cfind(p.type()); if (!patchTypeCstrIter.found()) { @@ -193,15 +191,14 @@ Foam::autoPtr> Foam::pointPatchField::New InfoInFunction << "Constructing pointPatchField" << endl; } - typename patchMapperConstructorTable::iterator cstrIter = - patchMapperConstructorTablePtr_->find(ptf.type()); + auto cstrIter = patchMapperConstructorTablePtr_->cfind(ptf.type()); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown patchField type " << ptf.type() << nl << nl - << "Valid patchField types are :" << endl + << "Valid patchField types :" << endl << patchMapperConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/OpenFOAM/graph/graph.C b/src/OpenFOAM/graph/graph.C index 105c69bcd5..9f5532575d 100644 --- a/src/OpenFOAM/graph/graph.C +++ b/src/OpenFOAM/graph/graph.C @@ -212,15 +212,14 @@ Foam::autoPtr Foam::graph::writer::New << exit(FatalError); } - wordConstructorTable::iterator cstrIter = - wordConstructorTablePtr_->find(graphFormat); + auto cstrIter = wordConstructorTablePtr_->cfind(graphFormat); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown graph format " << graphFormat - << endl << endl - << "Valid graph formats are : " << endl + << "Unknown graph format " + << graphFormat << nl << nl + << "Valid graph formats :" << endl << wordConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/OpenFOAM/interpolations/interpolationTable/tableReaders/tableReader.C b/src/OpenFOAM/interpolations/interpolationTable/tableReaders/tableReader.C index 58060e89fe..b3d96d50b0 100644 --- a/src/OpenFOAM/interpolations/interpolationTable/tableReaders/tableReader.C +++ b/src/OpenFOAM/interpolations/interpolationTable/tableReaders/tableReader.C @@ -39,16 +39,14 @@ Foam::autoPtr> Foam::tableReader::New "openFoam" ); - typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_ - ->find(readerType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(readerType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown reader type " << readerType - << nl << nl - << "Valid reader types : " << nl + << "Unknown reader type " + << readerType << nl << nl + << "Valid reader types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } @@ -78,8 +76,7 @@ void Foam::tableReader::write(Ostream& os) const { if (this->type() != "openFoam") { - os.writeKeyword("readerType") - << this->type() << token::END_STATEMENT << nl; + os.writeEntry("readerType", this->type()); } } diff --git a/src/OpenFOAM/interpolations/interpolationWeights/interpolationWeights/interpolationWeights.C b/src/OpenFOAM/interpolations/interpolationWeights/interpolationWeights/interpolationWeights.C index 59dd7cc0fd..01ee15eabd 100644 --- a/src/OpenFOAM/interpolations/interpolationWeights/interpolationWeights/interpolationWeights.C +++ b/src/OpenFOAM/interpolations/interpolationWeights/interpolationWeights/interpolationWeights.C @@ -27,23 +27,18 @@ License #include "addToRunTimeSelectionTable.H" #include "Time.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - defineTypeNameAndDebug(interpolationWeights, 0); defineRunTimeSelectionTable(interpolationWeights, word); +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -interpolationWeights::interpolationWeights -( - const scalarField& samples -) +Foam::interpolationWeights::interpolationWeights(const scalarField& samples) : samples_(samples) {} @@ -51,7 +46,7 @@ interpolationWeights::interpolationWeights // * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * // -autoPtr interpolationWeights::New +Foam::autoPtr Foam::interpolationWeights::New ( const word& type, const scalarField& samples @@ -64,16 +59,14 @@ autoPtr interpolationWeights::New << type << endl; } - wordConstructorTable::iterator cstrIter = - wordConstructorTablePtr_->find(type); + auto cstrIter = wordConstructorTablePtr_->cfind(type); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown interpolationWeights type " - << type - << endl << endl - << "Valid interpolationWeights types are :" << endl + << type << nl << nl + << "Valid interpolationWeights types :" << endl << wordConstructorTablePtr_->sortedToc() << exit(FatalError); } @@ -84,12 +77,8 @@ autoPtr interpolationWeights::New // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -interpolationWeights::~interpolationWeights() +Foam::interpolationWeights::~interpolationWeights() {} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixPreconditioner.C b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixPreconditioner.C index 8e1aa10b79..ad3de4764c 100644 --- a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixPreconditioner.C +++ b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixPreconditioner.C @@ -35,14 +35,14 @@ Foam::LduMatrix::preconditioner::New const dictionary& preconditionerDict ) { - word preconditionerName = preconditionerDict.lookup("preconditioner"); + const word preconditionerName = preconditionerDict.lookup("preconditioner"); if (sol.matrix().symmetric()) { - typename symMatrixConstructorTable::iterator constructorIter = - symMatrixConstructorTablePtr_->find(preconditionerName); + auto cstrIter = + symMatrixConstructorTablePtr_->cfind(preconditionerName); - if (!constructorIter.found()) + if (!cstrIter.found()) { FatalIOErrorInFunction ( @@ -50,13 +50,13 @@ Foam::LduMatrix::preconditioner::New ) << "Unknown symmetric matrix preconditioner " << preconditionerName << endl << endl << "Valid symmetric matrix preconditioners are :" << endl - << symMatrixConstructorTablePtr_->toc() + << symMatrixConstructorTablePtr_->sortedToc() << exit(FatalIOError); } return autoPtr::preconditioner> ( - constructorIter() + cstrIter() ( sol, preconditionerDict @@ -65,10 +65,10 @@ Foam::LduMatrix::preconditioner::New } else if (sol.matrix().asymmetric()) { - typename asymMatrixConstructorTable::iterator constructorIter = - asymMatrixConstructorTablePtr_->find(preconditionerName); + auto cstrIter = + asymMatrixConstructorTablePtr_->cfind(preconditionerName); - if (!constructorIter.found()) + if (!cstrIter.found()) { FatalIOErrorInFunction ( @@ -76,13 +76,13 @@ Foam::LduMatrix::preconditioner::New ) << "Unknown asymmetric matrix preconditioner " << preconditionerName << endl << endl << "Valid asymmetric matrix preconditioners are :" << endl - << asymMatrixConstructorTablePtr_->toc() + << asymMatrixConstructorTablePtr_->sortedToc() << exit(FatalIOError); } return autoPtr::preconditioner> ( - constructorIter() + cstrIter() ( sol, preconditionerDict diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSmoother.C b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSmoother.C index 195871e41f..758dafff9a 100644 --- a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSmoother.C +++ b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSmoother.C @@ -40,22 +40,21 @@ Foam::LduMatrix::smoother::New if (matrix.symmetric()) { - typename symMatrixConstructorTable::iterator constructorIter = - symMatrixConstructorTablePtr_->find(smootherName); + auto cstrIter = symMatrixConstructorTablePtr_->cfind(smootherName); - if (!constructorIter.found()) + if (!cstrIter.found()) { FatalIOErrorInFunction(smootherDict) << "Unknown symmetric matrix smoother " << smootherName << endl << endl << "Valid symmetric matrix smoothers are :" << endl - << symMatrixConstructorTablePtr_->toc() + << symMatrixConstructorTablePtr_->sortedToc() << exit(FatalIOError); } return autoPtr::smoother> ( - constructorIter() + cstrIter() ( fieldName, matrix @@ -64,22 +63,21 @@ Foam::LduMatrix::smoother::New } else if (matrix.asymmetric()) { - typename asymMatrixConstructorTable::iterator constructorIter = - asymMatrixConstructorTablePtr_->find(smootherName); + auto cstrIter = asymMatrixConstructorTablePtr_->cfind(smootherName); - if (!constructorIter.found()) + if (!cstrIter.found()) { FatalIOErrorInFunction(smootherDict) << "Unknown asymmetric matrix smoother " << smootherName << endl << endl << "Valid asymmetric matrix smoothers are :" << endl - << asymMatrixConstructorTablePtr_->toc() + << asymMatrixConstructorTablePtr_->sortedToc() << exit(FatalIOError); } return autoPtr::smoother> ( - constructorIter() + cstrIter() ( fieldName, matrix diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSolver.C b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSolver.C index 8338abdbf4..6ca7b2a64c 100644 --- a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSolver.C +++ b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSolver.C @@ -37,7 +37,7 @@ Foam::LduMatrix::solver::New const dictionary& solverDict ) { - word solverName = solverDict.lookup("solver"); + const word solverName = solverDict.lookup("solver"); if (matrix.diagonal()) { @@ -53,22 +53,21 @@ Foam::LduMatrix::solver::New } else if (matrix.symmetric()) { - typename symMatrixConstructorTable::iterator constructorIter = - symMatrixConstructorTablePtr_->find(solverName); + auto cstrIter = symMatrixConstructorTablePtr_->cfind(solverName); - if (!constructorIter.found()) + if (!cstrIter.found()) { FatalIOErrorInFunction(solverDict) << "Unknown symmetric matrix solver " << solverName << endl << endl << "Valid symmetric matrix solvers are :" << endl - << symMatrixConstructorTablePtr_->toc() + << symMatrixConstructorTablePtr_->sortedToc() << exit(FatalIOError); } return autoPtr::solver> ( - constructorIter() + cstrIter() ( fieldName, matrix, @@ -78,22 +77,21 @@ Foam::LduMatrix::solver::New } else if (matrix.asymmetric()) { - typename asymMatrixConstructorTable::iterator constructorIter = - asymMatrixConstructorTablePtr_->find(solverName); + auto cstrIter = asymMatrixConstructorTablePtr_->cfind(solverName); - if (!constructorIter.found()) + if (!cstrIter.found()) { FatalIOErrorInFunction(solverDict) << "Unknown asymmetric matrix solver " << solverName << endl << endl << "Valid asymmetric matrix solvers are :" << endl - << asymMatrixConstructorTablePtr_->toc() + << asymMatrixConstructorTablePtr_->sortedToc() << exit(FatalIOError); } return autoPtr::solver> ( - constructorIter() + cstrIter() ( fieldName, matrix, diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixPreconditioner.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixPreconditioner.C index 36d85e76e8..2d85cca0ae 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixPreconditioner.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixPreconditioner.C @@ -82,10 +82,9 @@ Foam::lduMatrix::preconditioner::New if (sol.matrix().symmetric()) { - symMatrixConstructorTable::iterator constructorIter = - symMatrixConstructorTablePtr_->find(name); + auto cstrIter = symMatrixConstructorTablePtr_->cfind(name); - if (!constructorIter.found()) + if (!cstrIter.found()) { FatalIOErrorInFunction ( @@ -99,7 +98,7 @@ Foam::lduMatrix::preconditioner::New return autoPtr ( - constructorIter() + cstrIter() ( sol, controls @@ -108,10 +107,9 @@ Foam::lduMatrix::preconditioner::New } else if (sol.matrix().asymmetric()) { - asymMatrixConstructorTable::iterator constructorIter = - asymMatrixConstructorTablePtr_->find(name); + auto cstrIter = asymMatrixConstructorTablePtr_->cfind(name); - if (!constructorIter.found()) + if (!cstrIter.found()) { FatalIOErrorInFunction ( @@ -125,7 +123,7 @@ Foam::lduMatrix::preconditioner::New return autoPtr ( - constructorIter() + cstrIter() ( sol, controls diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSmoother.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSmoother.C index 4692df969b..0edeea6a9c 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSmoother.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSmoother.C @@ -86,10 +86,9 @@ Foam::autoPtr Foam::lduMatrix::smoother::New if (matrix.symmetric()) { - symMatrixConstructorTable::iterator constructorIter = - symMatrixConstructorTablePtr_->find(name); + auto cstrIter = symMatrixConstructorTablePtr_->cfind(name); - if (!constructorIter.found()) + if (!cstrIter.found()) { FatalIOErrorInFunction(solverControls) << "Unknown symmetric matrix smoother " @@ -101,7 +100,7 @@ Foam::autoPtr Foam::lduMatrix::smoother::New return autoPtr ( - constructorIter() + cstrIter() ( fieldName, matrix, @@ -113,10 +112,9 @@ Foam::autoPtr Foam::lduMatrix::smoother::New } else if (matrix.asymmetric()) { - asymMatrixConstructorTable::iterator constructorIter = - asymMatrixConstructorTablePtr_->find(name); + auto cstrIter = asymMatrixConstructorTablePtr_->cfind(name); - if (!constructorIter.found()) + if (!cstrIter.found()) { FatalIOErrorInFunction(solverControls) << "Unknown asymmetric matrix smoother " @@ -128,7 +126,7 @@ Foam::autoPtr Foam::lduMatrix::smoother::New return autoPtr ( - constructorIter() + cstrIter() ( fieldName, matrix, diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C index 5caa6d627c..0bcd04bf4e 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C @@ -66,10 +66,9 @@ Foam::autoPtr Foam::lduMatrix::solver::New } else if (matrix.symmetric()) { - symMatrixConstructorTable::iterator constructorIter = - symMatrixConstructorTablePtr_->find(name); + auto cstrIter = symMatrixConstructorTablePtr_->cfind(name); - if (!constructorIter.found()) + if (!cstrIter.found()) { FatalIOErrorInFunction(solverControls) << "Unknown symmetric matrix solver " << name << nl << nl @@ -80,7 +79,7 @@ Foam::autoPtr Foam::lduMatrix::solver::New return autoPtr ( - constructorIter() + cstrIter() ( fieldName, matrix, @@ -93,10 +92,9 @@ Foam::autoPtr Foam::lduMatrix::solver::New } else if (matrix.asymmetric()) { - asymMatrixConstructorTable::iterator constructorIter = - asymMatrixConstructorTablePtr_->find(name); + auto cstrIter = asymMatrixConstructorTablePtr_->cfind(name); - if (!constructorIter.found()) + if (!cstrIter.found()) { FatalIOErrorInFunction(solverControls) << "Unknown asymmetric matrix solver " << name << nl << nl @@ -107,7 +105,7 @@ Foam::autoPtr Foam::lduMatrix::solver::New return autoPtr ( - constructorIter() + cstrIter() ( 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 d0168688fa..5095e2be6f 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C @@ -304,17 +304,16 @@ const Foam::GAMGAgglomeration& Foam::GAMGAgglomeration::New lduMeshConstructorTablePtr_ ); - lduMeshConstructorTable::iterator cstrIter = - lduMeshConstructorTablePtr_->find(agglomeratorType); + auto cstrIter = lduMeshConstructorTablePtr_->cfind(agglomeratorType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown GAMGAgglomeration type " << agglomeratorType << ".\n" - << "Valid matrix GAMGAgglomeration types are :" + << "Valid matrix GAMGAgglomeration types :" << lduMatrixConstructorTablePtr_->sortedToc() << endl - << "Valid geometric GAMGAgglomeration types are :" + << "Valid geometric GAMGAgglomeration types :" << lduMeshConstructorTablePtr_->sortedToc() << exit(FatalError); } @@ -369,8 +368,8 @@ const Foam::GAMGAgglomeration& Foam::GAMGAgglomeration::New } else { - lduMatrixConstructorTable::iterator cstrIter = - lduMatrixConstructorTablePtr_->find(agglomeratorType); + auto cstrIter = + lduMatrixConstructorTablePtr_->cfind(agglomeratorType); return store(cstrIter()(matrix, controlDict).ptr()); } @@ -405,15 +404,14 @@ Foam::autoPtr Foam::GAMGAgglomeration::New geometryConstructorTablePtr_ ); - geometryConstructorTable::iterator cstrIter = - geometryConstructorTablePtr_->find(agglomeratorType); + auto cstrIter = geometryConstructorTablePtr_->cfind(agglomeratorType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown GAMGAgglomeration type " << agglomeratorType << ".\n" - << "Valid geometric GAMGAgglomeration types are :" + << "Valid geometric GAMGAgglomeration types :" << geometryConstructorTablePtr_->sortedToc() << exit(FatalError); } 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 642151da87..96849e559c 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGProcAgglomerations/GAMGProcAgglomeration/GAMGProcAgglomeration.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGProcAgglomerations/GAMGProcAgglomeration/GAMGProcAgglomeration.C @@ -361,15 +361,14 @@ Foam::autoPtr Foam::GAMGProcAgglomeration::New InfoInFunction << "Constructing GAMGProcAgglomeration" << endl; } - GAMGAgglomerationConstructorTable::iterator cstrIter = - GAMGAgglomerationConstructorTablePtr_->find(type); + auto cstrIter = GAMGAgglomerationConstructorTablePtr_->cfind(type); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown GAMGProcAgglomeration type " << type << " for GAMGAgglomeration " << agglom.type() << nl << nl - << "Valid GAMGProcAgglomeration types are :" << endl + << "Valid GAMGProcAgglomeration types :" << endl << GAMGAgglomerationConstructorTablePtr_->sortedToc() << exit(FatalError); } 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 dda2e9024d..d10610212c 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/GAMGInterfaceField/GAMGInterfaceFieldNew.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/GAMGInterfaceField/GAMGInterfaceFieldNew.C @@ -35,15 +35,14 @@ Foam::autoPtr Foam::GAMGInterfaceField::New { const word coupleType(fineInterface.interfaceFieldType()); - lduInterfaceFieldConstructorTable::iterator cstrIter = - lduInterfaceFieldConstructorTablePtr_->find(coupleType); + auto cstrIter = lduInterfaceFieldConstructorTablePtr_->cfind(coupleType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown GAMGInterfaceField type " << coupleType << nl - << "Valid GAMGInterfaceField types are :" + << "Valid GAMGInterfaceField types :" << lduInterfaceFieldConstructorTablePtr_->sortedToc() << exit(FatalError); } @@ -61,15 +60,14 @@ Foam::autoPtr Foam::GAMGInterfaceField::New { const word coupleType(GAMGCp.type()); - lduInterfaceConstructorTable::iterator cstrIter = - lduInterfaceConstructorTablePtr_->find(coupleType); + auto cstrIter = lduInterfaceConstructorTablePtr_->cfind(coupleType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown GAMGInterfaceField type " << coupleType << nl - << "Valid GAMGInterfaceField types are :" + << "Valid GAMGInterfaceField types :" << lduInterfaceConstructorTablePtr_->sortedToc() << exit(FatalError); } 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 686fe2094e..284757c98f 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/GAMGInterfaceNew.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/GAMGInterfaceNew.C @@ -43,14 +43,13 @@ Foam::autoPtr Foam::GAMGInterface::New { const word coupleType(fineInterface.type()); - lduInterfaceConstructorTable::iterator cstrIter = - lduInterfaceConstructorTablePtr_->find(coupleType); + auto cstrIter = lduInterfaceConstructorTablePtr_->cfind(coupleType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown GAMGInterface type " << coupleType << ".\n" - << "Valid GAMGInterface types are :" + << "Valid GAMGInterface types :" << lduInterfaceConstructorTablePtr_->sortedToc() << exit(FatalError); } @@ -79,14 +78,13 @@ Foam::autoPtr Foam::GAMGInterface::New Istream& is ) { - IstreamConstructorTable::iterator cstrIter = - IstreamConstructorTablePtr_->find(coupleType); + auto cstrIter = IstreamConstructorTablePtr_->cfind(coupleType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown GAMGInterface type " << coupleType << ".\n" - << "Valid GAMGInterface types are :" + << "Valid GAMGInterface types :" << IstreamConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/OpenFOAM/meshes/pointMesh/pointPatches/facePointPatch/facePointPatchNew.C b/src/OpenFOAM/meshes/pointMesh/pointPatches/facePointPatch/facePointPatchNew.C index 69e76fe3b6..04aaeffd4d 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointPatches/facePointPatch/facePointPatchNew.C +++ b/src/OpenFOAM/meshes/pointMesh/pointPatches/facePointPatch/facePointPatchNew.C @@ -38,16 +38,14 @@ Foam::autoPtr Foam::facePointPatch::New InfoInFunction << "Constructing facePointPatch" << endl; } - polyPatchConstructorTable::iterator cstrIter = - polyPatchConstructorTablePtr_->find(patch.type()); + auto cstrIter = polyPatchConstructorTablePtr_->cfind(patch.type()); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown facePointPatch type " - << patch.type() - << nl << nl - << "Valid facePointPatch types are :" << endl + << patch.type() << nl << nl + << "Valid facePointPatch types :" << endl << polyPatchConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.C index 7a26581fe7..bd14deffc6 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.C @@ -279,13 +279,7 @@ Foam::wordList Foam::polyPatch::constraintTypes() label i = 0; - for - ( - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->begin(); - cstrIter != dictionaryConstructorTablePtr_->end(); - ++cstrIter - ) + forAllConstIters(*dictionaryConstructorTablePtr_, cstrIter) { if (constraintType(cstrIter.key())) { diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatchNew.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatchNew.C index 97d8f602c0..f8289222d8 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatchNew.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatchNew.C @@ -43,15 +43,14 @@ Foam::autoPtr Foam::polyPatch::New InfoInFunction << "Constructing polyPatch" << endl; } - wordConstructorTable::iterator cstrIter = - wordConstructorTablePtr_->find(patchType); + auto cstrIter = wordConstructorTablePtr_->cfind(patchType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown polyPatch type " << patchType << " for patch " << name << nl << nl - << "Valid polyPatch types are :" << endl + << "Valid polyPatch types :" << endl << wordConstructorTablePtr_->sortedToc() << exit(FatalError); } @@ -105,14 +104,13 @@ Foam::autoPtr Foam::polyPatch::New InfoInFunction << "Constructing polyPatch" << endl; } - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(patchType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(patchType); if (!cstrIter.found()) { if (!disallowGenericPolyPatch) { - cstrIter = dictionaryConstructorTablePtr_->find("genericPatch"); + cstrIter = dictionaryConstructorTablePtr_->cfind("genericPatch"); } if (!cstrIter.found()) @@ -122,7 +120,7 @@ Foam::autoPtr Foam::polyPatch::New dict ) << "Unknown polyPatch type " << patchType << " for patch " << name << nl << nl - << "Valid polyPatch types are :" << endl + << "Valid polyPatch types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalIOError); } diff --git a/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZoneNew.C b/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZoneNew.C index 2281285c07..ae9efcb289 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZoneNew.C +++ b/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZoneNew.C @@ -43,8 +43,7 @@ Foam::autoPtr Foam::cellZone::New const word zoneType(dict.lookup("type")); - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(zoneType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(zoneType); if (!cstrIter.found()) { @@ -53,7 +52,7 @@ Foam::autoPtr Foam::cellZone::New dict ) << "Unknown cellZone type " << zoneType << nl << nl - << "Valid cellZone types are:" << nl + << "Valid cellZone types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalIOError); } diff --git a/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZoneNew.C b/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZoneNew.C index b7d1e7a8d9..58acaf9ce2 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZoneNew.C +++ b/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZoneNew.C @@ -43,8 +43,7 @@ Foam::autoPtr Foam::faceZone::New const word zoneType(dict.lookup("type")); - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(zoneType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(zoneType); if (!cstrIter.found()) { @@ -53,7 +52,7 @@ Foam::autoPtr Foam::faceZone::New dict ) << "Unknown faceZone type " << zoneType << nl << nl - << "Valid faceZone types are:" << nl + << "Valid faceZone types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalIOError); } diff --git a/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZoneNew.C b/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZoneNew.C index e17d645b4a..a27c65d5b9 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZoneNew.C +++ b/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZoneNew.C @@ -43,8 +43,7 @@ Foam::autoPtr Foam::pointZone::New const word zoneType(dict.lookup("type")); - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(zoneType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(zoneType); if (!cstrIter.found()) { @@ -53,7 +52,7 @@ Foam::autoPtr Foam::pointZone::New dict ) << "Unknown pointZone type " << zoneType << nl << nl - << "Valid pointZone types are:" << nl + << "Valid pointZone types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalIOError); } diff --git a/src/OpenFOAM/primitives/functions/Function1/Function1/Function1New.C b/src/OpenFOAM/primitives/functions/Function1/Function1/Function1New.C index b9a8682a0b..fe97b5acc2 100644 --- a/src/OpenFOAM/primitives/functions/Function1/Function1/Function1New.C +++ b/src/OpenFOAM/primitives/functions/Function1/Function1/Function1New.C @@ -40,8 +40,7 @@ Foam::autoPtr> Foam::Function1::New const word Function1Type(coeffsDict.lookup("type")); - typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(Function1Type); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(Function1Type); if (!cstrIter.found()) { @@ -49,7 +48,7 @@ Foam::autoPtr> Foam::Function1::New << "Unknown Function1 type " << Function1Type << " for Function1 " << entryName << nl << nl - << "Valid Function1 types are:" << nl + << "Valid Function1 types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << nl << exit(FatalError); } @@ -76,8 +75,7 @@ Foam::autoPtr> Foam::Function1::New Function1Type = firstToken.wordToken(); } - typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(Function1Type); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(Function1Type); if (!cstrIter.found()) { @@ -85,7 +83,7 @@ Foam::autoPtr> Foam::Function1::New << "Unknown Function1 type " << Function1Type << " for Function1 " << entryName << nl << nl - << "Valid Function1 types are:" << nl + << "Valid Function1 types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << nl << exit(FatalError); } diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.C b/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.C index 5257a4c52a..0bd80034de 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.C +++ b/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.C @@ -153,8 +153,7 @@ Foam::LESModel::New Info<< "Selecting LES turbulence model " << modelType << endl; - typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C index 0f0cafba0b..1cdb6fd53b 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C +++ b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C @@ -73,15 +73,14 @@ Foam::autoPtr Foam::LESdelta::New Info<< "Selecting LES delta type " << deltaType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(deltaType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(deltaType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown LESdelta type " << deltaType << nl << nl - << "Valid LESdelta types are :" << endl + << "Valid LESdelta types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } @@ -102,36 +101,31 @@ Foam::autoPtr Foam::LESdelta::New Info<< "Selecting LES delta type " << deltaType << endl; - // First on additional ones - dictionaryConstructorTable::const_iterator cstrIter = - additionalConstructors.find(deltaType); - - if (cstrIter != additionalConstructors.end()) + // First any additional ones { - return autoPtr(cstrIter()(name, turbulence, dict)); - } - else - { - dictionaryConstructorTable::const_iterator cstrIter = - dictionaryConstructorTablePtr_->find(deltaType); + auto cstrIter = additionalConstructors.cfind(deltaType); - if (!cstrIter.found()) - { - FatalErrorInFunction - << "Unknown LESdelta type " - << deltaType << nl << nl - << "Valid LESdelta types are :" << endl - << additionalConstructors.sortedToc() - << " and " - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); - return autoPtr(); - } - else + if (cstrIter.found()) { return autoPtr(cstrIter()(name, turbulence, dict)); } } + + auto cstrIter = dictionaryConstructorTablePtr_->cfind(deltaType); + + if (!cstrIter.found()) + { + FatalErrorInFunction + << "Unknown LESdelta type " + << deltaType << nl << nl + << "Valid LESdelta types :" << endl + << additionalConstructors.sortedToc() + << " and " + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); + } + + return autoPtr(cstrIter()(name, turbulence, dict)); } diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESfilters/LESfilter/LESfilter.C b/src/TurbulenceModels/turbulenceModels/LES/LESfilters/LESfilter/LESfilter.C index dba84f07f8..ae7017eb91 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESfilters/LESfilter/LESfilter.C +++ b/src/TurbulenceModels/turbulenceModels/LES/LESfilters/LESfilter/LESfilter.C @@ -46,15 +46,14 @@ Foam::autoPtr Foam::LESfilter::New { const word filterType(dict.lookup(filterDictName)); - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(filterType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(filterType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown LESfilter type " << filterType << nl << nl - << "Valid LESfilter types are :" << endl + << "Valid LESfilter types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/TurbulenceModels/turbulenceModels/RAS/RASModel/RASModel.C b/src/TurbulenceModels/turbulenceModels/RAS/RASModel/RASModel.C index a4b283ff78..424c286f79 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/RASModel/RASModel.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/RASModel/RASModel.C @@ -143,8 +143,7 @@ Foam::RASModel::New Info<< "Selecting RAS turbulence model " << modelType << endl; - typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { diff --git a/src/TurbulenceModels/turbulenceModels/TurbulenceModel/TurbulenceModel.C b/src/TurbulenceModels/turbulenceModels/TurbulenceModel/TurbulenceModel.C index 8593c72df5..18d5be2cb9 100644 --- a/src/TurbulenceModels/turbulenceModels/TurbulenceModel/TurbulenceModel.C +++ b/src/TurbulenceModels/turbulenceModels/TurbulenceModel/TurbulenceModel.C @@ -105,15 +105,14 @@ Foam::TurbulenceModel::New Info<< "Selecting turbulence model type " << modelType << endl; - typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown TurbulenceModel type " + << "Unknown simulationType " << modelType << nl << nl - << "Valid TurbulenceModel types:" << endl + << "Valid simulation types:" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/TurbulenceModels/turbulenceModels/laminar/laminarModel/laminarModel.C b/src/TurbulenceModels/turbulenceModels/laminar/laminarModel/laminarModel.C index 33bba64b66..44e0556bc5 100644 --- a/src/TurbulenceModels/turbulenceModels/laminar/laminarModel/laminarModel.C +++ b/src/TurbulenceModels/turbulenceModels/laminar/laminarModel/laminarModel.C @@ -114,15 +114,14 @@ Foam::laminarModel::New Info<< "Selecting laminar stress model " << modelType << endl; - typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown laminarModel type " << modelType << nl << nl - << "Valid laminarModel types:" << endl + << "Valid laminarModel types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/combustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameAreaNew.C b/src/combustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameAreaNew.C index cefaf8a127..2154d2cc94 100644 --- a/src/combustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameAreaNew.C +++ b/src/combustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameAreaNew.C @@ -42,8 +42,8 @@ Foam::autoPtr Foam::reactionRateFlameArea::New Info<< "Selecting reaction rate flame area correlation " << reactionRateFlameAreaType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(reactionRateFlameAreaType); + auto cstrIter = + dictionaryConstructorTablePtr_->cfind(reactionRateFlameAreaType); if (!cstrIter.found()) { @@ -51,9 +51,9 @@ Foam::autoPtr Foam::reactionRateFlameArea::New ( dict ) << "Unknown reactionRateFlameArea type " - << reactionRateFlameAreaType << endl << endl - << "Valid reaction rate flame area types are :" << endl - << dictionaryConstructorTablePtr_->toc() + << reactionRateFlameAreaType << nl << nl + << "Valid reaction rate flame area types :" << endl + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalIOError); } diff --git a/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModelNew.C b/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModelNew.C index 76c2fb76ae..ca7d0616b8 100644 --- a/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModelNew.C +++ b/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModelNew.C @@ -53,16 +53,15 @@ Foam::combustionModels::psiCombustionModel::New Info<< "Selecting combustion model " << combModelName << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(combModelName); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(combModelName); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown psiCombustionModel type " << combModelName << endl << endl - << "Valid combustionModels are : " << endl - << dictionaryConstructorTablePtr_->toc() + << "Valid combustionModel types :" << endl + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModelNew.C b/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModelNew.C index 6060d2acc5..f6ffadc0b6 100644 --- a/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModelNew.C +++ b/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModelNew.C @@ -53,16 +53,15 @@ Foam::combustionModels::rhoCombustionModel::New Info<< "Selecting combustion model " << combTypeName << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(combTypeName); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(combTypeName); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown rhoCombustionModel type " << combTypeName << endl << endl - << "Valid combustionModels are : " << endl - << dictionaryConstructorTablePtr_->toc() + << "Valid combustionModel types :" << endl + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMeshNew.C b/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMeshNew.C index d9edadcc3f..aa4a74a790 100644 --- a/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMeshNew.C +++ b/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMeshNew.C @@ -68,15 +68,14 @@ Foam::autoPtr Foam::dynamicFvMesh::New(const IOobject& io) << exit(FatalError); } - IOobjectConstructorTable::iterator cstrIter = - IOobjectConstructorTablePtr_->find(dynamicFvMeshTypeName); + auto cstrIter = IOobjectConstructorTablePtr_->cfind(dynamicFvMeshTypeName); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown dynamicFvMesh type " << dynamicFvMeshTypeName << nl << nl - << "Valid dynamicFvMesh types are :" << endl + << "Valid dynamicFvMesh types :" << endl << IOobjectConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/dynamicMesh/meshCut/cellLooper/cellLooper.C b/src/dynamicMesh/meshCut/cellLooper/cellLooper.C index 629d16a478..9345538266 100644 --- a/src/dynamicMesh/meshCut/cellLooper/cellLooper.C +++ b/src/dynamicMesh/meshCut/cellLooper/cellLooper.C @@ -45,15 +45,14 @@ Foam::autoPtr Foam::cellLooper::New const polyMesh& mesh ) { - wordConstructorTable::iterator cstrIter = - wordConstructorTablePtr_->find(type); + auto cstrIter = wordConstructorTablePtr_->cfind(type); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown set type " + << "Unknown cellLooper type " << type << nl << nl - << "Valid cellLooper types : " << endl + << "Valid cellLooper types :" << endl << wordConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/dynamicMesh/motionSolvers/displacement/displacement/displacementMotionSolver.C b/src/dynamicMesh/motionSolvers/displacement/displacement/displacementMotionSolver.C index 6a8dbe3640..cfff04f05f 100644 --- a/src/dynamicMesh/motionSolvers/displacement/displacement/displacementMotionSolver.C +++ b/src/dynamicMesh/motionSolvers/displacement/displacement/displacementMotionSolver.C @@ -107,15 +107,14 @@ Foam::displacementMotionSolver::New << exit(FatalError); } - displacementConstructorTable::iterator cstrIter = - displacementConstructorTablePtr_->find(solverTypeName); + auto cstrIter = displacementConstructorTablePtr_->cfind(solverTypeName); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown solver type " << solverTypeName << nl << nl - << "Valid solver types are:" << endl + << "Valid solver types :" << endl << displacementConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunctionNew.C b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunctionNew.C index 911c888101..3ff7098ca0 100644 --- a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunctionNew.C +++ b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunctionNew.C @@ -37,15 +37,14 @@ Foam::autoPtr Foam::solidBodyMotionFunction::New Info<< "Selecting solid-body motion function " << motionType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(motionType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(motionType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown solidBodyMotionFunction type " << motionType << nl << nl - << "Valid solidBodyMotionFunctions are : " << endl + << "Valid solidBodyMotionFunction types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/dynamicMesh/motionSolvers/motionSolver/motionSolver.C b/src/dynamicMesh/motionSolvers/motionSolver/motionSolver.C index a3d8580554..054524a29b 100644 --- a/src/dynamicMesh/motionSolvers/motionSolver/motionSolver.C +++ b/src/dynamicMesh/motionSolvers/motionSolver/motionSolver.C @@ -104,14 +104,14 @@ Foam::autoPtr Foam::motionSolver::New const IOdictionary& solverDict ) { - const word solverTypeName + const word solverName ( solverDict.found("motionSolver") ? solverDict.lookup("motionSolver") : solverDict.lookup("solver") ); - Info<< "Selecting motion solver: " << solverTypeName << endl; + Info<< "Selecting motion solver: " << solverName << endl; const_cast(mesh.time()).libs().open ( @@ -127,15 +127,14 @@ Foam::autoPtr Foam::motionSolver::New << exit(FatalError); } - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(solverTypeName); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(solverName); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown solver type " - << solverTypeName << nl << nl - << "Valid solver types are:" << endl + << solverName << nl << nl + << "Valid solver types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/dynamicMesh/polyTopoChange/polyMeshModifier/polyMeshModifierNew.C b/src/dynamicMesh/polyTopoChange/polyMeshModifier/polyMeshModifierNew.C index f445f1a348..2569a86ce4 100644 --- a/src/dynamicMesh/polyTopoChange/polyMeshModifier/polyMeshModifierNew.C +++ b/src/dynamicMesh/polyTopoChange/polyMeshModifier/polyMeshModifierNew.C @@ -43,8 +43,7 @@ Foam::autoPtr Foam::polyMeshModifier::New const word modifierType(dict.lookup("type")); - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modifierType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modifierType); if (!cstrIter.found()) { @@ -53,7 +52,7 @@ Foam::autoPtr Foam::polyMeshModifier::New dict ) << "Unknown polyMeshModifier type " << modifierType << nl << nl - << "Valid polyMeshModifier types are :" << endl + << "Valid polyMeshModifier types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalIOError); } diff --git a/src/engine/engineMesh/engineMesh/engineMeshNew.C b/src/engine/engineMesh/engineMesh/engineMeshNew.C index 8d074d8e9c..38e23f1b5b 100644 --- a/src/engine/engineMesh/engineMesh/engineMeshNew.C +++ b/src/engine/engineMesh/engineMesh/engineMeshNew.C @@ -53,15 +53,14 @@ Foam::autoPtr Foam::engineMesh::New Info<< "Selecting engineMesh " << modelType << endl; - IOobjectConstructorTable::iterator cstrIter = - IOobjectConstructorTablePtr_->find(modelType); + auto cstrIter = IOobjectConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown engineMesh type " << modelType << nl << nl - << "Valid engineMesh types are :" << endl + << "Valid engineMesh types :" << endl << IOobjectConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/fileFormats/sampledSetWriters/writer.C b/src/fileFormats/sampledSetWriters/writer.C index 64b9743203..0caac20548 100644 --- a/src/fileFormats/sampledSetWriters/writer.C +++ b/src/fileFormats/sampledSetWriters/writer.C @@ -36,15 +36,14 @@ Foam::autoPtr> Foam::writer::New const word& writeType ) { - typename wordConstructorTable::iterator cstrIter = - wordConstructorTablePtr_->find(writeType); + auto cstrIter = wordConstructorTablePtr_->cfind(writeType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown write type " << writeType << nl << nl - << "Valid write types : " << endl + << "Valid write types :" << endl << wordConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModelNew.C b/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModelNew.C index ce5a5d148b..6851c76951 100644 --- a/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModelNew.C +++ b/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModelNew.C @@ -52,15 +52,14 @@ Foam::autoPtr Foam::SRF::SRFModel::New Info<< "Selecting SRFModel " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown SRFModel type " << modelType << nl << nl - << "Valid SRFModel types are :" << nl + << "Valid SRFModel types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/finiteVolume/cfdTools/general/fvOptions/fvOption.C b/src/finiteVolume/cfdTools/general/fvOptions/fvOption.C index f63fd852bf..76042ef024 100644 --- a/src/finiteVolume/cfdTools/general/fvOptions/fvOption.C +++ b/src/finiteVolume/cfdTools/general/fvOptions/fvOption.C @@ -70,10 +70,10 @@ Foam::autoPtr Foam::fv::option::New const fvMesh& mesh ) { - word modelType(coeffs.lookup("type")); + const word modelType(coeffs.lookup("type")); Info<< indent - << "Selecting finite volume options model type " << modelType << endl; + << "Selecting finite volume options type " << modelType << endl; const_cast(mesh.time()).libs().open ( @@ -82,14 +82,14 @@ Foam::autoPtr Foam::fv::option::New dictionaryConstructorTablePtr_ ); - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown Model type " << modelType << nl << nl - << "Valid model types are:" << nl + << "Unknown fvOption model type " + << modelType << nl << nl + << "Valid fvOption types are:" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModelNew.C b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModelNew.C index e45f4a2964..811023faaa 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModelNew.C +++ b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModelNew.C @@ -40,8 +40,7 @@ Foam::autoPtr Foam::porosityModel::New Info<< "Porosity region " << name << ":" << nl << " selecting model: " << modelType << endl; - meshConstructorTable::iterator cstrIter = - meshConstructorTablePtr_->find(modelType); + auto cstrIter = meshConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { diff --git a/src/finiteVolume/fields/fvPatchFields/basic/calculated/calculatedFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/basic/calculated/calculatedFvPatchField.C index 0f205cd057..27f2d4f98f 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/calculated/calculatedFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/basic/calculated/calculatedFvPatchField.C @@ -102,8 +102,7 @@ Foam::fvPatchField::NewCalculatedType const fvPatch& p ) { - typename patchConstructorTable::iterator patchTypeCstrIter = - patchConstructorTablePtr_->find(p.type()); + auto patchTypeCstrIter = patchConstructorTablePtr_->cfind(p.type()); if (patchTypeCstrIter.found()) { diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchFieldNew.C b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchFieldNew.C index bf62d071dc..866c8a48a5 100644 --- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchFieldNew.C +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchFieldNew.C @@ -42,21 +42,19 @@ Foam::tmp> Foam::fvPatchField::New << endl; } - typename patchConstructorTable::iterator cstrIter = - patchConstructorTablePtr_->find(patchFieldType); + auto cstrIter = patchConstructorTablePtr_->cfind(patchFieldType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown patchField type " << patchFieldType << nl << nl - << "Valid patchField types are :" << endl + << "Valid patchField types :" << endl << patchConstructorTablePtr_->sortedToc() << exit(FatalError); } - typename patchConstructorTable::iterator patchTypeCstrIter = - patchConstructorTablePtr_->find(p.type()); + auto patchTypeCstrIter = patchConstructorTablePtr_->cfind(p.type()); if ( @@ -116,14 +114,13 @@ Foam::tmp> Foam::fvPatchField::New << endl; } - typename dictionaryConstructorTable::iterator cstrIter - = dictionaryConstructorTablePtr_->find(patchFieldType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(patchFieldType); if (!cstrIter.found()) { if (!disallowGenericFvPatchField) { - cstrIter = dictionaryConstructorTablePtr_->find("generic"); + cstrIter = dictionaryConstructorTablePtr_->cfind("generic"); } if (!cstrIter.found()) @@ -133,7 +130,7 @@ Foam::tmp> Foam::fvPatchField::New dict ) << "Unknown patchField type " << patchFieldType << " for patch type " << p.type() << nl << nl - << "Valid patchField types are :" << endl + << "Valid patchField types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalIOError); } @@ -145,8 +142,8 @@ Foam::tmp> Foam::fvPatchField::New || word(dict.lookup("patchType")) != p.type() ) { - typename dictionaryConstructorTable::iterator patchTypeCstrIter - = dictionaryConstructorTablePtr_->find(p.type()); + auto patchTypeCstrIter + = dictionaryConstructorTablePtr_->cfind(p.type()); if (patchTypeCstrIter.found() && patchTypeCstrIter() != cstrIter()) { @@ -178,14 +175,13 @@ Foam::tmp> Foam::fvPatchField::New InfoInFunction << "Constructing fvPatchField" << endl; } - typename patchMapperConstructorTable::iterator cstrIter = - patchMapperConstructorTablePtr_->find(ptf.type()); + auto cstrIter = patchMapperConstructorTablePtr_->cfind(ptf.type()); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown patchField type " << ptf.type() << nl << nl - << "Valid patchField types are :" << endl + << "Valid patchField types :" << endl << patchMapperConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/finiteVolume/fields/fvsPatchFields/basic/calculated/calculatedFvsPatchField.C b/src/finiteVolume/fields/fvsPatchFields/basic/calculated/calculatedFvsPatchField.C index fcfbb1dae1..383d613a22 100644 --- a/src/finiteVolume/fields/fvsPatchFields/basic/calculated/calculatedFvsPatchField.C +++ b/src/finiteVolume/fields/fvsPatchFields/basic/calculated/calculatedFvsPatchField.C @@ -100,8 +100,7 @@ Foam::fvsPatchField::NewCalculatedType const fvPatch& p ) { - typename patchConstructorTable::iterator patchTypeCstrIter = - patchConstructorTablePtr_->find(p.type()); + auto patchTypeCstrIter = patchConstructorTablePtr_->cfind(p.type()); if (patchTypeCstrIter.found()) { diff --git a/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchFieldNew.C b/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchFieldNew.C index 12af314f87..5bcd17570e 100644 --- a/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchFieldNew.C +++ b/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchFieldNew.C @@ -39,15 +39,14 @@ Foam::tmp> Foam::fvsPatchField::New InfoInFunction << "Constructing fvsPatchField" << endl; } - typename patchConstructorTable::iterator cstrIter = - patchConstructorTablePtr_->find(patchFieldType); + auto cstrIter = patchConstructorTablePtr_->cfind(patchFieldType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown patchField type " << patchFieldType << nl << nl - << "Valid patchField types are :" << endl + << "Valid patchField types :" << endl << patchConstructorTablePtr_->sortedToc() << exit(FatalError); } @@ -58,8 +57,7 @@ Foam::tmp> Foam::fvsPatchField::New || actualPatchType != p.type() ) { - typename patchConstructorTable::iterator patchTypeCstrIter = - patchConstructorTablePtr_->find(p.type()); + auto patchTypeCstrIter = patchConstructorTablePtr_->cfind(p.type()); if (patchTypeCstrIter.found()) { @@ -104,14 +102,13 @@ Foam::tmp> Foam::fvsPatchField::New const word patchFieldType(dict.lookup("type")); - typename dictionaryConstructorTable::iterator cstrIter - = dictionaryConstructorTablePtr_->find(patchFieldType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(patchFieldType); if (!cstrIter.found()) { if (!disallowGenericFvsPatchField) { - cstrIter = dictionaryConstructorTablePtr_->find("generic"); + cstrIter = dictionaryConstructorTablePtr_->cfind("generic"); } if (!cstrIter.found()) @@ -121,7 +118,7 @@ Foam::tmp> Foam::fvsPatchField::New dict ) << "Unknown patchField type " << patchFieldType << " for patch type " << p.type() << nl << nl - << "Valid patchField types are :" << endl + << "Valid patchField types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalIOError); } @@ -133,8 +130,8 @@ Foam::tmp> Foam::fvsPatchField::New || word(dict.lookup("patchType")) != p.type() ) { - typename dictionaryConstructorTable::iterator patchTypeCstrIter - = dictionaryConstructorTablePtr_->find(p.type()); + auto patchTypeCstrIter + = dictionaryConstructorTablePtr_->cfind(p.type()); if (patchTypeCstrIter.found() && patchTypeCstrIter() != cstrIter()) { @@ -166,20 +163,18 @@ Foam::tmp> Foam::fvsPatchField::New InfoInFunction << "Constructing fvsPatchField" << endl; } - typename patchMapperConstructorTable::iterator cstrIter = - patchMapperConstructorTablePtr_->find(ptf.type()); + auto cstrIter = patchMapperConstructorTablePtr_->cfind(ptf.type()); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown patchField type " << ptf.type() << nl << nl - << "Valid patchField types are :" << endl + << "Valid patchField types :" << endl << patchMapperConstructorTablePtr_->sortedToc() << exit(FatalError); } - typename patchMapperConstructorTable::iterator - patchTypeCstrIter = patchMapperConstructorTablePtr_->find(p.type()); + auto patchTypeCstrIter = patchMapperConstructorTablePtr_->cfind(p.type()); if (patchTypeCstrIter.found()) { diff --git a/src/finiteVolume/finiteVolume/convectionSchemes/convectionScheme/convectionScheme.C b/src/finiteVolume/finiteVolume/convectionSchemes/convectionScheme/convectionScheme.C index a8539a5c48..ca63afc788 100644 --- a/src/finiteVolume/finiteVolume/convectionSchemes/convectionScheme/convectionScheme.C +++ b/src/finiteVolume/finiteVolume/convectionSchemes/convectionScheme/convectionScheme.C @@ -79,15 +79,15 @@ tmp> convectionScheme::New const word schemeName(schemeData); - typename IstreamConstructorTable::iterator cstrIter = - IstreamConstructorTablePtr_->find(schemeName); + auto cstrIter = IstreamConstructorTablePtr_->cfind(schemeName); if (!cstrIter.found()) { FatalIOErrorInFunction ( schemeData - ) << "Unknown convection scheme " << schemeName << nl << nl + ) << "Unknown convection scheme " + << schemeName << nl << nl << "Valid convection schemes are :" << endl << IstreamConstructorTablePtr_->sortedToc() << exit(FatalIOError); @@ -125,15 +125,15 @@ tmp> convectionScheme::New const word schemeName(schemeData); - typename MultivariateConstructorTable::iterator cstrIter = - MultivariateConstructorTablePtr_->find(schemeName); + auto cstrIter = MultivariateConstructorTablePtr_->cfind(schemeName); if (!cstrIter.found()) { FatalIOErrorInFunction ( schemeData - ) << "Unknown convection scheme " << schemeName << nl << nl + ) << "Unknown convection scheme " + << schemeName << nl << nl << "Valid convection schemes are :" << endl << MultivariateConstructorTablePtr_->sortedToc() << exit(FatalIOError); diff --git a/src/finiteVolume/finiteVolume/d2dt2Schemes/d2dt2Scheme/d2dt2Scheme.C b/src/finiteVolume/finiteVolume/d2dt2Schemes/d2dt2Scheme/d2dt2Scheme.C index d9c7091e6b..ffdc4c25b8 100644 --- a/src/finiteVolume/finiteVolume/d2dt2Schemes/d2dt2Scheme/d2dt2Scheme.C +++ b/src/finiteVolume/finiteVolume/d2dt2Schemes/d2dt2Scheme/d2dt2Scheme.C @@ -66,15 +66,15 @@ tmp> d2dt2Scheme::New const word schemeName(schemeData); - typename IstreamConstructorTable::iterator cstrIter = - IstreamConstructorTablePtr_->find(schemeName); + auto cstrIter = IstreamConstructorTablePtr_->cfind(schemeName); if (!cstrIter.found()) { FatalIOErrorInFunction ( schemeData - ) << "Unknown d2dt2 scheme " << schemeName << nl << nl + ) << "Unknown d2dt2 scheme " + << schemeName << nl << nl << "Valid d2dt2 schemes are :" << endl << IstreamConstructorTablePtr_->sortedToc() << exit(FatalIOError); diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C index f5e11840b9..fd4f502ed9 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C @@ -66,15 +66,15 @@ tmp> ddtScheme::New const word schemeName(schemeData); - typename IstreamConstructorTable::iterator cstrIter = - IstreamConstructorTablePtr_->find(schemeName); + auto cstrIter = IstreamConstructorTablePtr_->cfind(schemeName); if (!cstrIter.found()) { FatalIOErrorInFunction ( schemeData - ) << "Unknown ddt scheme " << schemeName << nl << nl + ) << "Unknown ddt scheme " + << schemeName << nl << nl << "Valid ddt schemes are :" << endl << IstreamConstructorTablePtr_->sortedToc() << exit(FatalIOError); diff --git a/src/finiteVolume/finiteVolume/divSchemes/divScheme/divScheme.C b/src/finiteVolume/finiteVolume/divSchemes/divScheme/divScheme.C index af586b63a5..8c71aafcb3 100644 --- a/src/finiteVolume/finiteVolume/divSchemes/divScheme/divScheme.C +++ b/src/finiteVolume/finiteVolume/divSchemes/divScheme/divScheme.C @@ -67,8 +67,7 @@ tmp> divScheme::New const word schemeName(schemeData); - typename IstreamConstructorTable::iterator cstrIter = - IstreamConstructorTablePtr_->find(schemeName); + auto cstrIter = IstreamConstructorTablePtr_->cfind(schemeName); if (!cstrIter.found()) { diff --git a/src/finiteVolume/finiteVolume/gradSchemes/gradScheme/gradScheme.C b/src/finiteVolume/finiteVolume/gradSchemes/gradScheme/gradScheme.C index 4358fab029..1a055779f1 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/gradScheme/gradScheme.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/gradScheme/gradScheme.C @@ -54,15 +54,15 @@ Foam::tmp> Foam::fv::gradScheme::New const word schemeName(schemeData); - typename IstreamConstructorTable::iterator cstrIter = - IstreamConstructorTablePtr_->find(schemeName); + auto cstrIter = IstreamConstructorTablePtr_->cfind(schemeName); if (!cstrIter.found()) { FatalIOErrorInFunction ( schemeData - ) << "Unknown grad scheme " << schemeName << nl << nl + ) << "Unknown grad scheme " + << schemeName << nl << nl << "Valid grad schemes are :" << endl << IstreamConstructorTablePtr_->sortedToc() << exit(FatalIOError); diff --git a/src/finiteVolume/finiteVolume/laplacianSchemes/laplacianScheme/laplacianScheme.C b/src/finiteVolume/finiteVolume/laplacianSchemes/laplacianScheme/laplacianScheme.C index f783228754..0a774bdf5d 100644 --- a/src/finiteVolume/finiteVolume/laplacianSchemes/laplacianScheme/laplacianScheme.C +++ b/src/finiteVolume/finiteVolume/laplacianSchemes/laplacianScheme/laplacianScheme.C @@ -65,15 +65,15 @@ tmp> laplacianScheme::New const word schemeName(schemeData); - typename IstreamConstructorTable::iterator cstrIter = - IstreamConstructorTablePtr_->find(schemeName); + auto cstrIter = IstreamConstructorTablePtr_->cfind(schemeName); if (!cstrIter.found()) { FatalIOErrorInFunction ( schemeData - ) << "Unknown laplacian scheme " << schemeName << nl << nl + ) << "Unknown laplacian scheme " + << schemeName << nl << nl << "Valid laplacian schemes are :" << endl << IstreamConstructorTablePtr_->sortedToc() << exit(FatalIOError); diff --git a/src/finiteVolume/finiteVolume/snGradSchemes/snGradScheme/snGradScheme.C b/src/finiteVolume/finiteVolume/snGradSchemes/snGradScheme/snGradScheme.C index 5644e7a6b1..d5422e729d 100644 --- a/src/finiteVolume/finiteVolume/snGradSchemes/snGradScheme/snGradScheme.C +++ b/src/finiteVolume/finiteVolume/snGradSchemes/snGradScheme/snGradScheme.C @@ -67,10 +67,9 @@ tmp> snGradScheme::New const word schemeName(schemeData); - typename MeshConstructorTable::iterator constructorIter = - MeshConstructorTablePtr_->find(schemeName); + auto cstrIter = MeshConstructorTablePtr_->cfind(schemeName); - if (!constructorIter.found()) + if (!cstrIter.found()) { FatalIOErrorInFunction ( @@ -82,7 +81,7 @@ tmp> snGradScheme::New << exit(FatalIOError); } - return constructorIter()(mesh, schemeData); + return cstrIter()(mesh, schemeData); } diff --git a/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatch.C b/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatch.C index 77c05e0863..579387eaec 100644 --- a/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatch.C +++ b/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatch.C @@ -70,13 +70,7 @@ Foam::wordList Foam::fvPatch::constraintTypes() label i = 0; - for - ( - polyPatchConstructorTable::iterator cstrIter = - polyPatchConstructorTablePtr_->begin(); - cstrIter != polyPatchConstructorTablePtr_->end(); - ++cstrIter - ) + forAllConstIters(*polyPatchConstructorTablePtr_, cstrIter) { if (constraintType(cstrIter.key())) { diff --git a/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatchNew.C b/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatchNew.C index 468b9b88f6..a916503f98 100644 --- a/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatchNew.C +++ b/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatchNew.C @@ -40,14 +40,13 @@ Foam::autoPtr Foam::fvPatch::New InfoInFunction << "Constructing fvPatch" << endl; } - polyPatchConstructorTable::iterator cstrIter = - polyPatchConstructorTablePtr_->find(patch.type()); + auto cstrIter = polyPatchConstructorTablePtr_->cfind(patch.type()); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown fvPatch type " << patch.type() << nl - << "Valid fvPatch types are :" + << "Valid fvPatch types :" << polyPatchConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/finiteVolume/fvMesh/wallDist/patchDistMethods/patchDistMethod/patchDistMethod.C b/src/finiteVolume/fvMesh/wallDist/patchDistMethods/patchDistMethod/patchDistMethod.C index 349d356497..e7357ff4d4 100644 --- a/src/finiteVolume/fvMesh/wallDist/patchDistMethods/patchDistMethod/patchDistMethod.C +++ b/src/finiteVolume/fvMesh/wallDist/patchDistMethods/patchDistMethod/patchDistMethod.C @@ -56,19 +56,18 @@ Foam::autoPtr Foam::patchDistMethod::New const labelHashSet& patchIDs ) { - word patchDistMethodType(dict.lookup("method")); + const word methodType(dict.lookup("method")); - Info<< "Selecting patchDistMethod " << patchDistMethodType << endl; + Info<< "Selecting patchDistMethod " << methodType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(patchDistMethodType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(methodType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown patchDistMethodType type " - << patchDistMethodType << endl << endl - << "Valid patchDistMethod types are : " << endl + << "Unknown patchDistMethod type " + << methodType << endl << endl + << "Valid patchDistMethod types : " << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } @@ -86,19 +85,18 @@ Foam::autoPtr Foam::patchDistMethod::New const word& defaultPatchDistMethod ) { - word patchDistMethodType = defaultPatchDistMethod; - dict.readIfPresent("method", patchDistMethodType); + word methodType = defaultPatchDistMethod; + dict.readIfPresent("method", methodType); - Info<< "Selecting patchDistMethod " << patchDistMethodType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(patchDistMethodType); + Info<< "Selecting patchDistMethod " << methodType << endl; + auto cstrIter = dictionaryConstructorTablePtr_->cfind(methodType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown patchDistMethodType type " - << patchDistMethodType << endl << endl - << "Valid patchDistMethod types are : " << endl + << methodType << endl << endl + << "Valid patchDistMethod types : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/finiteVolume/interpolation/interpolation/interpolation/interpolationNew.C b/src/finiteVolume/interpolation/interpolation/interpolation/interpolationNew.C index decc033fe5..14f3f86f6d 100644 --- a/src/finiteVolume/interpolation/interpolation/interpolation/interpolationNew.C +++ b/src/finiteVolume/interpolation/interpolation/interpolation/interpolationNew.C @@ -35,8 +35,7 @@ Foam::autoPtr> Foam::interpolation::New const GeometricField& psi ) { - typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(interpolationType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(interpolationType); if (!cstrIter.found()) { diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/limitedSurfaceInterpolationScheme/limitedSurfaceInterpolationScheme.C b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/limitedSurfaceInterpolationScheme/limitedSurfaceInterpolationScheme.C index fae9dddca3..d2c301c8dc 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/limitedSurfaceInterpolationScheme/limitedSurfaceInterpolationScheme.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/limitedSurfaceInterpolationScheme/limitedSurfaceInterpolationScheme.C @@ -58,10 +58,9 @@ Foam::limitedSurfaceInterpolationScheme::New const word schemeName(schemeData); - typename MeshConstructorTable::iterator constructorIter = - MeshConstructorTablePtr_->find(schemeName); + auto cstrIter = MeshConstructorTablePtr_->cfind(schemeName); - if (!constructorIter.found()) + if (!cstrIter.found()) { FatalIOErrorInFunction ( @@ -73,7 +72,7 @@ Foam::limitedSurfaceInterpolationScheme::New << exit(FatalIOError); } - return constructorIter()(mesh, schemeData); + return cstrIter()(mesh, schemeData); } @@ -107,10 +106,9 @@ Foam::limitedSurfaceInterpolationScheme::New const word schemeName(schemeData); - typename MeshFluxConstructorTable::iterator constructorIter = - MeshFluxConstructorTablePtr_->find(schemeName); + auto cstrIter = MeshFluxConstructorTablePtr_->cfind(schemeName); - if (!constructorIter.found()) + if (!cstrIter.found()) { FatalIOErrorInFunction ( @@ -122,7 +120,7 @@ Foam::limitedSurfaceInterpolationScheme::New << exit(FatalIOError); } - return constructorIter()(mesh, faceFlux, schemeData); + return cstrIter()(mesh, faceFlux, schemeData); } diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/multivariateSchemes/multivariateSurfaceInterpolationScheme/multivariateSurfaceInterpolationScheme.C b/src/finiteVolume/interpolation/surfaceInterpolation/multivariateSchemes/multivariateSurfaceInterpolationScheme/multivariateSurfaceInterpolationScheme.C index ea3017016b..e9400fbfee 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/multivariateSchemes/multivariateSurfaceInterpolationScheme/multivariateSurfaceInterpolationScheme.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/multivariateSchemes/multivariateSurfaceInterpolationScheme/multivariateSurfaceInterpolationScheme.C @@ -68,10 +68,9 @@ Foam::multivariateSurfaceInterpolationScheme::New const word schemeName(schemeData); - typename IstreamConstructorTable::iterator constructorIter = - IstreamConstructorTablePtr_->find(schemeName); + auto cstrIter = IstreamConstructorTablePtr_->cfind(schemeName); - if (!constructorIter.found()) + if (!cstrIter.found()) { FatalIOErrorInFunction ( @@ -82,7 +81,7 @@ Foam::multivariateSurfaceInterpolationScheme::New << exit(FatalIOError); } - return constructorIter()(mesh, vtfs, faceFlux, schemeData); + return cstrIter()(mesh, vtfs, faceFlux, schemeData); } diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolationScheme/surfaceInterpolationScheme.C b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolationScheme/surfaceInterpolationScheme.C index 0fbf63650b..b35c82f8a7 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolationScheme/surfaceInterpolationScheme.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolationScheme/surfaceInterpolationScheme.C @@ -58,10 +58,9 @@ Foam::surfaceInterpolationScheme::New InfoInFunction << "Discretisation scheme = " << schemeName << endl; } - typename MeshConstructorTable::iterator constructorIter = - MeshConstructorTablePtr_->find(schemeName); + auto cstrIter = MeshConstructorTablePtr_->cfind(schemeName); - if (!constructorIter.found()) + if (!cstrIter.found()) { FatalIOErrorInFunction ( @@ -73,7 +72,7 @@ Foam::surfaceInterpolationScheme::New << exit(FatalIOError); } - return constructorIter()(mesh, schemeData); + return cstrIter()(mesh, schemeData); } @@ -106,10 +105,9 @@ Foam::surfaceInterpolationScheme::New << "Discretisation scheme = " << schemeName << endl; } - typename MeshFluxConstructorTable::iterator constructorIter = - MeshFluxConstructorTablePtr_->find(schemeName); + auto cstrIter = MeshFluxConstructorTablePtr_->cfind(schemeName); - if (!constructorIter.found()) + if (!cstrIter.found()) { FatalIOErrorInFunction ( @@ -121,7 +119,7 @@ Foam::surfaceInterpolationScheme::New << exit(FatalIOError); } - return constructorIter()(mesh, faceFlux, schemeData); + return cstrIter()(mesh, faceFlux, schemeData); } @@ -241,8 +239,7 @@ Foam::surfaceInterpolationScheme::dotInterpolate << "Interpolating " << vf.type() << " " << vf.name() - << " from cells to faces " - "without explicit correction" + << " from cells to faces without explicit correction" << endl; } diff --git a/src/functionObjects/field/fieldValues/fieldValue/fieldValueNew.C b/src/functionObjects/field/fieldValues/fieldValue/fieldValueNew.C index 270859347e..b665ee2896 100644 --- a/src/functionObjects/field/fieldValues/fieldValue/fieldValueNew.C +++ b/src/functionObjects/field/fieldValues/fieldValue/fieldValueNew.C @@ -43,15 +43,14 @@ Foam::functionObjects::fieldValue::New Info<< "Selecting " << typeName << " " << modelType << endl; } - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown " << typeName << " type " << modelType << nl << nl - << "Valid " << typeName << " types are:" << nl + << "Valid " << typeName << " types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/functionObjects/graphics/runTimePostProcessing/pathline.C b/src/functionObjects/graphics/runTimePostProcessing/pathline.C index 717125fdc9..770356a70c 100644 --- a/src/functionObjects/graphics/runTimePostProcessing/pathline.C +++ b/src/functionObjects/graphics/runTimePostProcessing/pathline.C @@ -183,15 +183,14 @@ Foam::functionObjects::runTimePostPro::pathline::New Info<< "Selecting pathline " << pathlineType << endl; } - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(pathlineType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(pathlineType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown pathline type " << pathlineType << nl << nl - << "Valid pathline types are:" << endl + << "Valid pathline types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/functionObjects/graphics/runTimePostProcessing/pointData.C b/src/functionObjects/graphics/runTimePostProcessing/pointData.C index e9c8afacce..4274296288 100644 --- a/src/functionObjects/graphics/runTimePostProcessing/pointData.C +++ b/src/functionObjects/graphics/runTimePostProcessing/pointData.C @@ -143,15 +143,14 @@ Foam::autoPtr Foam::functionOb Info<< "Selecting pointData " << pointDataType << endl; } - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(pointDataType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(pointDataType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown pointData type " << pointDataType << nl << nl - << "Valid pointData types are:" << endl + << "Valid pointData types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/functionObjects/graphics/runTimePostProcessing/surface.C b/src/functionObjects/graphics/runTimePostProcessing/surface.C index 809b8294ad..fe58ffc99a 100644 --- a/src/functionObjects/graphics/runTimePostProcessing/surface.C +++ b/src/functionObjects/graphics/runTimePostProcessing/surface.C @@ -209,15 +209,14 @@ Foam::functionObjects::runTimePostPro::surface::New Info<< "Selecting surface " << surfaceType << endl; } - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(surfaceType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(surfaceType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown surface type " << surfaceType << nl << nl - << "Valid surface types are:" << endl + << "Valid surface types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/functionObjects/utilities/runTimeControl/runTimeCondition/runTimeCondition/runTimeConditionNew.C b/src/functionObjects/utilities/runTimeControl/runTimeCondition/runTimeCondition/runTimeConditionNew.C index 85192b98ec..5f5d878bae 100644 --- a/src/functionObjects/utilities/runTimeControl/runTimeCondition/runTimeCondition/runTimeConditionNew.C +++ b/src/functionObjects/utilities/runTimeControl/runTimeCondition/runTimeCondition/runTimeConditionNew.C @@ -36,19 +36,18 @@ Foam::functionObjects::runTimeControls::runTimeCondition::New stateFunctionObject& state ) { - word conditionType(dict.lookup("type")); + const word conditionType(dict.lookup("type")); Info<< "Selecting runTimeCondition " << conditionType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(conditionType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(conditionType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown runTimeCondition type " << conditionType << nl << nl - << "Valid runTimeCondition types are:" << nl + << "Valid runTimeCondition types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/fvMotionSolver/motionDiffusivity/motionDiffusivity/motionDiffusivity.C b/src/fvMotionSolver/motionDiffusivity/motionDiffusivity/motionDiffusivity.C index 161c424b26..c197e03ce8 100644 --- a/src/fvMotionSolver/motionDiffusivity/motionDiffusivity/motionDiffusivity.C +++ b/src/fvMotionSolver/motionDiffusivity/motionDiffusivity/motionDiffusivity.C @@ -54,15 +54,14 @@ Foam::autoPtr Foam::motionDiffusivity::New Info<< "Selecting motion diffusion: " << motionType << endl; - IstreamConstructorTable::iterator cstrIter = - IstreamConstructorTablePtr_->find(motionType); + auto cstrIter = IstreamConstructorTablePtr_->cfind(motionType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown diffusion type " << motionType << nl << nl - << "Valid diffusion types are :" << endl + << "Valid diffusion types :" << nl << IstreamConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/fvMotionSolver/motionInterpolation/motionInterpolation/motionInterpolation.C b/src/fvMotionSolver/motionInterpolation/motionInterpolation/motionInterpolation.C index c59808a21b..5210b6e286 100644 --- a/src/fvMotionSolver/motionInterpolation/motionInterpolation/motionInterpolation.C +++ b/src/fvMotionSolver/motionInterpolation/motionInterpolation/motionInterpolation.C @@ -32,7 +32,6 @@ License namespace Foam { defineTypeNameAndDebug(motionInterpolation, 0); - defineRunTimeSelectionTable(motionInterpolation, Istream); } @@ -74,15 +73,14 @@ Foam::motionInterpolation::New(const fvMesh& mesh, Istream& entry) Info<< "Selecting motion interpolation: " << type << endl; - IstreamConstructorTable::iterator cstrIter = - IstreamConstructorTablePtr_->find(type); + auto cstrIter = IstreamConstructorTablePtr_->cfind(type); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown interpolation type " << type << nl << nl - << "Valid interpolation types are :" << endl + << "Valid interpolation types :" << endl << IstreamConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/fvOptions/sources/derived/rotorDiskSource/profileModel/profileModel.C b/src/fvOptions/sources/derived/rotorDiskSource/profileModel/profileModel.C index a9b037a8ae..8f4f471567 100644 --- a/src/fvOptions/sources/derived/rotorDiskSource/profileModel/profileModel.C +++ b/src/fvOptions/sources/derived/rotorDiskSource/profileModel/profileModel.C @@ -73,21 +73,20 @@ Foam::autoPtr Foam::profileModel::New const dictionary& dict ) { - const word& modelName(dict.dictName()); + const word& modelName = dict.dictName(); const word modelType(dict.lookup("type")); Info<< " - creating " << modelType << " profile " << modelName << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown profile model type " << modelType - << nl << nl - << "Valid model types are :" << nl + << "Unknown profile model type " + << modelType << nl << nl + << "Valid model types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/fvOptions/sources/derived/rotorDiskSource/trimModel/trimModel/trimModelNew.C b/src/fvOptions/sources/derived/rotorDiskSource/trimModel/trimModel/trimModelNew.C index 92b0b09f5c..3aef03cc40 100644 --- a/src/fvOptions/sources/derived/rotorDiskSource/trimModel/trimModel/trimModelNew.C +++ b/src/fvOptions/sources/derived/rotorDiskSource/trimModel/trimModel/trimModelNew.C @@ -37,15 +37,14 @@ Foam::autoPtr Foam::trimModel::New Info<< " Selecting " << typeName << " " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown " << typeName << " type " << modelType << nl << nl - << "Valid " << typeName << " types are:" << nl + << "Valid " << typeName << " types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/lagrangian/DSMC/submodels/BinaryCollisionModel/BinaryCollisionModel/BinaryCollisionModelNew.C b/src/lagrangian/DSMC/submodels/BinaryCollisionModel/BinaryCollisionModel/BinaryCollisionModelNew.C index 43488462bd..549932dfe2 100644 --- a/src/lagrangian/DSMC/submodels/BinaryCollisionModel/BinaryCollisionModel/BinaryCollisionModelNew.C +++ b/src/lagrangian/DSMC/submodels/BinaryCollisionModel/BinaryCollisionModel/BinaryCollisionModelNew.C @@ -39,15 +39,14 @@ Foam::BinaryCollisionModel::New Info<< "Selecting BinaryCollisionModel " << modelType << endl; - typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown BinaryCollisionModel type " << modelType << nl << nl - << "Valid BinaryCollisionModel types are:" << nl + << "Valid BinaryCollisionModel types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/lagrangian/DSMC/submodels/InflowBoundaryModel/InflowBoundaryModel/InflowBoundaryModelNew.C b/src/lagrangian/DSMC/submodels/InflowBoundaryModel/InflowBoundaryModel/InflowBoundaryModelNew.C index fb67a50e0a..70f9d09e80 100644 --- a/src/lagrangian/DSMC/submodels/InflowBoundaryModel/InflowBoundaryModel/InflowBoundaryModelNew.C +++ b/src/lagrangian/DSMC/submodels/InflowBoundaryModel/InflowBoundaryModel/InflowBoundaryModelNew.C @@ -39,15 +39,14 @@ Foam::InflowBoundaryModel::New Info<< "Selecting InflowBoundaryModel " << modelType << endl; - typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown InflowBoundaryModel type " << modelType << nl << nl - << "Valid InflowBoundaryModel types are:" << nl + << "Valid InflowBoundaryModel types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/lagrangian/DSMC/submodels/WallInteractionModel/WallInteractionModel/WallInteractionModelNew.C b/src/lagrangian/DSMC/submodels/WallInteractionModel/WallInteractionModel/WallInteractionModelNew.C index 55a134367e..6254511609 100644 --- a/src/lagrangian/DSMC/submodels/WallInteractionModel/WallInteractionModel/WallInteractionModelNew.C +++ b/src/lagrangian/DSMC/submodels/WallInteractionModel/WallInteractionModel/WallInteractionModelNew.C @@ -39,15 +39,14 @@ Foam::WallInteractionModel::New Info<< "Selecting WallInteractionModel " << modelType << endl; - typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown WallInteractionModel type " << modelType << nl << nl - << "Valid WallInteractionModel types are:" << nl + << "Valid WallInteractionModel types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/lagrangian/distributionModels/distributionModel/distributionModelNew.C b/src/lagrangian/distributionModels/distributionModel/distributionModelNew.C index 9fa9d5c334..aa596e6898 100644 --- a/src/lagrangian/distributionModels/distributionModel/distributionModelNew.C +++ b/src/lagrangian/distributionModels/distributionModel/distributionModelNew.C @@ -37,14 +37,14 @@ Foam::autoPtr Foam::distributionModel::New Info<< "Selecting distribution model " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown distribution model type " << modelType << nl << nl - << "Valid distribution model types are:" << nl + << "Unknown distribution model type " + << modelType << nl << nl + << "Valid distribution model types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/lagrangian/intermediate/IntegrationScheme/IntegrationScheme/IntegrationSchemeNew.C b/src/lagrangian/intermediate/IntegrationScheme/IntegrationScheme/IntegrationSchemeNew.C index 1c84dc5ae9..c6fbb3e632 100644 --- a/src/lagrangian/intermediate/IntegrationScheme/IntegrationScheme/IntegrationSchemeNew.C +++ b/src/lagrangian/intermediate/IntegrationScheme/IntegrationScheme/IntegrationSchemeNew.C @@ -41,15 +41,14 @@ Foam::IntegrationScheme::New Info<< "Selecting " << phiName << " integration scheme " << schemeName << endl; - typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(schemeName); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(schemeName); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown integration scheme type " << schemeName << nl << nl - << "Valid integration scheme types are:" << nl + << "Valid integration scheme types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << nl << exit(FatalError); } diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObject/CloudFunctionObjectNew.C b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObject/CloudFunctionObjectNew.C index 1b115c6c26..0fe50e2e75 100644 --- a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObject/CloudFunctionObjectNew.C +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObject/CloudFunctionObjectNew.C @@ -40,15 +40,14 @@ Foam::CloudFunctionObject::New Info<< " Selecting cloud function " << modelName << " of type " << objectType << endl; - typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(objectType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(objectType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown cloud function type " << objectType << nl << nl - << "Valid cloud function types are:" << nl + << "Valid cloud function types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/CollisionModelNew.C b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/CollisionModelNew.C index 8548abfc76..5c8b778c91 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/CollisionModelNew.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/CollisionModelNew.C @@ -35,20 +35,20 @@ Foam::CollisionModel::New CloudType& owner ) { - word modelType(dict.lookup("collisionModel")); + const word modelType(dict.lookup("collisionModel")); Info<< "Selecting collision model " << modelType << endl; - typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown collision model type " << modelType - << ", constructor not in hash table" << nl << nl - << " Valid collision model types are:" << nl - << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); + << "Unknown collisionModel type " + << modelType << nl << nl + << "Valid collisionModel types :" << nl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); } return autoPtr>(cstrIter()(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 f98062e8e1..6f8a2d1b42 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 @@ -35,21 +35,20 @@ Foam::PairModel::New CloudType& owner ) { - word PairModelType(dict.lookup("pairModel")); + const word modelType(dict.lookup("pairModel")); - Info<< "Selecting pair model " << PairModelType << endl; + Info<< "Selecting pair model " << modelType << endl; - typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(PairModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown pair model type " - << PairModelType - << ", constructor not in hash table" << nl << nl - << " Valid pair model types are:" << nl - << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); + << "Unknown pairModel type " + << modelType << nl << nl + << "Valid pairModel types :" << nl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); } return autoPtr>(cstrIter()(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 21b9f57318..936163a3fe 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 @@ -35,20 +35,20 @@ Foam::WallModel::New CloudType& owner ) { - word WallModelType(dict.lookup("wallModel")); + const word modelType(dict.lookup("wallModel")); - Info<< "Selecting wall model " << WallModelType << endl; + Info<< "Selecting wall model " << modelType << endl; - typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(WallModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown wall model type type " << WallModelType - << ", constructor not in hash table" << nl << nl - << " Valid wall model types are:" << nl - << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); + << "Unknown wallModel type " + << modelType << nl << nl + << "Valid wallModel types :" << nl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); } return autoPtr>(cstrIter()(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 f8c1f4f538..990da5b40f 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/DispersionModel/DispersionModelNew.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/DispersionModel/DispersionModelNew.C @@ -39,15 +39,14 @@ Foam::DispersionModel::New Info<< "Selecting dispersion model " << modelType << endl; - typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown dispersion model type " + << "Unknown dispersionModel type " << modelType << nl << nl - << "Valid dispersion model types are:" << nl + << "Valid dispersionModel types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModelNew.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModelNew.C index b60c2e0031..3fde72fdd1 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModelNew.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModelNew.C @@ -39,16 +39,16 @@ Foam::InjectionModel::New Info<< "Selecting injection model " << modelType << endl; - typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown injection model type " + << "Unknown injectionModel type " << modelType << nl << nl - << "Valid injection model types are:" << nl - << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); + << "Valid injectionModel types :" << nl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); } return autoPtr>(cstrIter()(dict, owner)); @@ -67,16 +67,16 @@ Foam::InjectionModel::New { Info<< "Selecting injection model " << modelType << endl; - typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown injection model type " << modelType << nl << nl - << "Valid injection model types are:" << nl - << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); + << "Valid injection model types :" << nl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); } return diff --git a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/ParticleForce/ParticleForceNew.C b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/ParticleForce/ParticleForceNew.C index a4f1db04b5..2e801a88dc 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/ParticleForce/ParticleForceNew.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/ParticleForce/ParticleForceNew.C @@ -39,16 +39,14 @@ Foam::ParticleForce::New { Info<< " Selecting particle force " << forceType << endl; - typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(forceType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(forceType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown particle force type " - << forceType - << ", constructor not in hash table" << nl << nl - << " Valid particle force types are:" << nl + << forceType << nl << nl + << "Valid particle force types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModelNew.C b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModelNew.C index 19611a30b8..381fe58e29 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModelNew.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModelNew.C @@ -39,15 +39,14 @@ Foam::PatchInteractionModel::New Info<< "Selecting patch interaction model " << modelType << endl; - typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown patch interaction model type " << modelType << nl << nl - << "Valid patch interaction model types are:" << nl + << "Valid patch interaction model types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/lagrangian/intermediate/submodels/Kinematic/StochasticCollision/StochasticCollisionModel/StochasticCollisionModelNew.C b/src/lagrangian/intermediate/submodels/Kinematic/StochasticCollision/StochasticCollisionModel/StochasticCollisionModelNew.C index 3364416bbb..c35eece969 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/StochasticCollision/StochasticCollisionModel/StochasticCollisionModelNew.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/StochasticCollision/StochasticCollisionModel/StochasticCollisionModelNew.C @@ -35,20 +35,21 @@ Foam::StochasticCollisionModel::New CloudType& owner ) { - word modelType(dict.lookup("stochasticCollisionModel")); + const word modelType(dict.lookup("stochasticCollisionModel")); Info<< "Selecting stochastic collision model " << modelType << endl; - typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = + dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown model type type " - << modelType << ", constructor not in hash table" << nl << nl - << " Valid model types are:" << nl - << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); + << "Unknown stochasticCollisionModel type " + << modelType << nl << nl + << "Valid stochasticCollisionModel types :" << nl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); } return autoPtr> diff --git a/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModelNew.C b/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModelNew.C index 7344b41f77..07331049c7 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModelNew.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModelNew.C @@ -39,15 +39,14 @@ Foam::SurfaceFilmModel::New Info<< "Selecting surface film model " << modelType << endl; - typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown surface film model type " + << "Unknown surfaceFilmModel type " << modelType << nl << nl - << "Valid surface film model types are:" << nl + << "Valid surfaceFilmModel types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/lagrangian/intermediate/submodels/MPPIC/AveragingMethods/AveragingMethod/AveragingMethod.C b/src/lagrangian/intermediate/submodels/MPPIC/AveragingMethods/AveragingMethod/AveragingMethod.C index c64b12115a..b26b326d6e 100644 --- a/src/lagrangian/intermediate/submodels/MPPIC/AveragingMethods/AveragingMethod/AveragingMethod.C +++ b/src/lagrangian/intermediate/submodels/MPPIC/AveragingMethods/AveragingMethod/AveragingMethod.C @@ -84,20 +84,19 @@ Foam::AveragingMethod::New const fvMesh& mesh ) { - word averageType(dict.lookup(typeName)); + const word averageType(dict.lookup(typeName)); //Info<< "Selecting averaging method " // << averageType << endl; - typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(averageType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(averageType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown averaging method " << averageType - << ", constructor not in hash table" << nl << nl - << " Valid averaging methods are:" << nl + << "Unknown averaging method " + << averageType << nl << nl + << "Valid averaging methods :" << nl << dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); } diff --git a/src/lagrangian/intermediate/submodels/MPPIC/CorrectionLimitingMethods/CorrectionLimitingMethod/CorrectionLimitingMethod.C b/src/lagrangian/intermediate/submodels/MPPIC/CorrectionLimitingMethods/CorrectionLimitingMethod/CorrectionLimitingMethod.C index d958d1a146..5298d93b1a 100644 --- a/src/lagrangian/intermediate/submodels/MPPIC/CorrectionLimitingMethods/CorrectionLimitingMethod/CorrectionLimitingMethod.C +++ b/src/lagrangian/intermediate/submodels/MPPIC/CorrectionLimitingMethods/CorrectionLimitingMethod/CorrectionLimitingMethod.C @@ -60,15 +60,14 @@ Foam::CorrectionLimitingMethod::New Info<< "Selecting correction limiter " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown correction limiter type " << modelType - << ", constructor not in hash table" << nl << nl - << " Valid correction limiter types are:" << nl + << "Unknown correction limiter type " + << modelType << nl << nl + << "Valid correction limiter types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); } diff --git a/src/lagrangian/intermediate/submodels/MPPIC/DampingModels/DampingModel/DampingModel.C b/src/lagrangian/intermediate/submodels/MPPIC/DampingModels/DampingModel/DampingModel.C index 8d7836cb2b..fd2a6cb375 100644 --- a/src/lagrangian/intermediate/submodels/MPPIC/DampingModels/DampingModel/DampingModel.C +++ b/src/lagrangian/intermediate/submodels/MPPIC/DampingModels/DampingModel/DampingModel.C @@ -84,15 +84,14 @@ Foam::DampingModel::New Info<< "Selecting damping model " << modelType << endl; - typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown damping model type " << modelType - << ", constructor not in hash table" << nl << nl - << " Valid damping model types are:" << nl + << "Unknown damping model type " + << modelType << nl << nl + << "Valid damping model types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/lagrangian/intermediate/submodels/MPPIC/IsotropyModels/IsotropyModel/IsotropyModel.C b/src/lagrangian/intermediate/submodels/MPPIC/IsotropyModels/IsotropyModel/IsotropyModel.C index c8b02261b8..d929247b2e 100644 --- a/src/lagrangian/intermediate/submodels/MPPIC/IsotropyModels/IsotropyModel/IsotropyModel.C +++ b/src/lagrangian/intermediate/submodels/MPPIC/IsotropyModels/IsotropyModel/IsotropyModel.C @@ -88,15 +88,14 @@ Foam::IsotropyModel::New Info<< "Selecting isotropy model " << modelType << endl; - typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown isotropy model type " << modelType - << ", constructor not in hash table" << nl << nl - << " Valid isotropy model types are:" << nl + << "Unknown isotropy model type " + << modelType << nl << nl + << "Valid isotropy model types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/lagrangian/intermediate/submodels/MPPIC/PackingModels/PackingModel/PackingModel.C b/src/lagrangian/intermediate/submodels/MPPIC/PackingModels/PackingModel/PackingModel.C index 136c13eff4..0307220208 100644 --- a/src/lagrangian/intermediate/submodels/MPPIC/PackingModels/PackingModel/PackingModel.C +++ b/src/lagrangian/intermediate/submodels/MPPIC/PackingModels/PackingModel/PackingModel.C @@ -86,15 +86,14 @@ Foam::PackingModel::New Info<< "Selecting packing model " << modelType << endl; - typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown packing model type " << modelType - << ", constructor not in hash table" << nl << nl - << " Valid packing model types are:" << nl + << "Unknown packing model type " + << modelType << nl << nl + << "Valid packing model types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/lagrangian/intermediate/submodels/MPPIC/ParticleStressModels/ParticleStressModel/ParticleStressModel.C b/src/lagrangian/intermediate/submodels/MPPIC/ParticleStressModels/ParticleStressModel/ParticleStressModel.C index 29e95f3095..8fca6accbc 100644 --- a/src/lagrangian/intermediate/submodels/MPPIC/ParticleStressModels/ParticleStressModel/ParticleStressModel.C +++ b/src/lagrangian/intermediate/submodels/MPPIC/ParticleStressModels/ParticleStressModel/ParticleStressModel.C @@ -63,19 +63,18 @@ Foam::autoPtr Foam::ParticleStressModel::New const dictionary& dict ) { - word modelType(dict.lookup("type")); + const word modelType(dict.lookup("type")); Info<< "Selecting particle stress model " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown particle stress model type " << modelType - << ", constructor not in hash table" << nl << nl - << " Valid particle stress model types are:" << nl + << "Unknown particle stress model type " + << modelType << nl << nl + << "Valid particle stress model types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); } diff --git a/src/lagrangian/intermediate/submodels/MPPIC/TimeScaleModels/TimeScaleModel/TimeScaleModel.C b/src/lagrangian/intermediate/submodels/MPPIC/TimeScaleModels/TimeScaleModel/TimeScaleModel.C index 6502846403..8499550278 100644 --- a/src/lagrangian/intermediate/submodels/MPPIC/TimeScaleModels/TimeScaleModel/TimeScaleModel.C +++ b/src/lagrangian/intermediate/submodels/MPPIC/TimeScaleModels/TimeScaleModel/TimeScaleModel.C @@ -65,19 +65,18 @@ Foam::autoPtr Foam::TimeScaleModel::New const dictionary& dict ) { - word modelType(dict.lookup("type")); + const word modelType(dict.lookup("type")); Info<< "Selecting time scale model " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown time scale model type " << modelType - << ", constructor not in hash table" << nl << nl - << " Valid time scale model types are:" << nl + << "Unknown time scale model type " + << modelType << nl << nl + << "Valid time scale model types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); } diff --git a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModelNew.C b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModelNew.C index 3ed57d2d48..6d226d6b1e 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModelNew.C +++ b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModelNew.C @@ -39,15 +39,14 @@ Foam::CompositionModel::New Info<< "Selecting composition model " << modelType << endl; - typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown composition model type " + << "Unknown compositionModel type " << modelType << nl << nl - << "Valid composition model types are:" << nl + << "Valid compositionModel types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << nl << exit(FatalError); } diff --git a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModelNew.C b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModelNew.C index 8f85b5298e..3e8abf2397 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModelNew.C +++ b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModelNew.C @@ -39,15 +39,14 @@ Foam::PhaseChangeModel::New Info<< "Selecting phase change model " << modelType << endl; - typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown phase change model type " + << "Unknown phaseChangeModel type " << modelType << nl << nl - << "Valid phase change model types are:" << nl + << "Valid phaseChangeModel types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModelNew.C b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModelNew.C index 195a955fbf..2bfb98886f 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModelNew.C +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModelNew.C @@ -39,15 +39,14 @@ Foam::DevolatilisationModel::New Info<< "Selecting devolatilisation model " << modelType << endl; - typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown devolatilisation model type " + << "Unknown devolatilisationModel type " << modelType << nl << nl - << "Valid devolatilisation model types are:" << nl + << "Valid devolatilisationModel types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/SurfaceReactionModel/SurfaceReactionModel/SurfaceReactionModelNew.C b/src/lagrangian/intermediate/submodels/ReactingMultiphase/SurfaceReactionModel/SurfaceReactionModel/SurfaceReactionModelNew.C index f57f768e95..9888a13c6f 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/SurfaceReactionModel/SurfaceReactionModel/SurfaceReactionModelNew.C +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/SurfaceReactionModel/SurfaceReactionModel/SurfaceReactionModelNew.C @@ -39,15 +39,14 @@ Foam::SurfaceReactionModel::New Info<< "Selecting surface reaction model " << modelType << endl; - typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown surface reaction model type " + << "Unknown surfaceReactionModel type " << modelType << nl << nl - << "Valid surface reaction model types are:" << nl + << "Valid surfaceReactionModel types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModelNew.C b/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModelNew.C index 6396e4c698..c0f72be44f 100644 --- a/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModelNew.C +++ b/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModelNew.C @@ -39,15 +39,14 @@ Foam::HeatTransferModel::New Info<< "Selecting heat transfer model " << modelType << endl; - typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown heat transfer model type " + << "Unknown heatTransferModel type " << modelType << nl << nl - << "Valid heat transfer model types are:" << nl + << "Valid heatTransferModel types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/lagrangian/molecularDynamics/potential/energyScalingFunction/basic/energyScalingFunctionNew.C b/src/lagrangian/molecularDynamics/potential/energyScalingFunction/basic/energyScalingFunctionNew.C index fdc1b1bfd8..f5ddf77009 100644 --- a/src/lagrangian/molecularDynamics/potential/energyScalingFunction/basic/energyScalingFunctionNew.C +++ b/src/lagrangian/molecularDynamics/potential/energyScalingFunction/basic/energyScalingFunctionNew.C @@ -41,15 +41,14 @@ Foam::autoPtr Foam::energyScalingFunction::New << scalingType << " for " << name << " potential energy." << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(scalingType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(scalingType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown energyScalingFunction type " << scalingType << nl << nl - << "Valid energyScalingFunctions are:" << nl + << "Valid energyScalingFunction types:" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/lagrangian/molecularDynamics/potential/pairPotential/basic/pairPotentialNew.C b/src/lagrangian/molecularDynamics/potential/pairPotential/basic/pairPotentialNew.C index a6ed6c1e2c..22bc439d78 100644 --- a/src/lagrangian/molecularDynamics/potential/pairPotential/basic/pairPotentialNew.C +++ b/src/lagrangian/molecularDynamics/potential/pairPotential/basic/pairPotentialNew.C @@ -40,15 +40,14 @@ Foam::autoPtr Foam::pairPotential::New << potentialType << " for " << name << " interaction." << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(potentialType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(potentialType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown pairPotential type " << potentialType << nl << nl - << "Valid pairPotentials are:" << nl + << "Valid pairPotential types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/lagrangian/molecularDynamics/potential/tetherPotential/basic/tetherPotentialNew.C b/src/lagrangian/molecularDynamics/potential/tetherPotential/basic/tetherPotentialNew.C index 55d1f6864a..3570517f8d 100644 --- a/src/lagrangian/molecularDynamics/potential/tetherPotential/basic/tetherPotentialNew.C +++ b/src/lagrangian/molecularDynamics/potential/tetherPotential/basic/tetherPotentialNew.C @@ -38,15 +38,14 @@ Foam::autoPtr Foam::tetherPotential::New Info<< nl << "Selecting tether potential " << potentialType << " for " << name << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(potentialType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(potentialType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown tetherPotential type " << potentialType << nl << nl - << "Valid tetherPotentials are:" << nl + << "Valid tetherPotential types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/lagrangian/spray/submodels/AtomizationModel/AtomizationModel/AtomizationModelNew.C b/src/lagrangian/spray/submodels/AtomizationModel/AtomizationModel/AtomizationModelNew.C index 5562895841..2ac000be12 100644 --- a/src/lagrangian/spray/submodels/AtomizationModel/AtomizationModel/AtomizationModelNew.C +++ b/src/lagrangian/spray/submodels/AtomizationModel/AtomizationModel/AtomizationModelNew.C @@ -35,21 +35,20 @@ Foam::AtomizationModel::New CloudType& owner ) { - word AtomizationModelType(dict.lookup("atomizationModel")); + const word modelType(dict.lookup("atomizationModel")); - Info<< "Selecting AtomizationModel " << AtomizationModelType << endl; + Info<< "Selecting atomizationModel " << modelType << endl; - typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(AtomizationModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown AtomizationModelType type " - << AtomizationModelType - << ", constructor not in hash table" << nl << nl - << " Valid AtomizationModel types are:" << nl - << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); + << "Unknown atomizationModel type " + << modelType + << "Valid atomizationModel types :" << nl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); } return autoPtr>(cstrIter()(dict, owner)); diff --git a/src/lagrangian/spray/submodels/BreakupModel/BreakupModel/BreakupModelNew.C b/src/lagrangian/spray/submodels/BreakupModel/BreakupModel/BreakupModelNew.C index 25a1e75d69..3189306a86 100644 --- a/src/lagrangian/spray/submodels/BreakupModel/BreakupModel/BreakupModelNew.C +++ b/src/lagrangian/spray/submodels/BreakupModel/BreakupModel/BreakupModelNew.C @@ -35,21 +35,20 @@ Foam::BreakupModel::New CloudType& owner ) { - word BreakupModelType(dict.lookup("breakupModel")); + const word modelType(dict.lookup("breakupModel")); - Info<< "Selecting BreakupModel " << BreakupModelType << endl; + Info<< "Selecting breakupModel " << modelType << endl; - typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(BreakupModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown BreakupModelType type " - << BreakupModelType - << ", constructor not in hash table" << nl << nl - << " Valid BreakupModel types are:" << nl - << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); + << "Unknown breakupModel type " + << modelType << nl << nl + << "Valid breakupModel types :" << nl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); } return autoPtr>(cstrIter()(dict, owner)); diff --git a/src/mesh/blockMesh/blockEdges/blockEdge/blockEdge.C b/src/mesh/blockMesh/blockEdges/blockEdge/blockEdge.C index fd53017394..04ea707fa8 100644 --- a/src/mesh/blockMesh/blockEdges/blockEdge/blockEdge.C +++ b/src/mesh/blockMesh/blockEdges/blockEdge/blockEdge.C @@ -87,15 +87,14 @@ Foam::autoPtr Foam::blockEdge::New const word edgeType(is); - IstreamConstructorTable::iterator cstrIter = - IstreamConstructorTablePtr_->find(edgeType); + auto cstrIter = IstreamConstructorTablePtr_->cfind(edgeType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown blockEdge type " << edgeType << nl << nl - << "Valid blockEdge types are" << endl + << "Valid blockEdge types :" << endl << IstreamConstructorTablePtr_->sortedToc() << abort(FatalError); } diff --git a/src/mesh/blockMesh/blockFaces/blockFace/blockFace.C b/src/mesh/blockMesh/blockFaces/blockFace/blockFace.C index cec92a091a..dd194b52c4 100644 --- a/src/mesh/blockMesh/blockFaces/blockFace/blockFace.C +++ b/src/mesh/blockMesh/blockFaces/blockFace/blockFace.C @@ -84,15 +84,14 @@ Foam::autoPtr Foam::blockFace::New const word faceType(is); - IstreamConstructorTable::iterator cstrIter = - IstreamConstructorTablePtr_->find(faceType); + auto cstrIter = IstreamConstructorTablePtr_->cfind(faceType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown blockFace type " << faceType << nl << nl - << "Valid blockFace types are" << endl + << "Valid blockFace types :" << endl << IstreamConstructorTablePtr_->sortedToc() << abort(FatalError); } diff --git a/src/mesh/blockMesh/blockVertices/blockVertex/blockVertex.C b/src/mesh/blockMesh/blockVertices/blockVertex/blockVertex.C index 3593a69ec8..e40ff63751 100644 --- a/src/mesh/blockMesh/blockVertices/blockVertex/blockVertex.C +++ b/src/mesh/blockMesh/blockVertices/blockVertex/blockVertex.C @@ -78,15 +78,14 @@ Foam::autoPtr Foam::blockVertex::New { const word faceType(firstToken.wordToken()); - IstreamConstructorTable::iterator cstrIter = - IstreamConstructorTablePtr_->find(faceType); + auto cstrIter = IstreamConstructorTablePtr_->cfind(faceType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown blockVertex type " << faceType << nl << nl - << "Valid blockVertex types are" << endl + << "Valid blockVertex types :" << endl << IstreamConstructorTablePtr_->sortedToc() << abort(FatalError); } diff --git a/src/mesh/blockMesh/blocks/block/block.C b/src/mesh/blockMesh/blocks/block/block.C index 96e8c5d4c1..dc842131a2 100644 --- a/src/mesh/blockMesh/blocks/block/block.C +++ b/src/mesh/blockMesh/blocks/block/block.C @@ -78,8 +78,7 @@ Foam::autoPtr Foam::block::New const word blockOrCellShapeType(is); - IstreamConstructorTable::iterator cstrIter = - IstreamConstructorTablePtr_->find(blockOrCellShapeType); + auto cstrIter = IstreamConstructorTablePtr_->cfind(blockOrCellShapeType); if (!cstrIter.found()) { diff --git a/src/mesh/extrudeModel/extrudeModel/extrudeModelNew.C b/src/mesh/extrudeModel/extrudeModel/extrudeModelNew.C index 570a4518d3..a70ba047e3 100644 --- a/src/mesh/extrudeModel/extrudeModel/extrudeModelNew.C +++ b/src/mesh/extrudeModel/extrudeModel/extrudeModelNew.C @@ -36,15 +36,14 @@ Foam::autoPtr Foam::extrudeModel::New Info<< "Selecting extrudeModel " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown extrudeModel type " << modelType << nl << nl - << "Valid extrudeModel types are :" << nl + << "Valid extrudeModel types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << nl << exit(FatalError); } diff --git a/src/mesh/snappyHexMesh/externalDisplacementMeshMover/externalDisplacementMeshMover.C b/src/mesh/snappyHexMesh/externalDisplacementMeshMover/externalDisplacementMeshMover.C index 5b945d5164..4da5721d72 100644 --- a/src/mesh/snappyHexMesh/externalDisplacementMeshMover/externalDisplacementMeshMover.C +++ b/src/mesh/snappyHexMesh/externalDisplacementMeshMover/externalDisplacementMeshMover.C @@ -141,8 +141,7 @@ Foam::externalDisplacementMeshMover::New { Info<< "Selecting externalDisplacementMeshMover " << type << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(type); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(type); if (!cstrIter.found()) { diff --git a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/AMIMethod/AMIMethodNew.C b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/AMIMethod/AMIMethodNew.C index c43a03c950..840cbdb9ce 100644 --- a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/AMIMethod/AMIMethodNew.C +++ b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/AMIMethod/AMIMethodNew.C @@ -44,16 +44,16 @@ Foam::AMIMethod::New Info<< "Selecting AMIMethod " << methodName << endl; } - typename componentsConstructorTable::iterator cstrIter = - componentsConstructorTablePtr_->find(methodName); + auto cstrIter = componentsConstructorTablePtr_->cfind(methodName); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown AMIMethod type " << methodName << nl << nl - << "Valid AMIMethod types are:" << nl - << componentsConstructorTablePtr_->sortedToc() << exit(FatalError); + << "Valid AMIMethod types:" << nl + << componentsConstructorTablePtr_->sortedToc() + << exit(FatalError); } return autoPtr> diff --git a/src/meshTools/coordinateSystems/coordinateRotation/coordinateRotationNew.C b/src/meshTools/coordinateSystems/coordinateRotation/coordinateRotationNew.C index feb473421c..a1e939abad 100644 --- a/src/meshTools/coordinateSystems/coordinateRotation/coordinateRotationNew.C +++ b/src/meshTools/coordinateSystems/coordinateRotation/coordinateRotationNew.C @@ -42,7 +42,7 @@ Foam::autoPtr Foam::coordinateRotation::New { FatalIOErrorInFunction(dict) << "Unknown coordinateRotation type " << rotType << nl << nl - << "Valid coordinateRotation types are :" << nl + << "Valid coordinateRotation types :" << nl << objectRegistryConstructorTablePtr_->sortedToc() << exit(FatalIOError); } @@ -64,7 +64,7 @@ Foam::autoPtr Foam::coordinateRotation::New { FatalIOErrorInFunction(dict) << "Unknown coordinateRotation type " << rotType << nl << nl - << "Valid coordinateRotation types are :" << nl + << "Valid coordinateRotation types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalIOError); } diff --git a/src/meshTools/coordinateSystems/coordinateRotation/cylindrical.C b/src/meshTools/coordinateSystems/coordinateRotation/cylindrical.C index 3ebc07d442..481f15f71b 100644 --- a/src/meshTools/coordinateSystems/coordinateRotation/cylindrical.C +++ b/src/meshTools/coordinateSystems/coordinateRotation/cylindrical.C @@ -113,12 +113,12 @@ Foam::cylindrical::cylindrical(const tensorField& R) Foam::cylindrical::cylindrical(const dictionary& dict) : Rptr_(), - origin_(), - e3_() + origin_(Zero), + e3_(Zero) { FatalErrorInFunction << " cylindrical can not be constructed from dictionary " - << " use the construtctor : " + << " use the constructor : " "(" " const dictionary&, const objectRegistry&" ")" diff --git a/src/meshTools/coordinateSystems/coordinateRotation/cylindrical.H b/src/meshTools/coordinateSystems/coordinateRotation/cylindrical.H index 2baca6682c..b8502d8aab 100644 --- a/src/meshTools/coordinateSystems/coordinateRotation/cylindrical.H +++ b/src/meshTools/coordinateSystems/coordinateRotation/cylindrical.H @@ -69,7 +69,7 @@ class cylindrical { // Private data - //- AutoPtr to transformation tensor + //- An autoPtr to the transformation tensor autoPtr Rptr_; //- Origin of the coordinate system diff --git a/src/meshTools/coordinateSystems/coordinateSystemNew.C b/src/meshTools/coordinateSystems/coordinateSystemNew.C index bb4b860e86..486a12bc89 100644 --- a/src/meshTools/coordinateSystems/coordinateSystemNew.C +++ b/src/meshTools/coordinateSystems/coordinateSystemNew.C @@ -46,7 +46,7 @@ Foam::autoPtr Foam::coordinateSystem::New dict ) << "Unknown coordinateSystem type " << coordType << nl << nl - << "Valid coordinateSystem types are :" << nl + << "Valid coordinateSystem types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalIOError); } diff --git a/src/meshTools/edgeMesh/edgeMeshIO.C b/src/meshTools/edgeMesh/edgeMeshIO.C index a187cb2d6c..f04f03456f 100644 --- a/src/meshTools/edgeMesh/edgeMeshIO.C +++ b/src/meshTools/edgeMesh/edgeMeshIO.C @@ -96,14 +96,13 @@ void Foam::edgeMesh::write const word ext = name.ext(); - writefileExtensionMemberFunctionTable::iterator mfIter = - writefileExtensionMemberFunctionTablePtr_->find(ext); + auto mfIter = writefileExtensionMemberFunctionTablePtr_->cfind(ext); if (!mfIter.found()) { FatalErrorInFunction << "Unknown file extension " << ext << nl << nl - << "Valid types are :" << endl + << "Valid types :" << endl << writefileExtensionMemberFunctionTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/meshTools/edgeMesh/edgeMeshNew.C b/src/meshTools/edgeMesh/edgeMeshNew.C index fa488d6f55..60ed8096e9 100644 --- a/src/meshTools/edgeMesh/edgeMeshNew.C +++ b/src/meshTools/edgeMesh/edgeMeshNew.C @@ -33,15 +33,14 @@ Foam::autoPtr Foam::edgeMesh::New const word& ext ) { - fileExtensionConstructorTable::iterator cstrIter = - fileExtensionConstructorTablePtr_->find(ext); + auto cstrIter = fileExtensionConstructorTablePtr_->cfind(ext); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown file extension " << ext << " for file " << name << nl << nl - << "Valid extensions are :" << nl + << "Valid extensions :" << nl << fileExtensionConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/meshTools/edgeMesh/extendedEdgeMesh/extendedEdgeMeshNew.C b/src/meshTools/edgeMesh/extendedEdgeMesh/extendedEdgeMeshNew.C index c960f10370..b83678f40b 100644 --- a/src/meshTools/edgeMesh/extendedEdgeMesh/extendedEdgeMeshNew.C +++ b/src/meshTools/edgeMesh/extendedEdgeMesh/extendedEdgeMeshNew.C @@ -42,15 +42,14 @@ Foam::autoPtr Foam::extendedEdgeMesh::New const word& ext ) { - fileExtensionConstructorTable::iterator cstrIter = - fileExtensionConstructorTablePtr_->find(ext); + auto cstrIter = fileExtensionConstructorTablePtr_->cfind(ext); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown file extension " << ext << " for file " << name << nl << nl - << "Valid extensions are :" << nl + << "Valid extensions :" << nl << fileExtensionConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/meshTools/searchableSurfaces/searchableSurface/searchableSurface.C b/src/meshTools/searchableSurfaces/searchableSurface/searchableSurface.C index ac9b9daab0..2b1a224a75 100644 --- a/src/meshTools/searchableSurfaces/searchableSurface/searchableSurface.C +++ b/src/meshTools/searchableSurfaces/searchableSurface/searchableSurface.C @@ -43,15 +43,14 @@ Foam::autoPtr Foam::searchableSurface::New const dictionary& dict ) { - dictConstructorTable::iterator cstrIter = - dictConstructorTablePtr_->find(searchableSurfaceType); + auto cstrIter = dictConstructorTablePtr_->cfind(searchableSurfaceType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown searchableSurface type " << searchableSurfaceType - << endl << endl - << "Valid searchableSurface types : " << endl + << "Unknown searchableSurface type " + << searchableSurfaceType << nl << nl + << "Valid searchableSurface types :" << endl << dictConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/meshTools/sets/topoSetSource/topoSetSource.C b/src/meshTools/sets/topoSetSource/topoSetSource.C index acf6238b38..40c20d21de 100644 --- a/src/meshTools/sets/topoSetSource/topoSetSource.C +++ b/src/meshTools/sets/topoSetSource/topoSetSource.C @@ -73,15 +73,14 @@ Foam::autoPtr Foam::topoSetSource::New const dictionary& dict ) { - wordConstructorTable::iterator cstrIter = - wordConstructorTablePtr_->find(topoSetSourceType); + auto cstrIter = wordConstructorTablePtr_->cfind(topoSetSourceType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown topoSetSource type " << topoSetSourceType - << endl << endl - << "Valid topoSetSource types : " << endl + << "Unknown topoSetSource type " + << topoSetSourceType << nl << nl + << "Valid topoSetSource types :" << endl << wordConstructorTablePtr_->sortedToc() << exit(FatalError); } @@ -97,15 +96,14 @@ Foam::autoPtr Foam::topoSetSource::New Istream& is ) { - istreamConstructorTable::iterator cstrIter = - istreamConstructorTablePtr_->find(topoSetSourceType); + auto cstrIter = istreamConstructorTablePtr_->cfind(topoSetSourceType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown topoSetSource type " << topoSetSourceType - << endl << endl - << "Valid topoSetSource types : " << endl + << "Unknown topoSetSource type " + << topoSetSourceType << nl << nl + << "Valid topoSetSource types :" << endl << istreamConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/meshTools/sets/topoSets/topoSet.C b/src/meshTools/sets/topoSets/topoSet.C index ca2e6d7bbc..b7e574ddcd 100644 --- a/src/meshTools/sets/topoSets/topoSet.C +++ b/src/meshTools/sets/topoSets/topoSet.C @@ -51,15 +51,14 @@ Foam::autoPtr Foam::topoSet::New writeOption w ) { - wordConstructorTable::iterator cstrIter = - wordConstructorTablePtr_->find(setType); + auto cstrIter = wordConstructorTablePtr_->cfind(setType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown set type " << setType - << endl << endl - << "Valid set types : " << endl + << "Unknown set type " + << setType << nl << nl + << "Valid set types :" << endl << wordConstructorTablePtr_->sortedToc() << exit(FatalError); } @@ -77,15 +76,14 @@ Foam::autoPtr Foam::topoSet::New writeOption w ) { - sizeConstructorTable::iterator cstrIter = - sizeConstructorTablePtr_->find(setType); + auto cstrIter = sizeConstructorTablePtr_->cfind(setType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown set type " << setType - << endl << endl - << "Valid set types : " << endl + << "Unknown set type " + << setType << nl << nl + << "Valid set types :" << endl << sizeConstructorTablePtr_->sortedToc() << exit(FatalError); } @@ -103,15 +101,14 @@ Foam::autoPtr Foam::topoSet::New writeOption w ) { - setConstructorTable::iterator cstrIter = - setConstructorTablePtr_->find(setType); + auto cstrIter = setConstructorTablePtr_->cfind(setType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown set type " << setType - << endl << endl - << "Valid set types : " << endl + << "Unknown set type " + << setType << nl << nl + << "Valid set types :" << endl << setConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/overset/cellCellStencil/cellCellStencil/cellCellStencil.C b/src/overset/cellCellStencil/cellCellStencil/cellCellStencil.C index c6327181dc..8eb4dca330 100644 --- a/src/overset/cellCellStencil/cellCellStencil/cellCellStencil.C +++ b/src/overset/cellCellStencil/cellCellStencil/cellCellStencil.C @@ -68,18 +68,16 @@ Foam::autoPtr Foam::cellCellStencil::New InfoInFunction << "Constructing cellCellStencil" << endl; } - word type(dict.lookup("method")); + const word stencilType(dict.lookup("method")); - - meshConstructorTable::iterator cstrIter = - meshConstructorTablePtr_->find(type); + auto cstrIter = meshConstructorTablePtr_->cfind(stencilType); if (cstrIter == meshConstructorTablePtr_->end()) { FatalErrorInFunction << "Unknown cellCellStencil type " - << type << nl << nl - << "Valid cellCellStencil types are" << endl + << stencilType << nl << nl + << "Valid cellCellStencil types :" << endl << meshConstructorTablePtr_->sortedToc() << abort(FatalError); } diff --git a/src/parallel/decompose/decompositionMethods/decompositionConstraints/decompositionConstraint/decompositionConstraint.C b/src/parallel/decompose/decompositionMethods/decompositionConstraints/decompositionConstraint/decompositionConstraint.C index 8ede3a7294..57ac5fb352 100644 --- a/src/parallel/decompose/decompositionMethods/decompositionConstraints/decompositionConstraint/decompositionConstraint.C +++ b/src/parallel/decompose/decompositionMethods/decompositionConstraints/decompositionConstraint/decompositionConstraint.C @@ -56,15 +56,14 @@ Foam::decompositionConstraint::New { Info<< "Selecting decompositionConstraint " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalIOErrorInFunction(dict) << "Unknown decompositionConstraint type " << modelType << nl << nl - << "Valid decompositionConstraint types:" << endl + << "Valid decompositionConstraint types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalIOError); } diff --git a/src/parallel/decompose/decompositionMethods/decompositionMethod/decompositionMethod.C b/src/parallel/decompose/decompositionMethods/decompositionMethod/decompositionMethod.C index 984851df71..a66acf8dbd 100644 --- a/src/parallel/decompose/decompositionMethods/decompositionMethod/decompositionMethod.C +++ b/src/parallel/decompose/decompositionMethods/decompositionMethod/decompositionMethod.C @@ -180,19 +180,18 @@ Foam::autoPtr Foam::decompositionMethod::New const dictionary& decompositionDict ) { - word methodType(decompositionDict.lookup("method")); + const word methodType(decompositionDict.lookup("method")); Info<< "Selecting decompositionMethod " << methodType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(methodType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(methodType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown decompositionMethod " << methodType << nl << nl - << "Valid decompositionMethods are : " << endl + << "Valid decompositionMethods : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/randomProcesses/noise/noiseModels/noiseModel/noiseModelNew.C b/src/randomProcesses/noise/noiseModels/noiseModel/noiseModelNew.C index 72f06f7649..9ebd3e518b 100644 --- a/src/randomProcesses/noise/noiseModels/noiseModel/noiseModelNew.C +++ b/src/randomProcesses/noise/noiseModels/noiseModel/noiseModelNew.C @@ -33,15 +33,14 @@ Foam::autoPtr Foam::noiseModel::New(const dictionary& dict) Info<< "Selecting noiseModel " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown noiseModel type " << modelType << nl << nl - << "Valid noiseModel types are:" << nl + << "Valid noiseModel types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/randomProcesses/windowModels/windowModel/windowModelNew.C b/src/randomProcesses/windowModels/windowModel/windowModelNew.C index 7b1c8a7e72..fad8be3d92 100644 --- a/src/randomProcesses/windowModels/windowModel/windowModelNew.C +++ b/src/randomProcesses/windowModels/windowModel/windowModelNew.C @@ -37,15 +37,14 @@ Foam::autoPtr Foam::windowModel::New Info<< "Selecting windowModel " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown windowModel type " << modelType << nl << nl - << "Valid windowModel types are:" << nl + << "Valid windowModel types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/regionModels/pyrolysisModels/pyrolysisModel/pyrolysisModelNew.C b/src/regionModels/pyrolysisModels/pyrolysisModel/pyrolysisModelNew.C index 85db5ce6c8..2eb2bf5824 100644 --- a/src/regionModels/pyrolysisModels/pyrolysisModel/pyrolysisModelNew.C +++ b/src/regionModels/pyrolysisModels/pyrolysisModel/pyrolysisModelNew.C @@ -63,14 +63,14 @@ autoPtr pyrolysisModel::New Info<< "Selecting pyrolysisModel " << modelType << endl; - meshConstructorTable::iterator cstrIter = - meshConstructorTablePtr_->find(modelType); + auto cstrIter = meshConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown pyrolysisModel type " << modelType - << nl << nl << "Valid pyrolisisModel types are:" << nl + << "Unknown pyrolysisModel type " + << modelType << nl << nl + << "Valid pyrolysisModel types :" << nl << meshConstructorTablePtr_->sortedToc() << exit(FatalError); } @@ -91,14 +91,14 @@ autoPtr pyrolysisModel::New Info<< "Selecting pyrolysisModel " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown pyrolysisModel type " << modelType - << nl << nl << "Valid pyrolisisModel types are:" << nl + << "Unknown pyrolysisModel type " + << modelType << nl << nl + << "Valid pyrolysisModel types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/regionModels/regionModel/regionModelFunctionObject/regionModelFunctionObject/regionModelFunctionObjectNew.C b/src/regionModels/regionModel/regionModelFunctionObject/regionModelFunctionObject/regionModelFunctionObjectNew.C index 7d585e7e2d..75d1694a71 100644 --- a/src/regionModels/regionModel/regionModelFunctionObject/regionModelFunctionObject/regionModelFunctionObjectNew.C +++ b/src/regionModels/regionModel/regionModelFunctionObject/regionModelFunctionObject/regionModelFunctionObjectNew.C @@ -39,15 +39,14 @@ Foam::regionModels::regionModelFunctionObject::New Info<< " " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown region model function type " << modelType << nl << nl - << "Valid region model function types are:" << nl + << "Valid region model function types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/regionModels/surfaceFilmModels/submodels/kinematic/filmThermoModel/filmThermoModel/filmThermoModelNew.C b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmThermoModel/filmThermoModel/filmThermoModelNew.C index 67baf4f6c1..8b36192035 100644 --- a/src/regionModels/surfaceFilmModels/submodels/kinematic/filmThermoModel/filmThermoModel/filmThermoModelNew.C +++ b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmThermoModel/filmThermoModel/filmThermoModelNew.C @@ -46,15 +46,16 @@ autoPtr filmThermoModel::New Info<< " Selecting filmThermoModel " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = + dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown filmThermoModel type " << modelType << nl << nl - << "Valid filmThermoModel types are:" << nl - << dictionaryConstructorTablePtr_->toc() + << "Unknown filmThermoModel type " + << modelType << nl << nl + << "Valid filmThermoModel types :" << nl + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/regionModels/surfaceFilmModels/submodels/kinematic/filmTurbulenceModel/filmTurbulenceModel/filmTurbulenceModelNew.C b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmTurbulenceModel/filmTurbulenceModel/filmTurbulenceModelNew.C index a138fa6a68..a27014fc3f 100644 --- a/src/regionModels/surfaceFilmModels/submodels/kinematic/filmTurbulenceModel/filmTurbulenceModel/filmTurbulenceModelNew.C +++ b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmTurbulenceModel/filmTurbulenceModel/filmTurbulenceModelNew.C @@ -46,15 +46,15 @@ autoPtr filmTurbulenceModel::New Info<< " Selecting filmTurbulenceModel " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown filmTurbulenceModel type " << modelType - << nl << nl << "Valid filmTurbulenceModel types are:" << nl - << dictionaryConstructorTablePtr_->toc() + << "Unknown filmTurbulenceModel type " + << modelType << nl << nl + << "Valid filmTurbulenceModel types :" << nl + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/regionModels/surfaceFilmModels/submodels/kinematic/force/force/forceNew.C b/src/regionModels/surfaceFilmModels/submodels/kinematic/force/force/forceNew.C index 4ce1b6608d..4ebc37462a 100644 --- a/src/regionModels/surfaceFilmModels/submodels/kinematic/force/force/forceNew.C +++ b/src/regionModels/surfaceFilmModels/submodels/kinematic/force/force/forceNew.C @@ -45,15 +45,14 @@ autoPtr force::New { Info<< " " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown force type " << modelType - << nl << nl << "Valid force types are:" << nl - << dictionaryConstructorTablePtr_->toc() + FatalErrorInFunction << "Unknown force type " + << modelType << nl << nl + << "Valid force types :" << nl + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/regionModels/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModelNew.C b/src/regionModels/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModelNew.C index b06590a55c..19d56b4e63 100644 --- a/src/regionModels/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModelNew.C +++ b/src/regionModels/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModelNew.C @@ -45,15 +45,15 @@ autoPtr injectionModel::New { Info<< " " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown injectionModel type " << modelType - << nl << nl << "Valid injectionModel types are:" << nl - << dictionaryConstructorTablePtr_->toc() + << "Unknown injectionModel type " + << modelType << nl << nl + << "Valid injectionModel types :" << nl + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/regionModels/surfaceFilmModels/submodels/thermo/filmRadiationModel/filmRadiationModel/filmRadiationModelNew.C b/src/regionModels/surfaceFilmModels/submodels/thermo/filmRadiationModel/filmRadiationModel/filmRadiationModelNew.C index 781f1778ef..ef7d7e69d6 100644 --- a/src/regionModels/surfaceFilmModels/submodels/thermo/filmRadiationModel/filmRadiationModel/filmRadiationModelNew.C +++ b/src/regionModels/surfaceFilmModels/submodels/thermo/filmRadiationModel/filmRadiationModel/filmRadiationModelNew.C @@ -42,19 +42,19 @@ autoPtr filmRadiationModel::New const dictionary& dict ) { - word modelType(dict.lookup("radiationModel")); + const word modelType(dict.lookup("radiationModel")); Info<< " Selecting radiationModel " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown radiationModel type " << modelType << nl << nl - << "Valid filmRadiationModel types are:" << nl - << dictionaryConstructorTablePtr_->toc() + << "Unknown radiationModel type " + << modelType << nl << nl + << "Valid filmRadiationModel types :" << nl + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/filmViscosityModel/filmViscosityModelNew.C b/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/filmViscosityModel/filmViscosityModelNew.C index 25be0a0c28..7e9635a3ac 100644 --- a/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/filmViscosityModel/filmViscosityModelNew.C +++ b/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/filmViscosityModel/filmViscosityModelNew.C @@ -43,19 +43,19 @@ autoPtr filmViscosityModel::New volScalarField& mu ) { - word modelType(dict.lookup("filmViscosityModel")); + const word modelType(dict.lookup("filmViscosityModel")); Info<< " Selecting filmViscosityModel " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown filmViscosityModel type " << modelType - << nl << nl << "Valid filmViscosityModel types are:" << nl - << dictionaryConstructorTablePtr_->toc() + << "Unknown filmViscosityModel type " + << modelType << nl << nl + << "Valid filmViscosityModel types :" << nl + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/regionModels/surfaceFilmModels/submodels/thermo/heatTransferModel/heatTransferModel/heatTransferModelNew.C b/src/regionModels/surfaceFilmModels/submodels/thermo/heatTransferModel/heatTransferModel/heatTransferModelNew.C index 52b1870390..6adfe59247 100644 --- a/src/regionModels/surfaceFilmModels/submodels/thermo/heatTransferModel/heatTransferModel/heatTransferModelNew.C +++ b/src/regionModels/surfaceFilmModels/submodels/thermo/heatTransferModel/heatTransferModel/heatTransferModelNew.C @@ -42,19 +42,19 @@ autoPtr heatTransferModel::New const dictionary& dict ) { - word modelType(dict.lookup("heatTransferModel")); + const word modelType(dict.lookup("heatTransferModel")); Info<< " Selecting heatTransferModel " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown heatTransferModel type " << modelType << nl << nl - << "Valid heatTransferModel types are:" << nl - << dictionaryConstructorTablePtr_->toc() + << "Unknown heatTransferModel type " + << modelType << nl << nl + << "Valid heatTransferModel types :" << nl + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/regionModels/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModelNew.C b/src/regionModels/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModelNew.C index add63599f3..476222fdac 100644 --- a/src/regionModels/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModelNew.C +++ b/src/regionModels/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModelNew.C @@ -42,19 +42,19 @@ autoPtr phaseChangeModel::New const dictionary& dict ) { - word modelType(dict.lookup("phaseChangeModel")); + const word modelType(dict.lookup("phaseChangeModel")); Info<< " Selecting phaseChangeModel " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown phaseChangeModel type " << modelType - << nl << nl << "Valid phaseChangeModel types are:" << nl - << dictionaryConstructorTablePtr_->toc() + << "Unknown phaseChangeModel type " + << modelType << nl << nl + << "Valid phaseChangeModel types :" << nl + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/regionModels/surfaceFilmModels/surfaceFilmModel/surfaceFilmModelNew.C b/src/regionModels/surfaceFilmModels/surfaceFilmModel/surfaceFilmModelNew.C index 91b7639d9c..e6251116e7 100644 --- a/src/regionModels/surfaceFilmModels/surfaceFilmModel/surfaceFilmModelNew.C +++ b/src/regionModels/surfaceFilmModels/surfaceFilmModel/surfaceFilmModelNew.C @@ -66,15 +66,15 @@ autoPtr surfaceFilmModel::New Info<< "Selecting surfaceFilmModel " << modelType << endl; - meshConstructorTable::iterator cstrIter = - meshConstructorTablePtr_->find(modelType); + auto cstrIter = meshConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown surfaceFilmModel type " << modelType - << nl << nl << "Valid surfaceFilmModel types are:" << nl - << meshConstructorTablePtr_->toc() + << "Unknown surfaceFilmModel type " + << modelType << nl << nl + << "Valid surfaceFilmModel types :" << nl + << meshConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/regionModels/thermalBaffleModels/thermalBaffleModel/thermalBaffleModelNew.C b/src/regionModels/thermalBaffleModels/thermalBaffleModel/thermalBaffleModelNew.C index 6a9f88a1f0..ee6831c9ee 100644 --- a/src/regionModels/thermalBaffleModels/thermalBaffleModel/thermalBaffleModelNew.C +++ b/src/regionModels/thermalBaffleModels/thermalBaffleModel/thermalBaffleModelNew.C @@ -61,16 +61,15 @@ autoPtr thermalBaffleModel::New(const fvMesh& mesh) ); } - meshConstructorTable::iterator cstrIter = - meshConstructorTablePtr_->find(modelType); + auto cstrIter = meshConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown thermalBaffleModel type " << modelType - << nl << nl - << "Valid thermalBaffleModel types are:" << nl + << "Unknown thermalBaffleModel type " + << modelType << nl << nl + << "Valid thermalBaffleModel types :" << nl << meshConstructorTablePtr_->sortedToc() << exit(FatalError); } @@ -88,16 +87,14 @@ autoPtr thermalBaffleModel::New word modelType = dict.lookupOrDefault("thermalBaffleModel", "thermalBaffle"); - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalErrorInFunction - << "Unknown thermalBaffleModel type " << modelType - << nl << nl - << "Valid thermalBaffleModel types are:" << nl + << "Unknown thermalBaffleModel type " + << modelType << nl << nl + << "Valid thermalBaffleModel types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/renumber/renumberMethods/renumberMethod/renumberMethod.C b/src/renumber/renumberMethods/renumberMethod/renumberMethod.C index 8c91320221..ce5a12d6cf 100644 --- a/src/renumber/renumberMethods/renumberMethod/renumberMethod.C +++ b/src/renumber/renumberMethods/renumberMethod/renumberMethod.C @@ -48,8 +48,7 @@ Foam::autoPtr Foam::renumberMethod::New //Info<< "Selecting renumberMethod " << methodType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(methodType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(methodType); if (!cstrIter.found()) { diff --git a/src/rigidBodyDynamics/bodies/rigidBody/rigidBody.C b/src/rigidBodyDynamics/bodies/rigidBody/rigidBody.C index 20ba5e1423..d13772c100 100644 --- a/src/rigidBodyDynamics/bodies/rigidBody/rigidBody.C +++ b/src/rigidBodyDynamics/bodies/rigidBody/rigidBody.C @@ -76,15 +76,14 @@ Foam::autoPtr Foam::RBD::rigidBody::New { const word bodyType(dict.lookup("type")); - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(bodyType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(bodyType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown rigidBody type " << bodyType << nl << nl - << "Valid rigidBody types are : " << endl + << "Valid rigidBody types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/rigidBodyDynamics/joints/joint/joint.C b/src/rigidBodyDynamics/joints/joint/joint.C index f5a89e9b72..92204ffebd 100644 --- a/src/rigidBodyDynamics/joints/joint/joint.C +++ b/src/rigidBodyDynamics/joints/joint/joint.C @@ -53,15 +53,14 @@ Foam::autoPtr Foam::RBD::joint::New { const word bodyType(dict.lookup("type")); - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(bodyType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(bodyType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown joint type " << bodyType << nl << nl - << "Valid joint types are : " << endl + << "Valid joint types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/rigidBodyDynamics/restraints/restraint/rigidBodyRestraintNew.C b/src/rigidBodyDynamics/restraints/restraint/rigidBodyRestraintNew.C index ba95967324..dd2356982a 100644 --- a/src/rigidBodyDynamics/restraints/restraint/rigidBodyRestraintNew.C +++ b/src/rigidBodyDynamics/restraints/restraint/rigidBodyRestraintNew.C @@ -37,15 +37,14 @@ Foam::RBD::restraint::New { const word restraintType(dict.lookup("type")); - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(restraintType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(restraintType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown restraint type " << restraintType << nl << nl - << "Valid restraint types are : " << endl + << "Valid restraint types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/rigidBodyDynamics/rigidBodySolvers/rigidBodySolver/newRigidBodySolver.C b/src/rigidBodyDynamics/rigidBodySolvers/rigidBodySolver/newRigidBodySolver.C index 0a24730e7e..10909d79fb 100644 --- a/src/rigidBodyDynamics/rigidBodySolvers/rigidBodySolver/newRigidBodySolver.C +++ b/src/rigidBodyDynamics/rigidBodySolvers/rigidBodySolver/newRigidBodySolver.C @@ -33,19 +33,18 @@ Foam::autoPtr Foam::RBD::rigidBodySolver::New const dictionary& dict ) { - word rigidBodySolverType(dict.lookup("type")); + const word solverType(dict.lookup("type")); - Info<< "Selecting rigidBodySolver " << rigidBodySolverType << endl; + Info<< "Selecting rigidBodySolver " << solverType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(rigidBodySolverType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(solverType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown rigidBodySolverType type " - << rigidBodySolverType << endl << endl - << "Valid rigidBodySolver types are : " << endl + << solverType << nl << nl + << "Valid rigidBodySolver types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/sampling/meshToMesh/calcMethod/meshToMeshMethod/meshToMeshMethodNew.C b/src/sampling/meshToMesh/calcMethod/meshToMeshMethod/meshToMeshMethodNew.C index c315dfc76b..d5ae8a9e1a 100644 --- a/src/sampling/meshToMesh/calcMethod/meshToMeshMethod/meshToMeshMethodNew.C +++ b/src/sampling/meshToMesh/calcMethod/meshToMeshMethod/meshToMeshMethodNew.C @@ -39,16 +39,16 @@ Foam::autoPtr Foam::meshToMeshMethod::New Info<< "Selecting AMIMethod " << methodName << endl; } - componentsConstructorTable::iterator cstrIter = - componentsConstructorTablePtr_->find(methodName); + auto cstrIter = componentsConstructorTablePtr_->cfind(methodName); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown meshToMesh type " << methodName << nl << nl - << "Valid meshToMesh types are:" << nl - << componentsConstructorTablePtr_->sortedToc() << exit(FatalError); + << "Valid meshToMesh types :" << nl + << componentsConstructorTablePtr_->sortedToc() + << exit(FatalError); } return autoPtr(cstrIter()(src, tgt)); diff --git a/src/sampling/sampledSet/sampledSet/sampledSet.C b/src/sampling/sampledSet/sampledSet/sampledSet.C index 6e7ad85748..78694160f3 100644 --- a/src/sampling/sampledSet/sampledSet/sampledSet.C +++ b/src/sampling/sampledSet/sampledSet/sampledSet.C @@ -448,8 +448,7 @@ Foam::autoPtr Foam::sampledSet::New { const word sampleType(dict.lookup("type")); - wordConstructorTable::iterator cstrIter = - wordConstructorTablePtr_->find(sampleType); + auto cstrIter = wordConstructorTablePtr_->cfind(sampleType); if (!cstrIter.found()) { diff --git a/src/sampling/sampledSurface/readers/surfaceReaderNew.C b/src/sampling/sampledSurface/readers/surfaceReaderNew.C index 9a360611f3..53be1c7a0e 100644 --- a/src/sampling/sampledSurface/readers/surfaceReaderNew.C +++ b/src/sampling/sampledSurface/readers/surfaceReaderNew.C @@ -33,8 +33,7 @@ Foam::autoPtr Foam::surfaceReader::New const fileName& fName ) { - fileNameConstructorTable::iterator cstrIter = - fileNameConstructorTablePtr_->find(readerType); + auto cstrIter = fileNameConstructorTablePtr_->cfind(readerType); if (!cstrIter.found()) { diff --git a/src/sampling/sampledSurface/sampledSurface/sampledSurface.C b/src/sampling/sampledSurface/sampledSurface/sampledSurface.C index b075331031..8082337550 100644 --- a/src/sampling/sampledSurface/sampledSurface/sampledSurface.C +++ b/src/sampling/sampledSurface/sampledSurface/sampledSurface.C @@ -61,15 +61,14 @@ Foam::autoPtr Foam::sampledSurface::New Info<< "Selecting sampledType " << sampleType << endl; } - wordConstructorTable::iterator cstrIter = - wordConstructorTablePtr_->find(sampleType); + auto cstrIter = wordConstructorTablePtr_->cfind(sampleType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown sample type " << sampleType << nl << nl - << "Valid sample types : " << endl + << "Valid sample types :" << endl << wordConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/sampling/sampledSurface/writers/surfaceWriter.C b/src/sampling/sampledSurface/writers/surfaceWriter.C index 355f6431bf..801ef79215 100644 --- a/src/sampling/sampledSurface/writers/surfaceWriter.C +++ b/src/sampling/sampledSurface/writers/surfaceWriter.C @@ -54,8 +54,7 @@ namespace Foam Foam::autoPtr Foam::surfaceWriter::New(const word& writeType) { - wordConstructorTable::iterator cstrIter = - wordConstructorTablePtr_->find(writeType); + auto cstrIter = wordConstructorTablePtr_->cfind(writeType); if (!cstrIter.found()) { @@ -86,8 +85,7 @@ Foam::autoPtr Foam::surfaceWriter::New(const word& writeType, const dictionary& optDict) { // find constructors with dictionary options - wordDictConstructorTable::iterator cstrIter = - wordDictConstructorTablePtr_->find(writeType); + auto cstrIter = wordDictConstructorTablePtr_->cfind(writeType); if (!cstrIter.found()) { diff --git a/src/sampling/surfMeshSampler/surfMeshSampler/surfMeshSampler.C b/src/sampling/surfMeshSampler/surfMeshSampler/surfMeshSampler.C index dffee65df2..29de6a8523 100644 --- a/src/sampling/surfMeshSampler/surfMeshSampler/surfMeshSampler.C +++ b/src/sampling/surfMeshSampler/surfMeshSampler/surfMeshSampler.C @@ -78,8 +78,7 @@ Foam::surfMeshSampler::New { const word sampleType(dict.lookup("type")); - wordConstructorTable::iterator cstrIter = - wordConstructorTablePtr_->find(sampleType); + auto cstrIter = wordConstructorTablePtr_->cfind(sampleType); if (!cstrIter.found()) { diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraintNew.C b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraintNew.C index 6200cdcc67..a80ea68ce8 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraintNew.C +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraintNew.C @@ -40,15 +40,14 @@ Foam::sixDoFRigidBodyMotionConstraint::New sDoFRBMCDict.lookup("sixDoFRigidBodyMotionConstraint") ); - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(constraintType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(constraintType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown sixDoFRigidBodyMotionConstraint type " << constraintType << nl << nl - << "Valid sixDoFRigidBodyMotionConstraints are : " << endl + << "Valid sixDoFRigidBodyMotionConstraint types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraintNew.C b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraintNew.C index 864e8eee8c..33f2da687c 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraintNew.C +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraintNew.C @@ -39,15 +39,14 @@ Foam::sixDoFRigidBodyMotionRestraint::New sDoFRBMRDict.lookup("sixDoFRigidBodyMotionRestraint") ); - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(restraintType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(restraintType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown sixDoFRigidBodyMotionRestraint type " << restraintType << nl << nl - << "Valid sixDoFRigidBodyMotionRestraint types are : " << endl + << "Valid sixDoFRigidBodyMotionRestraint types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/sixDoFRigidBodyMotion/sixDoFSolvers/sixDoFSolver/newSixDoFSolver.C b/src/sixDoFRigidBodyMotion/sixDoFSolvers/sixDoFSolver/newSixDoFSolver.C index 44e4f0b58e..706583a560 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFSolvers/sixDoFSolver/newSixDoFSolver.C +++ b/src/sixDoFRigidBodyMotion/sixDoFSolvers/sixDoFSolver/newSixDoFSolver.C @@ -33,19 +33,18 @@ Foam::autoPtr Foam::sixDoFSolver::New sixDoFRigidBodyMotion& body ) { - word sixDoFSolverType(dict.lookup("type")); + word solverType(dict.lookup("type")); - Info<< "Selecting sixDoFSolver " << sixDoFSolverType << endl; + Info<< "Selecting sixDoFSolver " << solverType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(sixDoFSolverType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(solverType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown sixDoFSolverType type " - << sixDoFSolverType << endl << endl - << "Valid sixDoFSolver types are : " << endl + << "Unknown sixDoFSolver type " + << solverType << nl << nl + << "Valid sixDoFSolver types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/surfMesh/MeshedSurface/MeshedSurface.C b/src/surfMesh/MeshedSurface/MeshedSurface.C index 41d0418a3b..a2efe775e6 100644 --- a/src/surfMesh/MeshedSurface/MeshedSurface.C +++ b/src/surfMesh/MeshedSurface/MeshedSurface.C @@ -127,7 +127,7 @@ void Foam::MeshedSurface::write InfoInFunction << "Writing to " << name << endl; } - auto mfIter = writefileExtensionMemberFunctionTablePtr_->find(ext); + auto mfIter = writefileExtensionMemberFunctionTablePtr_->cfind(ext); if (!mfIter.found()) { diff --git a/src/surfMesh/MeshedSurface/MeshedSurfaceNew.C b/src/surfMesh/MeshedSurface/MeshedSurfaceNew.C index 7d345191ff..ae18f3b9bb 100644 --- a/src/surfMesh/MeshedSurface/MeshedSurfaceNew.C +++ b/src/surfMesh/MeshedSurface/MeshedSurfaceNew.C @@ -38,7 +38,7 @@ Foam::MeshedSurface::New(const fileName& name, const word& ext) InfoInFunction << "Constructing MeshedSurface" << endl; } - auto cstrIter = fileExtensionConstructorTablePtr_->find(ext); + auto cstrIter = fileExtensionConstructorTablePtr_->cfind(ext); if (!cstrIter.found()) { diff --git a/src/surfMesh/MeshedSurfaceProxy/MeshedSurfaceProxy.C b/src/surfMesh/MeshedSurfaceProxy/MeshedSurfaceProxy.C index b5dbdb6c99..dd15f9d31f 100644 --- a/src/surfMesh/MeshedSurfaceProxy/MeshedSurfaceProxy.C +++ b/src/surfMesh/MeshedSurfaceProxy/MeshedSurfaceProxy.C @@ -78,7 +78,7 @@ void Foam::MeshedSurfaceProxy::write InfoInFunction << "Writing to " << name << endl; } - auto mfIter = writefileExtensionMemberFunctionTablePtr_->find(ext); + auto mfIter = writefileExtensionMemberFunctionTablePtr_->cfind(ext); if (!mfIter.found()) { diff --git a/src/surfMesh/UnsortedMeshedSurface/UnsortedMeshedSurface.C b/src/surfMesh/UnsortedMeshedSurface/UnsortedMeshedSurface.C index b54f3c4ce1..ab426dc13d 100644 --- a/src/surfMesh/UnsortedMeshedSurface/UnsortedMeshedSurface.C +++ b/src/surfMesh/UnsortedMeshedSurface/UnsortedMeshedSurface.C @@ -113,7 +113,7 @@ void Foam::UnsortedMeshedSurface::write const word ext = name.ext(); - auto mfIter = writefileExtensionMemberFunctionTablePtr_->find(ext); + auto mfIter = writefileExtensionMemberFunctionTablePtr_->cfind(ext); if (!mfIter.found()) { diff --git a/src/surfMesh/UnsortedMeshedSurface/UnsortedMeshedSurfaceNew.C b/src/surfMesh/UnsortedMeshedSurface/UnsortedMeshedSurfaceNew.C index 6f50b23897..8986188350 100644 --- a/src/surfMesh/UnsortedMeshedSurface/UnsortedMeshedSurfaceNew.C +++ b/src/surfMesh/UnsortedMeshedSurface/UnsortedMeshedSurfaceNew.C @@ -37,7 +37,7 @@ Foam::UnsortedMeshedSurface::New(const fileName& name, const word& ext) InfoInFunction << "Constructing UnsortedMeshedSurface" << endl; } - auto cstrIter = fileExtensionConstructorTablePtr_->find(ext); + auto cstrIter = fileExtensionConstructorTablePtr_->cfind(ext); if (!cstrIter.found()) { diff --git a/src/thermophysicalModels/barotropicCompressibilityModel/barotropicCompressibilityModel/barotropicCompressibilityModelNew.C b/src/thermophysicalModels/barotropicCompressibilityModel/barotropicCompressibilityModel/barotropicCompressibilityModelNew.C index 3ba0e8e5c1..56d3d985fb 100644 --- a/src/thermophysicalModels/barotropicCompressibilityModel/barotropicCompressibilityModel/barotropicCompressibilityModelNew.C +++ b/src/thermophysicalModels/barotropicCompressibilityModel/barotropicCompressibilityModel/barotropicCompressibilityModelNew.C @@ -42,15 +42,14 @@ Foam::barotropicCompressibilityModel::New Info<< "Selecting compressibility model " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown barotropicCompressibilityModel type " << modelType << nl << nl - << "Valid barotropicCompressibilityModels are : " << endl + << "Valid barotropicCompressibilityModel types : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/thermophysicalModels/basic/basicThermo/basicThermoTemplates.C b/src/thermophysicalModels/basic/basicThermo/basicThermoTemplates.C index 56817cd219..0d6be8b710 100644 --- a/src/thermophysicalModels/basic/basicThermo/basicThermoTemplates.C +++ b/src/thermophysicalModels/basic/basicThermo/basicThermoTemplates.C @@ -38,7 +38,7 @@ typename Table::iterator Foam::basicThermo::lookupThermo ) { // Lookup the thermo package - typename Table::iterator cstrIter = tablePtr->find(thermoTypeName); + auto cstrIter = tablePtr->find(thermoTypeName); // Print error message if package not found in the table if (!cstrIter.found()) @@ -180,7 +180,7 @@ typename Table::iterator Foam::basicThermo::lookupThermo Info<< "Selecting thermodynamics package " << thermoTypeName << endl; - typename Table::iterator cstrIter = tablePtr->find(thermoTypeName); + auto cstrIter = tablePtr->find(thermoTypeName); if (!cstrIter.found()) { @@ -217,7 +217,7 @@ Foam::autoPtr Foam::basicThermo::New ) ); - typename Thermo::fvMeshConstructorTable::iterator cstrIter = + auto cstrIter = lookupThermo ( thermoDict, @@ -236,7 +236,7 @@ Foam::autoPtr Foam::basicThermo::New const word& phaseName ) { - typename Thermo::dictionaryConstructorTable::iterator cstrIter = + auto cstrIter = lookupThermo ( dict, diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/chemistryReductionMethod/chemistryReductionMethodNew.C b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/chemistryReductionMethod/chemistryReductionMethodNew.C index bdc0a3e2a7..6f676d8893 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/chemistryReductionMethod/chemistryReductionMethodNew.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/chemistryReductionMethod/chemistryReductionMethodNew.C @@ -70,22 +70,20 @@ Foam::chemistryReductionMethod::New dictionary MRdict(dict.subDict("reduction")); - word chemistryReductionMethodTypeName = + word methodName = word(MRdict.lookup("method")) + '<' + word(dict.subDict("chemistryType").lookup("chemistryThermo")) + ',' + thermoTypeName + '>'; - typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(chemistryReductionMethodTypeName); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(methodName); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown chemistryReductionMethodType type " - << chemistryReductionMethodTypeName - << endl << endl - << "Valid chemistryReductionMethodType types are :" << endl - << dictionaryConstructorTablePtr_->toc() + << "Unknown chemistryReductionMethod type " + << methodName << nl << nl + << "Valid chemistryReductionMethod types :" << endl + << dictionaryConstructorTablePtr_->sortedToc() << 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 a7f9268d3e..46c1a3e17c 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/chemistryTabulationMethod/chemistryTabulationMethodNew.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/chemistryTabulationMethod/chemistryTabulationMethodNew.C @@ -70,22 +70,20 @@ Foam::chemistryTabulationMethod::New dictionary tabdict(dict.subDict("tabulation")); - word chemistryTabulationMethodName = + const word methodName = word(tabdict.lookup("method")) + '<' + word(dict.subDict("chemistryType").lookup("chemistryThermo")) + ',' + thermoTypeName + '>'; - typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(chemistryTabulationMethodName); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(methodName); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown chemistryTabulationMethodType type " - << chemistryTabulationMethodName - << endl << endl - << "Valid chemistryTabulationMethodType types are :" << endl - << dictionaryConstructorTablePtr_->toc() + << methodName << nl << nl + << "Valid chemistryTabulationMethodType types :" << endl + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModelTemplates.C b/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModelTemplates.C index b0e72f1c5e..0b58ed3ec8 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModelTemplates.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModelTemplates.C @@ -123,15 +123,17 @@ Foam::autoPtr Foam::basicChemistryModel::New + thermoTypeName + ">>"; } - typename ChemistryModel::fvMeshConstructorTable::iterator cstrIter = - ChemistryModel::fvMeshConstructorTablePtr_->find(chemistryTypeName); + auto cstrIter = ChemistryModel::fvMeshConstructorTablePtr_->cfind + ( + chemistryTypeName + ); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown " << ChemistryModel::typeName << " type " << nl << "chemistryType" << chemistryTypeDict << nl << nl - << "Valid " << ChemistryModel ::typeName << " types are:" + << "Valid " << ChemistryModel ::typeName << " types :" << nl << nl; // Get the list of all the suitable chemistry packages available @@ -179,15 +181,17 @@ Foam::autoPtr Foam::basicChemistryModel::New Info<< "Selecting chemistry type " << chemistryTypeName << endl; - typename ChemistryModel::fvMeshConstructorTable::iterator cstrIter = - ChemistryModel::fvMeshConstructorTablePtr_->find(chemistryTypeName); + auto cstrIter = ChemistryModel::fvMeshConstructorTablePtr_->cfind + ( + chemistryTypeName + ); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown " << ChemistryModel::typeName << " type " << chemistryTypeName << nl << nl - << "Valid ChemistryModel types are:" << nl + << "Valid ChemistryModel types :" << nl << ChemistryModel::fvMeshConstructorTablePtr_->sortedToc() << nl << exit(FatalError); } diff --git a/src/thermophysicalModels/laminarFlameSpeed/laminarFlameSpeed/laminarFlameSpeedNew.C b/src/thermophysicalModels/laminarFlameSpeed/laminarFlameSpeed/laminarFlameSpeedNew.C index 74c87d4dd5..74d7f074e6 100644 --- a/src/thermophysicalModels/laminarFlameSpeed/laminarFlameSpeed/laminarFlameSpeedNew.C +++ b/src/thermophysicalModels/laminarFlameSpeed/laminarFlameSpeed/laminarFlameSpeedNew.C @@ -50,8 +50,7 @@ Foam::autoPtr Foam::laminarFlameSpeed::New Info<< "Selecting laminar flame speed correlation " << corrType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(corrType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(corrType); if (!cstrIter.found()) { @@ -60,7 +59,7 @@ Foam::autoPtr Foam::laminarFlameSpeed::New propDict ) << "Unknown laminarFlameSpeed type " << corrType << nl << nl - << "Valid laminarFlameSpeed types are :" << endl + << "Valid laminarFlameSpeed types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalIOError); } diff --git a/src/thermophysicalModels/radiation/radiationModels/radiationModel/radiationModelNew.C b/src/thermophysicalModels/radiation/radiationModels/radiationModel/radiationModelNew.C index 9b730c2228..21fc0f4f22 100644 --- a/src/thermophysicalModels/radiation/radiationModels/radiationModel/radiationModelNew.C +++ b/src/thermophysicalModels/radiation/radiationModels/radiationModel/radiationModelNew.C @@ -57,15 +57,14 @@ Foam::radiation::radiationModel::New Info<< "Selecting radiationModel " << modelType << endl; - TConstructorTable::iterator cstrIter = - TConstructorTablePtr_->find(modelType); + auto cstrIter = TConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown radiationModel type " << modelType << nl << nl - << "Valid radiationModel types are:" << nl + << "Valid radiationModel types :" << nl << TConstructorTablePtr_->sortedToc() << exit(FatalError); } @@ -85,15 +84,14 @@ Foam::radiation::radiationModel::New Info<< "Selecting radiationModel " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown radiationModel type " << modelType << nl << nl - << "Valid radiationModel types are:" << nl + << "Valid radiationModel types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/absorptionEmissionModel/absorptionEmissionModelNew.C b/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/absorptionEmissionModel/absorptionEmissionModelNew.C index 0705302b45..82b6e9b0c2 100644 --- a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/absorptionEmissionModel/absorptionEmissionModelNew.C +++ b/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/absorptionEmissionModel/absorptionEmissionModelNew.C @@ -39,16 +39,16 @@ Foam::radiation::absorptionEmissionModel::New Info<< "Selecting absorptionEmissionModel " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown absorptionEmissionModel type " << modelType << nl << nl - << "Valid absorptionEmissionModel types are :" << nl - << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); + << "Valid absorptionEmissionModel types :" << nl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); } return autoPtr(cstrIter()(dict, mesh)); diff --git a/src/thermophysicalModels/radiation/submodels/scatterModel/scatterModel/scatterModelNew.C b/src/thermophysicalModels/radiation/submodels/scatterModel/scatterModel/scatterModelNew.C index ab825045bc..c742a18f6f 100644 --- a/src/thermophysicalModels/radiation/submodels/scatterModel/scatterModel/scatterModelNew.C +++ b/src/thermophysicalModels/radiation/submodels/scatterModel/scatterModel/scatterModelNew.C @@ -38,15 +38,14 @@ Foam::autoPtr Foam::radiation::scatterModel::New Info<< "Selecting scatterModel " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown scatterModel type " << modelType << nl << nl - << "Valid scatterModel types are :" << nl + << "Valid scatterModel types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/thermophysicalModels/radiation/submodels/sootModel/sootModel/sootModelNew.C b/src/thermophysicalModels/radiation/submodels/sootModel/sootModel/sootModelNew.C index 1871870591..18fc90ada9 100644 --- a/src/thermophysicalModels/radiation/submodels/sootModel/sootModel/sootModelNew.C +++ b/src/thermophysicalModels/radiation/submodels/sootModel/sootModel/sootModelNew.C @@ -44,16 +44,16 @@ Foam::radiation::sootModel::New Info<< "Selecting sootModel " << modelType << endl; } - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown sootModel type " << modelType << nl << nl - << "Valid sootModel types are :" << nl - << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); + << "Valid sootModel types :" << nl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); } const label tempOpen = modelType.find('<'); diff --git a/src/thermophysicalModels/radiation/submodels/transmissivityModel/transmissivityModel/transmissivityModelNew.C b/src/thermophysicalModels/radiation/submodels/transmissivityModel/transmissivityModel/transmissivityModelNew.C index 07298ef596..da82c756f9 100644 --- a/src/thermophysicalModels/radiation/submodels/transmissivityModel/transmissivityModel/transmissivityModelNew.C +++ b/src/thermophysicalModels/radiation/submodels/transmissivityModel/transmissivityModel/transmissivityModelNew.C @@ -39,15 +39,14 @@ transmissivityModel::New Info<< "Selecting transmissivityModel " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown transmissivityModel type " << modelType << nl << nl - << "Valid transmissivityModel types are :" << nl + << "Valid transmissivityModel types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.C b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.C index c0d9e3f7af..69032a1169 100644 --- a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.C +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.C @@ -37,22 +37,21 @@ Foam::chemistryReader::New { // Let the chemistry reader type default to CHEMKIN // for backward compatibility - word chemistryReaderTypeName("chemkinReader"); + word readerName("chemkinReader"); // otherwise use the specified reader - thermoDict.readIfPresent("chemistryReader", chemistryReaderTypeName); + thermoDict.readIfPresent("chemistryReader", readerName); - Info<< "Selecting chemistryReader " << chemistryReaderTypeName << endl; + Info<< "Selecting chemistryReader " << readerName << endl; - typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(chemistryReaderTypeName); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(readerName); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown chemistryReader type " - << chemistryReaderTypeName << nl << nl - << "Valid chemistryReader types are:" << nl + << readerName << nl << nl + << "Valid chemistryReader types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/thermophysicalModels/solidChemistryModel/basicSolidChemistryModel/basicSolidChemistryModelNew.C b/src/thermophysicalModels/solidChemistryModel/basicSolidChemistryModel/basicSolidChemistryModelNew.C index 5ac8e03ef3..43f1010465 100644 --- a/src/thermophysicalModels/solidChemistryModel/basicSolidChemistryModel/basicSolidChemistryModelNew.C +++ b/src/thermophysicalModels/solidChemistryModel/basicSolidChemistryModel/basicSolidChemistryModelNew.C @@ -116,8 +116,7 @@ New Info<< "chemistryTypeName " << chemistryTypeName << endl; - fvMeshConstructorTable::iterator cstrIter = - fvMeshConstructorTablePtr_->find(chemistryTypeName); + auto cstrIter = fvMeshConstructorTablePtr_->cfind(chemistryTypeName); if (!cstrIter.found()) { diff --git a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.C b/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.C index 645cc4fc80..8f0330cea9 100644 --- a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.C +++ b/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.C @@ -366,15 +366,14 @@ Foam::Reaction::New { const word& reactionTypeName = dict.lookup("type"); - typename dictionaryConstructorTable::iterator cstrIter - = dictionaryConstructorTablePtr_->find(reactionTypeName); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(reactionTypeName); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown reaction type " << reactionTypeName << nl << nl - << "Valid reaction types are :" << nl + << "Valid reaction types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/liquidProperties/liquidProperties.C b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/liquidProperties/liquidProperties.C index f454eb7bf8..e0dec535cf 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/liquidProperties/liquidProperties.C +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/liquidProperties/liquidProperties.C @@ -95,14 +95,14 @@ Foam::autoPtr Foam::liquidProperties::New InfoInFunction << "Constructing liquidProperties" << endl; } - ConstructorTable::iterator cstrIter = ConstructorTablePtr_->find(name); + auto cstrIter = ConstructorTablePtr_->cfind(name); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown liquidProperties type " << name << nl << nl - << "Valid liquidProperties types are:" << nl + << "Valid liquidProperties types :" << nl << ConstructorTablePtr_->sortedToc() << exit(FatalError); } @@ -121,7 +121,7 @@ Foam::autoPtr Foam::liquidProperties::New InfoInFunction << "Constructing liquidProperties" << endl; } - const word& liquidPropertiesTypeName = dict.dictName(); + const word& liquidType = dict.dictName(); if (dict.found("defaultCoeffs")) { @@ -129,19 +129,18 @@ Foam::autoPtr Foam::liquidProperties::New if (Switch(dict.lookup("defaultCoeffs"))) { - return New(liquidPropertiesTypeName); + return New(liquidType); } else { - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(liquidPropertiesTypeName); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(liquidType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown liquidProperties type " - << liquidPropertiesTypeName << nl << nl - << "Valid liquidProperties types are:" << nl + << liquidType << nl << nl + << "Valid liquidProperties types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } @@ -150,22 +149,21 @@ Foam::autoPtr Foam::liquidProperties::New ( cstrIter() ( - dict.optionalSubDict(liquidPropertiesTypeName + "Coeffs") + dict.optionalSubDict(liquidType + "Coeffs") ) ); } } else { - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(liquidPropertiesTypeName); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(liquidType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown liquidProperties type " - << liquidPropertiesTypeName << nl << nl - << "Valid liquidProperties types are:" << nl + << liquidType << nl << nl + << "Valid liquidProperties types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/thermophysicalModels/thermophysicalProperties/solidProperties/solidProperties/solidPropertiesNew.C b/src/thermophysicalModels/thermophysicalProperties/solidProperties/solidProperties/solidPropertiesNew.C index f27570bf7b..89c4de9b2e 100644 --- a/src/thermophysicalModels/thermophysicalProperties/solidProperties/solidProperties/solidPropertiesNew.C +++ b/src/thermophysicalModels/thermophysicalProperties/solidProperties/solidProperties/solidPropertiesNew.C @@ -38,14 +38,14 @@ Foam::autoPtr Foam::solidProperties::New InfoInFunction << "Constructing solidProperties" << endl; } - ConstructorTable::iterator cstrIter = ConstructorTablePtr_->find(name); + auto cstrIter = ConstructorTablePtr_->cfind(name); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown solidProperties type " << name << nl << nl - << "Valid solidProperties types are:" << nl + << "Valid solidProperties types :" << nl << ConstructorTablePtr_->sortedToc() << exit(FatalError); } @@ -84,15 +84,14 @@ Foam::autoPtr Foam::solidProperties::New } else { - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(solidType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(solidType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown solidProperties type " << solidType << nl << nl - << "Valid solidProperties types are:" << nl + << "Valid solidProperties types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/thermophysicalModels/thermophysicalProperties/thermophysicalFunctions/thermophysicalFunction/thermophysicalFunction.C b/src/thermophysicalModels/thermophysicalProperties/thermophysicalFunctions/thermophysicalFunction/thermophysicalFunction.C index f26d242681..d88b584de1 100644 --- a/src/thermophysicalModels/thermophysicalProperties/thermophysicalFunctions/thermophysicalFunction/thermophysicalFunction.C +++ b/src/thermophysicalModels/thermophysicalProperties/thermophysicalFunctions/thermophysicalFunction/thermophysicalFunction.C @@ -50,18 +50,16 @@ Foam::autoPtr Foam::thermophysicalFunction::New << endl; } - const word thermophysicalFunctionType(is); + const word functionType(is); - IstreamConstructorTable::iterator cstrIter = - IstreamConstructorTablePtr_->find(thermophysicalFunctionType); + auto cstrIter = IstreamConstructorTablePtr_->cfind(functionType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown thermophysicalFunction type " - << thermophysicalFunctionType - << nl << nl - << "Valid thermophysicalFunction types are :" << endl + << functionType << nl << nl + << "Valid thermophysicalFunction types :" << endl << IstreamConstructorTablePtr_->sortedToc() << abort(FatalError); } @@ -82,17 +80,15 @@ Foam::autoPtr Foam::thermophysicalFunction::New << endl; } - const word thermophysicalFunctionType(dict.lookup("functionType")); + const word functionType(dict.lookup("functionType")); - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(thermophysicalFunctionType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(functionType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown thermophysicalFunction type " - << thermophysicalFunctionType - << nl << nl + << functionType << nl << nl << "Valid thermophysicalFunction types are :" << endl << dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); diff --git a/src/thermophysicalModels/thermophysicalProperties/thermophysicalProperties/thermophysicalProperties.C b/src/thermophysicalModels/thermophysicalProperties/thermophysicalProperties/thermophysicalProperties.C index d82d3f2a24..52570ede10 100644 --- a/src/thermophysicalModels/thermophysicalProperties/thermophysicalProperties/thermophysicalProperties.C +++ b/src/thermophysicalModels/thermophysicalProperties/thermophysicalProperties/thermophysicalProperties.C @@ -61,7 +61,7 @@ Foam::thermophysicalProperties::New InfoInFunction << "Constructing thermophysicalProperties" << endl; } - ConstructorTable::iterator cstrIter = ConstructorTablePtr_->find(name); + auto cstrIter = ConstructorTablePtr_->cfind(name); if (!cstrIter.found()) { @@ -88,17 +88,16 @@ Foam::thermophysicalProperties::New InfoInFunction << "Constructing thermophysicalProperties" << endl; } - const word& thermophysicalPropertiesTypeName = dict.dictName(); + const word& propertiesTypeName = dict.dictName(); - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(thermophysicalPropertiesTypeName); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(propertiesTypeName); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown thermophysicalProperties type " - << thermophysicalPropertiesTypeName << nl << nl - << "Valid thermophysicalProperties types are:" << nl + << propertiesTypeName << nl << nl + << "Valid thermophysicalProperties types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/transportModels/incompressible/viscosityModels/viscosityModel/viscosityModelNew.C b/src/transportModels/incompressible/viscosityModels/viscosityModel/viscosityModelNew.C index df4dcff09e..482036bbbb 100644 --- a/src/transportModels/incompressible/viscosityModels/viscosityModel/viscosityModelNew.C +++ b/src/transportModels/incompressible/viscosityModels/viscosityModel/viscosityModelNew.C @@ -41,15 +41,14 @@ Foam::autoPtr Foam::viscosityModel::New Info<< "Selecting incompressible transport model " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown viscosityModel type " << modelType << nl << nl - << "Valid viscosityModels are : " << endl + << "Valid viscosityModels :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/transportModels/interfaceProperties/surfaceTensionModels/surfaceTensionModel/surfaceTensionModelNew.C b/src/transportModels/interfaceProperties/surfaceTensionModels/surfaceTensionModel/surfaceTensionModelNew.C index 6b2aa962cb..7abdb1a75d 100644 --- a/src/transportModels/interfaceProperties/surfaceTensionModels/surfaceTensionModel/surfaceTensionModelNew.C +++ b/src/transportModels/interfaceProperties/surfaceTensionModels/surfaceTensionModel/surfaceTensionModelNew.C @@ -38,20 +38,18 @@ Foam::autoPtr Foam::surfaceTensionModel::New { const dictionary& sigmaDict = surfaceTensionModel::sigmaDict(dict); - word surfaceTensionModelType(sigmaDict.lookup("type")); + const word modelType(sigmaDict.lookup("type")); - Info<< "Selecting surfaceTensionModel " - << surfaceTensionModelType << endl; + Info<< "Selecting surfaceTensionModel " << modelType << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(surfaceTensionModelType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction - << "Unknown surfaceTensionModelType type " - << surfaceTensionModelType << endl << endl - << "Valid surfaceTensionModel types are : " << endl + << "Unknown surfaceTensionModel type " + << modelType << nl << nl + << "Valid surfaceTensionModel types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/waveModels/waveModel/waveModelNew.C b/src/waveModels/waveModel/waveModelNew.C index b47ea48217..95315fa4a6 100644 --- a/src/waveModels/waveModel/waveModelNew.C +++ b/src/waveModels/waveModel/waveModelNew.C @@ -62,15 +62,14 @@ Foam::autoPtr Foam::waveModel::New Info<< "Selecting waveModel " << modelType << endl; - patchConstructorTable::iterator cstrIter = - patchConstructorTablePtr_->find(modelType); + auto cstrIter = patchConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalIOErrorInFunction(waveDict) << "Unknown waveModel type " << modelType << nl << nl - << "Valid waveModel types are:" << nl + << "Valid waveModel types :" << nl << patchConstructorTablePtr_->sortedToc() << exit(FatalIOError); } From 7ac55ac74ac2433416e00e966d9eb70f5d67d9c4 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Mon, 3 Jul 2017 13:24:08 +0200 Subject: [PATCH 02/50] ENH: consolidate arch and version strings (issue #513) - make some IOobject writing routines non-templated. - relocate more IOobject methods into the IOobjectI.H (generally cleanup the main header). --- .../graphics/ensightFoamReader/libuserd.C | 1 + src/OpenFOAM/db/IOobject/IOobject.C | 14 +- src/OpenFOAM/db/IOobject/IOobject.H | 286 ++++++++---------- src/OpenFOAM/db/IOobject/IOobjectI.H | 192 +++++++----- src/OpenFOAM/db/IOobject/IOobjectTemplates.C | 5 +- .../db/IOobject/IOobjectWriteHeader.C | 104 +++++-- src/OpenFOAM/global/argList/argList.C | 30 +- src/OpenFOAM/global/foamVersion.H | 14 +- src/OpenFOAM/global/global.Cver | 20 ++ 9 files changed, 369 insertions(+), 297 deletions(-) diff --git a/applications/utilities/postProcessing/graphics/ensightFoamReader/libuserd.C b/applications/utilities/postProcessing/graphics/ensightFoamReader/libuserd.C index 88bf926c42..4df3379e3c 100644 --- a/applications/utilities/postProcessing/graphics/ensightFoamReader/libuserd.C +++ b/applications/utilities/postProcessing/graphics/ensightFoamReader/libuserd.C @@ -45,6 +45,7 @@ Description #include "fvMesh.H" #include "cellModeller.H" #include "globalFoam.H" +#include "foamVersion.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/db/IOobject/IOobject.C b/src/OpenFOAM/db/IOobject/IOobject.C index 5953185baa..f61465bcb3 100644 --- a/src/OpenFOAM/db/IOobject/IOobject.C +++ b/src/OpenFOAM/db/IOobject/IOobject.C @@ -351,6 +351,12 @@ const Foam::Time& Foam::IOobject::time() const } +const Foam::fileName& Foam::IOobject::rootPath() const +{ + return time().rootPath(); +} + + const Foam::fileName& Foam::IOobject::caseName() const { return time().caseName(); @@ -387,12 +393,6 @@ Foam::word Foam::IOobject::member() const } -const Foam::fileName& Foam::IOobject::rootPath() const -{ - return time().rootPath(); -} - - Foam::fileName Foam::IOobject::path() const { if (instance().isAbsolute()) @@ -617,6 +617,8 @@ void Foam::IOobject::setBad(const string& s) } +// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // + void Foam::IOobject::operator=(const IOobject& io) { name_ = io.name_; diff --git a/src/OpenFOAM/db/IOobject/IOobject.H b/src/OpenFOAM/db/IOobject/IOobject.H index b08b3bb661..a0502fb1df 100644 --- a/src/OpenFOAM/db/IOobject/IOobject.H +++ b/src/OpenFOAM/db/IOobject/IOobject.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. + \\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -191,6 +191,12 @@ public: TypeName("IOobject"); + // Static data members + + //- Type of file modification checking + static fileCheckTypes fileModificationChecking; + + // Static Member Functions //- Split path into instance, local, name components @@ -202,11 +208,9 @@ public: word& name ); - template - static inline word groupName(Name name, const word& group); - - //- Type of file modification checking - static fileCheckTypes fileModificationChecking; + //- Create dot-delimited name.group + template + static inline word groupName(StringType name, const word& group); // Constructors @@ -280,214 +284,162 @@ public: // Member Functions - // General access + // General access - //- Return time - const Time& time() const; + //- Return the local objectRegistry + const objectRegistry& db() const; - //- Return the local objectRegistry - const objectRegistry& db() const; + //- Return time + const Time& time() const; - //- Return name - const word& name() const - { - return name_; - } + //- Return name + inline const word& name() const; - //- Return name of the class name read from header - const word& headerClassName() const - { - return headerClassName_; - } + //- Return name of the class name read from header + inline const word& headerClassName() const; - //- Return non-constant access to the optional note - string& note() - { - return note_; - } + //- Return the optional note + inline const string& note() const; - //- Return the optional note - const string& note() const - { - return note_; - } + //- Return non-constant access to the optional note + inline string& note(); - //- Rename - virtual void rename(const word& newName) - { - name_ = newName; - } + //- Rename + virtual void rename(const word& newName) + { + name_ = newName; + } - //- Register object created from this IOobject with registry if true - bool& registerObject() - { - return registerObject_; - } + //- Register object created from this IOobject with registry if true + inline bool registerObject() const; - //- Register object created from this IOobject with registry if true - bool registerObject() const - { - return registerObject_; - } + //- Register object created from this IOobject with registry if true + inline bool& registerObject(); - //- Is object same for all processors - bool& globalObject() - { - return globalObject_; - } + //- Is object same for all processors + inline bool globalObject() const; - //- Is object same for all processors - bool globalObject() const - { - return globalObject_; - } + //- Is object same for all processors + inline bool& globalObject(); - // Read/write options + // Read/write options - readOption readOpt() const - { - return rOpt_; - } + //- The read option + inline readOption readOpt() const; - readOption& readOpt() - { - return rOpt_; - } + //- Non-constant access to the read option + inline readOption& readOpt(); - writeOption writeOpt() const - { - return wOpt_; - } + //- The write option + inline writeOption writeOpt() const; - writeOption& writeOpt() - { - return wOpt_; - } + //- Non-constant access to the write option + inline writeOption& writeOpt(); - // Path components + // Path components - //- Return group (extension part of name) - word group() const; + //- Return group (extension part of name) + word group() const; - //- Return member (name without the extension) - word member() const; + //- Return member (name without the extension) + word member() const; - const fileName& rootPath() const; + const fileName& rootPath() const; - const fileName& caseName() const; + const fileName& caseName() const; - const fileName& instance() const - { - return instance_; - } + inline const fileName& instance() const; - fileName& instance() - { - return instance_; - } + inline fileName& instance(); - const fileName& local() const - { - return local_; - } + inline const fileName& local() const; - //- Return complete path - fileName path() const; + //- Return complete path + fileName path() const; - //- Return complete path with alternative instance and local - fileName path - ( - const word& instance, - const fileName& local = fileName::null - ) const; + //- Return complete path with alternative instance and local + fileName path + ( + const word& instance, + const fileName& local = fileName::null + ) const; - //- Return complete path + object name - fileName objectPath() const - { - return path()/name(); - } + //- Return complete path + object name + inline fileName objectPath() const; - //- Helper for filePath that searches locally. - // When search is false, simply use the current instance, - // otherwise search previous instances. - fileName localFilePath(const bool search=true) const; + //- Helper for filePath that searches locally. + // When search is false, simply use the current instance, + // otherwise search previous instances. + fileName localFilePath(const bool search=true) const; - //- Helper for filePath that searches up if in parallel - // When search is false, simply use the current instance, - // otherwise search previous instances. - fileName globalFilePath(const bool search=true) const; + //- Helper for filePath that searches up if in parallel + // When search is false, simply use the current instance, + // otherwise search previous instances. + fileName globalFilePath(const bool search=true) const; - // Reading + // Reading - //- Read header - bool readHeader(Istream&); + //- Read header + bool readHeader(Istream& is); - //- Read header (uses typeFilePath to find file) and check its info. - // Optionally checks headerClassName against the type-name. - // When search is false, simply use the current instance, - // otherwise search previous instances. - template - bool typeHeaderOk - ( - const bool checkType = true, - const bool search = true - ); + //- Read header (uses typeFilePath to find file) and check its info. + // Optionally checks headerClassName against the type-name. + // When search is false, simply use the current instance, + // otherwise search previous instances. + template + bool typeHeaderOk + ( + const bool checkType = true, + const bool search = true + ); - //- Helper: warn that type does not support re-reading - template - void warnNoRereading() const; - - // Writing - - //- Write the standard OpenFOAM file/dictionary banner - // Optionally without -*- C++ -*- editor hint (eg, for logs) - template - static inline Stream& writeBanner(Stream& os, bool noHint=false); - - //- Write the standard file section divider - template - static inline Stream& writeDivider(Stream& os); - - //- Write the standard end file divider - template - static inline Stream& writeEndDivider(Stream& os); - - //- Write header - bool writeHeader(Ostream&) const; - - //- Write header. Allow override of type - bool writeHeader(Ostream&, const word& objectType) const; + //- Helper: warn that type does not support re-reading + template + void warnNoRereading() const; - // Error Handling + // Writing - bool good() const - { - return objState_ == GOOD; - } + //- Write the standard OpenFOAM file/dictionary banner + // Optionally without -*- C++ -*- editor hint (eg, for logs) + static Ostream& writeBanner(Ostream& os, bool noHint=false); - bool bad() const - { - return objState_ == BAD; - } + //- Write the standard file section divider + static Ostream& writeDivider(Ostream& os); + + //- Write the standard end file divider + static Ostream& writeEndDivider(Ostream& os); + + //- Write header + bool writeHeader(Ostream& os) const; + + //- Write header. Allow override of type + bool writeHeader(Ostream& os, const word& objectType) const; - // Info + // Error Handling - //- Return info proxy. - // Used to print token information to a stream - InfoProxy info() const - { - return *this; - } + inline bool good() const; + + inline bool bad() const; + + + // Info + + //- Return info proxy. + // Used to print token information to a stream + InfoProxy info() const + { + return *this; + } // Member operators - void operator=(const IOobject&); + void operator=(const IOobject& io); }; diff --git a/src/OpenFOAM/db/IOobject/IOobjectI.H b/src/OpenFOAM/db/IOobject/IOobjectI.H index be0a0760a2..adce4e7fdc 100644 --- a/src/OpenFOAM/db/IOobject/IOobjectI.H +++ b/src/OpenFOAM/db/IOobject/IOobjectI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2017 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,95 +23,137 @@ License \*---------------------------------------------------------------------------*/ -#include "foamVersion.H" +// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * // -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -template -inline Foam::word Foam::IOobject::groupName(Name name, const word& group) +template +inline Foam::word Foam::IOobject::groupName(StringType name, const word& group) { - if (group != word::null) - { - return name + ('.' + group); - } - else + if (group.empty()) { return name; } -} - - -template -inline Stream& Foam::IOobject::writeBanner(Stream& os, bool noHint) -{ - static bool spacesSet(false); - static char spaces[40]; - - if (!spacesSet) - { - memset(spaces, ' ', 40); - - size_t len = strlen(Foam::FOAMversion); - if (len < 38) - { - spaces[38 - len] = '\0'; - } - else - { - spaces[0] = '\0'; - } - spacesSet = true; - } - - if (noHint) - { - os << - "/*--------------------------------------" - "-------------------------------------*\\\n"; - } else { - os << - "/*--------------------------------*- C++ " - "-*----------------------------------*\\\n"; + return name + ('.' + group); } - - os << - "| ========= |" - " |\n" - "| \\\\ / F ield |" - " OpenFOAM: The Open Source CFD Toolbox |\n" - "| \\\\ / O peration |" - " Version: " << FOAMversion << spaces << "|\n" - "| \\\\ / A nd |" - " Web: www.OpenFOAM.com |\n" - "| \\\\/ M anipulation |" - " |\n" - "\\*-----------------------------------------" - "----------------------------------*/\n"; - - return os; } -template -inline Stream& Foam::IOobject::writeDivider(Stream& os) -{ - os << - "// * * * * * * * * * * * * * * * * * " - "* * * * * * * * * * * * * * * * * * * * //\n"; +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - return os; +// General access + +inline const Foam::word& Foam::IOobject::name() const +{ + return name_; } -template -inline Stream& Foam::IOobject::writeEndDivider(Stream& os) -{ - os << "\n\n" - "// *****************************************" - "******************************** //\n"; - return os; +inline const Foam::word& Foam::IOobject::headerClassName() const +{ + return headerClassName_; +} + + +inline const Foam::string& Foam::IOobject::note() const +{ + return note_; +} + + +inline Foam::string& Foam::IOobject::note() +{ + return note_; +} + + +inline bool Foam::IOobject::registerObject() const +{ + return registerObject_; +} + + +inline bool& Foam::IOobject::registerObject() +{ + return registerObject_; +} + + +inline bool Foam::IOobject::globalObject() const +{ + return globalObject_; +} + + +inline bool& Foam::IOobject::globalObject() +{ + return globalObject_; +} + + +// Read/write options + +inline Foam::IOobject::readOption Foam::IOobject::readOpt() const +{ + return rOpt_; +} + + +inline Foam::IOobject::readOption& Foam::IOobject::readOpt() +{ + return rOpt_; +} + + +inline Foam::IOobject::writeOption Foam::IOobject::writeOpt() const +{ + return wOpt_; +} + + +inline Foam::IOobject::writeOption& Foam::IOobject::writeOpt() +{ + return wOpt_; +} + + +// Path components + +inline const Foam::fileName& Foam::IOobject::instance() const +{ + return instance_; +} + + +inline Foam::fileName& Foam::IOobject::instance() +{ + return instance_; +} + + +inline const Foam::fileName& Foam::IOobject::local() const +{ + return local_; +} + + +inline Foam::fileName Foam::IOobject::objectPath() const +{ + return path()/name(); +} + + +// Error Handling + +inline bool Foam::IOobject::good() const +{ + return objState_ == GOOD; +} + + +inline bool Foam::IOobject::bad() const +{ + return objState_ == BAD; } diff --git a/src/OpenFOAM/db/IOobject/IOobjectTemplates.C b/src/OpenFOAM/db/IOobject/IOobjectTemplates.C index f93384bf8c..58757394db 100644 --- a/src/OpenFOAM/db/IOobject/IOobjectTemplates.C +++ b/src/OpenFOAM/db/IOobject/IOobjectTemplates.C @@ -116,9 +116,8 @@ void Foam::IOobject::warnNoRereading() const { WarningInFunction << Type::typeName << ' ' << name() - << " constructed with IOobject::MUST_READ_IF_MODIFIED" - " but " << Type::typeName - << " does not support automatic rereading." + << " constructed with IOobject::MUST_READ_IF_MODIFIED but " + << Type::typeName << " does not support automatic rereading." << endl; } } diff --git a/src/OpenFOAM/db/IOobject/IOobjectWriteHeader.C b/src/OpenFOAM/db/IOobject/IOobjectWriteHeader.C index 51d6f7d853..4e01787843 100644 --- a/src/OpenFOAM/db/IOobject/IOobjectWriteHeader.C +++ b/src/OpenFOAM/db/IOobject/IOobjectWriteHeader.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. + \\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -29,29 +29,91 @@ Description #include "IOobject.H" #include "objectRegistry.H" -#include "endian.H" -#include "label.H" -#include "scalar.H" +#include "foamVersion.H" -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -// file-scope -// Hint about machine endian, OpenFOAM label and scalar sizes -static const std::string archHint = -( -#ifdef WM_LITTLE_ENDIAN - "LSB" -#elif defined (WM_BIG_ENDIAN) - "MSB" -#else - "???" -#endif - ";label=" + std::to_string(8*sizeof(Foam::label)) - + ";scalar=" + std::to_string(8*sizeof(Foam::scalar)) -); +// A banner corresponding to this: +// +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: VERSION | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +Foam::Ostream& Foam::IOobject::writeBanner(Ostream& os, bool noHint) +{ + // The version padded with spaces to fit after "Version: " + // - initialized with zero-length string to detect if it has been populated + static char paddedVersion[39] = ""; + + if (!*paddedVersion) + { + // Populate: like strncpy but without trailing '\0' + const char *p = Foam::FOAMversion; + + memset(paddedVersion, ' ', 38); + for (int i = 0; *p && i < 38; ++i) + { + paddedVersion[i] = *p++; + } + paddedVersion[38] = '\0'; + } + + os << + "/*--------------------------------"; + + if (noHint) + { + // Without syntax hint + os << "---------"; + } + else + { + // With syntax hint + os << "*- C++ -*"; + } + + os << + "----------------------------------*\\\n" + "| ========= |" + " |\n" + "| \\\\ / F ield |" + " OpenFOAM: The Open Source CFD Toolbox |\n" + "| \\\\ / O peration |" + " Version: " << paddedVersion << "|\n" + "| \\\\ / A nd |" + " Web: www.OpenFOAM.com |\n" + "| \\\\/ M anipulation |" + " |\n" + "\\*-----------------------------------------" + "----------------------------------*/\n"; + + return os; +} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +Foam::Ostream& Foam::IOobject::writeDivider(Ostream& os) +{ + os << + "// * * * * * * * * * * * * * * * * * " + "* * * * * * * * * * * * * * * * * * * * //\n"; + + return os; +} + + +Foam::Ostream& Foam::IOobject::writeEndDivider(Ostream& os) +{ + os << "\n\n" + "// *****************************************" + "******************************** //\n"; + + return os; +} + bool Foam::IOobject::writeHeader(Ostream& os, const word& type) const { @@ -72,7 +134,7 @@ bool Foam::IOobject::writeHeader(Ostream& os, const word& type) const if (os.format() == IOstream::BINARY) { - os << " arch " << archHint << ";\n"; + os << " arch " << Foam::FOAMbuildArch << ";\n"; } if (!note().empty()) diff --git a/src/OpenFOAM/global/argList/argList.C b/src/OpenFOAM/global/argList/argList.C index e111b33067..42d497c770 100644 --- a/src/OpenFOAM/global/argList/argList.C +++ b/src/OpenFOAM/global/argList/argList.C @@ -37,7 +37,7 @@ License #include "sigInt.H" #include "sigQuit.H" #include "sigSegv.H" -#include "endian.H" +#include "foamVersion.H" #include @@ -54,22 +54,6 @@ Foam::string::size_type Foam::argList::usageMin = 20; Foam::string::size_type Foam::argList::usageMax = 80; Foam::word Foam::argList::postProcessOptionName("postProcess"); -// file-scope -// Hint about machine endian, OpenFOAM label and scalar sizes -static const std::string archHint = -( -#ifdef WM_LITTLE_ENDIAN - "LSB" -#elif defined (WM_BIG_ENDIAN) - "MSB" -#else - "???" -#endif - ";label=" + std::to_string(8*sizeof(Foam::label)) - + ";scalar=" + std::to_string(8*sizeof(Foam::scalar)) -); - - Foam::argList::initValidTables::initValidTables() { argList::addOption @@ -639,7 +623,7 @@ void Foam::argList::parse { IOobject::writeBanner(Info, true) << "Build : " << Foam::FOAMbuild << nl - << "Arch : " << archHint << nl + << "Arch : " << Foam::FOAMbuildArch << nl << "Exec : " << argListStr_.c_str() << nl << "Date : " << dateString.c_str() << nl << "Time : " << timeString.c_str() << nl @@ -650,7 +634,7 @@ void Foam::argList::parse jobInfo.add("startDate", dateString); jobInfo.add("startTime", timeString); jobInfo.add("userName", userName()); - jobInfo.add("foamVersion", word(FOAMversion)); + jobInfo.add("foamVersion", word(Foam::FOAMversion)); jobInfo.add("code", executable_); jobInfo.add("argList", argListStr_); jobInfo.add("currentDir", cwd()); @@ -660,10 +644,10 @@ void Foam::argList::parse // Add build information - only use the first word { std::string build(Foam::FOAMbuild); - std::string::size_type found = build.find(' '); - if (found != std::string::npos) + std::string::size_type space = build.find(' '); + if (space != std::string::npos) { - build.resize(found); + build.resize(space); } jobInfo.add("foamBuild", build); } @@ -1247,7 +1231,7 @@ void Foam::argList::printUsage() const <<"Using: OpenFOAM-" << Foam::FOAMversion << " (see www.OpenFOAM.com)" << nl << "Build: " << Foam::FOAMbuild << nl - << "Arch: " << archHint << nl + << "Arch: " << Foam::FOAMbuildArch << nl << endl; } diff --git a/src/OpenFOAM/global/foamVersion.H b/src/OpenFOAM/global/foamVersion.H index bd3386e786..3b5d9fcb46 100644 --- a/src/OpenFOAM/global/foamVersion.H +++ b/src/OpenFOAM/global/foamVersion.H @@ -32,13 +32,20 @@ Global Foam::FOAMversion Description - OpenFOAM version number static string. + OpenFOAM version number as a static string. Global Foam::FOAMbuild Description - OpenFOAM version number static string with build information + OpenFOAM build information as a static string + +Global + Foam::FOAMbuildArch + +Description + OpenFOAM build architecture information (endian, label/scalar sizes) + as a static string SourceFiles global.Cver @@ -48,6 +55,8 @@ SourceFiles #ifndef foamVersion_H #define foamVersion_H +#include + // The directory name for user-resources (located in the HOME directory) #define WM_USER_RESOURCE_DIRNAME ".OpenFOAM" @@ -57,6 +66,7 @@ namespace Foam { extern const char* const FOAMversion; extern const char* const FOAMbuild; + extern const std::string FOAMbuildArch; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/global/global.Cver b/src/OpenFOAM/global/global.Cver index a868495556..0c9f3fdf31 100644 --- a/src/OpenFOAM/global/global.Cver +++ b/src/OpenFOAM/global/global.Cver @@ -33,10 +33,30 @@ Description // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #include "foamVersion.H" +#include "endian.H" +#include "label.H" +#include "scalar.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // const char* const Foam::FOAMversion = "VERSION_STRING"; const char* const Foam::FOAMbuild = "BUILD_STRING"; +// Information about machine endian, label and scalar sizes +const std::string Foam::FOAMbuildArch = +( +#ifdef WM_LITTLE_ENDIAN + "LSB" +#elif defined (WM_BIG_ENDIAN) + "MSB" +#else + "???" +#endif + ";label=" + std::to_string(8*sizeof(Foam::label)) + + ";scalar=" + std::to_string(8*sizeof(Foam::scalar)) +); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // Setup an error handler for the global new operator From 1d56e9f13686dfaa525366e050522d18bbd7b499 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Mon, 3 Jul 2017 13:33:53 +0200 Subject: [PATCH 03/50] STYLE: use auto with vtkSmartPointer --- .../fieldVisualisationBase.C | 26 +++++++------------ .../functionObjectCloud.C | 6 ++--- .../functionObjectLine.C | 6 ++--- .../functionObjectSurface.C | 9 +++---- .../runTimePostProcessing/geometrySurface.C | 17 +++++------- .../graphics/runTimePostProcessing/pathline.C | 3 +-- .../runTimePostProcessing.C | 5 ++-- .../graphics/runTimePostProcessing/scene.C | 15 +++++------ .../graphics/runTimePostProcessing/surface.C | 6 ++--- .../graphics/runTimePostProcessing/text.C | 2 +- 10 files changed, 34 insertions(+), 61 deletions(-) diff --git a/src/functionObjects/graphics/runTimePostProcessing/fieldVisualisationBase.C b/src/functionObjects/graphics/runTimePostProcessing/fieldVisualisationBase.C index 1bd8614b68..3645ddbb0c 100644 --- a/src/functionObjects/graphics/runTimePostProcessing/fieldVisualisationBase.C +++ b/src/functionObjects/graphics/runTimePostProcessing/fieldVisualisationBase.C @@ -100,8 +100,7 @@ void Foam::functionObjects::fieldVisualisationBase::setColourMap lut->SetNumberOfColors(nColours); - vtkSmartPointer ctf = - vtkSmartPointer::New(); + auto ctf = vtkSmartPointer::New(); switch (colourMap_) { @@ -163,8 +162,7 @@ void Foam::functionObjects::fieldVisualisationBase::addScalarBar return; } - vtkSmartPointer sbar = - vtkSmartPointer::New(); + auto sbar = vtkSmartPointer::New(); sbar->SetLookupTable(lut); sbar->SetNumberOfLabels(scalarBar_.numberOfLabels_); @@ -174,8 +172,7 @@ void Foam::functionObjects::fieldVisualisationBase::addScalarBar // - Default scalar bar title text is scales by the scalar bar box // dimensions so if the title is a long string, the text is shrunk to fit // Instead, suppress title and set the title using a vtkTextActor - vtkSmartPointer titleActor = - vtkSmartPointer::New(); + auto titleActor = vtkSmartPointer::New(); sbar->SetTitle(" "); titleActor->SetInput(scalarBar_.title_.c_str()); titleActor->GetTextProperty()->SetFontFamilyToArial(); @@ -282,8 +279,7 @@ void Foam::functionObjects::fieldVisualisationBase::setField case cbField: { // Create look-up table for colours - vtkSmartPointer lut = - vtkSmartPointer::New(); + auto lut = vtkSmartPointer::New(); setColourMap(lut); lut->SetVectorMode(vtkScalarsToColors::MAGNITUDE); @@ -337,9 +333,8 @@ void Foam::functionObjects::fieldVisualisationBase::addGlyphs vtkRenderer* renderer ) const { - vtkSmartPointer glyph = vtkSmartPointer::New(); - vtkSmartPointer glyphMapper = - vtkSmartPointer::New(); + auto glyph = vtkSmartPointer::New(); + auto glyphMapper = vtkSmartPointer::New(); glyphMapper->SetInputConnection(glyph->GetOutputPort()); glyph->SetInputData(data); @@ -358,8 +353,7 @@ void Foam::functionObjects::fieldVisualisationBase::addGlyphs else if (data->GetCellData()->HasArray(scaleFieldNameChar) == 1) { // Need to convert cell data to point data - vtkSmartPointer cellToPoint = - vtkSmartPointer::New(); + auto cellToPoint = vtkSmartPointer::New(); cellToPoint->SetInputData(data); cellToPoint->Update(); vtkDataSet* pds = cellToPoint->GetOutput(); @@ -380,8 +374,7 @@ void Foam::functionObjects::fieldVisualisationBase::addGlyphs if (nComponents == 1) { - vtkSmartPointer sphere = - vtkSmartPointer::New(); + auto sphere = vtkSmartPointer::New(); sphere->SetCenter(0, 0, 0); sphere->SetRadius(0.5); @@ -428,8 +421,7 @@ void Foam::functionObjects::fieldVisualisationBase::addGlyphs } else if (nComponents == 3) { - vtkSmartPointer arrow = - vtkSmartPointer::New(); + auto arrow = vtkSmartPointer::New(); arrow->SetTipResolution(10); arrow->SetTipRadius(0.1); arrow->SetTipLength(0.35); diff --git a/src/functionObjects/graphics/runTimePostProcessing/functionObjectCloud.C b/src/functionObjects/graphics/runTimePostProcessing/functionObjectCloud.C index 357997df25..f4fe22be99 100644 --- a/src/functionObjects/graphics/runTimePostProcessing/functionObjectCloud.C +++ b/src/functionObjects/graphics/runTimePostProcessing/functionObjectCloud.C @@ -120,13 +120,11 @@ addGeometryToScene if (fName.ext() == "vtk") { - vtkSmartPointer points = - vtkSmartPointer::New(); + auto points = vtkSmartPointer::New(); points->SetFileName(fName.c_str()); points->Update(); - vtkSmartPointer mapper = - vtkSmartPointer::New(); + auto mapper = vtkSmartPointer::New(); actor_->SetMapper(mapper); diff --git a/src/functionObjects/graphics/runTimePostProcessing/functionObjectLine.C b/src/functionObjects/graphics/runTimePostProcessing/functionObjectLine.C index b1a9093f63..2d7fc46940 100644 --- a/src/functionObjects/graphics/runTimePostProcessing/functionObjectLine.C +++ b/src/functionObjects/graphics/runTimePostProcessing/functionObjectLine.C @@ -101,13 +101,11 @@ addGeometryToScene if (fName.ext() == "vtk") { - vtkSmartPointer lines = - vtkSmartPointer::New(); + auto lines = vtkSmartPointer::New(); lines->SetFileName(fName.c_str()); lines->Update(); - vtkSmartPointer mapper = - vtkSmartPointer::New(); + auto mapper = vtkSmartPointer::New(); setField(position, fieldName_, mapper, renderer, lines->GetOutput()); actor_->SetMapper(mapper); diff --git a/src/functionObjects/graphics/runTimePostProcessing/functionObjectSurface.C b/src/functionObjects/graphics/runTimePostProcessing/functionObjectSurface.C index 343985afa2..22b9c7570e 100644 --- a/src/functionObjects/graphics/runTimePostProcessing/functionObjectSurface.C +++ b/src/functionObjects/graphics/runTimePostProcessing/functionObjectSurface.C @@ -101,8 +101,7 @@ addGeometryToScene if (representation_ == rtGlyph) { - vtkSmartPointer surf = - vtkSmartPointer::New(); + auto surf = vtkSmartPointer::New(); surf->SetFileName(fName.c_str()); surf->Update(); @@ -121,15 +120,13 @@ addGeometryToScene { if (fName.ext() == "vtk") { - vtkSmartPointer surf = - vtkSmartPointer::New(); + auto surf = vtkSmartPointer::New(); surf->SetFileName(fName.c_str()); surf->Update(); addFeatureEdges(renderer, surf->GetOutput()); - vtkSmartPointer mapper = - vtkSmartPointer::New(); + auto mapper = vtkSmartPointer::New(); mapper->SetInputConnection(surf->GetOutputPort()); setField(position, fieldName_, mapper, renderer, surf->GetOutput()); diff --git a/src/functionObjects/graphics/runTimePostProcessing/geometrySurface.C b/src/functionObjects/graphics/runTimePostProcessing/geometrySurface.C index 19be822aa7..7c68893222 100644 --- a/src/functionObjects/graphics/runTimePostProcessing/geometrySurface.C +++ b/src/functionObjects/graphics/runTimePostProcessing/geometrySurface.C @@ -79,11 +79,9 @@ void Foam::functionObjects::runTimePostPro::geometrySurface::addGeometryToScene const Field& surfPoints = surf.points(); const Field& surfFaceNormals = surf.faceNormals(); - vtkSmartPointer points = vtkSmartPointer::New(); - vtkSmartPointer triangles = - vtkSmartPointer::New(); - vtkSmartPointer faceNormals = - vtkSmartPointer::New(); + auto points = vtkSmartPointer::New(); + auto triangles = vtkSmartPointer::New(); + auto faceNormals = vtkSmartPointer::New(); faceNormals->SetNumberOfComponents(3); @@ -97,8 +95,7 @@ void Foam::functionObjects::runTimePostPro::geometrySurface::addGeometryToScene { const Foam::face& f = surf[i]; - vtkSmartPointer triangle = - vtkSmartPointer::New(); + auto triangle = vtkSmartPointer::New(); triangle->GetPointIds()->SetId(0, f[0]); triangle->GetPointIds()->SetId(1, f[1]); triangle->GetPointIds()->SetId(2, f[2]); @@ -114,14 +111,12 @@ void Foam::functionObjects::runTimePostPro::geometrySurface::addGeometryToScene surf.clearOut(); - vtkSmartPointer polyData = - vtkSmartPointer::New(); + auto polyData = vtkSmartPointer::New(); polyData->SetPoints(points); polyData->SetPolys(triangles); polyData->GetCellData()->SetNormals(faceNormals); - vtkSmartPointer mapper = - vtkSmartPointer::New(); + auto mapper = vtkSmartPointer::New(); mapper->ScalarVisibilityOff(); mapper->SetInputData(polyData); diff --git a/src/functionObjects/graphics/runTimePostProcessing/pathline.C b/src/functionObjects/graphics/runTimePostProcessing/pathline.C index aedd860827..36c1aa9a01 100644 --- a/src/functionObjects/graphics/runTimePostProcessing/pathline.C +++ b/src/functionObjects/graphics/runTimePostProcessing/pathline.C @@ -104,8 +104,7 @@ void Foam::functionObjects::runTimePostPro::pathline::addLines } case rtTube: { - vtkSmartPointer tubes = - vtkSmartPointer::New(); + auto tubes = vtkSmartPointer::New(); tubes->SetInputData(data); tubes->SetRadius(tubeRadius_); tubes->SetNumberOfSides(20); diff --git a/src/functionObjects/graphics/runTimePostProcessing/runTimePostProcessing.C b/src/functionObjects/graphics/runTimePostProcessing/runTimePostProcessing.C index fe97eba4b3..1a2e917101 100644 --- a/src/functionObjects/graphics/runTimePostProcessing/runTimePostProcessing.C +++ b/src/functionObjects/graphics/runTimePostProcessing/runTimePostProcessing.C @@ -150,8 +150,7 @@ bool Foam::functionObjects::runTimePostProcessing::write() sigFpe::unset(false); // Initialise render window - vtkSmartPointer renderWindow = - vtkSmartPointer::New(); + auto renderWindow = vtkSmartPointer::New(); renderWindow->OffScreenRenderingOn(); renderWindow->SetSize(output_.width_, output_.height_); renderWindow->SetAAFrames(10); @@ -159,7 +158,7 @@ bool Foam::functionObjects::runTimePostProcessing::write() renderWindow->SetMultiSamples(0); // renderWindow->PolygonSmoothingOn(); - vtkSmartPointer renderer = vtkSmartPointer::New(); + auto renderer = vtkSmartPointer::New(); scene_.initialise(renderer, output_.name_); renderWindow->AddRenderer(renderer); diff --git a/src/functionObjects/graphics/runTimePostProcessing/scene.C b/src/functionObjects/graphics/runTimePostProcessing/scene.C index cd74326a16..d984e9f03b 100644 --- a/src/functionObjects/graphics/runTimePostProcessing/scene.C +++ b/src/functionObjects/graphics/runTimePostProcessing/scene.C @@ -186,20 +186,19 @@ void Foam::functionObjects::runTimePostPro::scene::initialise renderer->SetOcclusionRatio(0); // Set the camera - vtkSmartPointer camera = vtkSmartPointer::New(); + auto camera = vtkSmartPointer::New(); camera->SetParallelProjection(parallelProjection_); renderer->SetActiveCamera(camera); // Add the lights - vtkSmartPointer lightKit = vtkSmartPointer::New(); + auto lightKit = vtkSmartPointer::New(); lightKit->AddLightsToRenderer(renderer); if (!clipBox_.empty()) { const point& min = clipBox_.min(); const point& max = clipBox_.max(); - vtkSmartPointer clipBox = - vtkSmartPointer::New(); + auto clipBox = vtkSmartPointer::New(); clipBox->SetXLength(max.x() - min.x()); clipBox->SetYLength(max.y() - min.y()); clipBox->SetZLength(max.z() - min.z()); @@ -209,8 +208,7 @@ void Foam::functionObjects::runTimePostPro::scene::initialise min.y() + 0.5*(max.y() - min.y()), min.z() + 0.5*(max.z() - min.z()) ); - vtkSmartPointer clipMapper = - vtkSmartPointer::New(); + auto clipMapper = vtkSmartPointer::New(); clipMapper->SetInputConnection(clipBox->GetOutputPort()); clipBoxActor_ = vtkSmartPointer::New(); @@ -401,8 +399,7 @@ void Foam::functionObjects::runTimePostPro::scene::saveImage renderWindow->Render(); // Set up off-screen rendering - vtkSmartPointer windowToImageFilter = - vtkSmartPointer::New(); + auto windowToImageFilter = vtkSmartPointer::New(); windowToImageFilter->SetInput(renderWindow); @@ -414,7 +411,7 @@ void Foam::functionObjects::runTimePostPro::scene::saveImage windowToImageFilter->Update(); // Save the image - vtkSmartPointer writer = vtkSmartPointer::New(); + auto writer = vtkSmartPointer::New(); fileName fName(prefix/outputName_ + '.' + frameIndexStr() + ".png"); writer->SetFileName(fName.c_str()); writer->SetInputConnection(windowToImageFilter->GetOutputPort()); diff --git a/src/functionObjects/graphics/runTimePostProcessing/surface.C b/src/functionObjects/graphics/runTimePostProcessing/surface.C index 5c0383c4ab..222760c456 100644 --- a/src/functionObjects/graphics/runTimePostProcessing/surface.C +++ b/src/functionObjects/graphics/runTimePostProcessing/surface.C @@ -120,8 +120,7 @@ void Foam::functionObjects::runTimePostPro::surface::addFeatureEdges return; } - vtkSmartPointer featureEdges = - vtkSmartPointer::New(); + auto featureEdges = vtkSmartPointer::New(); featureEdges->SetInputData(data); featureEdges->BoundaryEdgesOn(); featureEdges->FeatureEdgesOn(); @@ -131,8 +130,7 @@ void Foam::functionObjects::runTimePostPro::surface::addFeatureEdges featureEdges->ColoringOff(); featureEdges->Update(); - vtkSmartPointer mapper = - vtkSmartPointer::New(); + auto mapper = vtkSmartPointer::New(); mapper->SetInputConnection(featureEdges->GetOutputPort()); mapper->ScalarVisibilityOff(); diff --git a/src/functionObjects/graphics/runTimePostProcessing/text.C b/src/functionObjects/graphics/runTimePostProcessing/text.C index fc395f5717..f83d31118f 100644 --- a/src/functionObjects/graphics/runTimePostProcessing/text.C +++ b/src/functionObjects/graphics/runTimePostProcessing/text.C @@ -81,7 +81,7 @@ void Foam::functionObjects::runTimePostPro::text::addGeometryToScene return; } - vtkSmartPointer actor = vtkSmartPointer::New(); + auto actor = vtkSmartPointer::New(); // Concatenate string with timeStamp if true string textAndTime = string_; From aefb7395840a672fe1b48210ea21e7378fc74619 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Mon, 3 Jul 2017 12:15:41 +0200 Subject: [PATCH 04/50] STYLE: fix permissions on files, remove unused files --- .../multiphaseSystem/multiphaseSystem.H | 4 --- .../multiphaseSystem/multiphaseSystemI.H | 28 ------------------- .../preProcessing/setAlphaField/Make/files | 0 .../preProcessing/setAlphaField/Make/options | 0 .../constant/panelRegion/radiationProperties | 0 .../panelRegion/thermophysicalProperties | 0 .../compartmentFire/system/blockMeshDict.m4 | 0 .../system/panelRegion/decomposeParDict | 0 .../system/panelRegion/fvSchemes | 0 .../system/panelRegion/fvSolution | 0 .../rhoPimpleFoam/laminar/sineWaveDamping/0/p | 0 .../sphereDrop/0.orig/pointDisplacement | 0 12 files changed, 32 deletions(-) delete mode 100644 applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystemI.H mode change 100755 => 100644 applications/utilities/preProcessing/setAlphaField/Make/files mode change 100755 => 100644 applications/utilities/preProcessing/setAlphaField/Make/options mode change 100755 => 100644 tutorials/combustion/fireFoam/LES/compartmentFire/constant/panelRegion/radiationProperties mode change 100755 => 100644 tutorials/combustion/fireFoam/LES/compartmentFire/constant/panelRegion/thermophysicalProperties mode change 100755 => 100644 tutorials/combustion/fireFoam/LES/compartmentFire/system/blockMeshDict.m4 mode change 100755 => 100644 tutorials/combustion/fireFoam/LES/compartmentFire/system/panelRegion/decomposeParDict mode change 100755 => 100644 tutorials/combustion/fireFoam/LES/compartmentFire/system/panelRegion/fvSchemes mode change 100755 => 100644 tutorials/combustion/fireFoam/LES/compartmentFire/system/panelRegion/fvSolution mode change 100755 => 100644 tutorials/compressible/rhoPimpleFoam/laminar/sineWaveDamping/0/p mode change 100755 => 100644 tutorials/multiphase/compressibleInterDyMFoam/laminar/sphereDrop/0.orig/pointDisplacement diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.H b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.H index dca55bf873..57a5afcb41 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.H @@ -207,10 +207,6 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "multiphaseSystemI.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - #endif // ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystemI.H b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystemI.H deleted file mode 100644 index b4ea367451..0000000000 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystemI.H +++ /dev/null @@ -1,28 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -// ************************************************************************* // diff --git a/applications/utilities/preProcessing/setAlphaField/Make/files b/applications/utilities/preProcessing/setAlphaField/Make/files old mode 100755 new mode 100644 diff --git a/applications/utilities/preProcessing/setAlphaField/Make/options b/applications/utilities/preProcessing/setAlphaField/Make/options old mode 100755 new mode 100644 diff --git a/tutorials/combustion/fireFoam/LES/compartmentFire/constant/panelRegion/radiationProperties b/tutorials/combustion/fireFoam/LES/compartmentFire/constant/panelRegion/radiationProperties old mode 100755 new mode 100644 diff --git a/tutorials/combustion/fireFoam/LES/compartmentFire/constant/panelRegion/thermophysicalProperties b/tutorials/combustion/fireFoam/LES/compartmentFire/constant/panelRegion/thermophysicalProperties old mode 100755 new mode 100644 diff --git a/tutorials/combustion/fireFoam/LES/compartmentFire/system/blockMeshDict.m4 b/tutorials/combustion/fireFoam/LES/compartmentFire/system/blockMeshDict.m4 old mode 100755 new mode 100644 diff --git a/tutorials/combustion/fireFoam/LES/compartmentFire/system/panelRegion/decomposeParDict b/tutorials/combustion/fireFoam/LES/compartmentFire/system/panelRegion/decomposeParDict old mode 100755 new mode 100644 diff --git a/tutorials/combustion/fireFoam/LES/compartmentFire/system/panelRegion/fvSchemes b/tutorials/combustion/fireFoam/LES/compartmentFire/system/panelRegion/fvSchemes old mode 100755 new mode 100644 diff --git a/tutorials/combustion/fireFoam/LES/compartmentFire/system/panelRegion/fvSolution b/tutorials/combustion/fireFoam/LES/compartmentFire/system/panelRegion/fvSolution old mode 100755 new mode 100644 diff --git a/tutorials/compressible/rhoPimpleFoam/laminar/sineWaveDamping/0/p b/tutorials/compressible/rhoPimpleFoam/laminar/sineWaveDamping/0/p old mode 100755 new mode 100644 diff --git a/tutorials/multiphase/compressibleInterDyMFoam/laminar/sphereDrop/0.orig/pointDisplacement b/tutorials/multiphase/compressibleInterDyMFoam/laminar/sphereDrop/0.orig/pointDisplacement old mode 100755 new mode 100644 From efc21270eaf7047f40e5b840aa8b942be5c097b6 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Wed, 5 Jul 2017 09:15:52 +0200 Subject: [PATCH 05/50] STYLE: regExp with explicit constructor - use separate constructor for ignore-case option (cf. wordRe treatment) - constructors/destructor now inline. --- src/OSspecific/POSIX/regExp.C | 32 ------------- src/OSspecific/POSIX/regExp.H | 28 ++++++----- src/OSspecific/POSIX/regExpI.H | 48 +++++++++++++++++++ .../starcd/STARCDsurfaceFormatCore.C | 12 ++--- 4 files changed, 70 insertions(+), 50 deletions(-) diff --git a/src/OSspecific/POSIX/regExp.C b/src/OSspecific/POSIX/regExp.C index 95e70ece9d..0f9cd7cb21 100644 --- a/src/OSspecific/POSIX/regExp.C +++ b/src/OSspecific/POSIX/regExp.C @@ -77,38 +77,6 @@ bool Foam::regExp::matchGrouping } -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::regExp::regExp() -: - preg_(nullptr) -{} - - -Foam::regExp::regExp(const char* pattern, bool ignoreCase) -: - preg_(nullptr) -{ - set(pattern, ignoreCase); -} - - -Foam::regExp::regExp(const std::string& pattern, bool ignoreCase) -: - preg_(nullptr) -{ - set(pattern.c_str(), ignoreCase); -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::regExp::~regExp() -{ - clear(); -} - - // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // bool Foam::regExp::set(const char* pattern, bool ignoreCase) diff --git a/src/OSspecific/POSIX/regExp.H b/src/OSspecific/POSIX/regExp.H index 640f6a819e..1f82552d07 100644 --- a/src/OSspecific/POSIX/regExp.H +++ b/src/OSspecific/POSIX/regExp.H @@ -77,7 +77,7 @@ class regExp //- Return true if it matches and sets the sub-groups matched. bool matchGrouping ( - const std::string&, + const std::string& text, List& groups ) const; @@ -99,17 +99,23 @@ public: // Constructors //- Construct null - regExp(); + inline regExp(); + + //- Construct from character array + inline explicit regExp(const char* pattern); + + //- Construct from string + inline explicit regExp(const std::string& pattern); //- Construct from character array, optionally ignore case - regExp(const char* pattern, bool ignoreCase=false); + inline regExp(const char* pattern, bool ignoreCase); //- Construct from string, optionally ignore case - regExp(const std::string& pattern, bool ignoreCase=false); + inline regExp(const std::string& pattern, bool ignoreCase); //- Destructor - ~regExp(); + inline ~regExp(); // Member functions @@ -143,20 +149,20 @@ public: // Matching/Searching - //- Find position within string. - // \Return The index where it begins or string::npos if not found + //- Find position within the text. + // \return The index where it begins or string::npos if not found std::string::size_type find(const std::string& text) const; - //- Return true if it matches the entire string + //- True if the regex matches the entire text. // The begin-of-line (^) and end-of-line ($) anchors are implicit bool match(const std::string& text) const; - //- Return true if it matches and sets the sub-groups matched + //- True if the regex matches the text, set the sub-groups matched. // The begin-of-line (^) and end-of-line ($) anchors are implicit bool match(const std::string& text, List& groups) const; - //- Return true if the regex was found within string - bool search(const std::string& text) const; + //- Return true if the regex was found within the text + inline bool search(const std::string& text) const; // Member Operators diff --git a/src/OSspecific/POSIX/regExpI.H b/src/OSspecific/POSIX/regExpI.H index e33564e611..7302e02410 100644 --- a/src/OSspecific/POSIX/regExpI.H +++ b/src/OSspecific/POSIX/regExpI.H @@ -38,6 +38,54 @@ inline bool Foam::regExp::meta(const char c) } +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +inline Foam::regExp::regExp() +: + preg_(nullptr) +{} + + +inline Foam::regExp::regExp(const char* pattern) +: + preg_(nullptr) +{ + set(pattern, false); +} + + +inline Foam::regExp::regExp(const std::string& pattern) +: + preg_(nullptr) +{ + set(pattern, false); +} + + +inline Foam::regExp::regExp(const char* pattern, bool ignoreCase) +: + preg_(nullptr) +{ + set(pattern, ignoreCase); +} + + +inline Foam::regExp::regExp(const std::string& pattern, bool ignoreCase) +: + preg_(nullptr) +{ + set(pattern, ignoreCase); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +inline Foam::regExp::~regExp() +{ + clear(); +} + + // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // inline bool Foam::regExp::empty() const diff --git a/src/surfMesh/surfaceFormats/starcd/STARCDsurfaceFormatCore.C b/src/surfMesh/surfaceFormats/starcd/STARCDsurfaceFormatCore.C index b926f96802..71b3751c8c 100644 --- a/src/surfMesh/surfaceFormats/starcd/STARCDsurfaceFormatCore.C +++ b/src/surfMesh/surfaceFormats/starcd/STARCDsurfaceFormatCore.C @@ -26,7 +26,7 @@ License #include "STARCDsurfaceFormatCore.H" #include "clock.H" #include "regExp.H" -#include "IStringStream.H" +#include "IFstream.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -47,7 +47,7 @@ Foam::fileFormats::STARCDsurfaceFormatCore::readInpCellTable return lookup; } - regExp ctnameRE + const regExp ctnameRE ( " *CTNA[^ ]*" // keyword - min 4 chars "[[:space:]]+" // space delimited @@ -64,13 +64,11 @@ Foam::fileFormats::STARCDsurfaceFormatCore::readInpCellTable if (ctnameRE.match(line, groups)) { const label tableId = atoi(groups[0].c_str()); + const word tableName = word::validated(groups[1]); - // strip bad chars - string::stripInvalid(groups[1]); - - if (!groups[1].empty()) + if (!tableName.empty()) { - lookup.insert(tableId, groups[1]); + lookup.insert(tableId, tableName); } } } From 1bcb454f6daa8b92144791a02cee98faa79a6244 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Wed, 5 Jul 2017 10:46:50 +0200 Subject: [PATCH 06/50] STYLE: hash constructors with power-of-two - use 1024 instead of 1000 since it will be changed internally to 1024 anyhow. --- applications/test/PackedList2/Test-PackedList2.C | 2 +- .../utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C | 4 ++-- .../surface/surfaceMeshTriangulate/surfaceMeshTriangulate.C | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/applications/test/PackedList2/Test-PackedList2.C b/applications/test/PackedList2/Test-PackedList2.C index 26981b484f..ce9b15ed51 100644 --- a/applications/test/PackedList2/Test-PackedList2.C +++ b/applications/test/PackedList2/Test-PackedList2.C @@ -54,7 +54,7 @@ int main(int argc, char *argv[]) std::vector stlVector(n, true); labelHashSet emptyHash; - labelHashSet fullHash(1000); + labelHashSet fullHash(1024); for (label i = 0; i < n; i++) { fullHash.insert(i); diff --git a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C index 3e91747415..28d5d4dfc6 100644 --- a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C +++ b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C @@ -393,7 +393,7 @@ void extractSurface // Collect sizes. Hash on names to handle local-only patches (e.g. // processor patches) - HashTable