diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C b/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C index 3570aebd80..6a6581182b 100644 --- a/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C +++ b/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C @@ -43,7 +43,7 @@ Foam::autoPtr Foam::PDRDragModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(modelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown PDRDragModel type " diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModelNew.C b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModelNew.C index 82411751fb..932080e717 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModelNew.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModelNew.C @@ -42,7 +42,7 @@ Foam::autoPtr Foam::XiEqModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(modelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown XiEqModel type " diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModelNew.C b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModelNew.C index 0d7f1afcfb..27fe3f5e17 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModelNew.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModelNew.C @@ -42,7 +42,7 @@ Foam::autoPtr Foam::XiGModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(modelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown XiGModel type " diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModelNew.C b/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModelNew.C index a317eb50ec..ed9dfb2fb3 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModelNew.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModelNew.C @@ -45,7 +45,7 @@ Foam::autoPtr Foam::XiModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(modelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown XiModel type " diff --git a/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/mixtureViscosityModel/mixtureViscosityModelNew.C b/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/mixtureViscosityModel/mixtureViscosityModelNew.C index b36e3f6e77..99c33123e8 100644 --- a/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/mixtureViscosityModel/mixtureViscosityModelNew.C +++ b/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/mixtureViscosityModel/mixtureViscosityModelNew.C @@ -44,7 +44,7 @@ Foam::autoPtr Foam::mixtureViscosityModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(modelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown mixtureViscosityModel type " diff --git a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C index 103ad496b7..cf8abd2e6e 100644 --- a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C +++ b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C @@ -111,7 +111,7 @@ Foam::autoPtr Foam::relativeVelocityModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(modelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown time scale model type " << modelType diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/newtemperaturePhaseChangeTwoPhaseMixture.C b/applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/newtemperaturePhaseChangeTwoPhaseMixture.C index 88497f6222..e4d71d2397 100644 --- a/applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/newtemperaturePhaseChangeTwoPhaseMixture.C +++ b/applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/newtemperaturePhaseChangeTwoPhaseMixture.C @@ -63,7 +63,7 @@ Foam::temperaturePhaseChangeTwoPhaseMixture::New componentsConstructorTablePtr_ ->find(temperaturePhaseChangeTwoPhaseMixtureTypeName); - if (cstrIter == componentsConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown temperaturePhaseChangeTwoPhaseMixture type " diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C index 0825368e5c..c14fa08d59 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C @@ -60,7 +60,7 @@ Foam::phaseChangeTwoPhaseMixture::New componentsConstructorTablePtr_ ->find(phaseChangeTwoPhaseMixtureTypeName); - if (cstrIter == componentsConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown phaseChangeTwoPhaseMixture type " diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C index 3bdd49ec7a..b880c4a6d3 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C @@ -44,7 +44,7 @@ Foam::autoPtr Foam::dragModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(dragModelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown dragModelType type " diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C index deabfc900f..b43d46f8a3 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C @@ -48,7 +48,7 @@ Foam::autoPtr Foam::heatTransferModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(heatTransferModelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown heatTransferModelType type " diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/diameterModels/diameterModel/newDiameterModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/diameterModels/diameterModel/newDiameterModel.C index ef872df0cc..963ad160f7 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/diameterModels/diameterModel/newDiameterModel.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/diameterModels/diameterModel/newDiameterModel.C @@ -46,7 +46,7 @@ Foam::autoPtr Foam::diameterModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(diameterModelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown diameterModelType type " diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/newInterfaceCompositionModel.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/newInterfaceCompositionModel.C index 16b3055687..fee1253108 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/newInterfaceCompositionModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/newInterfaceCompositionModel.C @@ -52,7 +52,7 @@ Foam::interfaceCompositionModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(interfaceCompositionModelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown interfaceCompositionModelType type " diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/massTransferModels/massTransferModel/newMassTransferModel.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/massTransferModels/massTransferModel/newMassTransferModel.C index 1251c98fe0..3b349be693 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/massTransferModels/massTransferModel/newMassTransferModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/massTransferModels/massTransferModel/newMassTransferModel.C @@ -42,7 +42,7 @@ Foam::autoPtr Foam::massTransferModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(massTransferModelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown massTransferModelType type " diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/saturationModel/newSaturationModel.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/saturationModel/newSaturationModel.C index 920d7c62c8..17fc43cac4 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/saturationModel/newSaturationModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/saturationModel/newSaturationModel.C @@ -40,7 +40,7 @@ Foam::autoPtr Foam::saturationModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(saturationModelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown saturationModelType type " diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/newSurfaceTensionModel.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/newSurfaceTensionModel.C index 82359c0508..f14c0da92f 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/newSurfaceTensionModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/newSurfaceTensionModel.C @@ -43,7 +43,7 @@ Foam::surfaceTensionModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(surfaceTensionModelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown surfaceTensionModelType type " diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/newAspectRatioModel.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/newAspectRatioModel.C index 568c1b2682..2946810cf5 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/newAspectRatioModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/newAspectRatioModel.C @@ -43,7 +43,7 @@ Foam::aspectRatioModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(aspectRatioModelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown aspectRatioModelType type " diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C index e077e31b2d..c2a5f4074e 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C @@ -42,7 +42,7 @@ Foam::autoPtr Foam::dragModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(dragModelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown dragModelType type " diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C index 8cdb07f297..46e43f6b11 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C @@ -42,7 +42,7 @@ Foam::autoPtr Foam::heatTransferModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(heatTransferModelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown heatTransferModelType type " diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/liftModel/newLiftModel.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/liftModel/newLiftModel.C index 3da4caee7c..8dbdd5479c 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/liftModel/newLiftModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/liftModel/newLiftModel.C @@ -42,7 +42,7 @@ Foam::autoPtr Foam::liftModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(liftModelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown liftModelType type " diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/newSwarmCorrection.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/newSwarmCorrection.C index a7181b4396..fb16d05418 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/newSwarmCorrection.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/newSwarmCorrection.C @@ -43,7 +43,7 @@ Foam::swarmCorrection::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(swarmCorrectionType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown swarmCorrectionType type " diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/newTurbulentDispersionModel.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/newTurbulentDispersionModel.C index e440e3d1ee..53266ae6b2 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/newTurbulentDispersionModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/newTurbulentDispersionModel.C @@ -43,7 +43,7 @@ Foam::turbulentDispersionModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(turbulentDispersionModelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown turbulentDispersionModelType type " diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/newVirtualMassModel.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/newVirtualMassModel.C index 4c4ced9ddc..1b092c197e 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/newVirtualMassModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/newVirtualMassModel.C @@ -42,7 +42,7 @@ Foam::autoPtr Foam::virtualMassModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(virtualMassModelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown virtualMassModelType type " diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/wallDampingModel/newWallDampingModel.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/wallDampingModel/newWallDampingModel.C index a5b0748679..83ad7b42e5 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/wallDampingModel/newWallDampingModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/wallDampingModel/newWallDampingModel.C @@ -42,7 +42,7 @@ Foam::autoPtr Foam::wallDampingModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(wallDampingModelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown wallDampingModelType type " diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/newWallLubricationModel.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/newWallLubricationModel.C index 08dfd7065d..806a1dd3b3 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/newWallLubricationModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/newWallLubricationModel.C @@ -42,7 +42,7 @@ Foam::autoPtr Foam::wallLubricationModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(wallLubricationModelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown wallLubricationModelType type " 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 e288235568..cbb33a5fbd 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/blendingMethod/newBlendingMethod.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/blendingMethod/newBlendingMethod.C @@ -41,7 +41,7 @@ Foam::autoPtr Foam::blendingMethod::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(blendingMethodType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown blendingMethodType type " diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/newDiameterModel.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/newDiameterModel.C index ef872df0cc..963ad160f7 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/newDiameterModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/newDiameterModel.C @@ -46,7 +46,7 @@ Foam::autoPtr Foam::diameterModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(diameterModelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown diameterModelType type " diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/newPhaseModel.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/newPhaseModel.C index 6c1ca526db..c42b86070d 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/newPhaseModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/newPhaseModel.C @@ -43,7 +43,7 @@ Foam::autoPtr Foam::phaseModel::New phaseSystemConstructorTable::iterator cstrIter = phaseSystemConstructorTablePtr_->find(phaseModelType); - if (cstrIter == phaseSystemConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown phaseModelType type " diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/newMultiphaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/newMultiphaseSystem.C index 7ee24aa1aa..0f116c7040 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/newMultiphaseSystem.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/newMultiphaseSystem.C @@ -54,7 +54,7 @@ Foam::autoPtr Foam::multiphaseSystem::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(multiphaseSystemType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown multiphaseSystemType type " 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 45301ef6f8..dcc0cc0d0f 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 @@ -41,7 +41,7 @@ Foam::wallBoilingModels::departureDiameterModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(departureDiameterModelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown departureDiameterModelType type " 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 4902b32915..13987ff4b0 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 @@ -41,7 +41,7 @@ Foam::wallBoilingModels::departureFrequencyModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(departureFrequencyModelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown departureFrequencyModelType type " 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 486597787d..32f2d5a520 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 @@ -41,7 +41,7 @@ Foam::wallBoilingModels::nucleationSiteModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(nucleationSiteModelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown nucleationSiteModelType type " 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 adfa944c9d..6cf6d1d64c 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 @@ -41,7 +41,7 @@ Foam::wallBoilingModels::partitioningModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(partitioningModelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown partitioningModelType type " 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 a878a09773..bfadfc6399 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 @@ -41,7 +41,7 @@ Foam::kineticTheoryModels::conductivityModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(conductivityModelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalError << "conductivityModel::New(const dictionary&) : " << endl 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 db6102174a..b68c03470f 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 @@ -41,7 +41,7 @@ Foam::kineticTheoryModels::frictionalStressModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(frictionalStressModelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalError << "frictionalStressModel::New(const dictionary&) : " << endl 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 36b2c2b175..a1ce25337f 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 @@ -41,7 +41,7 @@ Foam::kineticTheoryModels::granularPressureModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(granularPressureModelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalError << "granularPressureModel::New(const dictionary&) : " << endl 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 65f6c9ebb8..583ce1c3ad 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 @@ -41,7 +41,7 @@ Foam::kineticTheoryModels::radialModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(radialModelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalError << "radialModel::New(const dictionary&) : " << endl 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 e79cbde0c1..361850b414 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 @@ -41,7 +41,7 @@ Foam::kineticTheoryModels::viscosityModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(viscosityModelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalError << "viscosityModel::New(const dictionary&) : " << endl 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 dd110902b1..dfbd95e6b2 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 @@ -53,7 +53,7 @@ Foam::diameterModels::IATEsource::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(type); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown IATE source type " diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/newTwoPhaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/newTwoPhaseSystem.C index 5477ae7c58..c2ca635873 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/newTwoPhaseSystem.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/newTwoPhaseSystem.C @@ -54,7 +54,7 @@ Foam::autoPtr Foam::twoPhaseSystem::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(twoPhaseSystemType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown twoPhaseSystemType type " diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/newAspectRatioModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/newAspectRatioModel.C index 568c1b2682..2946810cf5 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/newAspectRatioModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/newAspectRatioModel.C @@ -43,7 +43,7 @@ Foam::aspectRatioModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(aspectRatioModelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown aspectRatioModelType type " diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C index e077e31b2d..c2a5f4074e 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C @@ -42,7 +42,7 @@ Foam::autoPtr Foam::dragModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(dragModelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown dragModelType type " diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C index 8cdb07f297..46e43f6b11 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C @@ -42,7 +42,7 @@ Foam::autoPtr Foam::heatTransferModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(heatTransferModelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown heatTransferModelType type " diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/liftModel/newLiftModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/liftModel/newLiftModel.C index 3da4caee7c..8dbdd5479c 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/liftModel/newLiftModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/liftModel/newLiftModel.C @@ -42,7 +42,7 @@ Foam::autoPtr Foam::liftModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(liftModelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown liftModelType type " diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/newSwarmCorrection.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/newSwarmCorrection.C index a7181b4396..fb16d05418 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/newSwarmCorrection.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/newSwarmCorrection.C @@ -43,7 +43,7 @@ Foam::swarmCorrection::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(swarmCorrectionType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown swarmCorrectionType type " diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/newTurbulentDispersionModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/newTurbulentDispersionModel.C index e440e3d1ee..53266ae6b2 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/newTurbulentDispersionModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/newTurbulentDispersionModel.C @@ -43,7 +43,7 @@ Foam::turbulentDispersionModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(turbulentDispersionModelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown turbulentDispersionModelType type " diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/newVirtualMassModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/newVirtualMassModel.C index 4c4ced9ddc..1b092c197e 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/newVirtualMassModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/newVirtualMassModel.C @@ -42,7 +42,7 @@ Foam::autoPtr Foam::virtualMassModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(virtualMassModelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown virtualMassModelType type " diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/newWallLubricationModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/newWallLubricationModel.C index 08dfd7065d..806a1dd3b3 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/newWallLubricationModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/newWallLubricationModel.C @@ -42,7 +42,7 @@ Foam::autoPtr Foam::wallLubricationModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(wallLubricationModelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown wallLubricationModelType type " 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 a878a09773..bfadfc6399 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C @@ -41,7 +41,7 @@ Foam::kineticTheoryModels::conductivityModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(conductivityModelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalError << "conductivityModel::New(const dictionary&) : " << endl 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 db6102174a..b68c03470f 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C @@ -41,7 +41,7 @@ Foam::kineticTheoryModels::frictionalStressModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(frictionalStressModelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalError << "frictionalStressModel::New(const dictionary&) : " << endl 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 36b2c2b175..a1ce25337f 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C @@ -41,7 +41,7 @@ Foam::kineticTheoryModels::granularPressureModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(granularPressureModelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalError << "granularPressureModel::New(const dictionary&) : " << endl 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 65f6c9ebb8..583ce1c3ad 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/newRadialModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/newRadialModel.C @@ -41,7 +41,7 @@ Foam::kineticTheoryModels::radialModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(radialModelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalError << "radialModel::New(const dictionary&) : " << endl 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 e79cbde0c1..361850b414 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C @@ -41,7 +41,7 @@ Foam::kineticTheoryModels::viscosityModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(viscosityModelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalError << "viscosityModel::New(const dictionary&) : " << endl 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 e288235568..cbb33a5fbd 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/blendingMethod/newBlendingMethod.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/blendingMethod/newBlendingMethod.C @@ -41,7 +41,7 @@ Foam::autoPtr Foam::blendingMethod::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(blendingMethodType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown blendingMethodType type " 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 27fd28d68d..fc011ece0c 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 @@ -54,7 +54,7 @@ Foam::diameterModels::IATEsource::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(type); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown IATE source type " diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/diameterModel/newDiameterModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/diameterModel/newDiameterModel.C index ef872df0cc..963ad160f7 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/diameterModel/newDiameterModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/diameterModel/newDiameterModel.C @@ -46,7 +46,7 @@ Foam::autoPtr Foam::diameterModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(diameterModelType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown diameterModelType type " diff --git a/applications/test/HashTable/Test-hashTable.C b/applications/test/HashTable/Test-hashTable.C index 8352a88ae0..5dd3ca0fa4 100644 --- a/applications/test/HashTable/Test-hashTable.C +++ b/applications/test/HashTable/Test-hashTable.C @@ -234,6 +234,97 @@ int main() Info<<"\ntable1: " << table1 << endl; + // Start again + HashTable table1start + { + {"aaa", 1.0}, + {"aba", 2.0}, + {"a_ca", 3.0}, + {"ada", 4.0}, + {"aeq_", 5.0}, + {"aaw", 6.0}, + {"abs", 7.0}, + {"a_cr", 8.0}, + {"adx", 9.0}, + {"ae_c", 10.0} + }; + + table1 = table1start; + Info<< "\ntable has keys: " + << flatOutput(table1.sortedToc()) << nl; + + wordRe matcher(".*_.*", wordRe::REGEX); + table1.filterKeys + ( + [&matcher](const word& k){ return matcher.match(k); } + ); + Info<< "retain things matching " << matcher << " => " + << flatOutput(table1.sortedToc()) << nl; + + table1 = table1start; + table1.filterKeys + ( + [&matcher](const word& k){ return matcher.match(k); }, + true + ); + + Info<< "prune things matching " << matcher << " => " + << flatOutput(table1.sortedToc()) << nl; + + // Same, without a lambda + table1 = table1start; + table1.filterKeys(matcher, true); + + Info<< "prune things matching " << matcher << " => " + << flatOutput(table1.sortedToc()) << nl; + + + // Same idea, but inverted logic inside the lambda + table1 = table1start; + table1.filterKeys + ( + [&matcher](const word& k){ return !matcher.match(k); }, + true + ); + + Info<< "prune things matching " << matcher << " => " + << flatOutput(table1.sortedToc()) << nl; + + + table1 = table1start; + Info<< "\ntable:" << table1 << nl; + + table1.filterValues + ( + [](const scalar& v){ return (v >= 5); } + ); + + Info<< "\ntable with values >= 5:" << table1 << nl; + + table1 = table1start; + Info<< "\ntable:" << table1 << nl; + + table1.filterEntries + ( + [&matcher](const word& k, const scalar& v) + { + return matcher(k) && (v >= 5); + } + ); + + Info<< "\ntable with values >= 5 and matching " << matcher + << table1 << nl; + + + table1 = table1start; + Info<< "\ntable:" << table1 << nl; + Info<< "has " + << table1.countValues([](const scalar& v) { return v >= 7; }) + << " values >= 7 with these keys: " + << table1.tocValues([](const scalar& v) { return v >= 7; }) + << nl; + + Info<< "\nDone\n"; return 0; diff --git a/applications/test/IOobjectList/Make/files b/applications/test/IOobjectList/Make/files new file mode 100644 index 0000000000..c09b00ecaa --- /dev/null +++ b/applications/test/IOobjectList/Make/files @@ -0,0 +1,3 @@ +Test-IOobjectList.C + +EXE = $(FOAM_USER_APPBIN)/Test-IOobjectList diff --git a/applications/test/IOobjectList/Make/options b/applications/test/IOobjectList/Make/options new file mode 100644 index 0000000000..d9745f69a0 --- /dev/null +++ b/applications/test/IOobjectList/Make/options @@ -0,0 +1,3 @@ +EXE_INC = -I$(LIB_SRC)/finiteVolume/lnInclude + +EXE_LIBS = -lfiniteVolume diff --git a/applications/test/IOobjectList/Test-IOobjectList.C b/applications/test/IOobjectList/Test-IOobjectList.C new file mode 100644 index 0000000000..27bd495950 --- /dev/null +++ b/applications/test/IOobjectList/Test-IOobjectList.C @@ -0,0 +1,104 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2017 OpenCFD Ltd. + \\/ 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 . + +Description + Basic tests of IOobjectList +\*---------------------------------------------------------------------------*/ + +#include "argList.H" +#include "Time.H" +#include "volFields.H" +#include "timeSelector.H" +#include "IOobjectList.H" +#include "hashedWordList.H" + +using namespace Foam; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Main program: + +int main(int argc, char *argv[]) +{ + argList::noParallel(); + argList::addOption("re", "wordReList"); + + // timeSelector::addOptions(); + timeSelector::addOptions(true, true); + + #include "setRootCase.H" + #include "createTime.H" + + wordReList matcher; + if (args.optionFound("re")) + { + matcher = args.optionReadList("re"); + Info<<"limit names: " << matcher << nl; + + } + + const hashedWordList subsetTypes + { + volScalarField::typeName, + volScalarField::Internal::typeName, + volVectorField::typeName, + }; + + + instantList timeDirs = timeSelector::select0(runTime, args); + + forAll(timeDirs, timeI) + { + runTime.setTime(timeDirs[timeI], timeI); + + // Objects at this time + IOobjectList objects(runTime, runTime.timeName()); + HashTable classes = + ( + matcher.size() + ? objects.classes(matcher) + : objects.classes() + ); + + Info<< "Time: " << runTime.timeName() << nl; + + Info<<"Name: " << flatOutput(objects.sortedNames()) << nl + <<"Objects: " << objects << nl + <<"Classes: " << classes << nl; + + classes.filterKeys(subsetTypes); + Info<<"only retain: " << flatOutput(subsetTypes) << nl; + Info<<"Pruned: " << classes << nl; + + classes = objects.classes(); + classes.erase(subsetTypes); + Info<<"remove: " << flatOutput(subsetTypes) << nl; + Info<<"Pruned: " << classes << nl; + } + + Info<< "\nEnd\n" << endl; + + return 0; +} + + +// ************************************************************************* // diff --git a/applications/test/fileName/Test-fileName.C b/applications/test/fileName/Test-fileName.C index 18f89b6db0..5de8912bd8 100644 --- a/applications/test/fileName/Test-fileName.C +++ b/applications/test/fileName/Test-fileName.C @@ -180,9 +180,9 @@ int main(int argc, char *argv[]) // A regex with a zero length matcher doesn't work at all: // eg "(png|jpg|txt|)" regex matcher itself - wordRe matcher0("()", wordRe::REGEXP); - wordRe matcher1("(png|jpg|txt)", wordRe::REGEXP); - wordRe matcher2("(png|txt)", wordRe::REGEXP); + wordRe matcher0("()", wordRe::REGEX); + wordRe matcher1("(png|jpg|txt)", wordRe::REGEX); + wordRe matcher2("(png|txt)", wordRe::REGEX); Info<<"Has extension(s):" << nl << "input: " << endWithDot << nl; diff --git a/applications/test/predicates/Make/files b/applications/test/predicates/Make/files new file mode 100644 index 0000000000..6197f71dfa --- /dev/null +++ b/applications/test/predicates/Make/files @@ -0,0 +1,3 @@ +Test-predicates.C + +EXE = $(FOAM_USER_APPBIN)/Test-predicates diff --git a/applications/test/predicates/Make/options b/applications/test/predicates/Make/options new file mode 100644 index 0000000000..9d6f459ad8 --- /dev/null +++ b/applications/test/predicates/Make/options @@ -0,0 +1 @@ +/**/ diff --git a/applications/test/predicates/Test-predicates.C b/applications/test/predicates/Test-predicates.C new file mode 100644 index 0000000000..9b9e77ddbb --- /dev/null +++ b/applications/test/predicates/Test-predicates.C @@ -0,0 +1,112 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2017 OpenCFD Ltd. + \\/ 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 . + +Application + Test-predicates + +Description + Simple tests using predicates + +\*---------------------------------------------------------------------------*/ + +#include "IOstreams.H" +#include "labelList.H" +#include "wordList.H" +#include "predicates.H" +#include "FlatOutput.H" +#include "regExp.H" + +using namespace Foam; + + +template +label printMatching(const ListType& list, const UnaryPredicate& pred) +{ + label count = 0; + + Info<< "("; + + for (const auto& val : list) + { + if (pred(val)) + { + if (count) Info<< ' '; + Info<< val; + ++count; + } + } + + Info<< ") => " << count << nl; + + return count; +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Main program: + +int main(int argc, char *argv[]) +{ + wordList words + { + "abc", + "def", + "hij", + "abc_", + "def_", + "hij_", + }; + + labelRange range(-10, 40); + labelList values(range.begin(), range.end()); + + Info<<"words: " << flatOutput(words) << endl; + Info<<"values: " << flatOutput(values) << endl; + + regExp matcher(".*_.*"); + + Info<<"With '_': "; + printMatching(words, matcher); + + Info<<"All: "; + printMatching(words, predicates::always()); + + Info<<"None: "; + printMatching(words, predicates::never()); + + Info<<"Neg values: "; + printMatching(values, [](const label v) { return v < 0; }); + + Info<<"Even values: "; + printMatching(values, [](const label v) { return !(v % 2); }); + + Info<<"All: "; + printMatching(values, predicates::always()); + + Info<<"None: "; + printMatching(values, predicates::never()); + + return 0; +} + +// ************************************************************************* // diff --git a/applications/test/wordRe/Test-wordRe.C b/applications/test/wordRe/Test-wordRe.C index f5dfcda831..be1af08a54 100644 --- a/applications/test/wordRe/Test-wordRe.C +++ b/applications/test/wordRe/Test-wordRe.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 | + \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -30,7 +30,10 @@ Description #include "IFstream.H" #include "List.H" #include "Tuple2.H" +#include "keyType.H" #include "wordRe.H" +#include "wordRes.H" +#include "predicates.H" using namespace Foam; @@ -44,12 +47,37 @@ int main(int argc, char *argv[]) Foam::string s2("this .* file"); const char * s3 = "this .* file"; + keyType keyre("x.*", true); + + wordReList wordrelist + { + {"this", wordRe::LITERAL}, + {"x.*", wordRe::REGEX}, + {"file[a-b]", wordRe::REGEX}, + }; + + wordRes wrelist(wordrelist); + + Info<< "re-list:" << wrelist() << endl; + Info<< "match this: " << wrelist("this") << endl; + Info<< "match xyz: " << wrelist("xyz") << endl; + Info<< "match zyx: " << wrelist("zyx") << endl; + Info<< "match xyz: " << wrelist.match("xyz") << endl; + Info<< "match any: " << predicates::always()("any junk") << endl; + Info<< "keyre match: " << keyre("xyz") << endl; + Info<< "string match: " << string("this").match("xyz") << endl; + Info<< "string match: " << string("x.*")("xyz") << endl; + Info<< "string match: " << string("x.*")(keyre) << endl; + wordRe(s1, wordRe::DETECT).info(Info) << endl; wordRe(s2).info(Info) << endl; wordRe(s2, wordRe::DETECT).info(Info) << endl; - wordRe(s3, wordRe::REGEXP).info(Info) << endl; + wordRe(s3, wordRe::REGEX).info(Info) << endl; wre = "this .* file"; + + Info<<"substring: " << wre(4) << endl; + wre.info(Info) << endl; wre = s1; wre.info(Info) << endl; 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 4551fe2c6f..15604c8867 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 @@ -90,7 +90,7 @@ Foam::cellSizeAndAlignmentControl::New cellSizeAndAlignmentControlTypeName ); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown cellSizeAndAlignmentControl type " 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 3e6860c7a5..9a0333e970 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 @@ -133,7 +133,7 @@ Foam::autoPtr Foam::cellSizeFunction::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(cellSizeFunctionTypeName); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown cellSizeFunction type " 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 2e925b9b32..93aa04c5ab 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 @@ -71,7 +71,7 @@ Foam::autoPtr Foam::cellSizeCalculationType::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(cellSizeCalculationTypeTypeName); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown cellSizeCalculationType type " 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 33d7267d7d..ac6c12ce6b 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 @@ -75,7 +75,7 @@ Foam::autoPtr Foam::surfaceCellSizeFunction::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(surfaceCellSizeFunctionTypeName); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown surfaceCellSizeFunction type " 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 0aa043cb1e..151a0b7884 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/faceAreaWeightModel/faceAreaWeightModel/faceAreaWeightModel.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/faceAreaWeightModel/faceAreaWeightModel/faceAreaWeightModel.C @@ -68,7 +68,7 @@ autoPtr faceAreaWeightModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(faceAreaWeightModelTypeName); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown faceAreaWeightModel type " 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 d7b93caba4..3cca22c751 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/initialPointsMethod/initialPointsMethod/initialPointsMethod.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/initialPointsMethod/initialPointsMethod/initialPointsMethod.C @@ -94,7 +94,7 @@ autoPtr initialPointsMethod::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(initialPointsMethodTypeName); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown initialPointsMethod type " 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 c06c5ed969..b968dd2ebe 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/relaxationModel/relaxationModel/relaxationModel.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/relaxationModel/relaxationModel/relaxationModel.C @@ -71,7 +71,7 @@ autoPtr relaxationModel::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(relaxationModelTypeName); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown relaxationModel type " diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/searchableSurfaceFeatures/searchableSurfaceFeatures.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/searchableSurfaceFeatures/searchableSurfaceFeatures.C index 16dc56814d..b35c37df1a 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/searchableSurfaceFeatures/searchableSurfaceFeatures.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/searchableSurfaceFeatures/searchableSurfaceFeatures.C @@ -48,7 +48,7 @@ Foam::searchableSurfaceFeatures::New dictConstructorTable::iterator cstrIter = dictConstructorTablePtr_->find(searchableSurfaceFeaturesType); - if (cstrIter == dictConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown searchableSurfaceFeatures type " diff --git a/applications/utilities/mesh/manipulation/createBaffles/faceSelection/faceSelection.C b/applications/utilities/mesh/manipulation/createBaffles/faceSelection/faceSelection.C index 84a7cea3c1..dd66f694aa 100644 --- a/applications/utilities/mesh/manipulation/createBaffles/faceSelection/faceSelection.C +++ b/applications/utilities/mesh/manipulation/createBaffles/faceSelection/faceSelection.C @@ -71,7 +71,7 @@ Foam::autoPtr Foam::faceSelection::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(sampleType); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { FatalErrorInFunction << "Unknown faceSelection type " diff --git a/applications/utilities/mesh/manipulation/subsetMesh/subsetMesh.C b/applications/utilities/mesh/manipulation/subsetMesh/subsetMesh.C index 4e03eb9cc8..2947edb02b 100644 --- a/applications/utilities/mesh/manipulation/subsetMesh/subsetMesh.C +++ b/applications/utilities/mesh/manipulation/subsetMesh/subsetMesh.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. @@ -112,7 +112,7 @@ labelList nearestPatch(const polyMesh& mesh, const labelList& patchIDs) { WarningInFunction << "Did not visit some faces, e.g. face " << faceI - << " at " << mesh.faceCentres()[faceI] << endl + << " at " << mesh.faceCentres()[faceI] << nl << "Using patch " << patchIDs[0] << " as nearest" << endl; haveWarned = true; @@ -129,57 +129,38 @@ labelList nearestPatch(const polyMesh& mesh, const labelList& patchIDs) } -template -void subsetVolFields +// +// Subset field-type, availability information cached +// in the availableFields hashtable. +// +template class PatchField, class GeoMesh> +void subsetFields ( const fvMeshSubset& subsetter, - const wordList& fieldNames, - PtrList>& subFields + HashTable& availableFields, + PtrList>& subFields ) { + typedef GeometricField FieldType; + const word fieldType = FieldType::typeName; + + const wordList fieldNames = availableFields(fieldType).sortedToc(); + subFields.setSize(fieldNames.size()); + const fvMesh& baseMesh = subsetter.baseMesh(); + if (fieldNames.empty()) + { + return; + } + Info<< "Subsetting " << fieldType << " ("; forAll(fieldNames, i) { const word& fieldName = fieldNames[i]; + if (i) Info<< ' '; + Info<< fieldName; - Info<< "Subsetting field " << fieldName << endl; - - GeometricField fld - ( - IOobject - ( - fieldName, - baseMesh.time().timeName(), - baseMesh, - IOobject::MUST_READ, - IOobject::NO_WRITE - ), - baseMesh - ); - - subFields.set(i, subsetter.interpolate(fld)); - } -} - - -template -void subsetSurfaceFields -( - const fvMeshSubset& subsetter, - const wordList& fieldNames, - PtrList>& subFields -) -{ - const fvMesh& baseMesh = subsetter.baseMesh(); - - forAll(fieldNames, i) - { - const word& fieldName = fieldNames[i]; - - Info<< "Subsetting field " << fieldName << endl; - - GeometricField fld + FieldType fld ( IOobject ( @@ -193,7 +174,11 @@ void subsetSurfaceFields ); subFields.set(i, subsetter.interpolate(fld)); + + // Subsetting adds 'subset' prefix - rename to match original. + subFields[i].rename(fieldName); } + Info<< ")" << nl; } @@ -202,19 +187,30 @@ void subsetPointFields ( const fvMeshSubset& subsetter, const pointMesh& pMesh, - const wordList& fieldNames, + HashTable& availableFields, PtrList>& subFields ) { + typedef GeometricField FieldType; + const word fieldType = FieldType::typeName; + + const wordList fieldNames = availableFields(fieldType).sortedToc(); + subFields.setSize(fieldNames.size()); + const fvMesh& baseMesh = subsetter.baseMesh(); + if (fieldNames.empty()) + { + return; + } + Info<< "Subsetting " << fieldType << " ("; forAll(fieldNames, i) { const word& fieldName = fieldNames[i]; + if (i) Info<< ' '; + Info<< fieldName; - Info<< "Subsetting field " << fieldName << endl; - - GeometricField fld + FieldType fld ( IOobject ( @@ -228,7 +224,11 @@ void subsetPointFields ); subFields.set(i, subsetter.interpolate(fld)); + + // Subsetting adds 'subset' prefix - rename to match original. + subFields[i].rename(fieldName); } + Info<< ")" << nl; } @@ -236,19 +236,30 @@ template void subsetDimensionedFields ( const fvMeshSubset& subsetter, - const wordList& fieldNames, + HashTable& availableFields, PtrList>& subFields ) { + typedef DimensionedField FieldType; + const word fieldType = FieldType::typeName; + + const wordList fieldNames = availableFields(fieldType).sortedToc(); + subFields.setSize(fieldNames.size()); + const fvMesh& baseMesh = subsetter.baseMesh(); + if (fieldNames.empty()) + { + return; + } + Info<< "Subsetting " << fieldType << " ("; forAll(fieldNames, i) { const word& fieldName = fieldNames[i]; + if (i) Info<< ' '; + Info<< fieldName; - Info<< "Subsetting field " << fieldName << endl; - - DimensionedField fld + FieldType fld ( IOobject ( @@ -262,7 +273,11 @@ void subsetDimensionedFields ); subFields.set(i, subsetter.interpolate(fld)); + + // Subsetting adds 'subset' prefix - rename to match original. + subFields[i].rename(fieldName); } + Info<< ")" << nl; } @@ -289,7 +304,7 @@ void subsetTopoSets // Map the data PackedBoolList isSet(set.maxSize(mesh)); - forAllConstIter(labelHashSet, set, iter) + forAllConstIters(set, iter) { isSet[iter.key()] = true; } @@ -359,7 +374,6 @@ int main(int argc, char *argv[]) #include "createNamedMesh.H" - const word setName = args[1]; word meshInstance = mesh.pointsInstance(); @@ -378,7 +392,7 @@ int main(int argc, char *argv[]) } - Info<< "Reading cell set from " << setName << endl << endl; + Info<< "Reading cell set from " << setName << nl << endl; // Create mesh subsetting engine fvMeshSubset subsetter(mesh); @@ -389,11 +403,7 @@ int main(int argc, char *argv[]) { const word patchName = args["patch"]; - exposedPatchIDs = labelList - ( - 1, - mesh.boundaryMesh().findPatchID(patchName) - ); + exposedPatchIDs = { mesh.boundaryMesh().findPatchID(patchName) }; if (exposedPatchIDs[0] == -1) { @@ -402,8 +412,8 @@ int main(int argc, char *argv[]) << exit(FatalError); } - Info<< "Adding exposed internal faces to patch " << patchName << endl - << endl; + Info<< "Adding exposed internal faces to patch " << patchName + << nl << endl; } else if (args.optionFound("patches")) { @@ -412,14 +422,14 @@ int main(int argc, char *argv[]) exposedPatchIDs = mesh.boundaryMesh().patchSet(patchNames).sortedToc(); Info<< "Adding exposed internal faces to nearest of patches " - << patchNames << endl << endl; + << patchNames << nl << endl; } else { Info<< "Adding exposed internal faces to a patch called" << " \"oldInternalFaces\" (created if necessary)" << endl << endl; - exposedPatchIDs = labelList(1, label(-1)); + exposedPatchIDs = { -1 }; } @@ -431,7 +441,6 @@ int main(int argc, char *argv[]) } else { - // Find per face the nearest patch labelList nearestExposedPatch(nearestPatch(mesh, exposedPatchIDs)); @@ -454,77 +463,45 @@ int main(int argc, char *argv[]) IOobjectList objects(mesh, runTime.timeName()); + HashTable availableFields = objects.classes(); // Read vol fields and subset // ~~~~~~~~~~~~~~~~~~~~~~~~~~ - wordList scalarNames(objects.names(volScalarField::typeName)); - PtrList scalarFlds(scalarNames.size()); - subsetVolFields(subsetter, scalarNames, scalarFlds); + PtrList scalarFlds; + subsetFields(subsetter, availableFields, scalarFlds); - wordList vectorNames(objects.names(volVectorField::typeName)); - PtrList vectorFlds(vectorNames.size()); - subsetVolFields(subsetter, vectorNames, vectorFlds); + PtrList vectorFlds; + subsetFields(subsetter, availableFields, vectorFlds); - wordList sphericalTensorNames - ( - objects.names(volSphericalTensorField::typeName) - ); - PtrList sphericalTensorFlds - ( - sphericalTensorNames.size() - ); - subsetVolFields(subsetter, sphericalTensorNames, sphericalTensorFlds); + PtrList sphTensorFlds; + subsetFields(subsetter, availableFields, sphTensorFlds); - wordList symmTensorNames(objects.names(volSymmTensorField::typeName)); - PtrList symmTensorFlds(symmTensorNames.size()); - subsetVolFields(subsetter, symmTensorNames, symmTensorFlds); + PtrList symmTensorFlds; + subsetFields(subsetter, availableFields, symmTensorFlds); - wordList tensorNames(objects.names(volTensorField::typeName)); - PtrList tensorFlds(tensorNames.size()); - subsetVolFields(subsetter, tensorNames, tensorFlds); + PtrList tensorFlds; + subsetFields(subsetter, availableFields, tensorFlds); // Read surface fields and subset // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - wordList surfScalarNames(objects.names(surfaceScalarField::typeName)); - PtrList surfScalarFlds(surfScalarNames.size()); - subsetSurfaceFields(subsetter, surfScalarNames, surfScalarFlds); + PtrList surfScalarFlds; + subsetFields(subsetter, availableFields, surfScalarFlds); - wordList surfVectorNames(objects.names(surfaceVectorField::typeName)); - PtrList surfVectorFlds(surfVectorNames.size()); - subsetSurfaceFields(subsetter, surfVectorNames, surfVectorFlds); + PtrList surfVectorFlds; + subsetFields(subsetter, availableFields, surfVectorFlds); - wordList surfSphericalTensorNames - ( - objects.names(surfaceSphericalTensorField::typeName) - ); - PtrList surfSphericalTensorFlds - ( - surfSphericalTensorNames.size() - ); - subsetSurfaceFields - ( - subsetter, - surfSphericalTensorNames, - surfSphericalTensorFlds - ); + PtrList surfSphTensorFlds; + subsetFields(subsetter, availableFields, surfSphTensorFlds); - wordList surfSymmTensorNames - ( - objects.names(surfaceSymmTensorField::typeName) - ); - PtrList surfSymmTensorFlds - ( - surfSymmTensorNames.size() - ); - subsetSurfaceFields(subsetter, surfSymmTensorNames, surfSymmTensorFlds); + PtrList surfSymmTensorFlds; + subsetFields(subsetter, availableFields, surfSymmTensorFlds); - wordList surfTensorNames(objects.names(surfaceTensorField::typeName)); - PtrList surfTensorFlds(surfTensorNames.size()); - subsetSurfaceFields(subsetter, surfTensorNames, surfTensorFlds); + PtrList surfTensorFlds; + subsetFields(subsetter, availableFields, surfTensorFlds); // Read point fields and subset @@ -532,86 +509,39 @@ int main(int argc, char *argv[]) const pointMesh& pMesh = pointMesh::New(mesh); - wordList pointScalarNames(objects.names(pointScalarField::typeName)); - PtrList pointScalarFlds(pointScalarNames.size()); - subsetPointFields(subsetter, pMesh, pointScalarNames, pointScalarFlds); + PtrList pointScalarFlds; + subsetPointFields(subsetter, pMesh, availableFields, pointScalarFlds); - wordList pointVectorNames(objects.names(pointVectorField::typeName)); - PtrList pointVectorFlds(pointVectorNames.size()); - subsetPointFields(subsetter, pMesh, pointVectorNames, pointVectorFlds); + PtrList pointVectorFlds; + subsetPointFields(subsetter, pMesh, availableFields, pointVectorFlds); - wordList pointSphericalTensorNames - ( - objects.names(pointSphericalTensorField::typeName) - ); - PtrList pointSphericalTensorFlds - ( - pointSphericalTensorNames.size() - ); - subsetPointFields - ( - subsetter, - pMesh, - pointSphericalTensorNames, - pointSphericalTensorFlds - ); + PtrList pointSphTensorFlds; + subsetPointFields(subsetter, pMesh, availableFields, pointSphTensorFlds); - wordList pointSymmTensorNames - ( - objects.names(pointSymmTensorField::typeName) - ); - PtrList pointSymmTensorFlds - ( - pointSymmTensorNames.size() - ); - subsetPointFields - ( - subsetter, - pMesh, - pointSymmTensorNames, - pointSymmTensorFlds - ); + PtrList pointSymmTensorFlds; + subsetPointFields(subsetter, pMesh, availableFields, pointSymmTensorFlds); - wordList pointTensorNames(objects.names(pointTensorField::typeName)); - PtrList pointTensorFlds(pointTensorNames.size()); - subsetPointFields(subsetter, pMesh, pointTensorNames, pointTensorFlds); + PtrList pointTensorFlds; + subsetPointFields(subsetter, pMesh, availableFields, pointTensorFlds); // Read dimensioned fields and subset // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - typedef volScalarField::Internal dimScalType; - wordList scalarDimNames(objects.names(dimScalType::typeName)); - PtrList scalarDimFlds(scalarDimNames.size()); - subsetDimensionedFields(subsetter, scalarDimNames, scalarDimFlds); + PtrList scalarDimFlds; + subsetDimensionedFields(subsetter, availableFields, scalarDimFlds); - typedef volVectorField::Internal dimVecType; - wordList vectorDimNames(objects.names(dimVecType::typeName)); - PtrList vectorDimFlds(vectorDimNames.size()); - subsetDimensionedFields(subsetter, vectorDimNames, vectorDimFlds); + PtrList vectorDimFlds; + subsetDimensionedFields(subsetter, availableFields, vectorDimFlds); - typedef volSphericalTensorField::Internal dimSphereType; - wordList sphericalTensorDimNames(objects.names(dimSphereType::typeName)); - PtrList sphericalTensorDimFlds - ( - sphericalTensorDimNames.size() - ); - subsetDimensionedFields - ( - subsetter, - sphericalTensorDimNames, - sphericalTensorDimFlds - ); + PtrList sphTensorDimFlds; + subsetDimensionedFields(subsetter, availableFields, sphTensorDimFlds); - typedef volSymmTensorField::Internal dimSymmTensorType; - wordList symmTensorDimNames(objects.names(dimSymmTensorType::typeName)); - PtrList symmTensorDimFlds(symmTensorDimNames.size()); - subsetDimensionedFields(subsetter, symmTensorDimNames, symmTensorDimFlds); + PtrList symmTensorDimFlds; + subsetDimensionedFields(subsetter, availableFields, symmTensorDimFlds); - typedef volTensorField::Internal dimTensorType; - wordList tensorDimNames(objects.names(dimTensorType::typeName)); - PtrList tensorDimFlds(tensorDimNames.size()); - subsetDimensionedFields(subsetter, tensorDimNames, tensorDimFlds); + PtrList tensorDimFlds; + subsetDimensionedFields(subsetter, availableFields, tensorDimFlds); // topoSets and subset @@ -620,6 +550,7 @@ int main(int argc, char *argv[]) PtrList cellSets; PtrList faceSets; PtrList pointSets; + { IOobjectList objects(mesh, mesh.facesInstance(), "polyMesh/sets"); objects.remove(currentSet); @@ -650,7 +581,6 @@ int main(int argc, char *argv[]) } - // Write mesh and fields to new time // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -668,123 +598,100 @@ int main(int argc, char *argv[]) subsetter.subMesh().setInstance(runTime.timeName()); } - - Info<< "Writing subsetted mesh and fields to time " << runTime.timeName() << endl; subsetter.subMesh().write(); processorMeshes::removeFiles(subsetter.subMesh()); - // Subsetting adds 'subset' prefix. Rename field to be like original. + // Volume fields forAll(scalarFlds, i) { - scalarFlds[i].rename(scalarNames[i]); scalarFlds[i].write(); } forAll(vectorFlds, i) { - vectorFlds[i].rename(vectorNames[i]); vectorFlds[i].write(); } - forAll(sphericalTensorFlds, i) + forAll(sphTensorFlds, i) { - sphericalTensorFlds[i].rename(sphericalTensorNames[i]); - sphericalTensorFlds[i].write(); + sphTensorFlds[i].write(); } forAll(symmTensorFlds, i) { - symmTensorFlds[i].rename(symmTensorNames[i]); symmTensorFlds[i].write(); } forAll(tensorFlds, i) { - tensorFlds[i].rename(tensorNames[i]); tensorFlds[i].write(); } - // Surface ones. + // Surface fields. forAll(surfScalarFlds, i) { - surfScalarFlds[i].rename(surfScalarNames[i]); surfScalarFlds[i].write(); } forAll(surfVectorFlds, i) { - surfVectorFlds[i].rename(surfVectorNames[i]); surfVectorFlds[i].write(); } - forAll(surfSphericalTensorFlds, i) + forAll(surfSphTensorFlds, i) { - surfSphericalTensorFlds[i].rename(surfSphericalTensorNames[i]); - surfSphericalTensorFlds[i].write(); + surfSphTensorFlds[i].write(); } forAll(surfSymmTensorFlds, i) { - surfSymmTensorFlds[i].rename(surfSymmTensorNames[i]); surfSymmTensorFlds[i].write(); } - forAll(surfTensorNames, i) + forAll(surfTensorFlds, i) { - surfTensorFlds[i].rename(surfTensorNames[i]); surfTensorFlds[i].write(); } - // Point ones + // Point fields forAll(pointScalarFlds, i) { - pointScalarFlds[i].rename(pointScalarNames[i]); pointScalarFlds[i].write(); } forAll(pointVectorFlds, i) { - pointVectorFlds[i].rename(pointVectorNames[i]); pointVectorFlds[i].write(); } - forAll(pointSphericalTensorFlds, i) + forAll(pointSphTensorFlds, i) { - pointSphericalTensorFlds[i].rename(pointSphericalTensorNames[i]); - pointSphericalTensorFlds[i].write(); + pointSphTensorFlds[i].write(); } forAll(pointSymmTensorFlds, i) { - pointSymmTensorFlds[i].rename(pointSymmTensorNames[i]); pointSymmTensorFlds[i].write(); } - forAll(pointTensorNames, i) + forAll(pointTensorFlds, i) { - pointTensorFlds[i].rename(pointTensorNames[i]); pointTensorFlds[i].write(); } - // DimensionedFields + // Dimensioned fields forAll(scalarDimFlds, i) { - scalarDimFlds[i].rename(scalarDimNames[i]); scalarDimFlds[i].write(); } forAll(vectorDimFlds, i) { - vectorDimFlds[i].rename(vectorDimNames[i]); vectorDimFlds[i].write(); } - forAll(sphericalTensorDimFlds, i) + forAll(sphTensorDimFlds, i) { - sphericalTensorDimFlds[i].rename(sphericalTensorDimNames[i]); - sphericalTensorDimFlds[i].write(); + sphTensorDimFlds[i].write(); } forAll(symmTensorDimFlds, i) { - symmTensorDimFlds[i].rename(symmTensorDimNames[i]); symmTensorDimFlds[i].write(); } forAll(tensorDimFlds, i) { - tensorDimFlds[i].rename(tensorDimNames[i]); tensorDimFlds[i].write(); } - Info<< "End\n" << endl; return 0; diff --git a/applications/utilities/miscellaneous/foamHelp/helpTypes/doxygenXmlParser/doxygenXmlParser.C b/applications/utilities/miscellaneous/foamHelp/helpTypes/doxygenXmlParser/doxygenXmlParser.C index 0de175b4b7..bc67aabd7f 100644 --- a/applications/utilities/miscellaneous/foamHelp/helpTypes/doxygenXmlParser/doxygenXmlParser.C +++ b/applications/utilities/miscellaneous/foamHelp/helpTypes/doxygenXmlParser/doxygenXmlParser.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "doxygenXmlParser.H" -#include "wordRe.H" +#include "regExp.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -40,8 +40,8 @@ Foam::doxygenXmlParser::doxygenXmlParser dictionary(dictionary::null) { // Pre-construct and compile regular expressions - const wordRe nameRe(".*.H", wordRe::DETECT); - const wordRe searchStrRe(searchStr, wordRe::DETECT); + const regExp nameRe(".*.H"); + const regExp searchStrRe(searchStr); // Pre-construct constant strings and names to speed-up comparisons const string slashStartTag('/' + startTag); @@ -163,7 +163,7 @@ Foam::doxygenXmlParser::doxygenXmlParser ( !exactMatch && !found(tName) // not already added - && wordRe(".*" + tName + ".*", wordRe::DETECT).match(name) + && regExp(".*" + tName + ".*").match(name) ) { dictionary dict(dictionary::null); diff --git a/applications/utilities/miscellaneous/foamHelp/helpTypes/helpType/helpTypeNew.C b/applications/utilities/miscellaneous/foamHelp/helpTypes/helpType/helpTypeNew.C index c6e45dd688..3feb5f8659 100644 --- a/applications/utilities/miscellaneous/foamHelp/helpTypes/helpType/helpTypeNew.C +++ b/applications/utilities/miscellaneous/foamHelp/helpTypes/helpType/helpTypeNew.C @@ -37,7 +37,7 @@ Foam::autoPtr Foam::helpType::New dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(helpTypeName); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + if (!cstrIter.found()) { // special treatment for -help // exit without stack trace diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/checkData.H b/applications/utilities/postProcessing/dataConversion/foamToEnsight/checkData.H index f33a8f727f..62cb39030b 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/checkData.H +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/checkData.H @@ -23,7 +23,7 @@ if (!fieldsToUse.found(fieldName)) ).typeHeaderOk(false, false) ); - if (variableGood) + if (!variableGood) { break; } diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/findCloudFields.H b/applications/utilities/postProcessing/dataConversion/foamToEnsight/findCloudFields.H index a37bbb7c09..89e1084abc 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/findCloudFields.H +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/findCloudFields.H @@ -35,36 +35,25 @@ if (timeDirs.size() && !noLagrangian) cloudPrefix/cloudName ); - // clouds always require "positions" + // Clouds always have "positions" if (cloudObjs.found("positions")) { - HashTable>::iterator cloudIter = - cloudFields.find(cloudName); + // Save the cloud fields on a per cloud basis + auto fieldsPerCloud = cloudFields(cloudName); - if (cloudIter == cloudFields.end()) + forAllConstIters(cloudObjs, fieldIter) { - // A newly discovered cloud - cloudFields.insert(cloudName, HashTable()); - cloudIter = cloudFields.find(cloudName); - } + const IOobject* obj = fieldIter(); - forAllConstIter(IOobjectList, cloudObjs, fieldIter) - { - const IOobject& obj = *fieldIter(); - - // Add field and field type - cloudIter().insert - ( - obj.name(), - obj.headerClassName() - ); + // Field name/type + fieldsPerCloud.insert(obj->name(), obj->headerClassName()); } } } } - // prune out "positions" again since it gets treated specially - forAllIter(HashTable>, cloudFields, cloudIter) + // Prune out "positions" again since it gets treated specially + forAllIters(cloudFields, cloudIter) { cloudIter().erase("positions"); } @@ -76,18 +65,13 @@ if (timeDirs.size() && !noLagrangian) } -// sorted list of cloud names +// Sorted list of cloud names const wordList cloudNames(cloudFields.sortedToc()); if (cloudNames.size()) { - // complete the echo information - Info<< "("; - forAll(cloudNames, cloudNo) - { - Info<< ' ' << cloudNames[cloudNo]; - } - Info<< " ) " << endl; + // Complete the echo information - as flatOutput + cloudNames.writeList(Info) << endl; } // ************************************************************************* // diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C b/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C index 5080d840eb..2c411b5cf5 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.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. @@ -78,6 +78,7 @@ Note #include "fvc.H" #include "volFields.H" +#include "hashedWordList.H" #include "labelIOField.H" #include "scalarIOField.H" @@ -190,7 +191,7 @@ int main(int argc, char *argv[]) ); // The volume field types that we handle - const wordList volFieldTypes + const hashedWordList volFieldTypes { volScalarField::typeName, volVectorField::typeName, @@ -207,7 +208,7 @@ int main(int argc, char *argv[]) #include "setRootCase.H" - // default to binary output, unless otherwise specified + // Default to binary output, unless otherwise specified const IOstream::streamFormat format = ( args.optionFound("ascii") @@ -234,7 +235,7 @@ int main(int argc, char *argv[]) } // - // general (case) output options + // General (case) output options // ensightCase::options caseOpts(format); @@ -257,7 +258,7 @@ int main(int argc, char *argv[]) // - // output configuration (geometry related) + // Output configuration (geometry related) // ensightMesh::options writeOpts(format); writeOpts.noPatches(args.optionFound("noPatches")); @@ -313,12 +314,6 @@ int main(int argc, char *argv[]) ensCase.printInfo(Info) << endl; } - - // Set Time to the last time before looking for lagrangian objects - runTime.setTime(timeDirs.last(), timeDirs.size()-1); - - IOobjectList objects(mesh, runTime.timeName()); - #include "checkMeshMoving.H" #include "findCloudFields.H" @@ -331,6 +326,40 @@ int main(int argc, char *argv[]) << timer.cpuTimeIncrement() << " s, " << mem.update().size() << " kB" << nl << endl; + // Get the list of supported classes/fields + HashTable usableObjects; + { + // Initially all possible objects that are available at the final time + IOobjectList objects(mesh, timeDirs.last().name()); + + // Categorize by classes, pre-filter on name (if requested) + usableObjects = + ( + fieldPatterns.empty() + ? objects.classes() + : objects.classes(fieldPatterns) + ); + + // Limit to types that we explicitly handle + usableObjects.filterKeys(volFieldTypes); + + // Force each field-type into existence (simplifies code logic + // and doesn't cost much) and simultaneously remove all + // "*_0" restart fields + + for (auto fieldType : volFieldTypes) + { + usableObjects + ( + fieldType + ).filterKeys + ( + [](const word& k){ return k.endsWith("_0"); }, + true // prune + ); + } + } + // ignore special fields (_0 fields), // ignore fields we don't handle, // ignore fields that are not available for all time-steps @@ -362,25 +391,22 @@ int main(int argc, char *argv[]) // ~~~~~~~~~~~~~~~~~~~~~~ Info<< "Write volume field ("; - forAll(volFieldTypes, typei) + for (auto fieldType : volFieldTypes) { - const word& fieldType = volFieldTypes[typei]; - wordList fieldNames = objects.names(fieldType); + // For convenience, just force each field-type into existence. + // This simplifies code logic and doesn't cost much at all. + wordHashSet& fieldNames = usableObjects(fieldType); - // Filter on name as required - if (!fieldPatterns.empty()) + forAllIters(fieldNames, fieldIter) { - inplaceSubsetStrings(fieldPatterns, fieldNames); - } - - forAll(fieldNames, fieldi) - { - const word& fieldName = fieldNames[fieldi]; + const word& fieldName = fieldIter.key(); #include "checkData.H" + // Partially complete field? if (!fieldsToUse[fieldName]) { + fieldNames.erase(fieldIter); continue; } @@ -597,7 +623,8 @@ int main(int argc, char *argv[]) } else { - // Do not currently handle this type - blacklist for the future. + // Do not currently handle this type + // - blacklist for the future. fieldsToUse.set(fieldName, false); } diff --git a/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK.C b/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK.C index c2a6f3b298..602f68b2d0 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK.C +++ b/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK.C @@ -199,7 +199,7 @@ void print(Ostream& os, const wordList& flds) labelList getSelectedPatches ( const polyBoundaryMesh& patches, - const List& excludePatches + const wordRes& excludePatches ) { DynamicList