diff --git a/applications/solvers/combustion/PDRFoam/createFields.H b/applications/solvers/combustion/PDRFoam/createFields.H index 84155c4849..c0602016c8 100644 --- a/applications/solvers/combustion/PDRFoam/createFields.H +++ b/applications/solvers/combustion/PDRFoam/createFields.H @@ -165,7 +165,7 @@ IOdictionary PDRProperties autoPtr drag = PDRDragModel::New ( PDRProperties, - turbulence, + *turbulence, rho, U, phi @@ -176,7 +176,7 @@ autoPtr flameWrinkling = XiModel::New ( PDRProperties, thermo, - turbulence, + *turbulence, Su, rho, b, diff --git a/applications/solvers/combustion/chemFoam/createSingleCellMesh.H b/applications/solvers/combustion/chemFoam/createSingleCellMesh.H index a43af46326..d65e45f44e 100644 --- a/applications/solvers/combustion/chemFoam/createSingleCellMesh.H +++ b/applications/solvers/combustion/chemFoam/createSingleCellMesh.H @@ -1,8 +1,5 @@ Info<< "Constructing single cell mesh" << nl << endl; -labelList owner(6, label(0)); -labelList neighbour(0); - pointField points(8); points[0] = vector(0, 0, 0); points[1] = vector(1, 0, 0); @@ -24,10 +21,10 @@ fvMesh mesh runTime, IOobject::READ_IF_PRESENT ), - xferMove(points), - faces.xfer(), - owner.xfer(), - neighbour.xfer() + std::move(points), + std::move(faces), + labelList(6, Zero), // owner + labelList() // neighbour ); List patches(1); diff --git a/applications/solvers/incompressible/pimpleFoam/overPimpleDyMFoam/correctPhi.H b/applications/solvers/incompressible/pimpleFoam/overPimpleDyMFoam/correctPhi.H index e5bbcadc67..1d8b670811 100644 --- a/applications/solvers/incompressible/pimpleFoam/overPimpleDyMFoam/correctPhi.H +++ b/applications/solvers/incompressible/pimpleFoam/overPimpleDyMFoam/correctPhi.H @@ -101,7 +101,7 @@ if (mesh.changing()) pcorrEqn.setReferences ( validCells, - scalarList(validCells.size(), 0.0), + scalar(0.0), true ); } diff --git a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.H b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.H index aefdbdee4f..b84ce6a7fa 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.H +++ b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.H @@ -89,22 +89,22 @@ public: const rhoThermo& thermo1() const { - return thermo1_(); + return *thermo1_; } const rhoThermo& thermo2() const { - return thermo2_(); + return *thermo2_; } rhoThermo& thermo1() { - return thermo1_(); + return *thermo1_; } rhoThermo& thermo2() { - return thermo2_(); + return *thermo2_; } //- Correct the thermodynamics of each phase diff --git a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/phaseModel/phaseModel.C b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/phaseModel/phaseModel.C index c97a5a1382..007b8206ae 100644 --- a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/phaseModel/phaseModel.C +++ b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/phaseModel/phaseModel.C @@ -81,7 +81,7 @@ Foam::phaseModel::phaseModel Foam::autoPtr Foam::phaseModel::clone() const { NotImplemented; - return autoPtr(nullptr); + return autoPtr(); } diff --git a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/phaseModel/phaseModel.H b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/phaseModel/phaseModel.H index 66d0ac8d63..253b7fb07a 100644 --- a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/phaseModel/phaseModel.H +++ b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/phaseModel/phaseModel.H @@ -100,7 +100,7 @@ public: autoPtr operator()(Istream& is) const { - return autoPtr(new phaseModel(is, p_, T_)); + return autoPtr::New(is, p_, T_); } }; @@ -120,13 +120,13 @@ public: //- Return const-access to phase rhoThermo const rhoThermo& thermo() const { - return thermo_(); + return *thermo_; } //- Return access to phase rhoThermo rhoThermo& thermo() { - return thermo_(); + return *thermo_; } //- Return const-access to phase divergence diff --git a/applications/solvers/multiphase/driftFluxFoam/incompressibleTwoPhaseInteractingMixture/incompressibleTwoPhaseInteractingMixture.H b/applications/solvers/multiphase/driftFluxFoam/incompressibleTwoPhaseInteractingMixture/incompressibleTwoPhaseInteractingMixture.H index 0950bbaba0..d790264fef 100644 --- a/applications/solvers/multiphase/driftFluxFoam/incompressibleTwoPhaseInteractingMixture/incompressibleTwoPhaseInteractingMixture.H +++ b/applications/solvers/multiphase/driftFluxFoam/incompressibleTwoPhaseInteractingMixture/incompressibleTwoPhaseInteractingMixture.H @@ -106,13 +106,13 @@ public: //- Return const-access to the mixture viscosityModel const mixtureViscosityModel& muModel() const { - return muModel_(); + return *muModel_; } //- Return const-access to the continuous-phase viscosityModel const viscosityModel& nucModel() const { - return nucModel_(); + return *nucModel_; } //- Return const-access to the dispersed-phase density diff --git a/applications/solvers/multiphase/interFoam/interMixingFoam/incompressibleThreePhaseMixture/incompressibleThreePhaseMixture.H b/applications/solvers/multiphase/interFoam/interMixingFoam/incompressibleThreePhaseMixture/incompressibleThreePhaseMixture.H index 58341e6cad..393c388d9f 100644 --- a/applications/solvers/multiphase/interFoam/interMixingFoam/incompressibleThreePhaseMixture/incompressibleThreePhaseMixture.H +++ b/applications/solvers/multiphase/interFoam/interMixingFoam/incompressibleThreePhaseMixture/incompressibleThreePhaseMixture.H @@ -181,19 +181,19 @@ public: //- Return const-access to phase1 viscosityModel const viscosityModel& nuModel1() const { - return nuModel1_(); + return *nuModel1_; } //- Return const-access to phase2 viscosityModel const viscosityModel& nuModel2() const { - return nuModel2_(); + return *nuModel2_; } //- Return const-access to phase3 viscosityModel const viscosityModel& nuModel3() const { - return nuModel3_(); + return *nuModel3_; } //- Return the dynamic laminar viscosity diff --git a/applications/solvers/multiphase/interFoam/overInterDyMFoam/correctPhi.H b/applications/solvers/multiphase/interFoam/overInterDyMFoam/correctPhi.H index 9c4608e238..cfd0353622 100644 --- a/applications/solvers/multiphase/interFoam/overInterDyMFoam/correctPhi.H +++ b/applications/solvers/multiphase/interFoam/overInterDyMFoam/correctPhi.H @@ -110,7 +110,7 @@ pcorrEqn.setReferences ( validCells, - scalarList(validCells.size(), 0.0), + scalar(0.0), true ); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/phaseModel/phaseModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/phaseModel/phaseModel.C index 224d0345d6..b57058d61f 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/phaseModel/phaseModel.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/phaseModel/phaseModel.C @@ -205,7 +205,7 @@ Foam::phaseModel::~phaseModel() Foam::autoPtr Foam::phaseModel::clone() const { NotImplemented; - return autoPtr(nullptr); + return autoPtr(); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/phaseModel/phaseModel.H b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/phaseModel/phaseModel.H index 90e48183ca..3740878610 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/phaseModel/phaseModel.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/phaseModel/phaseModel.H @@ -190,12 +190,12 @@ public: const surfaceScalarField& phi() const { - return phiPtr_(); + return *phiPtr_; } surfaceScalarField& phi() { - return phiPtr_(); + return *phiPtr_; } const surfaceScalarField& alphaPhi() const diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/phase/phase.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/phase/phase.C index 5fc59061a4..e14906619b 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/phase/phase.C +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/phase/phase.C @@ -68,7 +68,7 @@ Foam::phase::phase Foam::autoPtr Foam::phase::clone() const { NotImplemented; - return autoPtr(nullptr); + return autoPtr(); } diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/phase/phase.H b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/phase/phase.H index 91341fcf5c..3ce0ba7d65 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/phase/phase.H +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/phase/phase.H @@ -120,7 +120,7 @@ public: //- Return const-access to phase1 viscosityModel const viscosityModel& nuModel() const { - return nuModel_(); + return *nuModel_; } //- Return the kinematic laminar viscosity diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatAndMassTransferPhaseSystem/HeatAndMassTransferPhaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatAndMassTransferPhaseSystem/HeatAndMassTransferPhaseSystem.C index c63f6bfd44..bb493847b0 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatAndMassTransferPhaseSystem/HeatAndMassTransferPhaseSystem.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatAndMassTransferPhaseSystem/HeatAndMassTransferPhaseSystem.C @@ -59,14 +59,9 @@ HeatAndMassTransferPhaseSystem massTransferModels_ ); - forAllConstIter - ( - phaseSystem::phasePairTable, - this->phasePairs_, - phasePairIter - ) + forAllConstIters(this->phasePairs_, phasePairIter) { - const phasePair& pair(phasePairIter()); + const phasePair& pair = *(phasePairIter.object()); if (pair.ordered()) { @@ -197,14 +192,9 @@ Foam::HeatAndMassTransferPhaseSystem::dmdt ) ); - forAllConstIter - ( - phaseSystem::phasePairTable, - this->phasePairs_, - phasePairIter - ) + forAllConstIters(this->phasePairs_, phasePairIter) { - const phasePair& pair(phasePairIter()); + const phasePair& pair = *(phasePairIter.object()); if (pair.ordered()) { @@ -239,14 +229,9 @@ Foam::HeatAndMassTransferPhaseSystem::momentumTransfer() const phaseSystem::momentumTransferTable& eqns = eqnsPtr(); // Source term due to mass trasfer - forAllConstIter - ( - phaseSystem::phasePairTable, - this->phasePairs_, - phasePairIter - ) + forAllConstIters(this->phasePairs_, phasePairIter) { - const phasePair& pair(phasePairIter()); + const phasePair& pair = *(phasePairIter.object()); if (pair.ordered()) { @@ -291,17 +276,10 @@ Foam::HeatAndMassTransferPhaseSystem::heatTransfer() const } // Heat transfer with the interface - forAllConstIter - ( - heatTransferModelTable, - heatTransferModels_, - heatTransferModelIter - ) + forAllConstIters(heatTransferModels_, heatTransferModelIter) { - const phasePair& pair - ( - this->phasePairs_[heatTransferModelIter.key()] - ); + const phasePair& pair = + *(this->phasePairs_[heatTransferModelIter.key()]); const phaseModel* phase = &pair.phase1(); const phaseModel* otherPhase = &pair.phase2(); @@ -344,14 +322,9 @@ Foam::HeatAndMassTransferPhaseSystem::heatTransfer() const } // Source term due to mass transfer - forAllConstIter - ( - phaseSystem::phasePairTable, - this->phasePairs_, - phasePairIter - ) + forAllConstIters(this->phasePairs_, phasePairIter) { - const phasePair& pair(phasePairIter()); + const phasePair& pair = *(phasePairIter.object()); if (pair.ordered()) { diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatTransferPhaseSystem/HeatTransferPhaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatTransferPhaseSystem/HeatTransferPhaseSystem.C index 9fee19e77f..465d0b3af9 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatTransferPhaseSystem/HeatTransferPhaseSystem.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatTransferPhaseSystem/HeatTransferPhaseSystem.C @@ -128,16 +128,12 @@ Foam::HeatTransferPhaseSystem::heatTransfer() const ); } - forAllConstIter - ( - heatTransferModelTable, - heatTransferModels_, - heatTransferModelIter - ) + forAllConstIters(heatTransferModels_, heatTransferModelIter) { - const volScalarField K(heatTransferModelIter()->K()); + const phasePair& pair = + *(this->phasePairs_[heatTransferModelIter.key()]); - const phasePair& pair(this->phasePairs_[heatTransferModelIter.key()]); + const volScalarField K(heatTransferModelIter()->K()); const phaseModel* phase = &pair.phase1(); const phaseModel* otherPhase = &pair.phase2(); diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/InterfaceCompositionPhaseChangePhaseSystem/InterfaceCompositionPhaseChangePhaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/InterfaceCompositionPhaseChangePhaseSystem/InterfaceCompositionPhaseChangePhaseSystem.C index 1c9b53c803..53f724680b 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/InterfaceCompositionPhaseChangePhaseSystem/InterfaceCompositionPhaseChangePhaseSystem.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/InterfaceCompositionPhaseChangePhaseSystem/InterfaceCompositionPhaseChangePhaseSystem.C @@ -86,14 +86,9 @@ massTransfer() const } // Reset the interfacial mass flow rates - forAllConstIter - ( - phaseSystem::phasePairTable, - this->phasePairs_, - phasePairIter - ) + forAllConstIters(this->phasePairs_, phasePairIter) { - const phasePair& pair(phasePairIter()); + const phasePair& pair = *(phasePairIter.object()); if (pair.ordered()) { @@ -108,22 +103,18 @@ massTransfer() const } // Sum up the contribution from each interface composition model - forAllConstIter + forAllConstIters ( - interfaceCompositionModelTable, interfaceCompositionModels_, interfaceCompositionModelIter ) { - const interfaceCompositionModel& compositionModel - ( - interfaceCompositionModelIter() - ); + const phasePair& pair = + *(this->phasePairs_[interfaceCompositionModelIter.key()]); + + const interfaceCompositionModel& compositionModel = + *(interfaceCompositionModelIter.object()); - const phasePair& pair - ( - this->phasePairs_[interfaceCompositionModelIter.key()] - ); const phaseModel& phase = pair.phase1(); const phaseModel& otherPhase = pair.phase2(); const phasePairKey key(phase.name(), otherPhase.name()); @@ -209,14 +200,9 @@ correctThermo() // Yfi is likely to be a strong non-linear (typically exponential) function // of Tf, so the solution for the temperature is newton-accelerated - forAllConstIter - ( - phaseSystem::phasePairTable, - this->phasePairs_, - phasePairIter - ) + forAllConstIters(this->phasePairs_, phasePairIter) { - const phasePair& pair(phasePairIter()); + const phasePair& pair = *(phasePairIter.object()); if (pair.ordered()) { diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.C index 02969b89cb..43d5881fed 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.C @@ -82,14 +82,10 @@ MomentumTransferPhaseSystem turbulentDispersionModels_ ); - forAllConstIter - ( - dragModelTable, - dragModels_, - dragModelIter - ) + forAllConstIters(dragModels_, dragModelIter) { - const phasePair& pair(this->phasePairs_[dragModelIter.key()]); + const phasePair& pair = + *(this->phasePairs_[dragModelIter.key()]); Kds_.insert ( @@ -102,14 +98,10 @@ MomentumTransferPhaseSystem ); } - forAllConstIter - ( - virtualMassModelTable, - virtualMassModels_, - virtualMassModelIter - ) + forAllConstIters(virtualMassModels_, virtualMassModelIter) { - const phasePair& pair(this->phasePairs_[virtualMassModelIter.key()]); + const phasePair& pair = + *(this->phasePairs_[virtualMassModelIter.key()]); Vms_.insert ( @@ -183,16 +175,11 @@ Foam::MomentumTransferPhaseSystem::Kd ) ); - forAllConstIter - ( - phaseSystem::KdTable, - Kds_, - KdIter - ) + forAllConstIters(Kds_, KdIter) { - const volScalarField& K(*KdIter()); + const phasePair& pair = *(this->phasePairs_[KdIter.key()]); - const phasePair& pair(this->phasePairs_[KdIter.key()]); + const volScalarField& K(*KdIter()); const phaseModel* phase1 = &pair.phase1(); const phaseModel* phase2 = &pair.phase2(); @@ -430,27 +417,17 @@ Foam::MomentumTransferPhaseSystem::momentumTransfer() const } // Update the drag coefficients - forAllConstIter - ( - dragModelTable, - dragModels_, - dragModelIter - ) + forAllConstIters(dragModels_, dragModelIter) { *Kds_[dragModelIter.key()] = dragModelIter()->K(); } // Add the implicit part of the drag force - forAllConstIter - ( - phaseSystem::KdTable, - Kds_, - KdIter - ) + forAllConstIters(Kds_, KdIter) { - const volScalarField& K(*KdIter()); + const phasePair& pair = *(this->phasePairs_[KdIter.key()]); - const phasePair& pair(this->phasePairs_[KdIter.key()]); + const volScalarField& K(*KdIter()); const phaseModel* phase = &pair.phase1(); const phaseModel* otherPhase = &pair.phase2(); @@ -466,27 +443,17 @@ Foam::MomentumTransferPhaseSystem::momentumTransfer() const } // Update the virtual mass coefficients - forAllConstIter - ( - virtualMassModelTable, - virtualMassModels_, - virtualMassModelIter - ) + forAllConstIters(virtualMassModels_, virtualMassModelIter) { *Vms_[virtualMassModelIter.key()] = virtualMassModelIter()->K(); } // Add the virtual mass force - forAllConstIter - ( - phaseSystem::VmTable, - Vms_, - VmIter - ) + forAllConstIters(Vms_, VmIter) { - const volScalarField& Vm(*VmIter()); + const phasePair& pair = *(this->phasePairs_[VmIter.key()]); - const phasePair& pair(this->phasePairs_[VmIter.key()]); + const volScalarField& Vm(*VmIter()); const phaseModel* phase = &pair.phase1(); const phaseModel* otherPhase = &pair.phase2(); @@ -557,33 +524,22 @@ Foam::MomentumTransferPhaseSystem::Fs() const PtrList& Fs = tFs(); // Add the lift force - forAllConstIter - ( - liftModelTable, - liftModels_, - liftModelIter - ) + forAllConstIters(liftModels_, modelIter) { - const volVectorField F(liftModelIter()->F()); + const phasePair& pair = *(this->phasePairs_[modelIter.key()]); - const phasePair& pair(this->phasePairs_[liftModelIter.key()]); + const volVectorField F(modelIter()->template F()); setF(Fs, pair.phase1().index()) += F; setF(Fs, pair.phase2().index()) -= F; } // Add the wall lubrication force - forAllConstIter - ( - wallLubricationModelTable, - wallLubricationModels_, - wallLubricationModelIter - ) + forAllConstIters(wallLubricationModels_, modelIter) { - const volVectorField F(wallLubricationModelIter()->F()); + const phasePair& pair = *(this->phasePairs_[modelIter.key()]); - const phasePair& - pair(this->phasePairs_[wallLubricationModelIter.key()]); + const volVectorField F(modelIter()->template F()); setF(Fs, pair.phase1().index()) += F; setF(Fs, pair.phase2().index()) -= F; @@ -647,15 +603,10 @@ Foam::MomentumTransferPhaseSystem::phiDs PtrList& phiDs = tphiDs(); // Add the turbulent dispersion force - forAllConstIter - ( - turbulentDispersionModelTable, - turbulentDispersionModels_, - turbulentDispersionModelIter - ) + forAllConstIters(turbulentDispersionModels_, turbulentDispersionModelIter) { - const phasePair& - pair(this->phasePairs_[turbulentDispersionModelIter.key()]); + const phasePair& pair = + *(this->phasePairs_[turbulentDispersionModelIter.key()]); const volScalarField D(turbulentDispersionModelIter()->D()); const surfaceScalarField snGradAlpha1 diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/ThermalPhaseChangePhaseSystem/ThermalPhaseChangePhaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/ThermalPhaseChangePhaseSystem/ThermalPhaseChangePhaseSystem.C index a6dd838d23..bb5c2462c3 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/ThermalPhaseChangePhaseSystem/ThermalPhaseChangePhaseSystem.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/ThermalPhaseChangePhaseSystem/ThermalPhaseChangePhaseSystem.C @@ -42,14 +42,9 @@ ThermalPhaseChangePhaseSystem massTransfer_(this->lookup("massTransfer")) { - forAllConstIter - ( - phaseSystem::phasePairTable, - this->phasePairs_, - phasePairIter - ) + forAllConstIters(this->phasePairs_, phasePairIter) { - const phasePair& pair(phasePairIter()); + const phasePair& pair = *(phasePairIter.object()); if (pair.ordered()) { @@ -92,7 +87,7 @@ template const Foam::saturationModel& Foam::ThermalPhaseChangePhaseSystem::saturation() const { - return saturationModel_(); + return *saturationModel_; } @@ -109,14 +104,9 @@ Foam::ThermalPhaseChangePhaseSystem::heatTransfer() const phaseSystem::heatTransferTable& eqns = eqnsPtr(); // Accumulate mDotL contributions from boundaries - forAllConstIter - ( - phaseSystem::phasePairTable, - this->phasePairs_, - phasePairIter - ) + forAllConstIters(this->phasePairs_, phasePairIter) { - const phasePair& pair(phasePairIter()); + const phasePair& pair = *(phasePairIter.object()); if (pair.ordered()) { @@ -219,19 +209,15 @@ Foam::ThermalPhaseChangePhaseSystem::massTransfer() const } } - forAllConstIter - ( - phaseSystem::phasePairTable, - this->phasePairs_, - phasePairIter - ) + forAllConstIters(this->phasePairs_, phasePairIter) { - const phasePair& pair(phasePairIter()); + const phasePair& pair = *(phasePairIter.object()); if (pair.ordered()) { continue; } + const phaseModel& phase = pair.phase1(); const phaseModel& otherPhase = pair.phase2(); @@ -292,14 +278,9 @@ Foam::ThermalPhaseChangePhaseSystem::iDmdt ) ); - forAllConstIter - ( - phaseSystem::phasePairTable, - this->phasePairs_, - phasePairIter - ) + forAllConstIters(this->phasePairs_, phasePairIter) { - const phasePair& pair(phasePairIter()); + const phasePair& pair = *(phasePairIter.object()); if (pair.ordered()) { @@ -332,14 +313,9 @@ void Foam::ThermalPhaseChangePhaseSystem::correctThermo() BasePhaseSystem::correctThermo(); - forAllConstIter - ( - phaseSystem::phasePairTable, - this->phasePairs_, - phasePairIter - ) + forAllConstIters(this->phasePairs_, phasePairIter) { - const phasePair& pair(phasePairIter()); + const phasePair& pair = *(phasePairIter.object()); if (pair.ordered()) { diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.C index 2afa388aca..460e21ce85 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.C @@ -401,7 +401,7 @@ template const Foam::phaseCompressibleTurbulenceModel& Foam::MovingPhaseModel::turbulence() const { - return turbulence_; + return *turbulence_; } diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.C index da10824230..26be4e1bc7 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.C @@ -77,7 +77,7 @@ Foam::phaseModel::phaseModel Foam::autoPtr Foam::phaseModel::clone() const { NotImplemented; - return autoPtr(nullptr); + return autoPtr(); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystemTemplates.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystemTemplates.C index 8f4bf7ee0f..768c905e1f 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystemTemplates.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystemTemplates.C @@ -48,8 +48,8 @@ void Foam::phaseSystem::createSubModels key, modelType::New ( - *iter, - phasePairs_[key] + iter.object(), + phasePairs_[key]() ) ); } @@ -98,11 +98,11 @@ void Foam::phaseSystem::generatePairsAndSubModels const blendingMethod& blending ( blendingMethods_.found(modelName) - ? blendingMethods_[modelName] - : blendingMethods_["default"] + ? *(blendingMethods_[modelName]) + : *(blendingMethods_["default"]) ); - autoPtr noModel(nullptr); + autoPtr noModel; forAllConstIter(typename modelTypeTable, tempModels, iter) { diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/pU/pEqn.H b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/pU/pEqn.H index a164b73f26..758c411968 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/pU/pEqn.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/pU/pEqn.H @@ -217,16 +217,11 @@ while (pimple.correct()) ) ); - forAllConstIter - ( - phaseSystem::KdTable, - fluid.Kds(), - KdIter - ) + forAllConstIters(fluid.Kds(), KdIter) { const volScalarField& K(*KdIter()); - const phasePair& pair(fluid.phasePairs()[KdIter.key()]); + const phasePair& pair = *(fluid.phasePairs()[KdIter.key()]); const phaseModel* phase1 = &pair.phase1(); const phaseModel* phase2 = &pair.phase2(); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.H index 3183796015..db917c4865 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.H @@ -115,7 +115,7 @@ public: autoPtr clone() const { NotImplemented; - return autoPtr(nullptr); + return autoPtr(); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/BlendedInterfacialModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/BlendedInterfacialModel.C index cc089e347e..289054982d 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/BlendedInterfacialModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/BlendedInterfacialModel.C @@ -451,9 +451,11 @@ bool Foam::BlendedInterfacialModel::hasModel ) const { return - &phase == &(pair_.phase1()) + ( + &phase == &(pair_.phase1()) ? model1In2_.valid() - : model2In1_.valid(); + : model2In1_.valid() + ); } @@ -463,7 +465,7 @@ const modelType& Foam::BlendedInterfacialModel::phaseModel const class phaseModel& phase ) const { - return &phase == &(pair_.phase1()) ? model1In2_ : model2In1_; + return &phase == &(pair_.phase1()) ? *model1In2_ : *model2In1_; } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.H b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.H index c7655b9c34..29c150ce74 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.H @@ -114,7 +114,7 @@ public: autoPtr clone() const { NotImplemented; - return autoPtr(nullptr); + return autoPtr(); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.C index 9352b72397..139826e885 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.C @@ -227,14 +227,14 @@ Foam::tmp Foam::phaseModel::d() const Foam::PhaseCompressibleTurbulenceModel& Foam::phaseModel::turbulence() { - return turbulence_(); + return *turbulence_; } const Foam::PhaseCompressibleTurbulenceModel& Foam::phaseModel::turbulence() const { - return turbulence_(); + return *turbulence_; } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.H b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.H index 894907fe7c..f0c88afa1e 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.H @@ -162,14 +162,14 @@ public: //- Return the thermophysical model const rhoThermo& thermo() const { - return thermo_(); + return *thermo_; } //- Return non-const access to the thermophysical model // for correction rhoThermo& thermo() { - return thermo_(); + return *thermo_; } //- Return the laminar viscosity @@ -286,13 +286,13 @@ public: //- Return the volumetric flux const surfaceScalarField& phi() const { - return phiPtr_(); + return *phiPtr_; } //- Return non-const access to the volumetric flux surfaceScalarField& phi() { - return phiPtr_(); + return *phiPtr_; } //- Return the volumetric flux of the phase diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C index 5a99c32ae2..4750293fe8 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C @@ -177,12 +177,12 @@ Foam::twoPhaseSystem::twoPhaseSystem lookup("drag"), ( blendingMethods_.found("drag") - ? blendingMethods_["drag"] - : blendingMethods_["default"] + ? *(blendingMethods_["drag"]) + : *(blendingMethods_["default"]) ), - pair_, - pair1In2_, - pair2In1_, + *pair_, + *pair1In2_, + *pair2In1_, false // Do not zero drag coefficent at fixed-flux BCs ) ); @@ -194,12 +194,12 @@ Foam::twoPhaseSystem::twoPhaseSystem lookup("virtualMass"), ( blendingMethods_.found("virtualMass") - ? blendingMethods_["virtualMass"] - : blendingMethods_["default"] + ? *(blendingMethods_["virtualMass"]) + : *(blendingMethods_["default"]) ), - pair_, - pair1In2_, - pair2In1_ + *pair_, + *pair1In2_, + *pair2In1_ ) ); @@ -210,12 +210,12 @@ Foam::twoPhaseSystem::twoPhaseSystem lookup("heatTransfer"), ( blendingMethods_.found("heatTransfer") - ? blendingMethods_["heatTransfer"] - : blendingMethods_["default"] + ? *(blendingMethods_["heatTransfer"]) + : *(blendingMethods_["default"]) ), - pair_, - pair1In2_, - pair2In1_ + *pair_, + *pair1In2_, + *pair2In1_ ) ); @@ -226,12 +226,12 @@ Foam::twoPhaseSystem::twoPhaseSystem lookup("lift"), ( blendingMethods_.found("lift") - ? blendingMethods_["lift"] - : blendingMethods_["default"] + ? *(blendingMethods_["lift"]) + : *(blendingMethods_["default"]) ), - pair_, - pair1In2_, - pair2In1_ + *pair_, + *pair1In2_, + *pair2In1_ ) ); @@ -242,12 +242,12 @@ Foam::twoPhaseSystem::twoPhaseSystem lookup("wallLubrication"), ( blendingMethods_.found("wallLubrication") - ? blendingMethods_["wallLubrication"] - : blendingMethods_["default"] + ? *(blendingMethods_["wallLubrication"]) + : *(blendingMethods_["default"]) ), - pair_, - pair1In2_, - pair2In1_ + *pair_, + *pair1In2_, + *pair2In1_ ) ); @@ -258,12 +258,12 @@ Foam::twoPhaseSystem::twoPhaseSystem lookup("turbulentDispersion"), ( blendingMethods_.found("turbulentDispersion") - ? blendingMethods_["turbulentDispersion"] - : blendingMethods_["default"] + ? *(blendingMethods_["turbulentDispersion"]) + : *(blendingMethods_["default"]) ), - pair_, - pair1In2_, - pair2In1_ + *pair_, + *pair1In2_, + *pair2In1_ ) ); } @@ -272,7 +272,7 @@ Foam::twoPhaseSystem::twoPhaseSystem // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::twoPhaseSystem::~twoPhaseSystem() -{} +{} // Define here (incomplete type in header) // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // diff --git a/applications/solvers/stressAnalysis/solidDisplacementFoam/createFields.H b/applications/solvers/stressAnalysis/solidDisplacementFoam/createFields.H index fd97d416f9..8d9ef025c8 100644 --- a/applications/solvers/stressAnalysis/solidDisplacementFoam/createFields.H +++ b/applications/solvers/stressAnalysis/solidDisplacementFoam/createFields.H @@ -16,7 +16,7 @@ volVectorField D ); -autoPtr Tptr(nullptr); +autoPtr Tptr; if (thermalStress) { diff --git a/applications/test/Dictionary/Test-Dictionary.C b/applications/test/Dictionary/Test-Dictionary.C index 251cb2f841..d360c30a3b 100644 --- a/applications/test/Dictionary/Test-Dictionary.C +++ b/applications/test/Dictionary/Test-Dictionary.C @@ -180,7 +180,7 @@ int main(int argc, char *argv[]) { std::cout<< "iter: " << typeid(*iter).name() << '\n'; - Info<< "elem = " << *(*iter) << endl; + // Info<< "elem = " << *(*iter) << endl; } std::cout<< "iter type: " diff --git a/applications/test/DynamicList/Test-DynamicList.C b/applications/test/DynamicList/Test-DynamicList.C index 11111aad00..8ca36068ce 100644 --- a/applications/test/DynamicList/Test-DynamicList.C +++ b/applications/test/DynamicList/Test-DynamicList.C @@ -194,13 +194,13 @@ int main(int argc, char *argv[]) printInfo("dlC", dlC, true); - List