diff --git a/applications/solvers/DNS/dnsFoam/dnsFoam.C b/applications/solvers/DNS/dnsFoam/dnsFoam.C index 34f212bc4d6ddcfc4c11a2054751210bdd941f7d..73455c005df2367dce21661630e0c01d9926638d 100644 --- a/applications/solvers/DNS/dnsFoam/dnsFoam.C +++ b/applications/solvers/DNS/dnsFoam/dnsFoam.C @@ -85,7 +85,7 @@ int main(int argc, char *argv[]) for (int corr=1; corr<=1; corr++) { - volScalarField rAU = 1.0/UEqn.A(); + volScalarField rAU(1.0/UEqn.A()); U = rAU*UEqn.H(); phi = (fvc::interpolate(U) & mesh.Sf()) diff --git a/applications/solvers/DNS/dnsFoam/readTurbulenceProperties.H b/applications/solvers/DNS/dnsFoam/readTurbulenceProperties.H index ba1d5dcd8029e4de63ae5ea49dc226bec906800b..0d6b417d5ab7084596f490151e2fa393516703f0 100644 --- a/applications/solvers/DNS/dnsFoam/readTurbulenceProperties.H +++ b/applications/solvers/DNS/dnsFoam/readTurbulenceProperties.H @@ -12,8 +12,10 @@ ) ); - volVectorField force = - U/dimensionedScalar("dt", dimTime, runTime.deltaTValue()); + volVectorField force + ( + U/dimensionedScalar("dt", dimTime, runTime.deltaTValue()) + ); Kmesh K(mesh); UOprocess forceGen(K, runTime.deltaTValue(), turbulenceProperties); diff --git a/applications/solvers/basic/laplacianFoam/write.H b/applications/solvers/basic/laplacianFoam/write.H index a3cec5419fd57e693c50eebf31072a7353242e90..47aa182c0a986f6ca07a494623e4d59ae792b6d9 100644 --- a/applications/solvers/basic/laplacianFoam/write.H +++ b/applications/solvers/basic/laplacianFoam/write.H @@ -1,6 +1,6 @@ if (runTime.outputTime()) { - volVectorField gradT = fvc::grad(T); + volVectorField gradT(fvc::grad(T)); volScalarField gradTx ( diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/XiEqModels/basicXiSubXiEq/basicXiSubXiEq.C b/applications/solvers/combustion/PDRFoam/PDRModels/XiEqModels/basicXiSubXiEq/basicXiSubXiEq.C index 8d1053ca1ee3bc87302a22dffffd5a4576f93983..a8827a6e5231f30ce2d65672726f719240cbfbf0 100644 --- a/applications/solvers/combustion/PDRFoam/PDRModels/XiEqModels/basicXiSubXiEq/basicXiSubXiEq.C +++ b/applications/solvers/combustion/PDRFoam/PDRModels/XiEqModels/basicXiSubXiEq/basicXiSubXiEq.C @@ -34,8 +34,8 @@ namespace XiEqModels { defineTypeNameAndDebug(basicSubGrid, 0); addToRunTimeSelectionTable(XiEqModel, basicSubGrid, dictionary); -}; -}; +} +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -123,20 +123,24 @@ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::basicSubGrid::XiEq() const const objectRegistry& db = Su_.db(); const volVectorField& U = db.lookupObject<volVectorField>("U"); - volScalarField magU = mag(U); - volVectorField Uhat = - U/(mag(U) + dimensionedScalar("Usmall", U.dimensions(), 1e-4)); + volScalarField magU(mag(U)); + volVectorField Uhat + ( + U/(mag(U) + dimensionedScalar("Usmall", U.dimensions(), 1e-4)) + ); - volScalarField n = max(N_ - (Uhat & ns_ & Uhat), scalar(1e-4)); + volScalarField n(max(N_ - (Uhat & ns_ & Uhat), scalar(1e-4))); - volScalarField b = (Uhat & B_ & Uhat)/n; + volScalarField b((Uhat & B_ & Uhat)/n); - volScalarField up = sqrt((2.0/3.0)*turbulence_.k()); + volScalarField up(sqrt((2.0/3.0)*turbulence_.k())); - volScalarField XiSubEq = + volScalarField XiSubEq + ( scalar(1) + max(2.2*sqrt(b), min(0.34*magU/up, scalar(1.6))) - *min(0.25*n, scalar(1)); + *min(0.25*n, scalar(1)) + ); return XiSubEq*XiEqModel_->XiEq(); } diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C b/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C index 8c5ec52bedd99dae1d39795262471841a104e6df..a978b128773d9f0d1b96df8197c610f72d64a679 100644 --- a/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C +++ b/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C @@ -78,7 +78,7 @@ void PDRkEpsilon::correct() RASModel::correct(); - volScalarField divU = fvc::div(phi_/fvc::interpolate(rho_)); + volScalarField divU(fvc::div(phi_/fvc::interpolate(rho_))); if (mesh_.moving()) { @@ -99,7 +99,7 @@ void PDRkEpsilon::correct() const PDRDragModel& drag = U_.db().lookupObject<PDRDragModel>("PDRDragModel"); - volScalarField GR = drag.Gk(); + volScalarField GR(drag.Gk()); // Dissipation equation tmp<fvScalarMatrix> epsEqn diff --git a/applications/solvers/combustion/PDRFoam/StCourantNo.H b/applications/solvers/combustion/PDRFoam/StCourantNo.H index 8fac05d81c00be7dfa7d4ded60c1a2e1ffe84a3c..f1e3dc9916648adeb97be1fe1474b95617ce837e 100644 --- a/applications/solvers/combustion/PDRFoam/StCourantNo.H +++ b/applications/solvers/combustion/PDRFoam/StCourantNo.H @@ -34,9 +34,11 @@ Description if (mesh.nInternalFaces()) { - scalarField sumPhi = + scalarField sumPhi + ( fvc::surfaceSum(mag(phiSt))().internalField() - /rho.internalField(); + / rho.internalField() + ); StCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue(); diff --git a/applications/solvers/combustion/PDRFoam/UEqn.H b/applications/solvers/combustion/PDRFoam/UEqn.H index aea6ad9a46ab61df907b385fc197ecbfd31a4b01..deb00a312108fea2b9f9f5414452415e06910f76 100644 --- a/applications/solvers/combustion/PDRFoam/UEqn.H +++ b/applications/solvers/combustion/PDRFoam/UEqn.H @@ -7,7 +7,7 @@ betav*rho*g ); - volSymmTensorField invA = inv(I*UEqn.A() + drag->Dcu()); + volSymmTensorField invA(inv(I*UEqn.A() + drag->Dcu())); if (momentumPredictor) { diff --git a/applications/solvers/combustion/PDRFoam/XiEqns b/applications/solvers/combustion/PDRFoam/XiEqns deleted file mode 100644 index 8de3bffe4b1c689d3ed8ebc4e914a8448add523f..0000000000000000000000000000000000000000 --- a/applications/solvers/combustion/PDRFoam/XiEqns +++ /dev/null @@ -1,91 +0,0 @@ - // Calculate Xi according to the selected flame wrinkling model - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - // Calculate coefficients for Gulder's flame speed correlation - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - volScalarField up = uPrimeCoef*sqrt((2.0/3.0)*k); - volScalarField epsilonPlus = pow(uPrimeCoef, 3)*epsilon; - - volScalarField tauEta = sqrt(mag(thermo->muu()/(rhou*epsilonPlus))); - volScalarField Reta = up/ - ( - sqrt(epsilonPlus*tauEta) - + dimensionedScalar("1e-8", up.dimensions(), 1e-8) - ); - - else if (XiModel == "algebraic") - { - // Simple algebraic model for Xi based on Gulders correlation - // with a linear correction function to give a plausible profile for Xi - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - volScalarField GEta = GEtaCoef/tauEta; - volScalarField XiEqEta = 1.0 + XiCoef*sqrt(up/(Su + SuMin))*Reta; - - volScalarField R = - GEta*XiEqEta/(XiEqEta - 0.999) + GIn*XiIn/(XiIn - 0.999); - - volScalarField XiEqStar = R/(R - GEta - GIn); - - //- Calculate the unweighted b - //volScalarField Rrho = thermo->rhou()/thermo->rhob(); - //volScalarField bbar = b/(b + (Rrho*(1.0 - b))); - - Xi == 1.0 + (1.0 + (2*XiShapeCoef)*(0.5 - b))*(XiEqStar - 1.0); - } - else if (XiModel == "transport") - { - // Calculate Xi transport coefficients based on Gulders correlation - // and DNS data for the rate of generation - // with a linear correction function to give a plausible profile for Xi - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - volScalarField GEta = GEtaCoef/tauEta; - volScalarField XiEqEta = 1.0 + XiCoef*sqrt(up/(Su + SuMin))*Reta; - - volScalarField R = - GEta*XiEqEta/(XiEqEta - 0.999) + GIn*XiIn/(XiIn - 0.999); - - volScalarField XiEqStar = R/(R - GEta - GIn); - - volScalarField XiEq = - 1.0 + (1.0 + (2*XiShapeCoef)*(0.5 - b))*(XiEqStar - 1.0); - - volScalarField G = R*(XiEq - 1.0)/XiEq; - - // Calculate Xi flux - // ~~~~~~~~~~~~~~~~~ - surfaceScalarField phiXi = - phiSt - + ( - - fvc::interpolate(fvc::laplacian(Dbf, b)/mgb)*nf - + fvc::interpolate(rho)*fvc::interpolate(Su*(1.0/Xi - Xi))*nf - ); - - - // Solve for the flame wrinkling - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - solve - ( - betav*fvm::ddt(rho, Xi) - + mvConvection->fvmDiv(phi, Xi) - + fvm::div(phiXi, Xi, "div(phiXi,Xi)") - - fvm::Sp(fvc::div(phiXi), Xi) - == - betav*rho*R - - fvm::Sp(betav*rho*(R - G), Xi) - ); - - - // Correct boundedness of Xi - // ~~~~~~~~~~~~~~~~~~~~~~~~~ - Xi.max(1.0); - Xi = min(Xi, 2.0*XiEq); - Info<< "max(Xi) = " << max(Xi).value() << endl; - Info<< "max(XiEq) = " << max(XiEq).value() << endl; - } - else - { - FatalError - << args.executable() << " : Unknown Xi model " << XiModel - << abort(FatalError); - } diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/Gulder/Gulder.C b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/Gulder/Gulder.C index bfd6dee810bb49adfe1b87e0484736bffdd4dbb9..00e6e20ceee18a10e198d51a600b5215381dea8b 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/Gulder/Gulder.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/Gulder/Gulder.C @@ -34,8 +34,8 @@ namespace XiEqModels { defineTypeNameAndDebug(Gulder, 0); addToRunTimeSelectionTable(XiEqModel, Gulder, dictionary); -}; -}; +} +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -64,15 +64,18 @@ Foam::XiEqModels::Gulder::~Gulder() Foam::tmp<Foam::volScalarField> Foam::XiEqModels::Gulder::XiEq() const { - volScalarField up = sqrt((2.0/3.0)*turbulence_.k()); + volScalarField up(sqrt((2.0/3.0)*turbulence_.k())); const volScalarField& epsilon = turbulence_.epsilon(); - volScalarField tauEta = sqrt(mag(thermo_.muu()/(thermo_.rhou()*epsilon))); + volScalarField tauEta(sqrt(mag(thermo_.muu()/(thermo_.rhou()*epsilon)))); - volScalarField Reta = up/ + volScalarField Reta ( - sqrt(epsilon*tauEta) - + dimensionedScalar("1e-8", up.dimensions(), 1e-8) + up + / ( + sqrt(epsilon*tauEta) + + dimensionedScalar("1e-8", up.dimensions(), 1e-8) + ) ); return 1.0 + XiEqCoef*sqrt(up/(Su_ + SuMin))*Reta; diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/SCOPEXiEq/SCOPEXiEq.C b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/SCOPEXiEq/SCOPEXiEq.C index a59abab6987bb9032f20c7ed6ac9fc3ad43375d4..50d2ddb8b6817126c0a5a761abf946cbb690eb28 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/SCOPEXiEq/SCOPEXiEq.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/SCOPEXiEq/SCOPEXiEq.C @@ -34,8 +34,8 @@ namespace XiEqModels { defineTypeNameAndDebug(SCOPEXiEq, 0); addToRunTimeSelectionTable(XiEqModel, SCOPEXiEq, dictionary); -}; -}; +} +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -83,13 +83,13 @@ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::SCOPEXiEq::XiEq() const const volScalarField& k = turbulence_.k(); const volScalarField& epsilon = turbulence_.epsilon(); - volScalarField up = sqrt((2.0/3.0)*k); - volScalarField l = (lCoef*sqrt(3.0/2.0))*up*k/epsilon; - volScalarField Rl = up*l*thermo_.rhou()/thermo_.muu(); + volScalarField up(sqrt((2.0/3.0)*k)); + volScalarField l((lCoef*sqrt(3.0/2.0))*up*k/epsilon); + volScalarField Rl(up*l*thermo_.rhou()/thermo_.muu()); - volScalarField upBySu = up/(Su_ + SuMin); - volScalarField K = 0.157*upBySu/sqrt(Rl); - volScalarField Ma = MaModel.Ma(); + volScalarField upBySu(up/(Su_ + SuMin)); + volScalarField K(0.157*upBySu/sqrt(Rl)); + volScalarField Ma(MaModel.Ma()); tmp<volScalarField> tXiEq ( diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/instabilityXiEq/instabilityXiEq.C b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/instabilityXiEq/instabilityXiEq.C index 4fde0ef16842bc3d4d3058751ff6981e1322d333..41291403436803c82e111364f4d28d1fadaef1ec 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/instabilityXiEq/instabilityXiEq.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/instabilityXiEq/instabilityXiEq.C @@ -34,8 +34,8 @@ namespace XiEqModels { defineTypeNameAndDebug(instability, 0); addToRunTimeSelectionTable(XiEqModel, instability, dictionary); -}; -}; +} +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -64,7 +64,7 @@ Foam::XiEqModels::instability::~instability() Foam::tmp<Foam::volScalarField> Foam::XiEqModels::instability::XiEq() const { - volScalarField turbXiEq = XiEqModel_->XiEq(); + volScalarField turbXiEq(XiEqModel_->XiEq()); return XiEqIn/turbXiEq + turbXiEq; } diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/KTS/KTS.C b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/KTS/KTS.C index ab94c070b1392972186f4b15417e8ecdebe00988..c5c2a8b0599d70a5a7467f1fa59010e456876a42 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/KTS/KTS.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/KTS/KTS.C @@ -34,8 +34,8 @@ namespace XiGModels { defineTypeNameAndDebug(KTS, 0); addToRunTimeSelectionTable(XiGModel, KTS, dictionary); -}; -}; +} +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -63,10 +63,11 @@ Foam::XiGModels::KTS::~KTS() Foam::tmp<Foam::volScalarField> Foam::XiGModels::KTS::G() const { - volScalarField up = sqrt((2.0/3.0)*turbulence_.k()); + // volScalarField up(sqrt((2.0/3.0)*turbulence_.k())); const volScalarField& epsilon = turbulence_.epsilon(); - volScalarField tauEta = sqrt(mag(thermo_.muu()/(thermo_.rhou()*epsilon))); + tmp<volScalarField> tauEta = + sqrt(mag(thermo_.muu()/(thermo_.rhou()*epsilon))); return GEtaCoef/tauEta; } diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/instabilityG/instabilityG.C b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/instabilityG/instabilityG.C index 33c5163056ebd381bd3daa1749595687a0250de0..46182d16861cc895d45d60ec7a799382980bbc15 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/instabilityG/instabilityG.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/instabilityG/instabilityG.C @@ -65,7 +65,7 @@ Foam::XiGModels::instabilityG::~instabilityG() Foam::tmp<Foam::volScalarField> Foam::XiGModels::instabilityG::G() const { - volScalarField turbXiG = XiGModel_->G(); + volScalarField turbXiG(XiGModel_->G()); return GIn*GIn/(GIn + turbXiG) + turbXiG; } diff --git a/applications/solvers/combustion/PDRFoam/XiModels/algebraic/algebraic.C b/applications/solvers/combustion/PDRFoam/XiModels/algebraic/algebraic.C index 0beca272cca9c1de574a80fd76f8ae22bd99da19..893a6b454836ce5ac65167a67c60326076ab59cd 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/algebraic/algebraic.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/algebraic/algebraic.C @@ -34,8 +34,8 @@ namespace XiModels { defineTypeNameAndDebug(algebraic, 0); addToRunTimeSelectionTable(XiModel, algebraic, dictionary); -}; -}; +} +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -74,12 +74,12 @@ Foam::tmp<Foam::volScalarField> Foam::XiModels::algebraic::Db() const void Foam::XiModels::algebraic::correct() { - volScalarField XiEqEta = XiEqModel_->XiEq(); - volScalarField GEta = XiGModel_->G(); + volScalarField XiEqEta(XiEqModel_->XiEq()); + volScalarField GEta(XiGModel_->G()); - volScalarField R = GEta*XiEqEta/(XiEqEta - 0.999); + volScalarField R(GEta*XiEqEta/(XiEqEta - 0.999)); - volScalarField XiEqStar = R/(R - GEta); + volScalarField XiEqStar(R/(R - GEta)); Xi_ == 1.0 + (1.0 + (2*XiShapeCoef)*(0.5 - b_))*(XiEqStar - 1.0); } diff --git a/applications/solvers/combustion/PDRFoam/XiModels/transport/transport.C b/applications/solvers/combustion/PDRFoam/XiModels/transport/transport.C index 782638ef1ca61d44be025728df5e51aee7c96746..7fd6a6a33462afffc38b31035d249098c337dcbd 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/transport/transport.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/transport/transport.C @@ -34,8 +34,8 @@ namespace XiModels { defineTypeNameAndDebug(transport, 0); addToRunTimeSelectionTable(XiModel, transport, dictionary); -}; -}; +} +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -77,17 +77,19 @@ void Foam::XiModels::transport::correct const fv::convectionScheme<scalar>& mvConvection ) { - volScalarField XiEqEta = XiEqModel_->XiEq(); - volScalarField GEta = XiGModel_->G(); + volScalarField XiEqEta(XiEqModel_->XiEq()); + volScalarField GEta(XiGModel_->G()); - volScalarField R = GEta*XiEqEta/(XiEqEta - 0.999); + volScalarField R(GEta*XiEqEta/(XiEqEta - 0.999)); - volScalarField XiEqStar = R/(R - GEta); + volScalarField XiEqStar(R/(R - GEta)); - volScalarField XiEq = - 1.0 + (1.0 + (2*XiShapeCoef)*(0.5 - b_))*(XiEqStar - 1.0); + volScalarField XiEq + ( + 1.0 + (1.0 + (2*XiShapeCoef)*(0.5 - b_))*(XiEqStar - 1.0) + ); - volScalarField G = R*(XiEq - 1.0)/XiEq; + volScalarField G(R*(XiEq - 1.0)/XiEq); const objectRegistry& db = b_.db(); const volScalarField& betav = db.lookupObject<volScalarField>("betav"); diff --git a/applications/solvers/combustion/PDRFoam/bEqn.H b/applications/solvers/combustion/PDRFoam/bEqn.H index cb4493154030fc42af097a77dfd9258930ac62ec..bdc21c1babaa45abdd93cde0bf8fe9c3d3252b06 100644 --- a/applications/solvers/combustion/PDRFoam/bEqn.H +++ b/applications/solvers/combustion/PDRFoam/bEqn.H @@ -25,20 +25,20 @@ if (ign.ignited()) // Unburnt gas density // ~~~~~~~~~~~~~~~~~~~ - volScalarField rhou = thermo.rhou(); + volScalarField rhou(thermo.rhou()); // Calculate flame normal etc. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ - //volVectorField n = fvc::grad(b); - volVectorField n = fvc::reconstruct(fvc::snGrad(b)*mesh.magSf()); + // volVectorField n(fvc::grad(b)); + volVectorField n(fvc::reconstruct(fvc::snGrad(b)*mesh.magSf())); volScalarField mgb("mgb", mag(n)); dimensionedScalar dMgb("dMgb", mgb.dimensions(), SMALL); { - volScalarField bc = b*c; + volScalarField bc(b*c); dMgb += 1.0e-3* (bc*mgb)().weightedAverage(mesh.V()) @@ -47,8 +47,8 @@ if (ign.ignited()) mgb += dMgb; - surfaceVectorField Sfhat = mesh.Sf()/mesh.magSf(); - surfaceVectorField nfVec = fvc::interpolate(n); + surfaceVectorField Sfhat(mesh.Sf()/mesh.magSf()); + surfaceVectorField nfVec(fvc::interpolate(n)); nfVec += Sfhat*(fvc::snGrad(b) - (Sfhat & nfVec)); nfVec /= (mag(nfVec) + dMgb); surfaceScalarField nf("nf", mesh.Sf() & nfVec); diff --git a/applications/solvers/combustion/PDRFoam/pEqn.H b/applications/solvers/combustion/PDRFoam/pEqn.H index 9042837f54b1c128a220a41196e94a9ae13ee6de..9488e60e728edb19998db71f3a94e211508bdd9b 100644 --- a/applications/solvers/combustion/PDRFoam/pEqn.H +++ b/applications/solvers/combustion/PDRFoam/pEqn.H @@ -1,6 +1,6 @@ rho = thermo.rho(); -volScalarField rAU = 1.0/UEqn.A(); +volScalarField rAU(1.0/UEqn.A()); U = invA & UEqn.H(); if (transonic) diff --git a/applications/solvers/combustion/XiFoam/bEqn.H b/applications/solvers/combustion/XiFoam/bEqn.H index d93311ece1e9b7c9408a2418a3a6eb22f90c1f1b..e4a2f1ac39273368ed0db2c40f7176c09c76145f 100644 --- a/applications/solvers/combustion/XiFoam/bEqn.H +++ b/applications/solvers/combustion/XiFoam/bEqn.H @@ -2,18 +2,18 @@ if (ign.ignited()) { // progress variable // ~~~~~~~~~~~~~~~~~ - volScalarField c = scalar(1) - b; + volScalarField c(scalar(1) - b); // Unburnt gas density // ~~~~~~~~~~~~~~~~~~~ - volScalarField rhou = thermo.rhou(); + volScalarField rhou(thermo.rhou()); // Calculate flame normal etc. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ - volVectorField n = fvc::grad(b); + volVectorField n(fvc::grad(b)); - volScalarField mgb = mag(n); + volScalarField mgb(mag(n)); dimensionedScalar dMgb = 1.0e-3* (b*c*mgb)().weightedAverage(mesh.V()) @@ -22,11 +22,11 @@ if (ign.ignited()) mgb += dMgb; - surfaceVectorField SfHat = mesh.Sf()/mesh.magSf(); - surfaceVectorField nfVec = fvc::interpolate(n); + surfaceVectorField SfHat(mesh.Sf()/mesh.magSf()); + surfaceVectorField nfVec(fvc::interpolate(n)); nfVec += SfHat*(fvc::snGrad(b) - (SfHat & nfVec)); nfVec /= (mag(nfVec) + dMgb); - surfaceScalarField nf = (mesh.Sf() & nfVec); + surfaceScalarField nf((mesh.Sf() & nfVec)); n /= mgb; @@ -34,7 +34,7 @@ if (ign.ignited()) // Calculate turbulent flame speed flux // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - surfaceScalarField phiSt = fvc::interpolate(rhou*StCorr*Su*Xi)*nf; + surfaceScalarField phiSt(fvc::interpolate(rhou*StCorr*Su*Xi)*nf); scalar StCoNum = max ( @@ -71,16 +71,20 @@ if (ign.ignited()) // Calculate coefficients for Gulder's flame speed correlation // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - volScalarField up = uPrimeCoef*sqrt((2.0/3.0)*turbulence->k()); - //volScalarField up = sqrt(mag(diag(n * n) & diag(turbulence->r()))); + volScalarField up(uPrimeCoef*sqrt((2.0/3.0)*turbulence->k())); + //volScalarField up(sqrt(mag(diag(n * n) & diag(turbulence->r())))); - volScalarField epsilon = pow(uPrimeCoef, 3)*turbulence->epsilon(); + volScalarField epsilon(pow(uPrimeCoef, 3)*turbulence->epsilon()); - volScalarField tauEta = sqrt(thermo.muu()/(rhou*epsilon)); + volScalarField tauEta(sqrt(thermo.muu()/(rhou*epsilon))); - volScalarField Reta = up/ + volScalarField Reta ( - sqrt(epsilon*tauEta) + dimensionedScalar("1e-8", up.dimensions(), 1e-8) + up + / ( + sqrt(epsilon*tauEta) + + dimensionedScalar("1e-8", up.dimensions(), 1e-8) + ) ); //volScalarField l = 0.337*k*sqrt(k)/epsilon; @@ -88,34 +92,38 @@ if (ign.ignited()) // Calculate Xi flux // ~~~~~~~~~~~~~~~~~ - surfaceScalarField phiXi = + surfaceScalarField phiXi + ( phiSt - fvc::interpolate(fvc::laplacian(turbulence->alphaEff(), b)/mgb)*nf - + fvc::interpolate(rho)*fvc::interpolate(Su*(1.0/Xi - Xi))*nf; + + fvc::interpolate(rho)*fvc::interpolate(Su*(1.0/Xi - Xi))*nf + ); // Calculate mean and turbulent strain rates // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - volVectorField Ut = U + Su*Xi*n; - volScalarField sigmat = (n & n)*fvc::div(Ut) - (n & fvc::grad(Ut) & n); + volVectorField Ut(U + Su*Xi*n); + volScalarField sigmat((n & n)*fvc::div(Ut) - (n & fvc::grad(Ut) & n)); - volScalarField sigmas = + volScalarField sigmas + ( ((n & n)*fvc::div(U) - (n & fvc::grad(U) & n))/Xi + ( (n & n)*fvc::div(Su*n) - (n & fvc::grad(Su*n) & n) - )*(Xi + scalar(1))/(2*Xi); + )*(Xi + scalar(1))/(2*Xi) + ); // Calculate the unstrained laminar flame speed // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - volScalarField Su0 = unstrainedLaminarFlameSpeed()(); + volScalarField Su0(unstrainedLaminarFlameSpeed()()); // Calculate the laminar flame speed in equilibrium with the applied strain // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - volScalarField SuInf = Su0*max(scalar(1) - sigmas/sigmaExt, scalar(0.01)); + volScalarField SuInf(Su0*max(scalar(1) - sigmas/sigmaExt, scalar(0.01))); if (SuModel == "unstrained") { @@ -130,9 +138,11 @@ if (ign.ignited()) // Solve for the strained laminar flame speed // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - volScalarField Rc = + volScalarField Rc + ( (sigmas*SuInf*(Su0 - SuInf) + sqr(SuMin)*sigmaExt) - /(sqr(Su0 - SuInf) + sqr(SuMin)); + /(sqr(Su0 - SuInf) + sqr(SuMin)) + ); fvScalarMatrix SuEqn ( @@ -183,17 +193,21 @@ if (ign.ignited()) // with a linear correction function to give a plausible profile for Xi // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - volScalarField XiEqStar = - scalar(1.001) + XiCoef*sqrt(up/(Su + SuMin))*Reta; + volScalarField XiEqStar + ( + scalar(1.001) + XiCoef*sqrt(up/(Su + SuMin))*Reta + ); - volScalarField XiEq = + volScalarField XiEq + ( scalar(1.001) + (scalar(1) + (2*XiShapeCoef)*(scalar(0.5) - b)) - *(XiEqStar - scalar(1.001)); + *(XiEqStar - scalar(1.001)) + ); - volScalarField Gstar = 0.28/tauEta; - volScalarField R = Gstar*XiEqStar/(XiEqStar - scalar(1)); - volScalarField G = R*(XiEq - scalar(1.001))/XiEq; + volScalarField Gstar(0.28/tauEta); + volScalarField R(Gstar*XiEqStar/(XiEqStar - scalar(1))); + volScalarField G(R*(XiEq - scalar(1.001))/XiEq); //R *= (Gstar + 2*mag(dev(symm(fvc::grad(U)))))/Gstar; diff --git a/applications/solvers/combustion/XiFoam/createFields.H b/applications/solvers/combustion/XiFoam/createFields.H index ef16bd615c9bef3cfd86788e8fbd5a8a2bb879f3..7a7e796b62c1df021b6d19b2439babc15c985bdb 100644 --- a/applications/solvers/combustion/XiFoam/createFields.H +++ b/applications/solvers/combustion/XiFoam/createFields.H @@ -61,8 +61,10 @@ ); Info<< "Creating field DpDt\n" << endl; - volScalarField DpDt = - fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); + volScalarField DpDt + ( + fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p) + ); Info<< "Creating field Xi\n" << endl; diff --git a/applications/solvers/combustion/XiFoam/pEqn.H b/applications/solvers/combustion/XiFoam/pEqn.H index 3d414f4af63f8ba4f3885a39872b0f628c45070c..4168eb0e3461f9e5c15868dfaed51eb954b25ff0 100644 --- a/applications/solvers/combustion/XiFoam/pEqn.H +++ b/applications/solvers/combustion/XiFoam/pEqn.H @@ -1,6 +1,6 @@ rho = thermo.rho(); -volScalarField rAU = 1.0/UEqn.A(); +volScalarField rAU(1.0/UEqn.A()); U = rAU*UEqn.H(); if (transonic) diff --git a/applications/solvers/combustion/coldEngineFoam/createFields.H b/applications/solvers/combustion/coldEngineFoam/createFields.H index 6bc3139ce6f070445cc5e55ba3b3df839522ab50..9705f04525e4221a3561c51c2f42b5cbef2b55b0 100644 --- a/applications/solvers/combustion/coldEngineFoam/createFields.H +++ b/applications/solvers/combustion/coldEngineFoam/createFields.H @@ -55,5 +55,7 @@ ); Info<< "Creating field DpDt\n" << endl; - volScalarField DpDt = - fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); + volScalarField DpDt + ( + fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p) + ); diff --git a/applications/solvers/combustion/dieselEngineFoam/YEqn.H b/applications/solvers/combustion/dieselEngineFoam/YEqn.H index f6251d1c30424a1cbe145a8f0b9b5e96ea5bc23e..b8d39b4f46f329babb405d32cf0ae14c17c8079c 100644 --- a/applications/solvers/combustion/dieselEngineFoam/YEqn.H +++ b/applications/solvers/combustion/dieselEngineFoam/YEqn.H @@ -12,7 +12,7 @@ tmp<fv::convectionScheme<scalar> > mvConvection { label inertIndex = -1; - volScalarField Yt = 0.0*Y[0]; + volScalarField Yt(0.0*Y[0]); forAll(Y, i) { diff --git a/applications/solvers/combustion/dieselEngineFoam/createFields.H b/applications/solvers/combustion/dieselEngineFoam/createFields.H index 37aeca4c091586b1a6c852afa1228d04d9264a93..4bd9f1a9160ed8509f062834bf7c72adea75f84c 100644 --- a/applications/solvers/combustion/dieselEngineFoam/createFields.H +++ b/applications/solvers/combustion/dieselEngineFoam/createFields.H @@ -82,8 +82,10 @@ autoPtr<compressible::turbulenceModel> turbulence ); Info<< "Creating field DpDt\n" << endl; -volScalarField DpDt = - fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); +volScalarField DpDt +( + fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p) +); multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields; diff --git a/applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C b/applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C index 8ea5d32e5f887805be45221f9295ae414bba2689..649c73281013a9810822ef9f0def8f09ff50a5c5 100644 --- a/applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C +++ b/applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C @@ -94,11 +94,13 @@ int main(int argc, char *argv[]) // turbulent time scale { - volScalarField tk = - Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon()); - volScalarField tc = chemistry.tc(); + volScalarField tk + ( + Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon()) + ); + volScalarField tc(chemistry.tc()); - //Chalmers PaSR model + // Chalmers PaSR model kappa = (runTime.deltaT() + tc)/(runTime.deltaT() + tc + tk); } diff --git a/applications/solvers/combustion/dieselEngineFoam/pEqn.H b/applications/solvers/combustion/dieselEngineFoam/pEqn.H index b68ae732962c2e1f26c46876b69efae206eaaa45..049db9d2501c775d23ec5955d6246381df9e617b 100644 --- a/applications/solvers/combustion/dieselEngineFoam/pEqn.H +++ b/applications/solvers/combustion/dieselEngineFoam/pEqn.H @@ -1,6 +1,6 @@ rho = thermo.rho(); -volScalarField A = UEqn.A(); +volScalarField A(UEqn.A()); U = UEqn.H()/A; if (transonic) diff --git a/applications/solvers/combustion/dieselFoam/dieselFoam.C b/applications/solvers/combustion/dieselFoam/dieselFoam.C index 3bbebfd5ff27ac0c500ead070df00c9b54b1053a..8d9e20e6235750a7b628d45128da62b6aef6dfd8 100644 --- a/applications/solvers/combustion/dieselFoam/dieselFoam.C +++ b/applications/solvers/combustion/dieselFoam/dieselFoam.C @@ -85,9 +85,11 @@ int main(int argc, char *argv[]) // turbulent time scale { - volScalarField tk = - Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon()); - volScalarField tc = chemistry.tc(); + volScalarField tk + ( + Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon()) + ); + volScalarField tc(chemistry.tc()); // Chalmers PaSR model kappa = (runTime.deltaT() + tc)/(runTime.deltaT()+tc+tk); diff --git a/applications/solvers/combustion/dieselFoam/pEqn.H b/applications/solvers/combustion/dieselFoam/pEqn.H index f1b66877a0e08157b4d7c39f6b47f98d821afaa7..cb9f95c03f46c60b7a992dc01d9bb11ce1d0762e 100644 --- a/applications/solvers/combustion/dieselFoam/pEqn.H +++ b/applications/solvers/combustion/dieselFoam/pEqn.H @@ -1,6 +1,6 @@ rho = thermo.rho(); -volScalarField rAU = 1.0/UEqn.A(); +volScalarField rAU(1.0/UEqn.A()); U = rAU*UEqn.H(); if (transonic) diff --git a/applications/solvers/combustion/engineFoam/pEqn.H b/applications/solvers/combustion/engineFoam/pEqn.H index 913180f79425f16f133be7b5f1a274d5c9033a9d..78a90c2357dbad0058e03228d2b35584efa0313e 100644 --- a/applications/solvers/combustion/engineFoam/pEqn.H +++ b/applications/solvers/combustion/engineFoam/pEqn.H @@ -1,6 +1,6 @@ rho = thermo.rho(); -volScalarField rAU = 1.0/UEqn.A(); +volScalarField rAU(1.0/UEqn.A()); U = rAU*UEqn.H(); if (transonic) diff --git a/applications/solvers/combustion/fireFoam/combustionModels/combustionModel/combustionModel.C b/applications/solvers/combustion/fireFoam/combustionModels/combustionModel/combustionModel.C index ddfecc74b03a299911002ca18226130ec48bff96..053f0511c3a51c89603be5a4d8e9dd7ebeaaa794 100644 --- a/applications/solvers/combustion/fireFoam/combustionModels/combustionModel/combustionModel.C +++ b/applications/solvers/combustion/fireFoam/combustionModels/combustionModel/combustionModel.C @@ -32,7 +32,7 @@ namespace Foam { defineTypeNameAndDebug(combustionModel, 0); defineRunTimeSelectionTable(combustionModel, dictionary); -}; +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -78,8 +78,8 @@ Foam::combustionModel::combustionModel::R(volScalarField& fu) const { const basicMultiComponentMixture& composition = thermo_.composition(); const volScalarField& ft = composition.Y("ft"); - volScalarField fres = composition.fres(ft, stoicRatio_.value()); - volScalarField wFuelNorm = this->wFuelNorm()*pos(fu - fres); + volScalarField fres(composition.fres(ft, stoicRatio_.value())); + volScalarField wFuelNorm(this->wFuelNorm()*pos(fu - fres)); return wFuelNorm*fres - fvm::Sp(wFuelNorm, fu); } diff --git a/applications/solvers/combustion/fireFoam/createFields.H b/applications/solvers/combustion/fireFoam/createFields.H index 6a1a40b7779304f220567df699e78034223968f3..73686c56682d8c2734550e4df957577109454894 100644 --- a/applications/solvers/combustion/fireFoam/createFields.H +++ b/applications/solvers/combustion/fireFoam/createFields.H @@ -123,8 +123,10 @@ volScalarField dQ Info<< "Creating field DpDt\n" << endl; -volScalarField DpDt = - fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); +volScalarField DpDt +( + fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p) +); dimensionedScalar initialMass = fvc::domainIntegrate(rho); diff --git a/applications/solvers/combustion/fireFoam/fuhsEqn.H b/applications/solvers/combustion/fireFoam/fuhsEqn.H index 798cee4007e4979d948a7ba4d44af90aba62f5cb..6494ead4f4d7a343df5a78c4a9f7023e840dd984 100644 --- a/applications/solvers/combustion/fireFoam/fuhsEqn.H +++ b/applications/solvers/combustion/fireFoam/fuhsEqn.H @@ -1,7 +1,7 @@ { // Solve fuel equation // ~~~~~~~~~~~~~~~~~~~ - fvScalarMatrix R = combustion->R(fu); + fvScalarMatrix R(combustion->R(fu)); { fvScalarMatrix fuEqn diff --git a/applications/solvers/combustion/fireFoam/pEqn.H b/applications/solvers/combustion/fireFoam/pEqn.H index 135b55d879e34b6cdee878ae43f99db0b981ddf7..e0d120e9e303b722735dd2aae932ecd751b4bb4f 100644 --- a/applications/solvers/combustion/fireFoam/pEqn.H +++ b/applications/solvers/combustion/fireFoam/pEqn.H @@ -1,6 +1,6 @@ rho = thermo.rho(); -volScalarField rAU = 1.0/UEqn.A(); +volScalarField rAU(1.0/UEqn.A()); surfaceScalarField rhorAUf("(rho*(1|A(U)))", fvc::interpolate(rho*rAU)); U = rAU*UEqn.H(); @@ -17,7 +17,7 @@ phi = phiU - rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf(); for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { - surfaceScalarField rhorAUf = fvc::interpolate(rho*rAU); + surfaceScalarField rhorAUf(fvc::interpolate(rho*rAU)); fvScalarMatrix p_rghEqn ( diff --git a/applications/solvers/combustion/reactingFoam/YEqn.H b/applications/solvers/combustion/reactingFoam/YEqn.H index 76d8253795a028a9610293b0e3b9cbef06c76f67..8d63a12868554b2d7c785d97549537c736ac8fa9 100644 --- a/applications/solvers/combustion/reactingFoam/YEqn.H +++ b/applications/solvers/combustion/reactingFoam/YEqn.H @@ -11,7 +11,7 @@ tmp<fv::convectionScheme<scalar> > mvConvection { label inertIndex = -1; - volScalarField Yt = 0.0*Y[0]; + volScalarField Yt(0.0*Y[0]); forAll(Y, i) { diff --git a/applications/solvers/combustion/reactingFoam/chemistry.H b/applications/solvers/combustion/reactingFoam/chemistry.H index d7faf86b0c56719b3be3d75a91b692fae6df92b6..3a36aaac520a9bf63fd20c6b0373ae7e4751a61f 100644 --- a/applications/solvers/combustion/reactingFoam/chemistry.H +++ b/applications/solvers/combustion/reactingFoam/chemistry.H @@ -10,9 +10,14 @@ // turbulent time scale if (turbulentReaction) { - volScalarField tk = - Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon()); - volScalarField tc = chemistry.tc(); + volScalarField tk + ( + Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon()) + ); + volScalarField tc + ( + chemistry.tc() + ); // Chalmers PaSR model kappa = (runTime.deltaT() + tc)/(runTime.deltaT() + tc + tk); diff --git a/applications/solvers/combustion/reactingFoam/createFields.H b/applications/solvers/combustion/reactingFoam/createFields.H index bd8f7ea1fb176bd69dc9d87c9afe30c62fa69750..a2f016e04622295e17aa3c5a67915e5f3feae69c 100644 --- a/applications/solvers/combustion/reactingFoam/createFields.H +++ b/applications/solvers/combustion/reactingFoam/createFields.H @@ -72,8 +72,10 @@ autoPtr<compressible::turbulenceModel> turbulence ); Info<< "Creating field DpDt\n" << endl; -volScalarField DpDt = - fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); +volScalarField DpDt +( + fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p) +); multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields; diff --git a/applications/solvers/combustion/reactingFoam/pEqn.H b/applications/solvers/combustion/reactingFoam/pEqn.H index 3d414f4af63f8ba4f3885a39872b0f628c45070c..4168eb0e3461f9e5c15868dfaed51eb954b25ff0 100644 --- a/applications/solvers/combustion/reactingFoam/pEqn.H +++ b/applications/solvers/combustion/reactingFoam/pEqn.H @@ -1,6 +1,6 @@ rho = thermo.rho(); -volScalarField rAU = 1.0/UEqn.A(); +volScalarField rAU(1.0/UEqn.A()); U = rAU*UEqn.H(); if (transonic) diff --git a/applications/solvers/combustion/rhoReactingFoam/YEqn.H b/applications/solvers/combustion/rhoReactingFoam/YEqn.H index 76d8253795a028a9610293b0e3b9cbef06c76f67..8d63a12868554b2d7c785d97549537c736ac8fa9 100644 --- a/applications/solvers/combustion/rhoReactingFoam/YEqn.H +++ b/applications/solvers/combustion/rhoReactingFoam/YEqn.H @@ -11,7 +11,7 @@ tmp<fv::convectionScheme<scalar> > mvConvection { label inertIndex = -1; - volScalarField Yt = 0.0*Y[0]; + volScalarField Yt(0.0*Y[0]); forAll(Y, i) { diff --git a/applications/solvers/combustion/rhoReactingFoam/chemistry.H b/applications/solvers/combustion/rhoReactingFoam/chemistry.H index 8bfa872d7b395dd0907d4fdb6355322d97853731..841b434a7176d259a77f9d6f756bd1834af773a5 100644 --- a/applications/solvers/combustion/rhoReactingFoam/chemistry.H +++ b/applications/solvers/combustion/rhoReactingFoam/chemistry.H @@ -10,9 +10,11 @@ // turbulent time scale if (turbulentReaction) { - volScalarField tk = - Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon()); - volScalarField tc = chemistry.tc(); + volScalarField tk + ( + Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon()) + ); + volScalarField tc(chemistry.tc()); // Chalmers PaSR model kappa = (runTime.deltaT() + tc)/(runTime.deltaT() + tc + tk); diff --git a/applications/solvers/combustion/rhoReactingFoam/createFields.H b/applications/solvers/combustion/rhoReactingFoam/createFields.H index d4119b8c9263bfdfc3c3eb8942b0dfc6b6007ac9..d58e082f5ba433ad1cc0925ebb5c69c114b9fe9b 100644 --- a/applications/solvers/combustion/rhoReactingFoam/createFields.H +++ b/applications/solvers/combustion/rhoReactingFoam/createFields.H @@ -73,8 +73,10 @@ autoPtr<compressible::turbulenceModel> turbulence ); Info<< "Creating field DpDt\n" << endl; -volScalarField DpDt = - fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); +volScalarField DpDt +( + fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p) +); multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields; diff --git a/applications/solvers/combustion/rhoReactingFoam/pEqn.H b/applications/solvers/combustion/rhoReactingFoam/pEqn.H index 45ae3c1e5fed6f0ed9c574829b27766df9cd6ff4..f11c9792245d8275afd46682ccd77207e5491ea1 100644 --- a/applications/solvers/combustion/rhoReactingFoam/pEqn.H +++ b/applications/solvers/combustion/rhoReactingFoam/pEqn.H @@ -5,14 +5,16 @@ // pressure solution - done in 2 parts. Part 1: thermo.rho() -= psi*p; - volScalarField rAU = 1.0/UEqn.A(); + volScalarField rAU(1.0/UEqn.A()); U = rAU*UEqn.H(); if (transonic) { - surfaceScalarField phiv = + surfaceScalarField phiv + ( (fvc::interpolate(U) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, rho, U, phi); + + fvc::ddtPhiCorr(rAU, rho, U, phi) + ); phi = fvc::interpolate(rho)*phiv; diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.C b/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.C index 08c4354c3a9bfaa9954cebe0ea13822437cb3cd0..92f25ca30de605c8ae3ded7593fd041a789515f1 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.C +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.C @@ -181,13 +181,16 @@ void Foam::smoluchowskiJumpTFvPatchScalarField::updateCoeffs() ) ); - Field<scalar> C2 = pmu/prho + Field<scalar> C2 + ( + pmu/prho *sqrt(ppsi*constant::mathematical::piByTwo) *2.0*gamma_/Pr.value()/(gamma_ + 1.0) - *(2.0 - accommodationCoeff_)/accommodationCoeff_; + *(2.0 - accommodationCoeff_)/accommodationCoeff_ + ); - Field<scalar> aCoeff = prho.snGrad() - prho/C2; - Field<scalar> KEbyRho = 0.5*magSqr(pU); + Field<scalar> aCoeff(prho.snGrad() - prho/C2); + Field<scalar> KEbyRho(0.5*magSqr(pU)); valueFraction() = (1.0/(1.0 + patch().deltaCoeffs()*C2)); refValue() = Twall_; @@ -214,9 +217,11 @@ void Foam::smoluchowskiJumpTFvPatchScalarField::write(Ostream& os) const namespace Foam { - -makePatchTypeField(fvPatchScalarField, smoluchowskiJumpTFvPatchScalarField); - + makeNonTemplatedPatchTypeField + ( + fvPatchScalarField, + smoluchowskiJumpTFvPatchScalarField + ); } diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C b/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C index 4962a338a19c13ef6a518aacbf4e776ac75cf481..85f2db8d4cdc27c2df2875382b87abb376d3c133 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C @@ -83,8 +83,7 @@ maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField if ( mag(accommodationCoeff_) < SMALL - || - mag(accommodationCoeff_) > 2.0 + || mag(accommodationCoeff_) > 2.0 ) { FatalIOErrorIn @@ -142,10 +141,13 @@ void maxwellSlipUFvPatchVectorField::updateCoeffs() const fvPatchField<scalar>& ppsi = patch().lookupPatchField<volScalarField, scalar>("psi"); - Field<scalar> C1 = sqrt(ppsi*constant::mathematical::piByTwo) - *(2.0 - accommodationCoeff_)/accommodationCoeff_; + Field<scalar> C1 + ( + sqrt(ppsi*constant::mathematical::piByTwo) + * (2.0 - accommodationCoeff_)/accommodationCoeff_ + ); - Field<scalar> pnu = pmu/prho; + Field<scalar> pnu(pmu/prho); valueFraction() = (1.0/(1.0 + patch().deltaCoeffs()*C1*pnu)); refValue() = Uwall_; @@ -156,8 +158,8 @@ void maxwellSlipUFvPatchVectorField::updateCoeffs() this->db().objectRegistry::lookupObject<volScalarField>("T"); label patchi = this->patch().index(); const fvPatchScalarField& pT = vsfT.boundaryField()[patchi]; - Field<vector> gradpT = fvc::grad(vsfT)().boundaryField()[patchi]; - vectorField n = patch().nf(); + Field<vector> gradpT(fvc::grad(vsfT)().boundaryField()[patchi]); + vectorField n(patch().nf()); refValue() -= 3.0*pnu/(4.0*pT)*transform(I - n*n, gradpT); } @@ -166,7 +168,7 @@ void maxwellSlipUFvPatchVectorField::updateCoeffs() { const fvPatchTensorField& ptauMC = patch().lookupPatchField<volTensorField, tensor>("tauMC"); - vectorField n = patch().nf(); + vectorField n(patch().nf()); refValue() -= C1/prho*transform(I - n*n, (n & ptauMC)); } @@ -196,7 +198,11 @@ void maxwellSlipUFvPatchVectorField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField(fvPatchVectorField, maxwellSlipUFvPatchVectorField); +makeNonTemplatedPatchTypeField +( + fvPatchVectorField, + maxwellSlipUFvPatchVectorField +); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/mixedFixedValueSlip/mixedFixedValueSlipFvPatchField.C b/applications/solvers/compressible/rhoCentralFoam/BCs/mixedFixedValueSlip/mixedFixedValueSlipFvPatchField.C index 253b2c8af1059d6f47c4f53536ff0a10dc2c89e3..7383a3a58564e638b7cd1541df27f032fa79b79d 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/mixedFixedValueSlip/mixedFixedValueSlipFvPatchField.C +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/mixedFixedValueSlip/mixedFixedValueSlipFvPatchField.C @@ -135,8 +135,8 @@ void mixedFixedValueSlipFvPatchField<Type>::rmap template<class Type> tmp<Field<Type> > mixedFixedValueSlipFvPatchField<Type>::snGrad() const { - vectorField nHat = this->patch().nf(); - Field<Type> pif = this->patchInternalField(); + tmp<vectorField> nHat = this->patch().nf(); + Field<Type> pif(this->patchInternalField()); return ( @@ -155,7 +155,7 @@ void mixedFixedValueSlipFvPatchField<Type>::evaluate(const Pstream::commsTypes) this->updateCoeffs(); } - vectorField nHat = this->patch().nf(); + vectorField nHat(this->patch().nf()); Field<Type>::operator= ( @@ -174,7 +174,7 @@ template<class Type> tmp<Field<Type> > mixedFixedValueSlipFvPatchField<Type>::snGradTransformDiag() const { - vectorField nHat = this->patch().nf(); + vectorField nHat(this->patch().nf()); vectorField diag(nHat.size()); diag.replace(vector::X, mag(nHat.component(vector::X))); diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/mixedFixedValueSlip/mixedFixedValueSlipFvPatchFields.H b/applications/solvers/compressible/rhoCentralFoam/BCs/mixedFixedValueSlip/mixedFixedValueSlipFvPatchFields.H index 142ed89fc25996f287cd61c2f75feec12acea54b..4db898b9257784c9802a4f01c6785dba9199f04f 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/mixedFixedValueSlip/mixedFixedValueSlipFvPatchFields.H +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/mixedFixedValueSlip/mixedFixedValueSlipFvPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(mixedFixedValueSlip) +makePatchTypeFieldTypedefs(mixedFixedValueSlip); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/mixedFixedValueSlip/mixedFixedValueSlipFvPatchFieldsFwd.H b/applications/solvers/compressible/rhoCentralFoam/BCs/mixedFixedValueSlip/mixedFixedValueSlipFvPatchFieldsFwd.H index 818cb7ecaa02cba7904c349d7edca325ab1eb07b..00aedf3f0434b637b1325f080327a16895184996 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/mixedFixedValueSlip/mixedFixedValueSlipFvPatchFieldsFwd.H +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/mixedFixedValueSlip/mixedFixedValueSlipFvPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class mixedFixedValueSlipFvPatchField; -makePatchTypeFieldTypedefs(mixedFixedValueSlip) +makePatchTypeFieldTypedefs(mixedFixedValueSlip); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/rho/fixedRhoFvPatchScalarField.C b/applications/solvers/compressible/rhoCentralFoam/BCs/rho/fixedRhoFvPatchScalarField.C index ca9e9d01585c0479d940fefe102ebf11702d4e3a..c3340f69325a713e67bf710f7582ca251461d252 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/rho/fixedRhoFvPatchScalarField.C +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/rho/fixedRhoFvPatchScalarField.C @@ -112,7 +112,11 @@ void fixedRhoFvPatchScalarField::updateCoeffs() // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField(fvPatchScalarField, fixedRhoFvPatchScalarField); +makeNonTemplatedPatchTypeField +( + fvPatchScalarField, + fixedRhoFvPatchScalarField +); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/compressible/rhoCentralFoam/compressibleCourantNo.H b/applications/solvers/compressible/rhoCentralFoam/compressibleCourantNo.H index 50d75b78555f729c6d804ead12539f36d43a6234..ba404b8a73d7f10d04d7e48650fb0885cd0e6ac8 100644 --- a/applications/solvers/compressible/rhoCentralFoam/compressibleCourantNo.H +++ b/applications/solvers/compressible/rhoCentralFoam/compressibleCourantNo.H @@ -34,8 +34,10 @@ scalar meanCoNum = 0.0; if (mesh.nInternalFaces()) { - surfaceScalarField amaxSfbyDelta = - mesh.surfaceInterpolation::deltaCoeffs()*amaxSf; + surfaceScalarField amaxSfbyDelta + ( + mesh.surfaceInterpolation::deltaCoeffs()*amaxSf + ); CoNum = max(amaxSfbyDelta/mesh.magSf()).value()*runTime.deltaTValue(); diff --git a/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/rhoCentralDyMFoam.C b/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/rhoCentralDyMFoam.C index c151f4ffcb1a2b7afde76444016bc5a92581f999..fd1e550668ef77cd73c3e49069b848a2144e5ea3 100644 --- a/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/rhoCentralDyMFoam.C +++ b/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/rhoCentralDyMFoam.C @@ -62,52 +62,76 @@ int main(int argc, char *argv[]) { // --- upwind interpolation of primitive fields on faces - surfaceScalarField rho_pos = - fvc::interpolate(rho, pos, "reconstruct(rho)"); - surfaceScalarField rho_neg = - fvc::interpolate(rho, neg, "reconstruct(rho)"); + surfaceScalarField rho_pos + ( + fvc::interpolate(rho, pos, "reconstruct(rho)") + ); + surfaceScalarField rho_neg + ( + fvc::interpolate(rho, neg, "reconstruct(rho)") + ); - surfaceVectorField rhoU_pos = - fvc::interpolate(rhoU, pos, "reconstruct(U)"); - surfaceVectorField rhoU_neg = - fvc::interpolate(rhoU, neg, "reconstruct(U)"); + surfaceVectorField rhoU_pos + ( + fvc::interpolate(rhoU, pos, "reconstruct(U)") + ); + surfaceVectorField rhoU_neg + ( + fvc::interpolate(rhoU, neg, "reconstruct(U)") + ); - volScalarField rPsi = 1.0/psi; - surfaceScalarField rPsi_pos = - fvc::interpolate(rPsi, pos, "reconstruct(T)"); - surfaceScalarField rPsi_neg = - fvc::interpolate(rPsi, neg, "reconstruct(T)"); + volScalarField rPsi(1.0/psi); + surfaceScalarField rPsi_pos + ( + fvc::interpolate(rPsi, pos, "reconstruct(T)") + ); + surfaceScalarField rPsi_neg + ( + fvc::interpolate(rPsi, neg, "reconstruct(T)") + ); - surfaceScalarField e_pos = - fvc::interpolate(e, pos, "reconstruct(T)"); - surfaceScalarField e_neg = - fvc::interpolate(e, neg, "reconstruct(T)"); + surfaceScalarField e_pos + ( + fvc::interpolate(e, pos, "reconstruct(T)") + ); + surfaceScalarField e_neg + ( + fvc::interpolate(e, neg, "reconstruct(T)") + ); - surfaceVectorField U_pos = rhoU_pos/rho_pos; - surfaceVectorField U_neg = rhoU_neg/rho_neg; + surfaceVectorField U_pos(rhoU_pos/rho_pos); + surfaceVectorField U_neg(rhoU_neg/rho_neg); - surfaceScalarField p_pos = rho_pos*rPsi_pos; - surfaceScalarField p_neg = rho_neg*rPsi_neg; + surfaceScalarField p_pos(rho_pos*rPsi_pos); + surfaceScalarField p_neg(rho_neg*rPsi_neg); - surfaceScalarField phiv_pos = U_pos & mesh.Sf(); - surfaceScalarField phiv_neg = U_neg & mesh.Sf(); + surfaceScalarField phiv_pos(U_pos & mesh.Sf()); + surfaceScalarField phiv_neg(U_neg & mesh.Sf()); - volScalarField c = sqrt(thermo.Cp()/thermo.Cv()*rPsi); - surfaceScalarField cSf_pos = - fvc::interpolate(c, pos, "reconstruct(T)")*mesh.magSf(); - surfaceScalarField cSf_neg = - fvc::interpolate(c, neg, "reconstruct(T)")*mesh.magSf(); + volScalarField c(sqrt(thermo.Cp()/thermo.Cv()*rPsi)); + surfaceScalarField cSf_pos + ( + fvc::interpolate(c, pos, "reconstruct(T)")*mesh.magSf() + ); + surfaceScalarField cSf_neg + ( + fvc::interpolate(c, neg, "reconstruct(T)")*mesh.magSf() + ); - surfaceScalarField ap = - max(max(phiv_pos + cSf_pos, phiv_neg + cSf_neg), v_zero); - surfaceScalarField am = - min(min(phiv_pos - cSf_pos, phiv_neg - cSf_neg), v_zero); + surfaceScalarField ap + ( + max(max(phiv_pos + cSf_pos, phiv_neg + cSf_neg), v_zero) + ); + surfaceScalarField am + ( + min(min(phiv_pos - cSf_pos, phiv_neg - cSf_neg), v_zero) + ); - surfaceScalarField a_pos = ap/(ap - am); + surfaceScalarField a_pos(ap/(ap - am)); surfaceScalarField amaxSf("amaxSf", max(mag(am), mag(ap))); - surfaceScalarField aSf = am*a_pos; + surfaceScalarField aSf(am*a_pos); if (fluxScheme == "Tadmor") { @@ -115,13 +139,13 @@ int main(int argc, char *argv[]) a_pos = 0.5; } - surfaceScalarField a_neg = (1.0 - a_pos); + surfaceScalarField a_neg(1.0 - a_pos); phiv_pos *= a_pos; phiv_neg *= a_neg; - surfaceScalarField aphiv_pos = phiv_pos - aSf; - surfaceScalarField aphiv_neg = phiv_neg + aSf; + surfaceScalarField aphiv_pos(phiv_pos - aSf); + surfaceScalarField aphiv_neg(phiv_neg + aSf); // Reuse amaxSf for the maximum positive and negative fluxes // estimated by the central scheme @@ -148,14 +172,18 @@ int main(int argc, char *argv[]) surfaceScalarField phi("phi", aphiv_pos*rho_pos + aphiv_neg*rho_neg); - surfaceVectorField phiUp = + surfaceVectorField phiUp + ( (aphiv_pos*rhoU_pos + aphiv_neg*rhoU_neg) - + (a_pos*p_pos + a_neg*p_neg)*mesh.Sf(); + + (a_pos*p_pos + a_neg*p_neg)*mesh.Sf() + ); - surfaceScalarField phiEp = + surfaceScalarField phiEp + ( aphiv_pos*(rho_pos*(e_pos + 0.5*magSqr(U_pos)) + p_pos) + aphiv_neg*(rho_neg*(e_neg + 0.5*magSqr(U_neg)) + p_neg) - + aSf*p_pos - aSf*p_neg; + + aSf*p_pos - aSf*p_neg + ); volTensorField tauMC("tauMC", mu*dev2(Foam::T(fvc::grad(U)))); @@ -185,7 +213,7 @@ int main(int argc, char *argv[]) } // --- Solve energy - surfaceScalarField sigmaDotU = + surfaceScalarField sigmaDotU ( ( fvc::interpolate(mu)*mesh.magSf()*fvc::snGrad(U) diff --git a/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C b/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C index 42c8eb11d6bf8939c15f32884259603a060c5cc8..377795191c3a67b51aafe6ced3d6f72c9a560727 100644 --- a/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C +++ b/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C @@ -59,48 +59,72 @@ int main(int argc, char *argv[]) { // --- upwind interpolation of primitive fields on faces - surfaceScalarField rho_pos = - fvc::interpolate(rho, pos, "reconstruct(rho)"); - surfaceScalarField rho_neg = - fvc::interpolate(rho, neg, "reconstruct(rho)"); + surfaceScalarField rho_pos + ( + fvc::interpolate(rho, pos, "reconstruct(rho)") + ); + surfaceScalarField rho_neg + ( + fvc::interpolate(rho, neg, "reconstruct(rho)") + ); - surfaceVectorField rhoU_pos = - fvc::interpolate(rhoU, pos, "reconstruct(U)"); - surfaceVectorField rhoU_neg = - fvc::interpolate(rhoU, neg, "reconstruct(U)"); + surfaceVectorField rhoU_pos + ( + fvc::interpolate(rhoU, pos, "reconstruct(U)") + ); + surfaceVectorField rhoU_neg + ( + fvc::interpolate(rhoU, neg, "reconstruct(U)") + ); - volScalarField rPsi = 1.0/psi; - surfaceScalarField rPsi_pos = - fvc::interpolate(rPsi, pos, "reconstruct(T)"); - surfaceScalarField rPsi_neg = - fvc::interpolate(rPsi, neg, "reconstruct(T)"); + volScalarField rPsi(1.0/psi); + surfaceScalarField rPsi_pos + ( + fvc::interpolate(rPsi, pos, "reconstruct(T)") + ); + surfaceScalarField rPsi_neg + ( + fvc::interpolate(rPsi, neg, "reconstruct(T)") + ); - surfaceScalarField e_pos = - fvc::interpolate(e, pos, "reconstruct(T)"); - surfaceScalarField e_neg = - fvc::interpolate(e, neg, "reconstruct(T)"); + surfaceScalarField e_pos + ( + fvc::interpolate(e, pos, "reconstruct(T)") + ); + surfaceScalarField e_neg + ( + fvc::interpolate(e, neg, "reconstruct(T)") + ); - surfaceVectorField U_pos = rhoU_pos/rho_pos; - surfaceVectorField U_neg = rhoU_neg/rho_neg; + surfaceVectorField U_pos(rhoU_pos/rho_pos); + surfaceVectorField U_neg(rhoU_neg/rho_neg); - surfaceScalarField p_pos = rho_pos*rPsi_pos; - surfaceScalarField p_neg = rho_neg*rPsi_neg; + surfaceScalarField p_pos(rho_pos*rPsi_pos); + surfaceScalarField p_neg(rho_neg*rPsi_neg); - surfaceScalarField phiv_pos = U_pos & mesh.Sf(); - surfaceScalarField phiv_neg = U_neg & mesh.Sf(); + surfaceScalarField phiv_pos(U_pos & mesh.Sf()); + surfaceScalarField phiv_neg(U_neg & mesh.Sf()); - volScalarField c = sqrt(thermo.Cp()/thermo.Cv()*rPsi); - surfaceScalarField cSf_pos = - fvc::interpolate(c, pos, "reconstruct(T)")*mesh.magSf(); - surfaceScalarField cSf_neg = - fvc::interpolate(c, neg, "reconstruct(T)")*mesh.magSf(); + volScalarField c(sqrt(thermo.Cp()/thermo.Cv()*rPsi)); + surfaceScalarField cSf_pos + ( + fvc::interpolate(c, pos, "reconstruct(T)")*mesh.magSf() + ); + surfaceScalarField cSf_neg + ( + fvc::interpolate(c, neg, "reconstruct(T)")*mesh.magSf() + ); - surfaceScalarField ap = - max(max(phiv_pos + cSf_pos, phiv_neg + cSf_neg), v_zero); - surfaceScalarField am = - min(min(phiv_pos - cSf_pos, phiv_neg - cSf_neg), v_zero); + surfaceScalarField ap + ( + max(max(phiv_pos + cSf_pos, phiv_neg + cSf_neg), v_zero) + ); + surfaceScalarField am + ( + min(min(phiv_pos - cSf_pos, phiv_neg - cSf_neg), v_zero) + ); - surfaceScalarField a_pos = ap/(ap - am); + surfaceScalarField a_pos(ap/(ap - am)); surfaceScalarField amaxSf("amaxSf", max(mag(am), mag(ap))); @@ -112,7 +136,7 @@ int main(int argc, char *argv[]) Info<< "Time = " << runTime.timeName() << nl << endl; - surfaceScalarField aSf = am*a_pos; + surfaceScalarField aSf(am*a_pos); if (fluxScheme == "Tadmor") { @@ -120,24 +144,28 @@ int main(int argc, char *argv[]) a_pos = 0.5; } - surfaceScalarField a_neg = (1.0 - a_pos); + surfaceScalarField a_neg(1.0 - a_pos); phiv_pos *= a_pos; phiv_neg *= a_neg; - surfaceScalarField aphiv_pos = phiv_pos - aSf; - surfaceScalarField aphiv_neg = phiv_neg + aSf; + surfaceScalarField aphiv_pos(phiv_pos - aSf); + surfaceScalarField aphiv_neg(phiv_neg + aSf); surfaceScalarField phi("phi", aphiv_pos*rho_pos + aphiv_neg*rho_neg); - surfaceVectorField phiUp = + surfaceVectorField phiUp + ( (aphiv_pos*rhoU_pos + aphiv_neg*rhoU_neg) - + (a_pos*p_pos + a_neg*p_neg)*mesh.Sf(); + + (a_pos*p_pos + a_neg*p_neg)*mesh.Sf() + ); - surfaceScalarField phiEp = + surfaceScalarField phiEp + ( aphiv_pos*(rho_pos*(e_pos + 0.5*magSqr(U_pos)) + p_pos) + aphiv_neg*(rho_neg*(e_neg + 0.5*magSqr(U_neg)) + p_neg) - + aSf*p_pos - aSf*p_neg; + + aSf*p_pos - aSf*p_neg + ); volTensorField tauMC("tauMC", mu*dev2(Foam::T(fvc::grad(U)))); @@ -167,7 +195,7 @@ int main(int argc, char *argv[]) } // --- Solve energy - surfaceScalarField sigmaDotU = + surfaceScalarField sigmaDotU ( ( fvc::interpolate(mu)*mesh.magSf()*fvc::snGrad(U) diff --git a/applications/solvers/compressible/rhoPimpleFoam/UEqn.H b/applications/solvers/compressible/rhoPimpleFoam/UEqn.H index 45aa8f7790047112fc49496cca05f305442d07fe..27b06029b8841465d8775a4d9f9cba86332b57bc 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/UEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/UEqn.H @@ -9,7 +9,7 @@ tmp<fvVectorMatrix> UEqn UEqn().relax(); -volScalarField rAU = 1.0/UEqn().A(); +volScalarField rAU(1.0/UEqn().A()); if (momentumPredictor) { diff --git a/applications/solvers/compressible/rhoPimpleFoam/createFields.H b/applications/solvers/compressible/rhoPimpleFoam/createFields.H index 4642e10ef8aa6f20ae17e49072bf9021a0f0d33f..3c29a987d3617a7cddccdbb8de031d6107f10141 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/createFields.H +++ b/applications/solvers/compressible/rhoPimpleFoam/createFields.H @@ -52,5 +52,7 @@ ); Info<< "Creating field DpDt\n" << endl; - volScalarField DpDt = - fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); + volScalarField DpDt + ( + fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p) + ); diff --git a/applications/solvers/compressible/rhoPorousMRFPimpleFoam/UEqn.H b/applications/solvers/compressible/rhoPorousMRFPimpleFoam/UEqn.H index 0b0364b7067df2267c90be0076d1dc09ea71f211..faae8152ca6b7f37de58338c1b8e0c11654f40a3 100644 --- a/applications/solvers/compressible/rhoPorousMRFPimpleFoam/UEqn.H +++ b/applications/solvers/compressible/rhoPorousMRFPimpleFoam/UEqn.H @@ -12,7 +12,7 @@ UEqn().relax(); mrfZones.addCoriolis(rho, UEqn()); pZones.addResistance(UEqn()); -volScalarField rAU = 1.0/UEqn().A(); +volScalarField rAU(1.0/UEqn().A()); if (momentumPredictor) { diff --git a/applications/solvers/compressible/rhoPorousMRFPimpleFoam/createFields.H b/applications/solvers/compressible/rhoPorousMRFPimpleFoam/createFields.H index cc8f6436a19ecdbc7dd1b1abc44f9c1bc918244f..9dd30f53cfe865194b2b8f6119e2e1f38148127b 100644 --- a/applications/solvers/compressible/rhoPorousMRFPimpleFoam/createFields.H +++ b/applications/solvers/compressible/rhoPorousMRFPimpleFoam/createFields.H @@ -65,8 +65,10 @@ Info<< "Creating field DpDt\n" << endl; - volScalarField DpDt = - fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); + volScalarField DpDt + ( + fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p) + ); MRFZones mrfZones(mesh); mrfZones.correctBoundaryVelocity(U); diff --git a/applications/solvers/compressible/rhoPorousMRFPimpleFoam/pEqn.H b/applications/solvers/compressible/rhoPorousMRFPimpleFoam/pEqn.H index 590a3c1950c55be4f6f5b68b3d63954f290b50f9..3802c9298a6fb7d2495d0a680513db62a0e3943b 100644 --- a/applications/solvers/compressible/rhoPorousMRFPimpleFoam/pEqn.H +++ b/applications/solvers/compressible/rhoPorousMRFPimpleFoam/pEqn.H @@ -1,6 +1,6 @@ rho = thermo.rho(); -volScalarField rAU = 1.0/UEqn().A(); +volScalarField rAU(1.0/UEqn().A()); U = rAU*UEqn().H(); if (nCorr <= 1) diff --git a/applications/solvers/compressible/rhoPorousSimpleFoam/UEqn.H b/applications/solvers/compressible/rhoPorousSimpleFoam/UEqn.H index fd79c8400e7f52300f5ea60878436caabe71711d..c600b1ca0bf90734ddf3a48ad097238cec6c6f42 100644 --- a/applications/solvers/compressible/rhoPorousSimpleFoam/UEqn.H +++ b/applications/solvers/compressible/rhoPorousSimpleFoam/UEqn.H @@ -22,7 +22,7 @@ trTU = inv(tTU()); trTU().rename("rAU"); - volVectorField gradp = fvc::grad(p); + volVectorField gradp(fvc::grad(p)); for (int UCorr=0; UCorr<nUCorr; UCorr++) { diff --git a/applications/solvers/compressible/rhoSimpleFoam/pEqn.H b/applications/solvers/compressible/rhoSimpleFoam/pEqn.H index a082cac88053d27820e9d3128acef52f9c9a583f..4574a096efe84d2264c578eb439d42d5e6f2a838 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/pEqn.H +++ b/applications/solvers/compressible/rhoSimpleFoam/pEqn.H @@ -3,7 +3,7 @@ rho = max(rho, rhoMin); rho = min(rho, rhoMax); rho.relax(); -volScalarField rAU = 1.0/UEqn().A(); +volScalarField rAU(1.0/UEqn().A()); U = rAU*UEqn().H(); UEqn.clear(); diff --git a/applications/solvers/compressible/rhoSimplecFoam/pEqn.H b/applications/solvers/compressible/rhoSimplecFoam/pEqn.H index 2e370cc4473c41184c4f42238c75ea187774b396..36b77f039956ad5e23c54f1cfa49ae7955ed482b 100644 --- a/applications/solvers/compressible/rhoSimplecFoam/pEqn.H +++ b/applications/solvers/compressible/rhoSimplecFoam/pEqn.H @@ -3,10 +3,10 @@ rho = max(rho, rhoMin); rho = min(rho, rhoMax); rho.relax(); -volScalarField p0 = p; +volScalarField p0(p); -volScalarField AU = UEqn().A(); -volScalarField AtU = AU - UEqn().H1(); +volScalarField AU(UEqn().A()); +volScalarField AtU(AU - UEqn().H1()); U = UEqn().H()/AU; UEqn.clear(); diff --git a/applications/solvers/compressible/sonicDyMFoam/createFields.H b/applications/solvers/compressible/sonicDyMFoam/createFields.H index 4344a4f5e49451f647a322eb45b08bd07bf062b5..8367d7e3311f745026c65d2cc607757afef02825 100644 --- a/applications/solvers/compressible/sonicDyMFoam/createFields.H +++ b/applications/solvers/compressible/sonicDyMFoam/createFields.H @@ -51,5 +51,7 @@ ); Info<< "Creating field DpDt\n" << endl; - volScalarField DpDt = - fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); + volScalarField DpDt + ( + fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p) + ); diff --git a/applications/solvers/compressible/sonicFoam/pEqn.H b/applications/solvers/compressible/sonicFoam/pEqn.H index 8d6040b53009e8336acd86024851bd4a7d30a4d5..a4311dfd2ea5975ce206395fab72dcbf8486634b 100644 --- a/applications/solvers/compressible/sonicFoam/pEqn.H +++ b/applications/solvers/compressible/sonicFoam/pEqn.H @@ -1,6 +1,6 @@ rho = thermo.rho(); -volScalarField rAU = 1.0/UEqn.A(); +volScalarField rAU(1.0/UEqn.A()); U = rAU*UEqn.H(); surfaceScalarField phid diff --git a/applications/solvers/compressible/sonicLiquidFoam/sonicLiquidFoam.C b/applications/solvers/compressible/sonicLiquidFoam/sonicLiquidFoam.C index c92f3d82f9e7766ad53f92e4384c23443a904929..8ff86697f4d89a229573c7582e657ec91cc10446 100644 --- a/applications/solvers/compressible/sonicLiquidFoam/sonicLiquidFoam.C +++ b/applications/solvers/compressible/sonicLiquidFoam/sonicLiquidFoam.C @@ -71,7 +71,7 @@ int main(int argc, char *argv[]) for (int corr=0; corr<nCorr; corr++) { - volScalarField rAU = 1.0/UEqn.A(); + volScalarField rAU(1.0/UEqn.A()); U = rAU*UEqn.H(); surfaceScalarField phid diff --git a/applications/solvers/electromagnetics/mhdFoam/mhdFoam.C b/applications/solvers/electromagnetics/mhdFoam/mhdFoam.C index 7ebefc77f91ef07005e92fd64dd871173566d4b9..4a885a268b098b7aac2eeccc8e9441b7203ab6be 100644 --- a/applications/solvers/electromagnetics/mhdFoam/mhdFoam.C +++ b/applications/solvers/electromagnetics/mhdFoam/mhdFoam.C @@ -92,7 +92,7 @@ int main(int argc, char *argv[]) for (int corr=0; corr<nCorr; corr++) { - volScalarField rAU = 1.0/UEqn.A(); + volScalarField rAU(1.0/UEqn.A()); U = rAU*UEqn.H(); @@ -136,7 +136,7 @@ int main(int argc, char *argv[]) BEqn.solve(); - volScalarField rBA = 1.0/BEqn.A(); + volScalarField rBA(1.0/BEqn.A()); phiB = (fvc::interpolate(B) & mesh.Sf()) + fvc::ddtPhiCorr(rBA, B, phiB); diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/pEqn.H index 1e972269ff6b0aadb86b4c3522048f93244e947a..897ce2a0978c2b545f642f29a56dd4b89316e2bc 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/pEqn.H @@ -7,7 +7,7 @@ phi = (fvc::interpolate(U) & mesh.Sf()) + fvc::ddtPhiCorr(rAU, U, phi); - surfaceScalarField buoyancyPhi = rAUf*ghf*fvc::snGrad(rhok)*mesh.magSf(); + surfaceScalarField buoyancyPhi(rAUf*ghf*fvc::snGrad(rhok)*mesh.magSf()); phi -= buoyancyPhi; for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/pEqn.H index daa7867fd5b841f9c35a88271d99869066203d0e..0e8ae4e7933fc7f355b672678e41e827440fcfa3 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/pEqn.H @@ -8,7 +8,7 @@ phi = fvc::interpolate(U) & mesh.Sf(); adjustPhi(phi, U, p_rgh); - surfaceScalarField buoyancyPhi = rAUf*ghf*fvc::snGrad(rhok)*mesh.magSf(); + surfaceScalarField buoyancyPhi(rAUf*ghf*fvc::snGrad(rhok)*mesh.magSf()); phi -= buoyancyPhi; for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H index 05863b264c80e3e9b52201864d176e727429bf4f..768876c316ba6dffe7e55751b69413353bb8d088 100644 --- a/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H @@ -5,7 +5,7 @@ // pressure solution - done in 2 parts. Part 1: thermo.rho() -= psi*p_rgh; - volScalarField rAU = 1.0/UEqn.A(); + volScalarField rAU(1.0/UEqn.A()); surfaceScalarField rhorAUf("(rho*(1|A(U)))", fvc::interpolate(rho*rAU)); U = rAU*UEqn.H(); @@ -16,7 +16,7 @@ + fvc::ddtPhiCorr(rAU, rho, U, phi) ); - surfaceScalarField buoyancyPhi = -rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf(); + surfaceScalarField buoyancyPhi(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf()); phi += buoyancyPhi; for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H index 197005e0f7b9fe96ecca189c074003abce3d9821..6f39aff1c1481d408aa9e42c0bde7fd11bdfc335 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H @@ -2,7 +2,7 @@ rho = thermo.rho(); rho.relax(); - volScalarField rAU = 1.0/UEqn().A(); + volScalarField rAU(1.0/UEqn().A()); surfaceScalarField rhorAUf("(rho*(1|A(U)))", fvc::interpolate(rho*rAU)); U = rAU*UEqn().H(); @@ -11,7 +11,7 @@ phi = fvc::interpolate(rho)*(fvc::interpolate(U) & mesh.Sf()); bool closedVolume = adjustPhi(phi, U, p_rgh); - surfaceScalarField buoyancyPhi = rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf(); + surfaceScalarField buoyancyPhi(rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf()); phi -= buoyancyPhi; for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam_old/pEqn.H b/applications/solvers/heatTransfer/buoyantSimpleFoam_old/pEqn.H index 34536155ef0c8264861188dbeea6a599ebab4eb0..a90dd23ebcefa831598ea8b4fa3b711ae802f648 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam_old/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam_old/pEqn.H @@ -1,7 +1,7 @@ { rho = thermo.rho(); - volScalarField rAU = 1.0/UEqn().A(); + volScalarField rAU(1.0/UEqn().A()); surfaceScalarField rhorAUf("(rho*(1|A(U)))", fvc::interpolate(rho*rAU)); U = rAU*UEqn().H(); @@ -10,8 +10,10 @@ phi = fvc::interpolate(rho)*(fvc::interpolate(U) & mesh.Sf()); bool closedVolume = adjustPhi(phi, U, p); - surfaceScalarField buoyancyPhi = - rhorAUf*fvc::interpolate(rho)*(g & mesh.Sf()); + surfaceScalarField buoyancyPhi + ( + rhorAUf*fvc::interpolate(rho)*(g & mesh.Sf()) + ); phi += buoyancyPhi; for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/pEqn.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/pEqn.H index 2f339b87d7c3011339aeb56d7d5d49e84d8c23db..862581ef790689a49475e6254d39de6f238e8437 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/pEqn.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/pEqn.H @@ -4,7 +4,7 @@ rho = min(rho, rhoMax[i]); rho.relax(); - volScalarField rAU = 1.0/UEqn().A(); + volScalarField rAU(1.0/UEqn().A()); surfaceScalarField rhorAUf("(rho*(1|A(U)))", fvc::interpolate(rho*rAU)); U = rAU*UEqn().H(); @@ -15,7 +15,7 @@ dimensionedScalar compressibility = fvc::domainIntegrate(psi); bool compressible = (compressibility.value() > SMALL); - surfaceScalarField buoyancyPhi = rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf(); + surfaceScalarField buoyancyPhi(rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf()); phi -= buoyancyPhi; // Solve pressure diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C index d578cc9682f4bd49ac149f485029ba1d82749328..93caaf34fb8d35f50d436bcd9092260f331d4561 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C @@ -138,7 +138,7 @@ Foam::solidWallHeatFluxTemperatureFvPatchScalarField::K() const const symmTensorField& KWall = patch().lookupPatchField<volSymmTensorField, scalar>(KName_); - vectorField n = patch().nf(); + vectorField n(patch().nf()); return n & KWall & n; } @@ -203,7 +203,7 @@ void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::write namespace Foam { - makePatchTypeField + makeNonTemplatedPatchTypeField ( fvPatchScalarField, solidWallHeatFluxTemperatureFvPatchScalarField diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/compressibleCourantNo.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/compressibleCourantNo.C index 606cd811ea96818b0b2d8043ee03a57b23b474c2..0af7eaa06e1aee1309d67e6b592f08e04d5846be 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/compressibleCourantNo.C +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/compressibleCourantNo.C @@ -34,9 +34,11 @@ Foam::scalar Foam::compressibleCourantNo const surfaceScalarField& phi ) { - scalarField sumPhi = + scalarField sumPhi + ( fvc::surfaceSum(mag(phi))().internalField() - /rho.internalField(); + / rho.internalField() + ); scalar CoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue(); diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H index 854dc9e2cc3e169e2034b883f3653e871ed77092..07ab9c92e81799f1f80653cb414c095829c0e927 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H @@ -5,7 +5,7 @@ rho = thermo.rho(); - volScalarField rAU = 1.0/UEqn().A(); + volScalarField rAU(1.0/UEqn().A()); surfaceScalarField rhorAUf("(rho*(1|A(U)))", fvc::interpolate(rho*rAU)); U = rAU*UEqn().H(); diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffNo.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffNo.C index 322628b9ecddc54e6ca5df019277e4b3f1c9f95f..bb395003a3bba43b3787b1d84857c5e5b20d5449 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffNo.C +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffNo.C @@ -39,10 +39,12 @@ Foam::scalar Foam::solidRegionDiffNo //- Take care: can have fluid domains with 0 cells so do not test for // zero internal faces. - surfaceScalarField KrhoCpbyDelta = + surfaceScalarField KrhoCpbyDelta + ( mesh.surfaceInterpolation::deltaCoeffs() * fvc::interpolate(K) - / fvc::interpolate(Cprho); + / fvc::interpolate(Cprho) + ); DiNum = gMax(KrhoCpbyDelta.internalField())*runTime.deltaT().value(); @@ -66,14 +68,16 @@ Foam::scalar Foam::solidRegionDiffNo scalar DiNum = 0.0; scalar meanDiNum = 0.0; - volScalarField K = mag(Kdirectional); + volScalarField K(mag(Kdirectional)); //- Take care: can have fluid domains with 0 cells so do not test for // zero internal faces. - surfaceScalarField KrhoCpbyDelta = + surfaceScalarField KrhoCpbyDelta + ( mesh.surfaceInterpolation::deltaCoeffs() * fvc::interpolate(K) - / fvc::interpolate(Cprho); + / fvc::interpolate(Cprho) + ); DiNum = gMax(KrhoCpbyDelta.internalField())*runTime.deltaT().value(); diff --git a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletPressure/adjointOutletPressureFvPatchScalarField.C b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletPressure/adjointOutletPressureFvPatchScalarField.C index 5614578429eeb521768fb9ce6c8e27dc78a7d268..0d94768b236e41975a434c58b1dd94222c2f19e1 100644 --- a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletPressure/adjointOutletPressureFvPatchScalarField.C +++ b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletPressure/adjointOutletPressureFvPatchScalarField.C @@ -121,7 +121,7 @@ void Foam::adjointOutletPressureFvPatchScalarField::write(Ostream& os) const namespace Foam { - makePatchTypeField + makeNonTemplatedPatchTypeField ( fvPatchScalarField, adjointOutletPressureFvPatchScalarField diff --git a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.C b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.C index 0a00076eafcdb34c0a337d60e712797d342c4686..dbde31a88a6b4164344469e5d2953a0e8eafe050 100644 --- a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.C +++ b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.C @@ -96,10 +96,10 @@ void Foam::adjointOutletVelocityFvPatchVectorField::updateCoeffs() const fvPatchField<vector>& Up = patch().lookupPatchField<volVectorField, vector>("U"); - scalarField Un = mag(patch().nf() & Up); - vectorField UtHat = (Up - patch().nf()*Un)/(Un + SMALL); + scalarField Un(mag(patch().nf() & Up)); + vectorField UtHat((Up - patch().nf()*Un)/(Un + SMALL)); - vectorField Uan = patch().nf()*(patch().nf() & patchInternalField()); + vectorField Uan(patch().nf()*(patch().nf() & patchInternalField())); vectorField::operator=(phiap*patch().Sf()/sqr(patch().magSf()) + UtHat); //vectorField::operator=(Uan + UtHat); @@ -119,7 +119,7 @@ void Foam::adjointOutletVelocityFvPatchVectorField::write(Ostream& os) const namespace Foam { - makePatchTypeField + makeNonTemplatedPatchTypeField ( fvPatchVectorField, adjointOutletVelocityFvPatchVectorField diff --git a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointShapeOptimizationFoam.C b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointShapeOptimizationFoam.C index a18298f826760c2ea1b2a626829b458e2a35f613..de7a9276ae6087ad5cbf797383e3b79924966737 100644 --- a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointShapeOptimizationFoam.C +++ b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointShapeOptimizationFoam.C @@ -114,7 +114,7 @@ int main(int argc, char *argv[]) solve(UEqn() == -fvc::grad(p)); p.boundaryField().updateCoeffs(); - volScalarField rAU = 1.0/UEqn().A(); + volScalarField rAU(1.0/UEqn().A()); U = rAU*UEqn().H(); UEqn.clear(); phi = fvc::interpolate(U) & mesh.Sf(); @@ -153,10 +153,13 @@ int main(int argc, char *argv[]) { // Adjoint Momentum predictor - volVectorField adjointTransposeConvection = (fvc::grad(Ua) & U); - //volVectorField adjointTransposeConvection = fvc::reconstruct + volVectorField adjointTransposeConvection((fvc::grad(Ua) & U)); + //volVectorField adjointTransposeConvection //( - // mesh.magSf()*(fvc::snGrad(Ua) & fvc::interpolate(U)) + // fvc::reconstruct + // ( + // mesh.magSf()*(fvc::snGrad(Ua) & fvc::interpolate(U)) + // ) //); zeroCells(adjointTransposeConvection, inletCells); @@ -174,7 +177,7 @@ int main(int argc, char *argv[]) solve(UaEqn() == -fvc::grad(pa)); pa.boundaryField().updateCoeffs(); - volScalarField rAUa = 1.0/UaEqn().A(); + volScalarField rAUa(1.0/UaEqn().A()); Ua = rAUa*UaEqn().H(); UaEqn.clear(); phia = fvc::interpolate(Ua) & mesh.Sf(); diff --git a/applications/solvers/incompressible/boundaryFoam/boundaryFoam.C b/applications/solvers/incompressible/boundaryFoam/boundaryFoam.C index af2798cc3286798d3116960d7fbdfa08b52d314e..4bfdd66f4666bcd3c03be8ef4cc354e7c2f7c338 100644 --- a/applications/solvers/incompressible/boundaryFoam/boundaryFoam.C +++ b/applications/solvers/incompressible/boundaryFoam/boundaryFoam.C @@ -60,7 +60,7 @@ int main(int argc, char *argv[]) { Info<< "Time = " << runTime.timeName() << nl << endl; - fvVectorMatrix divR = turbulence->divDevReff(U); + fvVectorMatrix divR(turbulence->divDevReff(U)); divR.source() = flowMask & divR.source(); fvVectorMatrix UEqn diff --git a/applications/solvers/incompressible/boundaryFoam/evaluateNearWall.H b/applications/solvers/incompressible/boundaryFoam/evaluateNearWall.H index 8844f21e6eadf0101335e0dad056990f9d964000..3534caebd03b7ce0cd73f72c443c01cb683b5ce9 100644 --- a/applications/solvers/incompressible/boundaryFoam/evaluateNearWall.H +++ b/applications/solvers/incompressible/boundaryFoam/evaluateNearWall.H @@ -1,7 +1,7 @@ { // Evaluate near-wall behaviour - scalar nu = turbulence->nu().boundaryField()[patchId][faceId]; + scalar nu = turbulence->nu()().boundaryField()[patchId][faceId]; scalar nut = turbulence->nut()().boundaryField()[patchId][faceId]; symmTensor R = turbulence->devReff()().boundaryField()[patchId][faceId]; scalar epsilon = turbulence->epsilon()()[cellId]; @@ -31,4 +31,4 @@ << ", y+ = " << yPlus << ", u+ = " << uPlus << ", k+ = " << kPlus << ", epsilon+ = " << epsilonPlus << endl; -} \ No newline at end of file +} diff --git a/applications/solvers/incompressible/boundaryFoam/interrogateWallPatches.H b/applications/solvers/incompressible/boundaryFoam/interrogateWallPatches.H index 6fa3a0892cfdfeda4b81bd9399ff2551d81db624..7fd01f0e9ebbe9268f4270e12b4eb967bd30a4e5 100644 --- a/applications/solvers/incompressible/boundaryFoam/interrogateWallPatches.H +++ b/applications/solvers/incompressible/boundaryFoam/interrogateWallPatches.H @@ -13,7 +13,7 @@ forAll(patches, patchi) if (isA<wallFvPatch>(currPatch)) { - const vectorField nf = currPatch.nf(); + const vectorField nf(currPatch.nf()); forAll(nf, facei) { @@ -67,8 +67,10 @@ else label cellId = patches[patchId].faceCells()[faceId]; // create position array for graph generation -scalarField y = +scalarField y +( wallNormal - & (mesh.C().internalField() - mesh.C().boundaryField()[patchId][faceId]); + & (mesh.C().internalField() - mesh.C().boundaryField()[patchId][faceId]) +); Info<< " Height to first cell centre y0 = " << y[cellId] << endl; diff --git a/applications/solvers/incompressible/channelFoam/channelFoam.C b/applications/solvers/incompressible/channelFoam/channelFoam.C index 8918a4d8ebfafafa7763d3ec83f3fa555e41f147..6f19b96168839f388e7b17a1f792269bf7f0aaa2 100644 --- a/applications/solvers/incompressible/channelFoam/channelFoam.C +++ b/applications/solvers/incompressible/channelFoam/channelFoam.C @@ -77,7 +77,7 @@ int main(int argc, char *argv[]) // --- PISO loop - volScalarField rAU = 1.0/UEqn.A(); + volScalarField rAU(1.0/UEqn.A()); for (int corr=0; corr<nCorr; corr++) { diff --git a/applications/solvers/incompressible/icoFoam/icoFoam.C b/applications/solvers/incompressible/icoFoam/icoFoam.C index 98a4c4324bc08e8d1108c117a3c32b2a81e83bc2..27bffab99a7629f94ee5e4e627603d26001b34d1 100644 --- a/applications/solvers/incompressible/icoFoam/icoFoam.C +++ b/applications/solvers/incompressible/icoFoam/icoFoam.C @@ -66,7 +66,7 @@ int main(int argc, char *argv[]) for (int corr=0; corr<nCorr; corr++) { - volScalarField rAU = 1.0/UEqn.A(); + volScalarField rAU(1.0/UEqn.A()); U = rAU*UEqn.H(); phi = (fvc::interpolate(U) & mesh.Sf()) diff --git a/applications/solvers/incompressible/nonNewtonianIcoFoam/nonNewtonianIcoFoam.C b/applications/solvers/incompressible/nonNewtonianIcoFoam/nonNewtonianIcoFoam.C index dc62df435c671ce89446a826c141157635520066..467a625d6b202018b4ac5395a995e95dba910c9e 100644 --- a/applications/solvers/incompressible/nonNewtonianIcoFoam/nonNewtonianIcoFoam.C +++ b/applications/solvers/incompressible/nonNewtonianIcoFoam/nonNewtonianIcoFoam.C @@ -69,7 +69,7 @@ int main(int argc, char *argv[]) for (int corr=0; corr<nCorr; corr++) { - volScalarField rAU = 1.0/UEqn.A(); + volScalarField rAU(1.0/UEqn.A()); U = rAU*UEqn.H(); phi = (fvc::interpolate(U) & mesh.Sf()) diff --git a/applications/solvers/incompressible/pimpleFoam/UEqn.H b/applications/solvers/incompressible/pimpleFoam/UEqn.H index 3655677979ca0e81a0dea53b8e019a667c304d02..b897eec4b59b9018ccb2876fe1036bd52034e86f 100644 --- a/applications/solvers/incompressible/pimpleFoam/UEqn.H +++ b/applications/solvers/incompressible/pimpleFoam/UEqn.H @@ -9,7 +9,7 @@ tmp<fvVectorMatrix> UEqn UEqn().relax(); -volScalarField rAU = 1.0/UEqn().A(); +volScalarField rAU(1.0/UEqn().A()); if (momentumPredictor) { diff --git a/applications/solvers/incompressible/pisoFoam/pisoFoam.C b/applications/solvers/incompressible/pisoFoam/pisoFoam.C index 47414bf1732dc83f6ee95de05ee833e229950425..59c76c9e93cc1fef6d4acb91696e0df32ea4c0d4 100644 --- a/applications/solvers/incompressible/pisoFoam/pisoFoam.C +++ b/applications/solvers/incompressible/pisoFoam/pisoFoam.C @@ -79,7 +79,7 @@ int main(int argc, char *argv[]) for (int corr=0; corr<nCorr; corr++) { - volScalarField rAU = 1.0/UEqn.A(); + volScalarField rAU(1.0/UEqn.A()); U = rAU*UEqn.H(); phi = (fvc::interpolate(U) & mesh.Sf()) diff --git a/applications/solvers/incompressible/porousSimpleFoam/UEqn.H b/applications/solvers/incompressible/porousSimpleFoam/UEqn.H index 9cbcd61291fd3e617e21743cf2b8a115b456fc2b..a76c6db0fdbcbc27c162515eafab5089b86a0df9 100644 --- a/applications/solvers/incompressible/porousSimpleFoam/UEqn.H +++ b/applications/solvers/incompressible/porousSimpleFoam/UEqn.H @@ -22,7 +22,7 @@ trTU = inv(tTU()); trTU().rename("rAU"); - volVectorField gradp = fvc::grad(p); + volVectorField gradp(fvc::grad(p)); for (int UCorr=0; UCorr<nUCorr; UCorr++) { diff --git a/applications/solvers/incompressible/shallowWaterFoam/CourantNo.H b/applications/solvers/incompressible/shallowWaterFoam/CourantNo.H index 0dfa24316f288c59ce421092e857991b6e9140f2..c3f03b4868de702e848c04437edd33ae999c9e89 100644 --- a/applications/solvers/incompressible/shallowWaterFoam/CourantNo.H +++ b/applications/solvers/incompressible/shallowWaterFoam/CourantNo.H @@ -36,9 +36,11 @@ scalar waveCoNum = 0.0; if (mesh.nInternalFaces()) { - scalarField sumPhi = + scalarField sumPhi + ( fvc::surfaceSum(mag(phi))().internalField() - /h.internalField(); + / h.internalField() + ); CoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue(); diff --git a/applications/solvers/incompressible/shallowWaterFoam/shallowWaterFoam.C b/applications/solvers/incompressible/shallowWaterFoam/shallowWaterFoam.C index 274c8d1a63e7a487098cba99c025545b3c063b18..8d1d19073d0f23f1a86b86deb4a9411436ff78e4 100644 --- a/applications/solvers/incompressible/shallowWaterFoam/shallowWaterFoam.C +++ b/applications/solvers/incompressible/shallowWaterFoam/shallowWaterFoam.C @@ -89,10 +89,10 @@ int main(int argc, char *argv[]) // --- PISO loop for (int corr=0; corr<nCorr; corr++) { - volScalarField rAU = 1.0/hUEqn.A(); - surfaceScalarField ghrAUf = magg*fvc::interpolate(h*rAU); + volScalarField rAU(1.0/hUEqn.A()); + surfaceScalarField ghrAUf(magg*fvc::interpolate(h*rAU)); - surfaceScalarField phih0 = ghrAUf*mesh.magSf()*fvc::snGrad(h0); + surfaceScalarField phih0(ghrAUf*mesh.magSf()*fvc::snGrad(h0)); if (rotating) { diff --git a/applications/solvers/incompressible/simpleFoam/pEqn.H b/applications/solvers/incompressible/simpleFoam/pEqn.H index 313f20cbb40cbd88725f9e9298d5ed74f8572f06..c5b9748c5d867e327462cc93f5787a4409c0cba3 100644 --- a/applications/solvers/incompressible/simpleFoam/pEqn.H +++ b/applications/solvers/incompressible/simpleFoam/pEqn.H @@ -1,6 +1,6 @@ p.boundaryField().updateCoeffs(); - volScalarField AU = UEqn().A(); + volScalarField AU(UEqn().A()); U = UEqn().H()/AU; UEqn.clear(); phi = fvc::interpolate(U) & mesh.Sf(); diff --git a/applications/solvers/lagrangian/coalChemistryFoam/YEqn.H b/applications/solvers/lagrangian/coalChemistryFoam/YEqn.H index 0b04bdabba58c2421557bec330afa4da96d9fe8c..be82d6e2b6019af547a5fe2f023be66da02483a7 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/YEqn.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/YEqn.H @@ -12,7 +12,7 @@ tmp<fv::convectionScheme<scalar> > mvConvection { label inertIndex = -1; - volScalarField Yt = 0.0*Y[0]; + volScalarField Yt(0.0*Y[0]); forAll(Y, i) { diff --git a/applications/solvers/lagrangian/coalChemistryFoam/chemistry.H b/applications/solvers/lagrangian/coalChemistryFoam/chemistry.H index 50fc7f575b5e721711a250fa2b7d9d8ddf184fda..1690487b45db2e49964b43a9219cdbfa1d08853f 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/chemistry.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/chemistry.H @@ -10,10 +10,14 @@ // turbulent time scale if (turbulentReaction) { - DimensionedField<scalar, volMesh> tk = - Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon()); - DimensionedField<scalar, volMesh> tc = - chemistry.tc()().dimensionedInternalField(); + DimensionedField<scalar, volMesh> tk + ( + Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon()) + ); + DimensionedField<scalar, volMesh> tc + ( + chemistry.tc()().dimensionedInternalField() + ); // Chalmers PaSR model kappa = (runTime.deltaT() + tc)/(runTime.deltaT() + tc + tk); diff --git a/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H b/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H index 3f007e247dd06046f5376513e39133beccd56d4f..861e69bc8457c7bfcc13c6b4beb453be1fe57be2 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H @@ -1,6 +1,6 @@ rho = thermo.rho(); -volScalarField rAU = 1.0/UEqn.A(); +volScalarField rAU(1.0/UEqn.A()); U = rAU*UEqn.H(); if (transonic) diff --git a/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelDyMFoam/createFields.H b/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelDyMFoam/createFields.H index 0ad057e229970748c7d4e3b330643b700fb2dfe2..31be0cf8eef8ac8a27b4e9f98d2d916ae88082c7 100644 --- a/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelDyMFoam/createFields.H +++ b/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelDyMFoam/createFields.H @@ -51,7 +51,7 @@ singlePhaseTransportModel laminarTransport(U, phi); - const volScalarField nu = laminarTransport.nu(); + const volScalarField nu(laminarTransport.nu()); autoPtr<incompressible::turbulenceModel> turbulence ( diff --git a/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelFoam/createFields.H b/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelFoam/createFields.H index 0ad057e229970748c7d4e3b330643b700fb2dfe2..31be0cf8eef8ac8a27b4e9f98d2d916ae88082c7 100644 --- a/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelFoam/createFields.H +++ b/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelFoam/createFields.H @@ -51,7 +51,7 @@ singlePhaseTransportModel laminarTransport(U, phi); - const volScalarField nu = laminarTransport.nu(); + const volScalarField nu(laminarTransport.nu()); autoPtr<incompressible::turbulenceModel> turbulence ( diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/YEqn.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/YEqn.H index ac369f3df437deb7cc2849b953c3e7a078301682..e9d540f3a914dcf06e131453e87de9e9804d31b7 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/YEqn.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/YEqn.H @@ -13,7 +13,7 @@ tmp<fv::convectionScheme<scalar> > mvConvection { label inertIndex = -1; - volScalarField Yt = 0.0*Y[0]; + volScalarField Yt(0.0*Y[0]); forAll(Y, i) { diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/chemistry.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/chemistry.H index 50fc7f575b5e721711a250fa2b7d9d8ddf184fda..1690487b45db2e49964b43a9219cdbfa1d08853f 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/chemistry.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/chemistry.H @@ -10,10 +10,14 @@ // turbulent time scale if (turbulentReaction) { - DimensionedField<scalar, volMesh> tk = - Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon()); - DimensionedField<scalar, volMesh> tc = - chemistry.tc()().dimensionedInternalField(); + DimensionedField<scalar, volMesh> tk + ( + Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon()) + ); + DimensionedField<scalar, volMesh> tc + ( + chemistry.tc()().dimensionedInternalField() + ); // Chalmers PaSR model kappa = (runTime.deltaT() + tc)/(runTime.deltaT() + tc + tk); diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/pEqn.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/pEqn.H index 9d03624e4320b244f3e11ede5886691da15b002d..4a28b0dd9427fd96151896593ac2480aa2ff2f84 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/pEqn.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/pEqn.H @@ -5,7 +5,7 @@ // pressure solution - done in 2 parts. Part 1: thermo.rho() -= psi*p; - volScalarField rAU = 1.0/UEqn.A(); + volScalarField rAU(1.0/UEqn.A()); U = rAU*UEqn.H(); if (pZones.size() > 0) diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/YEqn.H b/applications/solvers/lagrangian/reactingParcelFilmFoam/YEqn.H index da9a289d69b0a2d5f0012c6e3f7d02c9f9733e74..8526b590a297c6f8fd351af4deb63cdebd713f0d 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/YEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/YEqn.H @@ -12,7 +12,7 @@ tmp<fv::convectionScheme<scalar> > mvConvection { label inertIndex = -1; - volScalarField Yt = 0.0*Y[0]; + volScalarField Yt(0.0*Y[0]); forAll(Y, i) { diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/chemistry.H b/applications/solvers/lagrangian/reactingParcelFilmFoam/chemistry.H index 12ed815d1dd5159f5b5e5fdd51924397f5546e59..5dd7ce9cb03c26f4bd5219bb3b7acf6ae72a925f 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/chemistry.H +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/chemistry.H @@ -10,10 +10,14 @@ // turbulent time scale if (turbulentReaction) { - DimensionedField<scalar, volMesh> tk = - Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon()); - DimensionedField<scalar, volMesh> tc = - chemistry.tc()().dimensionedInternalField(); + DimensionedField<scalar, volMesh> tk + ( + Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon()) + ); + DimensionedField<scalar, volMesh> tc + ( + chemistry.tc()().dimensionedInternalField() + ); // Chalmers PaSR model kappa = (runTime.deltaT() + tc)/(runTime.deltaT() + tc + tk); diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/pEqn.H b/applications/solvers/lagrangian/reactingParcelFilmFoam/pEqn.H index f957ab017e59e03aed001be06d5238ba4e5dc9c7..9d028d4502add888fb67dea12d4766c539e62e18 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/pEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/pEqn.H @@ -1,6 +1,6 @@ rho = thermo.rho(); -volScalarField rAU = 1.0/UEqn.A(); +volScalarField rAU(1.0/UEqn.A()); U = rAU*UEqn.H(); if (transonic) diff --git a/applications/solvers/lagrangian/reactingParcelFoam/YEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/YEqn.H index c4a929c44943a4c175103efc96b1acc4676f8d95..a18097332134baaa0b312ecaf281a81694ae73ac 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/YEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/YEqn.H @@ -12,7 +12,7 @@ tmp<fv::convectionScheme<scalar> > mvConvection { label inertIndex = -1; - volScalarField Yt = 0.0*Y[0]; + volScalarField Yt(0.0*Y[0]); forAll(Y, i) { diff --git a/applications/solvers/lagrangian/reactingParcelFoam/chemistry.H b/applications/solvers/lagrangian/reactingParcelFoam/chemistry.H index 50fc7f575b5e721711a250fa2b7d9d8ddf184fda..1690487b45db2e49964b43a9219cdbfa1d08853f 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/chemistry.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/chemistry.H @@ -10,10 +10,14 @@ // turbulent time scale if (turbulentReaction) { - DimensionedField<scalar, volMesh> tk = - Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon()); - DimensionedField<scalar, volMesh> tc = - chemistry.tc()().dimensionedInternalField(); + DimensionedField<scalar, volMesh> tk + ( + Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon()) + ); + DimensionedField<scalar, volMesh> tc + ( + chemistry.tc()().dimensionedInternalField() + ); // Chalmers PaSR model kappa = (runTime.deltaT() + tc)/(runTime.deltaT() + tc + tk); diff --git a/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H index d5de608bd2289ad6dcc14cd2af0dfbcf50f035d3..560fbc989506f63eef7190441385e976caaa6100 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H @@ -1,6 +1,6 @@ rho = thermo.rho(); -volScalarField rAU = 1.0/UEqn.A(); +volScalarField rAU(1.0/UEqn.A()); U = rAU*UEqn.H(); if (transonic) diff --git a/applications/solvers/lagrangian/steadyReactingParcelFoam/YEqn.H b/applications/solvers/lagrangian/steadyReactingParcelFoam/YEqn.H index 4e2f9766a8efefcadca381dd33ac4271394a15e9..53c6b25d81c1e10fb8f3f0d377ca35d715bf4686 100644 --- a/applications/solvers/lagrangian/steadyReactingParcelFoam/YEqn.H +++ b/applications/solvers/lagrangian/steadyReactingParcelFoam/YEqn.H @@ -14,7 +14,7 @@ tmp<fv::convectionScheme<scalar> > mvConvection if (solveSpecies) { label inertIndex = -1; - volScalarField Yt = 0.0*Y[0]; + volScalarField Yt(0.0*Y[0]); forAll(Y, i) { diff --git a/applications/solvers/lagrangian/steadyReactingParcelFoam/pEqn.H b/applications/solvers/lagrangian/steadyReactingParcelFoam/pEqn.H index e7d7c55dbbee62df067024b98aff1d5d23ddcba1..322289684ddac4ef42b4423034a2ac4eace3bb63 100644 --- a/applications/solvers/lagrangian/steadyReactingParcelFoam/pEqn.H +++ b/applications/solvers/lagrangian/steadyReactingParcelFoam/pEqn.H @@ -5,7 +5,7 @@ // pressure solution - done in 2 parts. Part 1: thermo.rho() -= psi*p; - volScalarField rAU = 1.0/UEqn.A(); + volScalarField rAU(1.0/UEqn.A()); U = rAU*UEqn.H(); if (pZones.size() > 0) diff --git a/applications/solvers/lagrangian/steadyReactingParcelFoam/timeScales.H b/applications/solvers/lagrangian/steadyReactingParcelFoam/timeScales.H index 26ebe6fc6773b4eb06d21729dbf871ba26786ccc..0e26fcdac1572aa829465be8df977c56314e258a 100644 --- a/applications/solvers/lagrangian/steadyReactingParcelFoam/timeScales.H +++ b/applications/solvers/lagrangian/steadyReactingParcelFoam/timeScales.H @@ -59,7 +59,8 @@ Info<< "Time scales min/max:" << endl; invTauFlow.max(1.0/maxDeltaT); - Info<< " Flow = " << gMin(1/invTauFlow.internalField()) << ", " + Info<< " Flow = " + << gMin(1/invTauFlow.internalField()) << ", " << gMax(1/invTauFlow.internalField()) << endl; } @@ -68,13 +69,16 @@ Info<< "Time scales min/max:" << endl; // ~~~~~~~~~~~~~~~~~~~~~~ { - scalarField tau = - runTime.deltaTValue()*mag(parcels.Srho() + massSource.SuTot()); + scalarField tau + ( + runTime.deltaTValue()*mag(parcels.Srho() + massSource.SuTot()) + ); tau = alphaTauRho*rho/(tau + ROOTVSMALL); - Info<< " Density = " << min(maxDeltaT, gMin(tau)) << ", " - << min(maxDeltaT, gMax(tau)) << endl; + Info<< " Density = " + << min(maxDeltaT, gMin(tau)) << ", " + << min(maxDeltaT, gMax(tau)) << endl; invTauFlow.internalField() = max(invTauFlow.internalField(), 1/tau); } @@ -86,7 +90,8 @@ Info<< "Time scales min/max:" << endl; { /* // Method 1 - mag(U) limit using 'small' nominal velocity - scalarField tau = + scalarField tau + ( runTime.deltaTValue() *mag ( @@ -94,7 +99,8 @@ Info<< "Time scales min/max:" << endl; + parcels.UTrans()/(mesh.V()*runTime.deltaT()) + momentumSource.Su() ) - /rho; + /rho + ); const scalar nomMagU(dimensionedScalar("1", dimVelocity, 1)); tau = alphaTauU*(nomMagU + mag(U))/(tau + ROOTVSMALL); @@ -128,13 +134,15 @@ Info<< "Time scales min/max:" << endl; fvc::interpolate(runTime.deltaT()*UEqnRhs) & mesh.Sf() ); - scalarField tau = + scalarField tau + ( alphaTauU*rho /fvc::surfaceSum ( mag(phi + phiSU)*mesh.deltaCoeffs()/mesh.magSf() + dimensionedScalar("SMALL", dimDensity/dimTime, ROOTVSMALL) - ); + ) + ); */ /* @@ -150,7 +158,8 @@ Info<< "Time scales min/max:" << endl; // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { - scalarField tau = + scalarField tau + ( runTime.deltaTValue() *mag ( @@ -159,7 +168,8 @@ Info<< "Time scales min/max:" << endl; + energySource.Su() + chemistrySh ) - /rho; + /rho + ); tau = alphaTauTemp*thermo.Cp()*T/(tau + ROOTVSMALL); @@ -178,7 +188,8 @@ Info<< "Time scales min/max:" << endl; forAll(Y, fieldI) { const volScalarField& Yi = Y[fieldI]; - const scalarField deltaYi = + const scalarField deltaYi + ( runTime.deltaTValue() *mag ( @@ -186,7 +197,8 @@ Info<< "Time scales min/max:" << endl; + massSource.Su(fieldI) + parcels.Srho(fieldI) ) - /rho; + /rho + ); tau = min ( diff --git a/applications/solvers/multiphase/bubbleFoam/UEqns.H b/applications/solvers/multiphase/bubbleFoam/UEqns.H index 64cc5db462bc1bd7c5877de05e0c06a7ee846cb5..82d53d84b0093c70f0ed81385a35c6fffba17eba 100644 --- a/applications/solvers/multiphase/bubbleFoam/UEqns.H +++ b/applications/solvers/multiphase/bubbleFoam/UEqns.H @@ -2,12 +2,14 @@ fvVectorMatrix UaEqn(Ua, Ua.dimensions()*dimVol/dimTime); fvVectorMatrix UbEqn(Ub, Ub.dimensions()*dimVol/dimTime); { - volTensorField Rca = -nuEffa*(fvc::grad(Ua)().T()); + volTensorField Rca(-nuEffa*(fvc::grad(Ua)().T())); Rca = Rca + (2.0/3.0)*sqr(Ct)*I*k - (2.0/3.0)*I*tr(Rca); - surfaceScalarField phiRa = + surfaceScalarField phiRa + ( - fvc::interpolate(nuEffa) - *mesh.magSf()*fvc::snGrad(alpha)/fvc::interpolate(alpha + scalar(0.001)); + *mesh.magSf()*fvc::snGrad(alpha)/fvc::interpolate(alpha + scalar(0.001)) + ); UaEqn = ( @@ -34,12 +36,14 @@ fvVectorMatrix UbEqn(Ub, Ub.dimensions()*dimVol/dimTime); UaEqn.relax(); - volTensorField Rcb = -nuEffb*fvc::grad(Ub)().T(); + volTensorField Rcb(-nuEffb*fvc::grad(Ub)().T()); Rcb = Rcb + (2.0/3.0)*I*k - (2.0/3.0)*I*tr(Rcb); - surfaceScalarField phiRb = + surfaceScalarField phiRb + ( - fvc::interpolate(nuEffb) - *mesh.magSf()*fvc::snGrad(beta)/fvc::interpolate(beta + scalar(0.001)); + *mesh.magSf()*fvc::snGrad(beta)/fvc::interpolate(beta + scalar(0.001)) + ); UbEqn = ( diff --git a/applications/solvers/multiphase/bubbleFoam/alphaEqn.H b/applications/solvers/multiphase/bubbleFoam/alphaEqn.H index db3b5956257eeb71dd290d0ca81233c1763c8e89..772008bc8936a17c98686777b9b769b248c560bf 100644 --- a/applications/solvers/multiphase/bubbleFoam/alphaEqn.H +++ b/applications/solvers/multiphase/bubbleFoam/alphaEqn.H @@ -1,7 +1,7 @@ { word scheme("div(phi,alpha)"); - surfaceScalarField phir = phia - phib; + surfaceScalarField phir(phia - phib); Info<< "Max Ur Courant Number = " << ( diff --git a/applications/solvers/multiphase/bubbleFoam/createFields.H b/applications/solvers/multiphase/bubbleFoam/createFields.H index 57bb7e88d50b7ffc42fc61633acd01eed6e67d75..efb41613a6c07e6a63d6fb6e8d37d381dae71729 100644 --- a/applications/solvers/multiphase/bubbleFoam/createFields.H +++ b/applications/solvers/multiphase/bubbleFoam/createFields.H @@ -171,15 +171,19 @@ Info<< "Calculating field DDtUa and DDtUb\n" << endl; - volVectorField DDtUa = + volVectorField DDtUa + ( fvc::ddt(Ua) + fvc::div(phia, Ua) - - fvc::div(phia)*Ua; + - fvc::div(phia)*Ua + ); - volVectorField DDtUb = + volVectorField DDtUb + ( fvc::ddt(Ub) + fvc::div(phib, Ub) - - fvc::div(phib)*Ub; + - fvc::div(phib)*Ub + ); Info<< "Calculating field g.h\n" << endl; diff --git a/applications/solvers/multiphase/bubbleFoam/kEpsilon.H b/applications/solvers/multiphase/bubbleFoam/kEpsilon.H index 84dadd7acb5b80452b7992f855d7965d893ff8df..309d4eba80bf1623cae3d873e8259494d7737217 100644 --- a/applications/solvers/multiphase/bubbleFoam/kEpsilon.H +++ b/applications/solvers/multiphase/bubbleFoam/kEpsilon.H @@ -6,7 +6,7 @@ if (turbulence) } tmp<volTensorField> tgradUb = fvc::grad(Ub); - volScalarField G = 2*nutb*(tgradUb() && dev(symm(tgradUb()))); + volScalarField G(2*nutb*(tgradUb() && dev(symm(tgradUb())))); tgradUb.clear(); #include "wallFunctions.H" diff --git a/applications/solvers/multiphase/bubbleFoam/liftDragCoeffs.H b/applications/solvers/multiphase/bubbleFoam/liftDragCoeffs.H index f9ae6ab2ca2a3e3a076b5b2ddbe0eda2eef4ed09..5d00e3982059014c21b776ee8ca96859354d5e92 100644 --- a/applications/solvers/multiphase/bubbleFoam/liftDragCoeffs.H +++ b/applications/solvers/multiphase/bubbleFoam/liftDragCoeffs.H @@ -1,11 +1,15 @@ - volVectorField Ur = Ua - Ub; - volScalarField magUr = mag(Ur); + volVectorField Ur(Ua - Ub); + volScalarField magUr(mag(Ur)); - volScalarField CdaMagUr = - (24.0*nub/da)*(scalar(1) + 0.15*pow(da*magUr/nub, 0.687)); + volScalarField CdaMagUr + ( + (24.0*nub/da)*(scalar(1) + 0.15*pow(da*magUr/nub, 0.687)) + ); - volScalarField CdbMagUr = - (24.0*nua/db)*(scalar(1) + 0.15*pow(db*magUr/nua, 0.687)); + volScalarField CdbMagUr + ( + (24.0*nua/db)*(scalar(1) + 0.15*pow(db*magUr/nua, 0.687)) + ); volScalarField dragCoef ( @@ -13,4 +17,7 @@ 0.75*(beta*rhob*CdaMagUr/da + alpha*rhoa*CdbMagUr/db) ); - volVectorField liftCoeff = Cl*(beta*rhob + alpha*rhoa)*(Ur ^ fvc::curl(U)); + volVectorField liftCoeff + ( + Cl*(beta*rhob + alpha*rhoa)*(Ur ^ fvc::curl(U)) + ); diff --git a/applications/solvers/multiphase/bubbleFoam/pEqn.H b/applications/solvers/multiphase/bubbleFoam/pEqn.H index 8e257c8fa9eb486061afd5861a6783560cdf9497..faae92d3970fa7d6add15990097aa69fcd0f7133 100644 --- a/applications/solvers/multiphase/bubbleFoam/pEqn.H +++ b/applications/solvers/multiphase/bubbleFoam/pEqn.H @@ -1,20 +1,24 @@ { - surfaceScalarField alphaf = fvc::interpolate(alpha); - surfaceScalarField betaf = scalar(1) - alphaf; + surfaceScalarField alphaf(fvc::interpolate(alpha)); + surfaceScalarField betaf(scalar(1) - alphaf); - volScalarField rUaA = 1.0/UaEqn.A(); - volScalarField rUbA = 1.0/UbEqn.A(); + volScalarField rUaA(1.0/UaEqn.A()); + volScalarField rUbA(1.0/UbEqn.A()); - surfaceScalarField rUaAf = fvc::interpolate(rUaA); - surfaceScalarField rUbAf = fvc::interpolate(rUbA); + surfaceScalarField rUaAf(fvc::interpolate(rUaA)); + surfaceScalarField rUbAf(fvc::interpolate(rUbA)); Ua = rUaA*UaEqn.H(); Ub = rUbA*UbEqn.H(); - surfaceScalarField phiDraga = - fvc::interpolate(beta/rhoa*dragCoef*rUaA)*phib + rUaAf*(g & mesh.Sf()); - surfaceScalarField phiDragb = - fvc::interpolate(alpha/rhob*dragCoef*rUbA)*phia + rUbAf*(g & mesh.Sf()); + surfaceScalarField phiDraga + ( + fvc::interpolate(beta/rhoa*dragCoef*rUaA)*phib + rUaAf*(g & mesh.Sf()) + ); + surfaceScalarField phiDragb + ( + fvc::interpolate(alpha/rhob*dragCoef*rUbA)*phia + rUbAf*(g & mesh.Sf()) + ); forAll(p.boundaryField(), patchi) { @@ -50,7 +54,7 @@ if (nonOrth == nNonOrthCorr) { - surfaceScalarField SfGradp = pEqn.flux()/Dp; + surfaceScalarField SfGradp(pEqn.flux()/Dp); phia -= rUaAf*SfGradp/rhoa; phib -= rUbAf*SfGradp/rhob; diff --git a/applications/solvers/multiphase/bubbleFoam/wallFunctions.H b/applications/solvers/multiphase/bubbleFoam/wallFunctions.H index fe5d16909ef35d7e92aefcf7b14b9ead30b1deca..a998d4c3ddcbffaa744b87b67a7eebd9f4b36524 100644 --- a/applications/solvers/multiphase/bubbleFoam/wallFunctions.H +++ b/applications/solvers/multiphase/bubbleFoam/wallFunctions.H @@ -34,7 +34,7 @@ { const scalarField& nuw = nutb.boundaryField()[patchi]; - scalarField magFaceGradU = mag(U.boundaryField()[patchi].snGrad()); + scalarField magFaceGradU(mag(U.boundaryField()[patchi].snGrad())); forAll(currPatch, facei) { diff --git a/applications/solvers/multiphase/cavitatingFoam/CourantNo.H b/applications/solvers/multiphase/cavitatingFoam/CourantNo.H index 8b26ba033e9f5f1352a6640cb625f863a6e622f2..cb72ce18f78acea6b5a90d9f6dea3dd0b1878e6e 100644 --- a/applications/solvers/multiphase/cavitatingFoam/CourantNo.H +++ b/applications/solvers/multiphase/cavitatingFoam/CourantNo.H @@ -35,8 +35,10 @@ scalar acousticCoNum = 0.0; if (mesh.nInternalFaces()) { - scalarField sumPhi = - fvc::surfaceSum(mag(phiv))().internalField(); + scalarField sumPhi + ( + fvc::surfaceSum(mag(phiv))().internalField() + ); CoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue(); diff --git a/applications/solvers/multiphase/cavitatingFoam/pEqn.H b/applications/solvers/multiphase/cavitatingFoam/pEqn.H index e6606b7b6261c885416f05fd0133556c2f0fcd71..6b6fc73eb9e81afb7e0a821c29ba3cb192557df0 100644 --- a/applications/solvers/multiphase/cavitatingFoam/pEqn.H +++ b/applications/solvers/multiphase/cavitatingFoam/pEqn.H @@ -9,18 +9,18 @@ )/psi; } - surfaceScalarField rhof = fvc::interpolate(rho, "rhof"); + surfaceScalarField rhof(fvc::interpolate(rho, "rhof")); - volScalarField rAU = 1.0/UEqn.A(); + volScalarField rAU(1.0/UEqn.A()); surfaceScalarField rAUf("rAUf", rhof*fvc::interpolate(rAU)); - volVectorField HbyA = rAU*UEqn.H(); + volVectorField HbyA(rAU*UEqn.H()); phiv = (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::ddtPhiCorr(rAU, rho, U, phiv); p.boundaryField().updateCoeffs(); - surfaceScalarField phiGradp = rAUf*mesh.magSf()*fvc::snGrad(p); + surfaceScalarField phiGradp(rAUf*mesh.magSf()*fvc::snGrad(p)); phiv -= phiGradp/rhof; diff --git a/applications/solvers/multiphase/compressibleInterFoam/alphaEqns.H b/applications/solvers/multiphase/compressibleInterFoam/alphaEqns.H index f54526276762aeee1aacd3e87fda796a961ce529..f5717a654dbe16677f62539fa427ba91011f82d5 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/alphaEqns.H +++ b/applications/solvers/multiphase/compressibleInterFoam/alphaEqns.H @@ -2,7 +2,7 @@ word alphaScheme("div(phi,alpha)"); word alpharScheme("div(phirb,alpha)"); - surfaceScalarField phir = phic*interface.nHatf(); + surfaceScalarField phir(phic*interface.nHatf()); for (int gCorr=0; gCorr<nAlphaCorr; gCorr++) { @@ -45,7 +45,8 @@ } - surfaceScalarField phiAlpha1 = + surfaceScalarField phiAlpha1 + ( fvc::flux ( phi, @@ -57,7 +58,8 @@ -fvc::flux(-phir, alpha2, alpharScheme), alpha1, alpharScheme - ); + ) + ); MULES::explicitSolve ( @@ -71,8 +73,8 @@ 0 ); - surfaceScalarField rho1f = fvc::interpolate(rho1); - surfaceScalarField rho2f = fvc::interpolate(rho2); + surfaceScalarField rho1f(fvc::interpolate(rho1)); + surfaceScalarField rho2f(fvc::interpolate(rho2)); rhoPhi = phiAlpha1*(rho1f - rho2f) + phi*rho2f; alpha2 = scalar(1) - alpha1; diff --git a/applications/solvers/multiphase/compressibleInterFoam/alphaEqnsSubCycle.H b/applications/solvers/multiphase/compressibleInterFoam/alphaEqnsSubCycle.H index 89ba7a4e7577e98b0e04fd99cb39bd3af711c68b..7645b2d4aa78f8445559e5bcc0d1bfcdb87b5854 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/alphaEqnsSubCycle.H +++ b/applications/solvers/multiphase/compressibleInterFoam/alphaEqnsSubCycle.H @@ -9,15 +9,15 @@ readLabel(piso.lookup("nAlphaSubCycles")) ); - surfaceScalarField phic = mag(phi/mesh.magSf()); + surfaceScalarField phic(mag(phi/mesh.magSf())); phic = min(interface.cAlpha()*phic, max(phic)); - volScalarField divU = fvc::div(phi); + volScalarField divU(fvc::div(phi)); if (nAlphaSubCycles > 1) { dimensionedScalar totalDeltaT = runTime.deltaT(); - surfaceScalarField rhoPhiSum = 0.0*rhoPhi; + surfaceScalarField rhoPhiSum(0.0*rhoPhi); for ( diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/alphaEqnsSubCycle.H b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/alphaEqnsSubCycle.H index e668296b6da3a214b2bf87bc58f992618a0e62d0..a973c23dfe535167b9eec77c2fa4b0fba9451387 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/alphaEqnsSubCycle.H +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/alphaEqnsSubCycle.H @@ -9,17 +9,17 @@ readLabel(piso.lookup("nAlphaSubCycles")) ); - surfaceScalarField phic = mag(phi/mesh.magSf()); + surfaceScalarField phic(mag(phi/mesh.magSf())); phic = min(interface.cAlpha()*phic, max(phic)); fvc::makeAbsolute(phi, U); - volScalarField divU = fvc::div(phi); + volScalarField divU(fvc::div(phi)); fvc::makeRelative(phi, U); if (nAlphaSubCycles > 1) { dimensionedScalar totalDeltaT = runTime.deltaT(); - surfaceScalarField rhoPhiSum = 0.0*rhoPhi; + surfaceScalarField rhoPhiSum(0.0*rhoPhi); for ( diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C index c2f1d04706d47475a271cba54f4ed907b083d50d..8519d23f670d250a350e1d4190735f5af21b4fc9 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C @@ -79,7 +79,7 @@ int main(int argc, char *argv[]) { // Store divU from the previous mesh for the correctPhi - volScalarField divU = fvc::div(phi); + volScalarField divU(fvc::div(phi)); scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime(); diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/pEqn.H b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/pEqn.H index ace51b5d846173cb2a1c6e0bdf6c81b97920b8fc..0c1ad0192d04685e3ab4b3efb1a327e625e6a0ed 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/pEqn.H +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/pEqn.H @@ -1,6 +1,6 @@ { - volScalarField rAU = 1.0/UEqn.A(); - surfaceScalarField rAUf = fvc::interpolate(rAU); + volScalarField rAU(1.0/UEqn.A()); + surfaceScalarField rAUf(fvc::interpolate(rAU)); tmp<fvScalarMatrix> p_rghEqnComp; diff --git a/applications/solvers/multiphase/compressibleInterFoam/createFields.H b/applications/solvers/multiphase/compressibleInterFoam/createFields.H index fab0df9284a8db2bb5356d48828bf77100cdd7ab..c598cb75ce6f888500409a91246e0b95c50076d4 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/createFields.H +++ b/applications/solvers/multiphase/compressibleInterFoam/createFields.H @@ -105,8 +105,8 @@ ) ); - volScalarField rho1 = rho10 + psi1*p; - volScalarField rho2 = rho20 + psi2*p; + volScalarField rho1(rho10 + psi1*p); + volScalarField rho2(rho20 + psi2*p); volScalarField rho ( @@ -138,8 +138,10 @@ fvc::interpolate(rho)*phi ); - volScalarField dgdt = - pos(alpha2)*fvc::div(phi)/max(alpha2, scalar(0.0001)); + volScalarField dgdt + ( + pos(alpha2)*fvc::div(phi)/max(alpha2, scalar(0.0001)) + ); // Construct interface from alpha1 distribution interfaceProperties interface(alpha1, U, twoPhaseProperties); diff --git a/applications/solvers/multiphase/compressibleInterFoam/pEqn.H b/applications/solvers/multiphase/compressibleInterFoam/pEqn.H index 7054fe1d44370b52fb092229175acee20af32395..047f2f3c4c4d23279aaeaee8346d6b1173d1b366 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/pEqn.H +++ b/applications/solvers/multiphase/compressibleInterFoam/pEqn.H @@ -1,6 +1,6 @@ { - volScalarField rAU = 1.0/UEqn.A(); - surfaceScalarField rAUf = fvc::interpolate(rAU); + volScalarField rAU(1.0/UEqn.A()); + surfaceScalarField rAUf(fvc::interpolate(rAU)); tmp<fvScalarMatrix> p_rghEqnComp; diff --git a/applications/solvers/multiphase/interFoam/LTSInterFoam/MULESTemplates.C b/applications/solvers/multiphase/interFoam/LTSInterFoam/MULESTemplates.C index 280d7d6d5514ee42e91a761b6d1f8593c30cc716..d6ab8bfc3eae09c6ec7ea48161bd67f12fb6940a 100644 --- a/applications/solvers/multiphase/interFoam/LTSInterFoam/MULESTemplates.C +++ b/applications/solvers/multiphase/interFoam/LTSInterFoam/MULESTemplates.C @@ -56,7 +56,7 @@ void Foam::MULES::explicitLTSSolve const fvMesh& mesh = psi.mesh(); psi.correctBoundaryConditions(); - surfaceScalarField phiBD = upwind<scalar>(psi.mesh(), phi).flux(psi); + surfaceScalarField phiBD(upwind<scalar>(psi.mesh(), phi).flux(psi)); surfaceScalarField& phiCorr = phiPsi; phiCorr -= phiBD; @@ -168,9 +168,11 @@ void Foam::MULES::implicitSolve scalarField allCoLambda(mesh.nFaces()); { - surfaceScalarField Cof = + surfaceScalarField Cof + ( mesh.time().deltaT()*mesh.surfaceInterpolation::deltaCoeffs() - *mag(phi)/mesh.magSf(); + *mag(phi)/mesh.magSf() + ); slicedSurfaceScalarField CoLambda ( @@ -226,7 +228,7 @@ void Foam::MULES::implicitSolve - Su ); - surfaceScalarField phiBD = psiConvectionDiffusion.flux(); + surfaceScalarField phiBD(psiConvectionDiffusion.flux()); surfaceScalarField& phiCorr = phiPsi; phiCorr -= phiBD; @@ -408,7 +410,7 @@ void Foam::MULES::limiter if (psiPf.coupled()) { - scalarField psiPNf = psiPf.patchNeighbourField(); + scalarField psiPNf(psiPf.patchNeighbourField()); forAll(phiCorrPf, pFacei) { diff --git a/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqn.H b/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqn.H index a4cb6e7688c168c92d3ac1aebd5cfb1cddf93382..0c2cf71e4edf3d00e5695a7be322c3f7ba423917 100644 --- a/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqn.H +++ b/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqn.H @@ -2,13 +2,14 @@ word alphaScheme("div(phi,alpha)"); word alpharScheme("div(phirb,alpha)"); - surfaceScalarField phic = mag(phi/mesh.magSf()); + surfaceScalarField phic(mag(phi/mesh.magSf())); phic = min(interface.cAlpha()*phic, max(phic)); - surfaceScalarField phir = phic*interface.nHatf(); + surfaceScalarField phir(phic*interface.nHatf()); for (int aCorr=0; aCorr<nAlphaCorr; aCorr++) { - surfaceScalarField phiAlpha = + surfaceScalarField phiAlpha + ( fvc::flux ( phi, @@ -20,7 +21,8 @@ -fvc::flux(-phir, scalar(1) - alpha1, alpharScheme), alpha1, alpharScheme - ); + ) + ); MULES::explicitLTSSolve(alpha1, phi, phiAlpha, 1, 0); //MULES::explicitSolve(alpha1, phi, phiAlpha, 1, 0); diff --git a/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqnSubCycle.H b/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqnSubCycle.H index 9aae37a8bef50329d7e2b4cac649219d48dcc707..073d058bfa0c586c0bdc2bdd568a66658a6f0607 100644 --- a/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqnSubCycle.H +++ b/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqnSubCycle.H @@ -11,7 +11,7 @@ label nAlphaSubCycles if (nAlphaSubCycles > 1) { dimensionedScalar totalDeltaT = runTime.deltaT(); - surfaceScalarField rhoPhiSum = 0.0*rhoPhi; + surfaceScalarField rhoPhiSum(0.0*rhoPhi); for ( diff --git a/applications/solvers/multiphase/interFoam/MRFInterFoam/pEqn.H b/applications/solvers/multiphase/interFoam/MRFInterFoam/pEqn.H index 7944df48142d57f7564ed13530be411a53402a58..e4f8247bac6591179574a92c10e3653e77d65fa5 100644 --- a/applications/solvers/multiphase/interFoam/MRFInterFoam/pEqn.H +++ b/applications/solvers/multiphase/interFoam/MRFInterFoam/pEqn.H @@ -1,6 +1,6 @@ { - volScalarField rAU = 1.0/UEqn.A(); - surfaceScalarField rAUf = fvc::interpolate(rAU); + volScalarField rAU(1.0/UEqn.A()); + surfaceScalarField rAUf(fvc::interpolate(rAU)); U = rAU*UEqn.H(); surfaceScalarField phiU diff --git a/applications/solvers/multiphase/interFoam/alphaCourantNo.H b/applications/solvers/multiphase/interFoam/alphaCourantNo.H index e5edfc76ca1dc79093fd108f2f09252f69f22531..d122753d4657f2845d941ce60b3f04287777ed6b 100644 --- a/applications/solvers/multiphase/interFoam/alphaCourantNo.H +++ b/applications/solvers/multiphase/interFoam/alphaCourantNo.H @@ -39,9 +39,11 @@ scalar meanAlphaCoNum = 0.0; if (mesh.nInternalFaces()) { - scalarField sumPhi = + scalarField sumPhi + ( pos(alpha1 - 0.01)*pos(0.99 - alpha1) - *fvc::surfaceSum(mag(phi))().internalField(); + *fvc::surfaceSum(mag(phi))().internalField() + ); alphaCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue(); diff --git a/applications/solvers/multiphase/interFoam/alphaEqn.H b/applications/solvers/multiphase/interFoam/alphaEqn.H index 0b2fb4ebf8cd36525b52507fd48b245293b0ddbc..d19ae9bb702d0be3752e33f4feaad92cb8dd4bff 100644 --- a/applications/solvers/multiphase/interFoam/alphaEqn.H +++ b/applications/solvers/multiphase/interFoam/alphaEqn.H @@ -2,13 +2,14 @@ word alphaScheme("div(phi,alpha)"); word alpharScheme("div(phirb,alpha)"); - surfaceScalarField phic = mag(phi/mesh.magSf()); + surfaceScalarField phic(mag(phi/mesh.magSf())); phic = min(interface.cAlpha()*phic, max(phic)); - surfaceScalarField phir = phic*interface.nHatf(); + surfaceScalarField phir(phic*interface.nHatf()); for (int aCorr=0; aCorr<nAlphaCorr; aCorr++) { - surfaceScalarField phiAlpha = + surfaceScalarField phiAlpha + ( fvc::flux ( phi, @@ -20,7 +21,8 @@ -fvc::flux(-phir, scalar(1) - alpha1, alpharScheme), alpha1, alpharScheme - ); + ) + ); MULES::explicitSolve(alpha1, phi, phiAlpha, 1, 0); diff --git a/applications/solvers/multiphase/interFoam/alphaEqnSubCycle.H b/applications/solvers/multiphase/interFoam/alphaEqnSubCycle.H index 9aae37a8bef50329d7e2b4cac649219d48dcc707..073d058bfa0c586c0bdc2bdd568a66658a6f0607 100644 --- a/applications/solvers/multiphase/interFoam/alphaEqnSubCycle.H +++ b/applications/solvers/multiphase/interFoam/alphaEqnSubCycle.H @@ -11,7 +11,7 @@ label nAlphaSubCycles if (nAlphaSubCycles > 1) { dimensionedScalar totalDeltaT = runTime.deltaT(); - surfaceScalarField rhoPhiSum = 0.0*rhoPhi; + surfaceScalarField rhoPhiSum(0.0*rhoPhi); for ( diff --git a/applications/solvers/multiphase/interFoam/interDyMFoam/pEqn.H b/applications/solvers/multiphase/interFoam/interDyMFoam/pEqn.H index 59c0cd19295dab7f4d58bf487a694a882ebf2db4..5bf3ca9418b69a3980f8adde55bc02ef99dfa0af 100644 --- a/applications/solvers/multiphase/interFoam/interDyMFoam/pEqn.H +++ b/applications/solvers/multiphase/interFoam/interDyMFoam/pEqn.H @@ -1,6 +1,6 @@ { - volScalarField rAU = 1.0/UEqn.A(); - surfaceScalarField rAUf = fvc::interpolate(rAU); + volScalarField rAU(1.0/UEqn.A()); + surfaceScalarField rAUf(fvc::interpolate(rAU)); U = rAU*UEqn.H(); surfaceScalarField phiU("phiU", (fvc::interpolate(U) & mesh.Sf())); diff --git a/applications/solvers/multiphase/interFoam/pEqn.H b/applications/solvers/multiphase/interFoam/pEqn.H index 6437572c3b7d69d2c5b837c149c02cc4c4c982bb..db1eccc5a5348055a2bed3c9ef0e8ea96ffb4484 100644 --- a/applications/solvers/multiphase/interFoam/pEqn.H +++ b/applications/solvers/multiphase/interFoam/pEqn.H @@ -1,6 +1,6 @@ { - volScalarField rAU = 1.0/UEqn.A(); - surfaceScalarField rAUf = fvc::interpolate(rAU); + volScalarField rAU(1.0/UEqn.A()); + surfaceScalarField rAUf(fvc::interpolate(rAU)); U = rAU*UEqn.H(); surfaceScalarField phiU diff --git a/applications/solvers/multiphase/interMixingFoam/alphaCourantNo.H b/applications/solvers/multiphase/interMixingFoam/alphaCourantNo.H index 105149f87eaeb5c1d8463c778e322392b01eb7da..821064fae1cc2b212960f71ac510056cd2b84d3a 100644 --- a/applications/solvers/multiphase/interMixingFoam/alphaCourantNo.H +++ b/applications/solvers/multiphase/interMixingFoam/alphaCourantNo.H @@ -39,11 +39,14 @@ scalar meanAlphaCoNum = 0.0; if (mesh.nInternalFaces()) { - scalarField sumPhi = max + scalarField sumPhi ( - pos(alpha1 - 0.01)*pos(0.99 - alpha1), - pos(alpha2 - 0.01)*pos(0.99 - alpha2) - )*fvc::surfaceSum(mag(phi))().internalField(); + max + ( + pos(alpha1 - 0.01)*pos(0.99 - alpha1), + pos(alpha2 - 0.01)*pos(0.99 - alpha2) + )*fvc::surfaceSum(mag(phi))().internalField() + ); alphaCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue(); diff --git a/applications/solvers/multiphase/interMixingFoam/alphaEqns.H b/applications/solvers/multiphase/interMixingFoam/alphaEqns.H index 00295354d46be67fd0a85ba4104989602b84bc67..15759adfe4a354816f94c2c928d77558aa9fdd32 100644 --- a/applications/solvers/multiphase/interMixingFoam/alphaEqns.H +++ b/applications/solvers/multiphase/interMixingFoam/alphaEqns.H @@ -40,7 +40,8 @@ // Create the complete convection flux for alpha1 - surfaceScalarField phiAlpha1 = + surfaceScalarField phiAlpha1 + ( fvc::flux ( phi, @@ -58,11 +59,14 @@ -fvc::flux(-phir, alpha3, alpharScheme), alpha1, alpharScheme - ); + ) + ); // Create the bounded (upwind) flux for alpha1 - surfaceScalarField phiAlpha1BD = - upwind<scalar>(mesh, phi).flux(alpha1); + surfaceScalarField phiAlpha1BD + ( + upwind<scalar>(mesh, phi).flux(alpha1) + ); // Calculate the flux correction for alpha1 phiAlpha1 -= phiAlpha1BD; @@ -83,7 +87,8 @@ ); // Create the complete flux for alpha2 - surfaceScalarField phiAlpha2 = + surfaceScalarField phiAlpha2 + ( fvc::flux ( phi, @@ -95,11 +100,14 @@ -fvc::flux(phir, alpha1, alpharScheme), alpha2, alpharScheme - ); + ) + ); // Create the bounded (upwind) flux for alpha2 - surfaceScalarField phiAlpha2BD = - upwind<scalar>(mesh, phi).flux(alpha2); + surfaceScalarField phiAlpha2BD + ( + upwind<scalar>(mesh, phi).flux(alpha2) + ); // Calculate the flux correction for alpha2 phiAlpha2 -= phiAlpha2BD; @@ -127,8 +135,8 @@ solve(fvm::ddt(alpha1) + fvc::div(phiAlpha1)); // Create the diffusion coefficients for alpha2<->alpha3 - volScalarField Dc23 = D23*max(alpha3, scalar(0))*pos(alpha2); - volScalarField Dc32 = D23*max(alpha2, scalar(0))*pos(alpha3); + volScalarField Dc23(D23*max(alpha3, scalar(0))*pos(alpha2)); + volScalarField Dc32(D23*max(alpha2, scalar(0))*pos(alpha3)); // Add the diffusive flux for alpha3->alpha2 phiAlpha2 -= fvc::interpolate(Dc32)*mesh.magSf()*fvc::snGrad(alpha1); diff --git a/applications/solvers/multiphase/interMixingFoam/alphaEqnsSubCycle.H b/applications/solvers/multiphase/interMixingFoam/alphaEqnsSubCycle.H index 765087a183baf3db62ec9b4dcf382d667b6209f3..81e09f9b900ca6362114330a396b63ca4e0e57ec 100644 --- a/applications/solvers/multiphase/interMixingFoam/alphaEqnsSubCycle.H +++ b/applications/solvers/multiphase/interMixingFoam/alphaEqnsSubCycle.H @@ -10,7 +10,7 @@ label nAlphaSubCycles if (nAlphaSubCycles > 1) { - surfaceScalarField rhoPhiSum = 0.0*rhoPhi; + surfaceScalarField rhoPhiSum(0.0*rhoPhi); dimensionedScalar totalDeltaT = runTime.deltaT(); for @@ -33,7 +33,7 @@ else interface.correct(); { - volScalarField rhoNew = alpha1*rho1 + alpha2*rho2 + alpha3*rho3; + volScalarField rhoNew(alpha1*rho1 + alpha2*rho2 + alpha3*rho3); //solve(fvm::ddt(rho) + fvc::div(rhoPhi)); //Info<< "density error = " diff --git a/applications/solvers/multiphase/interMixingFoam/incompressibleThreePhaseMixture/threePhaseMixture.C b/applications/solvers/multiphase/interMixingFoam/incompressibleThreePhaseMixture/threePhaseMixture.C index 4ea4c4d9899793ab2e50a136b075c1b6fb47b46e..163d5a5410c2268d2c3afe9ddc8024e10bd39679 100644 --- a/applications/solvers/multiphase/interMixingFoam/incompressibleThreePhaseMixture/threePhaseMixture.C +++ b/applications/solvers/multiphase/interMixingFoam/incompressibleThreePhaseMixture/threePhaseMixture.C @@ -133,9 +133,9 @@ Foam::tmp<Foam::volScalarField> Foam::threePhaseMixture::mu() const Foam::tmp<Foam::surfaceScalarField> Foam::threePhaseMixture::muf() const { - surfaceScalarField alpha1f = fvc::interpolate(alpha1_); - surfaceScalarField alpha2f = fvc::interpolate(alpha2_); - surfaceScalarField alpha3f = fvc::interpolate(alpha3_); + surfaceScalarField alpha1f(fvc::interpolate(alpha1_)); + surfaceScalarField alpha2f(fvc::interpolate(alpha2_)); + surfaceScalarField alpha3f(fvc::interpolate(alpha3_)); return tmp<surfaceScalarField> ( @@ -152,9 +152,9 @@ Foam::tmp<Foam::surfaceScalarField> Foam::threePhaseMixture::muf() const Foam::tmp<Foam::surfaceScalarField> Foam::threePhaseMixture::nuf() const { - surfaceScalarField alpha1f = fvc::interpolate(alpha1_); - surfaceScalarField alpha2f = fvc::interpolate(alpha2_); - surfaceScalarField alpha3f = fvc::interpolate(alpha3_); + surfaceScalarField alpha1f(fvc::interpolate(alpha1_)); + surfaceScalarField alpha2f(fvc::interpolate(alpha2_)); + surfaceScalarField alpha3f(fvc::interpolate(alpha3_)); return tmp<surfaceScalarField> ( diff --git a/applications/solvers/multiphase/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.C b/applications/solvers/multiphase/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.C index 48089e7c926a4524a33666959006bb0826957e3d..ad9e9fa1c5b0ff329c108e65f30c4a70737df876 100644 --- a/applications/solvers/multiphase/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.C +++ b/applications/solvers/multiphase/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.C @@ -81,31 +81,35 @@ void Foam::threePhaseInterfaceProperties::correctContactAngle refCast<const alphaContactAngleFvPatchScalarField> (alpha3[patchi]); - scalarField twoPhaseAlpha2 = max(a2cap, scalar(0)); - scalarField twoPhaseAlpha3 = max(a3cap, scalar(0)); + scalarField twoPhaseAlpha2(max(a2cap, scalar(0))); + scalarField twoPhaseAlpha3(max(a3cap, scalar(0))); - scalarField sumTwoPhaseAlpha = - twoPhaseAlpha2 + twoPhaseAlpha3 + SMALL; + scalarField sumTwoPhaseAlpha + ( + twoPhaseAlpha2 + twoPhaseAlpha3 + SMALL + ); twoPhaseAlpha2 /= sumTwoPhaseAlpha; twoPhaseAlpha3 /= sumTwoPhaseAlpha; fvsPatchVectorField& nHatp = nHatb[patchi]; - scalarField theta = + scalarField theta + ( convertToRad - *( + * ( twoPhaseAlpha2*(180 - a2cap.theta(U[patchi], nHatp)) + twoPhaseAlpha3*(180 - a3cap.theta(U[patchi], nHatp)) - ); + ) + ); - vectorField nf = boundary[patchi].nf(); + vectorField nf(boundary[patchi].nf()); // Reset nHatPatch to correspond to the contact angle - scalarField a12 = nHatp & nf; + scalarField a12(nHatp & nf); - scalarField b1 = cos(theta); + scalarField b1(cos(theta)); scalarField b2(nHatp.size()); @@ -114,10 +118,10 @@ void Foam::threePhaseInterfaceProperties::correctContactAngle b2[facei] = cos(acos(a12[facei]) - theta[facei]); } - scalarField det = 1.0 - a12*a12; + scalarField det(1.0 - a12*a12); - scalarField a = (b1 - a12*b2)/det; - scalarField b = (b2 - a12*b1)/det; + scalarField a((b1 - a12*b2)/det); + scalarField b((b2 - a12*b1)/det); nHatp = a*nf + b*nHatp; @@ -135,13 +139,13 @@ void Foam::threePhaseInterfaceProperties::calculateK() const surfaceVectorField& Sf = mesh.Sf(); // Cell gradient of alpha - volVectorField gradAlpha = fvc::grad(alpha1); + volVectorField gradAlpha(fvc::grad(alpha1)); // Interpolated face-gradient of alpha - surfaceVectorField gradAlphaf = fvc::interpolate(gradAlpha); + surfaceVectorField gradAlphaf(fvc::interpolate(gradAlpha)); // Face unit interface normal - surfaceVectorField nHatfv = gradAlphaf/(mag(gradAlphaf) + deltaN_); + surfaceVectorField nHatfv(gradAlphaf/(mag(gradAlphaf) + deltaN_)); correctContactAngle(nHatfv.boundaryField()); // Face unit interface normal flux diff --git a/applications/solvers/multiphase/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.H b/applications/solvers/multiphase/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.H index d21409408fdba8fb5dcb57227f29a3755249b783..d136aab5c02654d9eb9800da06652a00cf7a332d 100644 --- a/applications/solvers/multiphase/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.H +++ b/applications/solvers/multiphase/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.H @@ -125,8 +125,8 @@ public: tmp<volScalarField> sigma() const { - volScalarField limitedAlpha2 = max(mixture_.alpha2(), scalar(0)); - volScalarField limitedAlpha3 = max(mixture_.alpha3(), scalar(0)); + volScalarField limitedAlpha2(max(mixture_.alpha2(), scalar(0))); + volScalarField limitedAlpha3(max(mixture_.alpha3(), scalar(0))); return (limitedAlpha2*sigma12_ + limitedAlpha3*sigma13_) diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H index 05226dc72f4ae8109004ecaf4f6d5f26d996e446..9ce20db849e48869930b74ce03f186e33c74e5ad 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H @@ -6,7 +6,8 @@ for (int gCorr=0; gCorr<nAlphaCorr; gCorr++) { - surfaceScalarField phiAlpha = + surfaceScalarField phiAlpha + ( fvc::flux ( phi, @@ -18,7 +19,8 @@ -fvc::flux(-phir, scalar(1) - alpha1, alpharScheme), alpha1, alpharScheme - ); + ) + ); Pair<tmp<volScalarField> > vDotAlphal = twoPhaseProperties->vDotAlphal(); diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqnSubCycle.H b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqnSubCycle.H index df45bc64825d15a622c6630868a1eddcb7aac4b2..eea578e6e580c07c0b2368381bd5b6683900ee0b 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqnSubCycle.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqnSubCycle.H @@ -21,10 +21,10 @@ surfaceScalarField rhoPhi readLabel(piso.lookup("nAlphaSubCycles")) ); - surfaceScalarField phic = mag(phi/mesh.magSf()); + surfaceScalarField phic(mag(phi/mesh.magSf())); phic = min(interface.cAlpha()*phic, max(phic)); - volScalarField divU = fvc::div(phi); + volScalarField divU(fvc::div(phi)); dimensionedScalar totalDeltaT = runTime.deltaT(); diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H b/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H index 4f4e68cb595b84a931e9b8127e9d86697fb6045e..925e10aad2934deeb0c676025ff2ae42579c5ba5 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H @@ -1,6 +1,6 @@ { - volScalarField rAU = 1.0/UEqn.A(); - surfaceScalarField rAUf = fvc::interpolate(rAU); + volScalarField rAU(1.0/UEqn.A()); + surfaceScalarField rAUf(fvc::interpolate(rAU)); U = rAU*UEqn.H(); diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Kunz/Kunz.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Kunz/Kunz.C index 407512211659d54c83d141cfa68f5c74607c451d..1459fdc2fc53347bc7edf36cd531f3ecdf1ba3b5 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Kunz/Kunz.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Kunz/Kunz.C @@ -68,7 +68,7 @@ Foam::Pair<Foam::tmp<Foam::volScalarField> > Foam::phaseChangeTwoPhaseMixtures::Kunz::mDotAlphal() const { const volScalarField& p = alpha1_.db().lookupObject<volScalarField>("p"); - volScalarField limitedAlpha1 = min(max(alpha1_, scalar(0)), scalar(1)); + volScalarField limitedAlpha1(min(max(alpha1_, scalar(0)), scalar(1))); return Pair<tmp<volScalarField> > ( @@ -83,7 +83,7 @@ Foam::Pair<Foam::tmp<Foam::volScalarField> > Foam::phaseChangeTwoPhaseMixtures::Kunz::mDotP() const { const volScalarField& p = alpha1_.db().lookupObject<volScalarField>("p"); - volScalarField limitedAlpha1 = min(max(alpha1_, scalar(0)), scalar(1)); + volScalarField limitedAlpha1(min(max(alpha1_, scalar(0)), scalar(1))); return Pair<tmp<volScalarField> > ( diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Merkle/Merkle.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Merkle/Merkle.C index 66c279df2c671faf74a17242432b41107aa53978..250fb00578571d3d2d54c1778a83b9e7532f174a 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Merkle/Merkle.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Merkle/Merkle.C @@ -80,7 +80,7 @@ Foam::Pair<Foam::tmp<Foam::volScalarField> > Foam::phaseChangeTwoPhaseMixtures::Merkle::mDotP() const { const volScalarField& p = alpha1_.db().lookupObject<volScalarField>("p"); - volScalarField limitedAlpha1 = min(max(alpha1_, scalar(0)), scalar(1)); + volScalarField limitedAlpha1(min(max(alpha1_, scalar(0)), scalar(1))); return Pair<tmp<volScalarField> > ( diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C index 61e57b3a5e530c8a3104ec794a6f3561b59f0218..fb390277fbf8e1120642260dc1d5d3ea8a9f4874 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C @@ -97,9 +97,11 @@ Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer::pCoeff const volScalarField& p ) const { - volScalarField limitedAlpha1 = min(max(alpha1_, scalar(0)), scalar(1)); - volScalarField rho = - (limitedAlpha1*rho1() + (scalar(1) - limitedAlpha1)*rho2()); + volScalarField limitedAlpha1(min(max(alpha1_, scalar(0)), scalar(1))); + volScalarField rho + ( + limitedAlpha1*rho1() + (scalar(1) - limitedAlpha1)*rho2() + ); return (3*rho1()*rho2())*sqrt(2/(3*rho1())) @@ -111,9 +113,9 @@ Foam::Pair<Foam::tmp<Foam::volScalarField> > Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer::mDotAlphal() const { const volScalarField& p = alpha1_.db().lookupObject<volScalarField>("p"); - volScalarField limitedAlpha1 = min(max(alpha1_, scalar(0)), scalar(1)); + volScalarField limitedAlpha1(min(max(alpha1_, scalar(0)), scalar(1))); - volScalarField pCoeff = this->pCoeff(p); + volScalarField pCoeff(this->pCoeff(p)); return Pair<tmp<volScalarField> > ( @@ -128,9 +130,9 @@ Foam::Pair<Foam::tmp<Foam::volScalarField> > Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer::mDotP() const { const volScalarField& p = alpha1_.db().lookupObject<volScalarField>("p"); - volScalarField limitedAlpha1 = min(max(alpha1_, scalar(0)), scalar(1)); + volScalarField limitedAlpha1(min(max(alpha1_, scalar(0)), scalar(1))); - volScalarField apCoeff = limitedAlpha1*pCoeff(p); + volScalarField apCoeff(limitedAlpha1*pCoeff(p)); return Pair<tmp<volScalarField> > ( diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.C index 0ae535dd518477cae74457d3c2cd29325c4adf8a..374d61ddfa6f905f61b8387a2c69240253e2ac36 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.C @@ -54,7 +54,7 @@ Foam::phaseChangeTwoPhaseMixture::phaseChangeTwoPhaseMixture Foam::Pair<Foam::tmp<Foam::volScalarField> > Foam::phaseChangeTwoPhaseMixture::vDotAlphal() const { - volScalarField alphalCoeff = 1.0/rho1() - alpha1_*(1.0/rho1() - 1.0/rho2()); + volScalarField alphalCoeff(1.0/rho1() - alpha1_*(1.0/rho1() - 1.0/rho2())); Pair<tmp<volScalarField> > mDotAlphal = this->mDotAlphal(); return Pair<tmp<volScalarField> > diff --git a/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/pEqn.H b/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/pEqn.H index 3f59b6b3fca29006bbfde5ec4d146f947b1bea2a..8be2e12bf6a994394c5b624209e0b1882898dc68 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/pEqn.H +++ b/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/pEqn.H @@ -1,6 +1,6 @@ { - volScalarField rAU = 1.0/UEqn.A(); - surfaceScalarField rAUf = fvc::interpolate(rAU); + volScalarField rAU(1.0/UEqn.A()); + surfaceScalarField rAUf(fvc::interpolate(rAU)); U = rAU*UEqn.H(); diff --git a/applications/solvers/multiphase/multiphaseInterFoam/alphaCourantNo.H b/applications/solvers/multiphase/multiphaseInterFoam/alphaCourantNo.H index a63ab62103e36c36581d607fd621df9bca405b6a..bfcb18f2c136b98cdfda690dbd88384545ca4c71 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/alphaCourantNo.H +++ b/applications/solvers/multiphase/multiphaseInterFoam/alphaCourantNo.H @@ -39,9 +39,11 @@ scalar meanAlphaCoNum = 0.0; if (mesh.nInternalFaces()) { - scalarField sumPhi = + scalarField sumPhi + ( mixture.nearInterface()().internalField() - *fvc::surfaceSum(mag(phi))().internalField(); + * fvc::surfaceSum(mag(phi))().internalField() + ); alphaCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue(); diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.C index 6256b1cebfe7cdd02395cf1638237c628c8f48e8..9be378e5c579681a26f0f6763ec6934a7b8b4eed 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.C +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.C @@ -133,7 +133,11 @@ void alphaContactAngleFvPatchScalarField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField(fvPatchScalarField, alphaContactAngleFvPatchScalarField); +makeNonTemplatedPatchTypeField +( + fvPatchScalarField, + alphaContactAngleFvPatchScalarField +); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C index 22c45bad7182b33d5e7920f6c5654e0abbd6debd..d2bb7d05b4e321ee3a5dc2fa6b60fc02657edd41 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C @@ -273,7 +273,7 @@ void Foam::multiphaseMixture::solve() if (nAlphaSubCycles > 1) { - surfaceScalarField rhoPhiSum = 0.0*rhoPhi_; + surfaceScalarField rhoPhiSum(0.0*rhoPhi_); dimensionedScalar totalDeltaT = runTime.deltaT(); for @@ -314,9 +314,11 @@ Foam::tmp<Foam::surfaceVectorField> Foam::multiphaseMixture::nHatfv surfaceVectorField gradAlphaf = fvc::interpolate(gradAlpha); */ - surfaceVectorField gradAlphaf = + surfaceVectorField gradAlphaf + ( fvc::interpolate(alpha2)*fvc::interpolate(fvc::grad(alpha1)) - - fvc::interpolate(alpha1)*fvc::interpolate(fvc::grad(alpha2)); + - fvc::interpolate(alpha1)*fvc::interpolate(fvc::grad(alpha2)) + ); // Face unit interface normal return gradAlphaf/(mag(gradAlphaf) + deltaN_); @@ -361,9 +363,11 @@ void Foam::multiphaseMixture::correctContactAngle vectorField& nHatPatch = nHatb[patchi]; - vectorField AfHatPatch = + vectorField AfHatPatch + ( mesh_.Sf().boundaryField()[patchi] - /mesh_.magSf().boundaryField()[patchi]; + /mesh_.magSf().boundaryField()[patchi] + ); alphaContactAngleFvPatchScalarField::thetaPropsTable:: const_iterator tp = @@ -396,21 +400,25 @@ void Foam::multiphaseMixture::correctContactAngle scalar thetaR = convertToRad*tp().thetaR(matched); // Calculated the component of the velocity parallel to the wall - vectorField Uwall = + vectorField Uwall + ( U_.boundaryField()[patchi].patchInternalField() - - U_.boundaryField()[patchi]; + - U_.boundaryField()[patchi] + ); Uwall -= (AfHatPatch & Uwall)*AfHatPatch; // Find the direction of the interface parallel to the wall - vectorField nWall = - nHatPatch - (AfHatPatch & nHatPatch)*AfHatPatch; + vectorField nWall + ( + nHatPatch - (AfHatPatch & nHatPatch)*AfHatPatch + ); // Normalise nWall nWall /= (mag(nWall) + SMALL); // Calculate Uwall resolved normal to the interface parallel to // the interface - scalarField uwall = nWall & Uwall; + scalarField uwall(nWall & Uwall); theta += (thetaA - thetaR)*tanh(uwall/uTheta); } @@ -418,9 +426,9 @@ void Foam::multiphaseMixture::correctContactAngle // Reset nHatPatch to correspond to the contact angle - scalarField a12 = nHatPatch & AfHatPatch; + scalarField a12(nHatPatch & AfHatPatch); - scalarField b1 = cos(theta); + scalarField b1(cos(theta)); scalarField b2(nHatPatch.size()); @@ -429,10 +437,10 @@ void Foam::multiphaseMixture::correctContactAngle b2[facei] = cos(acos(a12[facei]) - theta[facei]); } - scalarField det = 1.0 - a12*a12; + scalarField det(1.0 - a12*a12); - scalarField a = (b1 - a12*b2)/det; - scalarField b = (b2 - a12*b1)/det; + scalarField a((b1 - a12*b2)/det); + scalarField b((b2 - a12*b1)/det); nHatPatch = a*AfHatPatch + b*nHatPatch; @@ -508,7 +516,7 @@ void Foam::multiphaseMixture::solveAlphas ) ); - surfaceScalarField phic = mag(phi_/mesh_.magSf()); + surfaceScalarField phic(mag(phi_/mesh_.magSf())); phic = min(cAlpha*phic, max(phic)); for (int gCorr=0; gCorr<nAlphaCorr; gCorr++) @@ -527,7 +535,7 @@ void Foam::multiphaseMixture::solveAlphas phase& refPhase = *refPhasePtr; - volScalarField refPhaseNew = refPhase; + volScalarField refPhaseNew(refPhase); refPhaseNew == 1.0; rhoPhi_ = phi_*refPhase.rho(); @@ -550,9 +558,11 @@ void Foam::multiphaseMixture::solveAlphas if (&alpha2 == &alpha) continue; - surfaceScalarField phir = phic*nHatf(alpha, alpha2); - surfaceScalarField phirb12 = - -fvc::flux(-phir, alpha2, alphacScheme); + surfaceScalarField phir(phic*nHatf(alpha, alpha2)); + surfaceScalarField phirb12 + ( + -fvc::flux(-phir, alpha2, alphacScheme) + ); alphaEqn += fvm::div(phirb12, alpha, alphacScheme); } diff --git a/applications/solvers/multiphase/multiphaseInterFoam/pEqn.H b/applications/solvers/multiphase/multiphaseInterFoam/pEqn.H index c06b843d8b37d62e10806cff8ea620e2e35443ca..712fcfc9a1e47b4d86949701056d5beaa9cdd90d 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/pEqn.H +++ b/applications/solvers/multiphase/multiphaseInterFoam/pEqn.H @@ -1,6 +1,6 @@ { - volScalarField rAU = 1.0/UEqn.A(); - surfaceScalarField rAUf = fvc::interpolate(rAU); + volScalarField rAU(1.0/UEqn.A()); + surfaceScalarField rAUf(fvc::interpolate(rAU)); U = rAU*UEqn.H(); diff --git a/applications/solvers/multiphase/settlingFoam/createFields.H b/applications/solvers/multiphase/settlingFoam/createFields.H index cfa2e9fd384c62b2271a6b7bdaec58db2b07dc5a..eaa21a8065ab2ba3e04133685c8c00808dd61f05 100644 --- a/applications/solvers/multiphase/settlingFoam/createFields.H +++ b/applications/solvers/multiphase/settlingFoam/createFields.H @@ -345,7 +345,7 @@ Info<< "Calculating field (g.h)f\n" << endl; volScalarField gh("gh", g & mesh.C()); - surfaceScalarField ghf = surfaceScalarField("gh", g & mesh.Cf()); + surfaceScalarField ghf(surfaceScalarField("gh", g & mesh.Cf())); volScalarField p ( diff --git a/applications/solvers/multiphase/settlingFoam/kEpsilon.H b/applications/solvers/multiphase/settlingFoam/kEpsilon.H index 2262ba3dbc2387866ea3b19ddf3756508986c874..ac1de3b9e1c25152467a1f6ad04ae184e7f36bb4 100644 --- a/applications/solvers/multiphase/settlingFoam/kEpsilon.H +++ b/applications/solvers/multiphase/settlingFoam/kEpsilon.H @@ -8,14 +8,16 @@ if (turbulence) dimensionedScalar kMin("kMin", k.dimensions(), SMALL); dimensionedScalar epsilonMin("epsilonMin", epsilon.dimensions(), SMALL); - volScalarField divU = fvc::div(phi/fvc::interpolate(rho)); + volScalarField divU(fvc::div(phi/fvc::interpolate(rho))); tmp<volTensorField> tgradU = fvc::grad(U); - volScalarField G = 2*mut*(tgradU() && dev(symm(tgradU()))); + volScalarField G(2*mut*(tgradU() && dev(symm(tgradU())))); tgradU.clear(); - volScalarField Gcoef = - Cmu*k/sigmak*(g & fvc::grad(rho))/(epsilon + epsilonMin); + volScalarField Gcoef + ( + Cmu*k/sigmak*(g & fvc::grad(rho))/(epsilon + epsilonMin) + ); #include "wallFunctions.H" diff --git a/applications/solvers/multiphase/settlingFoam/pEqn.H b/applications/solvers/multiphase/settlingFoam/pEqn.H index 806909ffe7521969fb072795eb5f45eaebbf0bf6..f359e952542436193bd149ee7ec2823383fbdc27 100644 --- a/applications/solvers/multiphase/settlingFoam/pEqn.H +++ b/applications/solvers/multiphase/settlingFoam/pEqn.H @@ -1,4 +1,4 @@ -volScalarField rAU = 1.0/UEqn.A(); +volScalarField rAU(1.0/UEqn.A()); surfaceScalarField rAUf ( diff --git a/applications/solvers/multiphase/settlingFoam/plasticViscosity.H b/applications/solvers/multiphase/settlingFoam/plasticViscosity.H index cbbeb7f3f50a28d15cd3e0c00ae1eb708a20706f..2797205a756b6e3ca93e544fe7a1036fdf3936f2 100644 --- a/applications/solvers/multiphase/settlingFoam/plasticViscosity.H +++ b/applications/solvers/multiphase/settlingFoam/plasticViscosity.H @@ -5,11 +5,13 @@ volScalarField plasticViscosity const volScalarField& alpha ) { - return + tmp<volScalarField> tfld ( plasticViscosityCoeff* ( pow(10.0, plasticViscosityExponent*alpha + SMALL) - scalar(1) ) ); + + return tfld(); } diff --git a/applications/solvers/multiphase/settlingFoam/wallFunctions.H b/applications/solvers/multiphase/settlingFoam/wallFunctions.H index decccfbff5924b0fdde9562c9bbbe087e5ecb9d9..952d3c459126b6e84b629fa5162a44a3dc4bf878 100644 --- a/applications/solvers/multiphase/settlingFoam/wallFunctions.H +++ b/applications/solvers/multiphase/settlingFoam/wallFunctions.H @@ -34,11 +34,13 @@ { const scalarField& rhow = rho.boundaryField()[patchi]; - const scalarField muw = mul.boundaryField()[patchi]; + const scalarField muw(mul.boundaryField()[patchi]); const scalarField& mutw = mut.boundaryField()[patchi]; - scalarField magFaceGradU = - mag(U.boundaryField()[patchi].snGrad()); + scalarField magFaceGradU + ( + mag(U.boundaryField()[patchi].snGrad()) + ); forAll(curPatch, facei) { diff --git a/applications/solvers/multiphase/settlingFoam/wallViscosity.H b/applications/solvers/multiphase/settlingFoam/wallViscosity.H index 8f64c27b3ce037d49c96a1a48b16f63025a964a4..9516bb0feae318d5b0297b10107748a32d8405cc 100644 --- a/applications/solvers/multiphase/settlingFoam/wallViscosity.H +++ b/applications/solvers/multiphase/settlingFoam/wallViscosity.H @@ -13,7 +13,7 @@ { const scalarField& rhow = rho.boundaryField()[patchi]; - const scalarField muw = mul.boundaryField()[patchi]; + const scalarField muw(mul.boundaryField()[patchi]); scalarField& mutw = mut.boundaryField()[patchi]; forAll(curPatch, facei) diff --git a/applications/solvers/multiphase/settlingFoam/yieldStress.H b/applications/solvers/multiphase/settlingFoam/yieldStress.H index 6b1b734f5093f9b9e54c9d14c1e6e81c23109c64..cb0415c66f58c0651867205bde735e6cbd43a4fe 100644 --- a/applications/solvers/multiphase/settlingFoam/yieldStress.H +++ b/applications/solvers/multiphase/settlingFoam/yieldStress.H @@ -6,7 +6,7 @@ volScalarField yieldStress const volScalarField& alpha ) { - return + tmp<volScalarField> tfld ( yieldStressCoeff* ( @@ -14,4 +14,6 @@ volScalarField yieldStress - pow(10.0, yieldStressExponent*yieldStressOffset) ) ); + + return tfld(); } diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/pEqn.H b/applications/solvers/multiphase/twoLiquidMixingFoam/pEqn.H index ca11063449ca8ee3b44fb683a87995ce676c3846..08f00fc185b794f4f821a4a08b563f72a074b618 100644 --- a/applications/solvers/multiphase/twoLiquidMixingFoam/pEqn.H +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/pEqn.H @@ -1,6 +1,6 @@ { - volScalarField rAU = 1.0/UEqn.A(); - surfaceScalarField rAUf = fvc::interpolate(rAU); + volScalarField rAU(1.0/UEqn.A()); + surfaceScalarField rAUf(fvc::interpolate(rAU)); U = rAU*UEqn.H(); surfaceScalarField phiU diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/UEqns.H b/applications/solvers/multiphase/twoPhaseEulerFoam/UEqns.H index 6eb2fe8850b3e66016a7ea13e37b29c26448e93d..b07f3e70dd396e95e9f38637a6b5ba4fb06c7fbb 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/UEqns.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/UEqns.H @@ -3,7 +3,7 @@ fvVectorMatrix UbEqn(Ub, Ub.dimensions()*dimVol/dimTime); { { - volTensorField gradUaT = fvc::grad(Ua)().T(); + volTensorField gradUaT(fvc::grad(Ua)().T()); if (kineticTheory.on()) { @@ -26,9 +26,11 @@ fvVectorMatrix UbEqn(Ub, Ub.dimensions()*dimVol/dimTime); Rca -= ((kineticTheory.lambda()/rhoa)*tr(gradUaT))*tensor(I); } - surfaceScalarField phiRa = + surfaceScalarField phiRa + ( -fvc::interpolate(nuEffa)*mesh.magSf()*fvc::snGrad(alpha) - /fvc::interpolate(alpha + scalar(0.001)); + /fvc::interpolate(alpha + scalar(0.001)) + ); UaEqn = ( @@ -56,16 +58,18 @@ fvVectorMatrix UbEqn(Ub, Ub.dimensions()*dimVol/dimTime); } { - volTensorField gradUbT = fvc::grad(Ub)().T(); + volTensorField gradUbT(fvc::grad(Ub)().T()); volTensorField Rcb ( "Rcb", ((2.0/3.0)*I)*(k + nuEffb*tr(gradUbT)) - nuEffb*gradUbT ); - surfaceScalarField phiRb = + surfaceScalarField phiRb + ( -fvc::interpolate(nuEffb)*mesh.magSf()*fvc::snGrad(beta) - /fvc::interpolate(beta + scalar(0.001)); + /fvc::interpolate(beta + scalar(0.001)) + ); UbEqn = ( diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/alphaEqn.H b/applications/solvers/multiphase/twoPhaseEulerFoam/alphaEqn.H index 47057c0efb44ce9bfa26e50a70fc0588dd3df682..cac8e52a8efb7d6a1b9115afc595e4b4617f88eb 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/alphaEqn.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/alphaEqn.H @@ -2,13 +2,13 @@ word scheme("div(phi,alpha)"); word schemer("div(phir,alpha)"); - surfaceScalarField phic = phi; - surfaceScalarField phir = phia - phib; + surfaceScalarField phic(phi); + surfaceScalarField phir(phia - phib); if (g0.value() > 0.0) { - surfaceScalarField alphaf = fvc::interpolate(alpha); - surfaceScalarField phipp = ppMagf*fvc::snGrad(alpha)*mesh.magSf(); + surfaceScalarField alphaf(fvc::interpolate(alpha)); + surfaceScalarField phipp(ppMagf*fvc::snGrad(alpha)*mesh.magSf()); phir += phipp; phic += fvc::interpolate(alpha)*phipp; } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/createFields.H b/applications/solvers/multiphase/twoPhaseEulerFoam/createFields.H index e422fe845b67041fb3277271559232271ecf2716..00581cd30243c8a2dff97c451105502005c5e25c 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/createFields.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/createFields.H @@ -132,15 +132,19 @@ Info<< "Calculating field DDtUa and DDtUb\n" << endl; - volVectorField DDtUa = + volVectorField DDtUa + ( fvc::ddt(Ua) + fvc::div(phia, Ua) - - fvc::div(phia)*Ua; + - fvc::div(phia)*Ua + ); - volVectorField DDtUb = + volVectorField DDtUb + ( fvc::ddt(Ub) + fvc::div(phib, Ub) - - fvc::div(phib)*Ub; + - fvc::div(phib)*Ub + ); Info<< "Calculating field g.h\n" << endl; diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Ergun/Ergun.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Ergun/Ergun.C index da4c723a3227a6de4162ae4b7e9cc70598040c34..2b68640f23e5ca4cb9f4e588fab198dd6dae0dbc 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Ergun/Ergun.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Ergun/Ergun.C @@ -68,7 +68,7 @@ Foam::tmp<Foam::volScalarField> Foam::Ergun::K const volScalarField& Ur ) const { - volScalarField beta = max(scalar(1) - alpha_, scalar(1.0e-6)); + volScalarField beta(max(scalar(1) - alpha_, scalar(1.0e-6))); return 150.0*alpha_*phaseb_.nu()*phaseb_.rho() diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.C index e728d5d9677f1a58771af3b424a27048a10eaebe..4ff7d0fc136b609f5cead1ac0b748db34250d1e1 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.C @@ -68,9 +68,9 @@ Foam::tmp<Foam::volScalarField> Foam::Gibilaro::K const volScalarField& Ur ) const { - volScalarField beta = max(scalar(1) - alpha_, scalar(1.0e-6)); - volScalarField bp = pow(beta, -2.8); - volScalarField Re = max(beta*Ur*phasea_.d()/phaseb_.nu(), scalar(1.0e-3)); + volScalarField beta(max(scalar(1) - alpha_, scalar(1.0e-6))); + volScalarField bp(pow(beta, -2.8)); + volScalarField Re(max(beta*Ur*phasea_.d()/phaseb_.nu(), scalar(1.0e-3))); return (17.3/Re + scalar(0.336))*phaseb_.rho()*Ur*bp/phasea_.d(); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C index da72226edb8646ef60bc863057c053752909afc2..a99f975330947e001f99655ea9d3ed0a1f4d228c 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C @@ -68,12 +68,12 @@ Foam::tmp<Foam::volScalarField> Foam::GidaspowErgunWenYu::K const volScalarField& Ur ) const { - volScalarField beta = max(scalar(1) - alpha_, scalar(1.0e-6)); + volScalarField beta(max(scalar(1) - alpha_, scalar(1.0e-6))); - volScalarField bp = pow(beta, -2.65); - volScalarField Re = max(Ur*phasea_.d()/phaseb_.nu(), scalar(1.0e-3)); + volScalarField bp(pow(beta, -2.65)); + volScalarField Re(max(Ur*phasea_.d()/phaseb_.nu(), scalar(1.0e-3))); - volScalarField Cds = 24.0*(1.0 + 0.15*pow(Re, 0.687))/Re; + volScalarField Cds(24.0*(1.0 + 0.15*pow(Re, 0.687))/Re); forAll(Re, celli) { diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.C index 5f9f2054db07fbecdca7a2f07731c33c1183842f..1da8e0c547804c292dd098041baf5fb8b7a91b7a 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.C @@ -68,11 +68,11 @@ Foam::tmp<Foam::volScalarField> Foam::GidaspowSchillerNaumann::K const volScalarField& Ur ) const { - volScalarField beta = max(scalar(1) - alpha_, scalar(1e-6)); - volScalarField bp = pow(beta, -2.65); + volScalarField beta(max(scalar(1) - alpha_, scalar(1e-6))); + volScalarField bp(pow(beta, -2.65)); - volScalarField Re = max(beta*Ur*phasea_.d()/phaseb_.nu(), scalar(1.0e-3)); - volScalarField Cds = 24.0*(scalar(1) + 0.15*pow(Re, 0.687))/Re; + volScalarField Re(max(beta*Ur*phasea_.d()/phaseb_.nu(), scalar(1.0e-3))); + volScalarField Cds(24.0*(scalar(1) + 0.15*pow(Re, 0.687))/Re); forAll(Re, celli) { diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.C index 1e99ae05f5ec019f7ed9d892d3bde6067b90e4f2..cdfaac389eadde7c09b3cfe81ba929b83aa9e6d3 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.C @@ -68,8 +68,8 @@ Foam::tmp<Foam::volScalarField> Foam::SchillerNaumann::K const volScalarField& Ur ) const { - volScalarField Re = max(Ur*phasea_.d()/phaseb_.nu(), scalar(1.0e-3)); - volScalarField Cds = 24.0*(scalar(1) + 0.15*pow(Re, 0.687))/Re; + volScalarField Re(max(Ur*phasea_.d()/phaseb_.nu(), scalar(1.0e-3))); + volScalarField Cds(24.0*(scalar(1) + 0.15*pow(Re, 0.687))/Re); forAll(Re, celli) { diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.C index 517b21cfe7d7eb408e3f88a72faf72e0c8e48be6..45989dbf3f8b6a50931094c058dcf6c6a1508b0c 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.C @@ -68,9 +68,9 @@ Foam::tmp<Foam::volScalarField> Foam::SyamlalOBrien::K const volScalarField& Ur ) const { - volScalarField beta = max(scalar(1) - alpha_, scalar(1.0e-6)); - volScalarField A = pow(beta, 4.14); - volScalarField B = 0.8*pow(beta, 1.28); + volScalarField beta(max(scalar(1) - alpha_, scalar(1.0e-6))); + volScalarField A(pow(beta, 4.14)); + volScalarField B(0.8*pow(beta, 1.28)); forAll (beta, celli) { @@ -80,14 +80,17 @@ Foam::tmp<Foam::volScalarField> Foam::SyamlalOBrien::K } } - volScalarField Re = max(Ur*phasea_.d()/phaseb_.nu(), scalar(1.0e-3)); + volScalarField Re(max(Ur*phasea_.d()/phaseb_.nu(), scalar(1.0e-3))); - volScalarField Vr = 0.5* + volScalarField Vr ( - A - 0.06*Re + sqrt(sqr(0.06*Re) + 0.12*Re*(2.0*B - A) + sqr(A)) + 0.5* + ( + A - 0.06*Re + sqrt(sqr(0.06*Re) + 0.12*Re*(2.0*B - A) + sqr(A)) + ) ); - volScalarField Cds = sqr(0.63 + 4.8*sqrt(Vr/Re)); + volScalarField Cds(sqr(0.63 + 4.8*sqrt(Vr/Re))); return 0.75*Cds*phaseb_.rho()*Ur/(phasea_.d()*sqr(Vr)); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/WenYu/WenYu.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/WenYu/WenYu.C index 164d82a4a5ce220f404b1f975dda2f3d9e9150af..bfd5eaadbdf4e8169743da1f11a3d7782b73b7fd 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/WenYu/WenYu.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/WenYu/WenYu.C @@ -68,11 +68,11 @@ Foam::tmp<Foam::volScalarField> Foam::WenYu::K const volScalarField& Ur ) const { - volScalarField beta = max(scalar(1) - alpha_, scalar(1.0e-6)); - volScalarField bp = pow(beta, -2.65); + volScalarField beta(max(scalar(1) - alpha_, scalar(1.0e-6))); + volScalarField bp(pow(beta, -2.65)); - volScalarField Re = max(Ur*phasea_.d()/phaseb_.nu(), scalar(1.0e-3)); - volScalarField Cds = 24.0*(scalar(1) + 0.15*pow(Re, 0.687))/Re; + volScalarField Re(max(Ur*phasea_.d()/phaseb_.nu(), scalar(1.0e-3))); + volScalarField Cds(24.0*(scalar(1) + 0.15*pow(Re, 0.687))/Re); forAll(Re, celli) { diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kEpsilon.H b/applications/solvers/multiphase/twoPhaseEulerFoam/kEpsilon.H index 3d53ef8684ef7141ab99a6089122e5bdd2f8b48b..8f85e120529daf4e5c3a963887ea0d1a60b85851 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kEpsilon.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kEpsilon.H @@ -6,7 +6,7 @@ if (turbulence) } tmp<volTensorField> tgradUb = fvc::grad(Ub); - volScalarField G = 2*nutb*(tgradUb() && dev(symm(tgradUb()))); + volScalarField G(2*nutb*(tgradUb() && dev(symm(tgradUb())))); tgradUb.clear(); #include "wallFunctions.H" diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C index c1eb55e14ecfd1b955b697f8b460e30c77fbabc3..d95a2d28319311b74e0a0b084384ebaef08c6c16 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C @@ -75,8 +75,10 @@ Foam::tmp<Foam::volScalarField> Foam::HrenyaSinclairConductivity::kappa { const scalar sqrtPi = sqrt(constant::mathematical::pi); - volScalarField lamda = - scalar(1) + da/(6.0*sqrt(2.0)*(alpha + scalar(1.0e-5)))/L_; + volScalarField lamda + ( + scalar(1) + da/(6.0*sqrt(2.0)*(alpha + scalar(1.0e-5)))/L_ + ); return rhoa*da*sqrt(Theta)* ( diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C index 436d373b04517b125bf39a25c282220fb95e4860..6a11f86c3edc1bbd222dcec2984e7ba6758756f9 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C @@ -202,16 +202,16 @@ void Foam::kineticTheoryModel::solve(const volTensorField& gradUat) const scalar sqrtPi = sqrt(constant::mathematical::pi); - surfaceScalarField phi = 1.5*rhoa_*phia_*fvc::interpolate(alpha_); + surfaceScalarField phi(1.5*rhoa_*phia_*fvc::interpolate(alpha_)); - volTensorField dU = gradUat.T();//fvc::grad(Ua_); - volSymmTensorField D = symm(dU); + volTensorField dU(gradUat.T()); //fvc::grad(Ua_); + volSymmTensorField D(symm(dU)); // NB, drag = K*alpha*beta, // (the alpha and beta has been extracted from the drag function for // numerical reasons) - volScalarField Ur = mag(Ua_ - Ub_); - volScalarField betaPrim = alpha_*(1.0 - alpha_)*draga_.K(Ur); + volScalarField Ur(mag(Ua_ - Ub_)); + volScalarField betaPrim(alpha_*(1.0 - alpha_)*draga_.K(Ur)); // Calculating the radial distribution function (solid volume fraction is // limited close to the packing limit, but this needs improvements) @@ -223,12 +223,15 @@ void Foam::kineticTheoryModel::solve(const volTensorField& gradUat) ); // particle pressure - coefficient in front of Theta (Eq. 3.22, p. 45) - volScalarField PsCoeff = granularPressureModel_->granularPressureCoeff + volScalarField PsCoeff ( - alpha_, - gs0_, - rhoa_, - e_ + granularPressureModel_->granularPressureCoeff + ( + alpha_, + gs0_, + rhoa_, + e_ + ) ); // 'thermal' conductivity (Table 3.3, p. 49) @@ -245,23 +248,27 @@ void Foam::kineticTheoryModel::solve(const volTensorField& gradUat) ); dimensionedScalar TsmallSqrt = sqrt(Tsmall); - volScalarField ThetaSqrt = sqrt(Theta_); + volScalarField ThetaSqrt(sqrt(Theta_)); // dissipation (Eq. 3.24, p.50) - volScalarField gammaCoeff = - 12.0*(1.0 - sqr(e_))*sqr(alpha_)*rhoa_*gs0_*(1.0/da_)*ThetaSqrt/sqrtPi; + volScalarField gammaCoeff + ( + 12.0*(1.0 - sqr(e_))*sqr(alpha_)*rhoa_*gs0_*(1.0/da_)*ThetaSqrt/sqrtPi + ); // Eq. 3.25, p. 50 Js = J1 - J2 - volScalarField J1 = 3.0*betaPrim; - volScalarField J2 = + volScalarField J1(3.0*betaPrim); + volScalarField J2 + ( 0.25*sqr(betaPrim)*da_*sqr(Ur) - /(max(alpha_, scalar(1e-6))*rhoa_*sqrtPi*(ThetaSqrt + TsmallSqrt)); + /(max(alpha_, scalar(1e-6))*rhoa_*sqrtPi*(ThetaSqrt + TsmallSqrt)) + ); // bulk viscosity p. 45 (Lun et al. 1984). lambda_ = (4.0/3.0)*sqr(alpha_)*rhoa_*da_*gs0_*(1.0+e_)*ThetaSqrt/sqrtPi; // stress tensor, Definitions, Table 3.1, p. 43 - volSymmTensorField tau = 2.0*mua_*D + (lambda_ - (2.0/3.0)*mua_)*tr(D)*I; + volSymmTensorField tau(2.0*mua_*D + (lambda_ - (2.0/3.0)*mua_)*tr(D)*I); if (!equilibrium_) { @@ -289,31 +296,38 @@ void Foam::kineticTheoryModel::solve(const volTensorField& gradUat) { // equilibrium => dissipation == production // Eq. 4.14, p.82 - volScalarField K1 = 2.0*(1.0 + e_)*rhoa_*gs0_; - volScalarField K3 = 0.5*da_*rhoa_* + volScalarField K1(2.0*(1.0 + e_)*rhoa_*gs0_); + volScalarField K3 + ( + 0.5*da_*rhoa_* ( (sqrtPi/(3.0*(3.0-e_))) *(1.0 + 0.4*(1.0 + e_)*(3.0*e_ - 1.0)*alpha_*gs0_) +1.6*alpha_*gs0_*(1.0 + e_)/sqrtPi - ); + ) + ); - volScalarField K2 = - 4.0*da_*rhoa_*(1.0 + e_)*alpha_*gs0_/(3.0*sqrtPi) - 2.0*K3/3.0; + volScalarField K2 + ( + 4.0*da_*rhoa_*(1.0 + e_)*alpha_*gs0_/(3.0*sqrtPi) - 2.0*K3/3.0 + ); - volScalarField K4 = 12.0*(1.0 - sqr(e_))*rhoa_*gs0_/(da_*sqrtPi); + volScalarField K4(12.0*(1.0 - sqr(e_))*rhoa_*gs0_/(da_*sqrtPi)); - volScalarField trD = tr(D); - volScalarField tr2D = sqr(trD); - volScalarField trD2 = tr(D & D); + volScalarField trD(tr(D)); + volScalarField tr2D(sqr(trD)); + volScalarField trD2(tr(D & D)); - volScalarField t1 = K1*alpha_ + rhoa_; - volScalarField l1 = -t1*trD; - volScalarField l2 = sqr(t1)*tr2D; - volScalarField l3 = + volScalarField t1(K1*alpha_ + rhoa_); + volScalarField l1(-t1*trD); + volScalarField l2(sqr(t1)*tr2D); + volScalarField l3 + ( 4.0 *K4 *max(alpha_, scalar(1e-6)) - *(2.0*K3*trD2 + K2*tr2D); + *(2.0*K3*trD2 + K2*tr2D) + ); Theta_ = sqr((l1 + sqrt(l2 + l3))/(2.0*(alpha_ + 1.0e-4)*K4)); } @@ -321,14 +335,17 @@ void Foam::kineticTheoryModel::solve(const volTensorField& gradUat) Theta_.max(1.0e-15); Theta_.min(1.0e+3); - volScalarField pf = frictionalStressModel_->frictionalPressure + volScalarField pf ( - alpha_, - alphaMinFriction_, - alphaMax_, - Fr_, - eta_, - p_ + frictionalStressModel_->frictionalPressure + ( + alpha_, + alphaMinFriction_, + alphaMax_, + Fr_, + eta_, + p_ + ) ); PsCoeff += pf/(Theta_+Tsmall); @@ -340,23 +357,26 @@ void Foam::kineticTheoryModel::solve(const volTensorField& gradUat) pa_ = PsCoeff*Theta_; // frictional shear stress, Eq. 3.30, p. 52 - volScalarField muf = frictionalStressModel_->muf + volScalarField muf ( - alpha_, - alphaMax_, - pf, - D, - phi_ + frictionalStressModel_->muf + ( + alpha_, + alphaMax_, + pf, + D, + phi_ + ) ); - // add frictional stress + // add frictional stress mua_ += muf; mua_.min(1.0e+2); mua_.max(0.0); Info<< "kinTheory: max(Theta) = " << max(Theta_).value() << endl; - volScalarField ktn = mua_/rhoa_; + volScalarField ktn(mua_/rhoa_); Info<< "kinTheory: min(nua) = " << min(ktn).value() << ", max(nua) = " << max(ktn).value() << endl; diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C index e52a3b204e7f547adcff8253f172d65d7bf8be0e..620ca79b6918b218d97d96844a517d4bb4646c32 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C @@ -78,8 +78,10 @@ Foam::kineticTheoryModels::HrenyaSinclairViscosity::mua { const scalar sqrtPi = sqrt(constant::mathematical::pi); - volScalarField lamda = - scalar(1) + da/(6.0*sqrt(2.0)*(alpha + scalar(1.0e-5)))/L_; + volScalarField lamda + ( + scalar(1) + da/(6.0*sqrt(2.0)*(alpha + scalar(1.0e-5)))/L_ + ); return rhoa*da*sqrt(Theta)* ( diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/liftDragCoeffs.H b/applications/solvers/multiphase/twoPhaseEulerFoam/liftDragCoeffs.H index 5e0caf1f0973bb2c7c6aa1a16db47b959835a61e..b614a4dfbe89bab3365728f5451d525d92390e98 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/liftDragCoeffs.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/liftDragCoeffs.H @@ -1,18 +1,18 @@ - volVectorField Ur = Ua - Ub; - volScalarField magUr = mag(Ur); + volVectorField Ur(Ua - Ub); + volScalarField magUr(mag(Ur)); - volScalarField Ka = draga->K(magUr); - volScalarField K = Ka; + volScalarField Ka(draga->K(magUr)); + volScalarField K(Ka); if (dragPhase == "b") { - volScalarField Kb = dragb->K(magUr); + volScalarField Kb(dragb->K(magUr)); K = Kb; } else if (dragPhase == "blended") { - volScalarField Kb = dragb->K(magUr); + volScalarField Kb(dragb->K(magUr)); K = (beta*Ka + alpha*Kb); } - volVectorField liftCoeff = Cl*(beta*rhob + alpha*rhoa)*(Ur ^ fvc::curl(U)); + volVectorField liftCoeff(Cl*(beta*rhob + alpha*rhoa)*(Ur ^ fvc::curl(U))); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H b/applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H index f92944a41487c086990330a3442c90dfd4981f74..82fc1280c10a80193838323412b3de9a93f47709 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H @@ -1,21 +1,23 @@ { - surfaceScalarField alphaf = fvc::interpolate(alpha); - surfaceScalarField betaf = scalar(1) - alphaf; + surfaceScalarField alphaf(fvc::interpolate(alpha)); + surfaceScalarField betaf(scalar(1) - alphaf); - volScalarField rUaA = 1.0/UaEqn.A(); - volScalarField rUbA = 1.0/UbEqn.A(); + volScalarField rUaA(1.0/UaEqn.A()); + volScalarField rUbA(1.0/UbEqn.A()); phia == (fvc::interpolate(Ua) & mesh.Sf()); phib == (fvc::interpolate(Ub) & mesh.Sf()); rUaAf = fvc::interpolate(rUaA); - surfaceScalarField rUbAf = fvc::interpolate(rUbA); + surfaceScalarField rUbAf(fvc::interpolate(rUbA)); Ua = rUaA*UaEqn.H(); Ub = rUbA*UbEqn.H(); - surfaceScalarField phiDraga = - fvc::interpolate(beta/rhoa*K*rUaA)*phib + rUaAf*(g & mesh.Sf()); + surfaceScalarField phiDraga + ( + fvc::interpolate(beta/rhoa*K*rUaA)*phib + rUaAf*(g & mesh.Sf()) + ); if (g0.value() > 0.0) { @@ -27,8 +29,10 @@ phiDraga -= rUaAf*fvc::snGrad(kineticTheory.pa()/rhoa)*mesh.magSf(); } - surfaceScalarField phiDragb = - fvc::interpolate(alpha/rhob*K*rUbA)*phia + rUbAf*(g & mesh.Sf()); + surfaceScalarField phiDragb + ( + fvc::interpolate(alpha/rhob*K*rUbA)*phia + rUbAf*(g & mesh.Sf()) + ); // Fix for gravity on outlet boundary. forAll(p.boundaryField(), patchi) @@ -66,7 +70,7 @@ if (nonOrth == nNonOrthCorr) { - surfaceScalarField SfGradp = pEqn.flux()/Dp; + surfaceScalarField SfGradp(pEqn.flux()/Dp); phia -= rUaAf*SfGradp/rhoa; phib -= rUbAf*SfGradp/rhob; diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/packingLimiter.H b/applications/solvers/multiphase/twoPhaseEulerFoam/packingLimiter.H index ba6dcf7ce6798ca56501b5585bad6130ff383730..e5d9d86a559f4faba98dfe26d0aca8f25b07cc6f 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/packingLimiter.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/packingLimiter.H @@ -1,11 +1,11 @@ if (packingLimiter) { // Calculating exceeding volume fractions - volScalarField alphaEx = max(alpha - alphaMax, scalar(0)); + volScalarField alphaEx(max(alpha - alphaMax, scalar(0))); // Finding neighbouring cells of the whole domain labelListList neighbour = mesh.cellCells(); - scalarField cellVolumes = mesh.cellVolumes(); + scalarField cellVolumes(mesh.cellVolumes()); forAll (alphaEx, celli) { diff --git a/applications/solvers/stressAnalysis/solidDisplacementFoam/solidDisplacementFoam.C b/applications/solvers/stressAnalysis/solidDisplacementFoam/solidDisplacementFoam.C index b2b2ac9d0d01b362e46008564065252c5eacdf08..28605769392ed92c7f79560b8e085793ced5589b 100644 --- a/applications/solvers/stressAnalysis/solidDisplacementFoam/solidDisplacementFoam.C +++ b/applications/solvers/stressAnalysis/solidDisplacementFoam/solidDisplacementFoam.C @@ -102,7 +102,7 @@ int main(int argc, char *argv[]) } { - volTensorField gradD = fvc::grad(D); + volTensorField gradD(fvc::grad(D)); sigmaD = mu*twoSymm(gradD) + (lambda*I)*tr(gradD); if (compactNormalStress) diff --git a/applications/solvers/stressAnalysis/solidDisplacementFoam/tractionDisplacement/tractionDisplacementFvPatchVectorField.C b/applications/solvers/stressAnalysis/solidDisplacementFoam/tractionDisplacement/tractionDisplacementFvPatchVectorField.C index a3ca61e0ffe9dac3d1f8eccdfa31126e4f4c71b3..46a947ef0b6e8cdfd8914afde4212a91ca4f3199 100644 --- a/applications/solvers/stressAnalysis/solidDisplacementFoam/tractionDisplacement/tractionDisplacementFvPatchVectorField.C +++ b/applications/solvers/stressAnalysis/solidDisplacementFoam/tractionDisplacement/tractionDisplacementFvPatchVectorField.C @@ -168,7 +168,7 @@ void tractionDisplacementFvPatchVectorField::updateCoeffs() scalar twoMuLambda = (2*mu + lambda).value(); - vectorField n = patch().nf(); + vectorField n(patch().nf()); const fvPatchField<symmTensor>& sigmaD = patch().lookupPatchField<volSymmTensorField, symmTensor>("sigmaD"); @@ -207,7 +207,11 @@ void tractionDisplacementFvPatchVectorField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField(fvPatchVectorField, tractionDisplacementFvPatchVectorField); +makeNonTemplatedPatchTypeField +( + fvPatchVectorField, + tractionDisplacementFvPatchVectorField +); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/kineticEnergyLimiter.H b/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/kineticEnergyLimiter.H index e1074a34085d163b1312d7beacbbf0ffef49313e..169c7f229f2ca2911aad4188e35391a3a97c2ecf 100644 --- a/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/kineticEnergyLimiter.H +++ b/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/kineticEnergyLimiter.H @@ -1,10 +1,10 @@ if (!(runTime.timeIndex() % 5)) { - volScalarField kineticEnergy = magSqr(Dcorr); + volScalarField kineticEnergy(magSqr(Dcorr)); dimensionedScalar intKineticEnergy = fvc::domainIntegrate(kineticEnergy); Info<< "kineticEnergy = " << intKineticEnergy.value() << endl; - volScalarField kineticPower = (Dcorr - Dcorr.oldTime()) & Dcorr; + volScalarField kineticPower((Dcorr - Dcorr.oldTime()) & Dcorr); dimensionedScalar intKineticPower = fvc::domainIntegrate(kineticPower); Info<< "kineticPower = " << intKineticPower.value() << endl; diff --git a/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/solidEquilibriumDisplacementFoam.C b/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/solidEquilibriumDisplacementFoam.C index df2c3ed7f34d517c325ba873bc69595c2c95125f..a44d8cb67b7fd9319afd65b9ffad0dd9f923bb53 100644 --- a/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/solidEquilibriumDisplacementFoam.C +++ b/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/solidEquilibriumDisplacementFoam.C @@ -69,7 +69,7 @@ int main(int argc, char *argv[]) D += accFac*Dcorr; { - volTensorField gradDcorr = fvc::grad(Dcorr); + volTensorField gradDcorr(fvc::grad(Dcorr)); sigmaExp = (lambda - mu)*gradDcorr + mu*gradDcorr.T() diff --git a/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/tractionDisplacementCorrection/tractionDisplacementCorrectionFvPatchVectorField.C b/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/tractionDisplacementCorrection/tractionDisplacementCorrectionFvPatchVectorField.C index b719e8af695ce9390213c809913125494ed1a074..0bf83bcca559831f670fcb9451a25de173679e4a 100644 --- a/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/tractionDisplacementCorrection/tractionDisplacementCorrectionFvPatchVectorField.C +++ b/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/tractionDisplacementCorrection/tractionDisplacementCorrectionFvPatchVectorField.C @@ -165,7 +165,7 @@ void tractionDisplacementCorrectionFvPatchVectorField::updateCoeffs() lambda = nu*E/((1.0 + nu)*(1.0 - nu)); } - vectorField n = patch().nf(); + vectorField n(patch().nf()); const fvPatchField<symmTensor>& sigmaD = patch().lookupPatchField<volSymmTensorField, symmTensor>("sigmaD"); @@ -194,7 +194,7 @@ void tractionDisplacementCorrectionFvPatchVectorField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField +makeNonTemplatedPatchTypeField ( fvPatchVectorField, tractionDisplacementCorrectionFvPatchVectorField diff --git a/applications/test/ODE/Test-ODE.C b/applications/test/ODE/Test-ODE.C index 2a3b8357b9684810fc5f9e646adeb14ced24529e..95af263718eb4a39a191987299e3857c4f2ae4d0 100644 --- a/applications/test/ODE/Test-ODE.C +++ b/applications/test/ODE/Test-ODE.C @@ -129,8 +129,8 @@ int main(int argc, char *argv[]) scalar eps = ::Foam::exp(-scalar(i + 1)); scalar x = xStart; - scalarField y = yStart; - scalarField dydx = dyStart; + scalarField y(yStart); + scalarField dydx(dyStart); scalarField yScale(ode.nEqns(), 1.0); scalar hEst = 0.6; @@ -148,7 +148,7 @@ int main(int argc, char *argv[]) scalar x = xStart; scalar xEnd = x + 1.0; - scalarField y = yStart; + scalarField y(yStart); scalarField yEnd(ode.nEqns()); yEnd[0] = ::Foam::j0(xEnd); diff --git a/applications/test/fvc/Test-fvc.C b/applications/test/fvc/Test-fvc.C index 70d03a692a4d6cde7462acc33526c8704bf10710..133884c7de37d4caad4d4ba8b78c1940d36a852f 100644 --- a/applications/test/fvc/Test-fvc.C +++ b/applications/test/fvc/Test-fvc.C @@ -41,18 +41,17 @@ int main(int argc, char *argv[]) # include "createTime.H" # include "createMesh.H" - volScalarField fx = pow(mesh.C().component(vector::X), 2); + volScalarField fx(pow(mesh.C().component(vector::X), 2)); fx.write(); - volScalarField gradx4 = fvc::grad(fx)().component(vector::X); + volScalarField gradx4(fvc::grad(fx)().component(vector::X)); gradx4.write(); - //volVectorField curlC = fvc::curl(1.0*mesh.C()); - + //volVectorField curlC(fvc::curl(1.0*mesh.C())); //curlC.write(); /* - surfaceScalarField xf = mesh.Cf().component(vector::X); - surfaceScalarField xf4 = pow(xf, 4); + surfaceScalarField xf(mesh.Cf().component(vector::X)); + surfaceScalarField xf4(pow(xf, 4)); for (int i=1; i<xf4.size()-1; i++) { diff --git a/applications/test/graphXi/Test-graphXi.C b/applications/test/graphXi/Test-graphXi.C index 2ef64f79bdd7346d13d4b5db32946112e3f002d1..7a852513d92f3c614facaca2adbc99ee0ebdaddf 100644 --- a/applications/test/graphXi/Test-graphXi.C +++ b/applications/test/graphXi/Test-graphXi.C @@ -47,10 +47,10 @@ int main() x[i] = -3 + 0.06*i; } - scalarField b = 0.5*(1.0 + erf(x)); - scalarField c = 1.0 - b; - scalarField gradb = (1/::sqrt(constant::mathematical::pi))*exp(-sqr(x)); - scalarField lapb = -2*x*gradb; + scalarField b(0.5*(1.0 + erf(x))); + scalarField c(1.0 - b); + scalarField gradb((1/::sqrt(constant::mathematical::pi))*exp(-sqr(x))); + scalarField lapb(-2*x*gradb); r = lapb*b*c/(gradb*gradb); diff --git a/applications/test/labelRanges/Make/files b/applications/test/labelRanges/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..df0fcc4843a742870c48915bbd0f3d6b685db824 --- /dev/null +++ b/applications/test/labelRanges/Make/files @@ -0,0 +1,3 @@ +Test-labelRanges.C + +EXE = $(FOAM_USER_APPBIN)/Test-labelRanges diff --git a/applications/test/labelRanges/Make/options b/applications/test/labelRanges/Make/options new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/applications/test/labelRanges/Test-labelRanges.C b/applications/test/labelRanges/Test-labelRanges.C new file mode 100644 index 0000000000000000000000000000000000000000..d7ef91301de70d15270b5f87dd35f6938306041b --- /dev/null +++ b/applications/test/labelRanges/Test-labelRanges.C @@ -0,0 +1,121 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 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 <http://www.gnu.org/licenses/>. + +Application + +Description + Test label ranges +\*---------------------------------------------------------------------------*/ + +#include "argList.H" +#include "IOobject.H" +#include "IOstreams.H" +#include "IFstream.H" +#include "IStringStream.H" +#include "labelRanges.H" + +using namespace Foam; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Main program: + +int main(int argc, char *argv[]) +{ + argList::noParallel(); + argList::validArgs.insert("start size .. startN sizeN"); + argList::addOption("verbose"); + argList::addNote + ( + "The default is to add ranges, use 'add' and 'del' to toggle\n\n" + "Eg, 0 10 30 10 del 20 15" + ); + + argList args(argc, argv, false, true); + + if (args.optionFound("verbose")) + { + labelRange::debug = 1; + } + + + labelRanges ranges; + + bool removeMode = false; + for (label argI=1; argI < args.size()-1; ++argI) + { + if (args[argI] == "add") + { + removeMode = false; + continue; + } + else if (args[argI] == "del") + { + removeMode = true; + continue; + } + + label start = 0; + label size = 0; + + IStringStream(args[argI])() >> start; + ++argI; + IStringStream(args[argI])() >> size; + + labelRange range(start, size); + + Info<< "---------------" << nl; + if (removeMode) + { + Info<< "del " << range << " :"; + forAllConstIter(labelRange, range, iter) + { + Info<< " " << iter(); + } + Info<< nl; + + ranges.remove(range); + } + else + { + Info<< "add " << range << " :"; + forAllConstIter(labelRange, range, iter) + { + Info<< " " << iter(); + } + Info<< nl; + + ranges.add(range); + } + + Info<< "<list>" << ranges << "</list>" << nl; + forAllConstIter(labelRanges, ranges, iter) + { + Info<< " " << iter(); + } + Info<< nl; + } + + return 0; +} + +// ************************************************************************* // diff --git a/applications/test/lduMatrix/Test-lduMatrix3.C b/applications/test/lduMatrix/Test-lduMatrix3.C index 175cf949e9b96eef4d1a5109ee0614654d4438d7..7874c57c39bd68fe52e2a2a4506627521d7969a7 100644 --- a/applications/test/lduMatrix/Test-lduMatrix3.C +++ b/applications/test/lduMatrix/Test-lduMatrix3.C @@ -102,7 +102,7 @@ int main(int argc, char *argv[]) for (int corr=0; corr<nCorr; corr++) { - volScalarField rAU = 1.0/UEqn.A(); + volScalarField rAU(1.0/UEqn.A()); U = rAU*UEqn.H(); phi = (fvc::interpolate(U) & mesh.Sf()) diff --git a/applications/test/xfer/Test-xferList.C b/applications/test/xfer/Test-xferList.C index 303d8951094245e1045af7299704f3c0bb27cee8..112b17ad9b7553a8f32abeb4fae71c3120aa0645 100644 --- a/applications/test/xfer/Test-xferList.C +++ b/applications/test/xfer/Test-xferList.C @@ -99,7 +99,7 @@ int main(int argc, char *argv[]) Info<< "xB[" << xB->size() << "]\n"; DynamicList<label> dl(10); - for (label i = 0; i < 5; i++) + for (label i = 0; i < 5; ++i) { dl.append(i); } @@ -111,11 +111,23 @@ int main(int argc, char *argv[]) Info<< "f1: " << f1 << endl; Info<< "f2: " << f2 << endl; + // add some more labels + for (label i = 5; i < 8; ++i) + { + dl.append(i); + } + // note: xfer() method returns a plain labelList - face f3( dl.xfer() ); + face f3(dl.xfer()); Info<< "dl[" << dl.size() << "/" << dl.capacity() << "] " << dl << endl; Info<< "f3: " << f3 << endl; + Info<<"\nflip faces:" << endl; + f1.flip(); + f3.flip(); + Info<< "f1: " << f1 << endl; + Info<< "f3: " << f3 << endl; + return 0; } diff --git a/applications/utilities/errorEstimation/estimateScalarError/estimateScalarError.C b/applications/utilities/errorEstimation/estimateScalarError/estimateScalarError.C index 5c89107d79fcfadf89b6a0756d71cabdacffe412..4daa1c116d370d3a3b21be2acca6ab9cf419f89e 100644 --- a/applications/utilities/errorEstimation/estimateScalarError/estimateScalarError.C +++ b/applications/utilities/errorEstimation/estimateScalarError/estimateScalarError.C @@ -112,7 +112,7 @@ int main(int argc, char *argv[]) ); ee.residual()().write(); - volScalarField e = ee.error(); + volScalarField e(ee.error()); e.write(); mag(e)().write(); } diff --git a/applications/utilities/errorEstimation/icoErrorEstimate/icoErrorEstimate.C b/applications/utilities/errorEstimation/icoErrorEstimate/icoErrorEstimate.C index edeb80a4b25a2527aed9026f69b150ac5ab2c910..ec6f5ddcd0d2e4bb3f6c0679bdc2365e4617980f 100644 --- a/applications/utilities/errorEstimation/icoErrorEstimate/icoErrorEstimate.C +++ b/applications/utilities/errorEstimation/icoErrorEstimate/icoErrorEstimate.C @@ -108,7 +108,7 @@ int main(int argc, char *argv[]) -fvc::grad(p) ); - volVectorField e = ee.error(); + volVectorField e(ee.error()); e.write(); mag(e)().write(); } diff --git a/applications/utilities/errorEstimation/icoMomentError/icoMomentError.C b/applications/utilities/errorEstimation/icoMomentError/icoMomentError.C index b3e9f927ce087022260a5207f90da5bacd1d88fe..fbe6561f94735d663f24c3b4c26597952c1a17d4 100644 --- a/applications/utilities/errorEstimation/icoMomentError/icoMomentError.C +++ b/applications/utilities/errorEstimation/icoMomentError/icoMomentError.C @@ -101,8 +101,8 @@ int main(int argc, char *argv[]) # include "createPhi.H" - volScalarField ek = 0.5*magSqr(U); - volTensorField gradU = fvc::grad(U); + volScalarField ek(0.5*magSqr(U)); + volTensorField gradU(fvc::grad(U)); // Divergence of the error in U squared diff --git a/applications/utilities/errorEstimation/momentScalarError/momentScalarError.C b/applications/utilities/errorEstimation/momentScalarError/momentScalarError.C index ce38d1dfb4ac2ae077bd7cfe3a2022d5b79a5842..dd6a0cb25a820feb10404072204244bfda33cc04 100644 --- a/applications/utilities/errorEstimation/momentScalarError/momentScalarError.C +++ b/applications/utilities/errorEstimation/momentScalarError/momentScalarError.C @@ -106,9 +106,9 @@ int main(int argc, char *argv[]) # include "createPhi.H" - volVectorField gradT = fvc::grad(T); + volVectorField gradT(fvc::grad(T)); - volScalarField TE = 0.5*sqr(T); + volScalarField TE(0.5*sqr(T)); volScalarField L ( diff --git a/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C b/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C index 21c9f5867a2f1ac273fd646b70590e86cadf6a84..7720b3b5597850be1262c5209266f8f8b265951d 100644 --- a/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C +++ b/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C @@ -130,7 +130,7 @@ void checkSnapMesh label nOldSize = wrongFaces.size(); - const scalarField magFaceAreas = mag(mesh.faceAreas()); + const scalarField magFaceAreas(mag(mesh.faceAreas())); forAll(magFaceAreas, faceI) { diff --git a/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/ccm26ToFoam.C b/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/ccm26ToFoam.C index 1866e5e1146d99d12f714b4f2f13d2c69c2be303..4110d71371b06c44f687e49e5fa44832deba001c 100644 --- a/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/ccm26ToFoam.C +++ b/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/ccm26ToFoam.C @@ -853,7 +853,7 @@ int main(int argc, char *argv[]) { foamOwner[faceI] = foamNeighbour[faceI]; foamNeighbour[faceI] = own; - foamFaces[faceI] = foamFaces[faceI].reverseFace(); + foamFaces[faceI].flip(); } } diff --git a/applications/utilities/mesh/conversion/cfx4ToFoam/hexBlock.C b/applications/utilities/mesh/conversion/cfx4ToFoam/hexBlock.C index af8d8a3cc1ec226b02a10c6a7c4255b5881749b6..36be3eb8fa6944a76623c9fb9fc8299e460480c4 100644 --- a/applications/utilities/mesh/conversion/cfx4ToFoam/hexBlock.C +++ b/applications/utilities/mesh/conversion/cfx4ToFoam/hexBlock.C @@ -375,7 +375,7 @@ faceList hexBlock::patchFaces(const label direc, const labelList& range) const // turn all faces inside out forAll(result, faceI) { - result[faceI] = result[faceI].reverseFace(); + result[faceI].flip(); } } diff --git a/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L b/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L index a8147a32bf14863b85532b2e59495c20e9c2e83f..f8ef2f226beda70bda121beee1a8180440e017af 100644 --- a/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L +++ b/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L @@ -868,7 +868,7 @@ int main(int argc, char *argv[]) fm[facei] = true; if (!cubitFile) { - faces[facei] = faces[facei].reverseFace(); + faces[facei].flip(); } Swap(owner[facei], neighbour[facei]); } diff --git a/applications/utilities/mesh/conversion/fluentMeshToFoam/create3DCellShape.C b/applications/utilities/mesh/conversion/fluentMeshToFoam/create3DCellShape.C index ce6eb6c03dd7c94adabf50fe811f1dea31a2a14e..898b69d99162685bae6bb53f011ae79c40aa692d 100644 --- a/applications/utilities/mesh/conversion/fluentMeshToFoam/create3DCellShape.C +++ b/applications/utilities/mesh/conversion/fluentMeshToFoam/create3DCellShape.C @@ -260,7 +260,7 @@ cellShape create3DCellShape meshFaceLabels[i - 1] = meshFaceLabels[i]; } - meshFaceLabels[meshFaceLabels.size() - 1] = firstLabel; + meshFaceLabels.last() = firstLabel; } } diff --git a/applications/utilities/mesh/conversion/foamMeshToFluent/fluentFvMesh.C b/applications/utilities/mesh/conversion/foamMeshToFluent/fluentFvMesh.C index 32218f79a65ade8821143cc223f6be161157e16a..4306612bc59f9cc9a2fff1d3f2dc9384a9ffafb5 100644 --- a/applications/utilities/mesh/conversion/foamMeshToFluent/fluentFvMesh.C +++ b/applications/utilities/mesh/conversion/foamMeshToFluent/fluentFvMesh.C @@ -158,7 +158,7 @@ void Foam::fluentFvMesh::writeFluentMesh() const // Writing boundary faces forAll(boundary(), patchI) { - const unallocFaceList& patchFaces = boundaryMesh()[patchI]; + const faceUList& patchFaces = boundaryMesh()[patchI]; const labelList& patchFaceCells = boundaryMesh()[patchI].faceCells(); diff --git a/applications/utilities/mesh/conversion/netgenNeutralToFoam/netgenNeutralToFoam.C b/applications/utilities/mesh/conversion/netgenNeutralToFoam/netgenNeutralToFoam.C index 1673ab9e807ccb4eac90a6b333fb8fded1945bc3..17ee921ad505714e4f86c6deb130311b81373d89 100644 --- a/applications/utilities/mesh/conversion/netgenNeutralToFoam/netgenNeutralToFoam.C +++ b/applications/utilities/mesh/conversion/netgenNeutralToFoam/netgenNeutralToFoam.C @@ -226,7 +226,7 @@ int main(int argc, char *argv[]) if (((fc - cc) & fn) < 0) { // Boundary face points inwards. Flip. - boundaryFaces[faceI] = boundaryFaces[faceI].reverseFace(); + boundaryFaces[faceI].flip(); } // Done this face so erase from hash diff --git a/applications/utilities/mesh/conversion/plot3dToFoam/hexBlock.C b/applications/utilities/mesh/conversion/plot3dToFoam/hexBlock.C index eef6299d30fcd3aeb211f2ae9af0d39cb43a5754..d04094a28bb40fcd6565b680701ca654d33850d7 100644 --- a/applications/utilities/mesh/conversion/plot3dToFoam/hexBlock.C +++ b/applications/utilities/mesh/conversion/plot3dToFoam/hexBlock.C @@ -472,7 +472,7 @@ faceList hexBlock::patchFaces(const label direc, const labelList& range) const // turn all faces inside out forAll(result, faceI) { - result[faceI] = result[faceI].reverseFace(); + result[faceI].flip(); } } diff --git a/applications/utilities/mesh/conversion/star3ToFoam/createCoupleMatches.C b/applications/utilities/mesh/conversion/star3ToFoam/createCoupleMatches.C index 63ec5b1da8852e224c2db23948b6934deb7442af..5555d007cae92c1d6b096733452461349c4f304b 100644 --- a/applications/utilities/mesh/conversion/star3ToFoam/createCoupleMatches.C +++ b/applications/utilities/mesh/conversion/star3ToFoam/createCoupleMatches.C @@ -1035,7 +1035,7 @@ void starMesh::createCoupleMatches() # ifdef DEBUG_RIGHT_HAND_WALK Info<< "Turning edge for right-hand turn rule" << endl; # endif - startEdge = startEdge.reverseEdge(); + startEdge.flip(); } // prepare the loop for the right-hand walk @@ -1348,7 +1348,7 @@ void starMesh::createCoupleMatches() ) < VSMALL ) { - intersectedFace = intersectedFace.reverseFace(); + intersectedFace.flip(); } // Add the new face to both master and slave diff --git a/applications/utilities/mesh/generation/extrude/extrudeMesh/Make/files b/applications/utilities/mesh/generation/extrude/extrudeMesh/Make/files index 08f746cc3ff9f56bdd7d5357fc976660bcc341be..f5a718066dbf105696cfbb28e0023345c7375e20 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeMesh/Make/files +++ b/applications/utilities/mesh/generation/extrude/extrudeMesh/Make/files @@ -1,4 +1,3 @@ extrudeMesh.C EXE = $(FOAM_APPBIN)/extrudeMesh - diff --git a/applications/utilities/mesh/generation/extrude/extrudeMesh/Make/options b/applications/utilities/mesh/generation/extrude/extrudeMesh/Make/options index 9a10a36f3cfff4bbfc1090fdb91ae354d81f64fb..3445b811eabf9aec7b97ba7dd4e1f3edae4270e9 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeMesh/Make/options +++ b/applications/utilities/mesh/generation/extrude/extrudeMesh/Make/options @@ -12,4 +12,3 @@ EXE_LIBS = \ -lmeshTools \ -ldynamicMesh \ -lextrudeModel - diff --git a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C index 0b0ad610bcca71995fd9a53779a5d4d0586d7b1a..526e6d341d12e08fd289ba5c3a6daba338030daa 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C +++ b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C @@ -58,13 +58,17 @@ enum ExtrudeMode SURFACE }; -template<> -const char* NamedEnum<ExtrudeMode, 3>::names[] = +namespace Foam { - "mesh", - "patch", - "surface" -}; + template<> + const char* NamedEnum<ExtrudeMode, 3>::names[] = + { + "mesh", + "patch", + "surface" + }; +} + static const NamedEnum<ExtrudeMode, 3> ExtrudeModeNames; @@ -369,7 +373,7 @@ int main(int argc, char *argv[]) // Layers per point labelList nPointLayers(extrudePatch.nPoints(), model().nLayers()); // Displacement for first layer - vectorField firstLayerDisp = displacement*model().sumThickness(1); + vectorField firstLayerDisp(displacement*model().sumThickness(1)); // Expansion ratio not used. scalarField ratio(extrudePatch.nPoints(), 1.0); diff --git a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMeshDict b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMeshDict index a38614047bcc33855bda4ce065ee2e5cb3c88411..4c20f79a7e4673f69ea70fecbb3b49beb39de5b0 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMeshDict +++ b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMeshDict @@ -94,4 +94,3 @@ mergeFaces false; //true; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - diff --git a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudedMesh/extrudedMesh.C b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudedMesh/extrudedMesh.C index 3dc6a409881997df8b9d78f8ad087ec4a5c59bbc..8a8ae1819f6dc7226ee82e7d7176c51e18c00f7b 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudedMesh/extrudedMesh.C +++ b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudedMesh/extrudedMesh.C @@ -381,4 +381,3 @@ Foam::extrudedMesh::extrudedMesh // ************************************************************************* // - diff --git a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudedMesh/extrudedMesh.H b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudedMesh/extrudedMesh.H index 7d14775158d6b5077c0f035bcb7135597c28305e..bf1353f3568c481ffdf9c12e0203b1341129501e 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudedMesh/extrudedMesh.H +++ b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudedMesh/extrudedMesh.H @@ -124,4 +124,3 @@ public: #endif // ************************************************************************* // - diff --git a/applications/utilities/mesh/generation/extrude/extrudeModel/Make/files b/applications/utilities/mesh/generation/extrude/extrudeModel/Make/files index fdd7c3e7b7c7cc2eb3e913bc31f9ff74768976fd..12b60a0f7db6f7947a6868049d050de5e285103d 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeModel/Make/files +++ b/applications/utilities/mesh/generation/extrude/extrudeModel/Make/files @@ -7,4 +7,3 @@ sigmaRadial/sigmaRadial.C wedge/wedge.C LIB = $(FOAM_LIBBIN)/libextrudeModel - diff --git a/applications/utilities/mesh/generation/extrude/extrudeModel/Make/options b/applications/utilities/mesh/generation/extrude/extrudeModel/Make/options index 3c57befe4f755eb3522c5a1c7c3564d7b030fe55..70c838b774c8b2609363d066e78b1a19b9306ccd 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeModel/Make/options +++ b/applications/utilities/mesh/generation/extrude/extrudeModel/Make/options @@ -5,4 +5,3 @@ EXE_INC = \ EXE_LIBS = \ -lmeshTools \ -ldynamicMesh - diff --git a/applications/utilities/mesh/generation/extrude/extrudeModel/extrudeModel/extrudeModel.C b/applications/utilities/mesh/generation/extrude/extrudeModel/extrudeModel/extrudeModel.C index b7b47bd6f24b6687b4925f1d23eeb00c6d638ecc..02c6fdd95ca82bc813ad6d033481f6b3316ca6e2 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeModel/extrudeModel/extrudeModel.C +++ b/applications/utilities/mesh/generation/extrude/extrudeModel/extrudeModel/extrudeModel.C @@ -86,4 +86,3 @@ Foam::scalar Foam::extrudeModel::sumThickness(const label layer) const // ************************************************************************* // - diff --git a/applications/utilities/mesh/generation/extrude/extrudeModel/linearDirection/linearDirection.C b/applications/utilities/mesh/generation/extrude/extrudeModel/linearDirection/linearDirection.C index d3d3d243828e015805bc7027498d166043d34ae0..d67d82c2c643230d33871b80b8c26341ffed6af8 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeModel/linearDirection/linearDirection.C +++ b/applications/utilities/mesh/generation/extrude/extrudeModel/linearDirection/linearDirection.C @@ -86,4 +86,3 @@ point linearDirection::operator() } // End namespace Foam // ************************************************************************* // - diff --git a/applications/utilities/mesh/generation/extrude/extrudeModel/linearDirection/linearDirection.H b/applications/utilities/mesh/generation/extrude/extrudeModel/linearDirection/linearDirection.H index 7776a479860dfe40d0eea1b5d268916a225905e3..62fc650c492ccd69838a6fc7e7fde0297397d31b 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeModel/linearDirection/linearDirection.H +++ b/applications/utilities/mesh/generation/extrude/extrudeModel/linearDirection/linearDirection.H @@ -95,4 +95,3 @@ public: #endif // ************************************************************************* // - diff --git a/applications/utilities/mesh/generation/extrude/extrudeModel/linearNormal/linearNormal.C b/applications/utilities/mesh/generation/extrude/extrudeModel/linearNormal/linearNormal.C index 34e0ba81cdac994e4285a16e9798e2c7fd8bbceb..ff429845c2049c4d0114feb559d63f542723c471 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeModel/linearNormal/linearNormal.C +++ b/applications/utilities/mesh/generation/extrude/extrudeModel/linearNormal/linearNormal.C @@ -83,4 +83,3 @@ point linearNormal::operator() } // End namespace Foam // ************************************************************************* // - diff --git a/applications/utilities/mesh/generation/extrude/extrudeModel/linearNormal/linearNormal.H b/applications/utilities/mesh/generation/extrude/extrudeModel/linearNormal/linearNormal.H index 4bdb9a080bdd27bb4804847116e7c477aebfc1ee..17b4f5b03487cc2f93ee0e0d3e789b9976539bf9 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeModel/linearNormal/linearNormal.H +++ b/applications/utilities/mesh/generation/extrude/extrudeModel/linearNormal/linearNormal.H @@ -92,4 +92,3 @@ public: #endif // ************************************************************************* // - diff --git a/applications/utilities/mesh/generation/extrude/extrudeModel/linearRadial/linearRadial.C b/applications/utilities/mesh/generation/extrude/extrudeModel/linearRadial/linearRadial.C index b3a8c1298af721aa7b458ddcdcc30c07e8d5be27..8d6631ea12847e6fbef8e72799f1eb8c6103e168 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeModel/linearRadial/linearRadial.C +++ b/applications/utilities/mesh/generation/extrude/extrudeModel/linearRadial/linearRadial.C @@ -79,4 +79,3 @@ point linearRadial::operator() } // End namespace Foam // ************************************************************************* // - diff --git a/applications/utilities/mesh/generation/extrude/extrudeModel/linearRadial/linearRadial.H b/applications/utilities/mesh/generation/extrude/extrudeModel/linearRadial/linearRadial.H index 8ec941f90164d910c89a8933e10a54bd366c134f..7cebd31e7b71bf24926195acbe57b7dad66c4f98 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeModel/linearRadial/linearRadial.H +++ b/applications/utilities/mesh/generation/extrude/extrudeModel/linearRadial/linearRadial.H @@ -90,4 +90,3 @@ public: #endif // ************************************************************************* // - diff --git a/applications/utilities/mesh/generation/extrude/extrudeModel/sigmaRadial/sigmaRadial.C b/applications/utilities/mesh/generation/extrude/extrudeModel/sigmaRadial/sigmaRadial.C index c8a8ffe6fb1c638910c2d8b0be524d84e8b0d67b..6f1a77cf207e1727c8c3274b0782b14abd0095f2 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeModel/sigmaRadial/sigmaRadial.C +++ b/applications/utilities/mesh/generation/extrude/extrudeModel/sigmaRadial/sigmaRadial.C @@ -89,4 +89,3 @@ point sigmaRadial::operator() } // End namespace Foam // ************************************************************************* // - diff --git a/applications/utilities/mesh/generation/extrude/extrudeModel/sigmaRadial/sigmaRadial.H b/applications/utilities/mesh/generation/extrude/extrudeModel/sigmaRadial/sigmaRadial.H index 23c709ecbd9998e4b31cba74f9e15e43a504cc0b..fd01268df355e2d564c5ecad57f9df89b2cb44ce 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeModel/sigmaRadial/sigmaRadial.H +++ b/applications/utilities/mesh/generation/extrude/extrudeModel/sigmaRadial/sigmaRadial.H @@ -91,4 +91,3 @@ public: #endif // ************************************************************************* // - diff --git a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/Make/files b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/Make/files index 62431e23d4025c507af0c2c6bebc6c0c50b0d452..be2c8d6975524c2caf8d76df74dd2e358bb1757d 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/Make/files +++ b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/Make/files @@ -3,5 +3,3 @@ createShellMesh.C extrudeToRegionMesh.C EXE = $(FOAM_APPBIN)/extrudeToRegionMesh - - diff --git a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/Make/options b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/Make/options index abe16677f54dd5954713206c2625d8a6a6ffebf4..201089b74fc76ccd7b4e8fd02aeefac0ef788857 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/Make/options +++ b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/Make/options @@ -9,4 +9,3 @@ EXE_LIBS = \ -lfiniteVolume \ -lmeshTools \ -ldynamicMesh - diff --git a/applications/utilities/mesh/manipulation/deformedGeom/deformedGeom.C b/applications/utilities/mesh/manipulation/deformedGeom/deformedGeom.C index 379e8e17f8d14564d6acc17596de3be4b3c36831..718d69fe546d46702e5d648a2b835e77e3426f7a 100644 --- a/applications/utilities/mesh/manipulation/deformedGeom/deformedGeom.C +++ b/applications/utilities/mesh/manipulation/deformedGeom/deformedGeom.C @@ -79,12 +79,13 @@ int main(int argc, char *argv[]) Info<< " Reading U" << endl; volVectorField U(Uheader, mesh); - pointField newPoints = + pointField newPoints + ( zeroPoints - + scaleFactor*pInterp.interpolate(U)().internalField(); + + scaleFactor*pInterp.interpolate(U)().internalField() + ); mesh.polyMesh::movePoints(newPoints); - mesh.write(); } else diff --git a/applications/utilities/mesh/manipulation/mergeMeshes/mergePolyMesh.C b/applications/utilities/mesh/manipulation/mergeMeshes/mergePolyMesh.C index d0e47d6c797b7c9aefa7a125c3f1c375f82b5b4a..01621bb1d171a65cf6e72102bef9c2f817804199 100644 --- a/applications/utilities/mesh/manipulation/mergeMeshes/mergePolyMesh.C +++ b/applications/utilities/mesh/manipulation/mergeMeshes/mergePolyMesh.C @@ -80,7 +80,7 @@ Foam::label Foam::mergePolyMesh::patchIndex(const polyPatch& p) << pName << " in mesh " << caseName << " already exists, but patch types " << " do not match.\nCreating a composite name as " - << patchNames_[patchNames_.size() - 1] << endl; + << patchNames_.last() << endl; } else { diff --git a/applications/utilities/mesh/manipulation/refineMesh/refineMesh.C b/applications/utilities/mesh/manipulation/refineMesh/refineMesh.C index eb33c26427a7291f74cb1093d8e5bb31717f4a0b..a3ee093f1030cbd59920c8a28d878b448edab998 100644 --- a/applications/utilities/mesh/manipulation/refineMesh/refineMesh.C +++ b/applications/utilities/mesh/manipulation/refineMesh/refineMesh.C @@ -271,7 +271,7 @@ label twoDNess(const polyMesh& mesh) { const vectorField& n = patch.faceAreas(); - scalarField cosAngle = mag(n/mag(n) & cellPlane.normal()); + const scalarField cosAngle(mag(n/mag(n) & cellPlane.normal())); if (mag(min(cosAngle) - max(cosAngle)) > 1E-6) { diff --git a/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C b/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C index 4c411fb150f52fb36bf0783bc3725290a96f165b..17495b1d3f2fedc1a588d129c038cc1a82aa7bae 100644 --- a/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C +++ b/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C @@ -295,7 +295,7 @@ autoPtr<mapPolyMesh> reorderMesh if (nei < own) { - newFaces[faceI] = newFaces[faceI].reverseFace(); + newFaces[faceI].flip(); Swap(newOwner[faceI], newNeighbour[faceI]); } } diff --git a/applications/utilities/parallelProcessing/redistributeMeshPar/redistributeMeshPar.C b/applications/utilities/parallelProcessing/redistributeMeshPar/redistributeMeshPar.C index a76cbb1393452173e1a34e5394efc1ca58fa428b..fe7e858b9a93b75a434d85e612e4cbe6eccfda5f 100644 --- a/applications/utilities/parallelProcessing/redistributeMeshPar/redistributeMeshPar.C +++ b/applications/utilities/parallelProcessing/redistributeMeshPar/redistributeMeshPar.C @@ -87,7 +87,7 @@ autoPtr<fvMesh> createMesh if (!haveMesh) { // Create dummy mesh. Only used on procs that don't have mesh. - IOobject noReadIO(io); + IOobject noReadIO(io); noReadIO.readOpt() = IOobject::NO_READ; fvMesh dummyMesh ( diff --git a/applications/utilities/postProcessing/dataConversion/foamToTecplot360/tecplotWriter.C b/applications/utilities/postProcessing/dataConversion/foamToTecplot360/tecplotWriter.C index b8469532138be36ee8f44d2e942ce2439bdd8aad..23548eceb6ed28429db8d66a0600670ac594fd03 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToTecplot360/tecplotWriter.C +++ b/applications/utilities/postProcessing/dataConversion/foamToTecplot360/tecplotWriter.C @@ -403,7 +403,7 @@ void Foam::tecplotWriter::writeConnectivity edge e = pp.edges()[edgeI]; if (e[0] > e[1]) { - e = e.reverseEdge(); + e.flip(); } FaceNodes[nodeI++] = INTEGER4(e[0]+1); @@ -448,7 +448,7 @@ void Foam::tecplotWriter::writeConnectivity edge e = pp.edges()[edgeI]; if (e[0] > e[1]) { - e = e.reverseEdge(); + e.flip(); } const face& f0 = pp.localFaces()[eFaces[0]]; diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUtils.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUtils.C index 673aeccffd2f7debe0f28fc380a0e0f250fc7562..989c2dcf805d4ac7f083ff7ef9256eccdc8d6348 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUtils.C +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUtils.C @@ -33,6 +33,7 @@ Description #include "fvMesh.H" #include "Time.H" #include "IFstream.H" +#include "memInfo.H" // VTK includes #include "vtkDataArraySelection.h" @@ -325,44 +326,13 @@ void Foam::vtkPV3Foam::setSelectedArrayEntries // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -// parse these bits of info from /proc/meminfo (Linux) -// -// MemTotal: 2062660 kB -// MemFree: 1124400 kB -// -// used = MemTotal - MemFree is what the free(1) uses. -// void Foam::vtkPV3Foam::printMemory() { - const char* meminfo = "/proc/meminfo"; + memInfo mem; - if (exists(meminfo)) + if (mem.valid()) { - IFstream is(meminfo); - label memTotal = 0; - label memFree = 0; - - string line; - - while (is.getLine(line).good()) - { - char tag[32]; - int value; - - if (sscanf(line.c_str(), "%30s %d", tag, &value) == 2) - { - if (!strcmp(tag, "MemTotal:")) - { - memTotal = value; - } - else if (!strcmp(tag, "MemFree:")) - { - memFree = value; - } - } - } - - Info<< "memUsed: " << (memTotal - memFree) << " kB\n"; + Info<< "mem peak/size/rss: " << mem << "\n"; } } diff --git a/applications/utilities/postProcessing/miscellaneous/postChannel/calculateFields.H b/applications/utilities/postProcessing/miscellaneous/postChannel/calculateFields.H index 6c7cffcf0ad300c7d95042c0fa44c06de822c03c..026861d87510a0c629eed93c303740b5fab6997c 100644 --- a/applications/utilities/postProcessing/miscellaneous/postChannel/calculateFields.H +++ b/applications/utilities/postProcessing/miscellaneous/postChannel/calculateFields.H @@ -1,9 +1,9 @@ /* - volTensorField gradU = fvc::grad(U); - volSymmTensorField D = symm(fvc::grad(U)); - volTensorField Dprim = symm(fvc::grad(U - UMean)); + volTensorField gradU(fvc::grad(U)); + volSymmTensorField D(symm(fvc::grad(U))); + volTensorField Dprim(symm(fvc::grad(U - UMean))); - volScalarField prod = -((U - UMean)*(U - UMean)) && D; + volScalarField prod(-((U - UMean)*(U - UMean)) && D); */ /* diff --git a/applications/utilities/postProcessing/miscellaneous/postChannel/channelIndex.C b/applications/utilities/postProcessing/miscellaneous/postChannel/channelIndex.C index ce5762b1f3db04482c34e25dcc559194ffafee74..628a6ba38c23a225018d94d8a344e29b22dcccb7 100644 --- a/applications/utilities/postProcessing/miscellaneous/postChannel/channelIndex.C +++ b/applications/utilities/postProcessing/miscellaneous/postChannel/channelIndex.C @@ -33,13 +33,20 @@ License // * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * * // -template<> -const char* Foam::NamedEnum<Foam::vector::components, 3>::names[] = +namespace Foam { - "x", - "y", - "z" -}; + template<> + const char* Foam::NamedEnum + < + Foam::vector::components, + 3 + >::names[] = + { + "x", + "y", + "z" + }; +} const Foam::NamedEnum<Foam::vector::components, 3> Foam::channelIndex::vectorComponentsNames_; @@ -283,10 +290,4 @@ Foam::channelIndex::channelIndex } -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - - -// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // - - // ************************************************************************* // diff --git a/applications/utilities/postProcessing/miscellaneous/postChannel/collapse.H b/applications/utilities/postProcessing/miscellaneous/postChannel/collapse.H index b3bf5594110835698535275ed2f58b647a7e238d..4b042ab63f7b51f6aea6f28dcbc9b061dc0431dd 100644 --- a/applications/utilities/postProcessing/miscellaneous/postChannel/collapse.H +++ b/applications/utilities/postProcessing/miscellaneous/postChannel/collapse.H @@ -1,41 +1,43 @@ - scalarField UMeanXvalues = channelIndexing.collapse + scalarField UMeanXvalues ( - UMean.component(vector::X)() + channelIndexing.collapse(UMean.component(vector::X)()) ); - scalarField UMeanYvalues = channelIndexing.collapse + scalarField UMeanYvalues ( - UMean.component(vector::Y)() + channelIndexing.collapse(UMean.component(vector::Y)()) ); - scalarField UMeanZvalues = channelIndexing.collapse + scalarField UMeanZvalues ( - UMean.component(vector::Z)() + channelIndexing.collapse(UMean.component(vector::Z)()) ); - scalarField RxxValues = channelIndexing.collapse(Rxx); - scalarField RyyValues = channelIndexing.collapse(Ryy); - scalarField RzzValues = channelIndexing.collapse(Rzz); - scalarField RxyValues = channelIndexing.collapse(Rxy, true); + scalarField RxxValues(channelIndexing.collapse(Rxx)); + scalarField RyyValues(channelIndexing.collapse(Ryy)); + scalarField RzzValues(channelIndexing.collapse(Rzz)); + scalarField RxyValues(channelIndexing.collapse(Rxy, true)); - scalarField pPrime2MeanValues = channelIndexing.collapse(pPrime2Mean); + scalarField pPrime2MeanValues(channelIndexing.collapse(pPrime2Mean)); /* - scalarField epsilonValues = channelIndexing.collapse(epsilonMean); + scalarField epsilonValues(channelIndexing.collapse(epsilonMean)); - scalarField nuMeanValues = channelIndexing.collapse(nuMean); - scalarField nuPrimeValues = channelIndexing.collapse(nuPrime); + scalarField nuMeanValues(channelIndexing.collapse(nuMean)); + scalarField nuPrimeValues(channelIndexing.collapse(nuPrime)); - scalarField gammaDotMeanValues = channelIndexing.collapse(gammaDotMean); - scalarField gammaDotPrimeValues = channelIndexing.collapse(gammaDotPrime); + scalarField gammaDotMeanValues(channelIndexing.collapse(gammaDotMean)); + scalarField gammaDotPrimeValues(channelIndexing.collapse(gammaDotPrime)); */ - scalarField urmsValues = sqrt(mag(RxxValues)); - scalarField vrmsValues = sqrt(mag(RyyValues)); - scalarField wrmsValues = sqrt(mag(RzzValues)); + scalarField urmsValues(sqrt(mag(RxxValues))); + scalarField vrmsValues(sqrt(mag(RyyValues))); + scalarField wrmsValues(sqrt(mag(RzzValues))); - scalarField kValues = - 0.5*(sqr(urmsValues) + sqr(vrmsValues) + sqr(wrmsValues)); + scalarField kValues + ( + 0.5*(sqr(urmsValues) + sqr(vrmsValues) + sqr(wrmsValues)) + ); const scalarField& y = channelIndexing.y(); diff --git a/applications/utilities/postProcessing/turbulence/createTurbulenceFields/createTurbulenceFields.C b/applications/utilities/postProcessing/turbulence/createTurbulenceFields/createTurbulenceFields.C index 761ea3bc6520d9dcf740337aba4b94e617f1aea9..fdd66e10e3644549b1ce0d3046ce94461c0ecd2c 100644 --- a/applications/utilities/postProcessing/turbulence/createTurbulenceFields/createTurbulenceFields.C +++ b/applications/utilities/postProcessing/turbulence/createTurbulenceFields/createTurbulenceFields.C @@ -61,13 +61,13 @@ int main(int argc, char *argv[]) // Cache the turbulence fields Info<< "\nRetrieving field k from turbulence model" << endl; - const volScalarField k = RASModel->k(); + const volScalarField k(RASModel->k()); Info<< "\nRetrieving field epsilon from turbulence model" << endl; - const volScalarField epsilon = RASModel->epsilon(); + const volScalarField epsilon(RASModel->epsilon()); Info<< "\nRetrieving field R from turbulence model" << endl; - const volSymmTensorField R = RASModel->R(); + const volSymmTensorField R(RASModel->R()); // Check availability of tubulence fields diff --git a/applications/utilities/postProcessing/velocityField/Lambda2/Lambda2.C b/applications/utilities/postProcessing/velocityField/Lambda2/Lambda2.C index c089d48539dff5ad6a81a5c233e5165493599fb4..00e72e058d2fc38459266f2192bbb72f74b9ae0b 100644 --- a/applications/utilities/postProcessing/velocityField/Lambda2/Lambda2.C +++ b/applications/utilities/postProcessing/velocityField/Lambda2/Lambda2.C @@ -55,8 +55,10 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh) const volTensorField gradU(fvc::grad(U)); - volTensorField SSplusWW = - (symm(gradU) & symm(gradU)) + (skew(gradU) & skew(gradU)); + volTensorField SSplusWW + ( + (symm(gradU) & symm(gradU)) + (skew(gradU) & skew(gradU)) + ); volScalarField Lambda2 ( diff --git a/applications/utilities/postProcessing/velocityField/Mach/Mach.C b/applications/utilities/postProcessing/velocityField/Mach/Mach.C index 304f30cdee2db0e5a38ae75b78bbd7bfa9b93721..66f3d2c6f5976eb240b387b5601b8c5042374097 100644 --- a/applications/utilities/postProcessing/velocityField/Mach/Mach.C +++ b/applications/utilities/postProcessing/velocityField/Mach/Mach.C @@ -71,8 +71,8 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh) basicPsiThermo::New(mesh) ); - volScalarField Cp = thermo->Cp(); - volScalarField Cv = thermo->Cv(); + volScalarField Cp(thermo->Cp()); + volScalarField Cv(thermo->Cv()); MachPtr.set ( diff --git a/applications/utilities/postProcessing/velocityField/Q/Q.C b/applications/utilities/postProcessing/velocityField/Q/Q.C index 5e148a8041f976f3f616f20b4c4761e2d2b33709..bbd3f3422eed25e49108df5531f4b7e7a1b510bc 100644 --- a/applications/utilities/postProcessing/velocityField/Q/Q.C +++ b/applications/utilities/postProcessing/velocityField/Q/Q.C @@ -53,7 +53,7 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh) { Info<< " Reading U" << endl; volVectorField U(Uheader, mesh); - volTensorField gradU = fvc::grad(U); + volTensorField gradU(fvc::grad(U)); volScalarField Q ( @@ -72,11 +72,11 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh) // This is a second way of calculating Q, that delivers results // very close, but not identical to the first approach. - volSymmTensorField S = symm(gradU); // symmetric part of tensor - volTensorField W = skew(gradU); // anti-symmetric part + volSymmTensorField S(symm(gradU)); // symmetric part of tensor + volTensorField W(skew(gradU)); // anti-symmetric part - volScalarField SS = S&&S; - volScalarField WW = W&&W; + volScalarField SS(S && S); + volScalarField WW(W && W); volScalarField Q ( diff --git a/applications/utilities/postProcessing/velocityField/flowType/flowType.C b/applications/utilities/postProcessing/velocityField/flowType/flowType.C index 2a5936f0a033b35c0af0d7a762fab18cba87d4db..bbee6e2be5f10eedd346df044fde5ef316de1187 100644 --- a/applications/utilities/postProcessing/velocityField/flowType/flowType.C +++ b/applications/utilities/postProcessing/velocityField/flowType/flowType.C @@ -62,9 +62,9 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh) Info<< " Reading U" << endl; volVectorField U(Uheader, mesh); - volTensorField gradU = fvc::grad(U); - volScalarField magD = mag(symm(gradU)); - volScalarField magOmega = mag(skew(gradU)); + volTensorField gradU(fvc::grad(U)); + volScalarField magD(mag(symm(gradU))); + volScalarField magOmega (mag(skew(gradU))); dimensionedScalar smallMagD("smallMagD", magD.dimensions(), SMALL); Info<< " Calculating flowType" << endl; diff --git a/applications/utilities/postProcessing/velocityField/streamFunction/streamFunction.C b/applications/utilities/postProcessing/velocityField/streamFunction/streamFunction.C index 28359cddc625208b29f935cf39c60c294200a000..c3c25221f5aec737b9667499d75d1eeff908740d 100644 --- a/applications/utilities/postProcessing/velocityField/streamFunction/streamFunction.C +++ b/applications/utilities/postProcessing/velocityField/streamFunction/streamFunction.C @@ -107,12 +107,12 @@ int main(int argc, char *argv[]) label nVisited = 0; label nVisitedOld = 0; - const unallocFaceList& faces = mesh.faces(); + const faceUList& faces = mesh.faces(); const pointField& points = mesh.points(); label nInternalFaces = mesh.nInternalFaces(); - vectorField unitAreas = mesh.faceAreas(); + vectorField unitAreas(mesh.faceAreas()); unitAreas /= mag(unitAreas); const polyPatchList& patches = mesh.boundaryMesh(); diff --git a/applications/utilities/postProcessing/wall/wallHeatFlux/wallHeatFlux.C b/applications/utilities/postProcessing/wall/wallHeatFlux/wallHeatFlux.C index c1bd9f05f4d47cd32ad6618a566cb095694840ae..f8f4a7c351639c2e8d1e996d2ea35f11dd8eb047 100644 --- a/applications/utilities/postProcessing/wall/wallHeatFlux/wallHeatFlux.C +++ b/applications/utilities/postProcessing/wall/wallHeatFlux/wallHeatFlux.C @@ -54,8 +54,10 @@ int main(int argc, char *argv[]) #include "createFields.H" - surfaceScalarField heatFlux = - fvc::interpolate(RASModel->alphaEff())*fvc::snGrad(h); + surfaceScalarField heatFlux + ( + fvc::interpolate(RASModel->alphaEff())*fvc::snGrad(h) + ); const surfaceScalarField::GeometricBoundaryField& patchHeatFlux = heatFlux.boundaryField(); diff --git a/applications/utilities/postProcessing/wall/yPlusLES/createFields.H b/applications/utilities/postProcessing/wall/yPlusLES/createFields.H index 83fb26a1d7bf476a2679fc031685289813d7a178..108aa9689fa22f8b03c5fa3eb0c4d1a4f931718b 100644 --- a/applications/utilities/postProcessing/wall/yPlusLES/createFields.H +++ b/applications/utilities/postProcessing/wall/yPlusLES/createFields.H @@ -21,4 +21,4 @@ autoPtr<incompressible::LESModel> sgsModel incompressible::LESModel::New(U, phi, laminarTransport) ); -volScalarField::GeometricBoundaryField d = nearWallDist(mesh).y(); +volScalarField::GeometricBoundaryField d(nearWallDist(mesh).y()); diff --git a/applications/utilities/postProcessing/wall/yPlusLES/yPlusLES.C b/applications/utilities/postProcessing/wall/yPlusLES/yPlusLES.C index b104a114d54f40d88acc5d5e61759d447a403f4b..74226acee0958ea33d8b9bf7476fd690c64cd828 100644 --- a/applications/utilities/postProcessing/wall/yPlusLES/yPlusLES.C +++ b/applications/utilities/postProcessing/wall/yPlusLES/yPlusLES.C @@ -100,10 +100,12 @@ int main(int argc, char *argv[]) ); volScalarField::GeometricBoundaryField d = nearWallDist(mesh).y(); - volScalarField nuEff = sgsModel->nuEff(); + volScalarField nuEff(sgsModel->nuEff()); const fvPatchList& patches = mesh.boundary(); + const volScalarField nuLam(sgsModel->nu()); + forAll(patches, patchi) { const fvPatch& currPatch = patches[patchi]; @@ -117,7 +119,7 @@ int main(int argc, char *argv[]) nuEff.boundaryField()[patchi] *mag(U.boundaryField()[patchi].snGrad()) ) - /sgsModel->nu().boundaryField()[patchi]; + /nuLam.boundaryField()[patchi]; const scalarField& Yp = yPlus.boundaryField()[patchi]; Info<< "Patch " << patchi diff --git a/applications/utilities/preProcessing/applyBoundaryLayer/applyBoundaryLayer.C b/applications/utilities/preProcessing/applyBoundaryLayer/applyBoundaryLayer.C index 8fe46ba29920ced00b6ed7561072f6a21c976ba1..5b105742faf33d2d7cb94c9dd7ba607683d78d5a 100644 --- a/applications/utilities/preProcessing/applyBoundaryLayer/applyBoundaryLayer.C +++ b/applications/utilities/preProcessing/applyBoundaryLayer/applyBoundaryLayer.C @@ -104,7 +104,7 @@ int main(int argc, char *argv[]) // Calculate nut tmp<volScalarField> tnut = turbulence->nut(); volScalarField& nut = tnut(); - volScalarField S = mag(dev(symm(fvc::grad(U)))); + volScalarField S(mag(dev(symm(fvc::grad(U))))); nut = sqr(kappa*min(y, ybl))*::sqrt(2)*S; if (args.optionFound("writenut")) diff --git a/applications/utilities/preProcessing/applyBoundaryLayer/createFields.H b/applications/utilities/preProcessing/applyBoundaryLayer/createFields.H index b8f5e0dadee29a34cdfc5a06bd66b75a28751a51..7447ad38e86a02371bbaea686fb2273bc8aa8596 100644 --- a/applications/utilities/preProcessing/applyBoundaryLayer/createFields.H +++ b/applications/utilities/preProcessing/applyBoundaryLayer/createFields.H @@ -47,7 +47,7 @@ License ); Info<< "Calculating wall distance field" << endl; - volScalarField y = wallDist(mesh).y(); + volScalarField y(wallDist(mesh).y()); // Set the mean boundary-layer thickness dimensionedScalar ybl("ybl", dimLength, 0); diff --git a/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/general/general.C b/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/general/general.C index a1f6dc421ef0bdd6918bd232e3d3de09c5da2272..5442df3bda2a24a3583181645043ed5e9a5f6583 100644 --- a/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/general/general.C +++ b/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/general/general.C @@ -41,16 +41,19 @@ namespace Foam dictionary ); } -} -template<> -const char* -Foam::NamedEnum<Foam::tabulatedWallFunctions::general::interpolationType, 1>:: - names[] = + template<> + const char* Foam::NamedEnum + < + Foam::tabulatedWallFunctions::general::interpolationType, + 1 + >::names[] = { "linear" }; +} + const Foam::NamedEnum<Foam::tabulatedWallFunctions::general::interpolationType, 1> Foam::tabulatedWallFunctions::general::interpolationTypeNames_; diff --git a/applications/utilities/surface/surfaceCheck/surfaceCheck.C b/applications/utilities/surface/surfaceCheck/surfaceCheck.C index be220dfa2e090516fb187e7ed9668bafd97752eb..b02c71756f90ba271fe0b5db44e1f03113e0a088 100644 --- a/applications/utilities/surface/surfaceCheck/surfaceCheck.C +++ b/applications/utilities/surface/surfaceCheck/surfaceCheck.C @@ -47,19 +47,16 @@ bool validTri const labelledTri& f = surf[faceI]; - if - ( - (f[0] < 0) || (f[0] >= surf.points().size()) - || (f[1] < 0) || (f[1] >= surf.points().size()) - || (f[2] < 0) || (f[2] >= surf.points().size()) - ) + forAll(f, fp) { - WarningIn("validTri(const triSurface&, const label)") - << "triangle " << faceI << " vertices " << f - << " uses point indices outside point range 0.." - << surf.points().size()-1 << endl; - - return false; + if (f[fp] < 0 || f[fp] >= surf.points().size()) + { + WarningIn("validTri(const triSurface&, const label)") + << "triangle " << faceI << " vertices " << f + << " uses point indices outside point range 0.." + << surf.points().size()-1 << endl; + return false; + } } if ((f[0] == f[1]) || (f[0] == f[2]) || (f[1] == f[2])) @@ -212,11 +209,10 @@ int main(int argc, char *argv[]) // write bounding box corners if (args.optionFound("blockMesh")) { - pointField cornerPts = boundBox(surf.points()).points(); - - Info<<"// blockMeshDict info" << nl; + pointField cornerPts(boundBox(surf.points()).points()); - Info<<"vertices\n(" << nl; + Info<<"// blockMeshDict info" << nl + <<"vertices\n(" << nl; forAll(cornerPts, ptI) { Info << " " << cornerPts[ptI] << nl; diff --git a/applications/utilities/surface/surfaceClean/collapseBase.C b/applications/utilities/surface/surfaceClean/collapseBase.C index dd92967a5fe488d58cee3d127c07561fcd8ed438..109aa0724844eafa9a13f8171c0a61c0c0570843 100644 --- a/applications/utilities/surface/surfaceClean/collapseBase.C +++ b/applications/utilities/surface/surfaceClean/collapseBase.C @@ -100,8 +100,8 @@ static void splitTri label oldNTris = tris.size(); label fp = findIndex(f, e[0]); - label fp1 = (fp+1)%3; - label fp2 = (fp1+1)%3; + label fp1 = f.fcIndex(fp); + label fp2 = f.fcIndex(fp1); if (f[fp1] == e[1]) { diff --git a/applications/utilities/surface/surfaceClean/collapseEdge.C b/applications/utilities/surface/surfaceClean/collapseEdge.C index 66fba4cd978883fc380b2b15607c1656159fc600..c7be020cab98dc588318d5a1423b7dd2610b1eb1 100644 --- a/applications/utilities/surface/surfaceClean/collapseEdge.C +++ b/applications/utilities/surface/surfaceClean/collapseEdge.C @@ -34,7 +34,7 @@ static void markPointNbrs boolList& okToCollapse ) { - const labelledTri& f = surf.localFaces()[faceI]; + const triSurface::FaceType& f = surf.localFaces()[faceI]; forAll(f, fp) { @@ -108,12 +108,12 @@ label collapseEdge(triSurface& surf, const scalar minLen) if (okToCollapse[faceI]) { // Check edge lengths. - const labelledTri& f = localFaces[faceI]; + const triSurface::FaceType& f = localFaces[faceI]; forAll(f, fp) { label v = f[fp]; - label v1 = f[(fp+1) % 3]; + label v1 = f[f.fcIndex(fp)]; if (mag(localPoints[v1] - localPoints[v]) < minLen) { diff --git a/applications/utilities/surface/surfaceSplitNonManifolds/surfaceSplitNonManifolds.C b/applications/utilities/surface/surfaceSplitNonManifolds/surfaceSplitNonManifolds.C index e52a32010aaf0dd293cdade1420282313e569ef5..2611a7863ad6f643ed08c09bc446d8d64bdf7d1a 100644 --- a/applications/utilities/surface/surfaceSplitNonManifolds/surfaceSplitNonManifolds.C +++ b/applications/utilities/surface/surfaceSplitNonManifolds/surfaceSplitNonManifolds.C @@ -128,9 +128,7 @@ void dumpFaces forAllConstIter(Map<label>, connectedFaces, iter) { - const labelledTri& f = surf.localFaces()[iter.key()]; - - point ctr(f.centre(surf.localPoints())); + point ctr = surf.localFaces()[iter.key()].centre(surf.localPoints()); os << "v " << ctr.x() << ' ' << ctr.y() << ' ' << ctr.z() << endl; } @@ -453,7 +451,7 @@ label sharedFace const edge& e = surf.edges()[sharedEdgeI]; - const labelledTri& f = surf.localFaces()[firstFaceI]; + const triSurface::FaceType& f = surf.localFaces()[firstFaceI]; label startIndex = findIndex(f, e.start()); @@ -597,13 +595,13 @@ void renumberFaces const triSurface& surf, const labelList& pointMap, const Map<label>& faceToEdge, - List<labelledTri>& newTris + List<triSurface::FaceType>& newTris ) { forAllConstIter(Map<label>, faceToEdge, iter) { const label faceI = iter.key(); - const labelledTri& f = surf.localFaces()[faceI]; + const triSurface::FaceType& f = surf.localFaces()[faceI]; forAll(f, fp) { @@ -911,7 +909,6 @@ int main(int argc, char *argv[]) forAll(surf, faceI) { newTris[faceI] = surf.localFaces()[faceI]; - newTris[faceI].region() = surf[faceI].region(); } @@ -924,7 +921,7 @@ int main(int argc, char *argv[]) // Check if faces use unmoved points. forAll(newTris, faceI) { - const labelledTri& f = newTris[faceI]; + const triSurface::FaceType& f = newTris[faceI]; forAll(f, fp) { diff --git a/applications/utilities/surface/surfaceSubset/surfaceSubset.C b/applications/utilities/surface/surfaceSubset/surfaceSubset.C index 6bc54d40addc9fedf385311bc1e19507f7cdb8bb..cdd718c3204fac5cf695d1219f2ee995e30cd58d 100644 --- a/applications/utilities/surface/surfaceSubset/surfaceSubset.C +++ b/applications/utilities/surface/surfaceSubset/surfaceSubset.C @@ -196,8 +196,7 @@ int main(int argc, char *argv[]) forAll(surf1, faceI) { - const labelledTri& f = surf1[faceI]; - const point centre = f.centre(surf1.points()); + const point centre = surf1[faceI].centre(surf1.points()); if ( diff --git a/bin/foamNew b/bin/foamNew index 10a8134c5d97f15a5f924bea31c9de63d81318e4..3d18e3a4d8d4670a62e24664656b171b4b21201f 100755 --- a/bin/foamNew +++ b/bin/foamNew @@ -36,7 +36,9 @@ Usage: ${0##*/} <type> {args} * create a new standard OpenFOAM source or template file -type: (source|template) +type: + -s | -source | source + -t | -template | template USAGE exit 1 @@ -47,16 +49,16 @@ USAGE [ "$#" -gt 1 ] || usage case "$1" in -source) +(-s | -source | source) shift $WM_PROJECT_DIR/etc/codeTemplates/source/foamNewSource $* ;; -template) +(-t | -template | template) shift $WM_PROJECT_DIR/etc/codeTemplates/template/foamNewTemplate $* ;; -*) - usage "unknown type" +(*) + usage "unknown type '$1'" ;; esac diff --git a/bin/mpirunDebug b/bin/mpirunDebug index 3c4aaf6a9a3691a7f86ff67e60268130b5f6ddcb..bd207e0b8e0ebf3d119f22c9118c9606e25e3a60 100755 --- a/bin/mpirunDebug +++ b/bin/mpirunDebug @@ -142,14 +142,15 @@ fi # Construct test string for remote execution. # Source OpenFOAM settings if OpenFOAM environment not set. # attempt to preserve the installation directory 'FOAM_INST_DIR' +# use FOAM_SETTINGS to pass command-line settings if [ "$FOAM_INST_DIR" ] then - sourceFoam='[ "$WM_PROJECT" ] || '"FOAM_INST_DIR=$FOAM_INST_DIR . $sourceFoam" + sourceFoam='[ "$WM_PROJECT" ] || '"FOAM_INST_DIR=$FOAM_INST_DIR . $sourceFoam $FOAM_SETTINGS" else - sourceFoam='[ "$WM_PROJECT" ] || '". $sourceFoam" + sourceFoam='[ "$WM_PROJECT" ] || '". $sourceFoam $FOAM_SETTINGS" fi -echo "**sourceFoam:$sourceFoam" +echo "**sourceFoam:$sourceFoam $FOAM_SETTINGS" rm -f $PWD/mpirun.schema touch $PWD/mpirun.schema diff --git a/bin/tools/pre-commit-hook b/bin/tools/pre-commit-hook index ae8ca7c21c6cb3e5a3406092a2c50f13235e5de3..7710f0ca52c6a32b92d8e0ca0d077fdb35cc289c 100755 --- a/bin/tools/pre-commit-hook +++ b/bin/tools/pre-commit-hook @@ -52,7 +52,7 @@ hookName="pre-commit" die() { - echo '$hookName hook failure' 1>&2 + echo "$hookName hook failure" 1>&2 echo '-----------------------' 1>&2 echo '' 1>&2 echo "$@" 1>&2 diff --git a/bin/tools/pre-receive-hook b/bin/tools/pre-receive-hook index 84ac684bc39e9f38e024f88e22e2262b3633cf4f..048feb3188af3aff0683fe8c1724bb839e4b950f 100755 --- a/bin/tools/pre-receive-hook +++ b/bin/tools/pre-receive-hook @@ -46,7 +46,7 @@ hookName="pre-receive" die() { - echo '$hookName hook failure' 1>&2 + echo "$hookName hook failure" 1>&2 echo '-----------------------' 1>&2 echo '' 1>&2 echo "$@" 1>&2 diff --git a/etc/aliases.csh b/etc/aliases.csh index a278c20d32301bbe8ab3c4d894ac1c0418f3a1f1..3ee5a555a6b8ce27db04f3d7e1c6a84507353f0d 100644 --- a/etc/aliases.csh +++ b/etc/aliases.csh @@ -26,16 +26,17 @@ # # Description # Aliases for working with OpenFOAM -# Sourced from OpenFOAM-??/etc/cshrc and/or ~/.cshrc +# Sourced from OpenFOAM-<VERSION>/etc/cshrc and/or ~/.cshrc # #------------------------------------------------------------------------------ # Change compiled version aliases # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -alias wm64 'setenv WM_ARCH_OPTION 64; source $WM_PROJECT_DIR/etc/cshrc' -alias wm32 'setenv WM_ARCH_OPTION 32; source $WM_PROJECT_DIR/etc/cshrc' -alias wmSP 'setenv WM_PRECISION_OPTION SP; source $WM_PROJECT_DIR/etc/cshrc' -alias wmDP 'setenv WM_PRECISION_OPTION DP; source $WM_PROJECT_DIR/etc/cshrc' +alias wmSET 'source $WM_PROJECT_DIR/etc/cshrc' +alias wm64 'wmSET WM_ARCH_OPTION=64' +alias wm32 'wmSET WM_ARCH_OPTION=32' +alias wmSP 'wmSET WM_PRECISION_OPTION=SP' +alias wmDP 'wmSET WM_PRECISION_OPTION=DP' # Toggle wmakeScheduler on/off # - also need to set WM_HOSTS diff --git a/etc/aliases.sh b/etc/aliases.sh index 628df5e90e4723dc65db50fca5401e29f74eddce..9755f000a5cc76dbdc695ed98483aa5a2ada1fdd 100644 --- a/etc/aliases.sh +++ b/etc/aliases.sh @@ -26,16 +26,17 @@ # # Description # Aliases for working with OpenFOAM -# Sourced from OpenFOAM-??/etc/bashrc and/or ~/.bashrc +# Sourced from OpenFOAM-<VERSION>/etc/bashrc and/or ~/.bashrc # #------------------------------------------------------------------------------ # Change compiled version aliases # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -alias wm64='export WM_ARCH_OPTION=64; . $WM_PROJECT_DIR/etc/bashrc' -alias wm32='export WM_ARCH_OPTION=32; . $WM_PROJECT_DIR/etc/bashrc' -alias wmSP='export WM_PRECISION_OPTION=SP; . $WM_PROJECT_DIR/etc/bashrc' -alias wmDP='export WM_PRECISION_OPTION=DP; . $WM_PROJECT_DIR/etc/bashrc' +alias wmSET='. $WM_PROJECT_DIR/etc/bashrc' +alias wm64='wmSET WM_ARCH_OPTION=64' +alias wm32='wmSET WM_ARCH_OPTION=32' +alias wmSP='wmSET WM_PRECISION_OPTION=SP' +alias wmDP='wmSET WM_PRECISION_OPTION=DP' # Toggle wmakeScheduler on/off # - also need to set WM_HOSTS diff --git a/etc/apps/paraview3/bashrc b/etc/apps/paraview3/bashrc index e160fa59e8fbaf85f91fa4714f024deb8f4f54cb..5487d2e8db113fc891775931d428be6c07824daf 100644 --- a/etc/apps/paraview3/bashrc +++ b/etc/apps/paraview3/bashrc @@ -38,7 +38,7 @@ cleaned=`$WM_PROJECT_DIR/bin/foamCleanPath "$PATH" "$WM_THIRD_PARTY_DIR/platform # determine the cmake to be used unset CMAKE_HOME -for cmake in cmake-2.8.1 cmake-2.8.0 cmake-2.6.4 +for cmake in cmake-2.8.3 cmake-2.8.1 cmake-2.8.0 cmake-2.6.4 do cmake=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cmake if [ -r $cmake ] diff --git a/etc/apps/paraview3/cshrc b/etc/apps/paraview3/cshrc index cdbe92277a00d566c761f9ba06c9bbead9b4affb..850eb78d27983bbbef90f55332c185c60fedb5f4 100644 --- a/etc/apps/paraview3/cshrc +++ b/etc/apps/paraview3/cshrc @@ -39,7 +39,7 @@ if ( $status == 0 ) setenv PATH $cleaned # determine the cmake to be used unsetenv CMAKE_HOME -foreach cmake ( cmake-2.8.1 cmake-2.8.0 cmake-2.6.4 ) +foreach cmake ( cmake-2.8.3 cmake-2.8.1 cmake-2.8.0 cmake-2.6.4 ) set cmake=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cmake if ( -r $cmake ) then setenv CMAKE_HOME $cmake diff --git a/etc/bashrc b/etc/bashrc index c6aa4608469b6b27921ec25b757398dee51069ac..2b0e3d0be71897e8f825e5d6dcb0a40f7a6b8f05 100644 --- a/etc/bashrc +++ b/etc/bashrc @@ -89,7 +89,8 @@ _foamSource() # Add in preset user or site preferences: _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile prefs.sh` -# Evaluate command-line parameters +# Evaluate command-line parameters and record settings for later +export FOAM_SETTINGS="$@" while [ $# -gt 0 ] do case "$1" in @@ -101,6 +102,15 @@ do # name=value -> export name=value eval "export $1" ;; + *) + # filename: source it + if [ -f "$1" ] + then + _foamSource "$1" + else + _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile "$1"` + fi + ;; esac shift done diff --git a/etc/codeTemplates/source/foamNewSource b/etc/codeTemplates/source/foamNewSource index 0e1c7f03d25fd7931e1e1dde1058fd8611185c81..30fc7acd0cdd82cf739ab10c050b57e71dddbd72 100755 --- a/etc/codeTemplates/source/foamNewSource +++ b/etc/codeTemplates/source/foamNewSource @@ -35,66 +35,81 @@ Template="$WM_PROJECT_DIR/etc/codeTemplates/source/_Template" usage() { while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat<<USAGE -Usage: $Script <type> <ClassName> +Usage: $Script [OPTION] <type> <ClassName> +options: + -help print the usage * create a new standard OpenFOAM source file type: (C|H|I|IO|App) +A ClassName starting with '-' will simply display the template + USAGE exit 1 } +className="$2" +unset subType Type printOpt + +# for a className starting with '-' simply display the code +if [ "${2#-}" != "${2}" ] +then + printOpt=true +fi + + # this implicitly covers a lone -help [ "$#" -gt 1 ] || usage -className="$2" -unset subType Type - case "$1" in --h | -help) +(-h | -help) usage ;; -C|H) +(C|H) Type=".$1" ;; -I) +(I) Type="$1.H" ;; -IO) +(IO) Type="$1.C" ;; -app|App) +(app|App) subType=App Type=".C" ;; -*) - usage "unknown type" +(*) + usage "unknown type '$1'" ;; esac + [ "$#" -eq 2 ] || usage "wrong number of arguments" shift 2 -fileName="$className$Type" - - -echo "$Script: Creating new interface file $fileName" -if [ -e "$fileName" ] +if [ "${printOpt:-false}" = true ] then - echo " Error: file exists" - exit 1 -fi + cat $Template$subType$Type +else + fileName="$className$Type" -# process class name -sed "s/CLASSNAME/$className/g" $Template$subType$Type > $fileName + echo "$Script: Creating new interface file $fileName" + if [ -e "$fileName" ] + then + echo " Error: file exists" + exit 1 + fi + # process class name + sed "s/CLASSNAME/$className/g" $Template$subType$Type > $fileName -if [ "$subType" = App -a ! -d Make ] -then - wmakeFilesAndOptions + if [ "$subType" = App -a ! -d Make ] + then + wmakeFilesAndOptions + fi fi #------------------------------------------------------------------------------ diff --git a/etc/codeTemplates/template/foamNewTemplate b/etc/codeTemplates/template/foamNewTemplate index b2a48cb6ba538e6fd59e56277b4cb68521f6f29c..1ab2b3907a147294f7a54b26506ad20f59518fc2 100755 --- a/etc/codeTemplates/template/foamNewTemplate +++ b/etc/codeTemplates/template/foamNewTemplate @@ -36,12 +36,16 @@ usage() { while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat<<USAGE -Usage: $Script <type> <ClassName> <Template arguments...> +Usage: $Script [OPTION] <type> <ClassName> <Template arguments...> +options: + -help print the usage * create a new standard OpenFOAM source file for templated classes type: (C|H|I|IO) +A ClassName starting with '-' will simply display the template + USAGE exit 1 } @@ -51,59 +55,76 @@ USAGE className="$2" -unset Type +unset Type printOpt + +# for a className starting with '-' simply display the code +if [ "${2#-}" != "${2}" ] +then + printOpt=true +fi + case "$1" in --h | -help) +(-h | -help) usage ;; -C|H) +(C|H) Type=".$1" ;; -I) +(I) Type="$1.H" ;; -IO) +(IO) Type="$1.C" ;; *) - usage "unknown type" + usage "unknown type '$1'" ;; esac -[ "$#" -ge 3 ] || usage "wrong number of arguments" -shift 2 - -fileName="$className$Type" -echo "$Script: Creating new template interface file $fileName" -if [ -e "$fileName" ] +if [ "${printOpt:-false}" = true ] then - echo " Error: file exists" - exit 1 -fi + [ "$#" -eq 2 ] || usage "wrong number of arguments" + shift 2 + + cat $Template$Type + +else + [ "$#" -ge 3 ] || usage "wrong number of arguments" + shift 2 -# process class name -sed -e "s/CLASSNAME/$className/g" $Template$Type > $fileName.1 + fileName="$className$Type" + echo "$Script: Creating new template interface file $fileName" + if [ -e "$fileName" ] + then + echo " Error: file exists" + exit 1 + fi -# process template arguments -for tArg -do - sed -e "s/TemplateClassArgument/class $tArg, TemplateClassArgument/g" \ - -e "s/TemplateArgument/$tArg, TemplateArgument/g" \ - $fileName.1 > $fileName.2 - mv $fileName.2 $fileName.1 -done + # process class name + sed -e "s/CLASSNAME/$className/g" $Template$Type > $fileName.1 -# remove remaining ", Template .." -sed -e "s/, TemplateClassArgument//g" \ - -e "s/, TemplateArgument//g" \ - $fileName.1 > $fileName + # process remaining (template) arguments + for tArg + do + sed -e "s/TemplateClassArgument/class $tArg, TemplateClassArgument/g" \ + -e "s/TemplateArgument/$tArg, TemplateArgument/g" \ + $fileName.1 > $fileName.2 -rm $fileName.1 + mv $fileName.2 $fileName.1 + done + + # remove remaining ", Template .." + sed -e "s/, TemplateClassArgument//g" \ + -e "s/, TemplateArgument//g" \ + $fileName.1 > $fileName + + rm $fileName.1 +fi #------------------------------------------------------------------------------ diff --git a/etc/cshrc b/etc/cshrc index 25628ab4072c61e51d9c6e731619876986ed9f09..0ef3f0ce78ce345c33d931f32ced7fe6c155a4d5 100644 --- a/etc/cshrc +++ b/etc/cshrc @@ -74,7 +74,8 @@ alias _foamSource 'if ($?FOAM_VERBOSE && $?prompt) echo "Sourcing: \!*"; if (\!* # Add in preset user or site preferences: _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile prefs.csh` -# Evaluate command-line parameters +# Evaluate command-line parameters and record settings for later +setenv FOAM_SETTINGS "${*}" while ( $#argv > 0 ) switch ($argv[1]) case *=: @@ -85,6 +86,14 @@ while ( $#argv > 0 ) # name=value -> setenv name value eval "setenv $argv[1]:s/=/ /" breaksw + default: + # filename: source it + if ( -f "$1" ) then + _foamSource "$1" + else + _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile "$1"` + endif + breaksw endsw shift end diff --git a/etc/settings.csh b/etc/settings.csh index f3bec0d91565f395ec53ce26a59d4f453ac40181..366f1e2a50bb0c3be1bd6f3349b1b8f9ac271709 100644 --- a/etc/settings.csh +++ b/etc/settings.csh @@ -117,7 +117,8 @@ case OpenFOAM: # using clang - not gcc setenv WM_CC 'clang' setenv WM_CXX 'clang++' - set clang_version=llvm-2.8 + #set clang_version=llvm-2.8 + set clang_version=llvm-svn breaksw default: echo @@ -236,7 +237,8 @@ unsetenv MPI_ARCH_PATH MPI_HOME switch ("$WM_MPLIB") case OPENMPI: - set mpi_version=openmpi-1.4.1 + #set mpi_version=openmpi-1.4.1 + set mpi_version=openmpi-1.5.1 setenv MPI_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$mpi_version # Tell OpenMPI where to find its install directory diff --git a/etc/settings.sh b/etc/settings.sh index f9bd097de3758ced6bf5991820c415cbad110f06..8412505be6dd0aa50cd19cdf199a0554533d2957 100644 --- a/etc/settings.sh +++ b/etc/settings.sh @@ -136,7 +136,8 @@ OpenFOAM) # using clang - not gcc export WM_CC='clang' export WM_CXX='clang++' - clang_version=llvm-2.8 + #clang_version=llvm-2.8 + clang_version=llvm-svn ;; *) echo @@ -260,7 +261,7 @@ unset MPI_ARCH_PATH MPI_HOME case "$WM_MPLIB" in OPENMPI) #mpi_version=openmpi-1.4.1 - mpi_version=openmpi-1.5 + mpi_version=openmpi-1.5.1 export MPI_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$mpi_version # Tell OpenMPI where to find its install directory diff --git a/src/OSspecific/POSIX/POSIX.C b/src/OSspecific/POSIX/POSIX.C index fecea27cbe3c98514396df0688ffbe41c925bec0..380c785c0b83fe4c92cbf89c0ec622107e59d679 100644 --- a/src/OSspecific/POSIX/POSIX.C +++ b/src/OSspecific/POSIX/POSIX.C @@ -109,12 +109,22 @@ bool Foam::setEnv } -Foam::word Foam::hostName() +Foam::word Foam::hostName(bool full) { - char buffer[256]; - gethostname(buffer, 256); + char buf[256]; + gethostname(buf, 256); - return buffer; + if (full) + { + struct hostent *hptr = gethostbyname(buf); + + if (hptr) + { + return hptr->h_name; + } + } + + return buf; } diff --git a/src/OSspecific/POSIX/fileMonitor.C b/src/OSspecific/POSIX/fileMonitor.C index 329e52ccc0a68ed9515126fba3f7d12ca611de1a..8abbf768eacd176abbcf7af0c61e5458c8dfe5b4 100644 --- a/src/OSspecific/POSIX/fileMonitor.C +++ b/src/OSspecific/POSIX/fileMonitor.C @@ -55,7 +55,11 @@ const Foam::NamedEnum<Foam::fileMonitor::fileState, 3> namespace Foam { template<> - const char* Foam::NamedEnum<Foam::fileMonitor::fileState, 3>::names[] = + const char* Foam::NamedEnum + < + Foam::fileMonitor::fileState, + 3 + >::names[] = { "unmodified", "modified", diff --git a/src/OSspecific/POSIX/memInfo/memInfo.C b/src/OSspecific/POSIX/memInfo/memInfo.C index 0d593ee4dfe19281b9c1988428b8f2cdfb71c32f..d15b3dc0f070c0c71200640e2c2b13f2c0d17ceb 100644 --- a/src/OSspecific/POSIX/memInfo/memInfo.C +++ b/src/OSspecific/POSIX/memInfo/memInfo.C @@ -79,6 +79,12 @@ const Foam::memInfo& Foam::memInfo::update() } +bool Foam::memInfo::valid() const +{ + return peak_ != -1; +} + + // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // Foam::Istream& Foam::operator>>(Istream& is, memInfo& m) diff --git a/src/OSspecific/POSIX/memInfo/memInfo.H b/src/OSspecific/POSIX/memInfo/memInfo.H index 25f29b0164e684ba0885693ec1ec8cd6108c9644..f9a3ed4743b8cc8a4d54e0a26b81bf440b5649c2 100644 --- a/src/OSspecific/POSIX/memInfo/memInfo.H +++ b/src/OSspecific/POSIX/memInfo/memInfo.H @@ -105,6 +105,9 @@ public: return rss_; } + //- True if the memory information appears valid + bool valid() const; + // IOstream Operators diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files index 3219197033834cab57b3bfd17d7bf01415f8db18..9cc3dd17b985851651f3f2153259b356ce8c80fa 100644 --- a/src/OpenFOAM/Make/files +++ b/src/OpenFOAM/Make/files @@ -64,6 +64,13 @@ $(sha1)/SHA1Digest.C primitives/random/Random/Random.C primitives/random/cachedRandom/cachedRandom.H +ranges = primitives/ranges +$(ranges)/labelRange/labelRange.C +$(ranges)/labelRange/labelRanges.C +$(ranges)/scalarRange/scalarRange.C +$(ranges)/scalarRange/scalarRanges.C + + containers/HashTables/HashTable/HashTableCore.C containers/HashTables/StaticHashTable/StaticHashTableCore.C containers/Lists/SortableList/ParSortableListName.C @@ -194,9 +201,6 @@ $(Time)/timeSelector.C $(Time)/instant/instant.C -db/scalarRange/scalarRange.C -db/scalarRange/scalarRanges.C - dimensionSet/dimensionSet.C dimensionSet/dimensionSetIO.C dimensionSet/dimensionSets.C diff --git a/src/OpenFOAM/algorithms/MeshWave/FaceCellWave.C b/src/OpenFOAM/algorithms/MeshWave/FaceCellWave.C index 95539965cec43cf5dc225c6259b830b2e4c2117c..55c4e5ff91e941ecbe39cd73520f8fd2cff1e187 100644 --- a/src/OpenFOAM/algorithms/MeshWave/FaceCellWave.C +++ b/src/OpenFOAM/algorithms/MeshWave/FaceCellWave.C @@ -36,8 +36,7 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // template <class Type, class TrackingData> -const Foam::scalar -Foam::FaceCellWave<Type, TrackingData>::geomTol_ = 1e-6; +const Foam::scalar Foam::FaceCellWave<Type, TrackingData>::geomTol_ = 1e-6; template <class Type, class TrackingData> Foam::scalar Foam::FaceCellWave<Type, TrackingData>::propagationTol_ = 0.01; diff --git a/src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTable.C b/src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTable.C index 8c2991a822ef27d0d49070caa57118fc6d5cf5ad..3e334a4e7fadd25c95161e3d2efcf8a2e28c9134 100644 --- a/src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTable.C +++ b/src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTable.C @@ -47,7 +47,7 @@ Foam::HashPtrTable<T, Key, Hash>::HashPtrTable { for (const_iterator iter = ht.begin(); iter != ht.end(); ++iter) { - insert(iter.key(), new T(**iter)); + this->insert(iter.key(), new T(**iter)); } } @@ -129,11 +129,11 @@ void Foam::HashPtrTable<T, Key, Hash>::operator= << abort(FatalError); } - clear(); + this->clear(); for (const_iterator iter = rhs.begin(); iter != rhs.end(); ++iter) { - insert(iter.key(), new T(**iter)); + this->insert(iter.key(), new T(**iter)); } } diff --git a/src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTable.H b/src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTable.H index 0e826742d9d6a03153a7aa6812037eac0032daa8..0c2335ce7fd0f8519797b0f08b64b1fa94d9f230 100644 --- a/src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTable.H +++ b/src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTable.H @@ -98,7 +98,7 @@ public: //- Construct from dictionary using default dictionary constructor // class - HashPtrTable(const dictionary& dict); + HashPtrTable(const dictionary&); //- Construct as copy HashPtrTable(const HashPtrTable<T, Key, Hash>&); diff --git a/src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTableIO.C b/src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTableIO.C index 82c02609dd60ebb54c02ac5b2fc6d2060de40709..ddad40b36bcca5ba3f779e47d52d929a5749f1e0 100644 --- a/src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTableIO.C +++ b/src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTableIO.C @@ -65,7 +65,7 @@ void Foam::HashPtrTable<T, Key, Hash>::read(Istream& is, const INew& inewt) { Key key; is >> key; - insert(key, inewt(key, is).ptr()); + this->insert(key, inewt(key, is).ptr()); is.fatalCheck ( @@ -112,7 +112,7 @@ void Foam::HashPtrTable<T, Key, Hash>::read(Istream& is, const INew& inewt) is.putBack(lastToken); Key key; is >> key; - insert(key, inewt(key, is).ptr()); + this->insert(key, inewt(key, is).ptr()); is.fatalCheck ( @@ -148,7 +148,11 @@ void Foam::HashPtrTable<T, Key, Hash>::read { forAllConstIter(dictionary, dict, iter) { - insert(iter().keyword(), inewt(dict.subDict(iter().keyword())).ptr()); + this->insert + ( + iter().keyword(), + inewt(dict.subDict(iter().keyword())).ptr() + ); } } @@ -177,21 +181,21 @@ template<class T, class Key, class Hash> template<class INew> Foam::HashPtrTable<T, Key, Hash>::HashPtrTable(Istream& is, const INew& inewt) { - read(is, inewt); + this->read(is, inewt); } template<class T, class Key, class Hash> Foam::HashPtrTable<T, Key, Hash>::HashPtrTable(Istream& is) { - read(is, INew<T>()); + this->read(is, INew<T>()); } template<class T, class Key, class Hash> Foam::HashPtrTable<T, Key, Hash>::HashPtrTable(const dictionary& dict) { - read(dict, INew<T>()); + this->read(dict, INew<T>()); } diff --git a/src/OpenFOAM/containers/HashTables/HashSet/HashSet.C b/src/OpenFOAM/containers/HashTables/HashSet/HashSet.C index 7e2981c34c30319bee9ee1211d9bfde76976e408..d2dea8a36cb57a14279634d5be24abfbff8dd356 100644 --- a/src/OpenFOAM/containers/HashTables/HashSet/HashSet.C +++ b/src/OpenFOAM/containers/HashTables/HashSet/HashSet.C @@ -37,7 +37,7 @@ Foam::HashSet<Key, Hash>::HashSet(const UList<Key>& lst) { forAll(lst, elemI) { - insert(lst[elemI]); + this->insert(lst[elemI]); } } @@ -59,7 +59,7 @@ Foam::HashSet<Key, Hash>::HashSet ++cit ) { - insert(cit.key()); + this->insert(cit.key()); } } @@ -72,7 +72,7 @@ Foam::label Foam::HashSet<Key, Hash>::insert(const UList<Key>& lst) label count = 0; forAll(lst, elemI) { - if (insert(lst[elemI])) + if (this->insert(lst[elemI])) { ++count; } @@ -87,7 +87,7 @@ Foam::label Foam::HashSet<Key, Hash>::insert(const UList<Key>& lst) template<class Key, class Hash> inline bool Foam::HashSet<Key, Hash>::operator[](const Key& key) const { - return found(key); + return this->found(key); } @@ -106,7 +106,7 @@ bool Foam::HashSet<Key, Hash>::operator==(const HashSet<Key, Hash>& rhs) const // Are all rhs elements in lhs? for (const_iterator iter = rhs.cbegin(); iter != rhs.cend(); ++iter) { - if (!found(iter.key())) + if (!this->found(iter.key())) { return false; } @@ -129,7 +129,7 @@ void Foam::HashSet<Key, Hash>::operator|=(const HashSet<Key, Hash>& rhs) // Add rhs elements into lhs for (const_iterator iter = rhs.cbegin(); iter != rhs.cend(); ++iter) { - insert(iter.key()); + this->insert(iter.key()); } } @@ -142,7 +142,7 @@ void Foam::HashSet<Key, Hash>::operator&=(const HashSet<Key, Hash>& rhs) { if (!rhs.found(iter.key())) { - erase(iter); + this->erase(iter); } } } @@ -154,13 +154,13 @@ void Foam::HashSet<Key, Hash>::operator^=(const HashSet<Key, Hash>& rhs) // Add missed rhs elements, remove duplicate elements for (const_iterator iter = rhs.cbegin(); iter != rhs.cend(); ++iter) { - if (found(iter.key())) + if (this->found(iter.key())) { - erase(iter.key()); + this->erase(iter.key()); } else { - insert(iter.key()); + this->insert(iter.key()); } } } @@ -173,7 +173,7 @@ void Foam::HashSet<Key, Hash>::operator-=(const HashSet<Key, Hash>& rhs) // Remove rhs elements from lhs for (const_iterator iter = rhs.cbegin(); iter != rhs.cend(); ++iter) { - erase(iter.key()); + this->erase(iter.key()); } } diff --git a/src/OpenFOAM/containers/HashTables/HashTable/HashTableI.H b/src/OpenFOAM/containers/HashTables/HashTable/HashTableI.H index 42f58b195fbf2aca71aad733e2032845541520d5..3f5ca46b3c911d69e205da72b7258d8e02944e3e 100644 --- a/src/OpenFOAM/containers/HashTables/HashTable/HashTableI.H +++ b/src/OpenFOAM/containers/HashTables/HashTable/HashTableI.H @@ -82,7 +82,7 @@ inline bool Foam::HashTable<T, Key, Hash>::insert const T& newEntry ) { - return set(key, newEntry, true); + return this->set(key, newEntry, true); } @@ -93,7 +93,7 @@ inline bool Foam::HashTable<T, Key, Hash>::set const T& newEntry ) { - return set(key, newEntry, false); + return this->set(key, newEntry, false); } @@ -110,9 +110,9 @@ Foam::HashTable<T, Key, Hash>::xfer() template<class T, class Key, class Hash> inline T& Foam::HashTable<T, Key, Hash>::operator[](const Key& key) { - iterator iter = find(key); + iterator iter = this->find(key); - if (iter == end()) + if (iter == this->end()) { FatalErrorIn("HashTable<T, Key, Hash>::operator[](const Key&)") << key << " not found in table. Valid entries: " @@ -127,9 +127,9 @@ inline T& Foam::HashTable<T, Key, Hash>::operator[](const Key& key) template<class T, class Key, class Hash> inline const T& Foam::HashTable<T, Key, Hash>::operator[](const Key& key) const { - const_iterator iter = find(key); + const_iterator iter = this->find(key); - if (iter == cend()) + if (iter == this->cend()) { FatalErrorIn("HashTable<T, Key, Hash>::operator[](const Key&) const") << key << " not found in table. Valid entries: " @@ -144,11 +144,11 @@ inline const T& Foam::HashTable<T, Key, Hash>::operator[](const Key& key) const template<class T, class Key, class Hash> inline T& Foam::HashTable<T, Key, Hash>::operator()(const Key& key) { - iterator iter = find(key); + iterator iter = this->find(key); - if (iter == end()) + if (iter == this->end()) { - insert(key, T()); + this->insert(key, T()); return *find(key); } else diff --git a/src/OpenFOAM/containers/LinkedLists/accessTypes/ILList/ILList.C b/src/OpenFOAM/containers/LinkedLists/accessTypes/ILList/ILList.C index de06d94776b8cbca0ae6f879d9a58b3c7a2bd060..64418158aaa1da1f83565bf898e61e0024585e5a 100644 --- a/src/OpenFOAM/containers/LinkedLists/accessTypes/ILList/ILList.C +++ b/src/OpenFOAM/containers/LinkedLists/accessTypes/ILList/ILList.C @@ -39,7 +39,7 @@ Foam::ILList<LListBase, T>::ILList(const ILList<LListBase, T>& lst) ++iter ) { - append(iter().clone().ptr()); + this->append(iter().clone().ptr()); } } @@ -62,7 +62,7 @@ Foam::ILList<LListBase, T>::ILList ++iter ) { - append(iter().clone(cloneArg).ptr()); + this->append(iter().clone(cloneArg).ptr()); } } #endif @@ -114,7 +114,7 @@ template<class LListBase, class T> void Foam::ILList<LListBase, T>::clear() { label oldSize = this->size(); - for (label i=0; i<oldSize; i++) + for (label i=0; i<oldSize; ++i) { eraseHead(); } @@ -145,7 +145,7 @@ void Foam::ILList<LListBase, T>::operator=(const ILList<LListBase, T>& lst) ++iter ) { - append(iter().clone().ptr()); + this->append(iter().clone().ptr()); } } diff --git a/src/OpenFOAM/containers/LinkedLists/accessTypes/ILList/ILListIO.C b/src/OpenFOAM/containers/LinkedLists/accessTypes/ILList/ILListIO.C index 60e0222f922e8fbcb4252244887ccb200e54a44b..4ca6dae30a7da3bcf9f7aab703091a21e2185289 100644 --- a/src/OpenFOAM/containers/LinkedLists/accessTypes/ILList/ILListIO.C +++ b/src/OpenFOAM/containers/LinkedLists/accessTypes/ILList/ILListIO.C @@ -53,9 +53,9 @@ void Foam::ILList<LListBase, T>::read(Istream& is, const INew& iNew) { if (delimiter == token::BEGIN_LIST) { - for (label i=0; i<s; i++) + for (label i=0; i<s; ++i) { - append(iNew(is).ptr()); + this->append(iNew(is).ptr()); is.fatalCheck ( @@ -67,7 +67,7 @@ void Foam::ILList<LListBase, T>::read(Istream& is, const INew& iNew) else { T* tPtr = iNew(is).ptr(); - append(tPtr); + this->append(tPtr); is.fatalCheck ( @@ -75,9 +75,9 @@ void Foam::ILList<LListBase, T>::read(Istream& is, const INew& iNew) "reading entry" ); - for (label i=1; i<s; i++) + for (label i=1; i<s; ++i) { - append(new T(*tPtr)); + this->append(new T(*tPtr)); } } } @@ -109,7 +109,7 @@ void Foam::ILList<LListBase, T>::read(Istream& is, const INew& iNew) ) { is.putBack(lastToken); - append(iNew(is).ptr()); + this->append(iNew(is).ptr()); is >> lastToken; is.fatalCheck("operator>>(Istream&, ILList<LListBase, T>&)"); @@ -131,14 +131,14 @@ template<class LListBase, class T> template<class INew> Foam::ILList<LListBase, T>::ILList(Istream& is, const INew& iNew) { - read(is, iNew); + this->read(is, iNew); } template<class LListBase, class T> Foam::ILList<LListBase, T>::ILList(Istream& is) { - read(is, INew<T>()); + this->read(is, INew<T>()); } @@ -154,6 +154,4 @@ Foam::Istream& Foam::operator>>(Istream& is, ILList<LListBase, T>& L) } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - // ************************************************************************* // diff --git a/src/OpenFOAM/containers/LinkedLists/accessTypes/LList/LList.C b/src/OpenFOAM/containers/LinkedLists/accessTypes/LList/LList.C index 47f015c0b0533d213a9fadc266e1a0b06652a101..5b832812ca60cce6ab0c8114ecc80882e1f43b86 100644 --- a/src/OpenFOAM/containers/LinkedLists/accessTypes/LList/LList.C +++ b/src/OpenFOAM/containers/LinkedLists/accessTypes/LList/LList.C @@ -35,7 +35,7 @@ Foam::LList<LListBase, T>::LList(const LList<LListBase, T>& lst) { for (const_iterator iter = lst.begin(); iter != lst.end(); ++iter) { - append(iter()); + this->append(iter()); } } @@ -53,9 +53,9 @@ template<class LListBase, class T> void Foam::LList<LListBase, T>::clear() { label oldSize = this->size(); - for (label i=0; i<oldSize; i++) + for (label i=0; i<oldSize; ++i) { - removeHead(); + this->removeHead(); } LListBase::clear(); @@ -79,7 +79,7 @@ void Foam::LList<LListBase, T>::operator=(const LList<LListBase, T>& lst) for (const_iterator iter = lst.begin(); iter != lst.end(); ++iter) { - append(iter()); + this->append(iter()); } } diff --git a/src/OpenFOAM/containers/LinkedLists/accessTypes/LList/LList.H b/src/OpenFOAM/containers/LinkedLists/accessTypes/LList/LList.H index 9439096df4e6203da5f2adb3e0b1f1d7877fd494..9885c60db235d89cd373bb65557e18a3783c1afe 100644 --- a/src/OpenFOAM/containers/LinkedLists/accessTypes/LList/LList.H +++ b/src/OpenFOAM/containers/LinkedLists/accessTypes/LList/LList.H @@ -238,10 +238,7 @@ public: public: //- Construct from base iterator - iterator - ( - LListBase_iterator baseIter - ) + iterator(LListBase_iterator baseIter) : LListBase_iterator(baseIter) {} @@ -282,20 +279,14 @@ public: public: //- Construct from base const_iterator - const_iterator - ( - LListBase_const_iterator baseIter - ) + const_iterator(LListBase_const_iterator baseIter) : LListBase_const_iterator(baseIter) {} //- Construct from base iterator - const_iterator - ( - LListBase_iterator baseIter - ) + const_iterator(LListBase_iterator baseIter) : LListBase_const_iterator(baseIter) {} diff --git a/src/OpenFOAM/containers/LinkedLists/accessTypes/LList/LListIO.C b/src/OpenFOAM/containers/LinkedLists/accessTypes/LList/LListIO.C index a1b984aa311485097d1938a7aef1bdf3b1ee7c64..6e15f171b5ced8ec03978fe19cbcc1bf94f59e81 100644 --- a/src/OpenFOAM/containers/LinkedLists/accessTypes/LList/LListIO.C +++ b/src/OpenFOAM/containers/LinkedLists/accessTypes/LList/LListIO.C @@ -64,7 +64,7 @@ Foam::Istream& Foam::operator>>(Istream& is, LList<LListBase, T>& L) { if (delimiter == token::BEGIN_LIST) { - for (register label i=0; i<s; i++) + for (register label i=0; i<s; ++i) { T element; is >> element; @@ -76,7 +76,7 @@ Foam::Istream& Foam::operator>>(Istream& is, LList<LListBase, T>& L) T element; is >> element; - for (register label i=0; i<s; i++) + for (register label i=0; i<s; ++i) { L.append(element); } diff --git a/src/OpenFOAM/containers/LinkedLists/accessTypes/LPtrList/LPtrList.C b/src/OpenFOAM/containers/LinkedLists/accessTypes/LPtrList/LPtrList.C index 3e6b95521e55ed96f9c8a8a0f8cf09a0892a07bd..c02eb611e5047d2041585fb93f5818cbd9b19286 100644 --- a/src/OpenFOAM/containers/LinkedLists/accessTypes/LPtrList/LPtrList.C +++ b/src/OpenFOAM/containers/LinkedLists/accessTypes/LPtrList/LPtrList.C @@ -34,7 +34,7 @@ Foam::LPtrList<LListBase, T>::LPtrList(const LPtrList<LListBase, T>& lst) { for (const_iterator iter = lst.begin(); iter != lst.end(); ++iter) { - append(iter().clone().ptr()); + this->append(iter().clone().ptr()); } } @@ -44,7 +44,7 @@ Foam::LPtrList<LListBase, T>::LPtrList(const LPtrList<LListBase, T>& lst) template<class LListBase, class T> Foam::LPtrList<LListBase, T>::~LPtrList() { - clear(); + this->clear(); } @@ -69,8 +69,8 @@ bool Foam::LPtrList<LListBase, T>::eraseHead() template<class LListBase, class T> void Foam::LPtrList<LListBase, T>::clear() { - label oldSize = this->size(); - for (label i=0; i<oldSize; i++) + const label oldSize = this->size(); + for (label i=0; i<oldSize; ++i) { eraseHead(); } @@ -96,7 +96,7 @@ void Foam::LPtrList<LListBase, T>::operator=(const LPtrList<LListBase, T>& lst) for (const_iterator iter = lst.begin(); iter != lst.end(); ++iter) { - append(iter().clone().ptr()); + this->append(iter().clone().ptr()); } } diff --git a/src/OpenFOAM/containers/LinkedLists/accessTypes/LPtrList/LPtrList.H b/src/OpenFOAM/containers/LinkedLists/accessTypes/LPtrList/LPtrList.H index b6b97f31088390b02630a125122bcce31401e549..d92c402e0499d1a4d9ad51c4081f28bbea69a748 100644 --- a/src/OpenFOAM/containers/LinkedLists/accessTypes/LPtrList/LPtrList.H +++ b/src/OpenFOAM/containers/LinkedLists/accessTypes/LPtrList/LPtrList.H @@ -63,7 +63,7 @@ Ostream& operator<< /*---------------------------------------------------------------------------*\ - Class LPtrList Declaration + Class LPtrList Declaration \*---------------------------------------------------------------------------*/ template<class LListBase, class T> @@ -75,7 +75,7 @@ class LPtrList //- Read from Istream using given Istream constructor class template<class INew> - void read(Istream&, const INew& inewt); + void read(Istream&, const INew&); public: @@ -188,10 +188,7 @@ public: public: //- Construct from base iterator - iterator - ( - LListBase_iterator baseIter - ) + iterator(LListBase_iterator baseIter) : LList<LListBase, T*>::iterator(baseIter) {} @@ -224,19 +221,13 @@ public: public: //- Construct from base const_iterator - const_iterator - ( - LListBase_const_iterator baseIter - ) + const_iterator(LListBase_const_iterator baseIter) : LList<LListBase, T*>::const_iterator(baseIter) {} //- Construct from base iterator - const_iterator - ( - LListBase_iterator baseIter - ) + const_iterator(LListBase_iterator baseIter) : LList<LListBase, T*>::const_iterator(baseIter) {} diff --git a/src/OpenFOAM/containers/LinkedLists/accessTypes/LPtrList/LPtrListIO.C b/src/OpenFOAM/containers/LinkedLists/accessTypes/LPtrList/LPtrListIO.C index 3d04c90e2aea348d43b2c145dc98cb5f03c3049d..2f81652237da84bcefbde1f55f86dadd62f3c6ee 100644 --- a/src/OpenFOAM/containers/LinkedLists/accessTypes/LPtrList/LPtrListIO.C +++ b/src/OpenFOAM/containers/LinkedLists/accessTypes/LPtrList/LPtrListIO.C @@ -58,9 +58,9 @@ void Foam::LPtrList<LListBase, T>::read(Istream& is, const INew& iNew) { if (delimiter == token::BEGIN_LIST) { - for (label i=0; i<s; i++) + for (label i=0; i<s; ++i) { - append(iNew(is).ptr()); + this->append(iNew(is).ptr()); is.fatalCheck ( @@ -72,7 +72,7 @@ void Foam::LPtrList<LListBase, T>::read(Istream& is, const INew& iNew) else { T* tPtr = iNew(is).ptr(); - append(tPtr); + this->append(tPtr); is.fatalCheck ( @@ -80,9 +80,9 @@ void Foam::LPtrList<LListBase, T>::read(Istream& is, const INew& iNew) "reading entry" ); - for (label i=1; i<s; i++) + for (label i=1; i<s; ++i) { - append(tPtr->clone().ptr()); + this->append(tPtr->clone().ptr()); } } } @@ -114,7 +114,7 @@ void Foam::LPtrList<LListBase, T>::read(Istream& is, const INew& iNew) ) { is.putBack(lastToken); - append(iNew(is).ptr()); + this->append(iNew(is).ptr()); is >> lastToken; is.fatalCheck @@ -144,14 +144,14 @@ template<class LListBase, class T> template<class INew> Foam::LPtrList<LListBase, T>::LPtrList(Istream& is, const INew& iNew) { - read(is, iNew); + this->read(is, iNew); } template<class LListBase, class T> Foam::LPtrList<LListBase, T>::LPtrList(Istream& is) { - read(is, INew<T>()); + this->read(is, INew<T>()); } diff --git a/src/OpenFOAM/containers/LinkedLists/accessTypes/UILList/UILList.C b/src/OpenFOAM/containers/LinkedLists/accessTypes/UILList/UILList.C index 9888f9018f3490e35b73dba16e4617af51f8b69b..fc33e894a24653874f35a3f0000922a4266d5d98 100644 --- a/src/OpenFOAM/containers/LinkedLists/accessTypes/UILList/UILList.C +++ b/src/OpenFOAM/containers/LinkedLists/accessTypes/UILList/UILList.C @@ -32,7 +32,7 @@ Foam::UILList<LListBase, T>::UILList(const UILList<LListBase, T>& lst) { for (const_iterator iter = lst.begin(); iter != lst.end(); ++iter) { - append(&iter()); + this->append(&iter()); } } @@ -46,7 +46,7 @@ void Foam::UILList<LListBase, T>::operator=(const UILList<LListBase, T>& rhs) for (const_iterator iter = rhs.begin(); iter != rhs.end(); ++iter) { - append(&iter()); + this->append(&iter()); } } diff --git a/src/OpenFOAM/containers/LinkedLists/accessTypes/UILList/UILList.H b/src/OpenFOAM/containers/LinkedLists/accessTypes/UILList/UILList.H index f7c2ca0a3c0bc800c341526281fb56e6c1419200..b87073653e1b7f959d0e67110a5e8f4140b36fe3 100644 --- a/src/OpenFOAM/containers/LinkedLists/accessTypes/UILList/UILList.H +++ b/src/OpenFOAM/containers/LinkedLists/accessTypes/UILList/UILList.H @@ -181,10 +181,7 @@ public: public: //- Construct from base iterator - iterator - ( - LListBase_iterator baseIter - ) + iterator(LListBase_iterator baseIter) : LListBase_iterator(baseIter) {} @@ -223,19 +220,13 @@ public: public: //- Construct from base const_iterator - const_iterator - ( - LListBase_const_iterator baseIter - ) + const_iterator(LListBase_const_iterator baseIter) : LListBase_const_iterator(baseIter) {} //- Construct from base iterator - const_iterator - ( - LListBase_iterator baseIter - ) + const_iterator(LListBase_iterator baseIter) : LListBase_const_iterator(baseIter) {} diff --git a/src/OpenFOAM/containers/LinkedLists/user/FIFOStack.H b/src/OpenFOAM/containers/LinkedLists/user/FIFOStack.H index de462de7017a952dc286b15978955deba183d783..41816ac7d1bde0690b6afa2263ef3842872d22ab 100644 --- a/src/OpenFOAM/containers/LinkedLists/user/FIFOStack.H +++ b/src/OpenFOAM/containers/LinkedLists/user/FIFOStack.H @@ -26,6 +26,7 @@ Class Description A FIFO stack based on a singly-linked list. + Operations are push(), pop(), top(), bottom() and empty(). SourceFiles diff --git a/src/OpenFOAM/containers/LinkedLists/user/LIFOStack.H b/src/OpenFOAM/containers/LinkedLists/user/LIFOStack.H index 3d4620c0a0274c6dc0c40a17b4a815b3b8c69858..37c89f8e63b9f2b605790ff8fd05ddcf7b3653bd 100644 --- a/src/OpenFOAM/containers/LinkedLists/user/LIFOStack.H +++ b/src/OpenFOAM/containers/LinkedLists/user/LIFOStack.H @@ -26,6 +26,7 @@ Class Description A LIFO stack based on a singly-linked list. + Operations are push(), pop(), top(), bottom() and empty(). SourceFiles diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C b/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C index 51e2fadfe77a4cc749b12a20a27e2dd9b198dfcd..508db4869bba8d398b1376209b4e9e3bfccbbdd3 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C +++ b/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C @@ -35,7 +35,11 @@ defineTypeNameAndDebug(Foam::UPstream, 0); namespace Foam { template<> - const char* Foam::NamedEnum<Foam::UPstream::commsTypes, 3>::names[] = + const char* Foam::NamedEnum + < + Foam::UPstream::commsTypes, + 3 + >::names[] = { "blocking", "scheduled", diff --git a/src/OpenFOAM/db/Time/Time.C b/src/OpenFOAM/db/Time/Time.C index f9a62d3b4d6c74465009caa0679f79e3ef1b2133..eff2e2965778e92d7861fdf65876feaac13b6e5d 100644 --- a/src/OpenFOAM/db/Time/Time.C +++ b/src/OpenFOAM/db/Time/Time.C @@ -35,7 +35,11 @@ defineTypeNameAndDebug(Foam::Time, 0); namespace Foam { template<> - const char* Foam::NamedEnum<Foam::Time::stopAtControls, 4>::names[] = + const char* Foam::NamedEnum + < + Foam::Time::stopAtControls, + 4 + >::names[] = { "endTime", "noWriteNow", @@ -44,7 +48,11 @@ namespace Foam }; template<> - const char* Foam::NamedEnum<Foam::Time::writeControls, 5>::names[] = + const char* Foam::NamedEnum + < + Foam::Time::writeControls, + 5 + >::names[] = { "timeStep", "runTime", diff --git a/src/OpenFOAM/db/objectRegistry/objectRegistry.C b/src/OpenFOAM/db/objectRegistry/objectRegistry.C index dd21cf5d59bd6945deb5cd98c12d8f1ec518d784..c3397ffc53663c2cdb7a1afd806e73ef09489b2e 100644 --- a/src/OpenFOAM/db/objectRegistry/objectRegistry.C +++ b/src/OpenFOAM/db/objectRegistry/objectRegistry.C @@ -31,6 +31,14 @@ License defineTypeNameAndDebug(Foam::objectRegistry, 0); +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +bool Foam::objectRegistry::parentNotTime() const +{ + return (&parent_ != dynamic_cast<const objectRegistry*>(&time_)); +} + + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::objectRegistry::objectRegistry diff --git a/src/OpenFOAM/db/objectRegistry/objectRegistry.H b/src/OpenFOAM/db/objectRegistry/objectRegistry.H index beb3c2493cf810cc2e43461f9cabf816f745e2b9..3b143b32689eebf39d3f0c2400ff6d90fe296f97 100644 --- a/src/OpenFOAM/db/objectRegistry/objectRegistry.H +++ b/src/OpenFOAM/db/objectRegistry/objectRegistry.H @@ -69,6 +69,10 @@ class objectRegistry // Private Member Functions + //- Is the objectRegistry parent_ different from time_ + // Used to terminate searching within the ancestors + bool parentNotTime() const; + //- Disallow Copy constructor objectRegistry(const objectRegistry&); diff --git a/src/OpenFOAM/db/objectRegistry/objectRegistryTemplates.C b/src/OpenFOAM/db/objectRegistry/objectRegistryTemplates.C index 34e87c092f110aa738d176542e111ebbbcb58c0a..5cedd377408d64cea00a268cec26dc7bef867ae4 100644 --- a/src/OpenFOAM/db/objectRegistry/objectRegistryTemplates.C +++ b/src/OpenFOAM/db/objectRegistry/objectRegistryTemplates.C @@ -84,22 +84,13 @@ bool Foam::objectRegistry::foundObject(const word& name) const { return true; } - else - { - return false; - } } - else + else if (this->parentNotTime()) { - if (&parent_ != dynamic_cast<const objectRegistry*>(&time_)) - { - return parent_.foundObject<Type>(name); - } - else - { - return false; - } + return parent_.foundObject<Type>(name); } + + return false; } @@ -117,8 +108,10 @@ const Type& Foam::objectRegistry::lookupObject(const word& name) const return *vpsiPtr_; } - FatalErrorIn("objectRegistry::lookupObject<Type>(const word&) const") - << nl + FatalErrorIn + ( + "objectRegistry::lookupObject<Type>(const word&) const" + ) << nl << " lookup of " << name << " from objectRegistry " << this->name() << " successful\n but it is not a " << Type::typeName @@ -127,23 +120,21 @@ const Type& Foam::objectRegistry::lookupObject(const word& name) const } else { - if (&parent_ != dynamic_cast<const objectRegistry*>(&time_)) + if (this->parentNotTime()) { return parent_.lookupObject<Type>(name); } - else - { - FatalErrorIn - ( - "objectRegistry::lookupObject<Type>(const word&) const" - ) << nl - << " request for " << Type::typeName - << " " << name << " from objectRegistry " << this->name() - << " failed\n available objects of type " << Type::typeName - << " are" << nl - << names<Type>() - << abort(FatalError); - } + + FatalErrorIn + ( + "objectRegistry::lookupObject<Type>(const word&) const" + ) << nl + << " request for " << Type::typeName + << " " << name << " from objectRegistry " << this->name() + << " failed\n available objects of type " << Type::typeName + << " are" << nl + << names<Type>() + << abort(FatalError); } return *reinterpret_cast< const Type* >(0); diff --git a/src/OpenFOAM/db/regIOobject/regIOobject.C b/src/OpenFOAM/db/regIOobject/regIOobject.C index f43cb4f44ef22261fccfc03393e8797f6aa6c068..de93473038da1dd0573e7bb2c793ee3e54e562e1 100644 --- a/src/OpenFOAM/db/regIOobject/regIOobject.C +++ b/src/OpenFOAM/db/regIOobject/regIOobject.C @@ -39,7 +39,11 @@ int Foam::regIOobject::fileModificationSkew namespace Foam { template<> - const char* Foam::NamedEnum<Foam::regIOobject::fileCheckTypes, 4>::names[] = + const char* Foam::NamedEnum + < + Foam::regIOobject::fileCheckTypes, + 4 + >::names[] = { "timeStamp", "timeStampMaster", diff --git a/src/OpenFOAM/db/typeInfo/className.H b/src/OpenFOAM/db/typeInfo/className.H index 747ab53384f3072e2625a4bcf8bf1e50bedbb204..2712593544dc7aa3a9a96d5f589313fd0fa2d191 100644 --- a/src/OpenFOAM/db/typeInfo/className.H +++ b/src/OpenFOAM/db/typeInfo/className.H @@ -109,11 +109,19 @@ public: \ //- Define the typeName as @a Name for template classes # define defineTemplateTypeNameWithName(Type, Name) \ defineTypeNameWithName(Type, Name) +//- Define the typeName as @a Name for template sub-classes +# define defineTemplate2TypeNameWithName(Type, Name) \ + defineTypeNameWithName(Type, Name) #else //- Define the typeName as @a Name for template classes # define defineTemplateTypeNameWithName(Type, Name) \ template<> \ defineTypeNameWithName(Type, Name) +//- Define the typeName as @a Name for template sub-classes +# define defineTemplate2TypeNameWithName(Type, Name) \ + template<> \ + template<> \ + defineTypeNameWithName(Type, Name) #endif //- Define the typeName for template classes, useful with typedefs @@ -143,11 +151,19 @@ public: \ //- Define the debug information for templates, lookup as @a Name # define defineTemplateDebugSwitchWithName(Type, Name, DebugSwitch) \ defineDebugSwitchWithName(Type, Name, DebugSwitch) +//- Define the debug information for templates sub-classes, lookup as @a Name +# define defineTemplate2DebugSwitchWithName(Type, Name, DebugSwitch) \ + defineDebugSwitchWithName(Type, Name, DebugSwitch) #else //- Define the debug information for templates, lookup as @a Name # define defineTemplateDebugSwitchWithName(Type, Name, DebugSwitch) \ template<> \ defineDebugSwitchWithName(Type, Name, DebugSwitch) +//- Define the debug information for templates sub-classes, lookup as @a Name +# define defineTemplate2DebugSwitchWithName(Type, Name, DebugSwitch) \ + template<> \ + template<> \ + defineDebugSwitchWithName(Type, Name, DebugSwitch) #endif //- Define the debug information for templates @@ -160,6 +176,18 @@ public: \ defineTemplateDebugSwitchWithName(Type, Type::typeName_(), DebugSwitch) +// for templated sub-classes + +//- Define the debug information for templates +// Useful with typedefs +#define defineTemplate2DebugSwitch(Type, DebugSwitch) \ + defineTemplate2DebugSwitchWithName(Type, #Type, DebugSwitch) + +//- Define the debug information directly for templates +#define defineNamedTemplate2DebugSwitch(Type, DebugSwitch) \ + defineTemplate2DebugSwitchWithName(Type, Type::typeName_(), DebugSwitch) + + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // definitions (with debug information) @@ -186,6 +214,19 @@ public: \ defineNamedTemplateTypeName(Type); \ defineNamedTemplateDebugSwitch(Type, DebugSwitch) +// for templated sub-classes + +//- Define the typeName and debug information, lookup as @a Name +#define defineTemplate2TypeNameAndDebugWithName(Type, Name, DebugSwitch) \ + defineTemplate2TypeNameWithName(Type, Name); \ + defineTemplate2DebugSwitchWithName(Type, Name, DebugSwitch) + +//- Define the typeName and debug information for templates, useful +// with typedefs +#define defineTemplate2TypeNameAndDebug(Type, DebugSwitch) \ + defineTemplate2TypeNameAndDebugWithName(Type, #Type, DebugSwitch) + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedField.C b/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedField.C index 53ce51cc13a30e58ed5ce7fe5f218c1932e3570d..b5faa5e26c929be67d44fcfb185d425129ffac9f 100644 --- a/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedField.C +++ b/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedField.C @@ -459,7 +459,7 @@ void DimensionedField<Type, GeoMesh>::operator= checkField(*this, df, "="); dimensions_ = df.dimensions(); - transfer(const_cast<DimensionedField<Type, GeoMesh>&>(df)); + this->transfer(const_cast<DimensionedField<Type, GeoMesh>&>(df)); tdf.clear(); } diff --git a/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedFieldIO.C b/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedFieldIO.C index 86be3e985e0507c1b58353f3845cf4e57ed5adfa..6365cdcf291065e83811e700c1cd1928e4f53cd2 100644 --- a/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedFieldIO.C +++ b/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedFieldIO.C @@ -26,15 +26,11 @@ License #include "DimensionedField.H" #include "IOstreams.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // template<class Type, class GeoMesh> -void DimensionedField<Type, GeoMesh>::readField +void Foam::DimensionedField<Type, GeoMesh>::readField ( const dictionary& fieldDict, const word& fieldDictEntry @@ -43,12 +39,15 @@ void DimensionedField<Type, GeoMesh>::readField dimensions_.reset(dimensionSet(fieldDict.lookup("dimensions"))); Field<Type> f(fieldDictEntry, fieldDict, GeoMesh::size(mesh_)); - transfer(f); + this->transfer(f); } template<class Type, class GeoMesh> -void DimensionedField<Type, GeoMesh>::readIfPresent(const word& fieldDictEntry) +void Foam::DimensionedField<Type, GeoMesh>::readIfPresent +( + const word& fieldDictEntry +) { if ( @@ -65,7 +64,7 @@ void DimensionedField<Type, GeoMesh>::readIfPresent(const word& fieldDictEntry) // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class Type, class GeoMesh> -DimensionedField<Type, GeoMesh>::DimensionedField +Foam::DimensionedField<Type, GeoMesh>::DimensionedField ( const IOobject& io, const Mesh& mesh, @@ -84,7 +83,7 @@ DimensionedField<Type, GeoMesh>::DimensionedField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class Type, class GeoMesh> -bool DimensionedField<Type, GeoMesh>::writeData +bool Foam::DimensionedField<Type, GeoMesh>::writeData ( Ostream& os, const word& fieldDictEntry @@ -107,7 +106,7 @@ bool DimensionedField<Type, GeoMesh>::writeData template<class Type, class GeoMesh> -bool DimensionedField<Type, GeoMesh>::writeData(Ostream& os) const +bool Foam::DimensionedField<Type, GeoMesh>::writeData(Ostream& os) const { return writeData(os, "value"); } @@ -116,7 +115,11 @@ bool DimensionedField<Type, GeoMesh>::writeData(Ostream& os) const // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // template<class Type, class GeoMesh> -Ostream& operator<<(Ostream& os, const DimensionedField<Type, GeoMesh>& df) +Foam::Ostream& Foam::operator<< +( + Ostream& os, + const DimensionedField<Type, GeoMesh>& df +) { df.writeData(os); @@ -125,7 +128,7 @@ Ostream& operator<<(Ostream& os, const DimensionedField<Type, GeoMesh>& df) template<class Type, class GeoMesh> -Ostream& operator<< +Foam::Ostream& Foam::operator<< ( Ostream& os, const tmp<DimensionedField<Type, GeoMesh> >& tdf @@ -138,8 +141,4 @@ Ostream& operator<< } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/OpenFOAM/fields/Fields/Field/Field.C b/src/OpenFOAM/fields/Fields/Field/Field.C index 979442ac86d166088054a3b0c45503af5816853c..3370264b5dbed7c614e089429991cbac4e1e93f0 100644 --- a/src/OpenFOAM/fields/Fields/Field/Field.C +++ b/src/OpenFOAM/fields/Fields/Field/Field.C @@ -28,42 +28,37 @@ License #include "dictionary.H" #include "contiguous.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * Static Members * * * * * * * * * * * * * * // template<class Type> -const char* const Field<Type>::typeName("Field"); +const char* const Foam::Field<Type>::typeName("Field"); // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class Type> -Field<Type>::Field() +Foam::Field<Type>::Field() : List<Type>() {} template<class Type> -Field<Type>::Field(const label size) +Foam::Field<Type>::Field(const label size) : List<Type>(size) {} template<class Type> -Field<Type>::Field(const label size, const Type& t) +Foam::Field<Type>::Field(const label size, const Type& t) : List<Type>(size, t) {} template<class Type> -Field<Type>::Field +Foam::Field<Type>::Field ( const UList<Type>& mapF, const labelUList& mapAddressing @@ -74,8 +69,9 @@ Field<Type>::Field map(mapF, mapAddressing); } + template<class Type> -Field<Type>::Field +Foam::Field<Type>::Field ( const tmp<Field<Type> >& tmapF, const labelUList& mapAddressing @@ -88,7 +84,7 @@ Field<Type>::Field template<class Type> -Field<Type>::Field +Foam::Field<Type>::Field ( const UList<Type>& mapF, const labelListList& mapAddressing, @@ -100,8 +96,9 @@ Field<Type>::Field map(mapF, mapAddressing, mapWeights); } + template<class Type> -Field<Type>::Field +Foam::Field<Type>::Field ( const tmp<Field<Type> >& tmapF, const labelListList& mapAddressing, @@ -115,7 +112,7 @@ Field<Type>::Field template<class Type> -Field<Type>::Field +Foam::Field<Type>::Field ( const UList<Type>& mapF, const FieldMapper& mapper @@ -126,8 +123,9 @@ Field<Type>::Field map(mapF, mapper); } + template<class Type> -Field<Type>::Field +Foam::Field<Type>::Field ( const tmp<Field<Type> >& tmapF, const FieldMapper& mapper @@ -140,7 +138,7 @@ Field<Type>::Field template<class Type> -Field<Type>::Field(const Field<Type>& f) +Foam::Field<Type>::Field(const Field<Type>& f) : refCount(), List<Type>(f) @@ -148,35 +146,37 @@ Field<Type>::Field(const Field<Type>& f) template<class Type> -Field<Type>::Field(Field<Type>& f, bool reUse) +Foam::Field<Type>::Field(Field<Type>& f, bool reUse) : List<Type>(f, reUse) {} template<class Type> -Field<Type>::Field(const Xfer<List<Type> >& f) +Foam::Field<Type>::Field(const Xfer<List<Type> >& f) : List<Type>(f) {} template<class Type> -Field<Type>::Field(const Xfer<Field<Type> >& f) +Foam::Field<Type>::Field(const Xfer<Field<Type> >& f) : List<Type>(f) {} +#ifdef __INTEL_COMPILER template<class Type> -Field<Type>::Field(const typename Field<Type>::subField& sf) +Foam::Field<Type>::Field(const typename Field<Type>::subField& sf) : List<Type>(sf) {} +#endif template<class Type> -Field<Type>::Field(const UList<Type>& list) +Foam::Field<Type>::Field(const UList<Type>& list) : List<Type>(list) {} @@ -185,7 +185,7 @@ Field<Type>::Field(const UList<Type>& list) // Construct as copy of tmp<Field> #ifdef ConstructFromTmp template<class Type> -Field<Type>::Field(const tmp<Field<Type> >& tf) +Foam::Field<Type>::Field(const tmp<Field<Type> >& tf) : List<Type>(const_cast<Field<Type>&>(tf()), tf.isTmp()) { @@ -195,14 +195,14 @@ Field<Type>::Field(const tmp<Field<Type> >& tf) template<class Type> -Field<Type>::Field(Istream& is) +Foam::Field<Type>::Field(Istream& is) : List<Type>(is) {} template<class Type> -Field<Type>::Field +Foam::Field<Type>::Field ( const word& keyword, const dictionary& dict, @@ -285,7 +285,7 @@ Field<Type>::Field template<class Type> -tmp<Field<Type> > Field<Type>::clone() const +Foam::tmp<Foam::Field<Type> > Foam::Field<Type>::clone() const { return tmp<Field<Type> >(new Field<Type>(*this)); } @@ -294,7 +294,7 @@ tmp<Field<Type> > Field<Type>::clone() const // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class Type> -void Field<Type>::map +void Foam::Field<Type>::map ( const UList<Type>& mapF, const labelUList& mapAddressing @@ -323,7 +323,7 @@ void Field<Type>::map template<class Type> -void Field<Type>::map +void Foam::Field<Type>::map ( const tmp<Field<Type> >& tmapF, const labelUList& mapAddressing @@ -335,7 +335,7 @@ void Field<Type>::map template<class Type> -void Field<Type>::map +void Foam::Field<Type>::map ( const UList<Type>& mapF, const labelListList& mapAddressing, @@ -378,8 +378,9 @@ void Field<Type>::map } } + template<class Type> -void Field<Type>::map +void Foam::Field<Type>::map ( const tmp<Field<Type> >& tmapF, const labelListList& mapAddressing, @@ -392,7 +393,7 @@ void Field<Type>::map template<class Type> -void Field<Type>::map +void Foam::Field<Type>::map ( const UList<Type>& mapF, const FieldMapper& mapper @@ -413,8 +414,9 @@ void Field<Type>::map } } + template<class Type> -void Field<Type>::map +void Foam::Field<Type>::map ( const tmp<Field<Type> >& tmapF, const FieldMapper& mapper @@ -426,7 +428,7 @@ void Field<Type>::map template<class Type> -void Field<Type>::autoMap +void Foam::Field<Type>::autoMap ( const FieldMapper& mapper ) @@ -452,7 +454,7 @@ void Field<Type>::autoMap template<class Type> -void Field<Type>::rmap +void Foam::Field<Type>::rmap ( const UList<Type>& mapF, const labelUList& mapAddressing @@ -471,8 +473,9 @@ void Field<Type>::rmap } } + template<class Type> -void Field<Type>::rmap +void Foam::Field<Type>::rmap ( const tmp<Field<Type> >& tmapF, const labelUList& mapAddressing @@ -484,7 +487,7 @@ void Field<Type>::rmap template<class Type> -void Field<Type>::rmap +void Foam::Field<Type>::rmap ( const UList<Type>& mapF, const labelUList& mapAddressing, @@ -501,8 +504,9 @@ void Field<Type>::rmap } } + template<class Type> -void Field<Type>::rmap +void Foam::Field<Type>::rmap ( const tmp<Field<Type> >& tmapF, const labelUList& mapAddressing, @@ -515,14 +519,15 @@ void Field<Type>::rmap template<class Type> -void Field<Type>::negate() +void Foam::Field<Type>::negate() { TFOR_ALL_F_OP_OP_F(Type, *this, =, -, Type, *this) } template<class Type> -tmp<Field<typename Field<Type>::cmptType> > Field<Type>::component +Foam::tmp<Foam::Field<typename Foam::Field<Type>::cmptType> > +Foam::Field<Type>::component ( const direction d ) const @@ -534,7 +539,7 @@ tmp<Field<typename Field<Type>::cmptType> > Field<Type>::component template<class Type> -void Field<Type>::replace +void Foam::Field<Type>::replace ( const direction d, const UList<cmptType>& sf @@ -546,7 +551,7 @@ void Field<Type>::replace template<class Type> -void Field<Type>::replace +void Foam::Field<Type>::replace ( const direction d, const tmp<Field<cmptType> >& tsf @@ -558,7 +563,7 @@ void Field<Type>::replace template<class Type> -void Field<Type>::replace +void Foam::Field<Type>::replace ( const direction d, const cmptType& c @@ -570,7 +575,7 @@ void Field<Type>::replace template<class Type> -tmp<Field<Type> > Field<Type>::T() const +Foam::tmp<Foam::Field<Type> > Foam::Field<Type>::T() const { tmp<Field<Type> > transpose(new Field<Type>(this->size())); ::Foam::T(transpose(), *this); @@ -579,7 +584,7 @@ tmp<Field<Type> > Field<Type>::T() const template<class Type> -void Field<Type>::writeEntry(const word& keyword, Ostream& os) const +void Foam::Field<Type>::writeEntry(const word& keyword, Ostream& os) const { os.writeKeyword(keyword); @@ -617,7 +622,7 @@ void Field<Type>::writeEntry(const word& keyword, Ostream& os) const // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // template<class Type> -void Field<Type>::operator=(const Field<Type>& rhs) +void Foam::Field<Type>::operator=(const Field<Type>& rhs) { if (this == &rhs) { @@ -631,21 +636,21 @@ void Field<Type>::operator=(const Field<Type>& rhs) template<class Type> -void Field<Type>::operator=(const SubField<Type>& rhs) +void Foam::Field<Type>::operator=(const SubField<Type>& rhs) { List<Type>::operator=(rhs); } template<class Type> -void Field<Type>::operator=(const UList<Type>& rhs) +void Foam::Field<Type>::operator=(const UList<Type>& rhs) { List<Type>::operator=(rhs); } template<class Type> -void Field<Type>::operator=(const tmp<Field>& rhs) +void Foam::Field<Type>::operator=(const tmp<Field>& rhs) { if (this == &(rhs())) { @@ -662,7 +667,7 @@ void Field<Type>::operator=(const tmp<Field>& rhs) template<class Type> -void Field<Type>::operator=(const Type& t) +void Foam::Field<Type>::operator=(const Type& t) { List<Type>::operator=(t); } @@ -670,7 +675,7 @@ void Field<Type>::operator=(const Type& t) template<class Type> template<class Form, class Cmpt, int nCmpt> -void Field<Type>::operator=(const VectorSpace<Form,Cmpt,nCmpt>& vs) +void Foam::Field<Type>::operator=(const VectorSpace<Form,Cmpt,nCmpt>& vs) { typedef VectorSpace<Form,Cmpt,nCmpt> VSType; TFOR_ALL_F_OP_S(Type, *this, =, VSType, vs) @@ -680,20 +685,20 @@ void Field<Type>::operator=(const VectorSpace<Form,Cmpt,nCmpt>& vs) #define COMPUTED_ASSIGNMENT(TYPE, op) \ \ template<class Type> \ -void Field<Type>::operator op(const UList<TYPE>& f) \ +void Foam::Field<Type>::operator op(const UList<TYPE>& f) \ { \ TFOR_ALL_F_OP_F(Type, *this, op, TYPE, f) \ } \ \ template<class Type> \ -void Field<Type>::operator op(const tmp<Field<TYPE> >& tf) \ +void Foam::Field<Type>::operator op(const tmp<Field<TYPE> >& tf) \ { \ operator op(tf()); \ tf.clear(); \ } \ \ template<class Type> \ -void Field<Type>::operator op(const TYPE& t) \ +void Foam::Field<Type>::operator op(const TYPE& t) \ { \ TFOR_ALL_F_OP_S(Type, *this, op, TYPE, t) \ } @@ -709,17 +714,17 @@ COMPUTED_ASSIGNMENT(scalar, /=) // * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // template<class Type> -Ostream& operator<<(Ostream& os, const Field<Type>& f) +Foam::Ostream& Foam::operator<<(Ostream& os, const Field<Type>& f) { - os << static_cast<const List<Type>&>(f); + os << static_cast<const List<Type>&>(f); return os; } template<class Type> -Ostream& operator<<(Ostream& os, const tmp<Field<Type> >& tf) +Foam::Ostream& Foam::operator<<(Ostream& os, const tmp<Field<Type> >& tf) { - os << tf(); + os << tf(); tf.clear(); return os; } @@ -727,10 +732,6 @@ Ostream& operator<<(Ostream& os, const tmp<Field<Type> >& tf) // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -# include "FieldFunctions.C" +#include "FieldFunctions.C" // ************************************************************************* // diff --git a/src/OpenFOAM/fields/Fields/Field/Field.H b/src/OpenFOAM/fields/Fields/Field/Field.H index a886dd37555983b7dc77bd05354abda4c7c9fc97..ecbbcbe8b4f05ab469b18fb163eb41d6cc8fc3ad 100644 --- a/src/OpenFOAM/fields/Fields/Field/Field.H +++ b/src/OpenFOAM/fields/Fields/Field/Field.H @@ -176,8 +176,10 @@ public: //- Construct by transferring the Field contents Field(const Xfer<Field<Type> >&); +#ifdef __INTEL_COMPILER //- Construct as copy of subField Field(const typename Field<Type>::subField&); +#endif //- Construct as copy of tmp<Field> # ifdef ConstructFromTmp @@ -188,7 +190,7 @@ public: Field(Istream&); //- Construct from a dictionary entry - Field(const word& keyword, const dictionary& dict, const label size); + Field(const word& keyword, const dictionary&, const label size); //- Clone tmp<Field<Type> > clone() const; diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C index 8da7d3fb63f3f30a0a85bcece06d3d518e98b776..3be5f70a2fdfe3d52566ce9f1705121b82f5a0c3 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C +++ b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C @@ -53,7 +53,7 @@ GeometricBoundaryField forAll(bmesh_, patchi) { - set + this->set ( patchi, PatchField<Type>::New @@ -112,7 +112,7 @@ GeometricBoundaryField { forAll(bmesh_, patchi) { - set + this->set ( patchi, PatchField<Type>::New @@ -129,7 +129,7 @@ GeometricBoundaryField { forAll(bmesh_, patchi) { - set + this->set ( patchi, PatchField<Type>::New @@ -167,7 +167,7 @@ GeometricBoundaryField forAll(bmesh_, patchi) { - set(patchi, ptfl[patchi].clone(field)); + this->set(patchi, ptfl[patchi].clone(field)); } } @@ -195,7 +195,7 @@ GeometricBoundaryField forAll(bmesh_, patchi) { - set(patchi, btf[patchi].clone(field)); + this->set(patchi, btf[patchi].clone(field)); } } @@ -275,7 +275,7 @@ GeometricBoundaryField << " to split cyclics." << exit(FatalIOError); } - set + this->set ( patchi, PatchField<Type>::New @@ -288,7 +288,7 @@ GeometricBoundaryField } else { - set + this->set ( patchi, PatchField<Type>::New diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C index 10c6d9c300ff9402701fb9f315830d50af7c19b4..1062ac09540eeb229cdedb27431ab754ca78e823 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C +++ b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C @@ -941,7 +941,14 @@ void Foam::GeometricField<Type, PatchField, GeoMesh>::relax() { word name = this->name(); - if (this->mesh().data::lookupOrDefault<bool>("finalIteration", false)) + if + ( + this->mesh().data::template lookupOrDefault<bool> + ( + "finalIteration", + false + ) + ) { name += "Final"; } diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricField/MapGeometricFields.H b/src/OpenFOAM/fields/GeometricFields/GeometricField/MapGeometricFields.H index 849dd3d6dbaee4071b32f00212b9920f641268c7..78cb5d5ad0fac308dd886af306262bc3fcb9e839 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricField/MapGeometricFields.H +++ b/src/OpenFOAM/fields/GeometricFields/GeometricField/MapGeometricFields.H @@ -74,8 +74,8 @@ void MapGeometricFields { HashTable<const GeometricField<Type, PatchField, GeoMesh>*> fields ( - mapper.thisDb().objectRegistry::lookupClass - <GeometricField<Type, PatchField, GeoMesh> >() + mapper.thisDb().objectRegistry::template + lookupClass<GeometricField<Type, PatchField, GeoMesh> >() ); // It is necessary to enforce that all old-time fields are stored diff --git a/src/OpenFOAM/fields/GeometricFields/pointFields/pointFields.C b/src/OpenFOAM/fields/GeometricFields/pointFields/pointFields.C index 5ffcf9f99cf9548a9f9e1811e3457befff23f159..92b2841f8e1557598edde4b5cb17c15071b41593 100644 --- a/src/OpenFOAM/fields/GeometricFields/pointFields/pointFields.C +++ b/src/OpenFOAM/fields/GeometricFields/pointFields/pointFields.C @@ -31,21 +31,22 @@ License namespace Foam { -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -defineTemplateTypeNameAndDebug(pointScalarField::DimensionedInternalField, 0); -defineTemplateTypeNameAndDebug(pointVectorField::DimensionedInternalField, 0); -defineTemplateTypeNameAndDebug +defineTemplate2TypeNameAndDebug(pointScalarField::DimensionedInternalField, 0); +defineTemplate2TypeNameAndDebug(pointVectorField::DimensionedInternalField, 0); +defineTemplate2TypeNameAndDebug ( pointSphericalTensorField::DimensionedInternalField, 0 ); -defineTemplateTypeNameAndDebug +defineTemplate2TypeNameAndDebug ( pointSymmTensorField::DimensionedInternalField, 0 ); -defineTemplateTypeNameAndDebug(pointTensorField::DimensionedInternalField, 0); +defineTemplate2TypeNameAndDebug(pointTensorField::DimensionedInternalField, 0); + defineTemplateTypeNameAndDebug(pointScalarField, 0); defineTemplateTypeNameAndDebug(pointVectorField, 0); diff --git a/src/OpenFOAM/fields/UniformDimensionedFields/UniformDimensionedField.H b/src/OpenFOAM/fields/UniformDimensionedFields/UniformDimensionedField.H index 801657e6b51bfd8faafd3c2eb093cbe36bad1be2..8885040afc6e8ed1e235254303187baba417f235 100644 --- a/src/OpenFOAM/fields/UniformDimensionedFields/UniformDimensionedField.H +++ b/src/OpenFOAM/fields/UniformDimensionedFields/UniformDimensionedField.H @@ -64,9 +64,6 @@ public: // Constructors - //- Construct null - UniformDimensionedField(); - //- Construct from components UniformDimensionedField(const IOobject&, const dimensioned<Type>&); diff --git a/src/OpenFOAM/fields/pointPatchFields/basic/basicSymmetry/basicSymmetryPointPatchField.C b/src/OpenFOAM/fields/pointPatchFields/basic/basicSymmetry/basicSymmetryPointPatchField.C index 6ea1a1cef86c120911fe58af65fa737a24abcb43..b315134b6b0e7f99ca3b1d6c7cbacd0c9af274d5 100644 --- a/src/OpenFOAM/fields/pointPatchFields/basic/basicSymmetry/basicSymmetryPointPatchField.C +++ b/src/OpenFOAM/fields/pointPatchFields/basic/basicSymmetry/basicSymmetryPointPatchField.C @@ -27,15 +27,11 @@ License #include "transformField.H" #include "symmTransformField.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class Type> -basicSymmetryPointPatchField<Type>::basicSymmetryPointPatchField +Foam::basicSymmetryPointPatchField<Type>::basicSymmetryPointPatchField ( const pointPatch& p, const DimensionedField<Type, pointMesh>& iF @@ -46,7 +42,7 @@ basicSymmetryPointPatchField<Type>::basicSymmetryPointPatchField template<class Type> -basicSymmetryPointPatchField<Type>::basicSymmetryPointPatchField +Foam::basicSymmetryPointPatchField<Type>::basicSymmetryPointPatchField ( const pointPatch& p, const DimensionedField<Type, pointMesh>& iF, @@ -58,7 +54,7 @@ basicSymmetryPointPatchField<Type>::basicSymmetryPointPatchField template<class Type> -basicSymmetryPointPatchField<Type>::basicSymmetryPointPatchField +Foam::basicSymmetryPointPatchField<Type>::basicSymmetryPointPatchField ( const basicSymmetryPointPatchField<Type>& ptf, const pointPatch& p, @@ -71,7 +67,7 @@ basicSymmetryPointPatchField<Type>::basicSymmetryPointPatchField template<class Type> -basicSymmetryPointPatchField<Type>::basicSymmetryPointPatchField +Foam::basicSymmetryPointPatchField<Type>::basicSymmetryPointPatchField ( const basicSymmetryPointPatchField<Type>& ptf, const DimensionedField<Type, pointMesh>& iF @@ -84,7 +80,10 @@ basicSymmetryPointPatchField<Type>::basicSymmetryPointPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class Type> -void basicSymmetryPointPatchField<Type>::evaluate(const Pstream::commsTypes) +void Foam::basicSymmetryPointPatchField<Type>::evaluate +( + const Pstream::commsTypes +) { const vectorField& nHat = this->patch().pointNormals(); @@ -99,12 +98,8 @@ void basicSymmetryPointPatchField<Type>::evaluate(const Pstream::commsTypes) // Get internal field to insert values into Field<Type>& iF = const_cast<Field<Type>&>(this->internalField()); - setInInternalField(iF, tvalues()); + this->setInInternalField(iF, tvalues()); } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/OpenFOAM/fields/pointPatchFields/basic/mixed/mixedPointPatchField.C b/src/OpenFOAM/fields/pointPatchFields/basic/mixed/mixedPointPatchField.C index 103ff7197f26444d742467bf22ca2a922cf7a460..bb465157ec4eca48cbf8fc519f9b07d3a0b62cac 100644 --- a/src/OpenFOAM/fields/pointPatchFields/basic/mixed/mixedPointPatchField.C +++ b/src/OpenFOAM/fields/pointPatchFields/basic/mixed/mixedPointPatchField.C @@ -26,15 +26,11 @@ License #include "mixedPointPatchField.H" #include "pointPatchFieldMapper.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // template<class Type> -void mixedPointPatchField<Type>::checkFieldSize() const +void Foam::mixedPointPatchField<Type>::checkFieldSize() const { if ( @@ -59,7 +55,7 @@ void mixedPointPatchField<Type>::checkFieldSize() const // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class Type> -mixedPointPatchField<Type>::mixedPointPatchField +Foam::mixedPointPatchField<Type>::mixedPointPatchField ( const pointPatch& p, const DimensionedField<Type, pointMesh>& iF @@ -72,7 +68,7 @@ mixedPointPatchField<Type>::mixedPointPatchField template<class Type> -mixedPointPatchField<Type>::mixedPointPatchField +Foam::mixedPointPatchField<Type>::mixedPointPatchField ( const pointPatch& p, const DimensionedField<Type, pointMesh>& iF, @@ -86,7 +82,7 @@ mixedPointPatchField<Type>::mixedPointPatchField template<class Type> -mixedPointPatchField<Type>::mixedPointPatchField +Foam::mixedPointPatchField<Type>::mixedPointPatchField ( const mixedPointPatchField<Type>& ptf, const pointPatch& p, @@ -108,7 +104,7 @@ mixedPointPatchField<Type>::mixedPointPatchField template<class Type> -mixedPointPatchField<Type>::mixedPointPatchField +Foam::mixedPointPatchField<Type>::mixedPointPatchField ( const mixedPointPatchField<Type>& ptf, const DimensionedField<Type, pointMesh>& iF @@ -124,7 +120,7 @@ mixedPointPatchField<Type>::mixedPointPatchField // Map and resize from self given a mapper template<class Type> -void mixedPointPatchField<Type>::autoMap +void Foam::mixedPointPatchField<Type>::autoMap ( const pointPatchFieldMapper& m ) @@ -137,7 +133,7 @@ void mixedPointPatchField<Type>::autoMap // Grab the values using rmap template<class Type> -void mixedPointPatchField<Type>::rmap +void Foam::mixedPointPatchField<Type>::rmap ( const pointPatchField<Type>& ptf, const labelList& addr @@ -154,7 +150,7 @@ void mixedPointPatchField<Type>::rmap // Evaluate patch field template<class Type> -void mixedPointPatchField<Type>::evaluate(const Pstream::commsTypes) +void Foam::mixedPointPatchField<Type>::evaluate(const Pstream::commsTypes) { Field<Type>::operator= ( @@ -165,13 +161,13 @@ void mixedPointPatchField<Type>::evaluate(const Pstream::commsTypes) // Get internal field to insert values into Field<Type>& iF = const_cast<Field<Type>&>(this->internalField()); - setInInternalField(iF, *this); + this->setInInternalField(iF, *this); } // Write template<class Type> -void mixedPointPatchField<Type>::write(Ostream& os) const +void Foam::mixedPointPatchField<Type>::write(Ostream& os) const { pointPatchField<Type>::write(os); refValue_.writeEntry("refValue", os); @@ -179,8 +175,4 @@ void mixedPointPatchField<Type>::write(Ostream& os) const } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.C b/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.C index 0afbf02f975c4400682720f4afc2b7f1ecea5d9c..5ce42fc1e093fd93342d73b768f4e7ee64052539 100644 --- a/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.C +++ b/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.C @@ -26,17 +26,12 @@ License #include "valuePointPatchField.H" #include "pointPatchFieldMapper.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // template<class Type> -void valuePointPatchField<Type>::checkFieldSize() const +void Foam::valuePointPatchField<Type>::checkFieldSize() const { - if (size() != this->patch().size()) + if (this->size() != this->patch().size()) { FatalErrorIn ( @@ -52,7 +47,7 @@ void valuePointPatchField<Type>::checkFieldSize() const // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * // template<class Type> -valuePointPatchField<Type>::valuePointPatchField +Foam::valuePointPatchField<Type>::valuePointPatchField ( const pointPatch& p, const DimensionedField<Type, pointMesh>& iF @@ -64,7 +59,7 @@ valuePointPatchField<Type>::valuePointPatchField template<class Type> -valuePointPatchField<Type>::valuePointPatchField +Foam::valuePointPatchField<Type>::valuePointPatchField ( const pointPatch& p, const DimensionedField<Type, pointMesh>& iF, @@ -105,7 +100,7 @@ valuePointPatchField<Type>::valuePointPatchField template<class Type> -valuePointPatchField<Type>::valuePointPatchField +Foam::valuePointPatchField<Type>::valuePointPatchField ( const valuePointPatchField<Type>& ptf, const pointPatch& p, @@ -119,7 +114,7 @@ valuePointPatchField<Type>::valuePointPatchField template<class Type> -valuePointPatchField<Type>::valuePointPatchField +Foam::valuePointPatchField<Type>::valuePointPatchField ( const valuePointPatchField<Type>& ptf, const DimensionedField<Type, pointMesh>& iF @@ -133,7 +128,7 @@ valuePointPatchField<Type>::valuePointPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class Type> -void valuePointPatchField<Type>::autoMap +void Foam::valuePointPatchField<Type>::autoMap ( const pointPatchFieldMapper& m ) @@ -143,7 +138,7 @@ void valuePointPatchField<Type>::autoMap template<class Type> -void valuePointPatchField<Type>::rmap +void Foam::valuePointPatchField<Type>::rmap ( const pointPatchField<Type>& ptf, const labelList& addr @@ -161,7 +156,7 @@ void valuePointPatchField<Type>::rmap template<class Type> -void valuePointPatchField<Type>::updateCoeffs() +void Foam::valuePointPatchField<Type>::updateCoeffs() { if (this->updated()) { @@ -171,26 +166,26 @@ void valuePointPatchField<Type>::updateCoeffs() // Get internal field to insert values into Field<Type>& iF = const_cast<Field<Type>&>(this->internalField()); - setInInternalField(iF, *this); + this->setInInternalField(iF, *this); pointPatchField<Type>::updateCoeffs(); } template<class Type> -void valuePointPatchField<Type>::evaluate(const Pstream::commsTypes) +void Foam::valuePointPatchField<Type>::evaluate(const Pstream::commsTypes) { // Get internal field to insert values into Field<Type>& iF = const_cast<Field<Type>&>(this->internalField()); - setInInternalField(iF, *this); + this->setInInternalField(iF, *this); pointPatchField<Type>::evaluate(); } template<class Type> -void valuePointPatchField<Type>::write(Ostream& os) const +void Foam::valuePointPatchField<Type>::write(Ostream& os) const { pointPatchField<Type>::write(os); this->writeEntry("value", os); @@ -200,7 +195,7 @@ void valuePointPatchField<Type>::write(Ostream& os) const // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // template<class Type> -void valuePointPatchField<Type>::operator= +void Foam::valuePointPatchField<Type>::operator= ( const valuePointPatchField<Type>& ptf ) @@ -210,7 +205,7 @@ void valuePointPatchField<Type>::operator= template<class Type> -void valuePointPatchField<Type>::operator= +void Foam::valuePointPatchField<Type>::operator= ( const pointPatchField<Type>& ptf ) @@ -220,7 +215,7 @@ void valuePointPatchField<Type>::operator= template<class Type> -void valuePointPatchField<Type>::operator= +void Foam::valuePointPatchField<Type>::operator= ( const Field<Type>& tf ) @@ -230,7 +225,7 @@ void valuePointPatchField<Type>::operator= template<class Type> -void valuePointPatchField<Type>::operator= +void Foam::valuePointPatchField<Type>::operator= ( const Type& t ) @@ -241,7 +236,7 @@ void valuePointPatchField<Type>::operator= // Force an assignment template<class Type> -void valuePointPatchField<Type>::operator== +void Foam::valuePointPatchField<Type>::operator== ( const valuePointPatchField<Type>& ptf ) @@ -251,7 +246,7 @@ void valuePointPatchField<Type>::operator== template<class Type> -void valuePointPatchField<Type>::operator== +void Foam::valuePointPatchField<Type>::operator== ( const pointPatchField<Type>& ptf ) @@ -261,7 +256,7 @@ void valuePointPatchField<Type>::operator== template<class Type> -void valuePointPatchField<Type>::operator== +void Foam::valuePointPatchField<Type>::operator== ( const Field<Type>& tf ) @@ -271,7 +266,7 @@ void valuePointPatchField<Type>::operator== template<class Type> -void valuePointPatchField<Type>::operator== +void Foam::valuePointPatchField<Type>::operator== ( const Type& t ) @@ -280,8 +275,4 @@ void valuePointPatchField<Type>::operator== } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/OpenFOAM/fields/pointPatchFields/constraint/cyclic/cyclicPointPatchField.C b/src/OpenFOAM/fields/pointPatchFields/constraint/cyclic/cyclicPointPatchField.C index 611f0f8ba99afbe848585e274d1440d570ecb1e2..97891689748231ea190972bd88ad4fb1b8988416 100644 --- a/src/OpenFOAM/fields/pointPatchFields/constraint/cyclic/cyclicPointPatchField.C +++ b/src/OpenFOAM/fields/pointPatchFields/constraint/cyclic/cyclicPointPatchField.C @@ -28,15 +28,10 @@ License #include "transformField.H" #include "pointFields.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class Type> -cyclicPointPatchField<Type>::cyclicPointPatchField +Foam::cyclicPointPatchField<Type>::cyclicPointPatchField ( const pointPatch& p, const DimensionedField<Type, pointMesh>& iF @@ -48,7 +43,7 @@ cyclicPointPatchField<Type>::cyclicPointPatchField template<class Type> -cyclicPointPatchField<Type>::cyclicPointPatchField +Foam::cyclicPointPatchField<Type>::cyclicPointPatchField ( const pointPatch& p, const DimensionedField<Type, pointMesh>& iF, @@ -77,7 +72,7 @@ cyclicPointPatchField<Type>::cyclicPointPatchField template<class Type> -cyclicPointPatchField<Type>::cyclicPointPatchField +Foam::cyclicPointPatchField<Type>::cyclicPointPatchField ( const cyclicPointPatchField<Type>& ptf, const pointPatch& p, @@ -109,7 +104,7 @@ cyclicPointPatchField<Type>::cyclicPointPatchField template<class Type> -cyclicPointPatchField<Type>::cyclicPointPatchField +Foam::cyclicPointPatchField<Type>::cyclicPointPatchField ( const cyclicPointPatchField<Type>& ptf, const DimensionedField<Type, pointMesh>& iF @@ -123,7 +118,7 @@ cyclicPointPatchField<Type>::cyclicPointPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class Type> -void cyclicPointPatchField<Type>::swapAddSeparated +void Foam::cyclicPointPatchField<Type>::swapAddSeparated ( const Pstream::commsTypes, Field<Type>& pField @@ -177,14 +172,10 @@ void cyclicPointPatchField<Type>::swapAddSeparated Swap(pf[pairs[pairi][0]], nbrPf[pairs[pairi][1]]); } } - addToInternalField(pField, pf); + this->addToInternalField(pField, pf); nbr.addToInternalField(pField, nbrPf); } } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/OpenFOAM/fields/pointPatchFields/constraint/cyclicSlip/cyclicSlipPointPatchField.C b/src/OpenFOAM/fields/pointPatchFields/constraint/cyclicSlip/cyclicSlipPointPatchField.C index 25bafe394fbc3ca0c6d915e3976cde723bfa00bb..842d50b88921b15316905bd1cee03daaacca8325 100644 --- a/src/OpenFOAM/fields/pointPatchFields/constraint/cyclicSlip/cyclicSlipPointPatchField.C +++ b/src/OpenFOAM/fields/pointPatchFields/constraint/cyclicSlip/cyclicSlipPointPatchField.C @@ -27,15 +27,11 @@ License #include "transformField.H" #include "symmTransformField.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class Type> -cyclicSlipPointPatchField<Type>::cyclicSlipPointPatchField +Foam::cyclicSlipPointPatchField<Type>::cyclicSlipPointPatchField ( const pointPatch& p, const DimensionedField<Type, pointMesh>& iF @@ -46,7 +42,7 @@ cyclicSlipPointPatchField<Type>::cyclicSlipPointPatchField template<class Type> -cyclicSlipPointPatchField<Type>::cyclicSlipPointPatchField +Foam::cyclicSlipPointPatchField<Type>::cyclicSlipPointPatchField ( const pointPatch& p, const DimensionedField<Type, pointMesh>& iF, @@ -58,7 +54,7 @@ cyclicSlipPointPatchField<Type>::cyclicSlipPointPatchField template<class Type> -cyclicSlipPointPatchField<Type>::cyclicSlipPointPatchField +Foam::cyclicSlipPointPatchField<Type>::cyclicSlipPointPatchField ( const cyclicSlipPointPatchField<Type>& ptf, const pointPatch& p, @@ -71,7 +67,7 @@ cyclicSlipPointPatchField<Type>::cyclicSlipPointPatchField template<class Type> -cyclicSlipPointPatchField<Type>::cyclicSlipPointPatchField +Foam::cyclicSlipPointPatchField<Type>::cyclicSlipPointPatchField ( const cyclicSlipPointPatchField<Type>& ptf, const DimensionedField<Type, pointMesh>& iF @@ -84,7 +80,7 @@ cyclicSlipPointPatchField<Type>::cyclicSlipPointPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class Type> -void cyclicSlipPointPatchField<Type>::evaluate(const Pstream::commsTypes) +void Foam::cyclicSlipPointPatchField<Type>::evaluate(const Pstream::commsTypes) { const vectorField& nHat = this->patch().pointNormals(); @@ -99,12 +95,8 @@ void cyclicSlipPointPatchField<Type>::evaluate(const Pstream::commsTypes) // Get internal field to insert values into Field<Type>& iF = const_cast<Field<Type>&>(this->internalField()); - setInInternalField(iF, tvalues()); + this->setInInternalField(iF, tvalues()); } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/OpenFOAM/fields/pointPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicPointPatchField.C b/src/OpenFOAM/fields/pointPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicPointPatchField.C index 129b9822cf2c13305609274d27f7a634aa90a9a6..9cc54bb275870ff7ed780a07bb0e8f444f8abe4e 100644 --- a/src/OpenFOAM/fields/pointPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicPointPatchField.C +++ b/src/OpenFOAM/fields/pointPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicPointPatchField.C @@ -27,15 +27,11 @@ License #include "transformField.H" #include "symmTransformField.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class Type> -nonuniformTransformCyclicPointPatchField<Type>:: +Foam::nonuniformTransformCyclicPointPatchField<Type>:: nonuniformTransformCyclicPointPatchField ( const pointPatch& p, @@ -47,7 +43,7 @@ nonuniformTransformCyclicPointPatchField template<class Type> -nonuniformTransformCyclicPointPatchField<Type>:: +Foam::nonuniformTransformCyclicPointPatchField<Type>:: nonuniformTransformCyclicPointPatchField ( const pointPatch& p, @@ -60,7 +56,7 @@ nonuniformTransformCyclicPointPatchField template<class Type> -nonuniformTransformCyclicPointPatchField<Type>:: +Foam::nonuniformTransformCyclicPointPatchField<Type>:: nonuniformTransformCyclicPointPatchField ( const nonuniformTransformCyclicPointPatchField<Type>& ptf, @@ -74,7 +70,7 @@ nonuniformTransformCyclicPointPatchField template<class Type> -nonuniformTransformCyclicPointPatchField<Type>:: +Foam::nonuniformTransformCyclicPointPatchField<Type>:: nonuniformTransformCyclicPointPatchField ( const nonuniformTransformCyclicPointPatchField<Type>& ptf, @@ -88,7 +84,7 @@ nonuniformTransformCyclicPointPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class Type> -void nonuniformTransformCyclicPointPatchField<Type>::evaluate +void Foam::nonuniformTransformCyclicPointPatchField<Type>::evaluate ( const Pstream::commsTypes ) @@ -106,12 +102,8 @@ void nonuniformTransformCyclicPointPatchField<Type>::evaluate // Get internal field to insert values into Field<Type>& iF = const_cast<Field<Type>&>(this->internalField()); - setInInternalField(iF, tvalues()); + this->setInInternalField(iF, tvalues()); } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/OpenFOAM/fields/pointPatchFields/constraint/processorCyclic/processorCyclicPointPatchField.C b/src/OpenFOAM/fields/pointPatchFields/constraint/processorCyclic/processorCyclicPointPatchField.C index 68a64544d7bd9cba5a7903400761cf46bfc94203..1c9ce086c59b2d1ba252d2a7247469f4529f5e2a 100644 --- a/src/OpenFOAM/fields/pointPatchFields/constraint/processorCyclic/processorCyclicPointPatchField.C +++ b/src/OpenFOAM/fields/pointPatchFields/constraint/processorCyclic/processorCyclicPointPatchField.C @@ -27,15 +27,11 @@ License #include "transformField.H" #include "processorPolyPatch.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class Type> -processorCyclicPointPatchField<Type>::processorCyclicPointPatchField +Foam::processorCyclicPointPatchField<Type>::processorCyclicPointPatchField ( const pointPatch& p, const DimensionedField<Type, pointMesh>& iF @@ -47,7 +43,7 @@ processorCyclicPointPatchField<Type>::processorCyclicPointPatchField template<class Type> -processorCyclicPointPatchField<Type>::processorCyclicPointPatchField +Foam::processorCyclicPointPatchField<Type>::processorCyclicPointPatchField ( const pointPatch& p, const DimensionedField<Type, pointMesh>& iF, @@ -60,7 +56,7 @@ processorCyclicPointPatchField<Type>::processorCyclicPointPatchField template<class Type> -processorCyclicPointPatchField<Type>::processorCyclicPointPatchField +Foam::processorCyclicPointPatchField<Type>::processorCyclicPointPatchField ( const processorCyclicPointPatchField<Type>& ptf, const pointPatch& p, @@ -74,7 +70,7 @@ processorCyclicPointPatchField<Type>::processorCyclicPointPatchField template<class Type> -processorCyclicPointPatchField<Type>::processorCyclicPointPatchField +Foam::processorCyclicPointPatchField<Type>::processorCyclicPointPatchField ( const processorCyclicPointPatchField<Type>& ptf, const DimensionedField<Type, pointMesh>& iF @@ -88,14 +84,14 @@ processorCyclicPointPatchField<Type>::processorCyclicPointPatchField // * * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * // template<class Type> -processorCyclicPointPatchField<Type>::~processorCyclicPointPatchField() +Foam::processorCyclicPointPatchField<Type>::~processorCyclicPointPatchField() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class Type> -void processorCyclicPointPatchField<Type>::initSwapAddSeparated +void Foam::processorCyclicPointPatchField<Type>::initSwapAddSeparated ( const Pstream::commsTypes commsType, Field<Type>& pField @@ -126,7 +122,7 @@ void processorCyclicPointPatchField<Type>::initSwapAddSeparated template<class Type> -void processorCyclicPointPatchField<Type>::swapAddSeparated +void Foam::processorCyclicPointPatchField<Type>::swapAddSeparated ( const Pstream::commsTypes commsType, Field<Type>& pField @@ -155,13 +151,9 @@ void processorCyclicPointPatchField<Type>::swapAddSeparated } // All points are separated - addToInternalField(pField, pnf); + this->addToInternalField(pField, pnf); } } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/OpenFOAM/fields/pointPatchFields/constraint/wedge/wedgePointPatchField.C b/src/OpenFOAM/fields/pointPatchFields/constraint/wedge/wedgePointPatchField.C index 05461c29f7b4dd999e2a352f54b72e9137ac0d96..5586869bcbe6ff539683460859fe4830622e058f 100644 --- a/src/OpenFOAM/fields/pointPatchFields/constraint/wedge/wedgePointPatchField.C +++ b/src/OpenFOAM/fields/pointPatchFields/constraint/wedge/wedgePointPatchField.C @@ -26,15 +26,11 @@ License #include "wedgePointPatchField.H" #include "transformField.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class Type> -wedgePointPatchField<Type>::wedgePointPatchField +Foam::wedgePointPatchField<Type>::wedgePointPatchField ( const pointPatch& p, const DimensionedField<Type, pointMesh>& iF @@ -45,7 +41,7 @@ wedgePointPatchField<Type>::wedgePointPatchField template<class Type> -wedgePointPatchField<Type>::wedgePointPatchField +Foam::wedgePointPatchField<Type>::wedgePointPatchField ( const pointPatch& p, const DimensionedField<Type, pointMesh>& iF, @@ -73,7 +69,7 @@ wedgePointPatchField<Type>::wedgePointPatchField template<class Type> -wedgePointPatchField<Type>::wedgePointPatchField +Foam::wedgePointPatchField<Type>::wedgePointPatchField ( const wedgePointPatchField<Type>& ptf, const pointPatch& p, @@ -104,7 +100,7 @@ wedgePointPatchField<Type>::wedgePointPatchField template<class Type> -wedgePointPatchField<Type>::wedgePointPatchField +Foam::wedgePointPatchField<Type>::wedgePointPatchField ( const wedgePointPatchField<Type>& ptf, const DimensionedField<Type, pointMesh>& iF @@ -117,7 +113,7 @@ wedgePointPatchField<Type>::wedgePointPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class Type> -void wedgePointPatchField<Type>::evaluate(const Pstream::commsTypes) +void Foam::wedgePointPatchField<Type>::evaluate(const Pstream::commsTypes) { // In order to ensure that the wedge patch is always flat, take the // normal vector from the first point @@ -129,12 +125,8 @@ void wedgePointPatchField<Type>::evaluate(const Pstream::commsTypes) // Get internal field to insert values into Field<Type>& iF = const_cast<Field<Type>&>(this->internalField()); - setInInternalField(iF, tvalues()); + this->setInInternalField(iF, tvalues()); } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/OpenFOAM/fields/pointPatchFields/derived/fixedNormalSlip/fixedNormalSlipPointPatchField.C b/src/OpenFOAM/fields/pointPatchFields/derived/fixedNormalSlip/fixedNormalSlipPointPatchField.C index 196ed0b817893935455a96f430d2ad2d766b8090..77fe4d5c1950ec3863fe34a78d567610b09a6e15 100644 --- a/src/OpenFOAM/fields/pointPatchFields/derived/fixedNormalSlip/fixedNormalSlipPointPatchField.C +++ b/src/OpenFOAM/fields/pointPatchFields/derived/fixedNormalSlip/fixedNormalSlipPointPatchField.C @@ -25,15 +25,10 @@ License #include "fixedNormalSlipPointPatchField.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class Type> -fixedNormalSlipPointPatchField<Type>::fixedNormalSlipPointPatchField +Foam::fixedNormalSlipPointPatchField<Type>::fixedNormalSlipPointPatchField ( const pointPatch& p, const DimensionedField<Type, pointMesh>& iF @@ -45,7 +40,7 @@ fixedNormalSlipPointPatchField<Type>::fixedNormalSlipPointPatchField template<class Type> -fixedNormalSlipPointPatchField<Type>::fixedNormalSlipPointPatchField +Foam::fixedNormalSlipPointPatchField<Type>::fixedNormalSlipPointPatchField ( const pointPatch& p, const DimensionedField<Type, pointMesh>& iF, @@ -58,7 +53,7 @@ fixedNormalSlipPointPatchField<Type>::fixedNormalSlipPointPatchField template<class Type> -fixedNormalSlipPointPatchField<Type>::fixedNormalSlipPointPatchField +Foam::fixedNormalSlipPointPatchField<Type>::fixedNormalSlipPointPatchField ( const fixedNormalSlipPointPatchField<Type>& ptf, const pointPatch& p, @@ -72,7 +67,7 @@ fixedNormalSlipPointPatchField<Type>::fixedNormalSlipPointPatchField template<class Type> -fixedNormalSlipPointPatchField<Type>::fixedNormalSlipPointPatchField +Foam::fixedNormalSlipPointPatchField<Type>::fixedNormalSlipPointPatchField ( const fixedNormalSlipPointPatchField<Type>& ptf, const DimensionedField<Type, pointMesh>& iF @@ -86,7 +81,10 @@ fixedNormalSlipPointPatchField<Type>::fixedNormalSlipPointPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class Type> -void fixedNormalSlipPointPatchField<Type>::evaluate(const Pstream::commsTypes) +void Foam::fixedNormalSlipPointPatchField<Type>::evaluate +( + const Pstream::commsTypes +) { tmp<Field<Type> > tvalues = transform(I - n_*n_, this->patchInternalField()); @@ -94,12 +92,12 @@ void fixedNormalSlipPointPatchField<Type>::evaluate(const Pstream::commsTypes) // Get internal field to insert values into Field<Type>& iF = const_cast<Field<Type>&>(this->internalField()); - setInInternalField(iF, tvalues()); + this->setInInternalField(iF, tvalues()); } template<class Type> -void fixedNormalSlipPointPatchField<Type>::write(Ostream& os) const +void Foam::fixedNormalSlipPointPatchField<Type>::write(Ostream& os) const { slipPointPatchField<Type>::write(os); os.writeKeyword("n") @@ -107,8 +105,4 @@ void fixedNormalSlipPointPatchField<Type>::write(Ostream& os) const } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.H index f7394f485007e64dba893bee9b6508aa042ba554..183c2edeac0e2848c7d122f0634b27b54981a601 100644 --- a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.H +++ b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.H @@ -501,80 +501,85 @@ const pointPatchField<Type>& operator+ #define makePointPatchTypeFieldTypeName(type) \ - \ -defineNamedTemplateTypeNameAndDebug(type, 0); + defineNamedTemplateTypeNameAndDebug(type, 0); + #define makePointPatchFieldsTypeName(type) \ - \ -makePointPatchTypeFieldTypeName(type##PointPatchScalarField); \ -makePointPatchTypeFieldTypeName(type##PointPatchVectorField); \ -makePointPatchTypeFieldTypeName(type##PointPatchSphericalTensorField); \ -makePointPatchTypeFieldTypeName(type##PointPatchSymmTensorField); \ -makePointPatchTypeFieldTypeName(type##PointPatchTensorField); + makePointPatchTypeFieldTypeName(type##PointPatchScalarField); \ + makePointPatchTypeFieldTypeName(type##PointPatchVectorField); \ + makePointPatchTypeFieldTypeName(type##PointPatchSphericalTensorField); \ + makePointPatchTypeFieldTypeName(type##PointPatchSymmTensorField); \ + makePointPatchTypeFieldTypeName(type##PointPatchTensorField); -#define makePointPatchTypeField(PatchTypeField, typePatchTypeField) \ - \ -defineNamedTemplateTypeNameAndDebug(typePatchTypeField, 0); \ - \ -addToRunTimeSelectionTable \ -( \ - PatchTypeField, typePatchTypeField, pointPatch \ -); \ - \ -addToRunTimeSelectionTable \ -( \ - PatchTypeField, \ - typePatchTypeField, \ - patchMapper \ -); \ + +#define addToPointPatchFieldRunTimeSelection(PatchTypeField, typePatchTypeField) \ \ -addToRunTimeSelectionTable \ -( \ - PatchTypeField, typePatchTypeField, dictionary \ -); + addToRunTimeSelectionTable \ + ( \ + PatchTypeField, \ + typePatchTypeField, \ + pointPatch \ + ); \ + addToRunTimeSelectionTable \ + ( \ + PatchTypeField, \ + typePatchTypeField, \ + patchMapper \ + ); \ + addToRunTimeSelectionTable \ + ( \ + PatchTypeField, \ + typePatchTypeField, \ + dictionary \ + ); + +// for non-templated patch fields +#define makeNonTemplatedPointPatchTypeField(PatchTypeField,typePatchTypeField)\ + defineTypeNameAndDebug(typePatchTypeField, 0); \ + addToPointPatchFieldRunTimeSelection(PatchTypeField, typePatchTypeField) + + +// for templated patch fields +#define makePointPatchTypeField(PatchTypeField, typePatchTypeField) \ + defineNamedTemplateTypeNameAndDebug(typePatchTypeField, 0); \ + addToPointPatchFieldRunTimeSelection(PatchTypeField, typePatchTypeField) #define makePointPatchFields(type) \ - \ -makePointPatchTypeField \ -( \ - pointPatchScalarField, \ - type##PointPatchScalarField \ -); \ - \ -makePointPatchTypeField \ -( \ - pointPatchVectorField, \ - type##PointPatchVectorField \ -); \ - \ -makePointPatchTypeField \ -( \ - pointPatchSphericalTensorField, \ - type##PointPatchSphericalTensorField \ -); \ - \ -makePointPatchTypeField \ -( \ - pointPatchSymmTensorField, \ - type##PointPatchSymmTensorField \ -); \ - \ -makePointPatchTypeField \ -( \ - pointPatchTensorField, \ - type##PointPatchTensorField \ + makePointPatchTypeField \ + ( \ + pointPatchScalarField, \ + type##PointPatchScalarField \ + ); \ + makePointPatchTypeField \ + ( \ + pointPatchVectorField, \ + type##PointPatchVectorField \ + ); \ + makePointPatchTypeField \ + ( \ + pointPatchSphericalTensorField, \ + type##PointPatchSphericalTensorField \ + ); \ + makePointPatchTypeField \ + ( \ + pointPatchSymmTensorField, \ + type##PointPatchSymmTensorField \ + ); \ + makePointPatchTypeField \ + ( \ + pointPatchTensorField, \ + type##PointPatchTensorField \ ); #define makePointPatchFieldTypedefs(type) \ - \ -typedef type##PointPatchField<scalar> type##PointPatchScalarField; \ -typedef type##PointPatchField<vector> type##PointPatchVectorField; \ -typedef type##PointPatchField<sphericalTensor> \ - type##PointPatchSphericalTensorField; \ -typedef type##PointPatchField<symmTensor> type##PointPatchSymmTensorField; \ -typedef type##PointPatchField<tensor> type##PointPatchTensorField; + typedef type##PointPatchField<scalar> type##PointPatchScalarField; \ + typedef type##PointPatchField<vector> type##PointPatchVectorField; \ + typedef type##PointPatchField<sphericalTensor> \ + type##PointPatchSphericalTensorField; \ + typedef type##PointPatchField<symmTensor> type##PointPatchSymmTensorField;\ + typedef type##PointPatchField<tensor> type##PointPatchTensorField; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/include/OSspecific.H b/src/OpenFOAM/include/OSspecific.H index 7b4c3a53209a3a516ea73ce68611420b3d6d5b3b..3ee759a5968e8639d9274421947399d9c786d4d0 100644 --- a/src/OpenFOAM/include/OSspecific.H +++ b/src/OpenFOAM/include/OSspecific.H @@ -68,7 +68,8 @@ string getEnv(const word&); bool setEnv(const word& name, const string& value, const bool overwrite); //- Return the system's host name -word hostName(); +// Optionally the full name reported from gethostbyname +word hostName(const bool full=false); //- Return the user's login name word userName(); diff --git a/src/OpenFOAM/interpolations/interpolationLookUpTable/interpolationLookUpTable.C b/src/OpenFOAM/interpolations/interpolationLookUpTable/interpolationLookUpTable.C index c4c1d1d65f62973ec210e115e8171f5db627d793..50652cc2a2662437144c73bca966a1b6542130d5 100644 --- a/src/OpenFOAM/interpolations/interpolationLookUpTable/interpolationLookUpTable.C +++ b/src/OpenFOAM/interpolations/interpolationLookUpTable/interpolationLookUpTable.C @@ -192,7 +192,7 @@ template<class Type> void Foam::interpolationLookUpTable<Type>::readTable ( const word& instance, - const fvMesh& mesh + const objectRegistry& obr ) { IOdictionary control @@ -201,7 +201,7 @@ void Foam::interpolationLookUpTable<Type>::readTable ( fileName_, instance, - mesh, + obr, IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) @@ -240,7 +240,7 @@ Foam::interpolationLookUpTable<Type>::interpolationLookUpTable ( const fileName& fn, const word& instance, - const fvMesh& mesh + const objectRegistry& obr ) : List<scalarField>(), @@ -255,7 +255,7 @@ Foam::interpolationLookUpTable<Type>::interpolationLookUpTable outputIndices_(0), interpOutput_(0) { - readTable(instance, mesh); + readTable(instance, obr); } @@ -341,7 +341,7 @@ void Foam::interpolationLookUpTable<Type>::write Ostream& os, const fileName& fn, const word& instance, - const fvMesh& mesh + const objectRegistry& obr ) const { IOdictionary control @@ -350,7 +350,7 @@ void Foam::interpolationLookUpTable<Type>::write ( fn, instance, - mesh, + obr, IOobject::NO_READ, IOobject::NO_WRITE ) diff --git a/src/OpenFOAM/interpolations/interpolationLookUpTable/interpolationLookUpTable.H b/src/OpenFOAM/interpolations/interpolationLookUpTable/interpolationLookUpTable.H index 59061f21c9daae0313726fdc5c992b22f85d7312..7dfde3de60725ec348bbeadbb245efec4142f77d 100644 --- a/src/OpenFOAM/interpolations/interpolationLookUpTable/interpolationLookUpTable.H +++ b/src/OpenFOAM/interpolations/interpolationLookUpTable/interpolationLookUpTable.H @@ -104,7 +104,7 @@ private: // Private Member Functions //- Read the table of data from file - void readTable(const word& instance, const fvMesh&); + void readTable(const word& instance, const objectRegistry&); //- Dimension table from dictionaries input and output void dimensionTable(); @@ -147,7 +147,7 @@ public: ( const fileName&, const word& instance, - const fvMesh& + const objectRegistry& ); //- Construct from dictionary @@ -171,7 +171,7 @@ public: Ostream&, const fileName&, const word& instance, - const fvMesh& + const objectRegistry& ) const; diff --git a/src/OpenFOAM/interpolations/primitivePatchInterpolation/PrimitivePatchInterpolation.C b/src/OpenFOAM/interpolations/primitivePatchInterpolation/PrimitivePatchInterpolation.C index ab1fbd10d518c6392c38b41bd56a9d59ffef2575..1af88ba7efabe38969338ee2ced7351a4adf02b6 100644 --- a/src/OpenFOAM/interpolations/primitivePatchInterpolation/PrimitivePatchInterpolation.C +++ b/src/OpenFOAM/interpolations/primitivePatchInterpolation/PrimitivePatchInterpolation.C @@ -318,8 +318,6 @@ tmp<Field<Type> > PrimitivePatchInterpolation<Patch>::faceToEdgeInterpolate Field<Type>& result = tresult(); - const pointField& points = patch_.localPoints(); - const faceList& faces = patch_.localFaces(); const edgeList& edges = patch_.edges(); const labelListList& edgeFaces = patch_.edgeFaces(); diff --git a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/processorLduInterfaceTemplates.C b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/processorLduInterfaceTemplates.C index 53afd8e3466ee2c10732c9978628b69ea83802df..6b227cc24cc8ccf17a4e3a9ec7e96f803247d60c 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/processorLduInterfaceTemplates.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/processorLduInterfaceTemplates.C @@ -150,7 +150,7 @@ void Foam::processorLduInterface::compressedSend fArray[i] = sArray[i] - slast[i%nCmpts]; } - reinterpret_cast<Type&>(fArray[nm1]) = f[f.size() - 1]; + reinterpret_cast<Type&>(fArray[nm1]) = f.last(); if (commsType == Pstream::blocking || commsType == Pstream::scheduled) { @@ -235,7 +235,7 @@ void Foam::processorLduInterface::compressedReceive const float *fArray = reinterpret_cast<const float*>(receiveBuf_.begin()); - f[f.size() - 1] = reinterpret_cast<const Type&>(fArray[nm1]); + f.last() = reinterpret_cast<const Type&>(fArray[nm1]); scalar *sArray = reinterpret_cast<scalar*>(f.begin()); const scalar *slast = &sArray[nm1]; diff --git a/src/OpenFOAM/meshes/MeshObject/MeshObject.C b/src/OpenFOAM/meshes/MeshObject/MeshObject.C index 4950476a241dbe9e5e1454fbfc37055a937ff070..e9eac11a326edc08ce291aeac097c0238ec7c06c 100644 --- a/src/OpenFOAM/meshes/MeshObject/MeshObject.C +++ b/src/OpenFOAM/meshes/MeshObject/MeshObject.C @@ -52,13 +52,22 @@ const Type& Foam::MeshObject<Mesh, Type>::New const Mesh& mesh ) { - if (!mesh.thisDb().objectRegistry::foundObject<Type>(Type::typeName)) + if + ( + mesh.thisDb().objectRegistry::template foundObject<Type> + ( + Type::typeName + ) + ) { - return store(new Type(mesh)); + return mesh.thisDb().objectRegistry::template lookupObject<Type> + ( + Type::typeName + ); } else { - return mesh.thisDb().objectRegistry::lookupObject<Type>(Type::typeName); + return store(new Type(mesh)); } } @@ -71,13 +80,22 @@ const Type& Foam::MeshObject<Mesh, Type>::New const Data1& d ) { - if (!mesh.thisDb().objectRegistry::foundObject<Type>(Type::typeName)) + if + ( + mesh.thisDb().objectRegistry::template foundObject<Type> + ( + Type::typeName + ) + ) { - return store(new Type(mesh, d)); + return mesh.thisDb().objectRegistry::template lookupObject<Type> + ( + Type::typeName + ); } else { - return mesh.thisDb().objectRegistry::lookupObject<Type>(Type::typeName); + return store(new Type(mesh, d)); } } @@ -91,13 +109,22 @@ const Type& Foam::MeshObject<Mesh, Type>::New const Data2& d2 ) { - if (!mesh.thisDb().objectRegistry::foundObject<Type>(Type::typeName)) + if + ( + mesh.thisDb().objectRegistry::template foundObject<Type> + ( + Type::typeName + ) + ) { - return store(new Type(mesh, d1, d2)); + return mesh.thisDb().objectRegistry::template lookupObject<Type> + ( + Type::typeName + ); } else { - return mesh.thisDb().objectRegistry::lookupObject<Type>(Type::typeName); + return store(new Type(mesh, d1, d2)); } } @@ -112,13 +139,22 @@ const Type& Foam::MeshObject<Mesh, Type>::New const Data3& d3 ) { - if (!mesh.thisDb().objectRegistry::foundObject<Type>(Type::typeName)) + if + ( + mesh.thisDb().objectRegistry::template foundObject<Type> + ( + Type::typeName + ) + ) { - return store(new Type(mesh, d1, d2, d3)); + return mesh.thisDb().objectRegistry::template lookupObject<Type> + ( + Type::typeName + ); } else { - return mesh.thisDb().objectRegistry::lookupObject<Type>(Type::typeName); + return store(new Type(mesh, d1, d2, d3)); } } @@ -134,13 +170,22 @@ const Type& Foam::MeshObject<Mesh, Type>::New const Data4& d4 ) { - if (!mesh.thisDb().objectRegistry::foundObject<Type>(Type::typeName)) + if + ( + mesh.thisDb().objectRegistry::template foundObject<Type> + ( + Type::typeName + ) + ) { - return store(new Type(mesh, d1, d2, d3, d4)); + return mesh.thisDb().objectRegistry::template lookupObject<Type> + ( + Type::typeName + ); } else { - return mesh.thisDb().objectRegistry::lookupObject<Type>(Type::typeName); + return store(new Type(mesh, d1, d2, d3, d4)); } } @@ -150,13 +195,19 @@ const Type& Foam::MeshObject<Mesh, Type>::New template<class Mesh, class Type> bool Foam::MeshObject<Mesh, Type>::Delete(const Mesh& mesh) { - if (mesh.thisDb().objectRegistry::foundObject<Type>(Type::typeName)) + if + ( + mesh.thisDb().objectRegistry::template foundObject<Type> + ( + Type::typeName + ) + ) { return mesh.thisDb().checkOut ( const_cast<Type&> ( - mesh.thisDb().objectRegistry::lookupObject<Type> + mesh.thisDb().objectRegistry::template lookupObject<Type> ( Type::typeName ) diff --git a/src/OpenFOAM/meshes/boundBox/boundBox.C b/src/OpenFOAM/meshes/boundBox/boundBox.C index 977d0add12e9ee0fe49c4bc688265efc9a8dbbcb..66152f378b919533152b7b388361c7e17c69e40a 100644 --- a/src/OpenFOAM/meshes/boundBox/boundBox.C +++ b/src/OpenFOAM/meshes/boundBox/boundBox.C @@ -47,7 +47,7 @@ const Foam::boundBox Foam::boundBox::invertedBox // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -void Foam::boundBox::calculate(const pointField& points, const bool doReduce) +void Foam::boundBox::calculate(const UList<point>& points, const bool doReduce) { if (points.empty()) { @@ -84,7 +84,7 @@ void Foam::boundBox::calculate(const pointField& points, const bool doReduce) // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::boundBox::boundBox(const pointField& points, const bool doReduce) +Foam::boundBox::boundBox(const UList<point>& points, const bool doReduce) : min_(point::zero), max_(point::zero) @@ -103,9 +103,43 @@ Foam::boundBox::boundBox(const tmp<pointField>& points, const bool doReduce) } -Foam::boundBox::boundBox(Istream& is) +Foam::boundBox::boundBox +( + const UList<point>& points, + const labelUList& indices, + const bool doReduce +) +: + min_(point::zero), + max_(point::zero) { - operator>>(is, *this); + if (points.empty() || indices.empty()) + { + if (doReduce && Pstream::parRun()) + { + // Use values that get overwritten by reduce minOp, maxOp below + min_ = point(VGREAT, VGREAT, VGREAT); + max_ = point(-VGREAT, -VGREAT, -VGREAT); + } + } + else + { + min_ = points[indices[0]]; + max_ = points[indices[0]]; + + for (label i=1; i < indices.size(); ++i) + { + min_ = ::Foam::min(min_, points[indices[i]]); + max_ = ::Foam::max(max_, points[indices[i]]); + } + } + + // Reduce parallel information + if (doReduce) + { + reduce(min_, minOp<point>()); + reduce(max_, maxOp<point>()); + } } @@ -129,6 +163,90 @@ Foam::tmp<Foam::pointField> Foam::boundBox::points() const } +bool Foam::boundBox::contains(const UList<point>& points) const +{ + if (points.empty()) + { + return true; + } + + forAll(points, i) + { + if (!contains(points[i])) + { + return false; + } + } + + return true; +} + + +bool Foam::boundBox::contains +( + const UList<point>& points, + const labelUList& indices +) const +{ + if (points.empty() || indices.empty()) + { + return true; + } + + forAll(indices, i) + { + if (!contains(points[indices[i]])) + { + return false; + } + } + + return true; +} + + +bool Foam::boundBox::containsAny(const UList<point>& points) const +{ + if (points.empty()) + { + return true; + } + + forAll(points, i) + { + if (contains(points[i])) + { + return true; + } + } + + return false; +} + + +bool Foam::boundBox::containsAny +( + const UList<point>& points, + const labelUList& indices +) const +{ + if (points.empty() || indices.empty()) + { + return true; + } + + forAll(indices, i) + { + if (contains(points[indices[i]])) + { + return true; + } + } + + return false; +} + + // * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // Foam::Ostream& Foam::operator<<(Ostream& os, const boundBox& bb) @@ -172,4 +290,5 @@ Foam::Istream& Foam::operator>>(Istream& is, boundBox& bb) return is; } + // ************************************************************************* // diff --git a/src/OpenFOAM/meshes/boundBox/boundBox.H b/src/OpenFOAM/meshes/boundBox/boundBox.H index 0c110b85097a1edf424da93268d0ee6c0be00b38..e424d18844b55626fbee06056ba614a141cb49b9 100644 --- a/src/OpenFOAM/meshes/boundBox/boundBox.H +++ b/src/OpenFOAM/meshes/boundBox/boundBox.H @@ -44,7 +44,8 @@ namespace Foam class boundBox; template<class T> class tmp; -Ostream& operator<<(Ostream& os, const boundBox& b); +Istream& operator>>(Istream&, boundBox&); +Ostream& operator<<(Ostream&, const boundBox&); /*---------------------------------------------------------------------------*\ @@ -60,9 +61,9 @@ class boundBox // Private Member Functions - //- Calculate the bounding box from the given pointField. + //- Calculate the bounding box from the given points. // Does parallel communication (doReduce = true) - void calculate(const pointField&, const bool doReduce = true); + void calculate(const UList<point>&, const bool doReduce = true); public: @@ -81,29 +82,42 @@ public: // Constructors //- Construct null, setting points to zero - boundBox() - : - min_(point::zero), - max_(point::zero) - {} + inline boundBox(); //- Construct from components - boundBox(const point& min, const point& max) - : - min_(min), - max_(max) - {} + inline boundBox(const point& min, const point& max); - //- Construct as the bounding box of the given pointField. + //- Construct as the bounding box of the given points // Does parallel communication (doReduce = true) - boundBox(const pointField&, const bool doReduce = true); + boundBox(const UList<point>&, const bool doReduce = true); //- Construct as the bounding box of the given temporary pointField. // Does parallel communication (doReduce = true) boundBox(const tmp<pointField>&, const bool doReduce = true); + //- Construct bounding box as subset of the pointField. + // The indices could be from cell/face etc. + // Does parallel communication (doReduce = true) + boundBox + ( + const UList<point>&, + const labelUList& indices, + const bool doReduce = true + ); + + //- Construct bounding box as subset of the pointField. + // The indices could be from edge/triFace etc. + // Does parallel communication (doReduce = true) + template<unsigned Size> + boundBox + ( + const UList<point>&, + const FixedList<label, Size>& indices, + const bool doReduce = true + ); + //- Construct from Istream - boundBox(Istream&); + inline boundBox(Istream&); // Member functions @@ -111,70 +125,37 @@ public: // Access //- Minimum describing the bounding box - const point& min() const - { - return min_; - } + inline const point& min() const; //- Maximum describing the bounding box - const point& max() const - { - return max_; - } + inline const point& max() const; //- Minimum describing the bounding box, non-const access - point& min() - { - return min_; - } + inline point& min(); //- Maximum describing the bounding box, non-const access - point& max() - { - return max_; - } + inline point& max(); //- The midpoint of the bounding box - point midpoint() const - { - return 0.5 * (max_ + min_); - } + inline point midpoint() const; //- The bounding box span (from minimum to maximum) - vector span() const - { - return (max_ - min_); - } + inline vector span() const; //- The magnitude of the bounding box span - scalar mag() const - { - return ::Foam::mag(max_ - min_); - } + inline scalar mag() const; //- The volume of the bound box - scalar volume() const - { - return cmptProduct(span()); - } + inline scalar volume() const; //- Smallest length/height/width dimension - scalar minDim() const - { - return cmptMin(span()); - } + inline scalar minDim() const; //- Largest length/height/width dimension - scalar maxDim() const - { - return cmptMax(span()); - } + inline scalar maxDim() const; //- Average length/height/width dimension - scalar avgDim() const - { - return cmptAv(span()); - } + inline scalar avgDim() const; //- Return corner points in an order corresponding to a 'hex' cell tmp<pointField> points() const; @@ -182,56 +163,65 @@ public: // Query //- Overlaps/touches boundingBox? - bool overlaps(const boundBox& bb) const - { - return - ( - bb.max_.x() >= min_.x() && bb.min_.x() <= max_.x() - && bb.max_.y() >= min_.y() && bb.min_.y() <= max_.y() - && bb.max_.z() >= min_.z() && bb.min_.z() <= max_.z() - ); - } + inline bool overlaps(const boundBox&) const; //- Contains point? (inside or on edge) - bool contains(const point& pt) const - { - return - ( - pt.x() >= min_.x() && pt.x() <= max_.x() - && pt.y() >= min_.y() && pt.y() <= max_.y() - && pt.z() >= min_.z() && pt.z() <= max_.z() - ); - } + inline bool contains(const point&) const; + + //- Fully contains other boundingBox? + inline bool contains(const boundBox&) const; //- Contains point? (inside only) - bool containsInside(const point& pt) const - { - return - ( - pt.x() > min_.x() && pt.x() < max_.x() - && pt.y() > min_.y() && pt.y() < max_.y() - && pt.z() > min_.z() && pt.z() < max_.z() - ); - } + inline bool containsInside(const point&) const; + + //- Contains all of the points? (inside or on edge) + bool contains(const UList<point>&) const; + + //- Contains all of the points? (inside or on edge) + bool contains + ( + const UList<point>&, + const labelUList& indices + ) const; + + //- Contains all of the points? (inside or on edge) + template<unsigned Size> + bool contains + ( + const UList<point>&, + const FixedList<label, Size>& indices + ) const; + + + //- Contains any of the points? (inside or on edge) + bool containsAny(const UList<point>&) const; + + //- Contains any of the points? (inside or on edge) + bool containsAny + ( + const UList<point>&, + const labelUList& indices + ) const; + + //- Contains any of the points? (inside or on edge) + template<unsigned Size> + bool containsAny + ( + const UList<point>&, + const FixedList<label, Size>& indices + ) const; // Friend Operators - friend bool operator==(const boundBox& a, const boundBox& b) - { - return (a.min_ == b.min_) && (a.max_ == b.max_); - } - - friend bool operator!=(const boundBox& a, const boundBox& b) - { - return !(a == b); - } + inline friend bool operator==(const boundBox&, const boundBox&); + inline friend bool operator!=(const boundBox&, const boundBox&); // IOstream operator - friend Istream& operator>>(Istream& is, boundBox&); - friend Ostream& operator<<(Ostream& os, const boundBox&); + friend Istream& operator>>(Istream&, boundBox&); + friend Ostream& operator<<(Ostream&, const boundBox&); }; @@ -244,7 +234,11 @@ inline bool contiguous<boundBox>() {return contiguous<point>();} } // End namespace Foam -// #include "boundBoxI.H" +#include "boundBoxI.H" + +#ifdef NoRepository +# include "boundBoxTemplates.C" +#endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/meshes/boundBox/boundBoxI.H b/src/OpenFOAM/meshes/boundBox/boundBoxI.H new file mode 100644 index 0000000000000000000000000000000000000000..51e75d41a558123ec400e7c948ad0430787ef507 --- /dev/null +++ b/src/OpenFOAM/meshes/boundBox/boundBoxI.H @@ -0,0 +1,174 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "boundBox.H" +#include "pointField.H" + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +inline Foam::boundBox::boundBox() +: + min_(point::zero), + max_(point::zero) +{} + + +inline Foam::boundBox::boundBox(const point& min, const point& max) +: + min_(min), + max_(max) +{} + + +inline Foam::boundBox::boundBox(Istream& is) +{ + operator>>(is, *this); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +inline const Foam::point& Foam::boundBox::min() const +{ + return min_; +} + + +inline const Foam::point& Foam::boundBox::max() const +{ + return max_; +} + + +inline Foam::point& Foam::boundBox::min() +{ + return min_; +} + + +inline Foam::point& Foam::boundBox::max() +{ + return max_; +} + + +inline Foam::point Foam::boundBox::midpoint() const +{ + return 0.5 * (max_ + min_); +} + + +inline Foam::vector Foam::boundBox::span() const +{ + return (max_ - min_); +} + + +inline Foam::scalar Foam::boundBox::mag() const +{ + return ::Foam::mag(max_ - min_); +} + + +inline Foam::scalar Foam::boundBox::volume() const +{ + return cmptProduct(span()); +} + + +inline Foam::scalar Foam::boundBox::minDim() const +{ + return cmptMin(span()); +} + + +inline Foam::scalar Foam::boundBox::maxDim() const +{ + return cmptMax(span()); +} + + +inline Foam::scalar Foam::boundBox::avgDim() const +{ + return cmptAv(span()); +} + + +inline bool Foam::boundBox::overlaps(const boundBox& bb) const +{ + return + ( + bb.max_.x() >= min_.x() && bb.min_.x() <= max_.x() + && bb.max_.y() >= min_.y() && bb.min_.y() <= max_.y() + && bb.max_.z() >= min_.z() && bb.min_.z() <= max_.z() + ); +} + + +inline bool Foam::boundBox::contains(const point& pt) const +{ + return + ( + pt.x() >= min_.x() && pt.x() <= max_.x() + && pt.y() >= min_.y() && pt.y() <= max_.y() + && pt.z() >= min_.z() && pt.z() <= max_.z() + ); +} + + +// this.bb fully contains bb +inline bool Foam::boundBox::contains(const boundBox& bb) const +{ + return contains(bb.min()) && contains(bb.max()); +} + + +inline bool Foam::boundBox::containsInside(const point& pt) const +{ + return + ( + pt.x() > min_.x() && pt.x() < max_.x() + && pt.y() > min_.y() && pt.y() < max_.y() + && pt.z() > min_.z() && pt.z() < max_.z() + ); +} + + +// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // + +inline bool Foam::operator==(const boundBox& a, const boundBox& b) +{ + return (a.min_ == b.min_) && (a.max_ == b.max_); +} + + +inline bool Foam::operator!=(const boundBox& a, const boundBox& b) +{ + return !(a == b); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/meshes/boundBox/boundBoxTemplates.C b/src/OpenFOAM/meshes/boundBox/boundBoxTemplates.C new file mode 100644 index 0000000000000000000000000000000000000000..1ca2f9929d70b0d6ed1e052df0e570116913871d --- /dev/null +++ b/src/OpenFOAM/meshes/boundBox/boundBoxTemplates.C @@ -0,0 +1,127 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "boundBox.H" +#include "FixedList.H" +#include "PstreamReduceOps.H" + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<unsigned Size> +Foam::boundBox::boundBox +( + const UList<point>& points, + const FixedList<label, Size>& indices, + const bool doReduce +) +: + min_(point::zero), + max_(point::zero) +{ + // a FixedList is never empty + if (points.empty()) + { + if (doReduce && Pstream::parRun()) + { + // Use values that get overwritten by reduce minOp, maxOp below + min_ = point(VGREAT, VGREAT, VGREAT); + max_ = point(-VGREAT, -VGREAT, -VGREAT); + } + } + else + { + min_ = points[indices[0]]; + max_ = points[indices[0]]; + + for (unsigned i=1; i < Size; ++i) + { + min_ = ::Foam::min(min_, points[indices[i]]); + max_ = ::Foam::max(max_, points[indices[i]]); + } + } + + // Reduce parallel information + if (doReduce) + { + reduce(min_, minOp<point>()); + reduce(max_, maxOp<point>()); + } +} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +template<unsigned Size> +bool Foam::boundBox::contains +( + const UList<point>& points, + const FixedList<label, Size>& indices +) const +{ + // a FixedList is never empty + if (points.empty()) + { + return false; + } + + forAll(indices, i) + { + if (!contains(points[indices[i]])) + { + return false; + } + } + + return true; +} + + +template<unsigned Size> +bool Foam::boundBox::containsAny +( + const UList<point>& points, + const FixedList<label, Size>& indices +) const +{ + // a FixedList is never empty + if (points.empty()) + { + return false; + } + + forAll(indices, i) + { + if (contains(points[indices[i]])) + { + return true; + } + } + + return false; +} + + +// ************************************************************************* // diff --git a/src/OpenFOAM/meshes/meshShapes/cell/cell.C b/src/OpenFOAM/meshes/meshShapes/cell/cell.C index fbfd7348ad5dfa4bc5d6499d1ab650d645d57b3f..e633ff73a4b733da36d3a24290b4a450e7444a35 100644 --- a/src/OpenFOAM/meshes/meshShapes/cell/cell.C +++ b/src/OpenFOAM/meshes/meshShapes/cell/cell.C @@ -32,7 +32,7 @@ const char* const Foam::cell::typeName = "cell"; // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::labelList Foam::cell::labels(const unallocFaceList& f) const +Foam::labelList Foam::cell::labels(const faceUList& f) const { // return the unordered list of vertex labels supporting the cell @@ -100,7 +100,7 @@ Foam::labelList Foam::cell::labels(const unallocFaceList& f) const Foam::pointField Foam::cell::points ( - const unallocFaceList& f, + const faceUList& f, const pointField& meshPoints ) const { @@ -117,7 +117,7 @@ Foam::pointField Foam::cell::points } -Foam::edgeList Foam::cell::edges(const unallocFaceList& f) const +Foam::edgeList Foam::cell::edges(const faceUList& f) const { // return the lisf of cell edges @@ -172,7 +172,7 @@ Foam::edgeList Foam::cell::edges(const unallocFaceList& f) const Foam::point Foam::cell::centre ( const pointField& p, - const unallocFaceList& f + const faceUList& f ) const { // When one wants to access the cell centre and magnitude, the @@ -238,7 +238,7 @@ Foam::point Foam::cell::centre Foam::scalar Foam::cell::mag ( const pointField& p, - const unallocFaceList& f + const faceUList& f ) const { // When one wants to access the cell centre and magnitude, the diff --git a/src/OpenFOAM/meshes/meshShapes/cell/cell.H b/src/OpenFOAM/meshes/meshShapes/cell/cell.H index 099456d8042617a0bd9594e62b846e5176968025..808701bc32cbc17b5d305bd0ff0b9d1009b6d763 100644 --- a/src/OpenFOAM/meshes/meshShapes/cell/cell.H +++ b/src/OpenFOAM/meshes/meshShapes/cell/cell.H @@ -90,26 +90,26 @@ public: inline label nFaces() const; //- Return labels of cell vertices - labelList labels(const unallocFaceList&) const; + labelList labels(const faceUList&) const; //- Return the cell vertices - pointField points(const unallocFaceList&, const pointField&) const; + pointField points(const faceUList&, const pointField&) const; //- Return cell edges - edgeList edges(const unallocFaceList&) const; + edgeList edges(const faceUList&) const; //- Return index of opposite face label opposingFaceLabel ( const label masterFaceLabel, - const unallocFaceList& meshFaces + const faceUList& meshFaces ) const; //- Return opposite face oriented the same way as the master face oppositeFace opposingFace ( const label masterFaceLabel, - const unallocFaceList& meshFaces + const faceUList& meshFaces ) const; @@ -122,10 +122,10 @@ public: // future. //- Returns cell centre - point centre(const pointField&, const unallocFaceList&) const; + point centre(const pointField&, const faceUList&) const; //- Returns cell volume - scalar mag(const pointField&, const unallocFaceList&) const; + scalar mag(const pointField&, const faceUList&) const; // Friend Operators diff --git a/src/OpenFOAM/meshes/meshShapes/cell/oppositeCellFace.C b/src/OpenFOAM/meshes/meshShapes/cell/oppositeCellFace.C index 3710aba551813a3b9b4e23a369c71f9a4853d02b..118aa621f2b09d5b4018338eea565d8823946ec0 100644 --- a/src/OpenFOAM/meshes/meshShapes/cell/oppositeCellFace.C +++ b/src/OpenFOAM/meshes/meshShapes/cell/oppositeCellFace.C @@ -39,7 +39,7 @@ Description Foam::label Foam::cell::opposingFaceLabel ( const label masterFaceLabel, - const unallocFaceList& meshFaces + const faceUList& meshFaces ) const { // Algorithm: @@ -114,7 +114,7 @@ Foam::label Foam::cell::opposingFaceLabel Foam::oppositeFace Foam::cell::opposingFace ( const label masterFaceLabel, - const unallocFaceList& meshFaces + const faceUList& meshFaces ) const { // Get the label of the opposite face diff --git a/src/OpenFOAM/meshes/meshShapes/edge/edge.H b/src/OpenFOAM/meshes/meshShapes/edge/edge.H index f5dc17ff51175bfaab271cead8190dec7413b9b5..c393279cc1e4deaa3889958242a4488e64bf5508 100644 --- a/src/OpenFOAM/meshes/meshShapes/edge/edge.H +++ b/src/OpenFOAM/meshes/meshShapes/edge/edge.H @@ -103,6 +103,9 @@ public: //- Return common vertex inline label commonVertex(const edge& a) const; + //- Flip the edge in-place. + inline void flip(); + //- Return reverse edge inline edge reverseEdge() const; diff --git a/src/OpenFOAM/meshes/meshShapes/edge/edgeI.H b/src/OpenFOAM/meshes/meshShapes/edge/edgeI.H index 5b51c71c4af0d4fb081050300873b7399585a49c..cc2ddc329e533dec90d0a558095e7afa07396b15 100644 --- a/src/OpenFOAM/meshes/meshShapes/edge/edgeI.H +++ b/src/OpenFOAM/meshes/meshShapes/edge/edgeI.H @@ -24,6 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "IOstreams.H" +#include "Swap.H" // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * // @@ -135,6 +136,12 @@ inline Foam::label Foam::edge::commonVertex(const edge& a) const } +inline void Foam::edge::flip() +{ + Swap(operator[](0), operator[](1)); +} + + inline Foam::edge Foam::edge::reverseEdge() const { return edge(end(), start()); diff --git a/src/OpenFOAM/meshes/meshShapes/face/face.C b/src/OpenFOAM/meshes/meshShapes/face/face.C index eb9c375ccda1424eafa1d6bae76297a846542038..b478c03a27fd2110adfc664e3924ae84824e3a54 100644 --- a/src/OpenFOAM/meshes/meshShapes/face/face.C +++ b/src/OpenFOAM/meshes/meshShapes/face/face.C @@ -27,11 +27,13 @@ License #include "triFace.H" #include "triPointRef.H" #include "mathematicalConstants.H" +#include "Swap.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // const char* const Foam::face::typeName = "face"; + // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // Foam::tmp<Foam::vectorField> @@ -475,6 +477,20 @@ Foam::label Foam::face::collapse() } +void Foam::face::flip() +{ + const label n = size(); + + if (n > 2) + { + for (label i=1; i < (n+1)/2; ++i) + { + Swap(operator[](i), operator[](n-i)); + } + } +} + + Foam::point Foam::face::centre(const pointField& meshPoints) const { // Calculate the centre by breaking the face into triangles and @@ -618,19 +634,17 @@ Foam::face Foam::face::reverseFace() const Foam::label Foam::face::which(const label globalIndex) const { - label pointInFace = -1; const labelList& f = *this; - forAll(f, i) + forAll(f, localIdx) { - if (f[i] == globalIndex) + if (f[localIdx] == globalIndex) { - pointInFace = i; - break; + return localIdx; } } - return pointInFace; + return -1; } @@ -654,9 +668,7 @@ Foam::scalar Foam::face::sweptVol point nextOldPoint = centreOldPoint; point nextNewPoint = centreNewPoint; - register label pI; - - for (pI = 0; pI < nPoints; pI++) + for (register label pI = 0; pI < nPoints; ++pI) { if (pI < nPoints - 1) { @@ -708,20 +720,18 @@ Foam::tensor Foam::face::inertia ).inertia(refPt, density); } - point c = centre(p); + const point ctr = centre(p); tensor J = tensor::zero; forAll(*this, i) { - triPointRef t + J += triPointRef ( p[operator[](i)], p[operator[](fcIndex(i))], - c - ); - - J += t.inertia(refPt, density); + ctr + ).inertia(refPt, density); } return J; @@ -734,15 +744,13 @@ Foam::edgeList Foam::face::edges() const edgeList e(points.size()); - label pointI; - - for (pointI = 0; pointI < points.size() - 1; pointI++) + for (label pointI = 0; pointI < points.size() - 1; ++pointI) { e[pointI] = edge(points[pointI], points[pointI + 1]); } // add last edge - e[points.size() - 1] = edge(points[points.size() - 1], points[0]); + e.last() = edge(points.last(), points[0]); return e; } @@ -839,9 +847,4 @@ Foam::label Foam::face::trianglesQuads } -// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - // ************************************************************************* // diff --git a/src/OpenFOAM/meshes/meshShapes/face/face.H b/src/OpenFOAM/meshes/meshShapes/face/face.H index 2b96610fca6bfb71e5c1f62d5996508eee486382..9ac1e8bdc96c19386bdc94a32b166152a940be22 100644 --- a/src/OpenFOAM/meshes/meshShapes/face/face.H +++ b/src/OpenFOAM/meshes/meshShapes/face/face.H @@ -27,12 +27,16 @@ Class Description A face is a list of labels corresponding to mesh vertices. +SeeAlso + Foam::triFace + SourceFiles faceI.H face.C faceIntersection.C faceContactSphere.C faceAreaInContact.C + faceTemplates.C \*---------------------------------------------------------------------------*/ @@ -169,6 +173,10 @@ public: // return the collapsed size label collapse(); + //- Flip the face in-place. + // The starting points of the original and flipped face are identical. + void flip(); + //- Return the points corresponding to this face inline pointField points(const pointField& meshPoints) const; @@ -186,11 +194,13 @@ public: vector normal(const pointField&) const; //- Return face with reverse direction + // The starting points of the original and reverse face are identical. face reverseFace() const; //- Navigation through face vertices //- Which vertex on face (face index given a global index) + // returns -1 if not found label which(const label globalIndex) const; //- Next vertex on face @@ -289,8 +299,8 @@ public: //- Return number of edges inline label nEdges() const; - //- Return edges in face point ordering, i.e. edges()[0] is edge - // between [0] and [1] + //- Return edges in face point ordering, + // i.e. edges()[0] is edge between [0] and [1] edgeList edges() const; //- Return n-th face edge diff --git a/src/OpenFOAM/meshes/meshShapes/face/faceI.H b/src/OpenFOAM/meshes/meshShapes/face/faceI.H index 165a11fd1a660b9d3904e802590fa268a6634272..9666e6a13bd7f027bd397fa0a4b7abeeb1b4c693 100644 --- a/src/OpenFOAM/meshes/meshShapes/face/faceI.H +++ b/src/OpenFOAM/meshes/meshShapes/face/faceI.H @@ -35,7 +35,7 @@ inline Foam::label Foam::face::right(const label i) const // Edge to the left of face vertex i inline Foam::label Foam::face::left(const label i) const { - return i ? i-1 : size()-1; + return rcIndex(i); } diff --git a/src/OpenFOAM/meshes/meshShapes/face/faceIntersection.C b/src/OpenFOAM/meshes/meshShapes/face/faceIntersection.C index f9f02eb61293307a29975ff878f75ffaef138ec0..4df16db7817bda46eff27a94333313577d090b51 100644 --- a/src/OpenFOAM/meshes/meshShapes/face/faceIntersection.C +++ b/src/OpenFOAM/meshes/meshShapes/face/faceIntersection.C @@ -21,9 +21,6 @@ License You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. -Description - Return intersection of a line with the face - \*---------------------------------------------------------------------------*/ #include "face.H" @@ -51,6 +48,17 @@ Foam::pointHit Foam::face::ray const intersection::direction dir ) const { + // If the face is a triangle, do a direct calculation + if (size() == 3) + { + return triPointRef + ( + meshPoints[operator[](0)], + meshPoints[operator[](1)], + meshPoints[operator[](2)] + ).ray(p, n, alg, dir); + } + point ctr = Foam::average(points(meshPoints)); scalar nearestHitDist = GREAT; @@ -139,6 +147,17 @@ Foam::pointHit Foam::face::intersection const scalar tol ) const { + // If the face is a triangle, do a direct calculation + if (size() == 3) + { + return triPointRef + ( + meshPoints[operator[](0)], + meshPoints[operator[](1)], + meshPoints[operator[](2)] + ).intersection(p, q, alg, tol); + } + scalar nearestHitDist = VGREAT; // Initialize to miss, distance = GREAT @@ -198,6 +217,17 @@ Foam::pointHit Foam::face::nearestPointClassify label& nearLabel ) const { + // If the face is a triangle, do a direct calculation + if (size() == 3) + { + return triPointRef + ( + meshPoints[operator[](0)], + meshPoints[operator[](1)], + meshPoints[operator[](2)] + ).nearestPointClassify(p, nearType, nearLabel); + } + const face& f = *this; point ctr = centre(meshPoints); diff --git a/src/OpenFOAM/meshes/meshShapes/face/faceListFwd.H b/src/OpenFOAM/meshes/meshShapes/face/faceListFwd.H index dea998508556edae2f8657bcd6b979cc1a4dcf5a..66726744a1c627090564d13fb932c7e6e6894ad2 100644 --- a/src/OpenFOAM/meshes/meshShapes/face/faceListFwd.H +++ b/src/OpenFOAM/meshes/meshShapes/face/faceListFwd.H @@ -39,10 +39,12 @@ Description namespace Foam { class face; - typedef UList<face> unallocFaceList; + typedef UList<face> faceUList; typedef List<face> faceList; typedef SubList<face> faceSubList; typedef List<faceList> faceListList; + // same as faceUList: + typedef UList<face> unallocFaceList; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/meshes/meshShapes/face/faceTemplates.C b/src/OpenFOAM/meshes/meshShapes/face/faceTemplates.C index 24cfe1d4e638cc50648f1ce820eb7ff2f668f3a4..ae072ea9eaf3fdcc148df067b4190c05f07b3560 100644 --- a/src/OpenFOAM/meshes/meshShapes/face/faceTemplates.C +++ b/src/OpenFOAM/meshes/meshShapes/face/faceTemplates.C @@ -50,7 +50,7 @@ template<class Type> Type Foam::face::average ( const pointField& meshPoints, - const Field<Type>& f + const Field<Type>& fld ) const { // Calculate the average by breaking the face into triangles and @@ -62,9 +62,9 @@ Type Foam::face::average return (1.0/3.0) *( - f[operator[](0)] - + f[operator[](1)] - + f[operator[](2)] + fld[operator[](0)] + + fld[operator[](1)] + + fld[operator[](2)] ); } @@ -76,7 +76,7 @@ Type Foam::face::average for (register label pI=0; pI<nPoints; pI++) { centrePoint += meshPoints[operator[](pI)]; - cf += f[operator[](pI)]; + cf += fld[operator[](pI)]; } centrePoint /= nPoints; @@ -90,8 +90,8 @@ Type Foam::face::average // Calculate 3*triangle centre field value Type ttcf = ( - f[operator[](pI)] - + f[operator[]((pI + 1) % nPoints)] + fld[operator[](pI)] + + fld[operator[]((pI + 1) % nPoints)] + cf ); @@ -116,4 +116,5 @@ Type Foam::face::average } } + // ************************************************************************* // diff --git a/src/OpenFOAM/meshes/meshShapes/face/oppositeFace.H b/src/OpenFOAM/meshes/meshShapes/face/oppositeFace.H index 4530f16dc6cd41f7ac9300cac77b96643f5617f1..afcf4b9a83efa9ae128e842772e8d79771f6a9e2 100644 --- a/src/OpenFOAM/meshes/meshShapes/face/oppositeFace.H +++ b/src/OpenFOAM/meshes/meshShapes/face/oppositeFace.H @@ -25,7 +25,7 @@ Class Foam::oppositeFace Description - Class containing opposite face for a prismatic cell with addresing + Class containing opposite face for a prismatic cell with addressing and a possibility of failure. SourceFiles diff --git a/src/OpenFOAM/meshes/meshShapes/triFace/triFace.H b/src/OpenFOAM/meshes/meshShapes/triFace/triFace.H index 09a8faeeefd024ca3db229434ebb9ba6ebd77a1f..dd16c41068c69477dfedd709a87c21ee88438288 100644 --- a/src/OpenFOAM/meshes/meshShapes/triFace/triFace.H +++ b/src/OpenFOAM/meshes/meshShapes/triFace/triFace.H @@ -25,10 +25,15 @@ Class Foam::triFace Description - A triangle face primitive using a FixedList. + A triangular face using a FixedList of labels corresponding to mesh + vertices. + +SeeAlso + Foam::face, Foam::triangle SourceFiles triFaceI.H + triFaceTemplates.C \*---------------------------------------------------------------------------*/ @@ -47,17 +52,17 @@ SourceFiles namespace Foam { -class face; - // Forward declaration of friend functions and operators +class face; class triFace; + inline bool operator==(const triFace&, const triFace&); inline bool operator!=(const triFace&, const triFace&); /*---------------------------------------------------------------------------*\ - class triFace Declaration + Class triFace Declaration \*---------------------------------------------------------------------------*/ class triFace @@ -93,62 +98,113 @@ public: // return the collapsed size, set collapsed point labels to -1 inline label collapse(); - //- Return the edge direction on the face - // - +1: forward (counter-clockwise) on the face - // - -1: reverse (clockwise) on the face - // - 0: edge not found on the face - inline int edgeDirection(const edge&) const; + //- Flip the face in-place. + // The starting points of the original and flipped face are identical. + inline void flip(); + + //- Return the points corresponding to this face + inline pointField points(const pointField& meshPoints) const; + //- Return triangle as a face + inline face triFaceFace() const; - // Properties + //- Return the triangle + inline triPointRef tri(const pointField&) const; - //- Return the points corresponding to this face - inline pointField points(const pointField& points) const; + //- Return centre (centroid) + inline point centre(const pointField&) const; - //- Return triangle as a face - inline face triFaceFace() const; + //- Calculate average value at centroid of face + template<class Type> + Type average(const pointField&, const Field<Type>&) const; - //- Return number of edges - inline label nEdges() const; + //- Return scalar magnitude + inline scalar mag(const pointField&) const; - //- Return edges - inline edgeList edges() const; + //- Return vector normal + inline vector normal(const pointField&) const; - //- Return centre (centroid) - inline point centre(const pointField&) const; + //- Number of triangles after splitting + inline label nTriangles() const; - //- Return scalar magnitude - inline scalar mag(const pointField&) const; + //- Return face with reverse direction + // The starting points of the original and reverse face are identical. + inline triFace reverseFace() const; - //- Return vector normal - inline vector normal(const pointField&) const; + //- Return swept-volume + inline scalar sweptVol + ( + const pointField& oldPoints, + const pointField& newPoints + ) const; - //- Number of triangles after splitting - inline label nTriangles() const; + //- Return the inertia tensor, with optional reference + // point and density specification + inline tensor inertia + ( + const pointField&, + const point& refPt = vector::zero, + scalar density = 1.0 + ) const; + + //- Return point intersection with a ray starting at p, + // with direction q. + inline pointHit ray + ( + const point& p, + const vector& q, + const pointField& points, + const intersection::algorithm = intersection::FULL_RAY, + const intersection::direction dir = intersection::VECTOR + ) const; + + //- Fast intersection with a ray. + inline pointHit intersection + ( + const point& p, + const vector& q, + const pointField& points, + const intersection::algorithm alg, + const scalar tol = 0.0 + ) const; + + //- Return nearest point to face + inline pointHit nearestPoint + ( + const point& p, + const pointField& points + ) const; + + + //- Return nearest point to face and classify it: + // + near point (nearType=POINT, nearLabel=0, 1, 2) + // + near edge (nearType=EDGE, nearLabel=0, 1, 2) + // Note: edges are counted from starting vertex so + // e.g. edge n is from f[n] to f[0], where the face has n + 1 + // points + inline pointHit nearestPointClassify + ( + const point& p, + const pointField& points, + label& nearType, + label& nearLabel + ) const; - //- Return face with reverse direction - inline triFace reverseFace() const; + //- Return number of edges + inline label nEdges() const; - //- Return swept-volume - inline scalar sweptVol - ( - const pointField& oldPoints, - const pointField& newPoints - ) const; + //- Return edges in face point ordering, + // i.e. edges()[0] is edge between [0] and [1] + inline edgeList edges() const; - //- Return point intersection with a ray starting at p, with - // direction n. - inline pointHit ray - ( - const point& p, - const vector& q, - const pointField& points, - const intersection::algorithm = intersection::FULL_RAY, - const intersection::direction dir = intersection::VECTOR - ) const; + //- Return n-th face edge + inline edge faceEdge(const label n) const; - //- Return the triangle - inline triPointRef tri(const pointField&) const; + //- Return the edge direction on the face + // - +1: forward (counter-clockwise) on the face + // - -1: reverse (clockwise) on the face + // - 0: edge not found on the face + inline int edgeDirection(const edge&) const; //- compare triFaces // - 0: different @@ -158,8 +214,8 @@ public: // Friend Operators - friend bool operator==(const triFace&, const triFace&); - friend bool operator!=(const triFace&, const triFace&); + inline friend bool operator==(const triFace&, const triFace&); + inline friend bool operator!=(const triFace&, const triFace&); }; @@ -199,6 +255,10 @@ inline bool contiguous<triFace>() {return true;} #include "triFaceI.H" +#ifdef NoRepository +# include "triFaceTemplates.C" +#endif + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif diff --git a/src/OpenFOAM/meshes/meshShapes/triFace/triFaceI.H b/src/OpenFOAM/meshes/meshShapes/triFace/triFaceI.H index 1cac003d26d31e231cb777174ed2d46c627f49c1..e19319e3d01734256729972b0724efc2e07fb6e3 100644 --- a/src/OpenFOAM/meshes/meshShapes/triFace/triFaceI.H +++ b/src/OpenFOAM/meshes/meshShapes/triFace/triFaceI.H @@ -26,6 +26,7 @@ License #include "IOstreams.H" #include "face.H" #include "triPointRef.H" +#include "Swap.H" // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * // @@ -118,6 +119,12 @@ inline Foam::label Foam::triFace::collapse() } +inline void Foam::triFace::flip() +{ + Swap(operator[](1), operator[](2)); +} + + inline Foam::pointField Foam::triFace::points(const pointField& points) const { pointField p(3); @@ -142,57 +149,14 @@ inline Foam::face Foam::triFace::triFaceFace() const } -inline Foam::label Foam::triFace::nEdges() const -{ - return 3; -} - - -inline Foam::edgeList Foam::triFace::edges() const -{ - edgeList e(3); - - e[0].start() = operator[](0); - e[0].end() = operator[](1); - - e[1].start() = operator[](1); - e[1].end() = operator[](2); - - e[2].start() = operator[](2); - e[2].end() = operator[](0); - - return e; -} - - -// return -// - +1: forward (counter-clockwise) on the face -// - -1: reverse (clockwise) on the face -// - 0: edge not found on the face -inline int Foam::triFace::edgeDirection(const edge& e) const +inline Foam::triPointRef Foam::triFace::tri(const pointField& points) const { - if - ( - (operator[](0) == e.start() && operator[](1) == e.end()) - || (operator[](1) == e.start() && operator[](2) == e.end()) - || (operator[](2) == e.start() && operator[](0) == e.end()) - ) - { - return 1; - } - else if + return triPointRef ( - (operator[](0) == e.end() && operator[](1) == e.start()) - || (operator[](1) == e.end() && operator[](2) == e.start()) - || (operator[](2) == e.end() && operator[](0) == e.start()) - ) - { - return -1; - } - else - { - return 0; - } + points[operator[](0)], + points[operator[](1)], + points[operator[](2)] + ); } @@ -269,6 +233,18 @@ inline Foam::scalar Foam::triFace::sweptVol } +Foam::tensor Foam::triFace::inertia +( + const pointField& points, + const point& refPt, + scalar density +) const +{ + // a triangle, do a direct calculation + return this->tri(points).inertia(refPt, density); +} + + inline Foam::pointHit Foam::triFace::ray ( const point& p, @@ -278,23 +254,103 @@ inline Foam::pointHit Foam::triFace::ray const intersection::direction dir ) const { - return triPointRef - ( - points[operator[](0)], - points[operator[](1)], - points[operator[](2)] - ).ray(p, q, alg, dir); + return this->tri(points).ray(p, q, alg, dir); } -inline Foam::triPointRef Foam::triFace::tri(const pointField& points) const + +inline Foam::pointHit Foam::triFace::intersection +( + const point& p, + const vector& q, + const pointField& points, + const intersection::algorithm alg, + const scalar tol +) const { - return triPointRef + return this->tri(points).intersection(p, q, alg, tol); +} + + +inline Foam::pointHit Foam::triFace::nearestPoint +( + const point& p, + const pointField& points +) const +{ + return this->tri(points).nearestPoint(p); +} + + +inline Foam::pointHit Foam::triFace::nearestPointClassify +( + const point& p, + const pointField& points, + label& nearType, + label& nearLabel +) const +{ + return this->tri(points).nearestPointClassify(p, nearType, nearLabel); +} + + +inline Foam::label Foam::triFace::nEdges() const +{ + return 3; +} + + +inline Foam::edgeList Foam::triFace::edges() const +{ + edgeList e(3); + + e[0].start() = operator[](0); + e[0].end() = operator[](1); + + e[1].start() = operator[](1); + e[1].end() = operator[](2); + + e[2].start() = operator[](2); + e[2].end() = operator[](0); + + return e; +} + + +inline Foam::edge Foam::triFace::faceEdge(const label n) const +{ + return edge(operator[](n), operator[](fcIndex(n))); +} + + +// return +// - +1: forward (counter-clockwise) on the face +// - -1: reverse (clockwise) on the face +// - 0: edge not found on the face +inline int Foam::triFace::edgeDirection(const edge& e) const +{ + if ( - points[operator[](0)], - points[operator[](1)], - points[operator[](2)] - ); + (operator[](0) == e.start() && operator[](1) == e.end()) + || (operator[](1) == e.start() && operator[](2) == e.end()) + || (operator[](2) == e.start() && operator[](0) == e.end()) + ) + { + return 1; + } + else if + ( + (operator[](0) == e.end() && operator[](1) == e.start()) + || (operator[](1) == e.end() && operator[](2) == e.start()) + || (operator[](2) == e.end() && operator[](0) == e.start()) + ) + { + return -1; + } + else + { + return 0; + } } diff --git a/src/OpenFOAM/meshes/meshShapes/triFace/triFaceTemplates.C b/src/OpenFOAM/meshes/meshShapes/triFace/triFaceTemplates.C new file mode 100644 index 0000000000000000000000000000000000000000..1a4f36f2696f469c756b8262dcc4a2fc6272b3cf --- /dev/null +++ b/src/OpenFOAM/meshes/meshShapes/triFace/triFaceTemplates.C @@ -0,0 +1,50 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "triFace.H" + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class Type> +Type Foam::triFace::average +( + const pointField& meshPoints, + const Field<Type>& fld +) const +{ + // a triangle, do a direct calculation + return + ( + (1.0/3.0) + * + ( + fld[operator[](0)] + + fld[operator[](1)] + + fld[operator[](2)] + ) + ); +} + +// ************************************************************************* // diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C index 0010c5ecc42194c91c0fb0ca02914cc838348024..128a3932268d7f6d0f77ebde9993682687004b7c 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C @@ -443,11 +443,19 @@ Foam::label Foam::cyclicPolyPatch::getConsistentRotationFace const pointField& faceCentres ) const { - const scalarField magRadSqr = - magSqr((faceCentres - rotationCentre_) ^ rotationAxis_); - scalarField axisLen = (faceCentres - rotationCentre_) & rotationAxis_; - axisLen = axisLen - min(axisLen); - const scalarField magLenSqr = magRadSqr + axisLen*axisLen; + const scalarField magRadSqr + ( + magSqr((faceCentres - rotationCentre_) ^ rotationAxis_) + ); + scalarField axisLen + ( + (faceCentres - rotationCentre_) & rotationAxis_ + ); + axisLen -= min(axisLen); + const scalarField magLenSqr + ( + magRadSqr + axisLen*axisLen + ); label rotFace = -1; scalar maxMagLenSqr = -GREAT; diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/oldCyclic/oldCyclicPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/oldCyclic/oldCyclicPolyPatch.C index 218debfa5b0b0df7e7571e368309a5e2c209f00b..0e2ee1022bd0be9dc7b051d8c02ce3d965d94d15 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/oldCyclic/oldCyclicPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/oldCyclic/oldCyclicPolyPatch.C @@ -44,19 +44,21 @@ namespace Foam addToRunTimeSelectionTable(polyPatch, oldCyclicPolyPatch, word); addToRunTimeSelectionTable(polyPatch, oldCyclicPolyPatch, dictionary); - -template<> -const char* NamedEnum<oldCyclicPolyPatch::transformType, 3>::names[] = -{ - "unknown", - "rotational", - "translational" -}; - -const NamedEnum<oldCyclicPolyPatch::transformType, 3> - oldCyclicPolyPatch::transformTypeNames; + template<> + const char* Foam::NamedEnum + < + Foam::oldCyclicPolyPatch::transformType, + 3 + >::names[] = + { + "unknown", + "rotational", + "translational" + }; } +const Foam::NamedEnum<Foam::oldCyclicPolyPatch::transformType, 3> + Foam::oldCyclicPolyPatch::transformTypeNames; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -536,11 +538,19 @@ Foam::label Foam::oldCyclicPolyPatch::getConsistentRotationFace const pointField& faceCentres ) const { - const scalarField magRadSqr = - magSqr((faceCentres - rotationCentre_) ^ rotationAxis_); - scalarField axisLen = (faceCentres - rotationCentre_) & rotationAxis_; + const scalarField magRadSqr + ( + magSqr((faceCentres - rotationCentre_) ^ rotationAxis_) + ); + scalarField axisLen + ( + (faceCentres - rotationCentre_) & rotationAxis_ + ); axisLen = axisLen - min(axisLen); - const scalarField magLenSqr = magRadSqr + axisLen*axisLen; + const scalarField magLenSqr + ( + magRadSqr + axisLen*axisLen + ); label rotFace = -1; scalar maxMagLenSqr = -GREAT; diff --git a/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatch.H b/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatch.H index e1dafb978cb91ae4e3a1beb196deeb2281e8732f..2aaf0c8417205b9944a9e29b1a3d06faee81d63f 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatch.H +++ b/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatch.H @@ -57,6 +57,7 @@ SourceFiles #include "point.H" #include "intersection.H" #include "HashSet.H" +#include "objectHit.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -64,7 +65,6 @@ namespace Foam { class face; -class objectHit; template<class T> class Map; /*---------------------------------------------------------------------------*\ diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C index 17b5bfd78ebe4a1968a2beffa2102fc7f844362e..3d1b45c0bb7efa1612851ec40aaf1e7ada16f303 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C +++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C @@ -302,7 +302,7 @@ bool Foam::primitiveMesh::checkFaceAreas << "checking face area magnitudes" << endl; } - const scalarField magFaceAreas = mag(faceAreas()); + const scalarField magFaceAreas(mag(faceAreas())); scalar minArea = GREAT; scalar maxArea = -GREAT; diff --git a/src/OpenFOAM/meshes/primitiveShapes/line/line.H b/src/OpenFOAM/meshes/primitiveShapes/line/line.H index cd455ec54e5cd8ce3c1e361829c8e94e843bac26..c377a59320649979e1c22e20fbb20e95d8839d38 100644 --- a/src/OpenFOAM/meshes/primitiveShapes/line/line.H +++ b/src/OpenFOAM/meshes/primitiveShapes/line/line.H @@ -38,6 +38,8 @@ SourceFiles #include "vector.H" #include "PointHit.H" #include "point2D.H" +#include "FixedList.H" +#include "UList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -80,6 +82,14 @@ public: //- Construct from two points inline line(const Point& start, const Point& end); + //- Construct from two points in the list of points + // The indices could be from edge etc. + inline line + ( + const UList<Point>&, + const FixedList<label, 2>& indices + ); + //- Construct from Istream inline line(Istream&); diff --git a/src/OpenFOAM/meshes/primitiveShapes/line/lineI.H b/src/OpenFOAM/meshes/primitiveShapes/line/lineI.H index cb6616fa0133ac26c4eff620443b7e16bb84d805..208293c392c2a906b02abdc939fd0612ca3a77b4 100644 --- a/src/OpenFOAM/meshes/primitiveShapes/line/lineI.H +++ b/src/OpenFOAM/meshes/primitiveShapes/line/lineI.H @@ -25,15 +25,10 @@ License #include "IOstreams.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class Point, class PointRef> -inline line<Point, PointRef>::line(const Point& start, const Point& end) +inline Foam::line<Point, PointRef>::line(const Point& start, const Point& end) : a_(start), b_(end) @@ -41,59 +36,65 @@ inline line<Point, PointRef>::line(const Point& start, const Point& end) template<class Point, class PointRef> -inline line<Point, PointRef>::line(Istream& is) -{ - // Read beginning of line point pair - is.readBegin("line"); - - is >> a_ >> b_; +inline Foam::line<Point, PointRef>::line +( + const UList<Point>& points, + const FixedList<label, 2>& indices +) +: + a_(points[indices[0]]), + b_(points[indices[1]]) +{} - // Read end of line point pair - is.readEnd("line"); - // Check state of Istream - is.check("line::line(Istream& is)"); +template<class Point, class PointRef> +inline Foam::line<Point, PointRef>::line(Istream& is) +{ + is >> *this; } // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class Point, class PointRef> -inline PointRef line<Point, PointRef>::start() const +inline PointRef Foam::line<Point, PointRef>::start() const { return a_; } template<class Point, class PointRef> -inline PointRef line<Point, PointRef>::end() const +inline PointRef Foam::line<Point, PointRef>::end() const { return b_; } template<class Point, class PointRef> -inline Point line<Point, PointRef>::centre() const +inline Point Foam::line<Point, PointRef>::centre() const { return 0.5*(a_ + b_); } template<class Point, class PointRef> -inline scalar line<Point, PointRef>::mag() const +inline Foam::scalar Foam::line<Point, PointRef>::mag() const { return ::Foam::mag(vec()); } template<class Point, class PointRef> -inline Point line<Point, PointRef>::vec() const +inline Point Foam::line<Point, PointRef>::vec() const { return b_ - a_; } template<class Point, class PointRef> -PointHit<Point> line<Point, PointRef>::nearestDist(const Point& p) const +Foam::PointHit<Point> Foam::line<Point, PointRef>::nearestDist +( + const Point& p +) const { Point v = vec(); @@ -122,7 +123,7 @@ PointHit<Point> line<Point, PointRef>::nearestDist(const Point& p) const template<class Point, class PointRef> -scalar line<Point, PointRef>::nearestDist +Foam::scalar Foam::line<Point, PointRef>::nearestDist ( const line<Point, const Point&>& edge, Point& thisPt, @@ -259,33 +260,34 @@ scalar line<Point, PointRef>::nearestDist // * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * * // template<class Point, class PointRef> -inline Istream& operator>>(Istream& is, line<Point, PointRef>& l) +inline Foam::Istream& Foam::operator>> +( + Istream& is, + line<Point, PointRef>& l +) { - // Read beginning of line point pair is.readBegin("line"); - - is >> l.a_ >> l.b_; - - // Read end of line point pair + is >> l.a_ >> l.b_; is.readEnd("line"); - // Check state of Ostream is.check("Istream& operator>>(Istream&, line&)"); - return is; } template<class Point, class PointRef> -inline Ostream& operator<<(Ostream& os, const line<Point, PointRef>& l) +inline Foam::Ostream& Foam::operator<< +( + Ostream& os, + const line<Point, PointRef>& l +) { - os << token::BEGIN_LIST << l.a_ << token::SPACE << l.b_ << token::END_LIST; + os << token::BEGIN_LIST + << l.a_ << token::SPACE + << l.b_ + << token::END_LIST; return os; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/OpenFOAM/meshes/primitiveShapes/objectHit/objectHit.H b/src/OpenFOAM/meshes/primitiveShapes/objectHit/objectHit.H index 209c4463099bf5b1fe67d370668b2dae24567d50..c19b5ca8c396a5392fe116abd03dfadd3219ae1b 100644 --- a/src/OpenFOAM/meshes/primitiveShapes/objectHit/objectHit.H +++ b/src/OpenFOAM/meshes/primitiveShapes/objectHit/objectHit.H @@ -40,14 +40,6 @@ Description namespace Foam { -// Forward declaration of friend functions and operators - -class objectHit; -inline bool operator==(const objectHit& a, const objectHit& b); -inline bool operator!=(const objectHit& a, const objectHit& b); -inline Ostream& operator<<(Ostream& os, const objectHit& b); - - /*---------------------------------------------------------------------------*\ Class objectHit Declaration \*---------------------------------------------------------------------------*/ @@ -106,22 +98,22 @@ public: // Friend Operators - friend bool operator==(const objectHit& a, const objectHit& b) + inline friend bool operator==(const objectHit& a, const objectHit& b) { - return ((a.hit_ == b.hit_) && (a.hitObject_ == b.hitObject_)); + return (a.hit_ == b.hit_) && (a.hitObject_ == b.hitObject_); } - friend bool operator!=(const objectHit& a, const objectHit& b) + inline friend bool operator!=(const objectHit& a, const objectHit& b) { - return (!(a == b)); + return !(a == b); } // Ostream operator - friend Ostream& operator<<(Ostream& os, const objectHit& b) + inline friend Ostream& operator<<(Ostream& os, const objectHit& obj) { - return os << b.hit() << token::SPACE << b.hitObject(); + return os << obj.hit() << token::SPACE << obj.hitObject(); } }; diff --git a/src/OpenFOAM/meshes/primitiveShapes/pyramid/pyramidI.H b/src/OpenFOAM/meshes/primitiveShapes/pyramid/pyramidI.H index 692730134d45d8a09e0c94fd90b234ebeb944108..7eee77c54d18f6a73992b06fe9dae2eef9490c84 100644 --- a/src/OpenFOAM/meshes/primitiveShapes/pyramid/pyramidI.H +++ b/src/OpenFOAM/meshes/primitiveShapes/pyramid/pyramidI.H @@ -27,15 +27,10 @@ Description #include "IOstreams.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class Point, class PointRef, class polygonRef> -inline pyramid<Point, PointRef, polygonRef>::pyramid +inline Foam::pyramid<Point, PointRef, polygonRef>::pyramid ( polygonRef base, const Point& apex @@ -47,30 +42,30 @@ inline pyramid<Point, PointRef, polygonRef>::pyramid template<class Point, class PointRef, class polygonRef> -inline pyramid<Point, PointRef, polygonRef>::pyramid(Istream& is) +inline Foam::pyramid<Point, PointRef, polygonRef>::pyramid(Istream& is) { is >> base_ >> apex_; - is.check("pyramid::pyramid(Istream& is)"); + is.check("pyramid::pyramid(Istream&)"); } // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class Point, class PointRef, class polygonRef> -inline const Point& pyramid<Point, PointRef, polygonRef>::apex() const +inline const Point& Foam::pyramid<Point, PointRef, polygonRef>::apex() const { return apex_; } template<class Point, class PointRef, class polygonRef> -inline polygonRef pyramid<Point, PointRef, polygonRef>::base() const +inline polygonRef Foam::pyramid<Point, PointRef, polygonRef>::base() const { return base_; } template<class Point, class PointRef, class polygonRef> -inline Point pyramid<Point, PointRef, polygonRef>::centre +inline Point Foam::pyramid<Point, PointRef, polygonRef>::centre ( const pointField& points ) const @@ -80,7 +75,7 @@ inline Point pyramid<Point, PointRef, polygonRef>::centre template<class Point, class PointRef, class polygonRef> -inline vector pyramid<Point, PointRef, polygonRef>::height +inline Foam::vector Foam::pyramid<Point, PointRef, polygonRef>::height ( const pointField& points ) const @@ -91,7 +86,7 @@ inline vector pyramid<Point, PointRef, polygonRef>::height template<class Point, class PointRef, class polygonRef> -inline scalar pyramid<Point, PointRef, polygonRef>::mag +inline Foam::scalar Foam::pyramid<Point, PointRef, polygonRef>::mag ( const pointField& points ) const @@ -103,32 +98,28 @@ inline scalar pyramid<Point, PointRef, polygonRef>::mag // * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * * // template<class Point, class PointRef, class polygonRef> -inline Istream& operator>> +inline Foam::Istream& Foam::operator>> ( Istream& is, pyramid<Point, PointRef, polygonRef>& p ) { - is >> p.base_ >> p.apex_; + is >> p.base_ >> p.apex_; is.check("Istream& operator>>(Istream&, pyramid&)"); return is; } template<class Point, class PointRef, class polygonRef> -inline Ostream& operator<< +inline Foam::Ostream& Foam::operator<< ( Ostream& os, const pyramid<Point, PointRef, polygonRef>& p ) { - os << p.base_ << tab << p.apex_ << nl; + os << p.base_ << tab << p.apex_ << nl; return os; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/OpenFOAM/meshes/primitiveShapes/tetrahedron/tetrahedron.H b/src/OpenFOAM/meshes/primitiveShapes/tetrahedron/tetrahedron.H index f80ac49d4061632c2a37e2ae20a37599472e33fe..e810da9a1d739a79cf829bbc2e649a33f34a69b4 100644 --- a/src/OpenFOAM/meshes/primitiveShapes/tetrahedron/tetrahedron.H +++ b/src/OpenFOAM/meshes/primitiveShapes/tetrahedron/tetrahedron.H @@ -43,6 +43,8 @@ SourceFiles #include "primitiveFieldsFwd.H" #include "pointHit.H" #include "Random.H" +#include "FixedList.H" +#include "UList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -105,6 +107,13 @@ public: const Point& d ); + //- Construct from four points in the list of points + inline tetrahedron + ( + const UList<Point>&, + const FixedList<label, 4>& indices + ); + //- Construct from Istream inline tetrahedron(Istream&); diff --git a/src/OpenFOAM/meshes/primitiveShapes/tetrahedron/tetrahedronI.H b/src/OpenFOAM/meshes/primitiveShapes/tetrahedron/tetrahedronI.H index c015c63db2ebd46daa6ca39b7797685085a8c543..a8bde775c7ffc67608301dea4a8ea3040e1f1278 100644 --- a/src/OpenFOAM/meshes/primitiveShapes/tetrahedron/tetrahedronI.H +++ b/src/OpenFOAM/meshes/primitiveShapes/tetrahedron/tetrahedronI.H @@ -27,15 +27,10 @@ License #include "IOstreams.H" #include "triPointRef.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class Point, class PointRef> -inline tetrahedron<Point, PointRef>::tetrahedron +inline Foam::tetrahedron<Point, PointRef>::tetrahedron ( const Point& a, const Point& b, @@ -51,95 +46,100 @@ inline tetrahedron<Point, PointRef>::tetrahedron template<class Point, class PointRef> -inline tetrahedron<Point, PointRef>::tetrahedron(Istream& is) -{ - // Read beginning of tetrahedron point pair - is.readBegin("tetrahedron"); - - is >> a_ >> b_ >> c_ >> d_; +inline Foam::tetrahedron<Point, PointRef>::tetrahedron +( + const UList<Point>& points, + const FixedList<label, 4>& indices +) +: + a_(points[indices[0]]), + b_(points[indices[1]]), + c_(points[indices[2]]), + d_(points[indices[3]]) +{} - // Read end of tetrahedron point pair - is.readEnd("tetrahedron"); - // Check state of Istream - is.check("tetrahedron::tetrahedron(Istream& is)"); +template<class Point, class PointRef> +inline Foam::tetrahedron<Point, PointRef>::tetrahedron(Istream& is) +{ + is >> *this; } // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class Point, class PointRef> -inline const Point& tetrahedron<Point, PointRef>::a() const +inline const Point& Foam::tetrahedron<Point, PointRef>::a() const { return a_; } template<class Point, class PointRef> -inline const Point& tetrahedron<Point, PointRef>::b() const +inline const Point& Foam::tetrahedron<Point, PointRef>::b() const { return b_; } template<class Point, class PointRef> -inline const Point& tetrahedron<Point, PointRef>::c() const +inline const Point& Foam::tetrahedron<Point, PointRef>::c() const { return c_; } template<class Point, class PointRef> -inline const Point& tetrahedron<Point, PointRef>::d() const +inline const Point& Foam::tetrahedron<Point, PointRef>::d() const { return d_; } template<class Point, class PointRef> -inline vector tetrahedron<Point, PointRef>::Sa() const +inline Foam::vector Foam::tetrahedron<Point, PointRef>::Sa() const { return triangle<Point, PointRef>(b_, c_, d_).normal(); } template<class Point, class PointRef> -inline vector tetrahedron<Point, PointRef>::Sb() const +inline Foam::vector Foam::tetrahedron<Point, PointRef>::Sb() const { return triangle<Point, PointRef>(a_, d_, c_).normal(); } template<class Point, class PointRef> -inline vector tetrahedron<Point, PointRef>::Sc() const +inline Foam::vector Foam::tetrahedron<Point, PointRef>::Sc() const { return triangle<Point, PointRef>(a_, b_, d_).normal(); } template<class Point, class PointRef> -inline vector tetrahedron<Point, PointRef>::Sd() const +inline Foam::vector Foam::tetrahedron<Point, PointRef>::Sd() const { return triangle<Point, PointRef>(a_, c_, b_).normal(); } template<class Point, class PointRef> -inline Point tetrahedron<Point, PointRef>::centre() const +inline Point Foam::tetrahedron<Point, PointRef>::centre() const { return 0.25*(a_ + b_ + c_ + d_); } template<class Point, class PointRef> -inline scalar tetrahedron<Point, PointRef>::mag() const +inline Foam::scalar Foam::tetrahedron<Point, PointRef>::mag() const { return (1.0/6.0)*(((b_ - a_) ^ (c_ - a_)) & (d_ - a_)); } template<class Point, class PointRef> -inline Point tetrahedron<Point, PointRef>::circumCentre() const +inline Point Foam::tetrahedron<Point, PointRef>::circumCentre() const { vector a = b_ - a_; vector b = c_ - a_; @@ -166,7 +166,7 @@ inline Point tetrahedron<Point, PointRef>::circumCentre() const template<class Point, class PointRef> -inline scalar tetrahedron<Point, PointRef>::circumRadius() const +inline Foam::scalar Foam::tetrahedron<Point, PointRef>::circumRadius() const { vector a = b_ - a_; vector b = c_ - a_; @@ -192,7 +192,7 @@ inline scalar tetrahedron<Point, PointRef>::circumRadius() const template<class Point, class PointRef> -inline scalar tetrahedron<Point, PointRef>::quality() const +inline Foam::scalar Foam::tetrahedron<Point, PointRef>::quality() const { return mag() @@ -205,7 +205,10 @@ inline scalar tetrahedron<Point, PointRef>::quality() const template<class Point, class PointRef> -inline Point tetrahedron<Point, PointRef>::randomPoint(Random& rndGen) const +inline Point Foam::tetrahedron<Point, PointRef>::randomPoint +( + Random& rndGen +) const { // Adapted from // http://vcg.isti.cnr.it/activities/geometryegraphics/pointintetraedro.html @@ -238,7 +241,7 @@ inline Point tetrahedron<Point, PointRef>::randomPoint(Random& rndGen) const template<class Point, class PointRef> -scalar tetrahedron<Point, PointRef>::barycentric +Foam::scalar Foam::tetrahedron<Point, PointRef>::barycentric ( const point& pt, List<scalar>& bary @@ -283,7 +286,7 @@ scalar tetrahedron<Point, PointRef>::barycentric template<class Point, class PointRef> -inline pointHit tetrahedron<Point, PointRef>::nearestPoint +inline Foam::pointHit Foam::tetrahedron<Point, PointRef>::nearestPoint ( const point& p ) const @@ -379,18 +382,17 @@ inline pointHit tetrahedron<Point, PointRef>::nearestPoint // * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // -template<class point, class pointRef> -inline Istream& operator>>(Istream& is, tetrahedron<point, pointRef>& t) +template<class Point, class PointRef> +inline Foam::Istream& Foam::operator>> +( + Istream& is, + tetrahedron<Point, PointRef>& t +) { - // Read beginning of tetrahedron point pair is.readBegin("tetrahedron"); - - is >> t.a_ >> t.b_ >> t.c_ >> t.d_; - - // Read end of tetrahedron point pair + is >> t.a_ >> t.b_ >> t.c_ >> t.d_; is.readEnd("tetrahedron"); - // Check state of Ostream is.check("Istream& operator>>(Istream&, tetrahedron&)"); return is; @@ -398,20 +400,22 @@ inline Istream& operator>>(Istream& is, tetrahedron<point, pointRef>& t) template<class Point, class PointRef> -inline Ostream& operator<<(Ostream& os, const tetrahedron<Point, PointRef>& t) +inline Foam::Ostream& Foam::operator<< +( + Ostream& os, + const tetrahedron<Point, PointRef>& t +) { os << nl << token::BEGIN_LIST - << t.a_ << token::SPACE << t.b_ - << token::SPACE << t.c_ << token::SPACE << t.d_ + << t.a_ << token::SPACE + << t.b_ << token::SPACE + << t.c_ << token::SPACE + << t.d_ << token::END_LIST; return os; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/OpenFOAM/meshes/primitiveShapes/triangle/intersection.C b/src/OpenFOAM/meshes/primitiveShapes/triangle/intersection.C index 110754f77a1494ff70167bf1c2ff7acf8cd1389a..0c2e84bdf47bd05483731915dd2f9594a83cd472 100644 --- a/src/OpenFOAM/meshes/primitiveShapes/triangle/intersection.C +++ b/src/OpenFOAM/meshes/primitiveShapes/triangle/intersection.C @@ -32,14 +32,22 @@ Foam::scalar Foam::intersection::planarTol_ = 0.2; namespace Foam { template<> - const char* Foam::NamedEnum<Foam::intersection::direction, 2>::names[] = + const char* Foam::NamedEnum + < + Foam::intersection::direction, + 2 + >::names[] = { "vector", "contactSphere" }; template<> - const char* Foam::NamedEnum<Foam::intersection::algorithm, 3>::names[] = + const char* Foam::NamedEnum + < + Foam::intersection::algorithm, + 3 + >::names[] = { "fullRay", "halfRay", diff --git a/src/OpenFOAM/meshes/primitiveShapes/triangle/triangle.H b/src/OpenFOAM/meshes/primitiveShapes/triangle/triangle.H index abb5d7d8e426ea94438536986ff92d9c731e3be0..aa3d3fe579402a538b385652add17a2ffc48bea9 100644 --- a/src/OpenFOAM/meshes/primitiveShapes/triangle/triangle.H +++ b/src/OpenFOAM/meshes/primitiveShapes/triangle/triangle.H @@ -40,6 +40,8 @@ SourceFiles #include "tensor.H" #include "pointHit.H" #include "Random.H" +#include "FixedList.H" +#include "UList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -69,7 +71,7 @@ inline Ostream& operator<< /*---------------------------------------------------------------------------*\ - class triangle Declaration + Class triangle Declaration \*---------------------------------------------------------------------------*/ template<class Point, class PointRef> @@ -96,6 +98,14 @@ public: //- Construct from three points inline triangle(const Point& a, const Point& b, const Point& c); + //- Construct from three points in the list of points + // The indices could be from triFace etc. + inline triangle + ( + const UList<Point>&, + const FixedList<label, 3>& indices + ); + //- Construct from Istream inline triangle(Istream&); diff --git a/src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H b/src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H index 1145e403a606c3b56803b2baa872a8dae7e22860..6e7a0302f5a20c253b1cd804bbd6e830926f7d7f 100644 --- a/src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H +++ b/src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H @@ -27,15 +27,10 @@ License #include "pointHit.H" #include "mathematicalConstants.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class Point, class PointRef> -inline triangle<Point, PointRef>::triangle +inline Foam::triangle<Point, PointRef>::triangle ( const Point& a, const Point& b, @@ -49,65 +44,70 @@ inline triangle<Point, PointRef>::triangle template<class Point, class PointRef> -inline triangle<Point, PointRef>::triangle(Istream& is) -{ - // Read beginning of triangle point pair - is.readBegin("triangle"); +inline Foam::triangle<Point, PointRef>::triangle +( + const UList<Point>& points, + const FixedList<label, 3>& indices +) +: + a_(points[indices[0]]), + b_(points[indices[1]]), + c_(points[indices[2]]) +{} - is >> a_ >> b_ >> c_; - // Read end of triangle point pair - is.readEnd("triangle"); - // Check state of Istream - is.check("triangle::triangle(Istream& is)"); +template<class Point, class PointRef> +inline Foam::triangle<Point, PointRef>::triangle(Istream& is) +{ + is >> *this; } // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class Point, class PointRef> -inline const Point& triangle<Point, PointRef>::a() const +inline const Point& Foam::triangle<Point, PointRef>::a() const { return a_; } template<class Point, class PointRef> -inline const Point& triangle<Point, PointRef>::b() const +inline const Point& Foam::triangle<Point, PointRef>::b() const { return b_; } template<class Point, class PointRef> -inline const Point& triangle<Point, PointRef>::c() const +inline const Point& Foam::triangle<Point, PointRef>::c() const { return c_; } template<class Point, class PointRef> -inline Point triangle<Point, PointRef>::centre() const +inline Point Foam::triangle<Point, PointRef>::centre() const { return (1.0/3.0)*(a_ + b_ + c_); } template<class Point, class PointRef> -inline scalar triangle<Point, PointRef>::mag() const +inline Foam::scalar Foam::triangle<Point, PointRef>::mag() const { return Foam::mag(normal()); } template<class Point, class PointRef> -inline vector triangle<Point, PointRef>::normal() const +inline Foam::vector Foam::triangle<Point, PointRef>::normal() const { return 0.5*((b_ - a_)^(c_ - a_)); } template<class Point, class PointRef> -inline Point triangle<Point, PointRef>::circumCentre() const +inline Point Foam::triangle<Point, PointRef>::circumCentre() const { scalar d1 = (c_ - a_) & (b_ - a_); scalar d2 = -(c_ - b_) & (b_ - a_); @@ -134,7 +134,7 @@ inline Point triangle<Point, PointRef>::circumCentre() const template<class Point, class PointRef> -inline scalar triangle<Point, PointRef>::circumRadius() const +inline Foam::scalar Foam::triangle<Point, PointRef>::circumRadius() const { scalar d1 = (c_ - a_) & (b_ - a_); scalar d2 = -(c_ - b_) & (b_ - a_); @@ -158,14 +158,17 @@ inline scalar triangle<Point, PointRef>::circumRadius() const template<class Point, class PointRef> -inline scalar triangle<Point, PointRef>::quality() const +inline Foam::scalar Foam::triangle<Point, PointRef>::quality() const { return mag()/(Foam::sqr(circumRadius())*3.0*sqrt(3.0)/4.0 + VSMALL); } template<class Point, class PointRef> -inline scalar triangle<Point, PointRef>::sweptVol(const triangle& t) const +inline Foam::scalar Foam::triangle<Point, PointRef>::sweptVol +( + const triangle& t +) const { return (1.0/12.0)* ( @@ -181,7 +184,7 @@ inline scalar triangle<Point, PointRef>::sweptVol(const triangle& t) const template<class Point, class PointRef> -inline tensor triangle<Point, PointRef>::inertia +inline Foam::tensor Foam::triangle<Point, PointRef>::inertia ( PointRef refPt, scalar density @@ -218,7 +221,7 @@ inline tensor triangle<Point, PointRef>::inertia template<class Point, class PointRef> -inline Point triangle<Point, PointRef>::randomPoint(Random& rndGen) const +inline Point Foam::triangle<Point, PointRef>::randomPoint(Random& rndGen) const { // Generating Random Points in Triangles // by Greg Turk @@ -234,7 +237,7 @@ inline Point triangle<Point, PointRef>::randomPoint(Random& rndGen) const template<class Point, class PointRef> -scalar triangle<Point, PointRef>::barycentric +Foam::scalar Foam::triangle<Point, PointRef>::barycentric ( const point& pt, List<scalar>& bary @@ -275,7 +278,7 @@ scalar triangle<Point, PointRef>::barycentric template<class Point, class PointRef> -inline pointHit triangle<Point, PointRef>::ray +inline Foam::pointHit Foam::triangle<Point, PointRef>::ray ( const point& p, const vector& q, @@ -391,7 +394,7 @@ inline pointHit triangle<Point, PointRef>::ray // From "Fast, Minimum Storage Ray/Triangle Intersection" // Moeller/Trumbore. template<class Point, class PointRef> -inline pointHit triangle<Point, PointRef>::intersection +inline Foam::pointHit Foam::triangle<Point, PointRef>::intersection ( const point& orig, const vector& dir, @@ -474,7 +477,7 @@ inline pointHit triangle<Point, PointRef>::intersection template<class Point, class PointRef> -pointHit triangle<Point, PointRef>::nearestPointClassify +Foam::pointHit Foam::triangle<Point, PointRef>::nearestPointClassify ( const point& p, label& nearType, @@ -623,7 +626,7 @@ pointHit triangle<Point, PointRef>::nearestPointClassify template<class Point, class PointRef> -inline pointHit triangle<Point, PointRef>::nearestPoint +inline Foam::pointHit Foam::triangle<Point, PointRef>::nearestPoint ( const point& p ) const @@ -637,7 +640,7 @@ inline pointHit triangle<Point, PointRef>::nearestPoint template<class Point, class PointRef> -inline bool triangle<Point, PointRef>::classify +inline bool Foam::triangle<Point, PointRef>::classify ( const point& p, label& nearType, @@ -650,38 +653,38 @@ inline bool triangle<Point, PointRef>::classify // * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // -template<class point, class pointRef> -inline Istream& operator>>(Istream& is, triangle<point, pointRef>& t) +template<class Point, class PointRef> +inline Foam::Istream& Foam::operator>> +( + Istream& is, + triangle<Point, PointRef>& t +) { - // Read beginning of triangle point pair is.readBegin("triangle"); - - is >> t.a_ >> t.b_ >> t.c_; - - // Read end of triangle point pair + is >> t.a_ >> t.b_ >> t.c_; is.readEnd("triangle"); - // Check state of Ostream is.check("Istream& operator>>(Istream&, triangle&)"); - return is; } template<class Point, class PointRef> -inline Ostream& operator<<(Ostream& os, const triangle<Point, PointRef>& t) +inline Foam::Ostream& Foam::operator<< +( + Ostream& os, + const triangle<Point, PointRef>& t +) { os << nl << token::BEGIN_LIST - << t.a_ << token::SPACE << t.b_ << token::SPACE << t.c_ + << t.a_ << token::SPACE + << t.b_ << token::SPACE + << t.c_ << token::END_LIST; return os; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/OpenFOAM/primitives/Lists/hashedWordList.H b/src/OpenFOAM/primitives/Lists/hashedWordList.H index 93a23d8db362b0ce1b7bc460d87a14a0042e237c..f0c51da1d63db8033895043e5f3ac9fd607497a2 100644 --- a/src/OpenFOAM/primitives/Lists/hashedWordList.H +++ b/src/OpenFOAM/primitives/Lists/hashedWordList.H @@ -119,9 +119,6 @@ public: //- Assignment operator. inline void operator=(const hashedWordList&); - //- Allow readonly access to list of words - inline operator const Foam::UList<word>&() const; - //- Return name corresponding to specified index inline const word& operator[](const label index) const; diff --git a/src/OpenFOAM/primitives/Lists/stringListOps.H b/src/OpenFOAM/primitives/Lists/stringListOps.H index 59c823b21d80342717c0c00517027fd771540177..f0a814329b6a8d56397eddd6a5bf5d2b1f30bc64 100644 --- a/src/OpenFOAM/primitives/Lists/stringListOps.H +++ b/src/OpenFOAM/primitives/Lists/stringListOps.H @@ -91,7 +91,8 @@ namespace Foam const bool invert=false ) { - return findStrings(regExp(rePattern), lst, invert); + const regExp re(rePattern); + return findStrings(re, lst, invert); } //- Return list indices for strings matching the regular expression @@ -104,7 +105,8 @@ namespace Foam const bool invert=false ) { - return findMatchingStrings(regExp(rePattern), lst, invert); + const regExp re(rePattern); + return findMatchingStrings(re, lst, invert); } //- Return list indices for strings matching the regular expression @@ -171,7 +173,8 @@ namespace Foam const bool invert=false ) { - return subsetMatchingStrings(regExp(rePattern), lst, invert); + const regExp re(rePattern); + return subsetMatchingStrings(re, lst, invert); } //- Extract elements of StringList when regular expression matches @@ -184,7 +187,8 @@ namespace Foam const bool invert=false ) { - return subsetMatchingStrings(regExp(rePattern), lst, invert); + const regExp re(rePattern); + return subsetMatchingStrings(re, lst, invert); } //- Extract elements of StringList when regular expression matches @@ -249,7 +253,8 @@ namespace Foam const bool invert=false ) { - inplaceSubsetMatchingStrings(regExp(rePattern), lst, invert); + const regExp re(rePattern); + inplaceSubsetMatchingStrings(re, lst, invert); } //- Inplace extract elements of StringList when regular expression matches @@ -262,7 +267,8 @@ namespace Foam const bool invert=false ) { - inplaceSubsetMatchingStrings(regExp(rePattern), lst, invert); + const regExp re(rePattern); + inplaceSubsetMatchingStrings(re, lst, invert); } //- Inplace extract elements of StringList when regular expression matches diff --git a/src/OpenFOAM/primitives/pTraits/pTraits.H b/src/OpenFOAM/primitives/pTraits/pTraits.H index d6a15b12617bce7031294fcdc06602615b8e4f2c..c6c61d33194d18f4bbae731d3a4e8a400b7cc889 100644 --- a/src/OpenFOAM/primitives/pTraits/pTraits.H +++ b/src/OpenFOAM/primitives/pTraits/pTraits.H @@ -27,7 +27,9 @@ Class Description Traits class for primitives. - All primitives need a specialised version of this class + All primitives need a specialised version of this class. The + specialised version will normally also require a conversion + method. \*---------------------------------------------------------------------------*/ @@ -66,21 +68,6 @@ public: : PrimitiveType(is) {} - - - // Member operators - - //- Access to the primitive - operator PrimitiveType() const - { - return *this; - } - - //- Access to the primitive - operator PrimitiveType&() - { - return *this; - } }; diff --git a/src/OpenFOAM/primitives/ranges/labelRange/labelRange.C b/src/OpenFOAM/primitives/ranges/labelRange/labelRange.C new file mode 100644 index 0000000000000000000000000000000000000000..fa4ed366cff19393d0d094dec98f131d895775d9 --- /dev/null +++ b/src/OpenFOAM/primitives/ranges/labelRange/labelRange.C @@ -0,0 +1,156 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "labelRange.H" +#include "token.H" + + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +const Foam::labelRange::const_iterator Foam::labelRange::endIter_; + +int Foam::labelRange::debug(::Foam::debug::debugSwitch("labelRange", 0)); + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::labelRange::labelRange(Istream& is) +: + start_(0), + size_(0) +{ + is >> *this; +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +bool Foam::labelRange::intersects +( + const labelRange& range, + const bool touches +) const +{ + label final = touches ? 1 : 0; + + return + ( + this->size() + && range.size() + && + ( + ( + range.first() >= this->first() + && range.first() <= this->last() + final + ) + || + ( + this->first() >= range.first() + && this->first() <= range.last() + final + ) + ) + ); +} + + +Foam::labelRange Foam::labelRange::join(const labelRange& range) const +{ + // trivial cases first + if (!size_) + { + return *this; + } + else if (!range.size_) + { + return range; + } + + const label lower = Foam::min(this->first(), range.first()); + const label upper = Foam::max(this->last(), range.last()); + const label sz = upper - lower + 1; + + return labelRange(lower, sz); +} + + +// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // + +Foam::labelRange& Foam::labelRange::operator+=(const labelRange& rhs) +{ + if (!size_) + { + // trivial case + operator=(rhs); + } + else if (rhs.size_) + { + const label lower = Foam::min(this->first(), rhs.first()); + const label upper = Foam::max(this->last(), rhs.last()); + + start_ = lower; + size_ = upper - lower + 1; + } + + return *this; +} + + +// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // + +Foam::Istream& Foam::operator>>(Istream& is, labelRange& range) +{ + is.readBegin("labelRange"); + is >> range.start_ >> range.size_; + is.readEnd("labelRange"); + + is.check("operator>>(Istream&, labelRange&)"); + + // disallow invalid sizes + if (range.size_ <= 0) + { + range.clear(); + } + + return is; +} + + +Foam::Ostream& Foam::operator<<(Ostream& os, const labelRange& range) +{ + // write ASCII only for now + os << token::BEGIN_LIST + << range.start_ << token::SPACE << range.size_ + << token::END_LIST; + +// os << token::BEGIN_BLOCK +// << range.start_ << "-" << range.last() +// << token::END_BLOCK; + + os.check("operator<<(Ostream&, const labelRange&)"); + return os; +} + + +// ************************************************************************* // diff --git a/src/OpenFOAM/primitives/ranges/labelRange/labelRange.H b/src/OpenFOAM/primitives/ranges/labelRange/labelRange.H new file mode 100644 index 0000000000000000000000000000000000000000..2d4fcc4f840fb7e7eb3794ac845e1fe762176a6b --- /dev/null +++ b/src/OpenFOAM/primitives/ranges/labelRange/labelRange.H @@ -0,0 +1,215 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 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 <http://www.gnu.org/licenses/>. + +Class + Foam::labelRange + +Description + A label range specifier. + +SourceFiles + labelRange.C + +\*---------------------------------------------------------------------------*/ +#ifndef labelRange_H +#define labelRange_H + +#include "label.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of classes +class Istream; +class Ostream; + +// Forward declaration of friend functions and operators +class labelRange; +Istream& operator>>(Istream&, labelRange&); +Ostream& operator<<(Ostream&, const labelRange&); + +/*---------------------------------------------------------------------------*\ + Class labelRange Declaration +\*---------------------------------------------------------------------------*/ + +class labelRange +{ + // Private data + + label start_; + label size_; + +public: + + static int debug; + + + // Public classes + + //- Less function class for sorting labelRange + class less + { + public: + + bool operator()(const labelRange& a, const labelRange& b) + { + return a.first() < b.first(); + } + }; + + // Constructors + + //- Construct an empty range + inline labelRange(); + + //- Construct a range + // A negative size is autmatically changed to zero. + inline labelRange(const label start, const label size); + + //- Construct from Istream. + labelRange(Istream&); + + + // Member Functions + + //- Reset to zero size + inline void clear(); + + //- Is the range empty? + inline bool empty() const; + + //- Return the effective size of the range + inline label size() const; + + //- The (inclusive) lower value of the range + inline label first() const; + + //- The (inclusive) upper value of the range + inline label last() const; + + //- Return true if the value is within the range + inline bool contains(const label) const; + + //- Return true if the ranges intersect + // Optional test for ranges that also just touch each other + bool intersects(const labelRange&, const bool touches = false) const; + + //- Return a joined range, squashing any gaps in between + // A prior intersects() check can be used to avoid squashing gaps. + labelRange join(const labelRange&) const; + + + // Member Operators + + //- Return element in range, no bounds checking + inline label operator[](const label) const; + + //- Comparison function for sorting, compares the start + inline bool operator<(const labelRange& rhs) const; + + //- Join ranges, squashing any gaps in between + // A prior intersects() check can be used to avoid squashing gaps. + labelRange& operator+=(const labelRange&); + + inline bool operator==(const labelRange&) const; + inline bool operator!=(const labelRange&) const; + + + // STL iterator + + //- An STL const_iterator + class const_iterator + { + // Private data + + //- Reference to the range for which this is an iterator + const labelRange& range_; + + //- Current index + label index_; + + public: + + // Constructors + + //- Construct null - equivalent to an 'end' position + inline const_iterator(); + + //- Construct from range, moving to its 'begin' position + inline explicit const_iterator(const labelRange&); + + + // Member operators + + inline bool operator==(const const_iterator&) const; + + inline bool operator!=(const const_iterator&) const; + + inline label operator*(); + inline label operator()(); + + inline const_iterator& operator++(); + inline const_iterator operator++(int); + }; + + + //- const_iterator set to the beginning of the range + inline const_iterator cbegin() const; + + //- const_iterator set to beyond the end of the range + inline const const_iterator& cend() const; + + //- const_iterator set to the beginning of the range + inline const_iterator begin() const; + + //- const_iterator set to beyond the end of the range + inline const const_iterator& end() const; + + + // IOstream Operators + + friend Istream& operator>>(Istream&, labelRange&); + friend Ostream& operator<<(Ostream&, const labelRange&); + + +private: + + //- const_iterator returned by end(), cend() + static const const_iterator endIter_; + +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "labelRangeI.H" + +#endif + +// ************************************************************************* // diff --git a/src/OpenFOAM/primitives/ranges/labelRange/labelRangeI.H b/src/OpenFOAM/primitives/ranges/labelRange/labelRangeI.H new file mode 100644 index 0000000000000000000000000000000000000000..3070657cca5d3ba59fdcdd9d28f2f2ac3a422ca2 --- /dev/null +++ b/src/OpenFOAM/primitives/ranges/labelRange/labelRangeI.H @@ -0,0 +1,205 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +inline Foam::labelRange::labelRange() +: + start_(0), + size_(0) +{} + + +inline Foam::labelRange::labelRange(const label start, const label size) +: + start_(start), + size_(size) +{ + // disallow invalid sizes + if (size_ <= 0) + { + this->clear(); + } +} + + +// * * * * * * * * * * * * * * * * Iterators * * * * * * * * * * * * * * * * // + +inline Foam::labelRange::const_iterator::const_iterator() +: + range_(*reinterpret_cast< Foam::labelRange* >(0)), + index_(-1) +{} + + +inline Foam::labelRange::const_iterator::const_iterator(const labelRange& range) +: + range_(range), + index_(range_.empty() ? -1 : 0) +{} + + +inline bool Foam::labelRange::const_iterator::operator== +( + const const_iterator& iter +) const +{ + return (this->index_ == iter.index_); +} + + +inline bool Foam::labelRange::const_iterator::operator!= +( + const const_iterator& iter +) const +{ + return !(this->operator==(iter)); +} + + +inline Foam::label Foam::labelRange::const_iterator::operator*() +{ + return range_[index_]; +} + + +inline Foam::label Foam::labelRange::const_iterator::operator()() +{ + return range_[index_]; +} + + +inline Foam::labelRange::const_iterator& +Foam::labelRange::const_iterator::operator++() +{ + if (++index_ >= range_.size()) + { + // equivalent to end iterator + index_ = -1; + } + + return *this; +} + + +inline Foam::labelRange::const_iterator +Foam::labelRange::const_iterator::operator++(int) +{ + const_iterator old = *this; + this->operator++(); + return old; +} + + +inline Foam::labelRange::const_iterator Foam::labelRange::cbegin() const +{ + return const_iterator(*this); +} + + +inline const Foam::labelRange::const_iterator& Foam::labelRange::cend() const +{ + return endIter_; +} + + +inline Foam::labelRange::const_iterator Foam::labelRange::begin() const +{ + return const_iterator(*this); +} + + +inline const Foam::labelRange::const_iterator& Foam::labelRange::end() const +{ + return endIter_; +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +inline void Foam::labelRange::clear() +{ + start_ = size_ = 0; +} + + +inline bool Foam::labelRange::empty() const +{ + return !size_; +} + + +inline Foam::label Foam::labelRange::size() const +{ + return size_; +} + + +inline Foam::label Foam::labelRange::first() const +{ + return start_; +} + + +inline Foam::label Foam::labelRange::last() const +{ + return start_ + size_ - 1; +} + + +inline bool Foam::labelRange::contains(const label value) const +{ + return value >= this->first() && value <= this->last(); +} + + +// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // + +inline Foam::label Foam::labelRange::operator[](const label i) const +{ + return start_ + i; +} + + +inline bool Foam::labelRange::operator<(const labelRange& rhs) const +{ + return this->first() < rhs.first(); +} + + +inline bool Foam::labelRange::operator==(const labelRange& rhs) const +{ + return start_ == rhs.start_ && size_ == rhs.size_; +} + + +inline bool Foam::labelRange::operator!=(const labelRange& rhs) const +{ + return !(operator==(rhs)); +} + + +// ************************************************************************* // diff --git a/src/OpenFOAM/primitives/ranges/labelRange/labelRanges.C b/src/OpenFOAM/primitives/ranges/labelRange/labelRanges.C new file mode 100644 index 0000000000000000000000000000000000000000..188e63e5f0ee372658fc7656097bea65ef489c7e --- /dev/null +++ b/src/OpenFOAM/primitives/ranges/labelRange/labelRanges.C @@ -0,0 +1,310 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "labelRanges.H" +#include "ListOps.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +const Foam::labelRanges::const_iterator Foam::labelRanges::endIter_; + + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +void Foam::labelRanges::insertBefore +( + const label insert, + const labelRange& range +) +{ + // insert via copying up + label nElem = this->size(); + + if (labelRange::debug) + { + Info<<"before insert " + << nElem << " elements, insert at " << insert << nl + << *this << endl; + } + + ParentType::setSize(nElem+1); + + if (labelRange::debug) + { + Info<<"copy between " << nElem << " and " << insert << nl; + } + + for (label i = nElem-1; i >= insert; --i) + { + if (labelRange::debug) + { + Info<<"copy from " << (i) << " to " << (i+1) << nl; + } + + ParentType::operator[](i+1) = ParentType::operator[](i); + } + + // finally insert the range + if (labelRange::debug) + { + Info<< "finally insert the range at " << insert << nl; + } + ParentType::operator[](insert) = range; +} + + +void Foam::labelRanges::purgeEmpty() +{ + // purge empty ranges by copying down + label nElem = 0; + forAll(*this, elemI) + { + if (!ParentType::operator[](elemI).empty()) + { + if (nElem != elemI) + { + ParentType::operator[](nElem) = ParentType::operator[](elemI); + } + ++nElem; + } + } + + // truncate + this->ParentType::setSize(nElem); +} + + +Foam::Ostream& Foam::labelRanges::printRange +( + Ostream& os, + const labelRange& range +) const +{ + if (range.empty()) + { + os << "empty"; + } + else + { + os << range << " = " << range.first() << ":" << range.last(); + } + return os; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::labelRanges::labelRanges(Istream& is) +{ + is >> *this; +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +bool Foam::labelRanges::add(const labelRange& range) +{ + if (range.empty()) + { + return false; + } + else if (this->empty()) + { + this->append(range); + return true; + } + + // find the correct place for insertion + forAll(*this, elemI) + { + labelRange& currRange = ParentType::operator[](elemI); + + if (currRange.intersects(range, true)) + { + // absorb into the existing (adjacent/overlapping) range + currRange += range; + + // might connect with the next following range(s) + for (; elemI < this->size()-1; ++elemI) + { + labelRange& nextRange = ParentType::operator[](elemI+1); + if (currRange.intersects(nextRange, true)) + { + currRange += nextRange; + nextRange.clear(); + } + else + { + break; + } + } + + // done - remove any empty ranges that might have been created + purgeEmpty(); + return true; + break; + } + else if (range < currRange) + { + insertBefore(elemI, range); + return true; + break; + } + } + + + // not found: simply append + this->append(range); + + return true; +} + + +bool Foam::labelRanges::remove(const labelRange& range) +{ + bool status = false; + if (range.empty() || this->empty()) + { + return status; + } + + forAll(*this, elemI) + { + labelRange& currRange = ParentType::operator[](elemI); + + if (range.first() > currRange.first()) + { + if (range.last() < currRange.last()) + { + // removal of range fragments of currRange + + if (labelRange::debug) + { + Info<<"Fragment removal "; + printRange(Info, range) << " from "; + printRange(Info, currRange) << endl; + } + + // left-hand-side fragment: insert before current range + label lower = currRange.first(); + label upper = range.first() - 1; + + labelRange fragment(lower, upper - lower + 1); + + // right-hand-side fragment + lower = range.last() + 1; + upper = currRange.last(); + + currRange = labelRange(lower, upper - lower + 1); + status = true; + insertBefore(elemI, fragment); + + if (labelRange::debug) + { + Info<<"fragment "; + printRange(Info, fragment) << endl; + Info<<"yields "; + printRange(Info, currRange) << endl; + } + + // fragmentation can only affect a single range + // thus we are done + break; + } + else if (range.first() <= currRange.last()) + { + // keep left-hand-side, remove right-hand-side + + if (labelRange::debug) + { + Info<<"RHS removal "; + printRange(Info, range) << " from "; + printRange(Info, currRange) << endl; + } + + const label lower = currRange.first(); + const label upper = range.first() - 1; + + currRange = labelRange(lower, upper - lower + 1); + status = true; + + if (labelRange::debug) + { + Info<<"yields "; + printRange(Info, currRange) << endl; + } + } + } + else if (range.first() <= currRange.first()) + { + if (range.last() >= currRange.first()) + { + // remove left-hand-side, keep right-hand-side + + if (labelRange::debug) + { + Info<<"LHS removal "; + printRange(Info, range) << " from "; + printRange(Info, currRange) << endl; + } + + const label lower = range.last() + 1; + const label upper = currRange.last(); + + currRange = labelRange(lower, upper - lower + 1); + status = true; + + if (labelRange::debug) + { + Info<<"yields "; + printRange(Info, currRange) << endl; + } + } + } + } + + purgeEmpty(); + + return status; +} + + +// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // + +Foam::Istream& Foam::operator>>(Istream& is, labelRanges& ranges) +{ + is >> static_cast<labelRanges::ParentType&>(ranges); + return is; +} + + +Foam::Ostream& Foam::operator<<(Ostream& os, const labelRanges& ranges) +{ + os << static_cast<const labelRanges::ParentType&>(ranges); + return os; +} + + +// ************************************************************************* // diff --git a/src/OpenFOAM/primitives/ranges/labelRange/labelRanges.H b/src/OpenFOAM/primitives/ranges/labelRange/labelRanges.H new file mode 100644 index 0000000000000000000000000000000000000000..d8b00970d0ef7c3af9118639fdf004a5239171ef --- /dev/null +++ b/src/OpenFOAM/primitives/ranges/labelRange/labelRanges.H @@ -0,0 +1,191 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 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 <http://www.gnu.org/licenses/>. + +Class + Foam::labelRanges + +Description + A list of labelRange. + +SourceFiles + labelRanges.C + +\*---------------------------------------------------------------------------*/ + +#ifndef labelRanges_H +#define labelRanges_H + +#include "labelRange.H" +#include "DynamicList.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of classes +class Istream; +class Ostream; + +// Forward declaration of friend functions and operators +class labelRanges; +Istream& operator>>(Istream&, labelRanges&); +Ostream& operator<<(Ostream&, const labelRanges&); + +/*---------------------------------------------------------------------------*\ + Class labelRanges Declaration +\*---------------------------------------------------------------------------*/ + +class labelRanges +: + private DynamicList<labelRange> +{ + // Private typedefs for convenience + + typedef DynamicList<labelRange> ParentType; + + + // Private Member Functions + + //- Insert range before specified insertion index, by copying up + void insertBefore(const label, const labelRange&); + + //- Purge empty ranges, by copying down + void purgeEmpty(); + + //- Print the range for debugging purposes + Ostream& printRange(Ostream&, const labelRange&) const; + + +public: + + // Constructors + + //- Construct null + inline labelRanges(); + + //- Construct given size + inline explicit labelRanges(const label); + + //- Construct from Istream. + labelRanges(Istream&); + + + // Member Functions + + //- Clear the addressed list + using DynamicList<labelRange>::clear; + + //- Return true if the list is empty + using DynamicList<labelRange>::empty; + + //- Return true if the value is within any of the ranges + inline bool contains(const label) const; + + //- Add the range to the list + bool add(const labelRange&); + + //- Remove the range from the list + bool remove(const labelRange&); + + // STL iterator + + //- An STL const_iterator + class const_iterator + { + // Private data + + //- Reference to the list for which this is an iterator + const labelRanges& list_; + + //- Current list index + label index_; + + //- Index of current element at listIndex + label subIndex_; + + public: + + // Constructors + + //- Construct null - equivalent to an 'end' position + inline const_iterator(); + + //- Construct from list, moving to its 'begin' position + inline explicit const_iterator(const labelRanges&); + + + // Member operators + + inline bool operator==(const const_iterator&) const; + + inline bool operator!=(const const_iterator&) const; + + inline label operator*(); + inline label operator()(); + + inline const_iterator& operator++(); + inline const_iterator operator++(int); + }; + + + //- const_iterator set to the beginning of the list + inline const_iterator cbegin() const; + + //- const_iterator set to beyond the end of the list + inline const const_iterator& cend() const; + + //- const_iterator set to the beginning of the list + inline const_iterator begin() const; + + //- const_iterator set to beyond the end of the list + inline const const_iterator& end() const; + + + // IOstream Operators + + friend Istream& operator>>(Istream&, labelRanges&); + friend Ostream& operator<<(Ostream&, const labelRanges&); + + +private: + + //- const_iterator returned by end(), cend() + static const const_iterator endIter_; + +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "labelRangesI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/OpenFOAM/primitives/ranges/labelRange/labelRangesI.H b/src/OpenFOAM/primitives/ranges/labelRange/labelRangesI.H new file mode 100644 index 0000000000000000000000000000000000000000..d4b34ace9ffa4246f304651422f658fd2ac3e27a --- /dev/null +++ b/src/OpenFOAM/primitives/ranges/labelRange/labelRangesI.H @@ -0,0 +1,166 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +inline Foam::labelRanges::labelRanges() +: + ParentType() +{} + + +inline Foam::labelRanges::labelRanges(const label nElem) +: + ParentType(nElem) +{} + + +// * * * * * * * * * * * * * * * * Iterators * * * * * * * * * * * * * * * * // + +inline Foam::labelRanges::const_iterator::const_iterator() +: + list_(*reinterpret_cast< Foam::labelRanges* >(0)), + index_(-1), + subIndex_(-1) +{} + + +inline Foam::labelRanges::const_iterator::const_iterator(const labelRanges& lst) +: + list_(lst), + index_(0), + subIndex_(0) +{ + if (list_.empty()) + { + // equivalent to end iterator + index_ = subIndex_ = -1; + } +} + + +inline bool Foam::labelRanges::const_iterator::operator== +( + const const_iterator& iter +) const +{ + return + ( + this->index_ == iter.index_ + && this->subIndex_ == iter.subIndex_ + ); +} + + +inline bool Foam::labelRanges::const_iterator::operator!= +( + const const_iterator& iter +) const +{ + return !(this->operator==(iter)); +} + + +inline Foam::label Foam::labelRanges::const_iterator::operator*() +{ + return list_[index_][subIndex_]; +} + + +inline Foam::label Foam::labelRanges::const_iterator::operator()() +{ + return list_[index_][subIndex_]; +} + + +inline Foam::labelRanges::const_iterator& +Foam::labelRanges::const_iterator::operator++() +{ + if (++subIndex_ >= list_[index_].size()) + { + // go to next list entry + subIndex_ = 0; + if (++index_ >= list_.size()) + { + // equivalent to end iterator + index_ = subIndex_ = -1; + } + } + + return *this; +} + + +inline Foam::labelRanges::const_iterator +Foam::labelRanges::const_iterator::operator++(int) +{ + const_iterator old = *this; + this->operator++(); + return old; +} + + +inline Foam::labelRanges::const_iterator Foam::labelRanges::cbegin() const +{ + return const_iterator(*this); +} + + +inline const Foam::labelRanges::const_iterator& Foam::labelRanges::cend() const +{ + return endIter_; +} + + +inline Foam::labelRanges::const_iterator Foam::labelRanges::begin() const +{ + return const_iterator(*this); +} + + +inline const Foam::labelRanges::const_iterator& Foam::labelRanges::end() const +{ + return endIter_; +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +inline bool Foam::labelRanges::contains(const label value) const +{ + forAll(*this, i) + { + if (this->ParentType::operator[](i).contains(value)) + { + return true; + } + } + + return false; +} + + +// ************************************************************************* // diff --git a/src/OpenFOAM/db/scalarRange/scalarRange.C b/src/OpenFOAM/primitives/ranges/scalarRange/scalarRange.C similarity index 97% rename from src/OpenFOAM/db/scalarRange/scalarRange.C rename to src/OpenFOAM/primitives/ranges/scalarRange/scalarRange.C index f046e7ba8757f691621c135d5aaf3e113eb7408b..4a148c5d635d6435ff6f8d435c4e0b0e65b10ada 100644 --- a/src/OpenFOAM/db/scalarRange/scalarRange.C +++ b/src/OpenFOAM/primitives/ranges/scalarRange/scalarRange.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2007-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -73,7 +73,13 @@ Foam::scalarRange::scalarRange(Istream& is) // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -bool Foam::scalarRange::isDefined() const +bool Foam::scalarRange::empty() const +{ + return type_ == EMPTY; +} + + +bool Foam::scalarRange::valid() const { return type_ != EMPTY; } @@ -149,23 +155,18 @@ bool Foam::scalarRange::selected(const scalar value) const bool Foam::scalarRange::operator==(const scalarRange& range) const { - if + return ( type_ == range.type_ && value_ == range.value_ && value2_ == range.value2_ - ) - { - return true; - } - - return false; + ); } bool Foam::scalarRange::operator!=(const scalarRange& range) const { - return operator==(range) ? false : true; + return !(operator==(range)); } diff --git a/src/OpenFOAM/db/scalarRange/scalarRange.H b/src/OpenFOAM/primitives/ranges/scalarRange/scalarRange.H similarity index 93% rename from src/OpenFOAM/db/scalarRange/scalarRange.H rename to src/OpenFOAM/primitives/ranges/scalarRange/scalarRange.H index 56a293dc370c2138718039d21a8bed8b22530f10..441ae598e5f6a8246c9d33f502bf1963043e07e0 100644 --- a/src/OpenFOAM/db/scalarRange/scalarRange.H +++ b/src/OpenFOAM/primitives/ranges/scalarRange/scalarRange.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2007-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -87,10 +87,10 @@ public: // Constructors - //- Construct Null + //- Construct an empty range scalarRange(); - //- Construct a Range + //- Construct a range from lower to upper scalarRange(const scalar lower, const scalar upper); //- Construct from Istream. @@ -101,8 +101,11 @@ public: // Member Functions + //- Is the range empty? + bool empty() const; + //- Is the range non-empty? - bool isDefined() const; + bool valid() const; //- Is the range 'EXACT'? bool isExact() const; diff --git a/src/OpenFOAM/db/scalarRange/scalarRanges.C b/src/OpenFOAM/primitives/ranges/scalarRange/scalarRanges.C similarity index 97% rename from src/OpenFOAM/db/scalarRange/scalarRanges.C rename to src/OpenFOAM/primitives/ranges/scalarRange/scalarRanges.C index 3b3dfd049d3fd43cb210b2b76ab82cd7ac1c660a..f709baf12d8b6bc24915bf00873e0333a19392e2 100644 --- a/src/OpenFOAM/db/scalarRange/scalarRanges.C +++ b/src/OpenFOAM/primitives/ranges/scalarRange/scalarRanges.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2007-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -44,7 +44,7 @@ Foam::scalarRanges::scalarRanges(Istream& is) while (is.good()) { scalarRange sr(is); - if (sr.isDefined()) + if (sr.valid()) { lst.append(sr); } diff --git a/src/OpenFOAM/db/scalarRange/scalarRanges.H b/src/OpenFOAM/primitives/ranges/scalarRange/scalarRanges.H similarity index 97% rename from src/OpenFOAM/db/scalarRange/scalarRanges.H rename to src/OpenFOAM/primitives/ranges/scalarRange/scalarRanges.H index 5d2a7969e2f516c43fa53b1f47570c79b033beb9..f3aba0715c68a34df1029c8352499f9cb6e4b33c 100644 --- a/src/OpenFOAM/db/scalarRange/scalarRanges.H +++ b/src/OpenFOAM/primitives/ranges/scalarRange/scalarRanges.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2007-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/conversion/meshReader/createPolyBoundary.C b/src/conversion/meshReader/createPolyBoundary.C index 16ea5d2a980992493f4d3f8e905d0dbf7621bc67..712ed643e051a3dcc7169379e0922a91bece4aec 100644 --- a/src/conversion/meshReader/createPolyBoundary.C +++ b/src/conversion/meshReader/createPolyBoundary.C @@ -305,7 +305,7 @@ void Foam::meshReader::createPolyBoundary() if (nMissingFaces > 0) { - patchSizes_[patchSizes_.size() - 1] = nMissingFaces; + patchSizes_.last() = nMissingFaces; } else { diff --git a/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.C b/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.C index 6ea8c123d0feee1ddd58c638f7eb2987cb95da46..12f6d34da87a45d1c4b8e678e53b97aacadb65b5 100644 --- a/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.C +++ b/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.C @@ -301,12 +301,14 @@ Foam::dynamicRefineFvMesh::refine ( lookupObject<surfaceScalarField>(correctFluxes_[i][0]) ); - surfaceScalarField phiU = + const surfaceScalarField phiU + ( fvc::interpolate ( lookupObject<volVectorField>(correctFluxes_[i][1]) ) - & Sf(); + & Sf() + ); // Recalculate new internal faces. for (label faceI = 0; faceI < nInternalFaces(); faceI++) @@ -492,12 +494,14 @@ Foam::dynamicRefineFvMesh::unrefine ( lookupObject<surfaceScalarField>(correctFluxes_[i][0]) ); - surfaceScalarField phiU = + surfaceScalarField phiU + ( fvc::interpolate ( lookupObject<volVectorField>(correctFluxes_[i][1]) ) - & Sf(); + & Sf() + ); forAllConstIter(Map<label>, faceToSplitPoint, iter) { diff --git a/src/dynamicFvMesh/include/meshCourantNo.H b/src/dynamicFvMesh/include/meshCourantNo.H index 501611db18d2c635adf4454a5a6383eb9c42c7d6..ad8f679657382f98a3af8d7639439342f0c96140 100644 --- a/src/dynamicFvMesh/include/meshCourantNo.H +++ b/src/dynamicFvMesh/include/meshCourantNo.H @@ -34,8 +34,10 @@ scalar meanMeshCoNum = 0.0; if (mesh.nInternalFaces()) { - scalarField sumPhi = - fvc::surfaceSum(mag(mesh.phi()))().internalField(); + scalarField sumPhi + ( + fvc::surfaceSum(mag(mesh.phi()))().internalField() + ); meshCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue(); diff --git a/src/dynamicMesh/layerAdditionRemoval/removeCellLayer.C b/src/dynamicMesh/layerAdditionRemoval/removeCellLayer.C index 9516bb95e0e9ae9e2bfd1ff4778ecb5ff9de156b..1204a1967c9356b84dc6de981bab09ec413be88d 100644 --- a/src/dynamicMesh/layerAdditionRemoval/removeCellLayer.C +++ b/src/dynamicMesh/layerAdditionRemoval/removeCellLayer.C @@ -360,7 +360,7 @@ void Foam::layerAdditionRemoval::removeCellLayer if (flipFace) { - newFace = newFace.reverseFace(); + newFace.flip(); zoneFlip = !zoneFlip; } diff --git a/src/dynamicMesh/layerAdditionRemoval/setLayerPairing.C b/src/dynamicMesh/layerAdditionRemoval/setLayerPairing.C index f401b664305227f738d33e75f962c71fc9207293..a5af000fa83a96d536e9eb02e493bb6a91a81f8e 100644 --- a/src/dynamicMesh/layerAdditionRemoval/setLayerPairing.C +++ b/src/dynamicMesh/layerAdditionRemoval/setLayerPairing.C @@ -105,7 +105,7 @@ bool Foam::layerAdditionRemoval::setLayerPairing() const // Flip face based on flip index to recover original orientation if (mfFlip[faceI]) { - curLocalFace = curLocalFace.reverseFace(); + curLocalFace.flip(); } // Get the opposing face from the master cell diff --git a/src/dynamicMesh/meshCut/directions/directionInfo/directionInfo.C b/src/dynamicMesh/meshCut/directions/directionInfo/directionInfo.C index c35bb701bb8ec1854b40f1fdf07d734db3b6c9b5..78faa944145f6b004b65dea507abb2c0bf762ce3 100644 --- a/src/dynamicMesh/meshCut/directions/directionInfo/directionInfo.C +++ b/src/dynamicMesh/meshCut/directions/directionInfo/directionInfo.C @@ -243,7 +243,7 @@ Foam::Istream& Foam::operator>>(Foam::Istream& is, Foam::directionInfo& wDist) // Check state of Istream is.check("Istream& operator>>(Istream&, directionInfo&)"); - return is; + return is; } // ************************************************************************* // diff --git a/src/dynamicMesh/meshCut/directions/directions.C b/src/dynamicMesh/meshCut/directions/directions.C index 7024c2ffbc59bd8364e487462daed5c3ac892138..629a3abd5661ab5d530fa029aadc9dcc0ad3da59 100644 --- a/src/dynamicMesh/meshCut/directions/directions.C +++ b/src/dynamicMesh/meshCut/directions/directions.C @@ -39,7 +39,11 @@ License namespace Foam { template<> - const char* Foam::NamedEnum<Foam::directions::directionType, 3>::names[] = + const char* Foam::NamedEnum + < + Foam::directions::directionType, + 3 + >::names[] = { "tan1", "tan2", @@ -269,7 +273,6 @@ Foam::vectorField Foam::directions::propagateDirection // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from dictionary Foam::directions::directions ( const polyMesh& mesh, @@ -353,7 +356,7 @@ Foam::directions::directions FatalErrorIn ( "directions::directions(const polyMesh&, const dictionary&," - "const twoDPointCorrector*" + "const twoDPointCorrector*)" ) << "Cannot find patch " << patchName << exit(FatalError); @@ -373,7 +376,7 @@ Foam::directions::directions WarningIn ( "directions::directions(const polyMesh&, const dictionary&," - "const twoDPointCorrector*" + "const twoDPointCorrector*)" ) << "Discarding user specified tan1 since 2D case." << endl << "Recalculated tan1 from face normal and planeNormal as " << tan1 << endl << endl; @@ -398,10 +401,7 @@ Foam::directions::directions if (wantNormal) { - operator[](nDirs++) = normalDirs; - - //// Dump to file. - //writeOBJ("normal.obj", mesh, normalDirs); + this->operator[](nDirs++) = normalDirs; } } @@ -420,20 +420,14 @@ Foam::directions::directions if (wantTan1) { - operator[](nDirs++) = tan1Dirs; - - //// Dump to file. - //writeOBJ("tan1.obj", mesh, tan1Dirs); + this->operator[](nDirs++) = tan1Dirs; } } if (wantTan2) { - vectorField tan2Dirs = normalDirs ^ tan1Dirs; - - operator[](nDirs++) = tan2Dirs; + tmp<vectorField> tan2Dirs = normalDirs ^ tan1Dirs; - //// Dump to file. - //writeOBJ("tan2.obj", mesh, tan2Dirs); + this->operator[](nDirs++) = tan2Dirs; } } else @@ -441,7 +435,7 @@ Foam::directions::directions FatalErrorIn ( "directions::directions(const polyMesh&, const dictionary&," - "const twoDPointCorrector*" + "const twoDPointCorrector*)" ) << "Unknown coordinate system " << coordSystem << endl << "Known types are global and patchLocal" diff --git a/src/dynamicMesh/polyMeshAdder/polyMeshAdder.C b/src/dynamicMesh/polyMeshAdder/polyMeshAdder.C index d5041792f1707895ec535a8885132dc4c3b450e7..845150a035473848d81e3f3b069f615f4d581eb0 100644 --- a/src/dynamicMesh/polyMeshAdder/polyMeshAdder.C +++ b/src/dynamicMesh/polyMeshAdder/polyMeshAdder.C @@ -127,7 +127,7 @@ Foam::label Foam::polyMeshAdder::patchIndex << pName << " in mesh " << caseName << " already exists, but patch types" << " do not match.\nCreating a composite name as " - << allPatchNames[allPatchNames.size() - 1] << endl; + << allPatchNames.last() << endl; return allPatchNames.size() - 1; } diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8.C b/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8.C index 5370d79f73edd897ab925838b6c6c6b27d1fe36e..0e7fe903133d8709bba091701f7dc0dc90c766fa 100644 --- a/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8.C +++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8.C @@ -1125,7 +1125,7 @@ Foam::label Foam::hexRef8::storeMidPointInfo { own = anchorCell1; nei = anchorCell0; - newFace = newFace.reverseFace(); + newFace.flip(); ownPt = mesh_.points()[anchors.otherVertex(anchorPointI)]; neiPt = mesh_.points()[anchorPointI]; diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C b/src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C index ccbe736f8d2f1dea53d0287f61ace173faf362b3..2b3232b3d5f278d61ed603505fd24c4d4a7fd1d9 100644 --- a/src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C +++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C @@ -1078,7 +1078,7 @@ void Foam::polyTopoChange::compact && faceNeighbour_[faceI] < faceOwner_[faceI] ) { - faces_[faceI] = faces_[faceI].reverseFace(); + faces_[faceI].flip(); Swap(faceOwner_[faceI], faceNeighbour_[faceI]); flipFaceFlux_[faceI] = ( diff --git a/src/dynamicMesh/slidingInterface/decoupleSlidingInterface.C b/src/dynamicMesh/slidingInterface/decoupleSlidingInterface.C index 7531a2acfcbb003455257be9b19228e70469236f..eed4804faf91890381271e5e05dff6137d1aa0a8 100644 --- a/src/dynamicMesh/slidingInterface/decoupleSlidingInterface.C +++ b/src/dynamicMesh/slidingInterface/decoupleSlidingInterface.C @@ -89,7 +89,7 @@ void Foam::slidingInterface::decoupleInterface if (masterPatchFlip[faceI]) { - newFace = newFace.reverseFace(); + newFace.flip(); } ref.setAction @@ -141,7 +141,7 @@ void Foam::slidingInterface::decoupleInterface if (slavePatchFlip[faceI]) { - newFace = newFace.reverseFace(); + newFace.flip(); } // Recover retired points on the slave side diff --git a/src/dynamicMesh/slidingInterface/enrichedPatch/enrichedPatch.H b/src/dynamicMesh/slidingInterface/enrichedPatch/enrichedPatch.H index 1054b06a77ed377172ec7c4c20f678c45dfeb368..954061378d894b6a6c929857c72341d6af54d8de 100644 --- a/src/dynamicMesh/slidingInterface/enrichedPatch/enrichedPatch.H +++ b/src/dynamicMesh/slidingInterface/enrichedPatch/enrichedPatch.H @@ -61,8 +61,6 @@ SourceFiles namespace Foam { -// Forward declaration of classes - /*---------------------------------------------------------------------------*\ Class enrichedPatch Declaration \*---------------------------------------------------------------------------*/ diff --git a/src/dynamicMesh/slidingInterface/enrichedPatch/enrichedPatchCutFaces.C b/src/dynamicMesh/slidingInterface/enrichedPatch/enrichedPatchCutFaces.C index 85c11da33c15d764eb18bdc86d67fe5e5f99b0b8..ffc999328bb38b9dcbb906d67737c4c8113489fd 100644 --- a/src/dynamicMesh/slidingInterface/enrichedPatch/enrichedPatchCutFaces.C +++ b/src/dynamicMesh/slidingInterface/enrichedPatch/enrichedPatchCutFaces.C @@ -519,8 +519,7 @@ void Foam::enrichedPatch::calcCutFaces() const // Reverse the face such that it // points out of the master patch - cf[cf.size() - 1] = - cf[cf.size() - 1].reverseFace(); + cf.last().flip(); if (debug) { diff --git a/src/dynamicMesh/slidingInterface/slidingInterface.H b/src/dynamicMesh/slidingInterface/slidingInterface.H index 47f4bcfb57f3a391c12ff0803f4b8c4760e167af..7d2eb17d347881aeb10eb5839b2365506550175e 100644 --- a/src/dynamicMesh/slidingInterface/slidingInterface.H +++ b/src/dynamicMesh/slidingInterface/slidingInterface.H @@ -58,15 +58,13 @@ SourceFiles #include "ZoneIDs.H" #include "intersection.H" #include "Pair.H" +#include "objectHit.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { -// Forward declaration of classes -class objectHit; - /*---------------------------------------------------------------------------*\ Class slidingInterface Declaration \*---------------------------------------------------------------------------*/ diff --git a/src/engine/engineMesh/fvMotionSolverEngineMesh/fvMotionSolverEngineMesh.C b/src/engine/engineMesh/fvMotionSolverEngineMesh/fvMotionSolverEngineMesh.C index 4f43e0d822016b88d39d11083019dd5c55ac6c08..8c7db2230b66da59ecc7dbbc18c4dac3dd756e18 100644 --- a/src/engine/engineMesh/fvMotionSolverEngineMesh/fvMotionSolverEngineMesh.C +++ b/src/engine/engineMesh/fvMotionSolverEngineMesh/fvMotionSolverEngineMesh.C @@ -68,9 +68,11 @@ void Foam::fvMotionSolverEngineMesh::move() motionSolver_.cellMotionU().boundaryField()[pistonIndex_] == deltaZ; { - scalarField linerPoints = + scalarField linerPoints + ( motionSolver_.cellMotionU() - .boundaryField()[linerIndex_].patch().Cf().component(vector::Z); + .boundaryField()[linerIndex_].patch().Cf().component(vector::Z) + ); motionSolver_.cellMotionU().boundaryField()[linerIndex_] == deltaZ*pos(deckHeight_.value() - linerPoints) diff --git a/src/engine/engineMesh/layeredEngineMesh/layeredEngineMesh.C b/src/engine/engineMesh/layeredEngineMesh/layeredEngineMesh.C index 41285ea67af32c671e17786ccc51c645be37f097..abe366a5c57c5039dafd4517966c650a4279f840 100644 --- a/src/engine/engineMesh/layeredEngineMesh/layeredEngineMesh.C +++ b/src/engine/engineMesh/layeredEngineMesh/layeredEngineMesh.C @@ -64,7 +64,7 @@ void Foam::layeredEngineMesh::move() // Position of the top of the static mesh layers above the piston scalar pistonPlusLayers = pistonPosition_.value() + pistonLayers_.value(); - pointField newPoints = points(); + pointField newPoints(points()); forAll(newPoints, pointi) { diff --git a/src/engine/include/StCorr.H b/src/engine/include/StCorr.H index 80df7f0af4fe907957286fcfbd4815a15911691f..c3bdc5771f76dad77aa156605d6cdec82a4397fb 100644 --- a/src/engine/include/StCorr.H +++ b/src/engine/include/StCorr.H @@ -80,8 +80,10 @@ // Calculate kernel area from b field consistent with the // discretisation of the b equation. - volScalarField mgb = - fvc::div(nf, b, "div(phiSt,b)") - b*fvc::div(nf) + dMgb; + const volScalarField mgb + ( + fvc::div(nf, b, "div(phiSt,b)") - b*fvc::div(nf) + dMgb + ); dimensionedScalar AkEst = gSum(mgb*mesh.V().field()); StCorr.value() = max(min((Ak/AkEst).value(), 10.0), 1.0); diff --git a/src/errorEstimation/errorDrivenRefinement/errorDrivenRefinement.C b/src/errorEstimation/errorDrivenRefinement/errorDrivenRefinement.C index e7c08e25af69d227e675eee9717d0e2353f6b3d4..feb02199545ac8c3714be327558d5f22688143dd 100644 --- a/src/errorEstimation/errorDrivenRefinement/errorDrivenRefinement.C +++ b/src/errorEstimation/errorDrivenRefinement/errorDrivenRefinement.C @@ -130,7 +130,7 @@ void Foam::errorDrivenRefinement::setRefinement(polyTopoChange& ref) const const volVectorField& resError = runTime.lookupObject<volVectorField>(errorField_); - const volScalarField magResError = Foam::mag(resError); + const volScalarField magResError(Foam::mag(resError)); scalar min = Foam::min(magResError).value(); scalar max = Foam::max(magResError).value(); diff --git a/src/errorEstimation/errorEstimate/resErrorDiv.C b/src/errorEstimation/errorEstimate/resErrorDiv.C index d374b180ea6ba93afbf342905bffac8a53272d21..b1a0d908818947b6ee115c85bae2b5ef22c8030e 100644 --- a/src/errorEstimation/errorEstimate/resErrorDiv.C +++ b/src/errorEstimation/errorEstimate/resErrorDiv.C @@ -57,13 +57,14 @@ div scalarField aNorm(vols.size(), 0.0); // Get sign of flux - const surfaceScalarField signF = pos(flux); + const surfaceScalarField signF(pos(flux)); // Calculate gradient of the solution GeometricField < typename outerProduct<vector, Type>::type, fvPatchField, volMesh - > gradVf = fvc::grad(vf); + > + gradVf(fvc::grad(vf)); // Internal faces forAll(owner, faceI) diff --git a/src/errorEstimation/errorEstimate/resErrorLaplacian.C b/src/errorEstimation/errorEstimate/resErrorLaplacian.C index c310a583b304434be3ef9d727ad954e35904d6b0..3d895e62fbf3a74de5a062160f99d7edd1551d9c 100644 --- a/src/errorEstimation/errorEstimate/resErrorLaplacian.C +++ b/src/errorEstimation/errorEstimate/resErrorLaplacian.C @@ -122,7 +122,7 @@ laplacian const scalarField& vols = mesh.V(); const surfaceVectorField& Sf = mesh.Sf(); - const surfaceScalarField magSf = mesh.magSf(); + const surfaceScalarField magSf(mesh.magSf()); const fvPatchList& patches = mesh.boundary(); const labelUList& owner = mesh.owner(); const labelUList& neighbour = mesh.neighbour(); @@ -137,7 +137,8 @@ laplacian GeometricField < typename outerProduct<vector, Type>::type, fvPatchField, volMesh - > gradVf = fvc::grad(vf); + > + gradVf(fvc::grad(vf)); // Internal faces forAll(owner, faceI) diff --git a/src/finiteVolume/cfdTools/compressible/compressibleCourantNo.H b/src/finiteVolume/cfdTools/compressible/compressibleCourantNo.H index c96ddeb22ffa9f33765ef6e71e32d434c5096728..cd5e92ed3dfae1325f6c8bde75917a38a8de66cc 100644 --- a/src/finiteVolume/cfdTools/compressible/compressibleCourantNo.H +++ b/src/finiteVolume/cfdTools/compressible/compressibleCourantNo.H @@ -34,9 +34,11 @@ scalar meanCoNum = 0.0; if (mesh.nInternalFaces()) { - scalarField sumPhi = + scalarField sumPhi + ( fvc::surfaceSum(mag(phi))().internalField() - /rho.internalField(); + / rho.internalField() + ); CoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue(); diff --git a/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModel.C b/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModel.C index c714c6a83d682a91dd76d3b7ff76e4dcd31d9ae7..21ee073fef9ce66cd7639464d890749428dd3463 100644 --- a/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModel.C +++ b/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModel.C @@ -162,7 +162,10 @@ Foam::vectorField Foam::SRF::SRFModel::velocity const vectorField& positions ) const { - return omega_.value() ^ (positions - axis_*(axis_ & positions)); + tmp<vectorField> tfld = + omega_.value() ^ (positions - axis_*(axis_ & positions)); + + return tfld(); } @@ -188,7 +191,7 @@ Foam::tmp<Foam::volVectorField> Foam::SRF::SRFModel::U() const Foam::tmp<Foam::volVectorField> Foam::SRF::SRFModel::Uabs() const { - const volVectorField Usrf = U(); + tmp<volVectorField> Usrf = U(); tmp<volVectorField> tUabs ( diff --git a/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.C b/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.C index c697e5b9a7b1e838828094b2576a49cae0264252..2f00ad181eea512529a8619e125093539c7bf921 100644 --- a/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.C +++ b/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.C @@ -29,14 +29,9 @@ License #include "SRFModel.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -SRFVelocityFvPatchVectorField::SRFVelocityFvPatchVectorField +Foam::SRFVelocityFvPatchVectorField::SRFVelocityFvPatchVectorField ( const fvPatch& p, const DimensionedField<vector, volMesh>& iF @@ -48,7 +43,7 @@ SRFVelocityFvPatchVectorField::SRFVelocityFvPatchVectorField {} -SRFVelocityFvPatchVectorField::SRFVelocityFvPatchVectorField +Foam::SRFVelocityFvPatchVectorField::SRFVelocityFvPatchVectorField ( const SRFVelocityFvPatchVectorField& ptf, const fvPatch& p, @@ -62,7 +57,7 @@ SRFVelocityFvPatchVectorField::SRFVelocityFvPatchVectorField {} -SRFVelocityFvPatchVectorField::SRFVelocityFvPatchVectorField +Foam::SRFVelocityFvPatchVectorField::SRFVelocityFvPatchVectorField ( const fvPatch& p, const DimensionedField<vector, volMesh>& iF, @@ -77,7 +72,7 @@ SRFVelocityFvPatchVectorField::SRFVelocityFvPatchVectorField } -SRFVelocityFvPatchVectorField::SRFVelocityFvPatchVectorField +Foam::SRFVelocityFvPatchVectorField::SRFVelocityFvPatchVectorField ( const SRFVelocityFvPatchVectorField& srfvpvf ) @@ -88,7 +83,7 @@ SRFVelocityFvPatchVectorField::SRFVelocityFvPatchVectorField {} -SRFVelocityFvPatchVectorField::SRFVelocityFvPatchVectorField +Foam::SRFVelocityFvPatchVectorField::SRFVelocityFvPatchVectorField ( const SRFVelocityFvPatchVectorField& srfvpvf, const DimensionedField<vector, volMesh>& iF @@ -102,7 +97,7 @@ SRFVelocityFvPatchVectorField::SRFVelocityFvPatchVectorField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void SRFVelocityFvPatchVectorField::autoMap +void Foam::SRFVelocityFvPatchVectorField::autoMap ( const fvPatchFieldMapper& m ) @@ -112,7 +107,7 @@ void SRFVelocityFvPatchVectorField::autoMap } -void SRFVelocityFvPatchVectorField::rmap +void Foam::SRFVelocityFvPatchVectorField::rmap ( const fvPatchVectorField& ptf, const labelList& addr @@ -127,7 +122,7 @@ void SRFVelocityFvPatchVectorField::rmap } -void SRFVelocityFvPatchVectorField::updateCoeffs() +void Foam::SRFVelocityFvPatchVectorField::updateCoeffs() { if (updated()) { @@ -142,7 +137,7 @@ void SRFVelocityFvPatchVectorField::updateCoeffs() db().lookupObject<SRF::SRFModel>("SRFProperties"); // Determine patch velocity due to SRF - const vectorField SRFVelocity = srf.velocity(patch().Cf()); + const vectorField SRFVelocity(srf.velocity(patch().Cf())); operator==(-SRFVelocity + inletValue_); } @@ -156,7 +151,7 @@ void SRFVelocityFvPatchVectorField::updateCoeffs() } -void SRFVelocityFvPatchVectorField::write(Ostream& os) const +void Foam::SRFVelocityFvPatchVectorField::write(Ostream& os) const { fvPatchVectorField::write(os); os.writeKeyword("relative") << relative_ << token::END_STATEMENT << nl; @@ -167,14 +162,13 @@ void SRFVelocityFvPatchVectorField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField -( - fvPatchVectorField, - SRFVelocityFvPatchVectorField -); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam +namespace Foam +{ + makeNonTemplatedPatchTypeField + ( + fvPatchVectorField, + SRFVelocityFvPatchVectorField + ); +} // ************************************************************************* // diff --git a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/actuationDiskSource/actuationDiskSourceTemplates.C b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/actuationDiskSource/actuationDiskSourceTemplates.C index 971b8edfcdd12c3b015db6a2a54db2da07164cc4..dde7ffc3c23da766b8bba97de11c7a9ed4e27665 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/actuationDiskSource/actuationDiskSourceTemplates.C +++ b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/actuationDiskSource/actuationDiskSourceTemplates.C @@ -49,7 +49,7 @@ void Foam::actuationDiskSource::addActuationDiskAxialInertialResistance E.xx() = uniDiskDir.x(); E.yy() = uniDiskDir.y(); E.zz() = uniDiskDir.z(); - vectorField U1 = (1.0 - a)*U; + const vectorField U1((1.0 - a)*U); forAll(cells, i) { totVol += V[cells[i]]; diff --git a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSource/explicitSource.H b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSource/explicitSource.H index 5ea397a8c35c7a12fc2aa0883e705d0cd6fc0073..b2a930b27f9a86aa1686acd6d8a6f657fe17e932 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSource/explicitSource.H +++ b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSource/explicitSource.H @@ -63,7 +63,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class explicitSource Declaration + Class explicitSource Declaration \*---------------------------------------------------------------------------*/ class explicitSource @@ -86,7 +86,7 @@ class explicitSource fieldList() : HashTable<Type>(0), - OwnerPtr_() + OwnerPtr_(*reinterpret_cast<explicitSource*>(0)) {} @@ -107,7 +107,7 @@ class explicitSource { geometricField& field = const_cast<geometricField&> ( - OwnerPtr_.mesh().lookupObject<geometricField> + OwnerPtr_.mesh().template lookupObject<geometricField> (this->toc()[i]) ); diff --git a/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/TimeActivatedExplicitSourceList.C b/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/TimeActivatedExplicitSourceList.C index 95f5109f56de6754daf6929c74defb7ef06af5db..45c405853cad575e835d7ca0be0be25b51f6ebb7 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/TimeActivatedExplicitSourceList.C +++ b/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/TimeActivatedExplicitSourceList.C @@ -175,7 +175,7 @@ bool Foam::TimeActivatedExplicitSourceList<Type>::readData(Istream& is) typename TimeActivatedExplicitSource<Type>::iNew(mesh_, fieldNames_) ); - transfer(newSources); + this->transfer(newSources); return is.good(); } diff --git a/src/finiteVolume/cfdTools/general/porousMedia/PorousZones.C b/src/finiteVolume/cfdTools/general/porousMedia/PorousZones.C index aea310c4e27b8de6254fa4e268a413f18e39e886..d3c66a715d2387535d73dbc9c64c04b9528738ae 100644 --- a/src/finiteVolume/cfdTools/general/porousMedia/PorousZones.C +++ b/src/finiteVolume/cfdTools/general/porousMedia/PorousZones.C @@ -175,7 +175,7 @@ bool Foam::PorousZones<ZoneType>::readData(Istream& is) typename ZoneType::iNew(mesh_) ); - transfer(newLst); + this->transfer(newLst); return is.good(); } diff --git a/src/finiteVolume/cfdTools/incompressible/CourantNo.H b/src/finiteVolume/cfdTools/incompressible/CourantNo.H index 8b917e1f89fb2dc15e207c42d1a1c0b6d0320d52..d5198141a327d0fb8aacca67bad4d3934265ccb6 100644 --- a/src/finiteVolume/cfdTools/incompressible/CourantNo.H +++ b/src/finiteVolume/cfdTools/incompressible/CourantNo.H @@ -34,8 +34,10 @@ scalar meanCoNum = 0.0; if (mesh.nInternalFaces()) { - scalarField sumPhi = - fvc::surfaceSum(mag(phi))().internalField(); + scalarField sumPhi + ( + fvc::surfaceSum(mag(phi))().internalField() + ); CoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue(); diff --git a/src/finiteVolume/cfdTools/incompressible/continuityErrs.H b/src/finiteVolume/cfdTools/incompressible/continuityErrs.H index 181cd251eb72ef1d945bf4e738a0292fe8e03a56..06287750bd09f8ae7034589c13871d0c02ae38d9 100644 --- a/src/finiteVolume/cfdTools/incompressible/continuityErrs.H +++ b/src/finiteVolume/cfdTools/incompressible/continuityErrs.H @@ -30,7 +30,7 @@ Description \*---------------------------------------------------------------------------*/ { - volScalarField contErr = fvc::div(phi); + volScalarField contErr(fvc::div(phi)); scalar sumLocalContErr = runTime.deltaTValue()* mag(contErr)().weightedAverage(mesh.V()).value(); diff --git a/src/finiteVolume/fields/fvPatchFields/basic/basicSymmetry/basicSymmetryFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/basic/basicSymmetry/basicSymmetryFvPatchField.C index b300f4354daa2c0cba7d0062e6c7cdce2b0d261d..744ef0a8687feb68ae036b9015641e99e10d468e 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/basicSymmetry/basicSymmetryFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/basic/basicSymmetry/basicSymmetryFvPatchField.C @@ -26,15 +26,11 @@ License #include "basicSymmetryFvPatchField.H" #include "symmTransformField.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class Type> -basicSymmetryFvPatchField<Type>::basicSymmetryFvPatchField +Foam::basicSymmetryFvPatchField<Type>::basicSymmetryFvPatchField ( const fvPatch& p, const DimensionedField<Type, volMesh>& iF @@ -45,7 +41,7 @@ basicSymmetryFvPatchField<Type>::basicSymmetryFvPatchField template<class Type> -basicSymmetryFvPatchField<Type>::basicSymmetryFvPatchField +Foam::basicSymmetryFvPatchField<Type>::basicSymmetryFvPatchField ( const basicSymmetryFvPatchField<Type>& ptf, const fvPatch& p, @@ -58,7 +54,7 @@ basicSymmetryFvPatchField<Type>::basicSymmetryFvPatchField template<class Type> -basicSymmetryFvPatchField<Type>::basicSymmetryFvPatchField +Foam::basicSymmetryFvPatchField<Type>::basicSymmetryFvPatchField ( const fvPatch& p, const DimensionedField<Type, volMesh>& iF, @@ -72,7 +68,7 @@ basicSymmetryFvPatchField<Type>::basicSymmetryFvPatchField template<class Type> -basicSymmetryFvPatchField<Type>::basicSymmetryFvPatchField +Foam::basicSymmetryFvPatchField<Type>::basicSymmetryFvPatchField ( const basicSymmetryFvPatchField<Type>& ptf ) @@ -82,7 +78,7 @@ basicSymmetryFvPatchField<Type>::basicSymmetryFvPatchField template<class Type> -basicSymmetryFvPatchField<Type>::basicSymmetryFvPatchField +Foam::basicSymmetryFvPatchField<Type>::basicSymmetryFvPatchField ( const basicSymmetryFvPatchField<Type>& ptf, const DimensionedField<Type, volMesh>& iF @@ -95,9 +91,10 @@ basicSymmetryFvPatchField<Type>::basicSymmetryFvPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class Type> -tmp<Field<Type> > basicSymmetryFvPatchField<Type>::snGrad() const +Foam::tmp<Foam::Field<Type> > +Foam::basicSymmetryFvPatchField<Type>::snGrad() const { - vectorField nHat = this->patch().nf(); + tmp<vectorField> nHat = this->patch().nf(); return ( @@ -108,14 +105,14 @@ tmp<Field<Type> > basicSymmetryFvPatchField<Type>::snGrad() const template<class Type> -void basicSymmetryFvPatchField<Type>::evaluate(const Pstream::commsTypes) +void Foam::basicSymmetryFvPatchField<Type>::evaluate(const Pstream::commsTypes) { if (!this->updated()) { this->updateCoeffs(); } - vectorField nHat = this->patch().nf(); + tmp<vectorField> nHat = this->patch().nf(); Field<Type>::operator= ( @@ -130,9 +127,10 @@ void basicSymmetryFvPatchField<Type>::evaluate(const Pstream::commsTypes) template<class Type> -tmp<Field<Type> > basicSymmetryFvPatchField<Type>::snGradTransformDiag() const +Foam::tmp<Foam::Field<Type> > +Foam::basicSymmetryFvPatchField<Type>::snGradTransformDiag() const { - vectorField nHat = this->patch().nf(); + const vectorField nHat(this->patch().nf()); vectorField diag(nHat.size()); @@ -144,8 +142,4 @@ tmp<Field<Type> > basicSymmetryFvPatchField<Type>::snGradTransformDiag() const } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/basic/basicSymmetry/basicSymmetryFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/basic/basicSymmetry/basicSymmetryFvPatchFields.H index dd8ea508642a4c0358b951012e86d895a9828afb..c3dda81f6464b11b582afe59ba809c3585c7292b 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/basicSymmetry/basicSymmetryFvPatchFields.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/basicSymmetry/basicSymmetryFvPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(basicSymmetry) +makePatchTypeFieldTypedefs(basicSymmetry); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/basic/calculated/calculatedFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/basic/calculated/calculatedFvPatchFields.H index d115909f66309a131ca51c64357b9be0e847a799..8e50436dd8c7c00bc081c1c8d6674c840412681f 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/calculated/calculatedFvPatchFields.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/calculated/calculatedFvPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(calculated) +makePatchTypeFieldTypedefs(calculated); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/basic/calculated/calculatedFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/basic/calculated/calculatedFvPatchFieldsFwd.H index e162ee1159f601d9e84fc56b2fe128f6cba85db7..4dd63efdb750da071bede155e2ce7c8b3bdf2e8d 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/calculated/calculatedFvPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/calculated/calculatedFvPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class calculatedFvPatchField; -makePatchTypeFieldTypedefs(calculated) +makePatchTypeFieldTypedefs(calculated); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchFields.H index 0ee57d4c36e72f395d00b330fb4cca30ca27098d..e5ac1d0db609aff6a1ea1e458812f42f4950edc1 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchFields.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(coupled) +makePatchTypeFieldTypedefs(coupled); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchFieldsFwd.H index c4a049f24e44cf77fcaa559d6acbb32fd1b5fdca..3e6ec75026e83c63d129d443cba13b46dac0dfd0 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class coupledFvPatchField; -makePatchTypeFieldTypedefs(coupled) +makePatchTypeFieldTypedefs(coupled); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/basic/directionMixed/directionMixedFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/basic/directionMixed/directionMixedFvPatchField.C index ebeb9e2b2d758421a608a51e63b7210449d64e22..6632299ffe78f47cc8b07938a7b8c6e88430396b 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/directionMixed/directionMixedFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/basic/directionMixed/directionMixedFvPatchField.C @@ -126,13 +126,13 @@ template<class Type> Foam::tmp<Foam::Field<Type> > Foam::directionMixedFvPatchField<Type>::snGrad() const { - Field<Type> pif = this->patchInternalField(); + const Field<Type> pif(this->patchInternalField()); - Field<Type> normalValue = transform(valueFraction_, refValue_); + tmp<Field<Type> > normalValue = transform(valueFraction_, refValue_); - Field<Type> gradValue = pif + refGrad_/this->patch().deltaCoeffs(); + tmp<Field<Type> > gradValue = pif + refGrad_/this->patch().deltaCoeffs(); - Field<Type> transformGradValue = + tmp<Field<Type> > transformGradValue = transform(I - valueFraction_, gradValue); return @@ -149,12 +149,12 @@ void Foam::directionMixedFvPatchField<Type>::evaluate(const Pstream::commsTypes) this->updateCoeffs(); } - Field<Type> normalValue = transform(valueFraction_, refValue_); + tmp<Field<Type> > normalValue = transform(valueFraction_, refValue_); - Field<Type> gradValue = + tmp<Field<Type> > gradValue = this->patchInternalField() + refGrad_/this->patch().deltaCoeffs(); - Field<Type> transformGradValue = + tmp<Field<Type> > transformGradValue = transform(I - valueFraction_, gradValue); Field<Type>::operator=(normalValue + transformGradValue); diff --git a/src/finiteVolume/fields/fvPatchFields/basic/directionMixed/directionMixedFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/basic/directionMixed/directionMixedFvPatchFields.H index 8a1c54b3dc7aa78d3e4e8a0c48ce0ac7c0de8f4f..d32f5f0de278587c1d6f01aad18554fc275cbddc 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/directionMixed/directionMixedFvPatchFields.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/directionMixed/directionMixedFvPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(directionMixed) +makePatchTypeFieldTypedefs(directionMixed); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/basic/directionMixed/directionMixedFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/basic/directionMixed/directionMixedFvPatchFieldsFwd.H index 9d8365e06558ced51b51ce7cd350b97ed6e164fc..303c0e469628b10ce202cfcf6c68dc1a4668becc 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/directionMixed/directionMixedFvPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/directionMixed/directionMixedFvPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class directionMixedFvPatchField; -makePatchTypeFieldTypedefs(directionMixed) +makePatchTypeFieldTypedefs(directionMixed); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/basic/fixedGradient/fixedGradientFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/basic/fixedGradient/fixedGradientFvPatchFields.H index 08394bd3f85b722d2179a9dd91603f6384c955f7..68197a3a6741bfe8f40273c99c1862670938f3b6 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/fixedGradient/fixedGradientFvPatchFields.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/fixedGradient/fixedGradientFvPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(fixedGradient) +makePatchTypeFieldTypedefs(fixedGradient); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/basic/fixedGradient/fixedGradientFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/basic/fixedGradient/fixedGradientFvPatchFieldsFwd.H index 7c1c25b91ecf1b2a4f75e3a8436d483e08b2b245..d35568896d1f46a0026f77fd92bb8f5f783f9b33 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/fixedGradient/fixedGradientFvPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/fixedGradient/fixedGradientFvPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class fixedGradientFvPatchField; -makePatchTypeFieldTypedefs(fixedGradient) +makePatchTypeFieldTypedefs(fixedGradient); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/basic/fixedValue/fixedValueFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/basic/fixedValue/fixedValueFvPatchFields.H index 885b81c91d70f77f65d02ba3fd2c6ac84fc3e2dc..aa47b371e587715e6d995309b28a84fdfc5ed7de 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/fixedValue/fixedValueFvPatchFields.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/fixedValue/fixedValueFvPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(fixedValue) +makePatchTypeFieldTypedefs(fixedValue); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/basic/fixedValue/fixedValueFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/basic/fixedValue/fixedValueFvPatchFieldsFwd.H index e79d157cdd6bd2687012f4b808188b8b0ff44cbb..f60fe4a98e221b5a05b75d9ec6b815dcd12e33a4 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/fixedValue/fixedValueFvPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/fixedValue/fixedValueFvPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class fixedValueFvPatchField; -makePatchTypeFieldTypedefs(fixedValue) +makePatchTypeFieldTypedefs(fixedValue); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/basic/mixed/mixedFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/basic/mixed/mixedFvPatchFields.H index badf13acb655d09323907f9acb9f9c77b475f83e..5491d5ccb2ed64730a7798eedfcd913145f094c6 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/mixed/mixedFvPatchFields.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/mixed/mixedFvPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(mixed) +makePatchTypeFieldTypedefs(mixed); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/basic/mixed/mixedFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/basic/mixed/mixedFvPatchFieldsFwd.H index 3086fe14bf44b8fb75d197a1d0b95f59d39c07d9..78d96998e62c055d6b79ee0f29a7b985b164271c 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/mixed/mixedFvPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/mixed/mixedFvPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class mixedFvPatchField; -makePatchTypeFieldTypedefs(mixed) +makePatchTypeFieldTypedefs(mixed); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/basic/sliced/slicedFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/basic/sliced/slicedFvPatchFields.H index 25c9a7fc070e2b35400ce66c491f09e93ad3ae66..20a6c3a417fa2362189e043560212014eb3f49d7 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/sliced/slicedFvPatchFields.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/sliced/slicedFvPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(sliced) +makePatchTypeFieldTypedefs(sliced); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/basic/sliced/slicedFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/basic/sliced/slicedFvPatchFieldsFwd.H index e4da05c17119350d1e8b5c0b2393e72632c4176e..7e3fb1d4f49181e8e77c829e509cf24a8539fc1e 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/sliced/slicedFvPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/sliced/slicedFvPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class slicedFvPatchField; -makePatchTypeFieldTypedefs(sliced) +makePatchTypeFieldTypedefs(sliced); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/basic/transform/transformFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/basic/transform/transformFvPatchFields.H index 652cbfa9b7750eea04215f79e17f088c2c8b7e75..3f2d04c3106a356c7e678caa60dfce1ba626476e 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/transform/transformFvPatchFields.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/transform/transformFvPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(transform) +makePatchTypeFieldTypedefs(transform); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/basic/transform/transformFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/basic/transform/transformFvPatchFieldsFwd.H index 5963f9e788233989188fa9dad03c6094cb0307dd..c9d48416427aa8b3717460434623d2a1b144268f 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/transform/transformFvPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/transform/transformFvPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class transformFvPatchField; -makePatchTypeFieldTypedefs(transform) +makePatchTypeFieldTypedefs(transform); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/basic/zeroGradient/zeroGradientFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/basic/zeroGradient/zeroGradientFvPatchFields.H index 949559484eb2cbfdc2f80021131f4d1bbf2a0985..ab9dccc8fe30567a574b1899dff46a598fe8d2ff 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/zeroGradient/zeroGradientFvPatchFields.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/zeroGradient/zeroGradientFvPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(zeroGradient) +makePatchTypeFieldTypedefs(zeroGradient); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/basic/zeroGradient/zeroGradientFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/basic/zeroGradient/zeroGradientFvPatchFieldsFwd.H index 46201f7e3b537e86fa196884efe54eef1a3b214b..fa5a06b972773a511099aea6ed1beeec0d87e232 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/zeroGradient/zeroGradientFvPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/zeroGradient/zeroGradientFvPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class zeroGradientFvPatchField; -makePatchTypeFieldTypedefs(zeroGradient) +makePatchTypeFieldTypedefs(zeroGradient); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchFields.H index bc8985abfc6c9a0c84dd34b2ed2133e74bc910df..8cc79ddf9d21ffacf6c11258441f8c85ae8b24ea 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchFields.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(cyclic) +makePatchTypeFieldTypedefs(cyclic); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchFieldsFwd.H index 91576b9219e34569b8cb01782fb3c4a0d74327af..cf4a7cd01466b164ec17e23348b3b6858060d3ae 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class cyclicFvPatchField; -makePatchTypeFieldTypedefs(cyclic) +makePatchTypeFieldTypedefs(cyclic); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicSlip/cyclicSlipFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicSlip/cyclicSlipFvPatchFields.H index 4b2d031fe5c161fb78ec3270519e9c10c5786a34..1d77c904fc01c0f978aefb94dfc6780c9084edd7 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicSlip/cyclicSlipFvPatchFields.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicSlip/cyclicSlipFvPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(cyclicSlip) +makePatchTypeFieldTypedefs(cyclicSlip); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicSlip/cyclicSlipFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicSlip/cyclicSlipFvPatchFieldsFwd.H index d1d914643f1731d1418dc5e29995abbb3c17d5e2..22daa47839c1d0ca3b210e194afdf549c104b39a 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicSlip/cyclicSlipFvPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicSlip/cyclicSlipFvPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class cyclicSlipFvPatchField; -makePatchTypeFieldTypedefs(cyclicSlip) +makePatchTypeFieldTypedefs(cyclicSlip); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/empty/emptyFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/constraint/empty/emptyFvPatchFields.H index 6219cea6da032106b794b9eeff6fca0f6eb382d5..3637bb2293fd5971b0cd24404138eb911359b07c 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/empty/emptyFvPatchFields.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/empty/emptyFvPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(empty) +makePatchTypeFieldTypedefs(empty); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/empty/emptyFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/constraint/empty/emptyFvPatchFieldsFwd.H index 38dac19e557b5e3f96c398a2202fdd886cc3d825..1ab0f7ad9b7d3db0e3cc712b506d8e7d5c4a077e 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/empty/emptyFvPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/empty/emptyFvPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class emptyFvPatchField; -makePatchTypeFieldTypedefs(empty) +makePatchTypeFieldTypedefs(empty); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchFields.H index e23a4b2f7768474a4674195ab06a88e43125414b..81b233cfa10014662a9c216236d8d53bd4e1a046 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchFields.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(jumpCyclic) +makePatchTypeFieldTypedefs(jumpCyclic); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchFieldsFwd.H index 69d455e27023656eb6afba6c70712b254d8e11e0..8bfd74209d39255b564d57005c25a3c8f09105f5 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class jumpCyclicFvPatchField; -makePatchTypeFieldTypedefs(jumpCyclic) +makePatchTypeFieldTypedefs(jumpCyclic); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatchFields.H index 3019604256452d4769c3bb957be8305fe3bf43eb..bd960ebd07d66e986b89e203188e95cbe19ae0e3 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatchFields.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(nonuniformTransformCyclic) +makePatchTypeFieldTypedefs(nonuniformTransformCyclic); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatchFieldsFwd.H index ea3d13608e120a3df43805bb54035a48a24813b5..d3523ffbd41eb3114fc77809e2efd9ebbf0aa499 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class nonuniformTransformCyclicFvPatchField; -makePatchTypeFieldTypedefs(nonuniformTransformCyclic) +makePatchTypeFieldTypedefs(nonuniformTransformCyclic); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchFields.H index 69cf96a0ea8f3437421df8baa39802e1133e642e..c3eb4d2e624832c4f09fac58e6ac655237f6b917 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchFields.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(processor) +makePatchTypeFieldTypedefs(processor); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchFieldsFwd.H index 7071e79babaf54ec2fa3e219a96f7c648093e80a..4da9ceb5c5d8198a20185e2445dab434ed26bed8 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class processorFvPatchField; -makePatchTypeFieldTypedefs(processor) +makePatchTypeFieldTypedefs(processor); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchFields.H index c73bba59a5431efa8018bd3ff96a2e302a6efc45..467183b7a3cd43e64cfaaadf9c98e2ca8c7042df 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchFields.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(processorCyclic) +makePatchTypeFieldTypedefs(processorCyclic); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchFieldsFwd.H index 496834e43093842559630865c0071064d2586168..c7403dd9108a764cee1ed3fe04e23c20c990cdca 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class processorCyclicFvPatchField; -makePatchTypeFieldTypedefs(processor) +makePatchTypeFieldTypedefs(processor); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/symmetry/symmetryFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/constraint/symmetry/symmetryFvPatchFields.H index 1f1caa91dcfd67e80e2138e29cdc135620318821..2a064adf1dd0c34febab7ffdc69f18c3bc380d5f 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/symmetry/symmetryFvPatchFields.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/symmetry/symmetryFvPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(symmetry) +makePatchTypeFieldTypedefs(symmetry); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/symmetry/symmetryFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/constraint/symmetry/symmetryFvPatchFieldsFwd.H index 4869041f18660b8aabd9e8dafa431b2b7f18fd3b..df9dcaccabfcad91d7f58b475c3d8c09a8526b1a 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/symmetry/symmetryFvPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/symmetry/symmetryFvPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class symmetryFvPatchField; -makePatchTypeFieldTypedefs(symmetry) +makePatchTypeFieldTypedefs(symmetry); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/wedge/wedgeFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/wedge/wedgeFvPatchField.C index a8540e302970b69334ac158271e9a09df6b5a1bf..fb4881030818af31534cb52b0d13623aca6b0beb 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/wedge/wedgeFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/wedge/wedgeFvPatchField.C @@ -29,15 +29,11 @@ License #include "symmTransform.H" #include "diagTensor.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class Type> -wedgeFvPatchField<Type>::wedgeFvPatchField +Foam::wedgeFvPatchField<Type>::wedgeFvPatchField ( const fvPatch& p, const DimensionedField<Type, volMesh>& iF @@ -48,7 +44,7 @@ wedgeFvPatchField<Type>::wedgeFvPatchField template<class Type> -wedgeFvPatchField<Type>::wedgeFvPatchField +Foam::wedgeFvPatchField<Type>::wedgeFvPatchField ( const wedgeFvPatchField<Type>& ptf, const fvPatch& p, @@ -80,7 +76,7 @@ wedgeFvPatchField<Type>::wedgeFvPatchField template<class Type> -wedgeFvPatchField<Type>::wedgeFvPatchField +Foam::wedgeFvPatchField<Type>::wedgeFvPatchField ( const fvPatch& p, const DimensionedField<Type, volMesh>& iF, @@ -113,7 +109,7 @@ wedgeFvPatchField<Type>::wedgeFvPatchField template<class Type> -wedgeFvPatchField<Type>::wedgeFvPatchField +Foam::wedgeFvPatchField<Type>::wedgeFvPatchField ( const wedgeFvPatchField<Type>& ptf ) @@ -123,7 +119,7 @@ wedgeFvPatchField<Type>::wedgeFvPatchField template<class Type> -wedgeFvPatchField<Type>::wedgeFvPatchField +Foam::wedgeFvPatchField<Type>::wedgeFvPatchField ( const wedgeFvPatchField<Type>& ptf, const DimensionedField<Type, volMesh>& iF @@ -136,9 +132,10 @@ wedgeFvPatchField<Type>::wedgeFvPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class Type> -tmp<Field<Type> > wedgeFvPatchField<Type>::snGrad() const +Foam::tmp<Foam::Field<Type> > Foam::wedgeFvPatchField<Type>::snGrad() const { - Field<Type> pif = this->patchInternalField(); + const Field<Type> pif(this->patchInternalField()); + return ( transform(refCast<const wedgeFvPatch>(this->patch()).cellT(), pif) - pif @@ -147,7 +144,7 @@ tmp<Field<Type> > wedgeFvPatchField<Type>::snGrad() const template<class Type> -void wedgeFvPatchField<Type>::evaluate(const Pstream::commsTypes) +void Foam::wedgeFvPatchField<Type>::evaluate(const Pstream::commsTypes) { if (!this->updated()) { @@ -166,7 +163,8 @@ void wedgeFvPatchField<Type>::evaluate(const Pstream::commsTypes) template<class Type> -tmp<Field<Type> > wedgeFvPatchField<Type>::snGradTransformDiag() const +Foam::tmp<Foam::Field<Type> > +Foam::wedgeFvPatchField<Type>::snGradTransformDiag() const { const diagTensor diagT = 0.5*diag(I - refCast<const wedgeFvPatch>(this->patch()).cellT()); @@ -192,8 +190,4 @@ tmp<Field<Type> > wedgeFvPatchField<Type>::snGradTransformDiag() const } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/wedge/wedgeFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/constraint/wedge/wedgeFvPatchFields.H index 47062e7419c1f71dd9ff9e6a92d62f1c035745d6..9db5808477a90ca3d07c9c7ff628750d85850f65 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/wedge/wedgeFvPatchFields.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/wedge/wedgeFvPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(wedge) +makePatchTypeFieldTypedefs(wedge); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/wedge/wedgeFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/constraint/wedge/wedgeFvPatchFieldsFwd.H index d6c546fe170c899df98bd106ef7c4718d5324410..09ce4a52c4e87ad4f1fb6952507ab54141e83f02 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/wedge/wedgeFvPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/wedge/wedgeFvPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class wedgeFvPatchField; -makePatchTypeFieldTypedefs(wedge) +makePatchTypeFieldTypedefs(wedge); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C index 92309507c122b9b68c577181d8d703fc7f42d62e..99549a8218394ed8917ab9e563405bfc25f79bd2 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C @@ -263,7 +263,7 @@ void Foam::activeBaffleVelocityFvPatchVectorField::updateCoeffs() Info<< "openFraction = " << openFraction_ << endl; vectorField::subField Sfw = this->patch().patch().faceAreas(); - vectorField newSfw = (1 - openFraction_)*initWallSf_; + const vectorField newSfw((1 - openFraction_)*initWallSf_); forAll(Sfw, facei) { Sfw[facei] = newSfw[facei]; @@ -310,11 +310,12 @@ void Foam::activeBaffleVelocityFvPatchVectorField::write(Ostream& os) const namespace Foam { - makePatchTypeField + makeNonTemplatedPatchTypeField ( fvPatchVectorField, activeBaffleVelocityFvPatchVectorField ); } + // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C index 209bd9cd92c026de59a94e23daf83fd49c953089..47f80feba3e46dea4b416e4e37b964a8ea7cc5c9 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C @@ -31,15 +31,11 @@ License #include "CrankNicholsonDdtScheme.H" #include "backwardDdtScheme.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class Type> -advectiveFvPatchField<Type>::advectiveFvPatchField +Foam::advectiveFvPatchField<Type>::advectiveFvPatchField ( const fvPatch& p, const DimensionedField<Type, volMesh>& iF @@ -58,7 +54,7 @@ advectiveFvPatchField<Type>::advectiveFvPatchField template<class Type> -advectiveFvPatchField<Type>::advectiveFvPatchField +Foam::advectiveFvPatchField<Type>::advectiveFvPatchField ( const advectiveFvPatchField& ptf, const fvPatch& p, @@ -75,7 +71,7 @@ advectiveFvPatchField<Type>::advectiveFvPatchField template<class Type> -advectiveFvPatchField<Type>::advectiveFvPatchField +Foam::advectiveFvPatchField<Type>::advectiveFvPatchField ( const fvPatch& p, const DimensionedField<Type, volMesh>& iF, @@ -127,7 +123,7 @@ advectiveFvPatchField<Type>::advectiveFvPatchField template<class Type> -advectiveFvPatchField<Type>::advectiveFvPatchField +Foam::advectiveFvPatchField<Type>::advectiveFvPatchField ( const advectiveFvPatchField& ptpsf ) @@ -141,7 +137,7 @@ advectiveFvPatchField<Type>::advectiveFvPatchField template<class Type> -advectiveFvPatchField<Type>::advectiveFvPatchField +Foam::advectiveFvPatchField<Type>::advectiveFvPatchField ( const advectiveFvPatchField& ptpsf, const DimensionedField<Type, volMesh>& iF @@ -158,10 +154,12 @@ advectiveFvPatchField<Type>::advectiveFvPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class Type> -tmp<scalarField> advectiveFvPatchField<Type>::advectionSpeed() const +Foam::tmp<Foam::scalarField> +Foam::advectiveFvPatchField<Type>::advectionSpeed() const { const surfaceScalarField& phi = - this->db().objectRegistry::lookupObject<surfaceScalarField>(phiName_); + this->db().objectRegistry::template lookupObject<surfaceScalarField> + (phiName_); fvsPatchField<scalar> phip = this->patch().template lookupPatchField<surfaceScalarField, scalar> @@ -187,7 +185,7 @@ tmp<scalarField> advectiveFvPatchField<Type>::advectionSpeed() const template<class Type> -void advectiveFvPatchField<Type>::updateCoeffs() +void Foam::advectiveFvPatchField<Type>::updateCoeffs() { if (this->updated()) { @@ -202,7 +200,7 @@ void advectiveFvPatchField<Type>::updateCoeffs() scalar deltaT = this->db().time().deltaTValue(); const GeometricField<Type, fvPatchField, volMesh>& field = - this->db().objectRegistry:: + this->db().objectRegistry::template lookupObject<GeometricField<Type, fvPatchField, volMesh> > ( this->dimensionedInternalField().name() @@ -210,10 +208,10 @@ void advectiveFvPatchField<Type>::updateCoeffs() // Calculate the advection speed of the field wave // If the wave is incoming set the speed to 0. - scalarField w = Foam::max(advectionSpeed(), scalar(0)); + const scalarField w(Foam::max(advectionSpeed(), scalar(0))); // Calculate the field wave coefficient alpha (See notes) - scalarField alpha = w*deltaT*this->patch().deltaCoeffs(); + const scalarField alpha(w*deltaT*this->patch().deltaCoeffs()); label patchi = this->patch().index(); @@ -222,7 +220,7 @@ void advectiveFvPatchField<Type>::updateCoeffs() if (lInf_ > SMALL) { // Calculate the field relaxation coefficient k (See notes) - scalarField k = w*deltaT/lInf_; + const scalarField k(w*deltaT/lInf_); if ( @@ -302,7 +300,7 @@ void advectiveFvPatchField<Type>::updateCoeffs() template<class Type> -void advectiveFvPatchField<Type>::write(Ostream& os) const +void Foam::advectiveFvPatchField<Type>::write(Ostream& os) const { fvPatchField<Type>::write(os); @@ -327,8 +325,4 @@ void advectiveFvPatchField<Type>::write(Ostream& os) const } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchFields.H index 77ecc7750721069fa7a58a213e6444fd8c19ab0c..2b12f5601b2abc55184fd82420262656b2022126 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchFields.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(advective) +makePatchTypeFieldTypedefs(advective); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchFieldsFwd.H index f05202582f9a2fd3dcb49dfd8aa68801c2761acb..0627447222fbdb92d346d6cc0633062c5202c7a3 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class advectiveFvPatchField; -makePatchTypeFieldTypedefs(advective) +makePatchTypeFieldTypedefs(advective); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/buoyantPressure/buoyantPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/buoyantPressure/buoyantPressureFvPatchScalarField.C index c8a37fef7aa6f9e9875204bc28c3b8b5dd29e328..cfd92b0c8dbb301efa24789863f9b783f49ff0e6 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/buoyantPressure/buoyantPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/buoyantPressure/buoyantPressureFvPatchScalarField.C @@ -29,14 +29,10 @@ License #include "volFields.H" #include "uniformDimensionedFields.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -buoyantPressureFvPatchScalarField:: +Foam::buoyantPressureFvPatchScalarField:: buoyantPressureFvPatchScalarField ( const fvPatch& p, @@ -48,7 +44,7 @@ buoyantPressureFvPatchScalarField {} -buoyantPressureFvPatchScalarField:: +Foam::buoyantPressureFvPatchScalarField:: buoyantPressureFvPatchScalarField ( const fvPatch& p, @@ -64,7 +60,7 @@ buoyantPressureFvPatchScalarField } -buoyantPressureFvPatchScalarField:: +Foam::buoyantPressureFvPatchScalarField:: buoyantPressureFvPatchScalarField ( const buoyantPressureFvPatchScalarField& ptf, @@ -78,7 +74,7 @@ buoyantPressureFvPatchScalarField {} -buoyantPressureFvPatchScalarField:: +Foam::buoyantPressureFvPatchScalarField:: buoyantPressureFvPatchScalarField ( const buoyantPressureFvPatchScalarField& ptf @@ -89,7 +85,7 @@ buoyantPressureFvPatchScalarField {} -buoyantPressureFvPatchScalarField:: +Foam::buoyantPressureFvPatchScalarField:: buoyantPressureFvPatchScalarField ( const buoyantPressureFvPatchScalarField& ptf, @@ -103,7 +99,7 @@ buoyantPressureFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void buoyantPressureFvPatchScalarField::updateCoeffs() +void Foam::buoyantPressureFvPatchScalarField::updateCoeffs() { if (updated()) { @@ -137,7 +133,7 @@ void buoyantPressureFvPatchScalarField::updateCoeffs() } -void buoyantPressureFvPatchScalarField::write(Ostream& os) const +void Foam::buoyantPressureFvPatchScalarField::write(Ostream& os) const { fixedGradientFvPatchScalarField::write(os); writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_); @@ -147,14 +143,14 @@ void buoyantPressureFvPatchScalarField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField -( - fvPatchScalarField, - buoyantPressureFvPatchScalarField -); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +namespace Foam +{ + makeNonTemplatedPatchTypeField + ( + fvPatchScalarField, + buoyantPressureFvPatchScalarField + ); +} -} // End namespace Foam // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.C index 64282fde04c83ec7caa5d5afbb7b7f7a5c74c632..6f5d368256ea2b58ff947b517d5627d1157fa30d 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.C @@ -131,14 +131,13 @@ void Foam::cylindricalInletVelocityFvPatchVectorField::updateCoeffs() vector hatAxis = axis_/mag(axis_); - vectorField r = (patch().Cf() - centre_); + const vectorField r(patch().Cf() - centre_); + tmp<vectorField> d = r - (hatAxis & r)*hatAxis; - vectorField d = r - (hatAxis & r)*hatAxis; + tmp<vectorField> tangVel = + (rpm_*constant::mathematical::pi/30.0)*(hatAxis) ^ d; - vectorField tangVelo = - (rpm_*constant::mathematical::pi/30.0)*(hatAxis)^d; - - operator==(tangVelo + axis_*axialVelocity_ + radialVelocity_*d); + operator==(tangVel + axis_*axialVelocity_ + radialVelocity_*d); fixedValueFvPatchField<vector>::updateCoeffs(); } @@ -162,7 +161,7 @@ void Foam::cylindricalInletVelocityFvPatchVectorField::write(Ostream& os) const namespace Foam { - makePatchTypeField + makeNonTemplatedPatchTypeField ( fvPatchVectorField, cylindricalInletVelocityFvPatchVectorField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedValue/directMappedFixedValueFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedValue/directMappedFixedValueFvPatchFields.H index 6215d226f31c04c6bd26f408a9194fe16eb13311..40bd0b644fe364659fc8eef1de6ae92d55adf4e8 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedValue/directMappedFixedValueFvPatchFields.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedValue/directMappedFixedValueFvPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(directMappedFixedValue) +makePatchTypeFieldTypedefs(directMappedFixedValue); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedValue/directMappedFixedValueFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedValue/directMappedFixedValueFvPatchFieldsFwd.H index b5ad9e88cb1f7a9bf5ab3067c9e35d51cd07277f..a00ea3950233b96ecd16be325ee1dc51614ab7f0 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedValue/directMappedFixedValueFvPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedValue/directMappedFixedValueFvPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class directMappedFixedValueFvPatchField; -makePatchTypeFieldTypedefs(directMappedFixedValue) +makePatchTypeFieldTypedefs(directMappedFixedValue); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C index 6405ab78b4bd698667c20dbc5f52eba4777aac5e..e83c36111f05434f2ccf841cb788003ceb87c265 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C @@ -30,14 +30,10 @@ License #include "surfaceFields.H" #include "addToRunTimeSelectionTable.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -directMappedVelocityFluxFixedValueFvPatchField:: +Foam::directMappedVelocityFluxFixedValueFvPatchField:: directMappedVelocityFluxFixedValueFvPatchField ( const fvPatch& p, @@ -49,7 +45,7 @@ directMappedVelocityFluxFixedValueFvPatchField {} -directMappedVelocityFluxFixedValueFvPatchField:: +Foam::directMappedVelocityFluxFixedValueFvPatchField:: directMappedVelocityFluxFixedValueFvPatchField ( const directMappedVelocityFluxFixedValueFvPatchField& ptf, @@ -83,7 +79,7 @@ directMappedVelocityFluxFixedValueFvPatchField } -directMappedVelocityFluxFixedValueFvPatchField:: +Foam::directMappedVelocityFluxFixedValueFvPatchField:: directMappedVelocityFluxFixedValueFvPatchField ( const fvPatch& p, @@ -138,7 +134,7 @@ directMappedVelocityFluxFixedValueFvPatchField } -directMappedVelocityFluxFixedValueFvPatchField:: +Foam::directMappedVelocityFluxFixedValueFvPatchField:: directMappedVelocityFluxFixedValueFvPatchField ( const directMappedVelocityFluxFixedValueFvPatchField& ptf @@ -149,7 +145,7 @@ directMappedVelocityFluxFixedValueFvPatchField {} -directMappedVelocityFluxFixedValueFvPatchField:: +Foam::directMappedVelocityFluxFixedValueFvPatchField:: directMappedVelocityFluxFixedValueFvPatchField ( const directMappedVelocityFluxFixedValueFvPatchField& ptf, @@ -163,7 +159,7 @@ directMappedVelocityFluxFixedValueFvPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void directMappedVelocityFluxFixedValueFvPatchField::updateCoeffs() +void Foam::directMappedVelocityFluxFixedValueFvPatchField::updateCoeffs() { if (updated()) { @@ -253,23 +249,27 @@ void directMappedVelocityFluxFixedValueFvPatchField::updateCoeffs() } -void directMappedVelocityFluxFixedValueFvPatchField::write(Ostream& os) const +void Foam::directMappedVelocityFluxFixedValueFvPatchField::write +( + Ostream& os +) const { fvPatchVectorField::write(os); writeEntryIfDifferent<word>(os, "phi", "phi", phiName_); this->writeEntry("value", os); } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -makePatchTypeField -( - fvPatchVectorField, - directMappedVelocityFluxFixedValueFvPatchField -); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace Foam +namespace Foam +{ + makeNonTemplatedPatchTypeField + ( + fvPatchVectorField, + directMappedVelocityFluxFixedValueFvPatchField + ); +} + // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.C index 56730e71666697c0fcb4bae91632ac6a53e2dd38..5191ab8590f5f5e4281caaca05fc9cf8f2918c93 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.C @@ -26,15 +26,10 @@ License #include "fanFvPatchField.H" #include "IOmanip.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class Type> -fanFvPatchField<Type>::fanFvPatchField +Foam::fanFvPatchField<Type>::fanFvPatchField ( const fvPatch& p, const DimensionedField<Type, volMesh>& iF @@ -47,7 +42,7 @@ fanFvPatchField<Type>::fanFvPatchField template<class Type> -fanFvPatchField<Type>::fanFvPatchField +Foam::fanFvPatchField<Type>::fanFvPatchField ( const fanFvPatchField<Type>& ptf, const fvPatch& p, @@ -62,7 +57,7 @@ fanFvPatchField<Type>::fanFvPatchField template<class Type> -fanFvPatchField<Type>::fanFvPatchField +Foam::fanFvPatchField<Type>::fanFvPatchField ( const fvPatch& p, const DimensionedField<Type, volMesh>& iF, @@ -96,7 +91,7 @@ fanFvPatchField<Type>::fanFvPatchField template<class Type> -fanFvPatchField<Type>::fanFvPatchField +Foam::fanFvPatchField<Type>::fanFvPatchField ( const fanFvPatchField<Type>& ptf ) @@ -109,7 +104,7 @@ fanFvPatchField<Type>::fanFvPatchField template<class Type> -fanFvPatchField<Type>::fanFvPatchField +Foam::fanFvPatchField<Type>::fanFvPatchField ( const fanFvPatchField<Type>& ptf, const DimensionedField<Type, volMesh>& iF @@ -124,7 +119,7 @@ fanFvPatchField<Type>::fanFvPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class Type> -void fanFvPatchField<Type>::autoMap +void Foam::fanFvPatchField<Type>::autoMap ( const fvPatchFieldMapper& m ) @@ -135,7 +130,7 @@ void fanFvPatchField<Type>::autoMap template<class Type> -void fanFvPatchField<Type>::rmap +void Foam::fanFvPatchField<Type>::rmap ( const fvPatchField<Type>& ptf, const labelList& addr @@ -150,7 +145,7 @@ void fanFvPatchField<Type>::rmap template<class Type> -void fanFvPatchField<Type>::write(Ostream& os) const +void Foam::fanFvPatchField<Type>::write(Ostream& os) const { fvPatchField<Type>::write(os); os.writeKeyword("patchType") << "cyclic" << token::END_STATEMENT << nl; @@ -163,8 +158,4 @@ void fanFvPatchField<Type>::write(Ostream& os) const } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C index 881a0f6464f391a8a23e84f62a3fadfb9a2dd793..6d41a654ea7a2777fd2501144601355ab02eb06c 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C @@ -28,12 +28,14 @@ License #include "volFields.H" #include "surfaceFields.H" -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - makePatchTypeField(fvPatchScalarField, fanFvPatchScalarField); -} + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +makePatchTypeField(fvPatchScalarField, fanFvPatchScalarField); // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // @@ -57,7 +59,7 @@ void Foam::fanFvPatchField<Foam::scalar>::updateCoeffs() const fvsPatchField<scalar>& phip = patch().patchField<surfaceScalarField, scalar>(phi); - scalarField Un = max(phip/patch().magSf(), scalar(0)); + scalarField Un(max(phip/patch().magSf(), scalar(0))); if (phi.dimensions() == dimDensity*dimVelocity*dimArea) { @@ -76,4 +78,8 @@ void Foam::fanFvPatchField<Foam::scalar>::updateCoeffs() } +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.H index c2b35c941c1832bb4f3c90642410d51ebb084cfe..656d9d2de071d68d9e6e2df705b4d611f9bc1fd7 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(fan) +makePatchTypeFieldTypedefs(fan); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFieldsFwd.H index 0c8e75bfc7aa9fa77724d832ac524f1d88883d38..2611b0b1a961983df88c5ae0fc78918435178cbe 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class fanFvPatchField; -makePatchTypeFieldTypedefs(fan) +makePatchTypeFieldTypedefs(fan); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.C index ab52c3061295be1586b5635dae43501fea3f180a..1c21f64d146b4086474636724009562b89ab353c 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.C @@ -172,7 +172,7 @@ void Foam::fixedFluxPressureFvPatchScalarField::write(Ostream& os) const namespace Foam { - makePatchTypeField + makeNonTemplatedPatchTypeField ( fvPatchScalarField, fixedFluxPressureFvPatchScalarField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedInternalValueFvPatchField/fixedInternalValueFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedInternalValueFvPatchField/fixedInternalValueFvPatchFields.H index 9cdea47984d2a086284d58703ad26c4daada224f..a6ee629b7ab9dccaed31db736eb6b3a44948b3ad 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedInternalValueFvPatchField/fixedInternalValueFvPatchFields.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedInternalValueFvPatchField/fixedInternalValueFvPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(fixedInternalValue) +makePatchTypeFieldTypedefs(fixedInternalValue); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchField.C index d2f5cdbb8dcd888bdd7220dd793b147ae83c5be3..502a806260facda19b8fd58403487af860b5276a 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchField.C @@ -26,15 +26,11 @@ License #include "fixedNormalSlipFvPatchField.H" #include "symmTransformField.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class Type> -fixedNormalSlipFvPatchField<Type>::fixedNormalSlipFvPatchField +Foam::fixedNormalSlipFvPatchField<Type>::fixedNormalSlipFvPatchField ( const fvPatch& p, const DimensionedField<Type, volMesh>& iF @@ -46,7 +42,7 @@ fixedNormalSlipFvPatchField<Type>::fixedNormalSlipFvPatchField template<class Type> -fixedNormalSlipFvPatchField<Type>::fixedNormalSlipFvPatchField +Foam::fixedNormalSlipFvPatchField<Type>::fixedNormalSlipFvPatchField ( const fixedNormalSlipFvPatchField<Type>& ptf, const fvPatch& p, @@ -60,7 +56,7 @@ fixedNormalSlipFvPatchField<Type>::fixedNormalSlipFvPatchField template<class Type> -fixedNormalSlipFvPatchField<Type>::fixedNormalSlipFvPatchField +Foam::fixedNormalSlipFvPatchField<Type>::fixedNormalSlipFvPatchField ( const fvPatch& p, const DimensionedField<Type, volMesh>& iF, @@ -75,7 +71,7 @@ fixedNormalSlipFvPatchField<Type>::fixedNormalSlipFvPatchField template<class Type> -fixedNormalSlipFvPatchField<Type>::fixedNormalSlipFvPatchField +Foam::fixedNormalSlipFvPatchField<Type>::fixedNormalSlipFvPatchField ( const fixedNormalSlipFvPatchField<Type>& ptf ) @@ -86,7 +82,7 @@ fixedNormalSlipFvPatchField<Type>::fixedNormalSlipFvPatchField template<class Type> -fixedNormalSlipFvPatchField<Type>::fixedNormalSlipFvPatchField +Foam::fixedNormalSlipFvPatchField<Type>::fixedNormalSlipFvPatchField ( const fixedNormalSlipFvPatchField<Type>& ptf, const DimensionedField<Type, volMesh>& iF @@ -100,7 +96,7 @@ fixedNormalSlipFvPatchField<Type>::fixedNormalSlipFvPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class Type> -void fixedNormalSlipFvPatchField<Type>::autoMap +void Foam::fixedNormalSlipFvPatchField<Type>::autoMap ( const fvPatchFieldMapper& m ) @@ -111,7 +107,7 @@ void fixedNormalSlipFvPatchField<Type>::autoMap template<class Type> -void fixedNormalSlipFvPatchField<Type>::rmap +void Foam::fixedNormalSlipFvPatchField<Type>::rmap ( const fvPatchField<Type>& ptf, const labelList& addr @@ -127,10 +123,11 @@ void fixedNormalSlipFvPatchField<Type>::rmap template<class Type> -tmp<Field<Type> > fixedNormalSlipFvPatchField<Type>::snGrad() const +Foam::tmp<Foam::Field<Type> > +Foam::fixedNormalSlipFvPatchField<Type>::snGrad() const { - vectorField nHat = this->patch().nf(); - Field<Type> pif = this->patchInternalField(); + const vectorField nHat(this->patch().nf()); + const Field<Type> pif(this->patchInternalField()); return ( @@ -140,14 +137,17 @@ tmp<Field<Type> > fixedNormalSlipFvPatchField<Type>::snGrad() const template<class Type> -void fixedNormalSlipFvPatchField<Type>::evaluate(const Pstream::commsTypes) +void Foam::fixedNormalSlipFvPatchField<Type>::evaluate +( + const Pstream::commsTypes +) { if (!this->updated()) { this->updateCoeffs(); } - vectorField nHat = this->patch().nf(); + const vectorField nHat(this->patch().nf()); Field<Type>::operator= ( @@ -160,9 +160,10 @@ void fixedNormalSlipFvPatchField<Type>::evaluate(const Pstream::commsTypes) template<class Type> -tmp<Field<Type> > fixedNormalSlipFvPatchField<Type>::snGradTransformDiag() const +Foam::tmp<Foam::Field<Type> > +Foam::fixedNormalSlipFvPatchField<Type>::snGradTransformDiag() const { - vectorField nHat = this->patch().nf(); + const vectorField nHat(this->patch().nf()); vectorField diag(nHat.size()); diag.replace(vector::X, mag(nHat.component(vector::X))); @@ -174,15 +175,11 @@ tmp<Field<Type> > fixedNormalSlipFvPatchField<Type>::snGradTransformDiag() const template<class Type> -void fixedNormalSlipFvPatchField<Type>::write(Ostream& os) const +void Foam::fixedNormalSlipFvPatchField<Type>::write(Ostream& os) const { transformFvPatchField<Type>::write(os); fixedValue_.writeEntry("fixedValue", os); } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchFields.H index c8434881ea21ca1bf40db4d92eb6395052f94a95..bdab55d346d9956506cb85eb44a26a130ff6bcaf 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchFields.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(fixedNormalSlip) +makePatchTypeFieldTypedefs(fixedNormalSlip); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedPressureCompressibleDensity/fixedPressureCompressibleDensityFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedPressureCompressibleDensity/fixedPressureCompressibleDensityFvPatchScalarField.C index f964748b182d7981a97650c79fd9acd881778fc4..22fac73eeb41676efa6861e7e1cc939325c3ce82 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedPressureCompressibleDensity/fixedPressureCompressibleDensityFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedPressureCompressibleDensity/fixedPressureCompressibleDensityFvPatchScalarField.C @@ -29,14 +29,9 @@ License #include "surfaceFields.H" #include "volFields.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -fixedPressureCompressibleDensityFvPatchScalarField:: +Foam::fixedPressureCompressibleDensityFvPatchScalarField:: fixedPressureCompressibleDensityFvPatchScalarField ( const fvPatch& p, @@ -48,7 +43,7 @@ fixedPressureCompressibleDensityFvPatchScalarField {} -fixedPressureCompressibleDensityFvPatchScalarField:: +Foam::fixedPressureCompressibleDensityFvPatchScalarField:: fixedPressureCompressibleDensityFvPatchScalarField ( const fixedPressureCompressibleDensityFvPatchScalarField& ptf, @@ -62,7 +57,7 @@ fixedPressureCompressibleDensityFvPatchScalarField {} -fixedPressureCompressibleDensityFvPatchScalarField:: +Foam::fixedPressureCompressibleDensityFvPatchScalarField:: fixedPressureCompressibleDensityFvPatchScalarField ( const fvPatch& p, @@ -75,7 +70,7 @@ fixedPressureCompressibleDensityFvPatchScalarField {} -fixedPressureCompressibleDensityFvPatchScalarField:: +Foam::fixedPressureCompressibleDensityFvPatchScalarField:: fixedPressureCompressibleDensityFvPatchScalarField ( const fixedPressureCompressibleDensityFvPatchScalarField& ptf @@ -86,7 +81,7 @@ fixedPressureCompressibleDensityFvPatchScalarField {} -fixedPressureCompressibleDensityFvPatchScalarField:: +Foam::fixedPressureCompressibleDensityFvPatchScalarField:: fixedPressureCompressibleDensityFvPatchScalarField ( const fixedPressureCompressibleDensityFvPatchScalarField& ptf, @@ -100,7 +95,7 @@ fixedPressureCompressibleDensityFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void fixedPressureCompressibleDensityFvPatchScalarField::updateCoeffs() +void Foam::fixedPressureCompressibleDensityFvPatchScalarField::updateCoeffs() { if (updated()) { @@ -127,7 +122,7 @@ void fixedPressureCompressibleDensityFvPatchScalarField::updateCoeffs() } -void fixedPressureCompressibleDensityFvPatchScalarField::write +void Foam::fixedPressureCompressibleDensityFvPatchScalarField::write ( Ostream& os ) const @@ -140,15 +135,13 @@ void fixedPressureCompressibleDensityFvPatchScalarField::write // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField -( - fvPatchScalarField, - fixedPressureCompressibleDensityFvPatchScalarField -); - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam +namespace Foam +{ + makeNonTemplatedPatchTypeField + ( + fvPatchScalarField, + fixedPressureCompressibleDensityFvPatchScalarField + ); +} // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C index 28b28fa221d6103e55905b2121ce7d44af011b44..4d0652c665171e15e67e72ef67f917a9eef22252 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C @@ -168,7 +168,7 @@ void Foam::flowRateInletVelocityFvPatchVectorField::write(Ostream& os) const namespace Foam { - makePatchTypeField + makeNonTemplatedPatchTypeField ( fvPatchVectorField, flowRateInletVelocityFvPatchVectorField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fluxCorrectedVelocity/fluxCorrectedVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/fluxCorrectedVelocity/fluxCorrectedVelocityFvPatchVectorField.C index 9bdb392467131c34d0ee022df9d70e1681eeb52c..bdaffac4bd294b80abfcaa3f44f9518b1bd522c2 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fluxCorrectedVelocity/fluxCorrectedVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fluxCorrectedVelocity/fluxCorrectedVelocityFvPatchVectorField.C @@ -110,7 +110,7 @@ void Foam::fluxCorrectedVelocityFvPatchVectorField::evaluate const fvsPatchField<scalar>& phip = patch().patchField<surfaceScalarField, scalar>(phi); - vectorField n = patch().nf(); + const vectorField n(patch().nf()); const Field<scalar>& magS = patch().magSf(); if (phi.dimensions() == dimVelocity*dimArea) @@ -152,7 +152,7 @@ void Foam::fluxCorrectedVelocityFvPatchVectorField::write(Ostream& os) const namespace Foam { - makePatchTypeField + makeNonTemplatedPatchTypeField ( fvPatchVectorField, fluxCorrectedVelocityFvPatchVectorField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/freestream/freestreamFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/derived/freestream/freestreamFvPatchFields.H index abf6218094217f4898807f4ddbebbfa65bba2f8c..d7cdb87630e6422d3c359e316c587783c250e239 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/freestream/freestreamFvPatchFields.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/freestream/freestreamFvPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(freestream) +makePatchTypeFieldTypedefs(freestream); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/freestream/freestreamFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/derived/freestream/freestreamFvPatchFieldsFwd.H index ec1dd2ea7ab3700307315023753aeb60eae89ffe..9bf1463814d1792b48787a664548f3303a4e801d 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/freestream/freestreamFvPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/freestream/freestreamFvPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class freestreamFvPatchField; -makePatchTypeFieldTypedefs(freestream) +makePatchTypeFieldTypedefs(freestream); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.C index 65642a17a20313e1cfd2148a13f0f52d07253f80..65b55658f9d567dabe10f23f697f5caaec176daa 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.C @@ -32,12 +32,10 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -freestreamPressureFvPatchScalarField::freestreamPressureFvPatchScalarField +Foam::freestreamPressureFvPatchScalarField:: +freestreamPressureFvPatchScalarField ( const fvPatch& p, const DimensionedField<scalar, volMesh>& iF @@ -47,7 +45,8 @@ freestreamPressureFvPatchScalarField::freestreamPressureFvPatchScalarField {} -freestreamPressureFvPatchScalarField::freestreamPressureFvPatchScalarField +Foam::freestreamPressureFvPatchScalarField:: +freestreamPressureFvPatchScalarField ( const freestreamPressureFvPatchScalarField& ptf, const fvPatch& p, @@ -59,7 +58,8 @@ freestreamPressureFvPatchScalarField::freestreamPressureFvPatchScalarField {} -freestreamPressureFvPatchScalarField::freestreamPressureFvPatchScalarField +Foam::freestreamPressureFvPatchScalarField:: +freestreamPressureFvPatchScalarField ( const fvPatch& p, const DimensionedField<scalar, volMesh>& iF, @@ -70,7 +70,8 @@ freestreamPressureFvPatchScalarField::freestreamPressureFvPatchScalarField {} -freestreamPressureFvPatchScalarField::freestreamPressureFvPatchScalarField +Foam::freestreamPressureFvPatchScalarField:: +freestreamPressureFvPatchScalarField ( const freestreamPressureFvPatchScalarField& wbppsf ) @@ -79,7 +80,8 @@ freestreamPressureFvPatchScalarField::freestreamPressureFvPatchScalarField {} -freestreamPressureFvPatchScalarField::freestreamPressureFvPatchScalarField +Foam::freestreamPressureFvPatchScalarField:: +freestreamPressureFvPatchScalarField ( const freestreamPressureFvPatchScalarField& wbppsf, const DimensionedField<scalar, volMesh>& iF @@ -91,7 +93,7 @@ freestreamPressureFvPatchScalarField::freestreamPressureFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void freestreamPressureFvPatchScalarField::updateCoeffs() +void Foam::freestreamPressureFvPatchScalarField::updateCoeffs() { if (updated()) { @@ -140,10 +142,13 @@ void freestreamPressureFvPatchScalarField::updateCoeffs() // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField(fvPatchScalarField, freestreamPressureFvPatchScalarField); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam +namespace Foam +{ + makeNonTemplatedPatchTypeField + ( + fvPatchScalarField, + freestreamPressureFvPatchScalarField + ); +} // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/inletOutlet/inletOutletFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/derived/inletOutlet/inletOutletFvPatchFields.H index 41b43e883e807eb9231cd20a9ae5e28a9682dd17..78532dd25b3332b5d83ed4749f36647eb5237c46 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/inletOutlet/inletOutletFvPatchFields.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/inletOutlet/inletOutletFvPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(inletOutlet) +makePatchTypeFieldTypedefs(inletOutlet); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/inletOutlet/inletOutletFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/derived/inletOutlet/inletOutletFvPatchFieldsFwd.H index b599bba389fd893f4f82402819c23ee0baf2394d..3c328a9d08d7a67bb84828fa12d541e402fdcd33 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/inletOutlet/inletOutletFvPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/inletOutlet/inletOutletFvPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class inletOutletFvPatchField; -makePatchTypeFieldTypedefs(inletOutlet) +makePatchTypeFieldTypedefs(inletOutlet); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.C index 149f24420985f51efeeef7002f37677e6dd382ed..04eb43c98b4508cbc75834c90f2ade27b8a352e0 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.C @@ -203,7 +203,7 @@ const namespace Foam { - makePatchTypeField + makeNonTemplatedPatchTypeField ( fvPatchScalarField, inletOutletTotalTemperatureFvPatchScalarField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/movingWallVelocity/movingWallVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/movingWallVelocity/movingWallVelocityFvPatchVectorField.C index 6fbb2547f5042541b3c95356587f06623b97971c..aefa37b8f5f6f2e77985aa1283f9c788943f2aab 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/movingWallVelocity/movingWallVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/movingWallVelocity/movingWallVelocityFvPatchVectorField.C @@ -29,14 +29,11 @@ License #include "surfaceFields.H" #include "fvcMeshPhi.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -movingWallVelocityFvPatchVectorField::movingWallVelocityFvPatchVectorField +Foam::movingWallVelocityFvPatchVectorField:: +movingWallVelocityFvPatchVectorField ( const fvPatch& p, const DimensionedField<vector, volMesh>& iF @@ -47,7 +44,8 @@ movingWallVelocityFvPatchVectorField::movingWallVelocityFvPatchVectorField {} -movingWallVelocityFvPatchVectorField::movingWallVelocityFvPatchVectorField +Foam::movingWallVelocityFvPatchVectorField:: +movingWallVelocityFvPatchVectorField ( const movingWallVelocityFvPatchVectorField& ptf, const fvPatch& p, @@ -60,7 +58,8 @@ movingWallVelocityFvPatchVectorField::movingWallVelocityFvPatchVectorField {} -movingWallVelocityFvPatchVectorField::movingWallVelocityFvPatchVectorField +Foam::movingWallVelocityFvPatchVectorField:: +movingWallVelocityFvPatchVectorField ( const fvPatch& p, const DimensionedField<vector, volMesh>& iF, @@ -74,7 +73,8 @@ movingWallVelocityFvPatchVectorField::movingWallVelocityFvPatchVectorField } -movingWallVelocityFvPatchVectorField::movingWallVelocityFvPatchVectorField +Foam::movingWallVelocityFvPatchVectorField:: +movingWallVelocityFvPatchVectorField ( const movingWallVelocityFvPatchVectorField& mwvpvf ) @@ -84,7 +84,8 @@ movingWallVelocityFvPatchVectorField::movingWallVelocityFvPatchVectorField {} -movingWallVelocityFvPatchVectorField::movingWallVelocityFvPatchVectorField +Foam::movingWallVelocityFvPatchVectorField:: +movingWallVelocityFvPatchVectorField ( const movingWallVelocityFvPatchVectorField& mwvpvf, const DimensionedField<vector, volMesh>& iF @@ -97,7 +98,7 @@ movingWallVelocityFvPatchVectorField::movingWallVelocityFvPatchVectorField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void movingWallVelocityFvPatchVectorField::updateCoeffs() +void Foam::movingWallVelocityFvPatchVectorField::updateCoeffs() { if (updated()) { @@ -116,15 +117,17 @@ void movingWallVelocityFvPatchVectorField::updateCoeffs() oldFc[i] = pp[i].centre(oldPoints); } - vectorField Up = (pp.faceCentres() - oldFc)/mesh.time().deltaTValue(); + const vectorField Up((pp.faceCentres() - oldFc)/mesh.time().deltaTValue()); const volVectorField& U = db().lookupObject<volVectorField>(UName_); - scalarField phip = - p.patchField<surfaceScalarField, scalar>(fvc::meshPhi(U)); + scalarField phip + ( + p.patchField<surfaceScalarField, scalar>(fvc::meshPhi(U)) + ); - vectorField n = p.nf(); + const vectorField n(p.nf()); const scalarField& magSf = p.magSf(); - scalarField Un = phip/(magSf + VSMALL); + tmp<scalarField> Un = phip/(magSf + VSMALL); vectorField::operator=(Up + n*(Un - (n & Up))); @@ -133,7 +136,7 @@ void movingWallVelocityFvPatchVectorField::updateCoeffs() } -void movingWallVelocityFvPatchVectorField::write(Ostream& os) const +void Foam::movingWallVelocityFvPatchVectorField::write(Ostream& os) const { fvPatchVectorField::write(os); writeEntryIfDifferent<word>(os, "U", "U", UName_); @@ -143,14 +146,13 @@ void movingWallVelocityFvPatchVectorField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField -( - fvPatchVectorField, - movingWallVelocityFvPatchVectorField -); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam +namespace Foam +{ + makeNonTemplatedPatchTypeField + ( + fvPatchVectorField, + movingWallVelocityFvPatchVectorField + ); +} // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/oscillatingFixedValue/oscillatingFixedValueFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/derived/oscillatingFixedValue/oscillatingFixedValueFvPatchFields.H index 09b7a91862afb335d0356976f329be14a189c5df..af109335210fbb67b3bae042ede43fbb25c6b94e 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/oscillatingFixedValue/oscillatingFixedValueFvPatchFields.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/oscillatingFixedValue/oscillatingFixedValueFvPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(oscillatingFixedValue) +makePatchTypeFieldTypedefs(oscillatingFixedValue); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/oscillatingFixedValue/oscillatingFixedValueFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/derived/oscillatingFixedValue/oscillatingFixedValueFvPatchFieldsFwd.H index 89fa288a0e5eacb1cf2707a15f8b2ce4a49ea4e9..930ac851f10efd1641774f6657922cc149eca7de 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/oscillatingFixedValue/oscillatingFixedValueFvPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/oscillatingFixedValue/oscillatingFixedValueFvPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class oscillatingFixedValueFvPatchField; -makePatchTypeFieldTypedefs(oscillatingFixedValue) +makePatchTypeFieldTypedefs(oscillatingFixedValue); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/outletInlet/outletInletFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/derived/outletInlet/outletInletFvPatchFields.H index 8d348b7576338b6c888878c5d17c5f3cc9b37983..8fd5158d9ae410c95135f2fcd95fa8af0eea8e70 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/outletInlet/outletInletFvPatchFields.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/outletInlet/outletInletFvPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(outletInlet) +makePatchTypeFieldTypedefs(outletInlet); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/outletInlet/outletInletFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/derived/outletInlet/outletInletFvPatchFieldsFwd.H index 8cf536eaa4e18df4cc91f2acc829baf161a18f9c..07dc336d02158060c21b689451166c100d117c44 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/outletInlet/outletInletFvPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/outletInlet/outletInletFvPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class outletInletFvPatchField; -makePatchTypeFieldTypedefs(outletInlet) +makePatchTypeFieldTypedefs(outletInlet); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/outletMappedUniformInlet/outletMappedUniformInletFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/outletMappedUniformInlet/outletMappedUniformInletFvPatchField.C index c3f2d89451f24129ed70ea860c74b049df61fceb..fb2d2502051ca96a1d28e978a9070310a847f8d2 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/outletMappedUniformInlet/outletMappedUniformInletFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/outletMappedUniformInlet/outletMappedUniformInletFvPatchField.C @@ -27,15 +27,10 @@ License #include "volFields.H" #include "surfaceFields.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class Type> -outletMappedUniformInletFvPatchField<Type>:: +Foam::outletMappedUniformInletFvPatchField<Type>:: outletMappedUniformInletFvPatchField ( const fvPatch& p, @@ -49,7 +44,7 @@ outletMappedUniformInletFvPatchField template<class Type> -outletMappedUniformInletFvPatchField<Type>:: +Foam::outletMappedUniformInletFvPatchField<Type>:: outletMappedUniformInletFvPatchField ( const outletMappedUniformInletFvPatchField<Type>& ptf, @@ -65,7 +60,7 @@ outletMappedUniformInletFvPatchField template<class Type> -outletMappedUniformInletFvPatchField<Type>:: +Foam::outletMappedUniformInletFvPatchField<Type>:: outletMappedUniformInletFvPatchField ( const fvPatch& p, @@ -80,7 +75,7 @@ outletMappedUniformInletFvPatchField template<class Type> -outletMappedUniformInletFvPatchField<Type>:: +Foam::outletMappedUniformInletFvPatchField<Type>:: outletMappedUniformInletFvPatchField ( const outletMappedUniformInletFvPatchField<Type>& ptf @@ -94,7 +89,7 @@ outletMappedUniformInletFvPatchField template<class Type> -outletMappedUniformInletFvPatchField<Type>:: +Foam::outletMappedUniformInletFvPatchField<Type>:: outletMappedUniformInletFvPatchField ( const outletMappedUniformInletFvPatchField<Type>& ptf, @@ -110,7 +105,7 @@ outletMappedUniformInletFvPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class Type> -void outletMappedUniformInletFvPatchField<Type>::updateCoeffs() +void Foam::outletMappedUniformInletFvPatchField<Type>::updateCoeffs() { if (this->updated()) { @@ -144,7 +139,9 @@ void outletMappedUniformInletFvPatchField<Type>::updateCoeffs() f.boundaryField()[outletPatchID]; const surfaceScalarField& phi = - this->db().objectRegistry::lookupObject<surfaceScalarField>(phiName_); + this->db().objectRegistry::template lookupObject<surfaceScalarField> + (phiName_); + const scalarField& outletPatchPhi = phi.boundaryField()[outletPatchID]; scalar sumOutletPatchPhi = gSum(outletPatchPhi); @@ -170,7 +167,7 @@ void outletMappedUniformInletFvPatchField<Type>::updateCoeffs() template<class Type> -void outletMappedUniformInletFvPatchField<Type>::write(Ostream& os) const +void Foam::outletMappedUniformInletFvPatchField<Type>::write(Ostream& os) const { fvPatchField<Type>::write(os); os.writeKeyword("outletPatchName") @@ -183,8 +180,4 @@ void outletMappedUniformInletFvPatchField<Type>::write(Ostream& os) const } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/outletMappedUniformInlet/outletMappedUniformInletFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/derived/outletMappedUniformInlet/outletMappedUniformInletFvPatchFields.H index 17e96617df55cc1f43abe6f9c44e46f2551d7e9c..2bd6f04871e061565f7f7fdfdd4f088a8601f216 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/outletMappedUniformInlet/outletMappedUniformInletFvPatchFields.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/outletMappedUniformInlet/outletMappedUniformInletFvPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(outletMappedUniformInlet) +makePatchTypeFieldTypedefs(outletMappedUniformInlet); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/outletMappedUniformInlet/outletMappedUniformInletFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/derived/outletMappedUniformInlet/outletMappedUniformInletFvPatchFieldsFwd.H index 76033b99236dbc661047b4fab4f63fc9cd0cf0ec..443e57fa5ad42c3484063ebe8ffeb9e97b2375f0 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/outletMappedUniformInlet/outletMappedUniformInletFvPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/outletMappedUniformInlet/outletMappedUniformInletFvPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class outletMappedUniformInletFvPatchField; -makePatchTypeFieldTypedefs(outletMappedUniformInlet) +makePatchTypeFieldTypedefs(outletMappedUniformInlet); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/partialSlip/partialSlipFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/partialSlip/partialSlipFvPatchField.C index 6ebeda2d55de32746a29eaecf6b1979daae13fea..172150f244020a24e9c90fd9237c0dd696da4d03 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/partialSlip/partialSlipFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/partialSlip/partialSlipFvPatchField.C @@ -26,15 +26,10 @@ License #include "partialSlipFvPatchField.H" #include "symmTransformField.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class Type> -partialSlipFvPatchField<Type>::partialSlipFvPatchField +Foam::partialSlipFvPatchField<Type>::partialSlipFvPatchField ( const fvPatch& p, const DimensionedField<Type, volMesh>& iF @@ -46,7 +41,7 @@ partialSlipFvPatchField<Type>::partialSlipFvPatchField template<class Type> -partialSlipFvPatchField<Type>::partialSlipFvPatchField +Foam::partialSlipFvPatchField<Type>::partialSlipFvPatchField ( const partialSlipFvPatchField<Type>& ptf, const fvPatch& p, @@ -60,7 +55,7 @@ partialSlipFvPatchField<Type>::partialSlipFvPatchField template<class Type> -partialSlipFvPatchField<Type>::partialSlipFvPatchField +Foam::partialSlipFvPatchField<Type>::partialSlipFvPatchField ( const fvPatch& p, const DimensionedField<Type, volMesh>& iF, @@ -75,7 +70,7 @@ partialSlipFvPatchField<Type>::partialSlipFvPatchField template<class Type> -partialSlipFvPatchField<Type>::partialSlipFvPatchField +Foam::partialSlipFvPatchField<Type>::partialSlipFvPatchField ( const partialSlipFvPatchField<Type>& ptf ) @@ -86,7 +81,7 @@ partialSlipFvPatchField<Type>::partialSlipFvPatchField template<class Type> -partialSlipFvPatchField<Type>::partialSlipFvPatchField +Foam::partialSlipFvPatchField<Type>::partialSlipFvPatchField ( const partialSlipFvPatchField<Type>& ptf, const DimensionedField<Type, volMesh>& iF @@ -100,7 +95,7 @@ partialSlipFvPatchField<Type>::partialSlipFvPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class Type> -void partialSlipFvPatchField<Type>::autoMap +void Foam::partialSlipFvPatchField<Type>::autoMap ( const fvPatchFieldMapper& m ) @@ -111,7 +106,7 @@ void partialSlipFvPatchField<Type>::autoMap template<class Type> -void partialSlipFvPatchField<Type>::rmap +void Foam::partialSlipFvPatchField<Type>::rmap ( const fvPatchField<Type>& ptf, const labelList& addr @@ -127,10 +122,11 @@ void partialSlipFvPatchField<Type>::rmap template<class Type> -tmp<Field<Type> > partialSlipFvPatchField<Type>::snGrad() const +Foam::tmp<Foam::Field<Type> > +Foam::partialSlipFvPatchField<Type>::snGrad() const { - vectorField nHat = this->patch().nf(); - Field<Type> pif = this->patchInternalField(); + tmp<vectorField> nHat = this->patch().nf(); + const Field<Type> pif(this->patchInternalField()); return ( @@ -140,14 +136,17 @@ tmp<Field<Type> > partialSlipFvPatchField<Type>::snGrad() const template<class Type> -void partialSlipFvPatchField<Type>::evaluate(const Pstream::commsTypes) +void Foam::partialSlipFvPatchField<Type>::evaluate +( + const Pstream::commsTypes +) { if (!this->updated()) { this->updateCoeffs(); } - vectorField nHat = this->patch().nf(); + tmp<vectorField> nHat = this->patch().nf(); Field<Type>::operator= ( @@ -160,9 +159,10 @@ void partialSlipFvPatchField<Type>::evaluate(const Pstream::commsTypes) template<class Type> -tmp<Field<Type> > partialSlipFvPatchField<Type>::snGradTransformDiag() const +Foam::tmp<Foam::Field<Type> > +Foam::partialSlipFvPatchField<Type>::snGradTransformDiag() const { - vectorField nHat = this->patch().nf(); + const vectorField nHat(this->patch().nf()); vectorField diag(nHat.size()); diag.replace(vector::X, mag(nHat.component(vector::X))); @@ -177,15 +177,11 @@ tmp<Field<Type> > partialSlipFvPatchField<Type>::snGradTransformDiag() const template<class Type> -void partialSlipFvPatchField<Type>::write(Ostream& os) const +void Foam::partialSlipFvPatchField<Type>::write(Ostream& os) const { transformFvPatchField<Type>::write(os); valueFraction_.writeEntry("valueFraction", os); } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/partialSlip/partialSlipFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/derived/partialSlip/partialSlipFvPatchFields.H index e23b03274c9826145ce6b98ef50fb35164e86b89..5fbf36552b03ac66261dacebdd00a258accf489a 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/partialSlip/partialSlipFvPatchFields.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/partialSlip/partialSlipFvPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(partialSlip) +makePatchTypeFieldTypedefs(partialSlip); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/partialSlip/partialSlipFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/derived/partialSlip/partialSlipFvPatchFieldsFwd.H index b76dd61177bb7cbb8b022a7cf954c32fd213540c..82c2b22351ce78d01913ee2e7d7dbe0b3d8b70a0 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/partialSlip/partialSlipFvPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/partialSlip/partialSlipFvPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class partialSlipFvPatchField; -makePatchTypeFieldTypedefs(partialSlip) +makePatchTypeFieldTypedefs(partialSlip); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.C index 6046617e726b231a4b40474a50415588ca2f406a..980087821c2f433668ec6f6260e549bee1248e2c 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.C @@ -29,14 +29,9 @@ License #include "volFields.H" #include "surfaceFields.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -pressureDirectedInletOutletVelocityFvPatchVectorField:: +Foam::pressureDirectedInletOutletVelocityFvPatchVectorField:: pressureDirectedInletOutletVelocityFvPatchVectorField ( const fvPatch& p, @@ -54,7 +49,7 @@ pressureDirectedInletOutletVelocityFvPatchVectorField } -pressureDirectedInletOutletVelocityFvPatchVectorField:: +Foam::pressureDirectedInletOutletVelocityFvPatchVectorField:: pressureDirectedInletOutletVelocityFvPatchVectorField ( const pressureDirectedInletOutletVelocityFvPatchVectorField& ptf, @@ -70,7 +65,7 @@ pressureDirectedInletOutletVelocityFvPatchVectorField {} -pressureDirectedInletOutletVelocityFvPatchVectorField:: +Foam::pressureDirectedInletOutletVelocityFvPatchVectorField:: pressureDirectedInletOutletVelocityFvPatchVectorField ( const fvPatch& p, @@ -90,7 +85,7 @@ pressureDirectedInletOutletVelocityFvPatchVectorField } -pressureDirectedInletOutletVelocityFvPatchVectorField:: +Foam::pressureDirectedInletOutletVelocityFvPatchVectorField:: pressureDirectedInletOutletVelocityFvPatchVectorField ( const pressureDirectedInletOutletVelocityFvPatchVectorField& pivpvf @@ -103,7 +98,7 @@ pressureDirectedInletOutletVelocityFvPatchVectorField {} -pressureDirectedInletOutletVelocityFvPatchVectorField:: +Foam::pressureDirectedInletOutletVelocityFvPatchVectorField:: pressureDirectedInletOutletVelocityFvPatchVectorField ( const pressureDirectedInletOutletVelocityFvPatchVectorField& pivpvf, @@ -119,7 +114,7 @@ pressureDirectedInletOutletVelocityFvPatchVectorField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void pressureDirectedInletOutletVelocityFvPatchVectorField::autoMap +void Foam::pressureDirectedInletOutletVelocityFvPatchVectorField::autoMap ( const fvPatchFieldMapper& m ) @@ -129,7 +124,7 @@ void pressureDirectedInletOutletVelocityFvPatchVectorField::autoMap } -void pressureDirectedInletOutletVelocityFvPatchVectorField::rmap +void Foam::pressureDirectedInletOutletVelocityFvPatchVectorField::rmap ( const fvPatchVectorField& ptf, const labelList& addr @@ -145,7 +140,7 @@ void pressureDirectedInletOutletVelocityFvPatchVectorField::rmap } -void pressureDirectedInletOutletVelocityFvPatchVectorField::updateCoeffs() +void Foam::pressureDirectedInletOutletVelocityFvPatchVectorField::updateCoeffs() { if (updated()) { @@ -158,8 +153,8 @@ void pressureDirectedInletOutletVelocityFvPatchVectorField::updateCoeffs() const fvsPatchField<scalar>& phip = patch().patchField<surfaceScalarField, scalar>(phi); - vectorField n = patch().nf(); - scalarField ndmagS = (n & inletDir_)*patch().magSf(); + tmp<vectorField> n = patch().nf(); + tmp<scalarField> ndmagS = (n & inletDir_)*patch().magSf(); if (phi.dimensions() == dimVelocity*dimArea) { @@ -191,8 +186,10 @@ void pressureDirectedInletOutletVelocityFvPatchVectorField::updateCoeffs() } -void pressureDirectedInletOutletVelocityFvPatchVectorField:: -write(Ostream& os) const +void Foam::pressureDirectedInletOutletVelocityFvPatchVectorField::write +( + Ostream& os +) const { fvPatchVectorField::write(os); writeEntryIfDifferent<word>(os, "phi", "phi", phiName_); @@ -204,7 +201,7 @@ write(Ostream& os) const // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // -void pressureDirectedInletOutletVelocityFvPatchVectorField::operator= +void Foam::pressureDirectedInletOutletVelocityFvPatchVectorField::operator= ( const fvPatchField<vector>& pvf ) @@ -219,14 +216,13 @@ void pressureDirectedInletOutletVelocityFvPatchVectorField::operator= // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField -( - fvPatchVectorField, - pressureDirectedInletOutletVelocityFvPatchVectorField -); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam +namespace Foam +{ + makeNonTemplatedPatchTypeField + ( + fvPatchVectorField, + pressureDirectedInletOutletVelocityFvPatchVectorField + ); +} // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletVelocity/pressureDirectedInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletVelocity/pressureDirectedInletVelocityFvPatchVectorField.C index 6125ee41dee83771cad10cf842d712c96dfc82ec..1ecafe0e0968f3e1b06ce4622eb68dcdf0e28eaa 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletVelocity/pressureDirectedInletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletVelocity/pressureDirectedInletVelocityFvPatchVectorField.C @@ -29,14 +29,10 @@ License #include "volFields.H" #include "surfaceFields.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -pressureDirectedInletVelocityFvPatchVectorField:: +Foam::pressureDirectedInletVelocityFvPatchVectorField:: pressureDirectedInletVelocityFvPatchVectorField ( const fvPatch& p, @@ -50,7 +46,7 @@ pressureDirectedInletVelocityFvPatchVectorField {} -pressureDirectedInletVelocityFvPatchVectorField:: +Foam::pressureDirectedInletVelocityFvPatchVectorField:: pressureDirectedInletVelocityFvPatchVectorField ( const pressureDirectedInletVelocityFvPatchVectorField& ptf, @@ -66,7 +62,7 @@ pressureDirectedInletVelocityFvPatchVectorField {} -pressureDirectedInletVelocityFvPatchVectorField:: +Foam::pressureDirectedInletVelocityFvPatchVectorField:: pressureDirectedInletVelocityFvPatchVectorField ( const fvPatch& p, @@ -83,7 +79,7 @@ pressureDirectedInletVelocityFvPatchVectorField } -pressureDirectedInletVelocityFvPatchVectorField:: +Foam::pressureDirectedInletVelocityFvPatchVectorField:: pressureDirectedInletVelocityFvPatchVectorField ( const pressureDirectedInletVelocityFvPatchVectorField& pivpvf @@ -96,7 +92,7 @@ pressureDirectedInletVelocityFvPatchVectorField {} -pressureDirectedInletVelocityFvPatchVectorField:: +Foam::pressureDirectedInletVelocityFvPatchVectorField:: pressureDirectedInletVelocityFvPatchVectorField ( const pressureDirectedInletVelocityFvPatchVectorField& pivpvf, @@ -112,7 +108,7 @@ pressureDirectedInletVelocityFvPatchVectorField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void pressureDirectedInletVelocityFvPatchVectorField::autoMap +void Foam::pressureDirectedInletVelocityFvPatchVectorField::autoMap ( const fvPatchFieldMapper& m ) @@ -122,7 +118,7 @@ void pressureDirectedInletVelocityFvPatchVectorField::autoMap } -void pressureDirectedInletVelocityFvPatchVectorField::rmap +void Foam::pressureDirectedInletVelocityFvPatchVectorField::rmap ( const fvPatchVectorField& ptf, const labelList& addr @@ -137,7 +133,7 @@ void pressureDirectedInletVelocityFvPatchVectorField::rmap } -void pressureDirectedInletVelocityFvPatchVectorField::updateCoeffs() +void Foam::pressureDirectedInletVelocityFvPatchVectorField::updateCoeffs() { if (updated()) { @@ -150,8 +146,8 @@ void pressureDirectedInletVelocityFvPatchVectorField::updateCoeffs() const fvsPatchField<scalar>& phip = patch().patchField<surfaceScalarField, scalar>(phi); - vectorField n = patch().nf(); - scalarField ndmagS = (n & inletDir_)*patch().magSf(); + tmp<vectorField> n = patch().nf(); + tmp<scalarField> ndmagS = (n & inletDir_)*patch().magSf(); if (phi.dimensions() == dimVelocity*dimArea) { @@ -180,7 +176,10 @@ void pressureDirectedInletVelocityFvPatchVectorField::updateCoeffs() } -void pressureDirectedInletVelocityFvPatchVectorField::write(Ostream& os) const +void Foam::pressureDirectedInletVelocityFvPatchVectorField::write +( + Ostream& os +) const { fvPatchVectorField::write(os); writeEntryIfDifferent<word>(os, "phi", "phi", phiName_); @@ -192,7 +191,7 @@ void pressureDirectedInletVelocityFvPatchVectorField::write(Ostream& os) const // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // -void pressureDirectedInletVelocityFvPatchVectorField::operator= +void Foam::pressureDirectedInletVelocityFvPatchVectorField::operator= ( const fvPatchField<vector>& pvf ) @@ -203,15 +202,13 @@ void pressureDirectedInletVelocityFvPatchVectorField::operator= // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField -( - fvPatchVectorField, - pressureDirectedInletVelocityFvPatchVectorField -); - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam +namespace Foam +{ + makeNonTemplatedPatchTypeField + ( + fvPatchVectorField, + pressureDirectedInletVelocityFvPatchVectorField + ); +} // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.C index 9d28b4796b68c2094a384568f7f13b5448d11246..d4e4d8aa0a026ba3d202a43019c04076b877c481 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.C @@ -28,14 +28,10 @@ License #include "volFields.H" #include "surfaceFields.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -pressureInletOutletVelocityFvPatchVectorField:: +Foam::pressureInletOutletVelocityFvPatchVectorField:: pressureInletOutletVelocityFvPatchVectorField ( const fvPatch& p, @@ -51,7 +47,7 @@ pressureInletOutletVelocityFvPatchVectorField } -pressureInletOutletVelocityFvPatchVectorField:: +Foam::pressureInletOutletVelocityFvPatchVectorField:: pressureInletOutletVelocityFvPatchVectorField ( const pressureInletOutletVelocityFvPatchVectorField& ptf, @@ -70,7 +66,7 @@ pressureInletOutletVelocityFvPatchVectorField } -pressureInletOutletVelocityFvPatchVectorField:: +Foam::pressureInletOutletVelocityFvPatchVectorField:: pressureInletOutletVelocityFvPatchVectorField ( const fvPatch& p, @@ -100,7 +96,7 @@ pressureInletOutletVelocityFvPatchVectorField } -pressureInletOutletVelocityFvPatchVectorField:: +Foam::pressureInletOutletVelocityFvPatchVectorField:: pressureInletOutletVelocityFvPatchVectorField ( const pressureInletOutletVelocityFvPatchVectorField& pivpvf @@ -112,7 +108,7 @@ pressureInletOutletVelocityFvPatchVectorField {} -pressureInletOutletVelocityFvPatchVectorField:: +Foam::pressureInletOutletVelocityFvPatchVectorField:: pressureInletOutletVelocityFvPatchVectorField ( const pressureInletOutletVelocityFvPatchVectorField& pivpvf, @@ -127,16 +123,16 @@ pressureInletOutletVelocityFvPatchVectorField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void pressureInletOutletVelocityFvPatchVectorField:: +void Foam::pressureInletOutletVelocityFvPatchVectorField:: setTangentialVelocity(const vectorField& tangentialVelocity) { tangentialVelocity_ = tangentialVelocity; - vectorField n = patch().nf(); + const vectorField n(patch().nf()); refValue() = tangentialVelocity_ - n*(n & tangentialVelocity_); } -void pressureInletOutletVelocityFvPatchVectorField::autoMap +void Foam::pressureInletOutletVelocityFvPatchVectorField::autoMap ( const fvPatchFieldMapper& m ) @@ -149,7 +145,7 @@ void pressureInletOutletVelocityFvPatchVectorField::autoMap } -void pressureInletOutletVelocityFvPatchVectorField::rmap +void Foam::pressureInletOutletVelocityFvPatchVectorField::rmap ( const fvPatchVectorField& ptf, const labelList& addr @@ -167,7 +163,7 @@ void pressureInletOutletVelocityFvPatchVectorField::rmap } -void pressureInletOutletVelocityFvPatchVectorField::updateCoeffs() +void Foam::pressureInletOutletVelocityFvPatchVectorField::updateCoeffs() { if (updated()) { @@ -184,7 +180,11 @@ void pressureInletOutletVelocityFvPatchVectorField::updateCoeffs() } -void pressureInletOutletVelocityFvPatchVectorField::write(Ostream& os) const +void Foam::pressureInletOutletVelocityFvPatchVectorField::write +( + Ostream& os +) +const { fvPatchVectorField::write(os); writeEntryIfDifferent<word>(os, "phi", "phi", phiName_); @@ -198,27 +198,26 @@ void pressureInletOutletVelocityFvPatchVectorField::write(Ostream& os) const // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // -void pressureInletOutletVelocityFvPatchVectorField::operator= +void Foam::pressureInletOutletVelocityFvPatchVectorField::operator= ( const fvPatchField<vector>& pvf ) { - vectorField normalValue = transform(valueFraction(), refValue()); - vectorField transformGradValue = transform(I - valueFraction(), pvf); + tmp<vectorField> normalValue = transform(valueFraction(), refValue()); + tmp<vectorField> transformGradValue = transform(I - valueFraction(), pvf); fvPatchField<vector>::operator=(normalValue + transformGradValue); } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField -( - fvPatchVectorField, - pressureInletOutletVelocityFvPatchVectorField -); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam +namespace Foam +{ + makeNonTemplatedPatchTypeField + ( + fvPatchVectorField, + pressureInletOutletVelocityFvPatchVectorField + ); +} // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletUniformVelocity/pressureInletUniformVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletUniformVelocity/pressureInletUniformVelocityFvPatchVectorField.C index 46bd5d107f83a9c47d91790b5ef8fa2c35ed11bb..1131b9a800a16c35d711c4d93acf5291a4415fb6 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletUniformVelocity/pressureInletUniformVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletUniformVelocity/pressureInletUniformVelocityFvPatchVectorField.C @@ -28,14 +28,9 @@ License #include "volFields.H" #include "surfaceFields.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -pressureInletUniformVelocityFvPatchVectorField:: +Foam::pressureInletUniformVelocityFvPatchVectorField:: pressureInletUniformVelocityFvPatchVectorField ( const fvPatch& p, @@ -46,7 +41,7 @@ pressureInletUniformVelocityFvPatchVectorField {} -pressureInletUniformVelocityFvPatchVectorField:: +Foam::pressureInletUniformVelocityFvPatchVectorField:: pressureInletUniformVelocityFvPatchVectorField ( const pressureInletUniformVelocityFvPatchVectorField& ptf, @@ -59,7 +54,7 @@ pressureInletUniformVelocityFvPatchVectorField {} -pressureInletUniformVelocityFvPatchVectorField:: +Foam::pressureInletUniformVelocityFvPatchVectorField:: pressureInletUniformVelocityFvPatchVectorField ( const fvPatch& p, @@ -71,7 +66,7 @@ pressureInletUniformVelocityFvPatchVectorField {} -pressureInletUniformVelocityFvPatchVectorField:: +Foam::pressureInletUniformVelocityFvPatchVectorField:: pressureInletUniformVelocityFvPatchVectorField ( const pressureInletUniformVelocityFvPatchVectorField& pivpvf @@ -81,7 +76,7 @@ pressureInletUniformVelocityFvPatchVectorField {} -pressureInletUniformVelocityFvPatchVectorField:: +Foam::pressureInletUniformVelocityFvPatchVectorField:: pressureInletUniformVelocityFvPatchVectorField ( const pressureInletUniformVelocityFvPatchVectorField& pivpvf, @@ -94,7 +89,7 @@ pressureInletUniformVelocityFvPatchVectorField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void pressureInletUniformVelocityFvPatchVectorField::updateCoeffs() +void Foam::pressureInletUniformVelocityFvPatchVectorField::updateCoeffs() { if (updated()) { @@ -109,7 +104,7 @@ void pressureInletUniformVelocityFvPatchVectorField::updateCoeffs() // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // -void pressureInletUniformVelocityFvPatchVectorField::operator= +void Foam::pressureInletUniformVelocityFvPatchVectorField::operator= ( const fvPatchField<vector>& pvf ) @@ -120,14 +115,13 @@ void pressureInletUniformVelocityFvPatchVectorField::operator= // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField -( - fvPatchVectorField, - pressureInletUniformVelocityFvPatchVectorField -); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam +namespace Foam +{ + makeNonTemplatedPatchTypeField + ( + fvPatchVectorField, + pressureInletUniformVelocityFvPatchVectorField + ); +} // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletVelocity/pressureInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletVelocity/pressureInletVelocityFvPatchVectorField.C index 84513de9f9c8855823c8890d878420df28d709e4..6ef3ff50956468064e04e941e3cc22a0f0908952 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletVelocity/pressureInletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletVelocity/pressureInletVelocityFvPatchVectorField.C @@ -28,14 +28,10 @@ License #include "volFields.H" #include "surfaceFields.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -pressureInletVelocityFvPatchVectorField::pressureInletVelocityFvPatchVectorField +Foam::pressureInletVelocityFvPatchVectorField:: +pressureInletVelocityFvPatchVectorField ( const fvPatch& p, const DimensionedField<vector, volMesh>& iF @@ -47,7 +43,8 @@ pressureInletVelocityFvPatchVectorField::pressureInletVelocityFvPatchVectorField {} -pressureInletVelocityFvPatchVectorField::pressureInletVelocityFvPatchVectorField +Foam::pressureInletVelocityFvPatchVectorField:: +pressureInletVelocityFvPatchVectorField ( const pressureInletVelocityFvPatchVectorField& ptf, const fvPatch& p, @@ -61,7 +58,8 @@ pressureInletVelocityFvPatchVectorField::pressureInletVelocityFvPatchVectorField {} -pressureInletVelocityFvPatchVectorField::pressureInletVelocityFvPatchVectorField +Foam::pressureInletVelocityFvPatchVectorField:: +pressureInletVelocityFvPatchVectorField ( const fvPatch& p, const DimensionedField<vector, volMesh>& iF, @@ -76,7 +74,8 @@ pressureInletVelocityFvPatchVectorField::pressureInletVelocityFvPatchVectorField } -pressureInletVelocityFvPatchVectorField::pressureInletVelocityFvPatchVectorField +Foam::pressureInletVelocityFvPatchVectorField:: +pressureInletVelocityFvPatchVectorField ( const pressureInletVelocityFvPatchVectorField& pivpvf ) @@ -87,7 +86,8 @@ pressureInletVelocityFvPatchVectorField::pressureInletVelocityFvPatchVectorField {} -pressureInletVelocityFvPatchVectorField::pressureInletVelocityFvPatchVectorField +Foam::pressureInletVelocityFvPatchVectorField:: +pressureInletVelocityFvPatchVectorField ( const pressureInletVelocityFvPatchVectorField& pivpvf, const DimensionedField<vector, volMesh>& iF @@ -101,7 +101,7 @@ pressureInletVelocityFvPatchVectorField::pressureInletVelocityFvPatchVectorField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void pressureInletVelocityFvPatchVectorField::updateCoeffs() +void Foam::pressureInletVelocityFvPatchVectorField::updateCoeffs() { if (updated()) { @@ -114,7 +114,7 @@ void pressureInletVelocityFvPatchVectorField::updateCoeffs() const fvsPatchField<scalar>& phip = patch().patchField<surfaceScalarField, scalar>(phi); - vectorField n = patch().nf(); + tmp<vectorField> n = patch().nf(); const Field<scalar>& magS = patch().magSf(); if (phi.dimensions() == dimVelocity*dimArea) @@ -142,7 +142,7 @@ void pressureInletVelocityFvPatchVectorField::updateCoeffs() } -void pressureInletVelocityFvPatchVectorField::write(Ostream& os) const +void Foam::pressureInletVelocityFvPatchVectorField::write(Ostream& os) const { fvPatchVectorField::write(os); writeEntryIfDifferent<word>(os, "phi", "phi", phiName_); @@ -153,7 +153,7 @@ void pressureInletVelocityFvPatchVectorField::write(Ostream& os) const // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // -void pressureInletVelocityFvPatchVectorField::operator= +void Foam::pressureInletVelocityFvPatchVectorField::operator= ( const fvPatchField<vector>& pvf ) @@ -164,14 +164,13 @@ void pressureInletVelocityFvPatchVectorField::operator= // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField -( - fvPatchVectorField, - pressureInletVelocityFvPatchVectorField -); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam +namespace Foam +{ + makeNonTemplatedPatchTypeField + ( + fvPatchVectorField, + pressureInletVelocityFvPatchVectorField + ); +} // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureNormalInletOutletVelocity/pressureNormalInletOutletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/pressureNormalInletOutletVelocity/pressureNormalInletOutletVelocityFvPatchVectorField.C index 4ac7f309f2337ea45f3f9457c6251adb93b45f1f..0f1577ebcfc93f123d21ea16b53ad5a075e8b7e5 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureNormalInletOutletVelocity/pressureNormalInletOutletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureNormalInletOutletVelocity/pressureNormalInletOutletVelocityFvPatchVectorField.C @@ -29,14 +29,10 @@ License #include "volFields.H" #include "surfaceFields.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -pressureNormalInletOutletVelocityFvPatchVectorField:: +Foam::pressureNormalInletOutletVelocityFvPatchVectorField:: pressureNormalInletOutletVelocityFvPatchVectorField ( const fvPatch& p, @@ -53,7 +49,7 @@ pressureNormalInletOutletVelocityFvPatchVectorField } -pressureNormalInletOutletVelocityFvPatchVectorField:: +Foam::pressureNormalInletOutletVelocityFvPatchVectorField:: pressureNormalInletOutletVelocityFvPatchVectorField ( const pressureNormalInletOutletVelocityFvPatchVectorField& ptf, @@ -68,7 +64,7 @@ pressureNormalInletOutletVelocityFvPatchVectorField {} -pressureNormalInletOutletVelocityFvPatchVectorField:: +Foam::pressureNormalInletOutletVelocityFvPatchVectorField:: pressureNormalInletOutletVelocityFvPatchVectorField ( const fvPatch& p, @@ -87,7 +83,7 @@ pressureNormalInletOutletVelocityFvPatchVectorField } -pressureNormalInletOutletVelocityFvPatchVectorField:: +Foam::pressureNormalInletOutletVelocityFvPatchVectorField:: pressureNormalInletOutletVelocityFvPatchVectorField ( const pressureNormalInletOutletVelocityFvPatchVectorField& pivpvf @@ -99,7 +95,7 @@ pressureNormalInletOutletVelocityFvPatchVectorField {} -pressureNormalInletOutletVelocityFvPatchVectorField:: +Foam::pressureNormalInletOutletVelocityFvPatchVectorField:: pressureNormalInletOutletVelocityFvPatchVectorField ( const pressureNormalInletOutletVelocityFvPatchVectorField& pivpvf, @@ -114,7 +110,7 @@ pressureNormalInletOutletVelocityFvPatchVectorField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void pressureNormalInletOutletVelocityFvPatchVectorField::updateCoeffs() +void Foam::pressureNormalInletOutletVelocityFvPatchVectorField::updateCoeffs() { if (updated()) { @@ -127,7 +123,7 @@ void pressureNormalInletOutletVelocityFvPatchVectorField::updateCoeffs() const fvsPatchField<scalar>& phip = patch().patchField<surfaceScalarField, scalar>(phi); - vectorField n = patch().nf(); + tmp<vectorField> n = patch().nf(); const Field<scalar>& magS = patch().magSf(); if (phi.dimensions() == dimVelocity*dimArea) @@ -160,8 +156,10 @@ void pressureNormalInletOutletVelocityFvPatchVectorField::updateCoeffs() } -void pressureNormalInletOutletVelocityFvPatchVectorField:: -write(Ostream& os) const +void Foam::pressureNormalInletOutletVelocityFvPatchVectorField::write +( + Ostream& os +) const { fvPatchVectorField::write(os); os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl; @@ -172,7 +170,7 @@ write(Ostream& os) const // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // -void pressureNormalInletOutletVelocityFvPatchVectorField::operator= +void Foam::pressureNormalInletOutletVelocityFvPatchVectorField::operator= ( const fvPatchField<vector>& pvf ) @@ -187,14 +185,13 @@ void pressureNormalInletOutletVelocityFvPatchVectorField::operator= // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField -( - fvPatchVectorField, - pressureNormalInletOutletVelocityFvPatchVectorField -); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam +namespace Foam +{ + makeNonTemplatedPatchTypeField + ( + fvPatchVectorField, + pressureNormalInletOutletVelocityFvPatchVectorField + ); +} // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.C index 6b9d4efb12317051fe49e1f18a0160094dcb2466..f32e945c9aace9826565bd9b7403fdc899a11334 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.C @@ -28,28 +28,25 @@ License #include "volFields.H" #include "surfaceFields.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -void rotatingPressureInletOutletVelocityFvPatchVectorField:: +void Foam::rotatingPressureInletOutletVelocityFvPatchVectorField:: calcTangentialVelocity() { vector axisHat = omega_/mag(omega_); - vectorField tangentialVelocity = - (-omega_) ^ (patch().Cf() - axisHat*(axisHat & patch().Cf())); + const vectorField tangentialVelocity + ( + (-omega_) ^ (patch().Cf() - axisHat*(axisHat & patch().Cf())) + ); - vectorField n = patch().nf(); + const vectorField n(patch().nf()); refValue() = tangentialVelocity - n*(n & tangentialVelocity); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -rotatingPressureInletOutletVelocityFvPatchVectorField:: +Foam::rotatingPressureInletOutletVelocityFvPatchVectorField:: rotatingPressureInletOutletVelocityFvPatchVectorField ( const fvPatch& p, @@ -61,7 +58,7 @@ rotatingPressureInletOutletVelocityFvPatchVectorField {} -rotatingPressureInletOutletVelocityFvPatchVectorField:: +Foam::rotatingPressureInletOutletVelocityFvPatchVectorField:: rotatingPressureInletOutletVelocityFvPatchVectorField ( const rotatingPressureInletOutletVelocityFvPatchVectorField& ptf, @@ -77,7 +74,7 @@ rotatingPressureInletOutletVelocityFvPatchVectorField } -rotatingPressureInletOutletVelocityFvPatchVectorField:: +Foam::rotatingPressureInletOutletVelocityFvPatchVectorField:: rotatingPressureInletOutletVelocityFvPatchVectorField ( const fvPatch& p, @@ -92,7 +89,7 @@ rotatingPressureInletOutletVelocityFvPatchVectorField } -rotatingPressureInletOutletVelocityFvPatchVectorField:: +Foam::rotatingPressureInletOutletVelocityFvPatchVectorField:: rotatingPressureInletOutletVelocityFvPatchVectorField ( const rotatingPressureInletOutletVelocityFvPatchVectorField& pivpvf @@ -105,7 +102,7 @@ rotatingPressureInletOutletVelocityFvPatchVectorField } -rotatingPressureInletOutletVelocityFvPatchVectorField:: +Foam::rotatingPressureInletOutletVelocityFvPatchVectorField:: rotatingPressureInletOutletVelocityFvPatchVectorField ( const rotatingPressureInletOutletVelocityFvPatchVectorField& pivpvf, @@ -121,8 +118,10 @@ rotatingPressureInletOutletVelocityFvPatchVectorField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void rotatingPressureInletOutletVelocityFvPatchVectorField:: -write(Ostream& os) const +void Foam::rotatingPressureInletOutletVelocityFvPatchVectorField::write +( + Ostream& os +) const { fvPatchVectorField::write(os); os.writeKeyword("phi") << phiName() << token::END_STATEMENT << nl; @@ -133,14 +132,13 @@ write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField -( - fvPatchVectorField, - rotatingPressureInletOutletVelocityFvPatchVectorField -); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam +namespace Foam +{ + makeNonTemplatedPatchTypeField + ( + fvPatchVectorField, + rotatingPressureInletOutletVelocityFvPatchVectorField + ); +} // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.C index 11debd36208baed9cf0cc420f7342f9a76e01efc..fcde041a1beed49e13e999c90f372f8fb9b8c334 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.C @@ -29,14 +29,10 @@ License #include "volFields.H" #include "surfaceFields.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -rotatingTotalPressureFvPatchScalarField::rotatingTotalPressureFvPatchScalarField +Foam::rotatingTotalPressureFvPatchScalarField:: +rotatingTotalPressureFvPatchScalarField ( const fvPatch& p, const DimensionedField<scalar, volMesh>& iF @@ -47,7 +43,8 @@ rotatingTotalPressureFvPatchScalarField::rotatingTotalPressureFvPatchScalarField {} -rotatingTotalPressureFvPatchScalarField::rotatingTotalPressureFvPatchScalarField +Foam::rotatingTotalPressureFvPatchScalarField:: +rotatingTotalPressureFvPatchScalarField ( const rotatingTotalPressureFvPatchScalarField& ptf, const fvPatch& p, @@ -60,7 +57,8 @@ rotatingTotalPressureFvPatchScalarField::rotatingTotalPressureFvPatchScalarField {} -rotatingTotalPressureFvPatchScalarField::rotatingTotalPressureFvPatchScalarField +Foam::rotatingTotalPressureFvPatchScalarField:: +rotatingTotalPressureFvPatchScalarField ( const fvPatch& p, const DimensionedField<scalar, volMesh>& iF, @@ -72,7 +70,8 @@ rotatingTotalPressureFvPatchScalarField::rotatingTotalPressureFvPatchScalarField {} -rotatingTotalPressureFvPatchScalarField::rotatingTotalPressureFvPatchScalarField +Foam::rotatingTotalPressureFvPatchScalarField:: +rotatingTotalPressureFvPatchScalarField ( const rotatingTotalPressureFvPatchScalarField& tppsf ) @@ -82,7 +81,8 @@ rotatingTotalPressureFvPatchScalarField::rotatingTotalPressureFvPatchScalarField {} -rotatingTotalPressureFvPatchScalarField::rotatingTotalPressureFvPatchScalarField +Foam::rotatingTotalPressureFvPatchScalarField:: +rotatingTotalPressureFvPatchScalarField ( const rotatingTotalPressureFvPatchScalarField& tppsf, const DimensionedField<scalar, volMesh>& iF @@ -95,7 +95,7 @@ rotatingTotalPressureFvPatchScalarField::rotatingTotalPressureFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void rotatingTotalPressureFvPatchScalarField::updateCoeffs() +void Foam::rotatingTotalPressureFvPatchScalarField::updateCoeffs() { if (updated()) { @@ -103,17 +103,20 @@ void rotatingTotalPressureFvPatchScalarField::updateCoeffs() } vector axisHat = omega_/mag(omega_); - vectorField rotationVelocity = + tmp<vectorField> rotationVelocity = omega_ ^ (patch().Cf() - axisHat*(axisHat & patch().Cf())); - vectorField Up = patch().lookupPatchField<volVectorField, vector>(UName()) - + rotationVelocity; + const vectorField Up + ( + patch().lookupPatchField<volVectorField, vector>(UName()) + + rotationVelocity + ); totalPressureFvPatchScalarField::updateCoeffs(Up); } -void rotatingTotalPressureFvPatchScalarField::write(Ostream& os) const +void Foam::rotatingTotalPressureFvPatchScalarField::write(Ostream& os) const { totalPressureFvPatchScalarField::write(os); os.writeKeyword("omega")<< omega_ << token::END_STATEMENT << nl; @@ -122,14 +125,13 @@ void rotatingTotalPressureFvPatchScalarField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField -( - fvPatchScalarField, - rotatingTotalPressureFvPatchScalarField -); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam +namespace Foam +{ + makeNonTemplatedPatchTypeField + ( + fvPatchScalarField, + rotatingTotalPressureFvPatchScalarField + ); +} // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C index 202ce95118dff4328ad536046130ca65e228713a..5f7b493a5595bb790977b825b537b66367e160de 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C @@ -28,14 +28,10 @@ License #include "volFields.H" #include "surfaceFields.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -rotatingWallVelocityFvPatchVectorField::rotatingWallVelocityFvPatchVectorField +Foam::rotatingWallVelocityFvPatchVectorField:: +rotatingWallVelocityFvPatchVectorField ( const fvPatch& p, const DimensionedField<vector, volMesh>& iF @@ -48,7 +44,8 @@ rotatingWallVelocityFvPatchVectorField::rotatingWallVelocityFvPatchVectorField {} -rotatingWallVelocityFvPatchVectorField::rotatingWallVelocityFvPatchVectorField +Foam::rotatingWallVelocityFvPatchVectorField:: +rotatingWallVelocityFvPatchVectorField ( const rotatingWallVelocityFvPatchVectorField& ptf, const fvPatch& p, @@ -63,7 +60,8 @@ rotatingWallVelocityFvPatchVectorField::rotatingWallVelocityFvPatchVectorField {} -rotatingWallVelocityFvPatchVectorField::rotatingWallVelocityFvPatchVectorField +Foam::rotatingWallVelocityFvPatchVectorField:: +rotatingWallVelocityFvPatchVectorField ( const fvPatch& p, const DimensionedField<vector, volMesh>& iF, @@ -80,7 +78,8 @@ rotatingWallVelocityFvPatchVectorField::rotatingWallVelocityFvPatchVectorField } -rotatingWallVelocityFvPatchVectorField::rotatingWallVelocityFvPatchVectorField +Foam::rotatingWallVelocityFvPatchVectorField:: +rotatingWallVelocityFvPatchVectorField ( const rotatingWallVelocityFvPatchVectorField& pivpvf ) @@ -92,7 +91,8 @@ rotatingWallVelocityFvPatchVectorField::rotatingWallVelocityFvPatchVectorField {} -rotatingWallVelocityFvPatchVectorField::rotatingWallVelocityFvPatchVectorField +Foam::rotatingWallVelocityFvPatchVectorField:: +rotatingWallVelocityFvPatchVectorField ( const rotatingWallVelocityFvPatchVectorField& pivpvf, const DimensionedField<vector, volMesh>& iF @@ -107,7 +107,7 @@ rotatingWallVelocityFvPatchVectorField::rotatingWallVelocityFvPatchVectorField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void rotatingWallVelocityFvPatchVectorField::updateCoeffs() +void Foam::rotatingWallVelocityFvPatchVectorField::updateCoeffs() { if (updated()) { @@ -115,18 +115,21 @@ void rotatingWallVelocityFvPatchVectorField::updateCoeffs() } // Calculate the rotating wall velocity from the specification of the motion - vectorField Up = (-omega_)*((patch().Cf() - origin_) ^ (axis_/mag(axis_))); + const vectorField Up + ( + (-omega_)*((patch().Cf() - origin_) ^ (axis_/mag(axis_))) + ); // Remove the component of Up normal to the wall // just in case it is not exactly circular - vectorField n = patch().nf(); + const vectorField n(patch().nf()); vectorField::operator=(Up - n*(n & Up)); fixedValueFvPatchVectorField::updateCoeffs(); } -void rotatingWallVelocityFvPatchVectorField::write(Ostream& os) const +void Foam::rotatingWallVelocityFvPatchVectorField::write(Ostream& os) const { fvPatchVectorField::write(os); os.writeKeyword("origin") << origin_ << token::END_STATEMENT << nl; @@ -138,15 +141,13 @@ void rotatingWallVelocityFvPatchVectorField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField -( - fvPatchVectorField, - rotatingWallVelocityFvPatchVectorField -); - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam +namespace Foam +{ + makeNonTemplatedPatchTypeField + ( + fvPatchVectorField, + rotatingWallVelocityFvPatchVectorField + ); +} // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/selfContainedDirectMapped/selfContainedDirectMappedFixedValueFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/derived/selfContainedDirectMapped/selfContainedDirectMappedFixedValueFvPatchFields.H index de8e960439e28465063413202610b1c34a57c815..0d5cb6f84838834e3a36d9d6026a8ee5b112313b 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/selfContainedDirectMapped/selfContainedDirectMappedFixedValueFvPatchFields.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/selfContainedDirectMapped/selfContainedDirectMappedFixedValueFvPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(selfContainedDirectMappedFixedValue) +makePatchTypeFieldTypedefs(selfContainedDirectMappedFixedValue); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/selfContainedDirectMapped/selfContainedDirectMappedFixedValueFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/derived/selfContainedDirectMapped/selfContainedDirectMappedFixedValueFvPatchFieldsFwd.H index 1c487460cd2f8c852bf3af4f8e9c68b7eaab1747..9b5767cd66c52f901fe039b54a47992ed6f58b32 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/selfContainedDirectMapped/selfContainedDirectMappedFixedValueFvPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/selfContainedDirectMapped/selfContainedDirectMappedFixedValueFvPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class selfContainedDirectMappedFixedValueFvPatchField; -makePatchTypeFieldTypedefs(selfContainedDirectMappedFixedValue) +makePatchTypeFieldTypedefs(selfContainedDirectMappedFixedValue); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/slip/slipFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/derived/slip/slipFvPatchFields.H index afbec1c427beb5296a57d68aef04c64ebf83d77c..cd3b94c256c25ecfa8ee833509156c0348128f40 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/slip/slipFvPatchFields.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/slip/slipFvPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(slip) +makePatchTypeFieldTypedefs(slip); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/slip/slipFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/derived/slip/slipFvPatchFieldsFwd.H index 63f28f3ab99e59bd1395b7dd874e1feae9633f85..fbdda1a82910b2f734e7866499db402944ecc980 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/slip/slipFvPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/slip/slipFvPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class slipFvPatchField; -makePatchTypeFieldTypedefs(slip) +makePatchTypeFieldTypedefs(slip); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/supersonicFreestream/supersonicFreestreamFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/supersonicFreestream/supersonicFreestreamFvPatchVectorField.C index 9f78e1f2f36f71d3fe29a653de242133c5bf45cb..785b03b2d104a2baf925bc5577aafbb0fa3626dc 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/supersonicFreestream/supersonicFreestreamFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/supersonicFreestream/supersonicFreestreamFvPatchVectorField.C @@ -28,14 +28,10 @@ License #include "fvPatchFieldMapper.H" #include "volFields.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -supersonicFreestreamFvPatchVectorField::supersonicFreestreamFvPatchVectorField +Foam::supersonicFreestreamFvPatchVectorField:: +supersonicFreestreamFvPatchVectorField ( const fvPatch& p, const DimensionedField<vector, volMesh>& iF @@ -53,7 +49,8 @@ supersonicFreestreamFvPatchVectorField::supersonicFreestreamFvPatchVectorField } -supersonicFreestreamFvPatchVectorField::supersonicFreestreamFvPatchVectorField +Foam::supersonicFreestreamFvPatchVectorField:: +supersonicFreestreamFvPatchVectorField ( const supersonicFreestreamFvPatchVectorField& ptf, const fvPatch& p, @@ -69,7 +66,8 @@ supersonicFreestreamFvPatchVectorField::supersonicFreestreamFvPatchVectorField {} -supersonicFreestreamFvPatchVectorField::supersonicFreestreamFvPatchVectorField +Foam::supersonicFreestreamFvPatchVectorField:: +supersonicFreestreamFvPatchVectorField ( const fvPatch& p, const DimensionedField<vector, volMesh>& iF, @@ -115,7 +113,8 @@ supersonicFreestreamFvPatchVectorField::supersonicFreestreamFvPatchVectorField } -supersonicFreestreamFvPatchVectorField::supersonicFreestreamFvPatchVectorField +Foam::supersonicFreestreamFvPatchVectorField:: +supersonicFreestreamFvPatchVectorField ( const supersonicFreestreamFvPatchVectorField& sfspvf ) @@ -128,7 +127,8 @@ supersonicFreestreamFvPatchVectorField::supersonicFreestreamFvPatchVectorField {} -supersonicFreestreamFvPatchVectorField::supersonicFreestreamFvPatchVectorField +Foam::supersonicFreestreamFvPatchVectorField:: +supersonicFreestreamFvPatchVectorField ( const supersonicFreestreamFvPatchVectorField& sfspvf, const DimensionedField<vector, volMesh>& iF @@ -144,7 +144,7 @@ supersonicFreestreamFvPatchVectorField::supersonicFreestreamFvPatchVectorField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void supersonicFreestreamFvPatchVectorField::updateCoeffs() +void Foam::supersonicFreestreamFvPatchVectorField::updateCoeffs() { if (!size() || updated()) { @@ -182,7 +182,7 @@ void supersonicFreestreamFvPatchVectorField::updateCoeffs() valueFraction() = 1; // get the near patch internal cell values - vectorField U = patchInternalField(); + const vectorField U(patchInternalField()); // Find the component of U normal to the free-stream flow and in the @@ -192,23 +192,18 @@ void supersonicFreestreamFvPatchVectorField::updateCoeffs() vector UInfHat = UInf_/mag(UInf_); // Normal to the plane defined by the free-stream and the patch normal - vectorField nnInfHat = UInfHat ^ patch().nf(); - - //vectorField UnInf = U - nnInfHat*(nnInfHat & U); - //vectorField Un = UnInf - UInfHat*(UInfHat & UnInf); - //vectorField nHatInf = - // (Un/(mag(Un) + SMALL)) * sign(patch().nf() & Un); + tmp<vectorField> nnInfHat = UInfHat ^ patch().nf(); // Normal to the free-stream in the plane defined by the free-stream // and the patch normal - vectorField nHatInf = nnInfHat ^ UInfHat; + const vectorField nHatInf(nnInfHat ^ UInfHat); // Component of U normal to the free-stream in the plane defined by the // free-stream and the patch normal - vectorField Un = nHatInf*(nHatInf & U); + const vectorField Un(nHatInf*(nHatInf & U)); // The tangential component is - vectorField Ut = U - Un; + const vectorField Ut(U - Un); // Calculate the Prandtl-Meyer function of the free-stream scalar nuMachInf = @@ -290,7 +285,7 @@ void supersonicFreestreamFvPatchVectorField::updateCoeffs() } -void supersonicFreestreamFvPatchVectorField::write(Ostream& os) const +void Foam::supersonicFreestreamFvPatchVectorField::write(Ostream& os) const { fvPatchVectorField::write(os); os.writeKeyword("UInf") << UInf_ << token::END_STATEMENT << nl; @@ -303,14 +298,13 @@ void supersonicFreestreamFvPatchVectorField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField -( - fvPatchVectorField, - supersonicFreestreamFvPatchVectorField -); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam +namespace Foam +{ + makeNonTemplatedPatchTypeField + ( + fvPatchVectorField, + supersonicFreestreamFvPatchVectorField + ); +} // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.C index 59edbe9b99d5f3ddeac42c6c7237a5098ad0ae55..300136c9cd2c324ca42435602554ae248502d591 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.C @@ -28,14 +28,9 @@ License #include "volFields.H" #include "fvPatchFieldMapper.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -surfaceNormalFixedValueFvPatchVectorField:: +Foam::surfaceNormalFixedValueFvPatchVectorField:: surfaceNormalFixedValueFvPatchVectorField ( const fvPatch& p, @@ -47,7 +42,7 @@ surfaceNormalFixedValueFvPatchVectorField {} -surfaceNormalFixedValueFvPatchVectorField:: +Foam::surfaceNormalFixedValueFvPatchVectorField:: surfaceNormalFixedValueFvPatchVectorField ( const surfaceNormalFixedValueFvPatchVectorField& ptf, @@ -63,7 +58,7 @@ surfaceNormalFixedValueFvPatchVectorField } -surfaceNormalFixedValueFvPatchVectorField:: +Foam::surfaceNormalFixedValueFvPatchVectorField:: surfaceNormalFixedValueFvPatchVectorField ( const fvPatch& p, @@ -78,7 +73,7 @@ surfaceNormalFixedValueFvPatchVectorField } -surfaceNormalFixedValueFvPatchVectorField:: +Foam::surfaceNormalFixedValueFvPatchVectorField:: surfaceNormalFixedValueFvPatchVectorField ( const surfaceNormalFixedValueFvPatchVectorField& pivpvf @@ -89,7 +84,7 @@ surfaceNormalFixedValueFvPatchVectorField {} -surfaceNormalFixedValueFvPatchVectorField:: +Foam::surfaceNormalFixedValueFvPatchVectorField:: surfaceNormalFixedValueFvPatchVectorField ( const surfaceNormalFixedValueFvPatchVectorField& pivpvf, @@ -103,7 +98,7 @@ surfaceNormalFixedValueFvPatchVectorField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void surfaceNormalFixedValueFvPatchVectorField::autoMap +void Foam::surfaceNormalFixedValueFvPatchVectorField::autoMap ( const fvPatchFieldMapper& m ) @@ -113,7 +108,7 @@ void surfaceNormalFixedValueFvPatchVectorField::autoMap } -void surfaceNormalFixedValueFvPatchVectorField::rmap +void Foam::surfaceNormalFixedValueFvPatchVectorField::rmap ( const fvPatchVectorField& ptf, const labelList& addr @@ -128,7 +123,7 @@ void surfaceNormalFixedValueFvPatchVectorField::rmap } -void surfaceNormalFixedValueFvPatchVectorField::write(Ostream& os) const +void Foam::surfaceNormalFixedValueFvPatchVectorField::write(Ostream& os) const { fvPatchVectorField::write(os); refValue_.writeEntry("refValue", os); @@ -137,15 +132,13 @@ void surfaceNormalFixedValueFvPatchVectorField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField -( - fvPatchVectorField, - surfaceNormalFixedValueFvPatchVectorField -); - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam +namespace Foam +{ + makeNonTemplatedPatchTypeField + ( + fvPatchVectorField, + surfaceNormalFixedValueFvPatchVectorField + ); +} // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C index c6a7394bd17a273a1a6669f71ccdfb8bc0590107..2943d37eab4a21a4aad794b8483e2a100e790398 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C @@ -131,7 +131,7 @@ void Foam::swirlFlowRateInletVelocityFvPatchVectorField::updateCoeffs() const vector avgNormal = gSum(patch().Sf())/totArea; // Update angular velocity - convert [rpm] to [rad/s] - vectorField tangentialVelocity = + tmp<vectorField> tangentialVelocity = ( (rpm_*constant::mathematical::pi/30.0) * (patch().Cf() - avgCenter) ^ avgNormal @@ -189,7 +189,7 @@ void Foam::swirlFlowRateInletVelocityFvPatchVectorField::write namespace Foam { - makePatchTypeField + makeNonTemplatedPatchTypeField ( fvPatchVectorField, swirlFlowRateInletVelocityFvPatchVectorField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/syringePressure/syringePressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/syringePressure/syringePressureFvPatchScalarField.C index f2ce5d6ec93923ade8551339e6d7b49311e75c05..e93c26a36854298142ba3a1385a5d537282e46be 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/syringePressure/syringePressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/syringePressure/syringePressureFvPatchScalarField.C @@ -29,14 +29,9 @@ License #include "fvPatchFieldMapper.H" #include "surfaceFields.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -syringePressureFvPatchScalarField::syringePressureFvPatchScalarField +Foam::syringePressureFvPatchScalarField::syringePressureFvPatchScalarField ( const fvPatch& p, const DimensionedField<scalar, volMesh>& iF @@ -47,7 +42,7 @@ syringePressureFvPatchScalarField::syringePressureFvPatchScalarField {} -syringePressureFvPatchScalarField::syringePressureFvPatchScalarField +Foam::syringePressureFvPatchScalarField::syringePressureFvPatchScalarField ( const syringePressureFvPatchScalarField& sppsf, const fvPatch& p, @@ -71,7 +66,7 @@ syringePressureFvPatchScalarField::syringePressureFvPatchScalarField {} -syringePressureFvPatchScalarField::syringePressureFvPatchScalarField +Foam::syringePressureFvPatchScalarField::syringePressureFvPatchScalarField ( const fvPatch& p, const DimensionedField<scalar, volMesh>& iF, @@ -97,7 +92,7 @@ syringePressureFvPatchScalarField::syringePressureFvPatchScalarField } -syringePressureFvPatchScalarField::syringePressureFvPatchScalarField +Foam::syringePressureFvPatchScalarField::syringePressureFvPatchScalarField ( const syringePressureFvPatchScalarField& sppsf, const DimensionedField<scalar, volMesh>& iF @@ -119,7 +114,7 @@ syringePressureFvPatchScalarField::syringePressureFvPatchScalarField {} -syringePressureFvPatchScalarField::syringePressureFvPatchScalarField +Foam::syringePressureFvPatchScalarField::syringePressureFvPatchScalarField ( const syringePressureFvPatchScalarField& sppsf ) @@ -142,7 +137,7 @@ syringePressureFvPatchScalarField::syringePressureFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -scalar syringePressureFvPatchScalarField::Vs(const scalar t) const +Foam::scalar Foam::syringePressureFvPatchScalarField::Vs(const scalar t) const { if (t < tas_) { @@ -181,7 +176,7 @@ scalar syringePressureFvPatchScalarField::Vs(const scalar t) const } -void syringePressureFvPatchScalarField::updateCoeffs() +void Foam::syringePressureFvPatchScalarField::updateCoeffs() { if (updated()) { @@ -229,7 +224,7 @@ void syringePressureFvPatchScalarField::updateCoeffs() } -void syringePressureFvPatchScalarField::write(Ostream& os) const +void Foam::syringePressureFvPatchScalarField::write(Ostream& os) const { fvPatchScalarField::write(os); @@ -250,14 +245,13 @@ void syringePressureFvPatchScalarField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField -( - fvPatchScalarField, - syringePressureFvPatchScalarField -); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam +namespace Foam +{ + makeNonTemplatedPatchTypeField + ( + fvPatchScalarField, + syringePressureFvPatchScalarField + ); +} // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingFlowRateInletVelocity/timeVaryingFlowRateInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingFlowRateInletVelocity/timeVaryingFlowRateInletVelocityFvPatchVectorField.C index b00a713b56b33203da88ce4facdc8c2e73015092..cfb2db6f0e1c2a80669a882ca54499dcf05d3436 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingFlowRateInletVelocity/timeVaryingFlowRateInletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingFlowRateInletVelocity/timeVaryingFlowRateInletVelocityFvPatchVectorField.C @@ -121,7 +121,7 @@ write(Ostream& os) const namespace Foam { - makePatchTypeField + makeNonTemplatedPatchTypeField ( fvPatchVectorField, timeVaryingFlowRateInletVelocityFvPatchVectorField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchFields.H index 5fdd235a3bb3460257bbed19fa6948e54e1d199f..0c090c59d7a9a26c54af69c3448561d54a0651ef 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchFields.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(timeVaryingMappedFixedValue) +makePatchTypeFieldTypedefs(timeVaryingMappedFixedValue); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchFieldsFwd.H index 82f01dbdf6493460e69ad0538904b9528fe71f9c..51a34888238891698b8a63fd139d68d974246266 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class timeVaryingMappedFixedValueFvPatchField; -makePatchTypeFieldTypedefs(timeVaryingMappedFixedValue) +makePatchTypeFieldTypedefs(timeVaryingMappedFixedValue); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFvPatchFields.H index e0d613eae69cbc3ee5f9b9fc63873296eed5d093..14c266ceddd52cdcdf1ca82f912fd56abd5e988b 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFvPatchFields.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFvPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(timeVaryingUniformFixedValue) +makePatchTypeFieldTypedefs(timeVaryingUniformFixedValue); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingUniformTotalPressure/timeVaryingUniformTotalPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingUniformTotalPressure/timeVaryingUniformTotalPressureFvPatchScalarField.C index a0f03b4c6bafcfe025f377a2d7c952eea3c9a01a..c63da946e99b0c34fd6b34efb970e38afe1dd9e7 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingUniformTotalPressure/timeVaryingUniformTotalPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingUniformTotalPressure/timeVaryingUniformTotalPressureFvPatchScalarField.C @@ -232,7 +232,7 @@ write(Ostream& os) const namespace Foam { - makePatchTypeField + makeNonTemplatedPatchTypeField ( fvPatchScalarField, timeVaryingUniformTotalPressureFvPatchScalarField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.C index c9890487fe3f82c24be39b123d5331fad975d77d..15be1f18e140120f234a785d8c224d15011caeec 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.C @@ -241,7 +241,7 @@ void Foam::totalPressureFvPatchScalarField::write(Ostream& os) const namespace Foam { - makePatchTypeField + makeNonTemplatedPatchTypeField ( fvPatchScalarField, totalPressureFvPatchScalarField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.C index 5a3b0e4e1c91347058e0aa08ea50dc4b86fc5cbc..5a6c89ec82eee606f704b494b42aeffc1a93d26f 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.C @@ -190,7 +190,7 @@ void Foam::totalTemperatureFvPatchScalarField::write(Ostream& os) const namespace Foam { - makePatchTypeField + makeNonTemplatedPatchTypeField ( fvPatchScalarField, totalTemperatureFvPatchScalarField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/translatingWallVelocity/translatingWallVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/translatingWallVelocity/translatingWallVelocityFvPatchVectorField.C index a0b85e0fed1732ef2b9874c064cdfa943a4e30a8..01c5f1f83788d2261a0dfa5d1de38b1ff6c155d3 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/translatingWallVelocity/translatingWallVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/translatingWallVelocity/translatingWallVelocityFvPatchVectorField.C @@ -28,14 +28,9 @@ License #include "volFields.H" #include "surfaceFields.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -translatingWallVelocityFvPatchVectorField:: +Foam::translatingWallVelocityFvPatchVectorField:: translatingWallVelocityFvPatchVectorField ( const fvPatch& p, @@ -47,7 +42,7 @@ translatingWallVelocityFvPatchVectorField {} -translatingWallVelocityFvPatchVectorField:: +Foam::translatingWallVelocityFvPatchVectorField:: translatingWallVelocityFvPatchVectorField ( const translatingWallVelocityFvPatchVectorField& ptf, @@ -61,7 +56,7 @@ translatingWallVelocityFvPatchVectorField {} -translatingWallVelocityFvPatchVectorField:: +Foam::translatingWallVelocityFvPatchVectorField:: translatingWallVelocityFvPatchVectorField ( const fvPatch& p, @@ -77,7 +72,7 @@ translatingWallVelocityFvPatchVectorField } -translatingWallVelocityFvPatchVectorField:: +Foam::translatingWallVelocityFvPatchVectorField:: translatingWallVelocityFvPatchVectorField ( const translatingWallVelocityFvPatchVectorField& twvpvf @@ -88,7 +83,7 @@ translatingWallVelocityFvPatchVectorField {} -translatingWallVelocityFvPatchVectorField:: +Foam::translatingWallVelocityFvPatchVectorField:: translatingWallVelocityFvPatchVectorField ( const translatingWallVelocityFvPatchVectorField& twvpvf, @@ -102,7 +97,7 @@ translatingWallVelocityFvPatchVectorField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void translatingWallVelocityFvPatchVectorField::updateCoeffs() +void Foam::translatingWallVelocityFvPatchVectorField::updateCoeffs() { if (updated()) { @@ -110,14 +105,14 @@ void translatingWallVelocityFvPatchVectorField::updateCoeffs() } // Remove the component of U normal to the wall in case the wall is not flat - vectorField n = patch().nf(); + const vectorField n(patch().nf()); vectorField::operator=(U_ - n*(n & U_)); fixedValueFvPatchVectorField::updateCoeffs(); } -void translatingWallVelocityFvPatchVectorField::write(Ostream& os) const +void Foam::translatingWallVelocityFvPatchVectorField::write(Ostream& os) const { fvPatchVectorField::write(os); os.writeKeyword("U") << U_ << token::END_STATEMENT << nl; @@ -127,15 +122,13 @@ void translatingWallVelocityFvPatchVectorField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField -( - fvPatchVectorField, - translatingWallVelocityFvPatchVectorField -); - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam +namespace Foam +{ + makeNonTemplatedPatchTypeField + ( + fvPatchVectorField, + translatingWallVelocityFvPatchVectorField + ); +} // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/turbulentInlet/turbulentInletFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/derived/turbulentInlet/turbulentInletFvPatchFields.H index 15cada3ec6222bf0ef8ef7b957972b8ef89ad8a8..38b765accad4ca270abb9d664250b178d27a71d0 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/turbulentInlet/turbulentInletFvPatchFields.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/turbulentInlet/turbulentInletFvPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(turbulentInlet) +makePatchTypeFieldTypedefs(turbulentInlet); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.C index 4c53ea8f95a428e88af94e6ef8e8450bdb0541c3..944f143c9e66b955c36c33ccdd8d455a35e08044 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.C @@ -147,7 +147,7 @@ void Foam::turbulentIntensityKineticEnergyInletFvPatchScalarField::write namespace Foam { - makePatchTypeField + makeNonTemplatedPatchTypeField ( fvPatchScalarField, turbulentIntensityKineticEnergyInletFvPatchScalarField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C index 564771b84c4a397f66f87e060f6ae8a0d4baa319..ae0a92c04fa546614d20947d8f781e5065f5548e 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C @@ -155,7 +155,7 @@ void Foam::uniformDensityHydrostaticPressureFvPatchScalarField::write namespace Foam { - makePatchTypeField + makeNonTemplatedPatchTypeField ( fvPatchScalarField, uniformDensityHydrostaticPressureFvPatchScalarField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchFields.H index 327cbf39be7729286a5c1d3a7cf78d91637134cf..44d595dbfecf9d1f9e44d689cfc3dc7ab76b7466 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchFields.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(uniformFixedValue) +makePatchTypeFieldTypedefs(uniformFixedValue); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchFieldsFwd.H index 900ede9bd3554fdf6642aecc85f1ef53470e401e..53b04b3b5bb95a807fa76973070b3201606795e5 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class uniformFixedValueFvPatchField; -makePatchTypeFieldTypedefs(uniform) +makePatchTypeFieldTypedefs(uniform); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/waveTransmissive/waveTransmissiveFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/derived/waveTransmissive/waveTransmissiveFvPatchFields.H index 690ca8bf3f910eeb32e7558bc2d328d68c217653..ee0ebd693039ce29aba472772b6de105f6ac5896 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/waveTransmissive/waveTransmissiveFvPatchFields.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/waveTransmissive/waveTransmissiveFvPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(waveTransmissive) +makePatchTypeFieldTypedefs(waveTransmissive); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/waveTransmissive/waveTransmissiveFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/derived/waveTransmissive/waveTransmissiveFvPatchFieldsFwd.H index af1b9ab04e3e065f31cd946e3c63cc9a392afe0d..97cc02605bf36a73bb3c864df85f299bb2a7e16b 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/waveTransmissive/waveTransmissiveFvPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/waveTransmissive/waveTransmissiveFvPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class waveTransmissiveFvPatchField; -makePatchTypeFieldTypedefs(waveTransmissive) +makePatchTypeFieldTypedefs(waveTransmissive); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H index b4600841834f8ab34f43197821be568ea787a038..92f33bd79bfd6eff20e158f0c47c1e442e0b09b5 100644 --- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H @@ -495,61 +495,86 @@ public: #endif -#define makePatchTypeFieldTypeName(type) \ - \ -defineNamedTemplateTypeNameAndDebug(type, 0); - -#define makePatchFieldsTypeName(type) \ - \ -makePatchTypeFieldTypeName(type##FvPatchScalarField); \ -makePatchTypeFieldTypeName(type##FvPatchVectorField); \ -makePatchTypeFieldTypeName(type##FvPatchSphericalTensorField); \ -makePatchTypeFieldTypeName(type##FvPatchSymmTensorField); \ -makePatchTypeFieldTypeName(type##FvPatchTensorField); - -#define makePatchTypeField(PatchTypeField, typePatchTypeField) \ - \ -defineNamedTemplateTypeNameAndDebug(typePatchTypeField, 0); \ - \ -addToRunTimeSelectionTable \ -( \ - PatchTypeField, typePatchTypeField, patch \ -); \ - \ -addToRunTimeSelectionTable \ -( \ - PatchTypeField, \ - typePatchTypeField, \ - patchMapper \ -); \ - \ -addToRunTimeSelectionTable \ -( \ - PatchTypeField, typePatchTypeField, dictionary \ -); - - -#define makePatchFields(type) \ - \ -makePatchTypeField(fvPatchScalarField, type##FvPatchScalarField); \ -makePatchTypeField(fvPatchVectorField, type##FvPatchVectorField); \ -makePatchTypeField \ -( \ - fvPatchSphericalTensorField, \ - type##FvPatchSphericalTensorField \ -); \ -makePatchTypeField(fvPatchSymmTensorField, type##FvPatchSymmTensorField); \ -makePatchTypeField(fvPatchTensorField, type##FvPatchTensorField); - - -#define makePatchTypeFieldTypedefs(type) \ - \ -typedef type##FvPatchField<scalar> type##FvPatchScalarField; \ -typedef type##FvPatchField<vector> type##FvPatchVectorField; \ -typedef type##FvPatchField<sphericalTensor> \ - type##FvPatchSphericalTensorField; \ -typedef type##FvPatchField<symmTensor> type##FvPatchSymmTensorField; \ -typedef type##FvPatchField<tensor> type##FvPatchTensorField; +#define makePatchTypeFieldTypeName(type) \ + defineNamedTemplateTypeNameAndDebug(type, 0) + + +#define makePatchFieldsTypeName(type) \ + defineNamedTemplateTypeNameAndDebug(type##FvPatchScalarField, 0); \ + defineNamedTemplateTypeNameAndDebug(type##FvPatchVectorField, 0); \ + defineNamedTemplateTypeNameAndDebug(type##FvPatchSphericalTensorField, 0);\ + defineNamedTemplateTypeNameAndDebug(type##FvPatchSymmTensorField, 0); \ + defineNamedTemplateTypeNameAndDebug(type##FvPatchTensorField, 0); + + +#define addToPatchFieldRunTimeSelection(PatchTypeField, typePatchTypeField) \ + addToRunTimeSelectionTable \ + ( \ + PatchTypeField, \ + typePatchTypeField, \ + patch \ + ); \ + addToRunTimeSelectionTable \ + ( \ + PatchTypeField, \ + typePatchTypeField, \ + patchMapper \ + ); \ + addToRunTimeSelectionTable \ + ( \ + PatchTypeField, \ + typePatchTypeField, \ + dictionary \ + ); + + +// for non-templated patch fields +#define makeNonTemplatedPatchTypeField(PatchTypeField, typePatchTypeField) \ + defineTypeNameAndDebug(typePatchTypeField, 0); \ + addToPatchFieldRunTimeSelection(PatchTypeField, typePatchTypeField) + + +// for templated patch fields +#define makePatchTypeField(PatchTypeField, typePatchTypeField) \ + defineNamedTemplateTypeNameAndDebug(typePatchTypeField, 0); \ + addToPatchFieldRunTimeSelection(PatchTypeField, typePatchTypeField) + + +#define makePatchFields(type) \ + makePatchTypeField \ + ( \ + fvPatchScalarField, \ + type##FvPatchScalarField \ + ); \ + makePatchTypeField \ + ( \ + fvPatchVectorField, \ + type##FvPatchVectorField \ + ); \ + makePatchTypeField \ + ( \ + fvPatchSphericalTensorField, \ + type##FvPatchSphericalTensorField \ + ); \ + makePatchTypeField \ + ( \ + fvPatchSymmTensorField, \ + type##FvPatchSymmTensorField \ + ); \ + makePatchTypeField \ + ( \ + fvPatchTensorField, \ + type##FvPatchTensorField \ + ); + + +#define makePatchTypeFieldTypedefs(type) \ + typedef type##FvPatchField<scalar> type##FvPatchScalarField; \ + typedef type##FvPatchField<vector> type##FvPatchVectorField; \ + typedef type##FvPatchField<sphericalTensor> \ + type##FvPatchSphericalTensorField; \ + typedef type##FvPatchField<symmTensor> type##FvPatchSymmTensorField; \ + typedef type##FvPatchField<tensor> type##FvPatchTensorField; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvsPatchFields/basic/calculated/calculatedFvsPatchFields.H b/src/finiteVolume/fields/fvsPatchFields/basic/calculated/calculatedFvsPatchFields.H index 1652e968cf5e5310d5e51d3d646cbe7bf9ea311d..27f503f6322f2de316fb05ee4d9b73dcd23630c2 100644 --- a/src/finiteVolume/fields/fvsPatchFields/basic/calculated/calculatedFvsPatchFields.H +++ b/src/finiteVolume/fields/fvsPatchFields/basic/calculated/calculatedFvsPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makeFvsPatchTypeFieldTypedefs(calculated) +makeFvsPatchTypeFieldTypedefs(calculated); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvsPatchFields/basic/calculated/calculatedFvsPatchFieldsFwd.H b/src/finiteVolume/fields/fvsPatchFields/basic/calculated/calculatedFvsPatchFieldsFwd.H index 9492537b17738e4e65d04af9453a20643d5d84d7..7f025dd0f237ef1b09864f0d6635330e8ef84f8e 100644 --- a/src/finiteVolume/fields/fvsPatchFields/basic/calculated/calculatedFvsPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvsPatchFields/basic/calculated/calculatedFvsPatchFieldsFwd.H @@ -42,7 +42,7 @@ namespace Foam template<class Type> class calculatedFvsPatchField; -makeFvsPatchTypeFieldTypedefs(calculated) +makeFvsPatchTypeFieldTypedefs(calculated); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvsPatchFields/basic/coupled/coupledFvsPatchFields.H b/src/finiteVolume/fields/fvsPatchFields/basic/coupled/coupledFvsPatchFields.H index e67037aceec2ca6a0e0694cae79d0fb054eb66fc..80882d6802f3acbb6588ec43e2589206949c0375 100644 --- a/src/finiteVolume/fields/fvsPatchFields/basic/coupled/coupledFvsPatchFields.H +++ b/src/finiteVolume/fields/fvsPatchFields/basic/coupled/coupledFvsPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makeFvsPatchTypeFieldTypedefs(coupled) +makeFvsPatchTypeFieldTypedefs(coupled); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvsPatchFields/basic/coupled/coupledFvsPatchFieldsFwd.H b/src/finiteVolume/fields/fvsPatchFields/basic/coupled/coupledFvsPatchFieldsFwd.H index 2c3950cf8f052ed4edfdfff7c9ae2a7edf07645e..446d4fe4109b7c86e569fdcd0ace0a836a340499 100644 --- a/src/finiteVolume/fields/fvsPatchFields/basic/coupled/coupledFvsPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvsPatchFields/basic/coupled/coupledFvsPatchFieldsFwd.H @@ -40,7 +40,7 @@ namespace Foam template<class Type> class coupledFvsPatchField; -makeFvsPatchTypeFieldTypedefs(coupled) +makeFvsPatchTypeFieldTypedefs(coupled); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvsPatchFields/basic/fixedValue/fixedValueFvsPatchFields.H b/src/finiteVolume/fields/fvsPatchFields/basic/fixedValue/fixedValueFvsPatchFields.H index 8c619beae1a63f1643f57bd40cbf2c1dae2bce8f..d6cf5117e25a8f7e18c7c01f26e68646f36d3926 100644 --- a/src/finiteVolume/fields/fvsPatchFields/basic/fixedValue/fixedValueFvsPatchFields.H +++ b/src/finiteVolume/fields/fvsPatchFields/basic/fixedValue/fixedValueFvsPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makeFvsPatchTypeFieldTypedefs(fixedValue) +makeFvsPatchTypeFieldTypedefs(fixedValue); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvsPatchFields/basic/fixedValue/fixedValueFvsPatchFieldsFwd.H b/src/finiteVolume/fields/fvsPatchFields/basic/fixedValue/fixedValueFvsPatchFieldsFwd.H index f8083f740e17093e782e4b9f207e837de3c761a4..8ebe47aea3fbc121f6894080f770c9968753a6da 100644 --- a/src/finiteVolume/fields/fvsPatchFields/basic/fixedValue/fixedValueFvsPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvsPatchFields/basic/fixedValue/fixedValueFvsPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class fixedValueFvsPatchField; -makeFvsPatchTypeFieldTypedefs(fixedValue) +makeFvsPatchTypeFieldTypedefs(fixedValue); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvsPatchFields/basic/sliced/slicedFvsPatchFields.H b/src/finiteVolume/fields/fvsPatchFields/basic/sliced/slicedFvsPatchFields.H index 3cde055905312707e2aae0956b8fcd40d7dcdd51..708eb09e25fd4fbd8b3e8bfb2b863ac852c96a6a 100644 --- a/src/finiteVolume/fields/fvsPatchFields/basic/sliced/slicedFvsPatchFields.H +++ b/src/finiteVolume/fields/fvsPatchFields/basic/sliced/slicedFvsPatchFields.H @@ -44,7 +44,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makeFvsPatchTypeFieldTypedefs(sliced) +makeFvsPatchTypeFieldTypedefs(sliced); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvsPatchFields/basic/sliced/slicedFvsPatchFieldsFwd.H b/src/finiteVolume/fields/fvsPatchFields/basic/sliced/slicedFvsPatchFieldsFwd.H index d81114db1cce599e729b36d8c54afa01a355309b..d4cad40c36799c40d5927cfd7d030dff3b7ca72a 100644 --- a/src/finiteVolume/fields/fvsPatchFields/basic/sliced/slicedFvsPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvsPatchFields/basic/sliced/slicedFvsPatchFieldsFwd.H @@ -40,7 +40,7 @@ namespace Foam template<class Type> class slicedFvsPatchField; -makeFvsPatchTypeFieldTypedefs(sliced) +makeFvsPatchTypeFieldTypedefs(sliced); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/cyclic/cyclicFvsPatchFields.H b/src/finiteVolume/fields/fvsPatchFields/constraint/cyclic/cyclicFvsPatchFields.H index 25f85a74df7f218b4801bf61ff739b3ca9012aad..ac35a51bf7250fa9ef95ec78850fb9de087e7331 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/cyclic/cyclicFvsPatchFields.H +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/cyclic/cyclicFvsPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makeFvsPatchTypeFieldTypedefs(cyclic) +makeFvsPatchTypeFieldTypedefs(cyclic); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/cyclic/cyclicFvsPatchFieldsFwd.H b/src/finiteVolume/fields/fvsPatchFields/constraint/cyclic/cyclicFvsPatchFieldsFwd.H index f5a53d76e57cf2cf20073403fc66c724e86203ea..a9e2a3dd9262caef3b3a79871d582727cb4ebc1b 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/cyclic/cyclicFvsPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/cyclic/cyclicFvsPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class cyclicFvsPatchField; -makeFvsPatchTypeFieldTypedefs(cyclic) +makeFvsPatchTypeFieldTypedefs(cyclic); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicSlip/cyclicSlipFvsPatchFields.H b/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicSlip/cyclicSlipFvsPatchFields.H index 74cc35b17fdc29a5dd2e1f1b1a41b738ec7a9f9e..7f1d5cc603cd35a3956ab701c228933b3a08b8f9 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicSlip/cyclicSlipFvsPatchFields.H +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicSlip/cyclicSlipFvsPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makeFvsPatchTypeFieldTypedefs(cyclicSlip) +makeFvsPatchTypeFieldTypedefs(cyclicSlip); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicSlip/cyclicSlipFvsPatchFieldsFwd.H b/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicSlip/cyclicSlipFvsPatchFieldsFwd.H index 788950d2e778c43becc07caef92538da2279a774..fa0eb4784cf828fa02257be085434044b770caa6 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicSlip/cyclicSlipFvsPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicSlip/cyclicSlipFvsPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class cyclicSlipFvsPatchField; -makeFvsPatchTypeFieldTypedefs(cyclicSlip) +makeFvsPatchTypeFieldTypedefs(cyclicSlip); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/empty/emptyFvsPatchFields.H b/src/finiteVolume/fields/fvsPatchFields/constraint/empty/emptyFvsPatchFields.H index 19acf746a07115669ffdf3b9bc676f1ec6d86844..cf715a381da3ed06bd552fde29dc0db2dd8975b4 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/empty/emptyFvsPatchFields.H +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/empty/emptyFvsPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makeFvsPatchTypeFieldTypedefs(empty) +makeFvsPatchTypeFieldTypedefs(empty); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/empty/emptyFvsPatchFieldsFwd.H b/src/finiteVolume/fields/fvsPatchFields/constraint/empty/emptyFvsPatchFieldsFwd.H index b7afaeba513fdcd080dd9d44fbf775c63d6920de..7a6db965ee8df6c01083ab69fed9354f1943dddf 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/empty/emptyFvsPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/empty/emptyFvsPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class emptyFvsPatchField; -makeFvsPatchTypeFieldTypedefs(empty) +makeFvsPatchTypeFieldTypedefs(empty); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvsPatchFields.H b/src/finiteVolume/fields/fvsPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvsPatchFields.H index 11e2aca8eb07fee1ec42c7824f7ea31f5c03c358..c3039136df0c975bdcb2ed96c66603797bcdf8f6 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvsPatchFields.H +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvsPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makeFvsPatchTypeFieldTypedefs(nonuniformTransformCyclic) +makeFvsPatchTypeFieldTypedefs(nonuniformTransformCyclic); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvsPatchFieldsFwd.H b/src/finiteVolume/fields/fvsPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvsPatchFieldsFwd.H index d4fbd4da677c012dfeef51cdcf7681da50b24d64..e45a671999f879bcf68ea87afa5fd2cf8f858760 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvsPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvsPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class nonuniformTransformCyclicFvsPatchField; -makeFvsPatchTypeFieldTypedefs(nonuniformTransformCyclic) +makeFvsPatchTypeFieldTypedefs(nonuniformTransformCyclic); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/processor/processorFvsPatchFields.H b/src/finiteVolume/fields/fvsPatchFields/constraint/processor/processorFvsPatchFields.H index 3b77f81963ab0fbe444b7c260fb2cb29007556a5..a690d8d47ebb4c82de05044085decf7fe2e320b1 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/processor/processorFvsPatchFields.H +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/processor/processorFvsPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makeFvsPatchTypeFieldTypedefs(processor) +makeFvsPatchTypeFieldTypedefs(processor); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/processor/processorFvsPatchFieldsFwd.H b/src/finiteVolume/fields/fvsPatchFields/constraint/processor/processorFvsPatchFieldsFwd.H index 72c610e66cab4ddac93868e6dc38e17991a6b790..fc08f766ed9e7b4e353462dc72a3b97f1689b3c6 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/processor/processorFvsPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/processor/processorFvsPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class processorFvsPatchField; -makeFvsPatchTypeFieldTypedefs(processor) +makeFvsPatchTypeFieldTypedefs(processor); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/processorCyclic/processorCyclicFvsPatchFields.H b/src/finiteVolume/fields/fvsPatchFields/constraint/processorCyclic/processorCyclicFvsPatchFields.H index 63ad5a8c8cc38176b7d107187213f820a6e0cc97..5ec1e18f56e2bf3505846ca88eb15661bce166bd 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/processorCyclic/processorCyclicFvsPatchFields.H +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/processorCyclic/processorCyclicFvsPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makeFvsPatchTypeFieldTypedefs(processorCyclic) +makeFvsPatchTypeFieldTypedefs(processorCyclic); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/processorCyclic/processorCyclicFvsPatchFieldsFwd.H b/src/finiteVolume/fields/fvsPatchFields/constraint/processorCyclic/processorCyclicFvsPatchFieldsFwd.H index ddb0593965e41ce33af67d2c7ee02beafabe3b99..1d698676aa75305f3c816ac0807a0c3286495586 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/processorCyclic/processorCyclicFvsPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/processorCyclic/processorCyclicFvsPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class processorCyclicFvsPatchField; -makeFvsPatchTypeFieldTypedefs(processor) +makeFvsPatchTypeFieldTypedefs(processor); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/symmetry/symmetryFvsPatchFields.H b/src/finiteVolume/fields/fvsPatchFields/constraint/symmetry/symmetryFvsPatchFields.H index 5ccedeb610cc4af43003d2431a6f5b00d7ad920f..0b7548db9aa164e222531ed809351a1e4c44111b 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/symmetry/symmetryFvsPatchFields.H +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/symmetry/symmetryFvsPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makeFvsPatchTypeFieldTypedefs(symmetry) +makeFvsPatchTypeFieldTypedefs(symmetry); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/symmetry/symmetryFvsPatchFieldsFwd.H b/src/finiteVolume/fields/fvsPatchFields/constraint/symmetry/symmetryFvsPatchFieldsFwd.H index ee5541184af7feab5b14e46dc52b693f040bb01e..2bf0e2cfd9ee23e5ebab50ab8b8e2a302cb21555 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/symmetry/symmetryFvsPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/symmetry/symmetryFvsPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class symmetryFvsPatchField; -makeFvsPatchTypeFieldTypedefs(symmetry) +makeFvsPatchTypeFieldTypedefs(symmetry); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/wedge/wedgeFvsPatchFields.H b/src/finiteVolume/fields/fvsPatchFields/constraint/wedge/wedgeFvsPatchFields.H index e8c97fcce055829433a3c2600937ede4966cee1c..b65ae24a8d6078aafc8d3f95dc3a806e7f900d1c 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/wedge/wedgeFvsPatchFields.H +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/wedge/wedgeFvsPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makeFvsPatchTypeFieldTypedefs(wedge) +makeFvsPatchTypeFieldTypedefs(wedge); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/wedge/wedgeFvsPatchFieldsFwd.H b/src/finiteVolume/fields/fvsPatchFields/constraint/wedge/wedgeFvsPatchFieldsFwd.H index f1767a89b8715b500f870448827f49d7c96faa79..af9b05b1afd86c2c51a17aa5a15a9ab9f71c55b5 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/wedge/wedgeFvsPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/wedge/wedgeFvsPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class wedgeFvsPatchField; -makeFvsPatchTypeFieldTypedefs(wedge) +makeFvsPatchTypeFieldTypedefs(wedge); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/surfaceFields/surfaceFields.C b/src/finiteVolume/fields/surfaceFields/surfaceFields.C index 3030df6137384e833ebb5a941d3ef99b31e5a307..2cfdb27e3abdd294ec75c405ad7c03ce5b6e8a28 100644 --- a/src/finiteVolume/fields/surfaceFields/surfaceFields.C +++ b/src/finiteVolume/fields/surfaceFields/surfaceFields.C @@ -30,21 +30,34 @@ License namespace Foam { -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -defineTemplateTypeNameAndDebug(surfaceScalarField::DimensionedInternalField, 0); -defineTemplateTypeNameAndDebug(surfaceVectorField::DimensionedInternalField, 0); -defineTemplateTypeNameAndDebug +defineTemplate2TypeNameAndDebug +( + surfaceScalarField::DimensionedInternalField, + 0 +); +defineTemplate2TypeNameAndDebug +( + surfaceVectorField::DimensionedInternalField, + 0 +); +defineTemplate2TypeNameAndDebug ( surfaceSphericalTensorField::DimensionedInternalField, 0 ); -defineTemplateTypeNameAndDebug +defineTemplate2TypeNameAndDebug ( surfaceSymmTensorField::DimensionedInternalField, 0 ); -defineTemplateTypeNameAndDebug(surfaceTensorField::DimensionedInternalField, 0); +defineTemplate2TypeNameAndDebug +( + surfaceTensorField::DimensionedInternalField, + 0 +); + defineTemplateTypeNameAndDebug(surfaceScalarField, 0); defineTemplateTypeNameAndDebug(surfaceVectorField, 0); diff --git a/src/finiteVolume/fields/volFields/volFields.C b/src/finiteVolume/fields/volFields/volFields.C index d195bffe5e0e5350961380995152de8e10b7d844..25ac7bbdcb38aa473adbaed6ca1b1225700012b2 100644 --- a/src/finiteVolume/fields/volFields/volFields.C +++ b/src/finiteVolume/fields/volFields/volFields.C @@ -32,15 +32,19 @@ namespace Foam // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -defineTemplateTypeNameAndDebug(volScalarField::DimensionedInternalField, 0); -defineTemplateTypeNameAndDebug(volVectorField::DimensionedInternalField, 0); -defineTemplateTypeNameAndDebug +defineTemplate2TypeNameAndDebug(volScalarField::DimensionedInternalField, 0); +defineTemplate2TypeNameAndDebug(volVectorField::DimensionedInternalField, 0); +defineTemplate2TypeNameAndDebug ( volSphericalTensorField::DimensionedInternalField, 0 ); -defineTemplateTypeNameAndDebug(volSymmTensorField::DimensionedInternalField, 0); -defineTemplateTypeNameAndDebug(volTensorField::DimensionedInternalField, 0); +defineTemplate2TypeNameAndDebug +( + volSymmTensorField::DimensionedInternalField, + 0 +); +defineTemplate2TypeNameAndDebug(volTensorField::DimensionedInternalField, 0); defineTemplateTypeNameAndDebug(volScalarField, 0); defineTemplateTypeNameAndDebug(volVectorField, 0); @@ -48,6 +52,10 @@ defineTemplateTypeNameAndDebug(volSphericalTensorField, 0); defineTemplateTypeNameAndDebug(volSymmTensorField, 0); defineTemplateTypeNameAndDebug(volTensorField, 0); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +// specialization for scalar fields template<> tmp<GeometricField<scalar, fvPatchField, volMesh> > GeometricField<scalar, fvPatchField, volMesh>::component @@ -58,6 +66,8 @@ GeometricField<scalar, fvPatchField, volMesh>::component return *this; } + +// specialization for scalar fields template<> void GeometricField<scalar, fvPatchField, volMesh>::replace ( diff --git a/src/finiteVolume/finiteVolume/d2dt2Schemes/EulerD2dt2Scheme/EulerD2dt2Scheme.C b/src/finiteVolume/finiteVolume/d2dt2Schemes/EulerD2dt2Scheme/EulerD2dt2Scheme.C index cff3d4fd7d06922a2fbdde9676bf841126982447..3cca10e76faced93d0b26816db829633b466e31f 100644 --- a/src/finiteVolume/finiteVolume/d2dt2Schemes/EulerD2dt2Scheme/EulerD2dt2Scheme.C +++ b/src/finiteVolume/finiteVolume/d2dt2Schemes/EulerD2dt2Scheme/EulerD2dt2Scheme.C @@ -147,16 +147,20 @@ EulerD2dt2Scheme<Type>::fvcD2dt2 scalar halfRdeltaT2 = 0.5*rDeltaT2.value(); scalar quarterRdeltaT2 = 0.25*rDeltaT2.value(); - scalarField VV0rhoRho0 = + const scalarField VV0rhoRho0 + ( (mesh().V() + mesh().V0()) - *(rho.internalField() + rho.oldTime().internalField()); + * (rho.internalField() + rho.oldTime().internalField()) + ); - scalarField V0V00rho0Rho00 = + const scalarField V0V00rho0Rho00 + ( (mesh().V0() + mesh().V00()) - *( - rho.oldTime().internalField() - + rho.oldTime().oldTime().internalField() - ); + * ( + rho.oldTime().internalField() + + rho.oldTime().oldTime().internalField() + ) + ); return tmp<GeometricField<Type, fvPatchField, volMesh> > ( @@ -207,8 +211,8 @@ EulerD2dt2Scheme<Type>::fvcD2dt2 { dimensionedScalar halfRdeltaT2 = 0.5*rDeltaT2; - volScalarField rhoRho0 = rho + rho.oldTime(); - volScalarField rho0Rho00 = rho.oldTime() +rho.oldTime().oldTime(); + const volScalarField rhoRho0(rho + rho.oldTime()); + const volScalarField rho0Rho00(rho.oldTime() +rho.oldTime().oldTime()); return tmp<GeometricField<Type, fvPatchField, volMesh> > ( @@ -258,8 +262,8 @@ EulerD2dt2Scheme<Type>::fvmD2dt2 { scalar halfRdeltaT2 = rDeltaT2/2.0; - scalarField VV0 = mesh().V() + mesh().V0(); - scalarField V0V00 = mesh().V0() + mesh().V00(); + const scalarField VV0(mesh().V() + mesh().V0()); + const scalarField V0V00(mesh().V0() + mesh().V00()); fvm.diag() = (coefft*halfRdeltaT2)*VV0; @@ -318,9 +322,8 @@ EulerD2dt2Scheme<Type>::fvmD2dt2 { scalar halfRdeltaT2 = 0.5*rDeltaT2; - scalarField VV0 = mesh().V() + mesh().V0(); - - scalarField V0V00 = mesh().V0() + mesh().V00(); + const scalarField VV0(mesh().V() + mesh().V0()); + const scalarField V0V00(mesh().V0() + mesh().V00()); fvm.diag() = rho.value()*(coefft*halfRdeltaT2)*VV0; @@ -379,16 +382,20 @@ EulerD2dt2Scheme<Type>::fvmD2dt2 { scalar quarterRdeltaT2 = 0.25*rDeltaT2; - scalarField VV0rhoRho0 = + const scalarField VV0rhoRho0 + ( (mesh().V() + mesh().V0()) - *(rho.internalField() + rho.oldTime().internalField()); + *(rho.internalField() + rho.oldTime().internalField()) + ); - scalarField V0V00rho0Rho00 = + const scalarField V0V00rho0Rho00 + ( (mesh().V0() + mesh().V00()) *( rho.oldTime().internalField() + rho.oldTime().oldTime().internalField() - ); + ) + ); fvm.diag() = (coefft*quarterRdeltaT2)*VV0rhoRho0; @@ -405,10 +412,13 @@ EulerD2dt2Scheme<Type>::fvmD2dt2 { scalar halfRdeltaT2 = 0.5*rDeltaT2; - scalarField rhoRho0 = - (rho.internalField() + rho.oldTime().internalField()); + const scalarField rhoRho0 + ( + rho.internalField() + + rho.oldTime().internalField() + ); - scalarField rho0Rho00 = + const scalarField rho0Rho00 ( rho.oldTime().internalField() + rho.oldTime().oldTime().internalField() diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/CoEulerDdtScheme/CoEulerDdtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/CoEulerDdtScheme/CoEulerDdtScheme.C index 654a260ef548446b0ba8b60a6b93960b69754c30..2c0e5f1e0b11339f41e86f7b068b3ca361b7baef 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/CoEulerDdtScheme/CoEulerDdtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/CoEulerDdtScheme/CoEulerDdtScheme.C @@ -43,7 +43,7 @@ namespace fv template<class Type> tmp<volScalarField> CoEulerDdtScheme<Type>::CorDeltaT() const { - surfaceScalarField cofrDeltaT = CofrDeltaT(); + const surfaceScalarField cofrDeltaT(CofrDeltaT()); tmp<volScalarField> tcorDeltaT ( @@ -154,7 +154,7 @@ CoEulerDdtScheme<Type>::fvcDdt const dimensioned<Type>& dt ) { - volScalarField rDeltaT = CorDeltaT(); + const volScalarField rDeltaT(CorDeltaT()); IOobject ddtIOobject ( @@ -213,7 +213,7 @@ CoEulerDdtScheme<Type>::fvcDdt const GeometricField<Type, fvPatchField, volMesh>& vf ) { - volScalarField rDeltaT = CorDeltaT(); + const volScalarField rDeltaT(CorDeltaT()); IOobject ddtIOobject ( @@ -265,7 +265,7 @@ CoEulerDdtScheme<Type>::fvcDdt const GeometricField<Type, fvPatchField, volMesh>& vf ) { - volScalarField rDeltaT = CorDeltaT(); + const volScalarField rDeltaT(CorDeltaT()); IOobject ddtIOobject ( @@ -317,7 +317,7 @@ CoEulerDdtScheme<Type>::fvcDdt const GeometricField<Type, fvPatchField, volMesh>& vf ) { - volScalarField rDeltaT = CorDeltaT(); + const volScalarField rDeltaT(CorDeltaT()); IOobject ddtIOobject ( @@ -382,7 +382,7 @@ CoEulerDdtScheme<Type>::fvmDdt fvMatrix<Type>& fvm = tfvm(); - scalarField rDeltaT = CorDeltaT()().internalField(); + scalarField rDeltaT(CorDeltaT()().internalField()); fvm.diag() = rDeltaT*mesh().V(); @@ -417,7 +417,7 @@ CoEulerDdtScheme<Type>::fvmDdt ); fvMatrix<Type>& fvm = tfvm(); - scalarField rDeltaT = CorDeltaT()().internalField(); + scalarField rDeltaT(CorDeltaT()().internalField()); fvm.diag() = rDeltaT*rho.value()*mesh().V(); @@ -454,7 +454,7 @@ CoEulerDdtScheme<Type>::fvmDdt ); fvMatrix<Type>& fvm = tfvm(); - scalarField rDeltaT = CorDeltaT()().internalField(); + scalarField rDeltaT(CorDeltaT()().internalField()); fvm.diag() = rDeltaT*rho.internalField()*mesh().V(); @@ -510,14 +510,14 @@ CoEulerDdtScheme<Type>::fvcDdtPhiCorr } else { - volScalarField rDeltaT = CorDeltaT(); + const volScalarField rDeltaT(CorDeltaT()); return tmp<fluxFieldType> ( new fluxFieldType ( ddtIOobject, - fvcDdtPhiCoeff(U.oldTime(), phi.oldTime())* + this->fvcDdtPhiCoeff(U.oldTime(), phi.oldTime())* ( fvc::interpolate(rDeltaT*rA)*phi.oldTime() - (fvc::interpolate(rDeltaT*rA*U.oldTime()) & mesh().Sf()) @@ -565,7 +565,7 @@ CoEulerDdtScheme<Type>::fvcDdtPhiCorr } else { - volScalarField rDeltaT = CorDeltaT(); + const volScalarField rDeltaT(CorDeltaT()); if ( @@ -578,7 +578,7 @@ CoEulerDdtScheme<Type>::fvcDdtPhiCorr new fluxFieldType ( ddtIOobject, - fvcDdtPhiCoeff(U.oldTime(), phi.oldTime()) + this->fvcDdtPhiCoeff(U.oldTime(), phi.oldTime()) *( fvc::interpolate(rDeltaT*rA*rho.oldTime())*phi.oldTime() - (fvc::interpolate(rDeltaT*rA*rho.oldTime()*U.oldTime()) @@ -598,7 +598,7 @@ CoEulerDdtScheme<Type>::fvcDdtPhiCorr new fluxFieldType ( ddtIOobject, - fvcDdtPhiCoeff + this->fvcDdtPhiCoeff ( U.oldTime(), phi.oldTime()/fvc::interpolate(rho.oldTime()) @@ -627,8 +627,9 @@ CoEulerDdtScheme<Type>::fvcDdtPhiCorr new fluxFieldType ( ddtIOobject, - fvcDdtPhiCoeff(rho.oldTime(), U.oldTime(), phi.oldTime()) - *( + this->fvcDdtPhiCoeff + (rho.oldTime(), U.oldTime(), phi.oldTime()) + * ( fvc::interpolate(rDeltaT*rA)*phi.oldTime() - ( fvc::interpolate(rDeltaT*rA*U.oldTime())&mesh().Sf() diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicholsonDdtScheme/CrankNicholsonDdtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicholsonDdtScheme/CrankNicholsonDdtScheme.C index 8adf1fb4798d1934d6ed7d298ab048a39e3a647b..bd0229502524c64e82187a786590acd61d1be273 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicholsonDdtScheme/CrankNicholsonDdtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicholsonDdtScheme/CrankNicholsonDdtScheme.C @@ -50,7 +50,7 @@ CrankNicholsonDdtScheme<Type>::DDt0Field<GeoField>::DDt0Field : GeoField(io, mesh), startTimeIndex_(-2) // This field is for a restart and thus correct so set - // the start time-index to corespond to a previous run + // the start time-index to correspond to a previous run { // Set the time-index to the beginning of the run to ensure the field // is updated during the first time-step @@ -108,7 +108,7 @@ CrankNicholsonDdtScheme<Type>::ddt0_ const dimensionSet& dims ) { - if (!mesh().objectRegistry::foundObject<GeoField>(name)) + if (!mesh().objectRegistry::template foundObject<GeoField>(name)) { const Time& runTime = mesh().time(); word startTimeName = runTime.timeName(runTime.startTime().value()); @@ -173,7 +173,7 @@ CrankNicholsonDdtScheme<Type>::ddt0_ ( const_cast<GeoField&> ( - mesh().objectRegistry::lookupObject<GeoField>(name) + mesh().objectRegistry::template lookupObject<GeoField>(name) ) ); @@ -946,7 +946,7 @@ CrankNicholsonDdtScheme<Type>::fvcDdtPhiCorr new fluxFieldType ( ddtIOobject, - fvcDdtPhiCoeff(U.oldTime(), phi.oldTime()) + this->fvcDdtPhiCoeff(U.oldTime(), phi.oldTime()) *fvc::interpolate(rA) *( (rDtCoef*phi.oldTime() + offCentre_(dphidt0())) @@ -1045,7 +1045,7 @@ CrankNicholsonDdtScheme<Type>::fvcDdtPhiCorr new fluxFieldType ( ddtIOobject, - fvcDdtPhiCoeff(U.oldTime(), phi.oldTime())* + this->fvcDdtPhiCoeff(U.oldTime(), phi.oldTime())* ( fvc::interpolate(rA*rho.oldTime()) *(rDtCoef*phi.oldTime() + offCentre_(dphidt0())) @@ -1090,7 +1090,7 @@ CrankNicholsonDdtScheme<Type>::fvcDdtPhiCorr new fluxFieldType ( ddtIOobject, - fvcDdtPhiCoeff + this->fvcDdtPhiCoeff ( U.oldTime(), phi.oldTime()/fvc::interpolate(rho.oldTime()) @@ -1139,8 +1139,9 @@ CrankNicholsonDdtScheme<Type>::fvcDdtPhiCorr new fluxFieldType ( ddtIOobject, - fvcDdtPhiCoeff(rho.oldTime(), U.oldTime(), phi.oldTime())* - ( + this->fvcDdtPhiCoeff + (rho.oldTime(), U.oldTime(), phi.oldTime()) + * ( fvc::interpolate(rA) *(rDtCoef*phi.oldTime() + offCentre_(dphidt0())) - ( diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.C index faf64f83bf252835c8fd0eadd2451152bd9bef4b..8b58bc0b614e7de5da34e0fba3f256f9e25c2fd8 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.C @@ -394,8 +394,8 @@ EulerDdtScheme<Type>::fvcDdtPhiCorr new fluxFieldType ( ddtIOobject, - fvcDdtPhiCoeff(U.oldTime(), phiAbs.oldTime(), phiCorr()) - *fvc::interpolate(rDeltaT*rA)*phiCorr + this->fvcDdtPhiCoeff(U.oldTime(), phiAbs.oldTime(), phiCorr()) + * fvc::interpolate(rDeltaT*rA)*phiCorr ) ); } @@ -436,11 +436,13 @@ EulerDdtScheme<Type>::fvcDdtPhiCorr ( ddtIOobject, rDeltaT - *fvcDdtPhiCoeff(U.oldTime(), phiAbs.oldTime()) - *( - fvc::interpolate(rA*rho.oldTime())*phiAbs.oldTime() - - (fvc::interpolate(rA*rho.oldTime()*U.oldTime()) - & mesh().Sf()) + * this->fvcDdtPhiCoeff(U.oldTime(), phiAbs.oldTime()) + * ( + fvc::interpolate(rA*rho.oldTime())*phiAbs.oldTime() + - ( + fvc::interpolate(rA*rho.oldTime()*U.oldTime()) + & mesh().Sf() + ) ) ) ); @@ -457,14 +459,14 @@ EulerDdtScheme<Type>::fvcDdtPhiCorr ( ddtIOobject, rDeltaT - *fvcDdtPhiCoeff + * this->fvcDdtPhiCoeff ( U.oldTime(), phiAbs.oldTime()/fvc::interpolate(rho.oldTime()) ) - *( - fvc::interpolate(rA*rho.oldTime()) - *phiAbs.oldTime()/fvc::interpolate(rho.oldTime()) + * ( + fvc::interpolate(rA*rho.oldTime()) + * phiAbs.oldTime()/fvc::interpolate(rho.oldTime()) - ( fvc::interpolate ( @@ -487,10 +489,11 @@ EulerDdtScheme<Type>::fvcDdtPhiCorr ( ddtIOobject, rDeltaT - *fvcDdtPhiCoeff(rho.oldTime(), U.oldTime(), phiAbs.oldTime()) - *( - fvc::interpolate(rA)*phiAbs.oldTime() - - (fvc::interpolate(rA*U.oldTime()) & mesh().Sf()) + * this->fvcDdtPhiCoeff + (rho.oldTime(), U.oldTime(), phiAbs.oldTime()) + * ( + fvc::interpolate(rA)*phiAbs.oldTime() + - (fvc::interpolate(rA*U.oldTime()) & mesh().Sf()) ) ) ); diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/SLTSDdtScheme/SLTSDdtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/SLTSDdtScheme/SLTSDdtScheme.C index 8b5fe573a2fc87b411b9db95e6d07729e21edb91..af50dc93cead4e2318b76b243d8f594817ade56c 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/SLTSDdtScheme/SLTSDdtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/SLTSDdtScheme/SLTSDdtScheme.C @@ -90,7 +90,8 @@ template<class Type> tmp<volScalarField> SLTSDdtScheme<Type>::SLrDeltaT() const { const surfaceScalarField& phi = - mesh().objectRegistry::lookupObject<surfaceScalarField>(phiName_); + mesh().objectRegistry::template + lookupObject<surfaceScalarField>(phiName_); const dimensionedScalar& deltaT = mesh().time().deltaT(); @@ -125,8 +126,10 @@ tmp<volScalarField> SLTSDdtScheme<Type>::SLrDeltaT() const else if (phi.dimensions() == dimensionSet(1, 0, -1, 0, 0)) { const volScalarField& rho = - mesh().objectRegistry::lookupObject<volScalarField>(rhoName_) - .oldTime(); + mesh().objectRegistry::template lookupObject<volScalarField> + ( + rhoName_ + ).oldTime(); rDeltaT.internalField() = max ( @@ -154,7 +157,7 @@ SLTSDdtScheme<Type>::fvcDdt const dimensioned<Type>& dt ) { - volScalarField rDeltaT = SLrDeltaT(); + const volScalarField rDeltaT(SLrDeltaT()); IOobject ddtIOobject ( @@ -213,7 +216,7 @@ SLTSDdtScheme<Type>::fvcDdt const GeometricField<Type, fvPatchField, volMesh>& vf ) { - volScalarField rDeltaT = SLrDeltaT(); + const volScalarField rDeltaT(SLrDeltaT()); IOobject ddtIOobject ( @@ -265,7 +268,7 @@ SLTSDdtScheme<Type>::fvcDdt const GeometricField<Type, fvPatchField, volMesh>& vf ) { - volScalarField rDeltaT = SLrDeltaT(); + const volScalarField rDeltaT(SLrDeltaT()); IOobject ddtIOobject ( @@ -317,7 +320,7 @@ SLTSDdtScheme<Type>::fvcDdt const GeometricField<Type, fvPatchField, volMesh>& vf ) { - volScalarField rDeltaT = SLrDeltaT(); + const volScalarField rDeltaT(SLrDeltaT()); IOobject ddtIOobject ( @@ -382,7 +385,7 @@ SLTSDdtScheme<Type>::fvmDdt fvMatrix<Type>& fvm = tfvm(); - scalarField rDeltaT = SLrDeltaT()().internalField(); + scalarField rDeltaT(SLrDeltaT()().internalField()); Info<< "max/min rDeltaT " << max(rDeltaT) << " " << min(rDeltaT) << endl; @@ -419,7 +422,7 @@ SLTSDdtScheme<Type>::fvmDdt ); fvMatrix<Type>& fvm = tfvm(); - scalarField rDeltaT = SLrDeltaT()().internalField(); + scalarField rDeltaT(SLrDeltaT()().internalField()); fvm.diag() = rDeltaT*rho.value()*mesh().V(); @@ -456,7 +459,7 @@ SLTSDdtScheme<Type>::fvmDdt ); fvMatrix<Type>& fvm = tfvm(); - scalarField rDeltaT = SLrDeltaT()().internalField(); + scalarField rDeltaT(SLrDeltaT()().internalField()); fvm.diag() = rDeltaT*rho.internalField()*mesh().V(); @@ -512,14 +515,14 @@ SLTSDdtScheme<Type>::fvcDdtPhiCorr } else { - volScalarField rDeltaT = SLrDeltaT(); + const volScalarField rDeltaT(SLrDeltaT()); return tmp<fluxFieldType> ( new fluxFieldType ( ddtIOobject, - fvcDdtPhiCoeff(U.oldTime(), phi.oldTime())* + this->fvcDdtPhiCoeff(U.oldTime(), phi.oldTime())* ( fvc::interpolate(rDeltaT*rA)*phi.oldTime() - (fvc::interpolate(rDeltaT*rA*U.oldTime()) & mesh().Sf()) @@ -567,7 +570,7 @@ SLTSDdtScheme<Type>::fvcDdtPhiCorr } else { - volScalarField rDeltaT = SLrDeltaT(); + const volScalarField rDeltaT(SLrDeltaT()); if ( @@ -580,7 +583,7 @@ SLTSDdtScheme<Type>::fvcDdtPhiCorr new fluxFieldType ( ddtIOobject, - fvcDdtPhiCoeff(U.oldTime(), phi.oldTime()) + this->fvcDdtPhiCoeff(U.oldTime(), phi.oldTime()) *( fvc::interpolate(rDeltaT*rA*rho.oldTime())*phi.oldTime() - (fvc::interpolate(rDeltaT*rA*rho.oldTime()*U.oldTime()) @@ -600,7 +603,7 @@ SLTSDdtScheme<Type>::fvcDdtPhiCorr new fluxFieldType ( ddtIOobject, - fvcDdtPhiCoeff + this->fvcDdtPhiCoeff ( U.oldTime(), phi.oldTime()/fvc::interpolate(rho.oldTime()) @@ -629,8 +632,9 @@ SLTSDdtScheme<Type>::fvcDdtPhiCorr new fluxFieldType ( ddtIOobject, - fvcDdtPhiCoeff(rho.oldTime(), U.oldTime(), phi.oldTime()) - *( + this->fvcDdtPhiCoeff + (rho.oldTime(), U.oldTime(), phi.oldTime()) + * ( fvc::interpolate(rDeltaT*rA)*phi.oldTime() - ( fvc::interpolate(rDeltaT*rA*U.oldTime())&mesh().Sf() diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/backwardDdtScheme/backwardDdtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/backwardDdtScheme/backwardDdtScheme.C index 3166f9ab0616087233c9f8a64e47d65e792344af..14226b7c2e8d14d3b7524a36315fdd4a4f7e3cbd 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/backwardDdtScheme/backwardDdtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/backwardDdtScheme/backwardDdtScheme.C @@ -542,7 +542,7 @@ backwardDdtScheme<Type>::fvcDdtPhiCorr new fluxFieldType ( ddtIOobject, - rDeltaT*fvcDdtPhiCoeff(U.oldTime(), phi.oldTime()) + rDeltaT*this->fvcDdtPhiCoeff(U.oldTime(), phi.oldTime()) *( fvc::interpolate(rA) *( @@ -606,7 +606,7 @@ backwardDdtScheme<Type>::fvcDdtPhiCorr new fluxFieldType ( ddtIOobject, - rDeltaT*fvcDdtPhiCoeff(U.oldTime(), phiAbs.oldTime()) + rDeltaT*this->fvcDdtPhiCoeff(U.oldTime(), phiAbs.oldTime()) *( coefft0*fvc::interpolate(rA*rho.oldTime()) *phiAbs.oldTime() @@ -639,7 +639,7 @@ backwardDdtScheme<Type>::fvcDdtPhiCorr ( ddtIOobject, rDeltaT - *fvcDdtPhiCoeff + *this->fvcDdtPhiCoeff ( U.oldTime(), phiAbs.oldTime()/fvc::interpolate(rho.oldTime()) @@ -678,10 +678,11 @@ backwardDdtScheme<Type>::fvcDdtPhiCorr ( ddtIOobject, rDeltaT - *fvcDdtPhiCoeff(rho.oldTime(), U.oldTime(), phiAbs.oldTime()) - *( + * this->fvcDdtPhiCoeff + (rho.oldTime(), U.oldTime(), phiAbs.oldTime()) + * ( fvc::interpolate(rA) - *( + * ( coefft0*phiAbs.oldTime() - coefft00*phiAbs.oldTime().oldTime() ) diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/boundedBackwardDdtScheme/boundedBackwardDdtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/boundedBackwardDdtScheme/boundedBackwardDdtScheme.C index 8484a56063b9ce6bb930fe3eb2f76668fb88743f..1a9086285ae893fac26fdeb8cf72b1f8563ae7d3 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/boundedBackwardDdtScheme/boundedBackwardDdtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/boundedBackwardDdtScheme/boundedBackwardDdtScheme.C @@ -143,7 +143,8 @@ boundedBackwardDdtScheme::fvcDdt // Calculate unboundedness indicator // Note: all times moved by one because access to internal field // copies current field into the old-time level. - volScalarField phict = + const volScalarField phict + ( mag ( vf.oldTime().oldTime() @@ -156,13 +157,16 @@ boundedBackwardDdtScheme::fvcDdt - vf.oldTime().oldTime() ) + dimensionedScalar("small", vf.dimensions(), VSMALL) - ); - - volScalarField limiter(pos(phict) - pos(phict - scalar(1))); + ) + ); - volScalarField coefft = scalar(1) + limiter*deltaT/(deltaT + deltaT0); - volScalarField coefft00 = limiter*sqr(deltaT)/(deltaT0*(deltaT + deltaT0)); - volScalarField coefft0 = coefft + coefft00; + const volScalarField limiter(pos(phict) - pos(phict - scalar(1))); + const volScalarField coefft(scalar(1) + limiter*deltaT/(deltaT + deltaT0)); + const volScalarField coefft00 + ( + limiter*sqr(deltaT)/(deltaT0*(deltaT + deltaT0)) + ); + const volScalarField coefft0(coefft + coefft00); if (mesh().moving()) { @@ -238,7 +242,8 @@ boundedBackwardDdtScheme::fvcDdt // Calculate unboundedness indicator // Note: all times moved by one because access to internal field // copies current field into the old-time level. - volScalarField phict = + const volScalarField phict + ( mag ( vf.oldTime().oldTime() @@ -251,13 +256,16 @@ boundedBackwardDdtScheme::fvcDdt - vf.oldTime().oldTime() ) + dimensionedScalar("small", vf.dimensions(), VSMALL) - ); - - volScalarField limiter(pos(phict) - pos(phict - scalar(1))); + ) + ); - volScalarField coefft = scalar(1) + limiter*deltaT/(deltaT + deltaT0); - volScalarField coefft00 = limiter*sqr(deltaT)/(deltaT0*(deltaT + deltaT0)); - volScalarField coefft0 = coefft + coefft00; + const volScalarField limiter(pos(phict) - pos(phict - scalar(1))); + const volScalarField coefft(scalar(1) + limiter*deltaT/(deltaT + deltaT0)); + const volScalarField coefft00 + ( + limiter*sqr(deltaT)/(deltaT0*(deltaT + deltaT0)) + ); + const volScalarField coefft0(coefft + coefft00); if (mesh().moving()) { @@ -333,7 +341,8 @@ boundedBackwardDdtScheme::fvcDdt // Calculate unboundedness indicator // Note: all times moved by one because access to internal field // copies current field into the old-time level. - volScalarField phict = + const volScalarField phict + ( mag ( rho.oldTime().oldTime()*vf.oldTime().oldTime() @@ -346,13 +355,16 @@ boundedBackwardDdtScheme::fvcDdt - rho.oldTime().oldTime()*vf.oldTime().oldTime() ) + dimensionedScalar("small", rho.dimensions()*vf.dimensions(), VSMALL) - ); - - volScalarField limiter(pos(phict) - pos(phict - scalar(1))); + ) + ); - volScalarField coefft = scalar(1) + limiter*deltaT/(deltaT + deltaT0); - volScalarField coefft00 = limiter*sqr(deltaT)/(deltaT0*(deltaT + deltaT0)); - volScalarField coefft0 = coefft + coefft00; + const volScalarField limiter(pos(phict) - pos(phict - scalar(1))); + const volScalarField coefft(scalar(1) + limiter*deltaT/(deltaT + deltaT0)); + const volScalarField coefft00 + ( + limiter*sqr(deltaT)/(deltaT0*(deltaT + deltaT0)) + ); + const volScalarField coefft0(coefft + coefft00); if (mesh().moving()) { @@ -434,7 +446,8 @@ boundedBackwardDdtScheme::fvmDdt // Calculate unboundedness indicator // Note: all times moved by one because access to internal field // copies current field into the old-time level. - scalarField phict = + const scalarField phict + ( mag ( vf.oldTime().oldTime().internalField() @@ -447,13 +460,16 @@ boundedBackwardDdtScheme::fvmDdt - vf.oldTime().oldTime().internalField() ) + VSMALL - ); - - scalarField limiter(pos(phict) - pos(phict - 1.0)); + ) + ); - scalarField coefft = 1.0 + limiter*deltaT/(deltaT + deltaT0); - scalarField coefft00 = limiter*deltaT*deltaT/(deltaT0*(deltaT + deltaT0)); - scalarField coefft0 = coefft + coefft00; + const scalarField limiter(pos(phict) - pos(phict - 1.0)); + const scalarField coefft(1.0 + limiter*deltaT/(deltaT + deltaT0)); + const scalarField coefft00 + ( + limiter*deltaT*deltaT/(deltaT0*(deltaT + deltaT0)) + ); + const scalarField coefft0(coefft + coefft00); fvm.diag() = (coefft*rDeltaT)*mesh().V(); @@ -504,7 +520,8 @@ boundedBackwardDdtScheme::fvmDdt // Calculate unboundedness indicator // Note: all times moved by one because access to internal field // copies current field into the old-time level. - scalarField phict = + const scalarField phict + ( mag ( vf.oldTime().oldTime().internalField() @@ -517,13 +534,16 @@ boundedBackwardDdtScheme::fvmDdt - vf.oldTime().oldTime().internalField() ) + VSMALL - ); - - scalarField limiter(pos(phict) - pos(phict - 1.0)); + ) + ); - scalarField coefft = 1.0 + limiter*deltaT/(deltaT + deltaT0); - scalarField coefft00 = limiter*deltaT*deltaT/(deltaT0*(deltaT + deltaT0)); - scalarField coefft0 = coefft + coefft00; + const scalarField limiter(pos(phict) - pos(phict - 1.0)); + const scalarField coefft(1.0 + limiter*deltaT/(deltaT + deltaT0)); + const scalarField coefft00 + ( + limiter*deltaT*deltaT/(deltaT0*(deltaT + deltaT0)) + ); + const scalarField coefft0(coefft + coefft00); fvm.diag() = (coefft*rDeltaT*rho.value())*mesh().V(); @@ -574,7 +594,8 @@ boundedBackwardDdtScheme::fvmDdt // Calculate unboundedness indicator // Note: all times moved by one because access to internal field // copies current field into the old-time level. - scalarField phict = + const scalarField phict + ( mag ( rho.oldTime().oldTime().internalField()* @@ -591,13 +612,16 @@ boundedBackwardDdtScheme::fvmDdt vf.oldTime().oldTime().internalField() ) + VSMALL - ); - - scalarField limiter(pos(phict) - pos(phict - 1.0)); + ) + ); - scalarField coefft = 1.0 + limiter*deltaT/(deltaT + deltaT0); - scalarField coefft00 = limiter*deltaT*deltaT/(deltaT0*(deltaT + deltaT0)); - scalarField coefft0 = coefft + coefft00; + const scalarField limiter(pos(phict) - pos(phict - 1.0)); + const scalarField coefft(1.0 + limiter*deltaT/(deltaT + deltaT0)); + const scalarField coefft00 + ( + limiter*deltaT*deltaT/(deltaT0*(deltaT + deltaT0)) + ); + const scalarField coefft0(coefft + coefft00); fvm.diag() = (coefft*rDeltaT)*rho.internalField()*mesh().V(); diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/localEulerDdtScheme/localEulerDdtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/localEulerDdtScheme/localEulerDdtScheme.C index b0e2f9bb115378952f7904cd9a7803a28ad59c3d..69ef2dc1be850ca3c893f3a1e6b7b5e12dcd7eca 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/localEulerDdtScheme/localEulerDdtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/localEulerDdtScheme/localEulerDdtScheme.C @@ -42,7 +42,8 @@ namespace fv template<class Type> const volScalarField& localEulerDdtScheme<Type>::localRDeltaT() const { - return mesh().objectRegistry::lookupObject<volScalarField>(rDeltaTName_); + return mesh().objectRegistry::template lookupObject<volScalarField> + (rDeltaTName_); } @@ -416,7 +417,7 @@ localEulerDdtScheme<Type>::fvcDdtPhiCorr new fluxFieldType ( ddtIOobject, - fvcDdtPhiCoeff(U.oldTime(), phi.oldTime())* + this->fvcDdtPhiCoeff(U.oldTime(), phi.oldTime())* ( fvc::interpolate(rDeltaT*rA)*phi.oldTime() - (fvc::interpolate(rDeltaT*rA*U.oldTime()) & mesh().Sf()) @@ -477,7 +478,7 @@ localEulerDdtScheme<Type>::fvcDdtPhiCorr new fluxFieldType ( ddtIOobject, - fvcDdtPhiCoeff(U.oldTime(), phi.oldTime()) + this->fvcDdtPhiCoeff(U.oldTime(), phi.oldTime()) *( fvc::interpolate(rDeltaT*rA*rho.oldTime())*phi.oldTime() - (fvc::interpolate(rDeltaT*rA*rho.oldTime()*U.oldTime()) @@ -497,7 +498,7 @@ localEulerDdtScheme<Type>::fvcDdtPhiCorr new fluxFieldType ( ddtIOobject, - fvcDdtPhiCoeff + this->fvcDdtPhiCoeff ( U.oldTime(), phi.oldTime()/fvc::interpolate(rho.oldTime()) @@ -526,8 +527,9 @@ localEulerDdtScheme<Type>::fvcDdtPhiCorr new fluxFieldType ( ddtIOobject, - fvcDdtPhiCoeff(rho.oldTime(), U.oldTime(), phi.oldTime()) - *( + this->fvcDdtPhiCoeff + (rho.oldTime(), U.oldTime(), phi.oldTime()) + * ( fvc::interpolate(rDeltaT*rA)*phi.oldTime() - ( fvc::interpolate(rDeltaT*rA*U.oldTime())&mesh().Sf() diff --git a/src/finiteVolume/finiteVolume/fvc/fvcSmooth/fvcSmooth.C b/src/finiteVolume/finiteVolume/fvc/fvcSmooth/fvcSmooth.C index 57f48b99352faccc13d27164adecc8864e313171..94a6a0259897dd7f50e09f4b928ac5a87c08873d 100644 --- a/src/finiteVolume/finiteVolume/fvc/fvcSmooth/fvcSmooth.C +++ b/src/finiteVolume/finiteVolume/fvc/fvcSmooth/fvcSmooth.C @@ -183,8 +183,10 @@ void Foam::fvc::spread label facei = patch.start() + patchFacei; label own = mesh.faceOwner()[facei]; - scalarField alphapn = - alpha.boundaryField()[patchi].patchNeighbourField(); + const scalarField alphapn + ( + alpha.boundaryField()[patchi].patchNeighbourField() + ); if ( @@ -283,8 +285,10 @@ void Foam::fvc::sweep label facei = patch.start() + patchFacei; label own = mesh.faceOwner()[facei]; - scalarField alphapn = - alpha.boundaryField()[patchi].patchNeighbourField(); + const scalarField alphapn + ( + alpha.boundaryField()[patchi].patchNeighbourField() + ); if (mag(alpha[own] - alphapn[patchFacei]) > alphaDiff) { diff --git a/src/finiteVolume/finiteVolume/gradSchemes/extendedLeastSquaresGrad/extendedLeastSquaresGrad.C b/src/finiteVolume/finiteVolume/gradSchemes/extendedLeastSquaresGrad/extendedLeastSquaresGrad.C index 722bbf329088f76349e4e449b07ad8324a227311..a77e47051e3e80992387e59bb9dc32dc5c8f6edf 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/extendedLeastSquaresGrad/extendedLeastSquaresGrad.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/extendedLeastSquaresGrad/extendedLeastSquaresGrad.C @@ -112,8 +112,10 @@ Foam::fv::extendedLeastSquaresGrad<Type>::calcGrad if (vsf.boundaryField()[patchi].coupled()) { - Field<Type> neiVsf = - vsf.boundaryField()[patchi].patchNeighbourField(); + const Field<Type> neiVsf + ( + vsf.boundaryField()[patchi].patchNeighbourField() + ); forAll(neiVsf, patchFaceI) { diff --git a/src/finiteVolume/finiteVolume/gradSchemes/extendedLeastSquaresGrad/extendedLeastSquaresVectors.C b/src/finiteVolume/finiteVolume/gradSchemes/extendedLeastSquaresGrad/extendedLeastSquaresVectors.C index 54da2b8bc262a3c0a6907396e519fd899dbf7807..4be71b70379cd688933ed1f641e08c65f274cee5 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/extendedLeastSquaresGrad/extendedLeastSquaresVectors.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/extendedLeastSquaresGrad/extendedLeastSquaresVectors.C @@ -111,7 +111,10 @@ void Foam::extendedLeastSquaresVectors::makeLeastSquaresVectors() const const labelUList& neighbour = mesh_.neighbour(); // Build the d-vectors - surfaceVectorField d = mesh_.Sf()/(mesh_.magSf()*mesh_.deltaCoeffs()); + surfaceVectorField d + ( + mesh_.Sf()/(mesh_.magSf()*mesh_.deltaCoeffs()) + ); if (!mesh_.orthogonal()) { @@ -124,7 +127,7 @@ void Foam::extendedLeastSquaresVectors::makeLeastSquaresVectors() const forAll(owner, faceI) { - symmTensor wdd = 1.0/magSqr(d[faceI])*sqr(d[faceI]); + const symmTensor wdd(1.0/magSqr(d[faceI])*sqr(d[faceI])); dd[owner[faceI]] += wdd; dd[neighbour[faceI]] += wdd; @@ -146,11 +149,11 @@ void Foam::extendedLeastSquaresVectors::makeLeastSquaresVectors() const } } - scalarField detdd = det(dd); + scalarField detdd(det(dd)); - Info<< "max(detdd) = " << max(detdd) << endl; - Info<< "min(detdd) = " << min(detdd) << endl; - Info<< "average(detdd) = " << average(detdd) << endl; + Info<< "max(detdd) = " << max(detdd) << nl + << "min(detdd) = " << min(detdd) << nl + << "average(detdd) = " << average(detdd) << endl; label nAddCells = 0; label maxNaddCells = 4*detdd.size(); @@ -219,13 +222,13 @@ void Foam::extendedLeastSquaresVectors::makeLeastSquaresVectors() const additionalCells_.setSize(nAddCells); - Info<< "max(detdd) = " << max(detdd) << endl; - Info<< "min(detdd) = " << min(detdd) << endl; - Info<< "average(detdd) = " << average(detdd) << endl; - Info<< "nAddCells/nCells = " << scalar(nAddCells)/mesh.nCells() << endl; + Info<< "max(detdd) = " << max(detdd) << nl + << "min(detdd) = " << min(detdd) << nl + << "average(detdd) = " << average(detdd) << nl + << "nAddCells/nCells = " << scalar(nAddCells)/mesh.nCells() << endl; // Invert the dd tensor - symmTensorField invDd = inv(dd); + const symmTensorField invDd(inv(dd)); // Revisit all faces and calculate the lsP and lsN vectors diff --git a/src/finiteVolume/finiteVolume/gradSchemes/fourthGrad/fourthGrad.C b/src/finiteVolume/finiteVolume/gradSchemes/fourthGrad/fourthGrad.C index efbacc24aae213b48b5d867c21aa68bd8409e7f9..6d9ff04f8e5f831c7866334c5eb4a3f1639cdc36 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/fourthGrad/fourthGrad.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/fourthGrad/fourthGrad.C @@ -122,12 +122,14 @@ Foam::fv::fourthGrad<Type>::calcGrad const scalarField& lambdap = lambda.boundaryField()[patchi]; // Build the d-vectors - vectorField pd = + vectorField pd + ( mesh.Sf().boundaryField()[patchi] - /( - mesh.magSf().boundaryField()[patchi] - *mesh.deltaCoeffs().boundaryField()[patchi] - ); + / ( + mesh.magSf().boundaryField()[patchi] + * mesh.deltaCoeffs().boundaryField()[patchi] + ) + ); if (!mesh.orthogonal()) { @@ -138,8 +140,10 @@ Foam::fv::fourthGrad<Type>::calcGrad const labelUList& faceCells = fGrad.boundaryField()[patchi].patch().faceCells(); - Field<GradType> neighbourSecondfGrad = - secondfGrad.boundaryField()[patchi].patchNeighbourField(); + const Field<GradType> neighbourSecondfGrad + ( + secondfGrad.boundaryField()[patchi].patchNeighbourField() + ); forAll(faceCells, patchFaceI) { diff --git a/src/finiteVolume/finiteVolume/gradSchemes/gaussGrad/gaussGrad.C b/src/finiteVolume/finiteVolume/gradSchemes/gaussGrad/gaussGrad.C index 562285d2d0585a9e7908717ce5a1040f33a73798..17895c1d213aec6fc41c1036062c133d81628c53 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/gaussGrad/gaussGrad.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/gaussGrad/gaussGrad.C @@ -154,9 +154,11 @@ void Foam::fv::gaussGrad<Type>::correctBoundaryConditions { if (!vsf.boundaryField()[patchi].coupled()) { - vectorField n = + const vectorField n + ( vsf.mesh().Sf().boundaryField()[patchi] - /vsf.mesh().magSf().boundaryField()[patchi]; + / vsf.mesh().magSf().boundaryField()[patchi] + ); gGrad.boundaryField()[patchi] += n * ( diff --git a/src/finiteVolume/finiteVolume/gradSchemes/gradScheme/gradScheme.C b/src/finiteVolume/finiteVolume/gradSchemes/gradScheme/gradScheme.C index 1b58aca6d11e79e3e14875d2d35872827921087a..5860dbec767e35158996b76e149d3a3f193c29be 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/gradScheme/gradScheme.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/gradScheme/gradScheme.C @@ -127,7 +127,7 @@ Foam::fv::gradScheme<Type>::grad if (!this->mesh().changing() && this->mesh().cache(name)) { - if (!mesh().objectRegistry::foundObject<GradFieldType>(name)) + if (!mesh().objectRegistry::template foundObject<GradFieldType>(name)) { cachePrintMessage("Calculating and caching", name, vsf); tmp<GradFieldType> tgGrad = calcGrad(vsf, name); @@ -137,7 +137,7 @@ Foam::fv::gradScheme<Type>::grad cachePrintMessage("Retreiving", name, vsf); GradFieldType& gGrad = const_cast<GradFieldType&> ( - mesh().objectRegistry::lookupObject<GradFieldType>(name) + mesh().objectRegistry::template lookupObject<GradFieldType>(name) ); if (gGrad.upToDate(vsf)) @@ -157,7 +157,10 @@ Foam::fv::gradScheme<Type>::grad regIOobject::store(tgGrad.ptr()); GradFieldType& gGrad = const_cast<GradFieldType&> ( - mesh().objectRegistry::lookupObject<GradFieldType>(name) + mesh().objectRegistry::template lookupObject<GradFieldType> + ( + name + ) ); return gGrad; @@ -165,11 +168,14 @@ Foam::fv::gradScheme<Type>::grad } else { - if (mesh().objectRegistry::foundObject<GradFieldType>(name)) + if (mesh().objectRegistry::template foundObject<GradFieldType>(name)) { GradFieldType& gGrad = const_cast<GradFieldType&> ( - mesh().objectRegistry::lookupObject<GradFieldType>(name) + mesh().objectRegistry::template lookupObject<GradFieldType> + ( + name + ) ); if (gGrad.ownedByRegistry()) diff --git a/src/finiteVolume/finiteVolume/gradSchemes/leastSquaresGrad/leastSquaresGrad.C b/src/finiteVolume/finiteVolume/gradSchemes/leastSquaresGrad/leastSquaresGrad.C index 708d578779c073b95f030dac62a1bfc2ac093059..073dda4b978ecfe4e58536fa1a8b3c4b2e4297b2 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/leastSquaresGrad/leastSquaresGrad.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/leastSquaresGrad/leastSquaresGrad.C @@ -108,8 +108,10 @@ Foam::fv::leastSquaresGrad<Type>::calcGrad if (vsf.boundaryField()[patchi].coupled()) { - Field<Type> neiVsf = - vsf.boundaryField()[patchi].patchNeighbourField(); + const Field<Type> neiVsf + ( + vsf.boundaryField()[patchi].patchNeighbourField() + ); forAll(neiVsf, patchFaceI) { diff --git a/src/finiteVolume/finiteVolume/gradSchemes/leastSquaresGrad/leastSquaresVectors.C b/src/finiteVolume/finiteVolume/gradSchemes/leastSquaresGrad/leastSquaresVectors.C index b6735d483475debcb34a601d3c45a86c71040f2c..da750b544ba3e1672c65b593181223a37f5862ca 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/leastSquaresGrad/leastSquaresVectors.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/leastSquaresGrad/leastSquaresVectors.C @@ -130,12 +130,14 @@ void Foam::leastSquaresVectors::makeLeastSquaresVectors() const const labelUList& faceCells = p.patch().faceCells(); // Build the d-vectors - vectorField pd = + vectorField pd + ( mesh.Sf().boundaryField()[patchi] - /( - mesh.magSf().boundaryField()[patchi] - *mesh.deltaCoeffs().boundaryField()[patchi] - ); + / ( + mesh.magSf().boundaryField()[patchi] + * mesh.deltaCoeffs().boundaryField()[patchi] + ) + ); if (!mesh.orthogonal()) { @@ -167,7 +169,7 @@ void Foam::leastSquaresVectors::makeLeastSquaresVectors() const // Invert the dd tensor - symmTensorField invDd = inv(dd); + const symmTensorField invDd(inv(dd)); // Revisit all faces and calculate the lsP and lsN vectors @@ -194,12 +196,14 @@ void Foam::leastSquaresVectors::makeLeastSquaresVectors() const const labelUList& faceCells = p.faceCells(); // Build the d-vectors - vectorField pd = + vectorField pd + ( mesh.Sf().boundaryField()[patchi] /( mesh.magSf().boundaryField()[patchi] *mesh.deltaCoeffs().boundaryField()[patchi] - ); + ) + ); if (!mesh.orthogonal()) { diff --git a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellLimitedGrad/cellLimitedGrads.C b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellLimitedGrad/cellLimitedGrads.C index 7fa5683a9559344751e1436208ea0fe86100d2a6..6bb5c3b4ef2bc9dbc4478a1ec5a8ee50314c6778 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellLimitedGrad/cellLimitedGrads.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellLimitedGrad/cellLimitedGrads.C @@ -97,7 +97,7 @@ Foam::fv::cellLimitedGrad<Foam::scalar>::calcGrad if (psf.coupled()) { - scalarField psfNei = psf.patchNeighbourField(); + const scalarField psfNei(psf.patchNeighbourField()); forAll(pOwner, pFacei) { @@ -126,7 +126,7 @@ Foam::fv::cellLimitedGrad<Foam::scalar>::calcGrad if (k_ < 1.0) { - scalarField maxMinVsf = (1.0/k_ - 1.0)*(maxVsf - minVsf); + const scalarField maxMinVsf((1.0/k_ - 1.0)*(maxVsf - minVsf)); maxVsf += maxMinVsf; minVsf -= maxMinVsf; @@ -250,7 +250,7 @@ Foam::fv::cellLimitedGrad<Foam::vector>::calcGrad if (psf.coupled()) { - vectorField psfNei = psf.patchNeighbourField(); + const vectorField psfNei(psf.patchNeighbourField()); forAll(pOwner, pFacei) { @@ -279,7 +279,7 @@ Foam::fv::cellLimitedGrad<Foam::vector>::calcGrad if (k_ < 1.0) { - vectorField maxMinVsf = (1.0/k_ - 1.0)*(maxVsf - minVsf); + const vectorField maxMinVsf((1.0/k_ - 1.0)*(maxVsf - minVsf)); maxVsf += maxMinVsf; minVsf -= maxMinVsf; diff --git a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellMDLimitedGrad/cellMDLimitedGrads.C b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellMDLimitedGrad/cellMDLimitedGrads.C index 2a1fa06e64eaa1e30e13a897683939daab410f04..0030742069c6cc4f91f52711e05d56ef2aa24b6a 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellMDLimitedGrad/cellMDLimitedGrads.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellMDLimitedGrad/cellMDLimitedGrads.C @@ -98,7 +98,7 @@ Foam::fv::cellMDLimitedGrad<Foam::scalar>::calcGrad if (psf.coupled()) { - scalarField psfNei = psf.patchNeighbourField(); + const scalarField psfNei(psf.patchNeighbourField()); forAll(pOwner, pFacei) { @@ -127,7 +127,7 @@ Foam::fv::cellMDLimitedGrad<Foam::scalar>::calcGrad if (k_ < 1.0) { - scalarField maxMinVsf = (1.0/k_ - 1.0)*(maxVsf - minVsf); + const scalarField maxMinVsf((1.0/k_ - 1.0)*(maxVsf - minVsf)); maxVsf += maxMinVsf; minVsf -= maxMinVsf; @@ -240,7 +240,7 @@ Foam::fv::cellMDLimitedGrad<Foam::vector>::calcGrad if (psf.coupled()) { - vectorField psfNei = psf.patchNeighbourField(); + const vectorField psfNei(psf.patchNeighbourField()); forAll(pOwner, pFacei) { @@ -269,7 +269,7 @@ Foam::fv::cellMDLimitedGrad<Foam::vector>::calcGrad if (k_ < 1.0) { - vectorField maxMinVsf = (1.0/k_ - 1.0)*(maxVsf - minVsf); + const vectorField maxMinVsf((1.0/k_ - 1.0)*(maxVsf - minVsf)); maxVsf += maxMinVsf; minVsf -= maxMinVsf; diff --git a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceLimitedGrad/faceLimitedGrads.C b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceLimitedGrad/faceLimitedGrads.C index febc19eb17d1c5ba17cdc6ac5745cfaf49431e64..e1f3e5cab1495a8d3673d3ad37b2a5b545bbf04a 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceLimitedGrad/faceLimitedGrads.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceLimitedGrad/faceLimitedGrads.C @@ -116,7 +116,7 @@ Foam::fv::faceLimitedGrad<Foam::scalar>::calcGrad if (psf.coupled()) { - scalarField psfNei = psf.patchNeighbourField(); + const scalarField psfNei(psf.patchNeighbourField()); forAll(pOwner, pFacei) { @@ -267,7 +267,7 @@ Foam::fv::faceLimitedGrad<Foam::vector>::calcGrad if (psf.coupled()) { - vectorField psfNei = psf.patchNeighbourField(); + const vectorField psfNei(psf.patchNeighbourField()); forAll(pOwner, pFacei) { diff --git a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceMDLimitedGrad/faceMDLimitedGrads.C b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceMDLimitedGrad/faceMDLimitedGrads.C index 906324e0ebd5ed229db248cc3338f6d101143f72..ba3c9528a9d47eb43b0b2842df542db397bda51f 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceMDLimitedGrad/faceMDLimitedGrads.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceMDLimitedGrad/faceMDLimitedGrads.C @@ -119,7 +119,7 @@ Foam::fv::faceMDLimitedGrad<Foam::scalar>::calcGrad if (psf.coupled()) { - scalarField psfNei = psf.patchNeighbourField(); + const scalarField psfNei(psf.patchNeighbourField()); forAll(pOwner, pFacei) { @@ -261,7 +261,7 @@ Foam::fv::faceMDLimitedGrad<Foam::vector>::calcGrad if (psf.coupled()) { - vectorField psfNei = psf.patchNeighbourField(); + const vectorField psfNei(psf.patchNeighbourField()); forAll(pOwner, pFacei) { diff --git a/src/finiteVolume/finiteVolume/laplacianSchemes/gaussLaplacianScheme/gaussLaplacianScheme.C b/src/finiteVolume/finiteVolume/laplacianSchemes/gaussLaplacianScheme/gaussLaplacianScheme.C index f9a49efdaf62ad5e01b633871bf499a5f1ef59a5..9d49f1f3aed7ae1f8325d12d66522520aacda8fc 100644 --- a/src/finiteVolume/finiteVolume/laplacianSchemes/gaussLaplacianScheme/gaussLaplacianScheme.C +++ b/src/finiteVolume/finiteVolume/laplacianSchemes/gaussLaplacianScheme/gaussLaplacianScheme.C @@ -153,11 +153,14 @@ gaussLaplacianScheme<Type, GType>::fvmLaplacian { const fvMesh& mesh = this->mesh(); - surfaceVectorField Sn = mesh.Sf()/mesh.magSf(); + const surfaceVectorField Sn(mesh.Sf()/mesh.magSf()); - surfaceVectorField SfGamma = mesh.Sf() & gamma; - GeometricField<scalar, fvsPatchField, surfaceMesh> SfGammaSn = SfGamma & Sn; - surfaceVectorField SfGammaCorr = SfGamma - SfGammaSn*Sn; + const surfaceVectorField SfGamma(mesh.Sf() & gamma); + const GeometricField<scalar, fvsPatchField, surfaceMesh> SfGammaSn + ( + SfGamma & Sn + ); + const surfaceVectorField SfGammaCorr(SfGamma - SfGammaSn*Sn); tmp<fvMatrix<Type> > tfvm = fvmLaplacianUncorrected(SfGammaSn, vf); fvMatrix<Type>& fvm = tfvm(); @@ -192,11 +195,13 @@ gaussLaplacianScheme<Type, GType>::fvcLaplacian { const fvMesh& mesh = this->mesh(); - surfaceVectorField Sn = mesh.Sf()/mesh.magSf(); - - surfaceVectorField SfGamma = mesh.Sf() & gamma; - GeometricField<scalar, fvsPatchField, surfaceMesh> SfGammaSn = SfGamma & Sn; - surfaceVectorField SfGammaCorr = SfGamma - SfGammaSn*Sn; + const surfaceVectorField Sn(mesh.Sf()/mesh.magSf()); + const surfaceVectorField SfGamma(mesh.Sf() & gamma); + const GeometricField<scalar, fvsPatchField, surfaceMesh> SfGammaSn + ( + SfGamma & Sn + ); + const surfaceVectorField SfGammaCorr(SfGamma - SfGammaSn*Sn); tmp<GeometricField<Type, fvPatchField, volMesh> > tLaplacian ( diff --git a/src/finiteVolume/finiteVolume/snGradSchemes/limitedSnGrad/limitedSnGrad.C b/src/finiteVolume/finiteVolume/snGradSchemes/limitedSnGrad/limitedSnGrad.C index 2ae13959924a72f0717689704651fe2d7367c023..8107d88226e05809f1846da76f6bc32c747bc2b2 100644 --- a/src/finiteVolume/finiteVolume/snGradSchemes/limitedSnGrad/limitedSnGrad.C +++ b/src/finiteVolume/finiteVolume/snGradSchemes/limitedSnGrad/limitedSnGrad.C @@ -66,10 +66,12 @@ limitedSnGrad<Type>::correction const GeometricField<Type, fvPatchField, volMesh>& vf ) const { - GeometricField<Type, fvsPatchField, surfaceMesh> corr = - correctedSnGrad<Type>(this->mesh()).correction(vf); + const GeometricField<Type, fvsPatchField, surfaceMesh> corr + ( + correctedSnGrad<Type>(this->mesh()).correction(vf) + ); - surfaceScalarField limiter + const surfaceScalarField limiter ( min ( diff --git a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C index b0c18e3c68fd5f48f1cf99710a07c2f4105dada3..a5c29339495b8d81d68d4302d786d361ec2bd8ca 100644 --- a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C +++ b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C @@ -623,7 +623,8 @@ void Foam::fvMatrix<Type>::relax() { word name = psi_.select ( - psi_.mesh().data::lookupOrDefault<bool>("finalIteration", false) + psi_.mesh().data::template lookupOrDefault<bool> + ("finalIteration", false) ); if (psi_.mesh().relax(name)) @@ -734,7 +735,7 @@ Foam::fvMatrix<Type>::H() const // Loop over field components for (direction cmpt=0; cmpt<Type::nComponents; cmpt++) { - scalarField psiCmpt = psi_.internalField().component(cmpt); + scalarField psiCmpt(psi_.internalField().component(cmpt)); scalarField boundaryDiagCmpt(psi_.size(), 0.0); addBoundaryDiag(boundaryDiagCmpt, cmpt); @@ -801,7 +802,7 @@ Foam::tmp<Foam::volScalarField> Foam::fvMatrix<Type>::H1() const /* for (direction cmpt=0; cmpt<Type::nComponents; cmpt++) { - scalarField psiCmpt = psi_.internalField().component(cmpt); + scalarField psiCmpt(psi_.internalField().component(cmpt)); scalarField boundaryDiagCmpt(psi_.size(), 0.0); addBoundaryDiag(boundaryDiagCmpt, cmpt); @@ -2258,7 +2259,7 @@ Foam::operator& // Loop over field components for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++) { - scalarField psiCmpt = psi.field().component(cmpt); + scalarField psiCmpt(psi.field().component(cmpt)); scalarField boundaryDiagCmpt(M.diag()); M.addBoundaryDiag(boundaryDiagCmpt, cmpt); Mphi.internalField().replace(cmpt, -boundaryDiagCmpt*psiCmpt); diff --git a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C index f86c0c9aba062168da68674f1968ba50fa05b7de..bc320829cdd4ff89d5829e5b24fcf31aa33d6046 100644 --- a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C +++ b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C @@ -71,9 +71,9 @@ Foam::lduMatrix::solverPerformance Foam::fvMatrix<Type>::solve psi.name() ); - scalarField saveDiag = diag(); + scalarField saveDiag(diag()); - Field<Type> source = source_; + Field<Type> source(source_); // At this point include the boundary source from the coupled boundaries. // This is corrected for the implict part by updateMatrixInterfaces within @@ -95,10 +95,10 @@ Foam::lduMatrix::solverPerformance Foam::fvMatrix<Type>::solve // copy field and source - scalarField psiCmpt = psi.internalField().component(cmpt); + scalarField psiCmpt(psi.internalField().component(cmpt)); addBoundaryDiag(diag(), cmpt); - scalarField sourceCmpt = source.component(cmpt); + scalarField sourceCmpt(source.component(cmpt)); FieldField<Field, scalar> bouCoeffsCmpt ( @@ -174,7 +174,8 @@ Foam::fvMatrix<Type>::solver() ( psi_.select ( - psi_.mesh().data::lookupOrDefault<bool>("finalIteration", false) + psi_.mesh().data::template lookupOrDefault<bool> + ("finalIteration", false) ) ) ); @@ -186,11 +187,12 @@ Foam::lduMatrix::solverPerformance Foam::fvMatrix<Type>::fvSolver::solve() { return solve ( - psi_.mesh().solverDict + fvMat_.psi_.mesh().solverDict ( - psi_.select + fvMat_.psi_.select ( - psi_.mesh().data::lookupOrDefault<bool>("finalIteration", false) + fvMat_.psi_.mesh().data::template lookupOrDefault<bool> + ("finalIteration", false) ) ) ); @@ -206,7 +208,8 @@ Foam::lduMatrix::solverPerformance Foam::fvMatrix<Type>::solve() ( psi_.select ( - psi_.mesh().data::lookupOrDefault<bool>("finalIteration", false) + psi_.mesh().data::template lookupOrDefault<bool> + ("finalIteration", false) ) ) ); @@ -224,7 +227,7 @@ Foam::tmp<Foam::Field<Type> > Foam::fvMatrix<Type>::residual() const // Loop over field components for (direction cmpt=0; cmpt<Type::nComponents; cmpt++) { - scalarField psiCmpt = psi_.internalField().component(cmpt); + scalarField psiCmpt(psi_.internalField().component(cmpt)); scalarField boundaryDiagCmpt(psi_.size(), 0.0); addBoundaryDiag(boundaryDiagCmpt, cmpt); diff --git a/src/finiteVolume/fvMatrices/fvScalarMatrix/fvScalarMatrix.C b/src/finiteVolume/fvMatrices/fvScalarMatrix/fvScalarMatrix.C index e877b51af547d8902e257d39eca11ae55eb286b4..f0c6404abacd414a9c1df306d8076f955a1e694e 100644 --- a/src/finiteVolume/fvMatrices/fvScalarMatrix/fvScalarMatrix.C +++ b/src/finiteVolume/fvMatrices/fvScalarMatrix/fvScalarMatrix.C @@ -66,7 +66,7 @@ Foam::fvMatrix<Foam::scalar>::solver << endl; } - scalarField saveDiag = diag(); + scalarField saveDiag(diag()); addBoundaryDiag(diag(), 0); autoPtr<fvMatrix<scalar>::fvSolver> solverPtr @@ -102,10 +102,10 @@ Foam::lduMatrix::solverPerformance Foam::fvMatrix<Foam::scalar>::fvSolver::solve const_cast<GeometricField<scalar, fvPatchField, volMesh>&> (fvMat_.psi()); - scalarField saveDiag = fvMat_.diag(); + scalarField saveDiag(fvMat_.diag()); fvMat_.addBoundaryDiag(fvMat_.diag(), 0); - scalarField totalSource = fvMat_.source(); + scalarField totalSource(fvMat_.source()); fvMat_.addBoundarySource(totalSource, false); // assign new solver controls @@ -145,10 +145,10 @@ Foam::lduMatrix::solverPerformance Foam::fvMatrix<Foam::scalar>::solve GeometricField<scalar, fvPatchField, volMesh>& psi = const_cast<GeometricField<scalar, fvPatchField, volMesh>&>(psi_); - scalarField saveDiag = diag(); + scalarField saveDiag(diag()); addBoundaryDiag(diag(), 0); - scalarField totalSource = source_; + scalarField totalSource(source_); addBoundarySource(totalSource, false); // Solver call diff --git a/src/finiteVolume/fvMatrices/solvers/MULES/MULESTemplates.C b/src/finiteVolume/fvMatrices/solvers/MULES/MULESTemplates.C index eafec93b65d6d09f2318622034a3bd3cb73348dc..964c55f717b021dc93d7f9a328de27759f5aaa1f 100644 --- a/src/finiteVolume/fvMatrices/solvers/MULES/MULESTemplates.C +++ b/src/finiteVolume/fvMatrices/solvers/MULES/MULESTemplates.C @@ -56,7 +56,7 @@ void Foam::MULES::explicitSolve const fvMesh& mesh = psi.mesh(); psi.correctBoundaryConditions(); - surfaceScalarField phiBD = upwind<scalar>(psi.mesh(), phi).flux(psi); + surfaceScalarField phiBD(upwind<scalar>(psi.mesh(), phi).flux(psi)); surfaceScalarField& phiCorr = phiPsi; phiCorr -= phiBD; @@ -167,7 +167,7 @@ void Foam::MULES::implicitSolve scalarField allCoLambda(mesh.nFaces()); { - surfaceScalarField Cof = + tmp<surfaceScalarField> Cof = mesh.time().deltaT()*mesh.surfaceInterpolation::deltaCoeffs() *mag(phi)/mesh.magSf(); @@ -225,7 +225,7 @@ void Foam::MULES::implicitSolve - Su ); - surfaceScalarField phiBD = psiConvectionDiffusion.flux(); + surfaceScalarField phiBD(psiConvectionDiffusion.flux()); surfaceScalarField& phiCorr = phiPsi; phiCorr -= phiBD; @@ -405,7 +405,7 @@ void Foam::MULES::limiter if (psiPf.coupled()) { - scalarField psiPNf = psiPf.patchNeighbourField(); + const scalarField psiPNf(psiPf.patchNeighbourField()); forAll(phiCorrPf, pFacei) { diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CECCellToCellStencil.C b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CECCellToCellStencil.C index 7612de35e30c3cb6e12e32ca128d0d06b6fa79bc..dbe97fd61f214fe13de87398180c05a88e67b087 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CECCellToCellStencil.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CECCellToCellStencil.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CECCellToCellStencil.H b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CECCellToCellStencil.H index 6e8c48165f9a8ac5fa7672e0f2ab604c1ea5f15a..3656466b8ee9a6f41c4931de59706529f346e1ec 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CECCellToCellStencil.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CECCellToCellStencil.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -46,7 +46,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class CECCellToCellStencil Declaration + Class CECCellToCellStencil Declaration \*---------------------------------------------------------------------------*/ class CECCellToCellStencil @@ -66,13 +66,6 @@ class CECCellToCellStencil void calcCellStencil(labelListList& globalCellCells) const; - //- Disallow default bitwise copy construct - CECCellToCellStencil(const CECCellToCellStencil&); - - //- Disallow default bitwise assignment - void operator=(const CECCellToCellStencil&); - - public: // Constructors diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CFCCellToCellStencil.C b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CFCCellToCellStencil.C index fe9edd868b1c7d178b4a255ec4e019bec143a43c..747bf770767f51bb1ed2faf6ed1015db0af0acd7 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CFCCellToCellStencil.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CFCCellToCellStencil.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CFCCellToCellStencil.H b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CFCCellToCellStencil.H index e552f8e4a39d10303ac28fd3d00fe1d62bce2485..e2f4e8e427eec609da1f59d8fc3c76e5a6e5d5a4 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CFCCellToCellStencil.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CFCCellToCellStencil.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -42,7 +42,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class CFCCellToCellStencil Declaration + Class CFCCellToCellStencil Declaration \*---------------------------------------------------------------------------*/ class CFCCellToCellStencil @@ -55,11 +55,6 @@ class CFCCellToCellStencil void calcCellStencil(labelListList& globalCellCells) const; - //- Disallow default bitwise copy construct - CFCCellToCellStencil(const CFCCellToCellStencil&); - - //- Disallow default bitwise assignment - void operator=(const CFCCellToCellStencil&); public: diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CPCCellToCellStencil.C b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CPCCellToCellStencil.C index 652308fa45607afacb36373bfb4392d3ab86f846..51f49c1b67cbea7e86b5203f58c6a7c10b65902b 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CPCCellToCellStencil.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CPCCellToCellStencil.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CPCCellToCellStencil.H b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CPCCellToCellStencil.H index b23b9a215de68790b13d4542f7bbc6e8a782777f..b1ffa0b613895dcee57898978d2a20208f8c4a0f 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CPCCellToCellStencil.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CPCCellToCellStencil.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -45,7 +45,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class CPCCellToCellStencil Declaration + Class CPCCellToCellStencil Declaration \*---------------------------------------------------------------------------*/ class CPCCellToCellStencil @@ -65,13 +65,6 @@ class CPCCellToCellStencil void calcCellStencil(labelListList& globalCellCells) const; - //- Disallow default bitwise copy construct - CPCCellToCellStencil(const CPCCellToCellStencil&); - - //- Disallow default bitwise assignment - void operator=(const CPCCellToCellStencil&); - - public: // Constructors diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/cellToCellStencil.C b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/cellToCellStencil.C index caf3c64f6e00de85ad133f366de0c28f9b1047b5..46256713d757ed4909e8125afb46de4035896128 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/cellToCellStencil.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/cellToCellStencil.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/cellToCellStencil.H b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/cellToCellStencil.H index 458caa0a2c943d1f5fbfd90edaee25a6a8f6cfff..33781e3bf46fbedd737c7d195b9d9fa3970e9e9e 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/cellToCellStencil.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/cellToCellStencil.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -49,7 +49,7 @@ namespace Foam class polyMesh; /*---------------------------------------------------------------------------*\ - Class cellToCellStencil Declaration + Class cellToCellStencil Declaration \*---------------------------------------------------------------------------*/ class cellToCellStencil @@ -64,12 +64,6 @@ class cellToCellStencil const globalIndex globalNumbering_; - // Private Member Functions - - //- Disallow default bitwise assignment - void operator=(const cellToCellStencil&); - - protected: //- Merge two lists. diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCECCellToFaceStencilObject.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCECCellToFaceStencilObject.C index 0c5d4444b1496af324c58eb2e5bf0d2fb2fef845..e2e24f912b758d0d71320b9e01b9e3a9107667f8 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCECCellToFaceStencilObject.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCECCellToFaceStencilObject.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCECCellToFaceStencilObject.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCECCellToFaceStencilObject.H index 87daa487304d71d5b38b5e1e5f20610ea65cd0b9..d624066b855835302be43112b7ae872b1b86ce84 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCECCellToFaceStencilObject.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCECCellToFaceStencilObject.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,7 +43,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class centredCECCellToFaceStencilObject Declaration + Class centredCECCellToFaceStencilObject Declaration \*---------------------------------------------------------------------------*/ class centredCECCellToFaceStencilObject diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCFCCellToFaceStencilObject.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCFCCellToFaceStencilObject.C index 839175000f5111a85b035ceb219ad6dfff2281b3..7e077d500fbc62770637aadfa7523d4947970037 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCFCCellToFaceStencilObject.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCFCCellToFaceStencilObject.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCFCCellToFaceStencilObject.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCFCCellToFaceStencilObject.H index 78d587f8a5de3f0e967e55e049ab91f0b81c4284..5de1a9117de6761a94affcafb730ad0803af6e22 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCFCCellToFaceStencilObject.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCFCCellToFaceStencilObject.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,7 +43,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class centredCFCCellToFaceStencilObject Declaration + Class centredCFCCellToFaceStencilObject Declaration \*---------------------------------------------------------------------------*/ class centredCFCCellToFaceStencilObject diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCPCCellToFaceStencilObject.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCPCCellToFaceStencilObject.C index 3e955dfbf348a53efd1e3acd1f8bc204c580285d..4841e383987b3c73d5fc0b2dcc51e882cd8725be 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCPCCellToFaceStencilObject.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCPCCellToFaceStencilObject.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCPCCellToFaceStencilObject.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCPCCellToFaceStencilObject.H index 67d21d083d4b38e631e839c24df97c80909cad69..1139f6768315251a1d08fdfcbc880728fd507825 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCPCCellToFaceStencilObject.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCPCCellToFaceStencilObject.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,7 +43,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class centredCPCCellToFaceStencilObject Declaration + Class centredCPCCellToFaceStencilObject Declaration \*---------------------------------------------------------------------------*/ class centredCPCCellToFaceStencilObject diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredFECCellToFaceStencilObject.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredFECCellToFaceStencilObject.C index dc78b94bb98141c2fc1abb62222886d136e2f667..a8fb315f5014a0d99eb582b201b8f36e0117b6a9 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredFECCellToFaceStencilObject.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredFECCellToFaceStencilObject.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredFECCellToFaceStencilObject.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredFECCellToFaceStencilObject.H index e5a4011f344b458da4fc87254e9d0daf317599be..e953c6421d6e78c8ff13835496961d8c2ad5461e 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredFECCellToFaceStencilObject.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredFECCellToFaceStencilObject.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,7 +43,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class centredFECCellToFaceStencilObject Declaration + Class centredFECCellToFaceStencilObject Declaration \*---------------------------------------------------------------------------*/ class centredFECCellToFaceStencilObject diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/pureUpwindCFCCellToFaceStencilObject.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/pureUpwindCFCCellToFaceStencilObject.C index a15c868e3da7ae09122da4c6ffda9c85023e4eb8..81ea346b3747e395b086f95d14b0d7d38aaf5390 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/pureUpwindCFCCellToFaceStencilObject.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/pureUpwindCFCCellToFaceStencilObject.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/pureUpwindCFCCellToFaceStencilObject.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/pureUpwindCFCCellToFaceStencilObject.H index b09ef35c77f90bbd4bd38e050dfc9336f2c3a618..4965e2ed109bc6eec89319ccd2a234b50df2cebf 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/pureUpwindCFCCellToFaceStencilObject.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/pureUpwindCFCCellToFaceStencilObject.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCECCellToFaceStencilObject.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCECCellToFaceStencilObject.C index 21e9352e28cbf799dac3d189d2ccd47d0a2731d5..52c62dd0b956f70fbf428ce8e0cb4f1fed205369 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCECCellToFaceStencilObject.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCECCellToFaceStencilObject.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCECCellToFaceStencilObject.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCECCellToFaceStencilObject.H index 12c0aa658cb33ace7d86181e58f03001b7f2c3fa..0b51b1b6804017a87190a32fc449225c6cb1c2d5 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCECCellToFaceStencilObject.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCECCellToFaceStencilObject.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,7 +43,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class upwindCECCellToFaceStencilObject Declaration + Class upwindCECCellToFaceStencilObject Declaration \*---------------------------------------------------------------------------*/ class upwindCECCellToFaceStencilObject diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCFCCellToFaceStencilObject.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCFCCellToFaceStencilObject.C index 7402a71570cbc45a18c9359066a2cd617ec05cd5..5e8d703133a49f33f034292acf59c4cc9ae263f9 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCFCCellToFaceStencilObject.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCFCCellToFaceStencilObject.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCFCCellToFaceStencilObject.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCFCCellToFaceStencilObject.H index 5ad0f018e3d488838f995a021765556b5402bfc7..1dafb3d84a4f667ec664c8db7126bc8220ce3c3e 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCFCCellToFaceStencilObject.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCFCCellToFaceStencilObject.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,7 +43,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class upwindCFCCellToFaceStencilObject Declaration + Class upwindCFCCellToFaceStencilObject Declaration \*---------------------------------------------------------------------------*/ class upwindCFCCellToFaceStencilObject diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCPCCellToFaceStencilObject.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCPCCellToFaceStencilObject.C index bffd49b8780566dc603aaa33b72e16e60a278127..a0753ad3795e4b348b48cb83bcdb77e1a355a5b2 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCPCCellToFaceStencilObject.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCPCCellToFaceStencilObject.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCPCCellToFaceStencilObject.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCPCCellToFaceStencilObject.H index 7a3aa15195e60d41b735304d33b88d41f8ac5cb6..f5bf5c05bd1fd6372c42af62b6ca072275d24644 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCPCCellToFaceStencilObject.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCPCCellToFaceStencilObject.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,7 +43,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class upwindCPCCellToFaceStencilObject Declaration + Class upwindCPCCellToFaceStencilObject Declaration \*---------------------------------------------------------------------------*/ class upwindCPCCellToFaceStencilObject diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindFECCellToFaceStencilObject.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindFECCellToFaceStencilObject.C index eaa94dbba071003e55878d8131b0df15ab30e1e8..1522627bdad90a42ba40a6aa9a24395f05b420aa 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindFECCellToFaceStencilObject.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindFECCellToFaceStencilObject.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindFECCellToFaceStencilObject.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindFECCellToFaceStencilObject.H index bbe69305f67e3a367579c6b43e7cb1ca0fc0722a..a4773f73bde8feda1a936f5059526f377eea9c24 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindFECCellToFaceStencilObject.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindFECCellToFaceStencilObject.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,7 +43,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class upwindFECCellToFaceStencilObject Declaration + Class upwindFECCellToFaceStencilObject Declaration \*---------------------------------------------------------------------------*/ class upwindFECCellToFaceStencilObject diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencil.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencil.C index c82c81e7ab3be51e72ac70ede276816ebc7c0db8..328b5f1e8af5413a5c65d0a2251f0a826f534086 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencil.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencil.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencil.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencil.H index 374366d00ad2867caacfc9cc7a26696abc99fa55..0e6d5530ab4318a6618e79705a9401f342c7c592 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencil.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencil.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -60,7 +60,7 @@ namespace Foam class globalIndex; /*---------------------------------------------------------------------------*\ - Class extendedCellToFaceStencil Declaration + Class extendedCellToFaceStencil Declaration \*---------------------------------------------------------------------------*/ class extendedCellToFaceStencil @@ -72,21 +72,6 @@ protected: const polyMesh& mesh_; - // Protected Member Functions - - - -private: - - // Private Member Functions - - //- Disallow default bitwise copy construct - extendedCellToFaceStencil(const extendedCellToFaceStencil&); - - //- Disallow default bitwise assignment - void operator=(const extendedCellToFaceStencil&); - - protected: //- Write some statistics about stencil diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencilTemplates.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencilTemplates.C index c357bb59f72dc8eb4af232d16f296e442be503eb..f02b93cc3fd744c6748e6f073d500de0c4bd6935 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencilTemplates.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencilTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCentredCellToFaceStencil.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCentredCellToFaceStencil.C index 3fd5f7c911a51b58ecdec3c3df2e5c507b974894..805e6ebcdd15f2de2ce9e153904b806efaa3a883 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCentredCellToFaceStencil.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCentredCellToFaceStencil.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCentredCellToFaceStencil.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCentredCellToFaceStencil.H index ec4e0f26fe551a13f636362cc6594fa808f4b25c..ed081c46c313cb44f9910f8b2fd0540720c76f84 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCentredCellToFaceStencil.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCentredCellToFaceStencil.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -44,7 +44,7 @@ namespace Foam class cellToFaceStencil; /*---------------------------------------------------------------------------*\ - Class extendedCentredCellToFaceStencil Declaration + Class extendedCentredCellToFaceStencil Declaration \*---------------------------------------------------------------------------*/ class extendedCentredCellToFaceStencil diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedUpwindCellToFaceStencil.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedUpwindCellToFaceStencil.C index e647da8224056a987d996ca67e4fd3f58bfd3c7a..101c55a6b7a1c2bb3f31ecd490b8619cf3ade2df 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedUpwindCellToFaceStencil.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedUpwindCellToFaceStencil.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedUpwindCellToFaceStencil.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedUpwindCellToFaceStencil.H index f23d408b1c1887462f5fb69d50ec4af3ecda6cf8..0e35b9f5d317d71576abe737ae7cecbc38494ece 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedUpwindCellToFaceStencil.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedUpwindCellToFaceStencil.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -54,7 +54,7 @@ namespace Foam class cellToFaceStencil; /*---------------------------------------------------------------------------*\ - Class extendedUpwindCellToFaceStencil Declaration + Class extendedUpwindCellToFaceStencil Declaration \*---------------------------------------------------------------------------*/ class extendedUpwindCellToFaceStencil diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedUpwindCellToFaceStencilTemplates.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedUpwindCellToFaceStencilTemplates.C index 283b6547d5cfbfd0dc02d5fd23bf071aef244f0c..c9f8c83d7c91ae5c5214f0d9bdba30522763459c 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedUpwindCellToFaceStencilTemplates.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedUpwindCellToFaceStencilTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CECCellToFaceStencil.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CECCellToFaceStencil.C index 65bcfd50271e95bfb365c086382cff2f6e381725..6e05a51835c89b21334c05dfa673ff4588400833 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CECCellToFaceStencil.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CECCellToFaceStencil.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,7 +26,6 @@ License #include "CECCellToFaceStencil.H" #include "CECCellToCellStencil.H" -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CECCellToFaceStencil.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CECCellToFaceStencil.H index a47dc52890992fa17a5d5abc4019f48f2084290a..3ac5f17ca1c109769f71c9aea577433607e7967b 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CECCellToFaceStencil.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CECCellToFaceStencil.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,7 +43,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class CECCellToFaceStencil Declaration + Class CECCellToFaceStencil Declaration \*---------------------------------------------------------------------------*/ class CECCellToFaceStencil diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CFCCellToFaceStencil.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CFCCellToFaceStencil.C index 9a9df2881c3c7cea7c8241628b6d1a43745b2964..a618bad84cfe5f3fb93bdddec6b6224103b27766 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CFCCellToFaceStencil.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CFCCellToFaceStencil.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CFCCellToFaceStencil.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CFCCellToFaceStencil.H index 3fe614cb8d093d1e8715d700bf6e35171cb09cfd..4a4ebd16bd1701bd92c99a14b128b9698fdf2035 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CFCCellToFaceStencil.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CFCCellToFaceStencil.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,7 +43,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class CFCCellToFaceStencil Declaration + Class CFCCellToFaceStencil Declaration \*---------------------------------------------------------------------------*/ class CFCCellToFaceStencil @@ -55,7 +55,7 @@ public: // Constructors //- Construct from mesh - explicit CFCCellToFaceStencil(const polyMesh& mesh); + explicit CFCCellToFaceStencil(const polyMesh&); }; diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CPCCellToFaceStencil.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CPCCellToFaceStencil.C index e0efc5b6f59c35b58a9944cf4396b8ebffb299b1..0e43ccf1eef6aba85e3f75403898c17b373647a5 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CPCCellToFaceStencil.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CPCCellToFaceStencil.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CPCCellToFaceStencil.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CPCCellToFaceStencil.H index a9f7fc6c6603008327902982e4622af1798a3f0f..9a9cea8e3e2840b621dbe29d6433b8f46882df04 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CPCCellToFaceStencil.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CPCCellToFaceStencil.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,7 +43,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class CPCCellToFaceStencil Declaration + Class CPCCellToFaceStencil Declaration \*---------------------------------------------------------------------------*/ class CPCCellToFaceStencil diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/FECCellToFaceStencil.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/FECCellToFaceStencil.C index 7630b30f871611f59e24fe776e54177d97a81974..caf3e462c9f955bfb4854b7d90d84cecc2177696 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/FECCellToFaceStencil.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/FECCellToFaceStencil.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/FECCellToFaceStencil.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/FECCellToFaceStencil.H index b7dbc24dc94b3647824ac5f3b54604ec5839db20..edacad1760999f539380ceac82b1ec52f7d6fddb 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/FECCellToFaceStencil.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/FECCellToFaceStencil.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -44,7 +44,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class FECCellToFaceStencil Declaration + Class FECCellToFaceStencil Declaration \*---------------------------------------------------------------------------*/ class FECCellToFaceStencil diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/cellToFaceStencil.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/cellToFaceStencil.C index 1d2308999d57f4a1064549664f55a610be90e351..ac5e24ab75b3070454c5ed7f538436d01d23d604 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/cellToFaceStencil.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/cellToFaceStencil.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/cellToFaceStencil.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/cellToFaceStencil.H index eed39fbacd842622d93dfcea1b8d7ec69b414ea8..aabba8fefd2de66b154fd9985932c7b4c3132b09 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/cellToFaceStencil.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/cellToFaceStencil.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,7 +25,7 @@ Class Foam::cellToFaceStencil Description - baseclass for extended cell-to-facel stencils (face values from + Base class for extended cell-to-face stencils (face values from neighbouring cells) SourceFiles @@ -49,7 +49,7 @@ namespace Foam class polyMesh; /*---------------------------------------------------------------------------*\ - Class cellToFaceStencil Declaration + Class cellToFaceStencil Declaration \*---------------------------------------------------------------------------*/ class cellToFaceStencil @@ -64,15 +64,6 @@ class cellToFaceStencil const globalIndex globalNumbering_; - // Private Member Functions - - //- Disallow default bitwise copy construct - cellToFaceStencil(const cellToFaceStencil&); - - //- Disallow default bitwise assignment - void operator=(const cellToFaceStencil&); - - protected: //- Merge two lists. diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/MeshObjects/centredCFCFaceToCellStencilObject.C b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/MeshObjects/centredCFCFaceToCellStencilObject.C index 8edf92b2884f55c909d2e340f48d938b6b4d99ee..c61e54f42eee2e9cbaa8acb798e65ef0a87c78d0 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/MeshObjects/centredCFCFaceToCellStencilObject.C +++ b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/MeshObjects/centredCFCFaceToCellStencilObject.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/MeshObjects/centredCFCFaceToCellStencilObject.H b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/MeshObjects/centredCFCFaceToCellStencilObject.H index 2eb784cd5c6c1cd0b1a1edd03eb95da12b9629e8..6263d4d574b2e1d3add2e6eff4775ecb2ca3b546 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/MeshObjects/centredCFCFaceToCellStencilObject.H +++ b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/MeshObjects/centredCFCFaceToCellStencilObject.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,7 +43,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class centredCFCFaceToCellStencilObject Declaration + Class centredCFCFaceToCellStencilObject Declaration \*---------------------------------------------------------------------------*/ class centredCFCFaceToCellStencilObject diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedCentredFaceToCellStencil.C b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedCentredFaceToCellStencil.C index d241b34343c4a74f81c2c9c4c1ad675e1bc8d5cd..46e20fc6bc51275dd0713212dd9c1f9d79e0a460 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedCentredFaceToCellStencil.C +++ b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedCentredFaceToCellStencil.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedCentredFaceToCellStencil.H b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedCentredFaceToCellStencil.H index 027249b82d87a958cadb593e28ccdba43e45a55e..135442e293ee06f88d11675d0700e43b99ed6507 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedCentredFaceToCellStencil.H +++ b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedCentredFaceToCellStencil.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -44,7 +44,7 @@ namespace Foam class faceToCellStencil; /*---------------------------------------------------------------------------*\ - Class extendedCentredFaceToCellStencil Declaration + Class extendedCentredFaceToCellStencil Declaration \*---------------------------------------------------------------------------*/ class extendedCentredFaceToCellStencil diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencil.C b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencil.C index 6eda5dfab1839c14540d7de5c0bbc7664c8fdfb7..0ffaf74a559481e43b1743bfb953f972e9d3c911 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencil.C +++ b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencil.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencil.H b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencil.H index fe5b2ff87d1f3b96f0eb6a5517b1fe989535cc90..20b862816c8092a24eec103bb2482b66cb0c0068 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencil.H +++ b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencil.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -49,7 +49,7 @@ namespace Foam class globalIndex; /*---------------------------------------------------------------------------*\ - Class extendedFaceToCellStencil Declaration + Class extendedFaceToCellStencil Declaration \*---------------------------------------------------------------------------*/ class extendedFaceToCellStencil @@ -60,17 +60,6 @@ protected: const polyMesh& mesh_; -private: - - // Private Member Functions - - //- Disallow default bitwise copy construct - extendedFaceToCellStencil(const extendedFaceToCellStencil&); - - //- Disallow default bitwise assignment - void operator=(const extendedFaceToCellStencil&); - - public: // Constructors diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencilTemplates.C b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencilTemplates.C index d7bede746b3550309addcdf79966b3665544c04f..68f843736955589de1a24c7a761f7a752c1b50df 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencilTemplates.C +++ b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencilTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/fullStencils/CFCFaceToCellStencil.C b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/fullStencils/CFCFaceToCellStencil.C index 6cb25cb064964fa4776f50497a9b683d2994b72c..9b42c34cfb5dbe48433abd796e1e9d0f0e1e019f 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/fullStencils/CFCFaceToCellStencil.C +++ b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/fullStencils/CFCFaceToCellStencil.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/fullStencils/CFCFaceToCellStencil.H b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/fullStencils/CFCFaceToCellStencil.H index 5bc993d1c8d9f79e34374aac6518bb733a6a456c..1397b398c62e4669d9f98c53f5b16c9cc6a75edf 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/fullStencils/CFCFaceToCellStencil.H +++ b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/fullStencils/CFCFaceToCellStencil.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -42,7 +42,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class CFCFaceToCellStencil Declaration + Class CFCFaceToCellStencil Declaration \*---------------------------------------------------------------------------*/ class CFCFaceToCellStencil @@ -61,7 +61,7 @@ public: // Constructors //- Construct from mesh - explicit CFCFaceToCellStencil(const polyMesh& mesh); + explicit CFCFaceToCellStencil(const polyMesh&); }; diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/fullStencils/faceToCellStencil.C b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/fullStencils/faceToCellStencil.C index 29b354a47024b3197b33ca6b72d5f476446ffe87..e1ac4edf705fb11677f1a23c72f4f023c7d86a88 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/fullStencils/faceToCellStencil.C +++ b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/fullStencils/faceToCellStencil.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/fullStencils/faceToCellStencil.H b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/fullStencils/faceToCellStencil.H index c89f95775597901c82984dfa74ebccdb25960157..3df34dd1309d56c2c8db4c23bdbece08c326f4e6 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/fullStencils/faceToCellStencil.H +++ b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/fullStencils/faceToCellStencil.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -49,7 +49,7 @@ namespace Foam class polyMesh; /*---------------------------------------------------------------------------*\ - Class faceToCellStencil Declaration + Class faceToCellStencil Declaration \*---------------------------------------------------------------------------*/ class faceToCellStencil @@ -63,15 +63,6 @@ class faceToCellStencil //- Global numbering for faces const globalIndex globalNumbering_; - - // Private Member Functions - - //- Disallow default bitwise copy construct - faceToCellStencil(const faceToCellStencil&); - - //- Disallow default bitwise assignment - void operator=(const faceToCellStencil&); - public: // Constructors diff --git a/src/finiteVolume/fvMesh/fvMeshLduAddressing.H b/src/finiteVolume/fvMesh/fvMeshLduAddressing.H index 20954aeb36e6077af247622fc2212db0f7338498..836672c90b0993c6698547b9b9855474ca05aa9b 100644 --- a/src/finiteVolume/fvMesh/fvMeshLduAddressing.H +++ b/src/finiteVolume/fvMesh/fvMeshLduAddressing.H @@ -60,7 +60,7 @@ class fvMeshLduAddressing const labelList& upperAddr_; //- Patch addressing as a list of sublists - List<const unallocLabelList*> patchAddr_; + List<const labelUList*> patchAddr_; //- Patch field evaluation schedule const lduSchedule& patchSchedule_; diff --git a/src/finiteVolume/fvMesh/fvPatches/constraint/cyclic/cyclicFvPatch.C b/src/finiteVolume/fvMesh/fvPatches/constraint/cyclic/cyclicFvPatch.C index bdf117c3a5683a051c93a926a86b54ae9de1e67d..89149a06b7424623b1c8e19963044ba757446966 100644 --- a/src/finiteVolume/fvMesh/fvPatches/constraint/cyclic/cyclicFvPatch.C +++ b/src/finiteVolume/fvMesh/fvPatches/constraint/cyclic/cyclicFvPatch.C @@ -28,29 +28,27 @@ License #include "fvMesh.H" #include "transform.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -defineTypeNameAndDebug(cyclicFvPatch, 0); -addToRunTimeSelectionTable(fvPatch, cyclicFvPatch, polyPatch); + defineTypeNameAndDebug(cyclicFvPatch, 0); + addToRunTimeSelectionTable(fvPatch, cyclicFvPatch, polyPatch); +} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // Make patch weighting factors -void cyclicFvPatch::makeWeights(scalarField& w) const +void Foam::cyclicFvPatch::makeWeights(scalarField& w) const { const cyclicFvPatch& nbrPatch = neighbFvPatch(); const scalarField& magFa = magSf(); const scalarField& nbrMagFa = nbrPatch.magSf(); - scalarField deltas = nf() & fvPatch::delta(); - scalarField nbrDeltas = nbrPatch.nf() & nbrPatch.fvPatch::delta(); + const scalarField deltas(nf() & fvPatch::delta()); + const scalarField nbrDeltas(nbrPatch.nf() & nbrPatch.fvPatch::delta()); forAll(magFa, facei) { @@ -58,7 +56,7 @@ void cyclicFvPatch::makeWeights(scalarField& w) const if (mag(magFa[facei] - nbrMagFa[facei])/avFa > 1e-4) { - FatalErrorIn("cyclicFvPatch::makeWeights(scalarField& w) const") + FatalErrorIn("cyclicFvPatch::makeWeights(scalarField&) const") << "face " << facei << " areas do not match by " << 100*mag(magFa[facei] - nbrMagFa[facei])/avFa << "% -- possible face ordering problem" @@ -74,13 +72,13 @@ void cyclicFvPatch::makeWeights(scalarField& w) const // Make patch face - neighbour cell distances -void cyclicFvPatch::makeDeltaCoeffs(scalarField& dc) const +void Foam::cyclicFvPatch::makeDeltaCoeffs(scalarField& dc) const { //const cyclicPolyPatch& nbrPatch = cyclicPolyPatch_.neighbPatch(); const cyclicFvPatch& nbrPatch = neighbFvPatch(); - scalarField deltas = nf() & fvPatch::delta(); - scalarField nbrDeltas = nbrPatch.nf() & nbrPatch.fvPatch::delta(); + const scalarField deltas(nf() & fvPatch::delta()); + const scalarField nbrDeltas(nbrPatch.nf() & nbrPatch.fvPatch::delta()); forAll(deltas, facei) { @@ -93,10 +91,10 @@ void cyclicFvPatch::makeDeltaCoeffs(scalarField& dc) const // Return delta (P to N) vectors across coupled patch -tmp<vectorField> cyclicFvPatch::delta() const +Foam::tmp<Foam::vectorField> Foam::cyclicFvPatch::delta() const { - vectorField patchD = fvPatch::delta(); - vectorField nbrPatchD = neighbFvPatch().fvPatch::delta(); + const vectorField patchD(fvPatch::delta()); + const vectorField nbrPatchD(neighbFvPatch().fvPatch::delta()); tmp<vectorField> tpdv(new vectorField(patchD.size())); vectorField& pdv = tpdv(); @@ -127,7 +125,7 @@ tmp<vectorField> cyclicFvPatch::delta() const } -tmp<labelField> cyclicFvPatch::interfaceInternalField +Foam::tmp<Foam::labelField> Foam::cyclicFvPatch::interfaceInternalField ( const labelUList& internalData ) const @@ -136,7 +134,7 @@ tmp<labelField> cyclicFvPatch::interfaceInternalField } -tmp<labelField> cyclicFvPatch::internalFieldTransfer +Foam::tmp<Foam::labelField> Foam::cyclicFvPatch::internalFieldTransfer ( const Pstream::commsTypes commsType, const labelUList& iF @@ -146,8 +144,4 @@ tmp<labelField> cyclicFvPatch::internalFieldTransfer } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatchFvMeshTemplates.C b/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatchFvMeshTemplates.C index 127ea953487df830eed78c5dcdafa0a84d2f9692..f1ee779d3a9b064b188b630e3db20fadc476080f 100644 --- a/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatchFvMeshTemplates.C +++ b/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatchFvMeshTemplates.C @@ -37,7 +37,8 @@ const typename GeometricField::PatchFieldType& Foam::fvPatch::lookupPatchField { return patchField<GeometricField, Type> ( - boundaryMesh().mesh().objectRegistry::lookupObject<GeometricField>(name) + boundaryMesh().mesh().objectRegistry::template + lookupObject<GeometricField>(name) ); } diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/LimitedScheme/LimitFuncs.C b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/LimitedScheme/LimitFuncs.C index cdcabd8dc98bee702a70ffceab408f1c7000d423..cc86a89b7e4ba62cf77c4e2db26e1aebb346b671 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/LimitedScheme/LimitFuncs.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/LimitedScheme/LimitFuncs.C @@ -72,7 +72,7 @@ inline tmp<volScalarField> rhoMagSqr<Type>::operator() ) const { const volScalarField& rho = - phi.db().objectRegistry::lookupObject<volScalarField>("rho"); + phi.db().objectRegistry::template lookupObject<volScalarField>("rho"); return Foam::magSqr(phi/rho); } diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/LimitedScheme/LimitedScheme.C b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/LimitedScheme/LimitedScheme.C index be8ca144ae695ab1d5e4786ec0d49b3e2704437c..8c875bc67ec99e5327e8c75f0c8bce9341f904fa 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/LimitedScheme/LimitedScheme.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/LimitedScheme/LimitedScheme.C @@ -30,13 +30,9 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -namespace Foam -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - template<class Type, class Limiter, template<class> class LimitFunc> -tmp<surfaceScalarField> LimitedScheme<Type, Limiter, LimitFunc>::limiter +Foam::tmp<Foam::surfaceScalarField> +Foam::LimitedScheme<Type, Limiter, LimitFunc>::limiter ( const GeometricField<Type, fvPatchField, volMesh>& phi ) const @@ -107,22 +103,33 @@ tmp<surfaceScalarField> LimitedScheme<Type, Limiter, LimitFunc>::limiter const scalarField& pCDweights = CDweights.boundaryField()[patchi]; const scalarField& pFaceFlux = this->faceFlux_.boundaryField()[patchi]; - Field<typename Limiter::phiType> plPhiP = - lPhi.boundaryField()[patchi].patchInternalField(); - Field<typename Limiter::phiType> plPhiN = - lPhi.boundaryField()[patchi].patchNeighbourField(); - Field<typename Limiter::gradPhiType> pGradcP = - gradc.boundaryField()[patchi].patchInternalField(); - Field<typename Limiter::gradPhiType> pGradcN = - gradc.boundaryField()[patchi].patchNeighbourField(); + + const Field<typename Limiter::phiType> plPhiP + ( + lPhi.boundaryField()[patchi].patchInternalField() + ); + const Field<typename Limiter::phiType> plPhiN + ( + lPhi.boundaryField()[patchi].patchNeighbourField() + ); + const Field<typename Limiter::gradPhiType> pGradcP + ( + gradc.boundaryField()[patchi].patchInternalField() + ); + const Field<typename Limiter::gradPhiType> pGradcN + ( + gradc.boundaryField()[patchi].patchNeighbourField() + ); // Build the d-vectors - vectorField pd = + vectorField pd + ( mesh.Sf().boundaryField()[patchi] - /( - mesh.magSf().boundaryField()[patchi] - *mesh.deltaCoeffs().boundaryField()[patchi] - ); + / ( + mesh.magSf().boundaryField()[patchi] + * mesh.deltaCoeffs().boundaryField()[patchi] + ) + ); if (!mesh.orthogonal()) { @@ -154,8 +161,4 @@ tmp<surfaceScalarField> LimitedScheme<Type, Limiter, LimitFunc>::limiter } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/PhiScheme/PhiScheme.C b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/PhiScheme/PhiScheme.C index 8df15c9726d0d466a0680251d0fa2afe0ab571b8..84586c4c3a49f8708fe38c1023270f578154a0e4 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/PhiScheme/PhiScheme.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/PhiScheme/PhiScheme.C @@ -31,13 +31,9 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -namespace Foam -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - template<class Type, class PhiLimiter> -tmp<surfaceScalarField> PhiScheme<Type, PhiLimiter>::limiter +Foam::tmp<Foam::surfaceScalarField> +Foam::PhiScheme<Type, PhiLimiter>::limiter ( const GeometricField<Type, fvPatchField, volMesh>& phi ) const @@ -73,7 +69,9 @@ tmp<surfaceScalarField> PhiScheme<Type, PhiLimiter>::limiter if (this->faceFlux_.dimensions() == dimDensity*dimVelocity*dimArea) { const volScalarField& rho = - phi.db().objectRegistry::lookupObject<volScalarField>("rho"); + phi.db().objectRegistry::template lookupObject<volScalarField> + ("rho"); + tUflux = this->faceFlux_/fvc::interpolate(rho); } else if (this->faceFlux_.dimensions() != dimVelocity*dimArea) @@ -117,10 +115,15 @@ tmp<surfaceScalarField> PhiScheme<Type, PhiLimiter>::limiter const vectorField& pSf = Sf.boundaryField()[patchI]; const scalarField& pmagSf = magSf.boundaryField()[patchI]; const scalarField& pFaceFlux = Uflux.boundaryField()[patchI]; - Field<Type> pphiP = - phi.boundaryField()[patchI].patchInternalField(); - Field<Type> pphiN = - phi.boundaryField()[patchI].patchNeighbourField(); + + const Field<Type> pphiP + ( + phi.boundaryField()[patchI].patchInternalField() + ); + const Field<Type> pphiN + ( + phi.boundaryField()[patchI].patchNeighbourField() + ); forAll(pLimiter, face) { @@ -145,8 +148,4 @@ tmp<surfaceScalarField> PhiScheme<Type, PhiLimiter>::limiter } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/limitedSurfaceInterpolationScheme/limitedSurfaceInterpolationScheme.C b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/limitedSurfaceInterpolationScheme/limitedSurfaceInterpolationScheme.C index 22ced8af7376466dcccb0f17f75c06865fd922de..f804ef8271c964f7ebc48aea7f4a079ab26ef6cd 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/limitedSurfaceInterpolationScheme/limitedSurfaceInterpolationScheme.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/limitedSurfaceInterpolationScheme/limitedSurfaceInterpolationScheme.C @@ -215,7 +215,7 @@ limitedSurfaceInterpolationScheme<Type>::flux const GeometricField<Type, fvPatchField, volMesh>& phi ) const { - return faceFlux_*interpolate(phi); + return faceFlux_*this->interpolate(phi); } diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/linearUpwind/linearUpwind.C b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/linearUpwind/linearUpwind.C index 07f81f4ab361995e4219e6a6aa8fa323f1ef2529..a706a8df51b5215215a16955df9eb0dbed9ab216 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/linearUpwind/linearUpwind.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/linearUpwind/linearUpwind.C @@ -114,16 +114,20 @@ Foam::linearUpwind<Type>::correction const scalarField& pFaceFlux = faceFlux.boundaryField()[patchi]; - Field<typename outerProduct<vector, Type>::type> pGradVfNei = - gradVf.boundaryField()[patchi].patchNeighbourField(); + const Field<typename outerProduct<vector, Type>::type> pGradVfNei + ( + gradVf.boundaryField()[patchi].patchNeighbourField() + ); // Build the d-vectors - vectorField pd = + vectorField pd + ( mesh.Sf().boundaryField()[patchi] - /( - mesh.magSf().boundaryField()[patchi] - *mesh.deltaCoeffs().boundaryField()[patchi] - ); + / ( + mesh.magSf().boundaryField()[patchi] + * mesh.deltaCoeffs().boundaryField()[patchi] + ) + ); if (!mesh.orthogonal()) { diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/multivariateSchemes/multivariateScheme/multivariateScheme.C b/src/finiteVolume/interpolation/surfaceInterpolation/multivariateSchemes/multivariateScheme/multivariateScheme.C index a11c25efe6d06ce60f44bd529504592cf4f1a96f..d4c22ff7f9d2d1cbfd282ff47713ddeaf253e83f 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/multivariateSchemes/multivariateScheme/multivariateScheme.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/multivariateSchemes/multivariateScheme/multivariateScheme.C @@ -29,13 +29,8 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -namespace Foam -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - template<class Type, class Scheme> -multivariateScheme<Type, Scheme>::multivariateScheme +Foam::multivariateScheme<Type, Scheme>::multivariateScheme ( const fvMesh& mesh, const typename multivariateSurfaceInterpolationScheme<Type>:: @@ -68,8 +63,10 @@ multivariateScheme<Type, Scheme>::multivariateScheme typename multivariateSurfaceInterpolationScheme<Type>:: fieldTable::const_iterator iter = this->fields().begin(); - surfaceScalarField limiter = - Scheme(mesh, faceFlux_, *this).limiter(*iter()); + surfaceScalarField limiter + ( + Scheme(mesh, faceFlux_, *this).limiter(*iter()) + ); for (++iter; iter != this->fields().end(); ++iter) { @@ -86,8 +83,4 @@ multivariateScheme<Type, Scheme>::multivariateScheme } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/multivariateSchemes/multivariateSelectionScheme/multivariateSelectionScheme.C b/src/finiteVolume/interpolation/surfaceInterpolation/multivariateSchemes/multivariateSelectionScheme/multivariateSelectionScheme.C index 0387966fc36f76de2c5ee7cb99bcf912ac8db996..e371d531f92067f8217309de108c08186a2d24e8 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/multivariateSchemes/multivariateSelectionScheme/multivariateSelectionScheme.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/multivariateSchemes/multivariateSelectionScheme/multivariateSelectionScheme.C @@ -29,15 +29,11 @@ License #include "surfaceFields.H" #include "upwind.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // template<class Type> -multivariateSelectionScheme<Type>::multivariateSelectionScheme +Foam::multivariateSelectionScheme<Type>::multivariateSelectionScheme ( const fvMesh& mesh, const typename multivariateSurfaceInterpolationScheme<Type>:: @@ -70,7 +66,7 @@ multivariateSelectionScheme<Type>::multivariateSelectionScheme typename multivariateSurfaceInterpolationScheme<Type>:: fieldTable::const_iterator iter = this->fields().begin(); - surfaceScalarField limiter = + surfaceScalarField limiter ( limitedSurfaceInterpolationScheme<Type>::New ( @@ -100,8 +96,4 @@ multivariateSelectionScheme<Type>::multivariateSelectionScheme } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/multivariateSchemes/multivariateSurfaceInterpolationScheme/multivariateSurfaceInterpolationScheme.H b/src/finiteVolume/interpolation/surfaceInterpolation/multivariateSchemes/multivariateSurfaceInterpolationScheme/multivariateSurfaceInterpolationScheme.H index 3aae3ea0f95721b4d93fc5e0ba397b10d9169ae8..b5a2f808a505f917f6fcf5eb0076a305bcacd898 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/multivariateSchemes/multivariateSurfaceInterpolationScheme/multivariateSurfaceInterpolationScheme.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/multivariateSchemes/multivariateSurfaceInterpolationScheme/multivariateSurfaceInterpolationScheme.H @@ -67,7 +67,7 @@ public: void add(const GeometricField<Type, fvPatchField, volMesh>& f) { - insert(f.name(), &f); + this->insert(f.name(), &f); } }; diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/cubic/cubic.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/cubic/cubic.H index ab8f8a30cbb0af2a5bf0bb0556f242d17cd00804..c77e2a5284b7f822cfdfa76682843db70fca5cd2 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/cubic/cubic.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/cubic/cubic.H @@ -118,11 +118,13 @@ public: // calculate the appropriate interpolation factors const surfaceScalarField& lambda = mesh.weights(); - surfaceScalarField kSc = - lambda*(scalar(1) - lambda*(scalar(3) - scalar(2)*lambda)); + const surfaceScalarField kSc + ( + lambda*(scalar(1) - lambda*(scalar(3) - scalar(2)*lambda)) + ); - surfaceScalarField kVecP = sqr(scalar(1) - lambda)*lambda; - surfaceScalarField kVecN = sqr(lambda)*(lambda - scalar(1)); + const surfaceScalarField kVecP(sqr(scalar(1) - lambda)*lambda); + const surfaceScalarField kVecN(sqr(lambda)*(lambda - scalar(1))); tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > tsfCorr ( diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/limiterBlended/limiterBlended.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/limiterBlended/limiterBlended.H index 965e65afa919bc0a46d807a69b72fa0f57b23007..67fe74cf327b0ce4e9d8dc32af337171bb4143eb 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/limiterBlended/limiterBlended.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/limiterBlended/limiterBlended.H @@ -138,8 +138,10 @@ public: const GeometricField<Type, fvPatchField, volMesh>& vf ) const { - surfaceScalarField blendingFactor = - tLimitedScheme_().limiter(vf); + surfaceScalarField blendingFactor + ( + tLimitedScheme_().limiter(vf) + ); return blendingFactor*tScheme1_().weights(vf) @@ -151,8 +153,10 @@ public: tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > interpolate(const GeometricField<Type, fvPatchField, volMesh>& vf) const { - surfaceScalarField blendingFactor = - tLimitedScheme_().limiter(vf); + surfaceScalarField blendingFactor + ( + tLimitedScheme_().limiter(vf) + ); return blendingFactor*tScheme1_().interpolate(vf) @@ -175,8 +179,10 @@ public: const GeometricField<Type, fvPatchField, volMesh>& vf ) const { - surfaceScalarField blendingFactor = - tLimitedScheme_().limiter(vf); + surfaceScalarField blendingFactor + ( + tLimitedScheme_().limiter(vf) + ); if (tScheme1_().corrected()) { diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/localBlended/localBlended.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/localBlended/localBlended.H index 9be5eaf087c1c531d2944e1ac40dd18c99c89a05..38c5205c3267b855c1e0b7a3482c648c92aadb4d 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/localBlended/localBlended.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/localBlended/localBlended.H @@ -124,7 +124,7 @@ public: ) const { const surfaceScalarField& blendingFactor = - this->mesh().objectRegistry:: + this->mesh().objectRegistry::template lookupObject<const surfaceScalarField> ( word(vf.name() + "BlendingFactor") @@ -142,7 +142,7 @@ public: { const surfaceScalarField& blendingFactor = ( - this->mesh().objectRegistry:: + this->mesh().objectRegistry::template lookupObject<const surfaceScalarField> ( word(vf.name() + "BlendingFactor") @@ -171,7 +171,7 @@ public: ) const { const surfaceScalarField& blendingFactor = - this->mesh().objectRegistry:: + this->mesh().objectRegistry::template lookupObject<const surfaceScalarField> ( word(vf.name() + "BlendingFactor") diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/skewCorrected/skewCorrectionVectors.C b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/skewCorrected/skewCorrectionVectors.C index f434d6e62bb3491c3ece4fff3ccf603d71307159..7e06bb2037448eb4bbb7b079ddd7c15f9e53f41a 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/skewCorrected/skewCorrectionVectors.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/skewCorrected/skewCorrectionVectors.C @@ -84,7 +84,7 @@ void Foam::skewCorrectionVectors::makeSkewCorrectionVectors() const const labelUList& owner = mesh_.owner(); // Build the d-vectors - surfaceVectorField d = Sf/(mesh_.magSf()*mesh_.deltaCoeffs()); + surfaceVectorField d(Sf/(mesh_.magSf()*mesh_.deltaCoeffs())); if (!mesh_.orthogonal()) { diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/weighted/weighted.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/weighted/weighted.H index 6e540fee3a88ecc48255b6188b01b314d62d09df..d51433a3e3c90b596e14e3f0af28a7791f2920ef 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/weighted/weighted.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/weighted/weighted.H @@ -84,8 +84,11 @@ public: surfaceInterpolationScheme<Type>(mesh), weights_ ( - this->mesh().objectRegistry:: - lookupObject<const surfaceScalarField>(word(is)) + this->mesh().objectRegistry::template + lookupObject<const surfaceScalarField> + ( + word(is) + ) ) {} @@ -100,7 +103,7 @@ public: surfaceInterpolationScheme<Type>(mesh), weights_ ( - this->mesh().objectRegistry:: + this->mesh().objectRegistry::template lookupObject<const surfaceScalarField> ( word(is) diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolation.C b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolation.C index 543b6932c3f62e0e13d6c4addc029c3a9ad98e54..f8fd44dec56dfc2adbf2abafe2453b3e1c24da16 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolation.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolation.C @@ -321,7 +321,7 @@ void surfaceInterpolation::makeCorrectionVectors() const const fvPatch& p = patchcorrVecs.patch(); - vectorField patchDeltas = mesh_.boundary()[patchi].delta(); + const vectorField patchDeltas(mesh_.boundary()[patchi].delta()); forAll(p, patchFacei) { diff --git a/src/fvMotionSolver/fvMotionSolvers/displacement/SBRStress/displacementSBRStressFvMotionSolver.C b/src/fvMotionSolver/fvMotionSolvers/displacement/SBRStress/displacementSBRStressFvMotionSolver.C index a975995f9678328329e01571c404f54dda613fea..cf071879ffc94ba0ca8965e781418d35a3ad9e57 100644 --- a/src/fvMotionSolver/fvMotionSolvers/displacement/SBRStress/displacementSBRStressFvMotionSolver.C +++ b/src/fvMotionSolver/fvMotionSolvers/displacement/SBRStress/displacementSBRStressFvMotionSolver.C @@ -134,9 +134,9 @@ void Foam::displacementSBRStressFvMotionSolver::solve() diffusivityPtr_->correct(); pointDisplacement_.boundaryField().updateCoeffs(); - surfaceScalarField Df = diffusivityPtr_->operator()(); + surfaceScalarField Df(diffusivityPtr_->operator()()); - volTensorField gradCd = fvc::grad(cellDisplacement_); + volTensorField gradCd(fvc::grad(cellDisplacement_)); Foam::solve ( diff --git a/src/fvMotionSolver/fvMotionSolvers/displacement/interpolation/displacementInterpolationFvMotionSolver.C b/src/fvMotionSolver/fvMotionSolvers/displacement/interpolation/displacementInterpolationFvMotionSolver.C index 38fee1fb4fdd7fb1cc9a80f45fc877d2aec693c9..a1b1b9b3d7c86680d03a95fcc68fe9e5f3c86c2f 100644 --- a/src/fvMotionSolver/fvMotionSolvers/displacement/interpolation/displacementInterpolationFvMotionSolver.C +++ b/src/fvMotionSolver/fvMotionSolvers/displacement/interpolation/displacementInterpolationFvMotionSolver.C @@ -180,7 +180,7 @@ displacementInterpolationFvMotionSolver zoneCoordinates.last() += SMALL; // Check if we have static min and max mesh bounds - const scalarField meshCoords = points0().component(dir); + const scalarField meshCoords(points0().component(dir)); scalar minCoord = gMin(meshCoords); scalar maxCoord = gMax(meshCoords); diff --git a/src/fvMotionSolver/fvPatchFields/derived/cellMotion/cellMotionFvPatchField.C b/src/fvMotionSolver/fvPatchFields/derived/cellMotion/cellMotionFvPatchField.C index b01da6b6211e417a4527c42a0129008d48ccc623..f0a97e2805c571f5f5e339244a2d02e7aaf5921a 100644 --- a/src/fvMotionSolver/fvPatchFields/derived/cellMotion/cellMotionFvPatchField.C +++ b/src/fvMotionSolver/fvPatchFields/derived/cellMotion/cellMotionFvPatchField.C @@ -28,15 +28,11 @@ License #include "volMesh.H" #include "pointFields.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class Type> -cellMotionFvPatchField<Type>::cellMotionFvPatchField +Foam::cellMotionFvPatchField<Type>::cellMotionFvPatchField ( const fvPatch& p, const DimensionedField<Type, volMesh>& iF @@ -47,7 +43,7 @@ cellMotionFvPatchField<Type>::cellMotionFvPatchField template<class Type> -cellMotionFvPatchField<Type>::cellMotionFvPatchField +Foam::cellMotionFvPatchField<Type>::cellMotionFvPatchField ( const cellMotionFvPatchField<Type>& ptf, const fvPatch& p, @@ -60,7 +56,7 @@ cellMotionFvPatchField<Type>::cellMotionFvPatchField template<class Type> -cellMotionFvPatchField<Type>::cellMotionFvPatchField +Foam::cellMotionFvPatchField<Type>::cellMotionFvPatchField ( const fvPatch& p, const DimensionedField<Type, volMesh>& iF, @@ -74,7 +70,7 @@ cellMotionFvPatchField<Type>::cellMotionFvPatchField template<class Type> -cellMotionFvPatchField<Type>::cellMotionFvPatchField +Foam::cellMotionFvPatchField<Type>::cellMotionFvPatchField ( const cellMotionFvPatchField<Type>& ptf ) @@ -84,7 +80,7 @@ cellMotionFvPatchField<Type>::cellMotionFvPatchField template<class Type> -cellMotionFvPatchField<Type>::cellMotionFvPatchField +Foam::cellMotionFvPatchField<Type>::cellMotionFvPatchField ( const cellMotionFvPatchField<Type>& ptf, const DimensionedField<Type, volMesh>& iF @@ -97,7 +93,7 @@ cellMotionFvPatchField<Type>::cellMotionFvPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class Type> -void cellMotionFvPatchField<Type>::updateCoeffs() +void Foam::cellMotionFvPatchField<Type>::updateCoeffs() { if (this->updated()) { @@ -113,11 +109,9 @@ void cellMotionFvPatchField<Type>::updateCoeffs() pfName.replace("cell", "point"); const GeometricField<Type, pointPatchField, pointMesh>& pointMotion = - this->db().objectRegistry:: - lookupObject<GeometricField<Type, pointPatchField, pointMesh> > - ( - pfName - ); + this->db().objectRegistry::template + lookupObject<GeometricField<Type, pointPatchField, pointMesh> > + (pfName); forAll(p, i) { @@ -129,15 +123,10 @@ void cellMotionFvPatchField<Type>::updateCoeffs() template<class Type> -void cellMotionFvPatchField<Type>::write(Ostream& os) const +void Foam::cellMotionFvPatchField<Type>::write(Ostream& os) const { fvPatchField<Type>::write(os); this->writeEntry("value", os); } - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/fvMotionSolver/fvPatchFields/derived/cellMotion/cellMotionFvPatchFields.H b/src/fvMotionSolver/fvPatchFields/derived/cellMotion/cellMotionFvPatchFields.H index 316ca9f6cf9053c7b59aa794d91f4a5f20917e53..c5d93e15b26180dedf3f35aaff4427be9209ba06 100644 --- a/src/fvMotionSolver/fvPatchFields/derived/cellMotion/cellMotionFvPatchFields.H +++ b/src/fvMotionSolver/fvPatchFields/derived/cellMotion/cellMotionFvPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(cellMotion) +makePatchTypeFieldTypedefs(cellMotion); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/fvMotionSolver/fvPatchFields/derived/cellMotion/cellMotionFvPatchFieldsFwd.H b/src/fvMotionSolver/fvPatchFields/derived/cellMotion/cellMotionFvPatchFieldsFwd.H index 79658624f45caf30b6ab71cc225828901afed115..af832fb1ff9c5fedbdb327151216e7f2be73666d 100644 --- a/src/fvMotionSolver/fvPatchFields/derived/cellMotion/cellMotionFvPatchFieldsFwd.H +++ b/src/fvMotionSolver/fvPatchFields/derived/cellMotion/cellMotionFvPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class cellMotionFvPatchField; -makePatchTypeFieldTypedefs(cellMotion) +makePatchTypeFieldTypedefs(cellMotion); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/fvMotionSolver/fvPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementFvPatchFields.H b/src/fvMotionSolver/fvPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementFvPatchFields.H index a67169c9b7f692bf555f89c740addb12ba923156..8eb4624720ee8688aaaf16efc7a1a63f85b9bd0a 100644 --- a/src/fvMotionSolver/fvPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementFvPatchFields.H +++ b/src/fvMotionSolver/fvPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementFvPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(surfaceSlipDisplacement) +makePatchTypeFieldTypedefs(surfaceSlipDisplacement); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/fvMotionSolver/fvPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementFvPatchFieldsFwd.H b/src/fvMotionSolver/fvPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementFvPatchFieldsFwd.H index 30e9ca9cbee1d58bba38d16aa01eb34605377637..21451bd9318bc0db4280b081d2c1d8f213778076 100644 --- a/src/fvMotionSolver/fvPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementFvPatchFieldsFwd.H +++ b/src/fvMotionSolver/fvPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementFvPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class surfaceSlipDisplacementFvPatchField; -makePatchTypeFieldTypedefs(slip) +makePatchTypeFieldTypedefs(slip); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/fvMotionSolver/motionDiffusivity/directional/directionalDiffusivity.C b/src/fvMotionSolver/motionDiffusivity/directional/directionalDiffusivity.C index 6fbc3faea9297e0504ce2c9bbb548800d506afb8..147b03d824fd5509e371a27aa183b8d071734c28 100644 --- a/src/fvMotionSolver/motionDiffusivity/directional/directionalDiffusivity.C +++ b/src/fvMotionSolver/motionDiffusivity/directional/directionalDiffusivity.C @@ -68,7 +68,7 @@ void Foam::directionalDiffusivity::correct() { const fvMesh& mesh = mSolver().mesh(); - surfaceVectorField n = mesh.Sf()/mesh.magSf(); + const surfaceVectorField n(mesh.Sf()/mesh.magSf()); faceDiffusivity_ == (n & cmptMultiply(diffusivityVector_, n)); } diff --git a/src/fvMotionSolver/motionDiffusivity/inverseFaceDistance/inverseFaceDistanceDiffusivity.C b/src/fvMotionSolver/motionDiffusivity/inverseFaceDistance/inverseFaceDistanceDiffusivity.C index 6464f87341ee39f886bb05f70827399b8d2ff59c..5e9a85acdf80ee740e7bee420f8a29e24579083f 100644 --- a/src/fvMotionSolver/motionDiffusivity/inverseFaceDistance/inverseFaceDistanceDiffusivity.C +++ b/src/fvMotionSolver/motionDiffusivity/inverseFaceDistance/inverseFaceDistanceDiffusivity.C @@ -96,7 +96,7 @@ void Foam::inverseFaceDistanceDiffusivity::correct() { const polyPatch& patch = bdry[iter.key()]; - const vectorField::subField fc = patch.faceCentres(); + const vectorField::subField fc(patch.faceCentres()); forAll(fc, patchFaceI) { diff --git a/src/fvMotionSolver/motionDiffusivity/motionDirectional/motionDirectionalDiffusivity.C b/src/fvMotionSolver/motionDiffusivity/motionDirectional/motionDirectionalDiffusivity.C index ea48bda76457634a583629b7b4806223ec4b714c..7262b814941648d09cd4b001e9944029e61993ea 100644 --- a/src/fvMotionSolver/motionDiffusivity/motionDirectional/motionDirectionalDiffusivity.C +++ b/src/fvMotionSolver/motionDiffusivity/motionDirectional/motionDirectionalDiffusivity.C @@ -90,7 +90,7 @@ void Foam::motionDirectionalDiffusivity::correct() ); D.correctBoundaryConditions(); - surfaceVectorField n = mesh.Sf()/mesh.magSf(); + const surfaceVectorField n(mesh.Sf()/mesh.magSf()); faceDiffusivity_ == (n & cmptMultiply(fvc::interpolate(D), n)); } else diff --git a/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.C b/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.C index 000677aa207509f4229420ad522b0016325d54e3..786c3b600809e03ec87c7e5b26b98e548432c459 100644 --- a/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.C +++ b/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.C @@ -160,7 +160,7 @@ void angularOscillatingDisplacementPointPatchVectorField::updateCoeffs() scalar angle = angle0_ + amplitude_*sin(omega_*t.value()); vector axisHat = axis_/mag(axis_); - vectorField p0Rel = p0_ - origin_; + vectorField p0Rel(p0_ - origin_); vectorField::operator= ( @@ -196,7 +196,7 @@ void angularOscillatingDisplacementPointPatchVectorField::write // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePointPatchTypeField +makeNonTemplatedPointPatchTypeField ( pointPatchVectorField, angularOscillatingDisplacementPointPatchVectorField diff --git a/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingVelocity/angularOscillatingVelocityPointPatchVectorField.C b/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingVelocity/angularOscillatingVelocityPointPatchVectorField.C index 27123ccf4e24d7a377fe79545fb0f696ef1c90f7..aa9bce36ee92a4a6d22cf5a62f44b1d76403ece7 100644 --- a/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingVelocity/angularOscillatingVelocityPointPatchVectorField.C +++ b/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingVelocity/angularOscillatingVelocityPointPatchVectorField.C @@ -161,7 +161,7 @@ void angularOscillatingVelocityPointPatchVectorField::updateCoeffs() scalar angle = angle0_ + amplitude_*sin(omega_*t.value()); vector axisHat = axis_/mag(axis_); - vectorField p0Rel = p0_ - origin_; + vectorField p0Rel(p0_ - origin_); vectorField::operator= ( @@ -201,7 +201,7 @@ void angularOscillatingVelocityPointPatchVectorField::write // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePointPatchTypeField +makeNonTemplatedPointPatchTypeField ( pointPatchVectorField, angularOscillatingVelocityPointPatchVectorField diff --git a/src/fvMotionSolver/pointPatchFields/derived/oscillatingDisplacement/oscillatingDisplacementPointPatchVectorField.C b/src/fvMotionSolver/pointPatchFields/derived/oscillatingDisplacement/oscillatingDisplacementPointPatchVectorField.C index aa0674683ddf727371961e30fbd8f7d69855a0b3..fbadba14ac2870a56c648f9dc83237503e9155a7 100644 --- a/src/fvMotionSolver/pointPatchFields/derived/oscillatingDisplacement/oscillatingDisplacementPointPatchVectorField.C +++ b/src/fvMotionSolver/pointPatchFields/derived/oscillatingDisplacement/oscillatingDisplacementPointPatchVectorField.C @@ -127,7 +127,7 @@ void oscillatingDisplacementPointPatchVectorField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePointPatchTypeField +makeNonTemplatedPointPatchTypeField ( pointPatchVectorField, oscillatingDisplacementPointPatchVectorField diff --git a/src/fvMotionSolver/pointPatchFields/derived/oscillatingVelocity/oscillatingVelocityPointPatchVectorField.C b/src/fvMotionSolver/pointPatchFields/derived/oscillatingVelocity/oscillatingVelocityPointPatchVectorField.C index b9cbac6460ad8afce5de96f525870bca32645fa1..30fdf7382a7ed4c8cd8293911056ed9b922870d7 100644 --- a/src/fvMotionSolver/pointPatchFields/derived/oscillatingVelocity/oscillatingVelocityPointPatchVectorField.C +++ b/src/fvMotionSolver/pointPatchFields/derived/oscillatingVelocity/oscillatingVelocityPointPatchVectorField.C @@ -171,7 +171,7 @@ void oscillatingVelocityPointPatchVectorField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePointPatchTypeField +makeNonTemplatedPointPatchTypeField ( pointPatchVectorField, oscillatingVelocityPointPatchVectorField diff --git a/src/fvMotionSolver/pointPatchFields/derived/surfaceDisplacement/surfaceDisplacementPointPatchVectorField.C b/src/fvMotionSolver/pointPatchFields/derived/surfaceDisplacement/surfaceDisplacementPointPatchVectorField.C index 57c288aa2c934c190ffe4b737dc2b885b913b921..f2c4ce669ca373ebae21c375bcade8a61d186a4f 100644 --- a/src/fvMotionSolver/pointPatchFields/derived/surfaceDisplacement/surfaceDisplacementPointPatchVectorField.C +++ b/src/fvMotionSolver/pointPatchFields/derived/surfaceDisplacement/surfaceDisplacementPointPatchVectorField.C @@ -439,14 +439,14 @@ void surfaceDisplacementPointPatchVectorField::updateCoeffs() const polyMesh& mesh = patch().boundaryMesh().mesh()(); - vectorField currentDisplacement = this->patchInternalField(); + vectorField currentDisplacement(this->patchInternalField()); // Calculate intersections with surface w.r.t points0. vectorField displacement(currentDisplacement); calcProjection(displacement); // offset wrt current displacement - vectorField offset = displacement-currentDisplacement; + vectorField offset(displacement-currentDisplacement); // Clip offset to maximum displacement possible: velocity*timestep @@ -499,7 +499,7 @@ void surfaceDisplacementPointPatchVectorField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePointPatchTypeField +makeNonTemplatedPointPatchTypeField ( fixedValuePointPatchVectorField, surfaceDisplacementPointPatchVectorField diff --git a/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.C b/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.C index 2c5edb340abb3dde53e46d3c733eaab7a52b288f..3eedadcc843cbb68d5d5f4c0d08e9508f3db77c2 100644 --- a/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.C +++ b/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.C @@ -448,7 +448,7 @@ void surfaceSlipDisplacementPointPatchVectorField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePointPatchTypeField +makeNonTemplatedPointPatchTypeField ( pointPatchVectorField, surfaceSlipDisplacementPointPatchVectorField diff --git a/src/genericPatchFields/genericFvPatchField/genericFvPatchFields.H b/src/genericPatchFields/genericFvPatchField/genericFvPatchFields.H index aaed1964030bd333151d52eca971ffae12b4c603..d684aec679044e629bb383c2b244ca6cc2d49875 100644 --- a/src/genericPatchFields/genericFvPatchField/genericFvPatchFields.H +++ b/src/genericPatchFields/genericFvPatchField/genericFvPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(generic) +makePatchTypeFieldTypedefs(generic); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/basic/Cloud/Cloud.C b/src/lagrangian/basic/Cloud/Cloud.C index d2331a1f2e561cab89c328e51e65a9a5039e7585..0a6aa75e5b15a0de30ee1b6d8c83f2a4136c48ce 100644 --- a/src/lagrangian/basic/Cloud/Cloud.C +++ b/src/lagrangian/basic/Cloud/Cloud.C @@ -383,7 +383,7 @@ Foam::label Foam::Cloud<ParticleType>::getNewParticleID() const template<class ParticleType> void Foam::Cloud<ParticleType>::addParticle(ParticleType* pPtr) { - append(pPtr); + this->append(pPtr); } diff --git a/src/lagrangian/basic/InteractionLists/globalIndexAndTransform/vectorTensorTransform/vectorTensorTransformI.H b/src/lagrangian/basic/InteractionLists/globalIndexAndTransform/vectorTensorTransform/vectorTensorTransformI.H index f322fc786fb709bc1bb8001461df116b2788d574..b42ec621538629a00dfa2e052200588b37591219 100644 --- a/src/lagrangian/basic/InteractionLists/globalIndexAndTransform/vectorTensorTransform/vectorTensorTransformI.H +++ b/src/lagrangian/basic/InteractionLists/globalIndexAndTransform/vectorTensorTransform/vectorTensorTransformI.H @@ -120,14 +120,17 @@ inline Foam::pointField Foam::vectorTensorTransform::transform const pointField& pts ) const { + tmp<pointField> tfld; + if (hasR_) { - return t() + (R() & pts); + tfld = t() + (R() & pts); } else { - return t() + pts; + tfld = t() + pts; } + return tfld(); } @@ -152,14 +155,17 @@ inline Foam::pointField Foam::vectorTensorTransform::invTransform const pointField& pts ) const { + tmp<pointField> tfld; + if (hasR_) { - return (R().T() & (pts - t())); + tfld = (R().T() & (pts - t())); } else { - return pts - t(); + tfld = pts - t(); } + return tfld(); } diff --git a/src/lagrangian/dieselSpray/injector/swirlInjector/swirlInjector.C b/src/lagrangian/dieselSpray/injector/swirlInjector/swirlInjector.C index 57cce2960f3e8f49793d132c440a92eb9184b339..7c9774abfada4f4b2010fb5730ffa33384d3aebd 100644 --- a/src/lagrangian/dieselSpray/injector/swirlInjector/swirlInjector.C +++ b/src/lagrangian/dieselSpray/injector/swirlInjector/swirlInjector.C @@ -101,8 +101,8 @@ Foam::swirlInjector::swirlInjector ( mag ( - massFlowRateProfile_[massFlowRateProfile_.size() - 1][0] - - injectionPressureProfile_[injectionPressureProfile_.size() - 1][0] + massFlowRateProfile_.last()[0] + - injectionPressureProfile_.last()[0] ) > SMALL ) { diff --git a/src/lagrangian/dieselSpray/spray/sprayI.H b/src/lagrangian/dieselSpray/spray/sprayI.H index 7087204888f6acb57e643182f015e301ef87d8c3..fe583b2a87f2754220a27ecc1d4a597b30e7ad46 100644 --- a/src/lagrangian/dieselSpray/spray/sprayI.H +++ b/src/lagrangian/dieselSpray/spray/sprayI.H @@ -23,116 +23,112 @@ License \*---------------------------------------------------------------------------*/ -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -inline const Time& spray::runTime() const +inline const Foam::Time& Foam::spray::runTime() const { return runTime_; } -inline const fvMesh& spray::mesh() const +inline const Foam::fvMesh& Foam::spray::mesh() const { return mesh_; } -inline const volVectorField& spray::U() const +inline const Foam::volVectorField& Foam::spray::U() const { return U_; } -inline const volScalarField& spray::rho() const +inline const Foam::volScalarField& Foam::spray::rho() const { return rho_; } -inline const volScalarField& spray::p() const +inline const Foam::volScalarField& Foam::spray::p() const { return p_; } -inline const volScalarField& spray::T() const +inline const Foam::volScalarField& Foam::spray::T() const { return T_; } -inline PtrList<injector>& spray::injectors() +inline Foam::PtrList<Foam::injector>& Foam::spray::injectors() { return injectors_; } -inline const PtrList<injector>& spray::injectors() const +inline const Foam::PtrList<Foam::injector>& Foam::spray::injectors() const { return injectors_; } -inline const atomizationModel& spray::atomization() const +inline const Foam::atomizationModel& Foam::spray::atomization() const { - return atomization_; + return atomization_(); } -inline const breakupModel& spray::breakup() const +inline const Foam::breakupModel& Foam::spray::breakup() const { - return breakupModel_; + return breakupModel_(); } -inline const collisionModel& spray::collisions() const +inline const Foam::collisionModel& Foam::spray::collisions() const { - return collisionModel_; + return collisionModel_(); } -inline const dispersionModel& spray::dispersion() const +inline const Foam::dispersionModel& Foam::spray::dispersion() const { - return dispersionModel_; + return dispersionModel_(); } -inline const dragModel& spray::drag() const +inline const Foam::dragModel& Foam::spray::drag() const { - return drag_; + return drag_(); } -inline const evaporationModel& spray::evaporation() const +inline const Foam::evaporationModel& Foam::spray::evaporation() const { - return evaporation_; + return evaporation_(); } -inline const heatTransferModel& spray::heatTransfer() const +inline const Foam::heatTransferModel& Foam::spray::heatTransfer() const { - return heatTransfer_; + return heatTransfer_(); } -inline const injectorModel& spray::injection() const +inline const Foam::injectorModel& Foam::spray::injection() const { - return injectorModel_; + return injectorModel_(); } -inline const wallModel& spray::wall() const +inline const Foam::wallModel& Foam::spray::wall() const { - return wall_; + return wall_(); } -inline tmp<volVectorField> spray::momentumSource() const +inline Foam::tmp<Foam::volVectorField> Foam::spray::momentumSource() const { tmp<volVectorField> tsource ( @@ -162,7 +158,8 @@ inline tmp<volVectorField> spray::momentumSource() const } -inline tmp<volScalarField> spray::evaporationSource(const label si) const +inline Foam::tmp<Foam::volScalarField> +Foam::spray::evaporationSource(const label si) const { tmp<volScalarField> tsource ( @@ -196,7 +193,7 @@ inline tmp<volScalarField> spray::evaporationSource(const label si) const } -inline tmp<volScalarField> spray::heatTransferSource() const +inline Foam::tmp<Foam::volScalarField> Foam::spray::heatTransferSource() const { tmp<volScalarField> tsource ( @@ -221,164 +218,165 @@ inline tmp<volScalarField> spray::heatTransferSource() const } -inline cachedRandom& spray::rndGen() +inline Foam::cachedRandom& Foam::spray::rndGen() { return rndGen_; } -inline label spray::subCycles() const +inline Foam::label Foam::spray::subCycles() const { return subCycles_; } -inline const vector& spray::g() const +inline const Foam::vector& Foam::spray::g() const { return g_; } -inline const liquidMixture& spray::fuels() const +inline const Foam::liquidMixture& Foam::spray::fuels() const { - return fuels_; + return fuels_(); } -inline const PtrList<gasThermoPhysics>& spray::gasProperties() const +inline const Foam::PtrList<Foam::gasThermoPhysics>& +Foam::spray::gasProperties() const { return gasProperties_; } -inline const basicMultiComponentMixture& spray::composition() const +inline const Foam::basicMultiComponentMixture& Foam::spray::composition() const { return composition_; } -inline const List<label>& spray::liquidToGasIndex() const +inline const Foam::List<Foam::label>& Foam::spray::liquidToGasIndex() const { return liquidToGasIndex_; } -inline const List<label>& spray::gasToLiquidIndex() const +inline const Foam::List<Foam::label>& Foam::spray::gasToLiquidIndex() const { return gasToLiquidIndex_; } -inline const List<bool>& spray::isLiquidFuel() const +inline const Foam::List<bool>& Foam::spray::isLiquidFuel() const { return isLiquidFuel_; } -inline bool spray::twoD() const +inline bool Foam::spray::twoD() const { return twoD_; } -inline const vector& spray::axisOfSymmetry() const +inline const Foam::vector& Foam::spray::axisOfSymmetry() const { return axisOfSymmetry_; } -inline const vector& spray::axisOfWedge() const +inline const Foam::vector& Foam::spray::axisOfWedge() const { return axisOfWedge_; } -inline const vector& spray::axisOfWedgeNormal() const +inline const Foam::vector& Foam::spray::axisOfWedgeNormal() const { return axisOfWedgeNormal_; } -inline scalar spray::angleOfWedge() const +inline Foam::scalar Foam::spray::angleOfWedge() const { return angleOfWedge_; } -inline const interpolation<vector>& spray::UInterpolator() const +inline const Foam::interpolation<Foam::vector>& +Foam::spray::UInterpolator() const { return UInterpolator_; } -inline const interpolation<scalar>& spray::rhoInterpolator() const +inline const Foam::interpolation<Foam::scalar>& +Foam::spray::rhoInterpolator() const { return rhoInterpolator_; } -inline const interpolation<scalar>& spray::pInterpolator() const +inline const Foam::interpolation<Foam::scalar>& +Foam::spray::pInterpolator() const { return pInterpolator_; } -inline const interpolation<scalar>& spray::TInterpolator() const +inline const Foam::interpolation<Foam::scalar>& +Foam::spray::TInterpolator() const { return TInterpolator_; } -inline vectorField& spray::sms() +inline Foam::vectorField& Foam::spray::sms() { return sms_; } -inline const vectorField& spray::sms() const +inline const Foam::vectorField& Foam::spray::sms() const { return sms_; } -inline scalarField& spray::shs() +inline Foam::scalarField& Foam::spray::shs() { return shs_; } -inline const scalarField& spray::shs() const +inline const Foam::scalarField& Foam::spray::shs() const { return shs_; } -inline PtrList<scalarField>& spray::srhos() +inline Foam::PtrList<Foam::scalarField>& Foam::spray::srhos() { return srhos_; } -inline const PtrList<scalarField>& spray::srhos() const +inline const Foam::PtrList<Foam::scalarField>& Foam::spray::srhos() const { return srhos_; } -inline scalar spray::ambientPressure() const +inline Foam::scalar Foam::spray::ambientPressure() const { return ambientPressure_; } -inline scalar spray::ambientTemperature() const +inline Foam::scalar Foam::spray::ambientTemperature() const { return ambientTemperature_; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/collisionModel/ORourke/sameCell.H b/src/lagrangian/dieselSpray/spraySubModels/collisionModel/ORourke/sameCell.H index 7743a06f7cceceaa0ef0c315e2bb2ed2051a1cfb..ed34a3fda00d3cce7b26105aa8968726fe0b4967 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/collisionModel/ORourke/sameCell.H +++ b/src/lagrangian/dieselSpray/spraySubModels/collisionModel/ORourke/sameCell.H @@ -103,9 +103,9 @@ if ((xx > collProb) && (mMin > VSMALL) && (mMax > VSMALL)) pMax().U() = (momMax + (1.0-newMinMass/mMin)*momMin)/newMaxMass; // update the liquid molar fractions - scalarField Ymin = spray_.fuels().Y(pMin().X()); - scalarField Ymax = spray_.fuels().Y(pMax().X()); - scalarField Ynew = mMax*Ymax + (mMin - newMinMass)*Ymin; + scalarField Ymin(spray_.fuels().Y(pMin().X())); + scalarField Ymax(spray_.fuels().Y(pMax().X())); + scalarField Ynew(mMax*Ymax + (mMin - newMinMass)*Ymin); scalar Wlinv = 0.0; forAll(Ynew, i) { diff --git a/src/lagrangian/dieselSpray/spraySubModels/collisionModel/trajectoryModel/trajectoryCM.H b/src/lagrangian/dieselSpray/spraySubModels/collisionModel/trajectoryModel/trajectoryCM.H index d9e83f68752bd8ca911e8fd35f65323289fa221e..657e018e11e7e6936b7193ad5aa20a3c4ddc00cb 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/collisionModel/trajectoryModel/trajectoryCM.H +++ b/src/lagrangian/dieselSpray/spraySubModels/collisionModel/trajectoryModel/trajectoryCM.H @@ -139,9 +139,9 @@ if (vAlign > 0) (momMax + (1.0-newMinMass/mMin)*momMin)/newMaxMass; // update the liquid molar fractions - scalarField Ymin = spray_.fuels().Y(pMin().X()); - scalarField Ymax = spray_.fuels().Y(pMax().X()); - scalarField Ynew = mMax*Ymax + (mMin - newMinMass)*Ymin; + scalarField Ymin(spray_.fuels().Y(pMin().X())); + scalarField Ymax(spray_.fuels().Y(pMax().X())); + scalarField Ynew(mMax*Ymax + (mMin - newMinMass)*Ymin); scalar Wlinv = 0.0; forAll(Ynew, i) { diff --git a/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/gradientDispersionRAS/gradientDispersionRAS.C b/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/gradientDispersionRAS/gradientDispersionRAS.C index 9c7f0dffd082ee4bdf64fcf58c88e409dc17b177..1076c002221b6c2a190cea852043566451a5988e 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/gradientDispersionRAS/gradientDispersionRAS.C +++ b/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/gradientDispersionRAS/gradientDispersionRAS.C @@ -70,7 +70,7 @@ void Foam::gradientDispersionRAS::disperseParcels() const scalar dt = spray_.runTime().deltaTValue(); const volScalarField& k = turbulence().k(); - volVectorField gradk = fvc::grad(k); + const volVectorField gradk(fvc::grad(k)); const volScalarField& epsilon = turbulence().epsilon(); const volVectorField& U = spray_.U(); diff --git a/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/stochasticDispersionRAS/stochasticDispersionRAS.C b/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/stochasticDispersionRAS/stochasticDispersionRAS.C index 7085f45839d91ed522da41aa278b28f65019ca0c..eb96e3f6537dddec5cb0a3d08ed3c4a0928d211e 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/stochasticDispersionRAS/stochasticDispersionRAS.C +++ b/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/stochasticDispersionRAS/stochasticDispersionRAS.C @@ -71,7 +71,7 @@ void Foam::stochasticDispersionRAS::disperseParcels() const scalar dt = spray_.runTime().deltaTValue(); const volScalarField& k = turbulence().k(); - //volVectorField gradk = fvc::grad(k); + // volVectorField gradk(fvc::grad(k)); const volScalarField& epsilon = turbulence().epsilon(); const volVectorField& U = spray_.U(); diff --git a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.C b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.C index 495c49b6e9b8baecdef0a4c063721fc2b53d9e27..793bc39fc93669700405ca2f6126b885f306a173 100644 --- a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.C +++ b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.C @@ -511,7 +511,7 @@ void Foam::DsmcCloud<ParcelType>::addNewParcel typeId ); - addParticle(pPtr); + this->addParticle(pPtr); } diff --git a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloudI.H b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloudI.H index 6390bfbc82b0caf838205fe0ec4d25cf35280967..57b48986a134fc3972eccb398a2250457bca0f2e 100644 --- a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloudI.H +++ b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloudI.H @@ -352,8 +352,9 @@ inline Foam::scalarField Foam::DsmcCloud<ParcelType>::maxwellianAverageSpeed scalar mass ) const { - return + tmp<scalarField> tfld = 2.0*sqrt(2.0*physicoChemical::k.value()*temperature/(pi*mass)); + return tfld(); } @@ -375,7 +376,9 @@ inline Foam::scalarField Foam::DsmcCloud<ParcelType>::maxwellianRMSSpeed scalar mass ) const { - return sqrt(3.0*physicoChemical::k.value()*temperature/mass); + tmp<scalarField> tfld = + sqrt(3.0*physicoChemical::k.value()*temperature/mass); + return tfld(); } @@ -399,7 +402,9 @@ Foam::DsmcCloud<ParcelType>::maxwellianMostProbableSpeed scalar mass ) const { - return sqrt(2.0*physicoChemical::k.value()*temperature/mass); + tmp<scalarField> tfld = + sqrt(2.0*physicoChemical::k.value()*temperature/mass); + return tfld(); } diff --git a/src/lagrangian/dsmc/submodels/InflowBoundaryModel/FreeStream/FreeStream.C b/src/lagrangian/dsmc/submodels/InflowBoundaryModel/FreeStream/FreeStream.C index df835e735d008961222ce12cc0ff3a155ef2fef5..4cda733a8673386d9afc6476a4b1bc482790dfb1 100644 --- a/src/lagrangian/dsmc/submodels/InflowBoundaryModel/FreeStream/FreeStream.C +++ b/src/lagrangian/dsmc/submodels/InflowBoundaryModel/FreeStream/FreeStream.C @@ -188,9 +188,11 @@ void Foam::FreeStream<CloudType>::inflow() // negated), dividing by the most probable speed to form // molecularSpeedRatio * cosTheta - scalarField sCosTheta = + scalarField sCosTheta + ( (boundaryU[patchI] & -patch.faceAreas()/mag(patch.faceAreas())) - /mostProbableSpeed; + / mostProbableSpeed + ); // From Bird eqn 4.22 diff --git a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H index dabbdc1211679c06827e4af9688585fbb78dd20b..ceff5e02c8e236871b97da188653503c5da10e36 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H +++ b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H @@ -137,7 +137,7 @@ Foam::ThermoCloud<ParcelType>::Sh(volScalarField& hs) const { if (this->solution().semiImplicit("hs")) { - const volScalarField Cp = thermo_.thermo().Cp(); + const volScalarField Cp(thermo_.thermo().Cp()); return hsTrans()/(this->mesh().V()*this->db().time().deltaT()) diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C index f0e175904c3521a3b64366148a7b28ca5c6787c3..b0a7497211062a5e77c16c7c06fdb66c352b60dc 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C @@ -265,7 +265,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc scalarField Cs(td.cloud().composition().carrier().species().size(), 0.0); // Calc mass and enthalpy transfer due to phase change - calcPhaseChange + this->calcPhaseChange ( td, dt, @@ -313,7 +313,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc ); // Correct surface values due to emitted species - correctSurfaceValues(td, cellI, Ts, Cs, rhos, mus, Pr, kappa); + this->correctSurfaceValues(td, cellI, Ts, Cs, rhos, mus, Pr, kappa); // Surface reactions @@ -357,9 +357,9 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc // Update component mass fractions // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - scalarField dMassGas = dMassDV + dMassSRGas; - scalarField dMassLiquid = dMassPC + dMassSRLiquid; - scalarField dMassSolid = dMassSRSolid; + scalarField dMassGas(dMassDV + dMassSRGas); + scalarField dMassLiquid(dMassPC + dMassSRLiquid); + scalarField dMassSolid(dMassSRSolid); scalar mass1 = updateMassFractions(mass0, dMassGas, dMassLiquid, dMassSolid); @@ -371,7 +371,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc // Calculate new particle temperature scalar Cuh = 0.0; scalar T1 = - calcHeatTransfer + this->calcHeatTransfer ( td, dt, @@ -396,7 +396,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc // Calculate new particle velocity scalar Cud = 0; vector U1 = - calcVelocity + this->calcVelocity ( td, dt, diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelIO.C b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelIO.C index 414638d6990126978319a3cfde15817c4a620812..d0e8e130d44ff43247c27a3e3869ddc129c20747 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelIO.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelIO.C @@ -286,9 +286,9 @@ Foam::Ostream& Foam::operator<< const ReactingMultiphaseParcel<ParcelType>& p ) { - scalarField YGasLoc = p.YGas()*p.Y()[0]; - scalarField YLiquidLoc = p.YLiquid()*p.Y()[1]; - scalarField YSolidLoc = p.YSolid()*p.Y()[2]; + scalarField YGasLoc(p.YGas()*p.Y()[0]); + scalarField YLiquidLoc(p.YLiquid()*p.Y()[1]); + scalarField YSolidLoc(p.YSolid()*p.Y()[2]); if (os.format() == IOstream::ASCII) { os << static_cast<const ReactingParcel<ParcelType>&>(p) diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C index 3fca0e81359a46f3dbaf13830d967e765d13012c..926c7dcf94b8c4e87d1cd00716ab05c46eb2f801 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C @@ -322,7 +322,7 @@ void Foam::ReactingParcel<ParcelType>::calc // Calculate new particle temperature scalar Cuh = 0.0; scalar T1 = - calcHeatTransfer + this->calcHeatTransfer ( td, dt, @@ -347,7 +347,7 @@ void Foam::ReactingParcel<ParcelType>::calc // Calculate new particle velocity scalar Cud = 0.0; vector U1 = - calcVelocity + this->calcVelocity ( td, dt, diff --git a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C index 1637021dbf11f0d13c4ef14ee151a9ccabf7ec77..ba98abf666b588e897b4b232508804aee769bc2b 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C @@ -202,7 +202,7 @@ void Foam::ThermoParcel<ParcelType>::calc // Calculate new particle velocity scalar Cuh = 0.0; scalar T1 = - calcHeatTransfer + this->calcHeatTransfer ( td, dt, @@ -227,7 +227,7 @@ void Foam::ThermoParcel<ParcelType>::calc // Calculate new particle velocity scalar Cud = 0.0; vector U1 = - calcVelocity + this->calcVelocity ( td, dt, diff --git a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcelI.H b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcelI.H index d588e69fd309d3bd1e8477c212f00a677e3fb4a2..1773a82db762ac537c6ff22f3114940064eb7e8c 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcelI.H +++ b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcelI.H @@ -116,7 +116,8 @@ inline Foam::ThermoParcel<ParcelType>::trackData::trackData interpolation<scalar>::New ( cloud.solution().interpolationSchemes(), - cloud.mesh().objectRegistry::lookupObject<volScalarField>("G") + cloud.mesh().objectRegistry::template + lookupObject<volScalarField>("G") ).ptr() ); } diff --git a/src/lagrangian/intermediate/parcels/include/createKinematicParcelTypes.H b/src/lagrangian/intermediate/parcels/include/createKinematicParcelTypes.H index acdace44af1948592b36d80e03907231060ee0ce..d48969ca748356eda4aef02a96c7c57516c84f6c 100644 --- a/src/lagrangian/intermediate/parcels/include/createKinematicParcelTypes.H +++ b/src/lagrangian/intermediate/parcels/include/createKinematicParcelTypes.H @@ -33,7 +33,7 @@ License #define createKinematicParcelTypes(ParcelType) \ \ - defineTemplateTypeNameAndDebug(ParcelType, 0); \ + defineTypeNameAndDebug(ParcelType, 0); \ defineTemplateTypeNameAndDebug(Particle<ParcelType>, 0); \ defineTemplateTypeNameAndDebug(Cloud<ParcelType>, 0); \ \ diff --git a/src/lagrangian/intermediate/phaseProperties/phaseProperties/phaseProperties.C b/src/lagrangian/intermediate/phaseProperties/phaseProperties/phaseProperties.C index 4ad492b064a26812115b16770df229ee470b8d31..18c7e9a38c57543a63a653d3cd402e8399aed3ed 100644 --- a/src/lagrangian/intermediate/phaseProperties/phaseProperties/phaseProperties.C +++ b/src/lagrangian/intermediate/phaseProperties/phaseProperties/phaseProperties.C @@ -30,7 +30,11 @@ License namespace Foam { template<> - const char* Foam::NamedEnum<Foam::phaseProperties::phaseType, 4>::names[] = + const char* Foam::NamedEnum + < + Foam::phaseProperties::phaseType, + 4 + >::names[] = { "gas", "liquid", diff --git a/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/DispersionRASModel/DispersionRASModel.C b/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/DispersionRASModel/DispersionRASModel.C index 250074a975b9fe8d024d38dbe913942bdd7bd143..22f11402701ba3f69da9cceca1bf18fa7db90474 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/DispersionRASModel/DispersionRASModel.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/DispersionRASModel/DispersionRASModel.C @@ -38,7 +38,10 @@ Foam::DispersionRASModel<CloudType>::DispersionRASModel DispersionModel<CloudType>(owner), turbulence_ ( - owner.mesh().objectRegistry::lookupObject<compressible::RASModel> + owner.mesh().objectRegistry::template lookupObject + < + compressible::RASModel + > ( "RASProperties" ) diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.C index 40f7b61be55658a28879886ff308c40efe630d95..75f34af8eba6b0e9c5866a1d52e8b7a0d923167e 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.C @@ -80,14 +80,14 @@ Foam::FieldActivatedInjection<CloudType>::FieldActivatedInjection factor_(readScalar(this->coeffDict().lookup("factor"))), referenceField_ ( - owner.db().objectRegistry::lookupObject<volScalarField> + owner.db().objectRegistry::template lookupObject<volScalarField> ( this->coeffDict().lookup("referenceField") ) ), thresholdField_ ( - owner.db().objectRegistry::lookupObject<volScalarField> + owner.db().objectRegistry::template lookupObject<volScalarField> ( this->coeffDict().lookup("thresholdField") ) diff --git a/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.C b/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.C index f1ef48de9dcb6a17c521a9ea98802d0b04bbe5ab..a454c5daad1d53fc50ecc937c6ca93193cba48f9 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.C @@ -134,7 +134,7 @@ void Foam::SurfaceFilmModel<CloudType>::inject(TrackData& td) // Retrieve the film model from the owner database const surfaceFilmModels::surfaceFilmModel& filmModel = - this->owner().db().objectRegistry::lookupObject + this->owner().db().objectRegistry::template lookupObject <surfaceFilmModels::surfaceFilmModel> ( "surfaceFilmProperties" diff --git a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.C b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.C index 2e88774afa14da4034ab9c653c9f8bcc7a331a39..219e691e3a7da2b721c33c50bba900c7911e002f 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.C +++ b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.C @@ -322,7 +322,8 @@ Foam::scalarField Foam::CompositionModel<CloudType>::X } } - return X/WInv; + tmp<scalarField> tfld = X/WInv; + return tfld(); } diff --git a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C index 1d468668f16533a86db8a2a3e9256d9c764e0334..6b72e9db0cc3823a7d7c7d54d52b28101e39d05c 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C +++ b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C @@ -32,7 +32,7 @@ using namespace Foam::constant::mathematical; // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // template<class CloudType> -Foam::scalarField Foam::LiquidEvaporation<CloudType>::calcXc +Foam::tmp<Foam::scalarField> Foam::LiquidEvaporation<CloudType>::calcXc ( const label cellI ) const @@ -149,7 +149,7 @@ void Foam::LiquidEvaporation<CloudType>::calculate ) const { // construct carrier phase species volume fractions for cell, cellI - const scalarField Xc = calcXc(cellI); + const scalarField Xc(calcXc(cellI)); // droplet surface area const scalar A = pi*sqr(d); diff --git a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.H b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.H index b998e9e4d2a8b84dbdc445daf802be04fd8064f3..dbae15d93d4b199afa8c007494f7294297e53bb7 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.H +++ b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.H @@ -72,7 +72,7 @@ protected: scalar Sh(const scalar Re, const scalar Sc) const; //- Calculate the carrier phase component volume fractions at cellI - scalarField calcXc(const label cellI) const; + tmp<scalarField> calcXc(const label cellI) const; public: diff --git a/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C b/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C index 1a037fdc7792afb649a764aebd6065b42a70a23d..c0d9f69e7703a4c115219b37c071d21cf1c89013 100644 --- a/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C +++ b/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C @@ -492,7 +492,10 @@ Foam::ThermoSurfaceFilm<CloudType>::ThermoSurfaceFilm : SurfaceFilmModel<CloudType>(dict, owner, g, typeName), rndGen_(owner.rndGen()), - thermo_(owner.db().objectRegistry::lookupObject<SLGThermo>("SLGThermo")), + thermo_ + ( + owner.db().objectRegistry::template lookupObject<SLGThermo>("SLGThermo") + ), TFilmPatch_(0), CpFilmPatch_(0), interactionType_ @@ -567,7 +570,7 @@ bool Foam::ThermoSurfaceFilm<CloudType>::transferParcel surfaceFilmModels::surfaceFilmModel& filmModel = const_cast<surfaceFilmModels::surfaceFilmModel&> ( - this->owner().db().objectRegistry:: + this->owner().db().objectRegistry::template lookupObject<surfaceFilmModels::surfaceFilmModel> ( "surfaceFilmProperties" diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C index 68d17629939077addbd69c00ba5db1b4f3fafc90..2b6628fe75de3896bc04abb979ee1b2241115104 100644 --- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C +++ b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C @@ -3032,7 +3032,7 @@ void Foam::autoLayerDriver::addLayers } } - scalarField invExpansionRatio = 1.0 / expansionRatio; + const scalarField invExpansionRatio(1.0 / expansionRatio); // Add topo regardless of whether extrudeStatus is extruderemove. // Not add layer if patchDisp is zero. diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.C b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.C index c1c19fa1734db1114947976ee03753c1a0fbf4f3..95fd5ffabecdab9a54587db995063e9b935e301d 100644 --- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.C +++ b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.C @@ -652,7 +652,8 @@ Foam::scalarField Foam::autoSnapDriver::calcSnapDistance -GREAT // null value ); - return snapParams.snapTol()*maxEdgeLen; + tmp<scalarField> tfld = snapParams.snapTol()*maxEdgeLen; + return tfld(); } diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/pointData/pointData.H b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/pointData/pointData.H index f4f29af8be8292b1baa41d114499cbe506b72f1e..6d3ca65bdfc5df225225a88f02f4c44782056446 100644 --- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/pointData/pointData.H +++ b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/pointData/pointData.H @@ -25,7 +25,7 @@ Class Foam::pointData Description - Variant of pointEdgePoint with some transported additional data. + Variant of pointEdgePoint with some transported additional data. WIP - should be templated on data like wallDistData. Passive vector v_ is not a coordinate (so no enterDomain/leaveDomain transformation needed) diff --git a/src/mesh/autoMesh/autoHexMesh/refinementSurfaces/refinementSurfaces.C b/src/mesh/autoMesh/autoHexMesh/refinementSurfaces/refinementSurfaces.C index 9a91bcccb0b37a0fe745b1935b506051d270aea1..91c7a07fc587bc2dce93fb0e6a41b5711d86da3b 100644 --- a/src/mesh/autoMesh/autoHexMesh/refinementSurfaces/refinementSurfaces.C +++ b/src/mesh/autoMesh/autoHexMesh/refinementSurfaces/refinementSurfaces.C @@ -37,8 +37,11 @@ License namespace Foam { template<> - const char* - Foam::NamedEnum<Foam::refinementSurfaces::areaSelectionAlgo, 4>::names[] = + const char* Foam::NamedEnum + < + Foam::refinementSurfaces::areaSelectionAlgo, + 4 + >::names[] = { "inside", "outside", diff --git a/src/mesh/blockMesh/curvedEdges/lineEdge.H b/src/mesh/blockMesh/curvedEdges/lineEdge.H index f445e85f56220b7e24e47e4af0da66d90f957a58..856c6b3f965197f93df4c24b17b331c55a3cca4a 100644 --- a/src/mesh/blockMesh/curvedEdges/lineEdge.H +++ b/src/mesh/blockMesh/curvedEdges/lineEdge.H @@ -51,13 +51,6 @@ class lineEdge : public curvedEdge { - // Private Member Functions - - //- Disallow default bitwise copy construct - lineEdge(const lineEdge&); - - //- Disallow default bitwise assignment - void operator=(const lineEdge&); public: diff --git a/src/meshTools/coordinateSystems/coordinateSystem.C b/src/meshTools/coordinateSystems/coordinateSystem.C index 1fbe52dfe9ff500b758cfdfb52464b8f64d2b0d1..e394f89bb241a1894d49dd3618c3819229b1df63 100644 --- a/src/meshTools/coordinateSystems/coordinateSystem.C +++ b/src/meshTools/coordinateSystems/coordinateSystem.C @@ -59,7 +59,7 @@ Foam::coordinateSystem::coordinateSystem note_(), origin_(cs.origin_), R_(cs.R_), - Rtr_(Rtr_) + Rtr_(R_.T()) {} diff --git a/src/meshTools/coordinateSystems/cylindricalCS.C b/src/meshTools/coordinateSystems/cylindricalCS.C index 70f937908119fe31feaa43125e71755e09ce8b74..1be2500f16854b888c807ea0b4a623557863815e 100644 --- a/src/meshTools/coordinateSystems/cylindricalCS.C +++ b/src/meshTools/coordinateSystems/cylindricalCS.C @@ -148,7 +148,7 @@ Foam::tmp<Foam::vectorField> Foam::cylindricalCS::localToGlobal bool translate ) const { - scalarField theta = + scalarField theta ( local.component(vector::Y) *(inDegrees_ ? constant::mathematical::pi/180.0 : 1.0) @@ -170,7 +170,10 @@ Foam::vector Foam::cylindricalCS::globalToLocal bool translate ) const { - const vector lc = coordinateSystem::globalToLocal(global, translate); + const vector lc + ( + coordinateSystem::globalToLocal(global, translate) + ); return vector ( @@ -191,8 +194,10 @@ Foam::tmp<Foam::vectorField> Foam::cylindricalCS::globalToLocal bool translate ) const { - const vectorField lc = - coordinateSystem::globalToLocal(global, translate); + const vectorField lc + ( + coordinateSystem::globalToLocal(global, translate) + ); tmp<vectorField> tresult(new vectorField(lc.size())); vectorField& result = tresult(); diff --git a/src/meshTools/coordinateSystems/sphericalCS.C b/src/meshTools/coordinateSystems/sphericalCS.C index 1bc0b10790f53902bacd4d2a68d9711b8c2de6b6..281316c12e45235bb6de7de44f3914fd4062bddb 100644 --- a/src/meshTools/coordinateSystems/sphericalCS.C +++ b/src/meshTools/coordinateSystems/sphericalCS.C @@ -155,7 +155,7 @@ Foam::tmp<Foam::vectorField> Foam::sphericalCS::localToGlobal bool translate ) const { - const scalarField r = local.component(vector::X); + const scalarField r(local.component(vector::X)); const scalarField theta ( local.component(vector::Y) @@ -206,8 +206,8 @@ Foam::tmp<Foam::vectorField> Foam::sphericalCS::globalToLocal bool translate ) const { - const vectorField lc = coordinateSystem::globalToLocal(global, translate); - const scalarField r = mag(lc); + const vectorField lc(coordinateSystem::globalToLocal(global, translate)); + const scalarField r(mag(lc)); tmp<vectorField> tresult(new vectorField(lc.size())); vectorField& result = tresult(); diff --git a/src/meshTools/coordinateSystems/toroidalCS.C b/src/meshTools/coordinateSystems/toroidalCS.C index d0463acaca60f30fa57b4b4a3c0024ae20bc95f9..f7ce5a2bf8132aa9e342645d3819ea293d12be8f 100644 --- a/src/meshTools/coordinateSystems/toroidalCS.C +++ b/src/meshTools/coordinateSystems/toroidalCS.C @@ -97,15 +97,25 @@ Foam::tmp<Foam::vectorField> Foam::toroidalCS::localToGlobal bool translate ) const { - const scalarField r = local.component(vector::X); + const scalarField r + ( + local.component(vector::X) + ); - const scalarField theta = - local.component(vector::Y)*constant::mathematical::pi/180.0; + const scalarField theta + ( + local.component(vector::Y)*constant::mathematical::pi/180.0 + ); - const scalarField phi = - local.component(vector::Z)*constant::mathematical::pi/180.0; + const scalarField phi + ( + local.component(vector::Z)*constant::mathematical::pi/180.0 + ); - const scalarField rprime = radius_ + r*sin(phi); + const scalarField rprime + ( + radius_ + r*sin(phi) + ); vectorField lc(local.size()); lc.replace(vector::X, rprime*cos(theta)); diff --git a/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.C b/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.C index 0ad7c431b5e27f937019c5de10509de3da6610af..eb14063862e948dff332818f98f174bbc64d9e95 100644 --- a/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.C +++ b/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.C @@ -44,30 +44,38 @@ namespace Foam defineTypeNameAndDebug(directMappedPatchBase, 0); template<> - const char* NamedEnum<directMappedPatchBase::sampleMode, 3>::names[] = + const char* Foam::NamedEnum + < + Foam::directMappedPatchBase::sampleMode, + 3 + >::names[] = { "nearestCell", "nearestPatchFace", "nearestFace" }; - const NamedEnum<directMappedPatchBase::sampleMode, 3> - directMappedPatchBase::sampleModeNames_; - - template<> - const char* NamedEnum<directMappedPatchBase::offsetMode, 3>::names[] = + const char* Foam::NamedEnum + < + Foam::directMappedPatchBase::offsetMode, + 3 + >::names[] = { "uniform", "nonuniform", "normal" }; - - const NamedEnum<directMappedPatchBase::offsetMode, 3> - directMappedPatchBase::offsetModeNames_; } +const Foam::NamedEnum<Foam::directMappedPatchBase::sampleMode, 3> + Foam::directMappedPatchBase::sampleModeNames_; + +const Foam::NamedEnum<Foam::directMappedPatchBase::offsetMode, 3> + Foam::directMappedPatchBase::offsetModeNames_; + + // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // void Foam::directMappedPatchBase::collectSamples diff --git a/src/meshTools/indexedOctree/labelBits.H b/src/meshTools/indexedOctree/labelBits.H index d25ab4ab23f0c470f1ff585364586ea3f5519c7e..ab2a71274b8e07d3019f1a6f6faf5ec2243559e1 100644 --- a/src/meshTools/indexedOctree/labelBits.H +++ b/src/meshTools/indexedOctree/labelBits.H @@ -118,24 +118,24 @@ public: // Member Operators - friend inline bool operator==(const labelBits& a, const labelBits& b) + inline friend bool operator==(const labelBits& a, const labelBits& b) { return a.data_ == b.data_; } - friend inline bool operator!=(const labelBits& a, const labelBits& b) + inline friend bool operator!=(const labelBits& a, const labelBits& b) { return !(a == b); } // IOstream Operators - friend inline Istream& operator>>(Istream& is, labelBits& lb) + inline friend Istream& operator>>(Istream& is, labelBits& lb) { return is >> lb.data_; } - friend inline Ostream& operator<<(Ostream& os, const labelBits& lb) + inline friend Ostream& operator<<(Ostream& os, const labelBits& lb) { return os << lb.data_; } diff --git a/src/meshTools/indexedOctree/treeDataFace.C b/src/meshTools/indexedOctree/treeDataFace.C index 7114781de712d2189a4e272c8f4af4666248392c..7082af6049418ef6674c7db1aa1da3d63425000c 100644 --- a/src/meshTools/indexedOctree/treeDataFace.C +++ b/src/meshTools/indexedOctree/treeDataFace.C @@ -446,13 +446,9 @@ bool Foam::treeDataFace::overlaps label faceI = faceLabels_[index]; const face& f = mesh_.faces()[faceI]; - - forAll(f, fp) + if (cubeBb.containsAny(points, f)) { - if (cubeBb.contains(points[f[fp]])) - { - return true; - } + return true; } // 3. Difficult case: all points are outside but connecting edges might diff --git a/src/meshTools/indexedOctree/treeDataPrimitivePatch.C b/src/meshTools/indexedOctree/treeDataPrimitivePatch.C index 1267b1342f47bed5ea955017994a73fd2683b94f..9d214f37898ce96dc07df25399177e32b107030f 100644 --- a/src/meshTools/indexedOctree/treeDataPrimitivePatch.C +++ b/src/meshTools/indexedOctree/treeDataPrimitivePatch.C @@ -433,12 +433,9 @@ overlaps const pointField& points = patch_.points(); const face& f = patch_[index]; - forAll(f, fp) + if (cubeBb.containsAny(points, f)) { - if (cubeBb.contains(points[f[fp]])) - { - return true; - } + return true; } // 3. Difficult case: all points are outside but connecting edges might diff --git a/src/meshTools/indexedOctree/treeDataTriSurface.C b/src/meshTools/indexedOctree/treeDataTriSurface.C index 81cad2948bf6fc99630e881f7a59a0254bc5de1a..cdc995446c41399cc2af0766379173ef1b49ae7a 100644 --- a/src/meshTools/indexedOctree/treeDataTriSurface.C +++ b/src/meshTools/indexedOctree/treeDataTriSurface.C @@ -268,17 +268,7 @@ bool Foam::treeDataTriSurface::overlaps const pointField& points = surface_.points(); const labelledTri& f = surface_[index]; - // Triangle points - const point& p0 = points[f[0]]; - const point& p1 = points[f[1]]; - const point& p2 = points[f[2]]; - - treeBoundBox triBb(p0, p0); - triBb.min() = min(triBb.min(), p1); - triBb.min() = min(triBb.min(), p2); - - triBb.max() = max(triBb.max(), p1); - triBb.max() = max(triBb.max(), p2); + treeBoundBox triBb(points, surface_[index]); //- For testing: robust one //return cubeBb.overlaps(triBb); @@ -293,12 +283,17 @@ bool Foam::treeDataTriSurface::overlaps } // Check if one or more triangle point inside - if (cubeBb.contains(p0) || cubeBb.contains(p1) || cubeBb.contains(p2)) + if (cubeBb.containsAny(points, f)) { - // One or more points inside return true; } + // Triangle points + const point& p0 = points[f[0]]; + const point& p1 = points[f[1]]; + const point& p2 = points[f[2]]; + + // Now we have the difficult case: all points are outside but connecting // edges might go through cube. Use fast intersection of bounding box. @@ -324,13 +319,7 @@ void Foam::treeDataTriSurface::findNearest forAll(indices, i) { label index = indices[i]; - const labelledTri& f = surface_[index]; - - // Triangle points - const point& p0 = points[f[0]]; - const point& p1 = points[f[1]]; - const point& p2 = points[f[2]]; - + const triSurface::FaceType& f = surface_[index]; ////- Possible optimization: do quick rejection of triangle if bounding //// sphere does not intersect triangle bounding box. From simplistic @@ -379,7 +368,7 @@ void Foam::treeDataTriSurface::findNearest // t // ); - pointHit pHit = triPointRef(p0, p1, p2).nearestPoint(sample); + pointHit pHit = f.nearestPoint(sample, points); scalar distSqr = sqr(pHit.distance()); @@ -425,14 +414,10 @@ bool Foam::treeDataTriSurface::intersects { const pointField& points = surface_.points(); - const labelledTri& f = surface_[index]; + const triSurface::FaceType& f = surface_[index]; // Do quick rejection test - treeBoundBox triBb(points[f[0]], points[f[0]]); - triBb.min() = min(triBb.min(), points[f[1]]); - triBb.max() = max(triBb.max(), points[f[1]]); - triBb.min() = min(triBb.min(), points[f[2]]); - triBb.max() = max(triBb.max(), points[f[2]]); + treeBoundBox triBb(points, f); const direction startBits(triBb.posBits(start)); const direction endBits(triBb.posBits(end)); @@ -443,16 +428,14 @@ bool Foam::treeDataTriSurface::intersects return false; } - const triPointRef tri(points[f[0]], points[f[1]], points[f[2]]); - const vector dir(end - start); // Use relative tolerance (from octree) to determine intersection. - - pointHit inter = tri.intersection + pointHit inter = f.intersection ( start, dir, + points, intersection::HALF_RAY, indexedOctree<treeDataTriSurface>::perturbTol() ); diff --git a/src/meshTools/octree/octreeDataFace.C b/src/meshTools/octree/octreeDataFace.C index b7b35c743d218c33e516eb682d767b2ccf7f2254..6e7b6a7582f528710e734e110009ee010143fac0 100644 --- a/src/meshTools/octree/octreeDataFace.C +++ b/src/meshTools/octree/octreeDataFace.C @@ -514,13 +514,9 @@ bool Foam::octreeDataFace::overlaps const face& f = mesh_.faces()[faceI]; const pointField& points = mesh_.points(); - - forAll(f, fp) + if (sampleBb.containsAny(points, f)) { - if (sampleBb.contains(points[f[fp]])) - { - return true; - } + return true; } // 3. Difficult case: all points are outside but connecting edges might diff --git a/src/meshTools/octree/treeBoundBox.C b/src/meshTools/octree/treeBoundBox.C index 9499e53b0ebaf552d9837af179599e1c0e04d7ea..aaf85594f8da6739e1f32882df40e0384c2beff8 100644 --- a/src/meshTools/octree/treeBoundBox.C +++ b/src/meshTools/octree/treeBoundBox.C @@ -124,10 +124,9 @@ Foam::FixedList<Foam::vector, 6> Foam::treeBoundBox::calcFaceNormals() // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct as the bounding box of the given pointField Foam::treeBoundBox::treeBoundBox(const UList<point>& points) : - boundBox() + boundBox(points, false) { if (points.empty()) { @@ -139,57 +138,31 @@ Foam::treeBoundBox::treeBoundBox(const UList<point>& points) return; } - - min() = points[0]; - max() = points[0]; - - for (label i = 1; i < points.size(); i++) - { - min() = ::Foam::min(min(), points[i]); - max() = ::Foam::max(max(), points[i]); - } } -// Construct as the bounding box of the given pointField Foam::treeBoundBox::treeBoundBox ( const UList<point>& points, - const labelUList& meshPoints + const labelUList& indices ) : - boundBox() + boundBox(points, indices, false) { - if (points.empty() || meshPoints.empty()) + if (points.empty() || indices.empty()) { WarningIn ( "treeBoundBox::treeBoundBox" "(const UList<point>&, const labelUList&)" - ) << "cannot find bounding box for zero-sized pointField" + ) << "cannot find bounding box for zero-sized pointField, " << "returning zero" << endl; return; } - - min() = points[meshPoints[0]]; - max() = points[meshPoints[0]]; - - for (label i = 1; i < meshPoints.size(); i++) - { - min() = ::Foam::min(min(), points[meshPoints[i]]); - max() = ::Foam::max(max(), points[meshPoints[i]]); - } } -// Construct from Istream -Foam::treeBoundBox::treeBoundBox(Istream& is) -: - boundBox(is) -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // Foam::tmp<Foam::pointField> Foam::treeBoundBox::points() const @@ -462,13 +435,6 @@ bool Foam::treeBoundBox::intersects } -// this.bb fully contains bb -bool Foam::treeBoundBox::contains(const treeBoundBox& bb) const -{ - return contains(bb.min()) && contains(bb.max()); -} - - bool Foam::treeBoundBox::contains(const vector& dir, const point& pt) const { // diff --git a/src/meshTools/octree/treeBoundBox.H b/src/meshTools/octree/treeBoundBox.H index 824a9d4b5f9025638299d11c268318b63322fd46..009fd01dc9ec1d55bb61fcbc52e42867b3eb6ed8 100644 --- a/src/meshTools/octree/treeBoundBox.H +++ b/src/meshTools/octree/treeBoundBox.H @@ -50,6 +50,7 @@ Description SourceFiles treeBoundBoxI.H treeBoundBox.C + treeBoundBoxTemplates.C \*---------------------------------------------------------------------------*/ @@ -69,7 +70,7 @@ namespace Foam class Random; /*---------------------------------------------------------------------------*\ - Class treeBoundBox Declaration + Class treeBoundBox Declaration \*---------------------------------------------------------------------------*/ class treeBoundBox @@ -165,11 +166,11 @@ public: //- Construct null setting points to zero inline treeBoundBox(); - //- Construct from components - inline treeBoundBox(const point& min, const point& max); + //- Construct from a boundBox + explicit inline treeBoundBox(const boundBox& bb); //- Construct from components - explicit inline treeBoundBox(const boundBox& bb); + inline treeBoundBox(const point& min, const point& max); //- Construct as the bounding box of the given pointField. // Local processor domain only (no reduce as in boundBox) @@ -177,10 +178,21 @@ public: //- Construct as subset of points // Local processor domain only (no reduce as in boundBox) - treeBoundBox(const UList<point>&, const labelUList& meshPoints); + treeBoundBox(const UList<point>&, const labelUList& indices); + + //- Construct as subset of points + // The indices could be from edge/triFace etc. + // Local processor domain only (no reduce as in boundBox) + template<unsigned Size> + treeBoundBox + ( + const UList<point>&, + const FixedList<label, Size>& indices + ); + //- Construct from Istream - treeBoundBox(Istream&); + inline treeBoundBox(Istream&); // Member functions @@ -257,8 +269,8 @@ public: FixedList<direction, 8>& octantOrder ) const; - //- Overlaps other boundingbox? - inline bool overlaps(const treeBoundBox&) const; + //- Overlaps other bounding box? + using boundBox::overlaps; //- Overlaps boundingSphere (centre + sqr(radius))? bool overlaps(const point&, const scalar radiusSqr) const; @@ -289,18 +301,15 @@ public: point& pt ) const; - //- fully contains other boundingBox? - inline bool contains(const treeBoundBox&) const; - - //- Contains point? (inside or on edge) - inline bool contains(const point&) const; + //- Contains point or other bounding box? + using boundBox::contains; //- Contains point (inside or on edge) and moving in direction // dir would cause it to go inside. bool contains(const vector& dir, const point&) const; - //- Code position of pt on bounding box faces - direction faceBits(const point& pt) const; + //- Code position of point on bounding box faces + direction faceBits(const point&) const; //- Position of point relative to bounding box direction posBits(const point&) const; @@ -355,6 +364,10 @@ inline bool contiguous<treeBoundBox>() {return contiguous<boundBox>();} #include "treeBoundBoxI.H" +#ifdef NoRepository +# include "treeBoundBoxTemplates.C" +#endif + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif diff --git a/src/meshTools/octree/treeBoundBoxI.H b/src/meshTools/octree/treeBoundBoxI.H index 543e4e0256326ad4ea100ce34684c27e653e7de7..a085eb442170da871e97cefbb95cfb97bf468da5 100644 --- a/src/meshTools/octree/treeBoundBoxI.H +++ b/src/meshTools/octree/treeBoundBoxI.H @@ -46,6 +46,12 @@ inline Foam::treeBoundBox::treeBoundBox(const boundBox& bb) {} +inline Foam::treeBoundBox::treeBoundBox(Istream& is) +: + boundBox(is) +{} + + // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // inline Foam::scalar Foam::treeBoundBox::typDim() const @@ -306,20 +312,6 @@ inline void Foam::treeBoundBox::searchOrder } -// true if bb's intersect or overlap. -// Note: <= to make sure we catch all. -inline bool Foam::treeBoundBox::overlaps(const treeBoundBox& bb) const -{ - return boundBox::overlaps(bb); -} - - -inline bool Foam::treeBoundBox::contains(const point& pt) const -{ - return boundBox::contains(pt); -} - - //- Return slightly wider bounding box inline Foam::treeBoundBox Foam::treeBoundBox::extend ( @@ -346,6 +338,4 @@ inline Foam::treeBoundBox Foam::treeBoundBox::extend } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - // ************************************************************************* // diff --git a/src/meshTools/octree/treeBoundBoxTemplates.C b/src/meshTools/octree/treeBoundBoxTemplates.C new file mode 100644 index 0000000000000000000000000000000000000000..c8cb5fab5daf994d26fc63afc3c40ac91bcf9067 --- /dev/null +++ b/src/meshTools/octree/treeBoundBoxTemplates.C @@ -0,0 +1,56 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "treeBoundBox.H" +#include "FixedList.H" + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + + +template<unsigned Size> +Foam::treeBoundBox::treeBoundBox +( + const UList<point>& points, + const FixedList<label, Size>& indices +) +: + boundBox(points, indices, false) +{ + // points may be empty, but a FixedList is never empty + if (points.empty()) + { + WarningIn + ( + "treeBoundBox::treeBoundBox" + "(const UList<point>&, const FixedList<label, Size>&)" + ) << "cannot find bounding box for zero-sized pointField, " + << "returning zero" << endl; + + return; + } +} + +// ************************************************************************* // diff --git a/src/meshTools/polyMeshZipUpCells/polyMeshZipUpCells.C b/src/meshTools/polyMeshZipUpCells/polyMeshZipUpCells.C index de78e0fd938ea048b092b2902a1e53dbfe473bf3..f8ed7766b574d910e160552df1702ef482716704 100644 --- a/src/meshTools/polyMeshZipUpCells/polyMeshZipUpCells.C +++ b/src/meshTools/polyMeshZipUpCells/polyMeshZipUpCells.C @@ -447,9 +447,7 @@ bool Foam::polyMeshZipUpCells(polyMesh& mesh) point startPoint = Points[unorderedEdge[0]]; dist[0] = 0; - vector dir = - Points[unorderedEdge[unorderedEdge.size() - 1]] - - startPoint; + vector dir = Points[unorderedEdge.last()] - startPoint; for (label i = 1; i < dist.size(); i++) { @@ -509,7 +507,7 @@ bool Foam::polyMeshZipUpCells(polyMesh& mesh) edge testEdge ( orderedEdge[0], - orderedEdge[orderedEdge.size() - 1] + orderedEdge.last() ); // In order to avoid edge-to-edge comparison, get faces using diff --git a/src/meshTools/searchableSurface/searchableBox.C b/src/meshTools/searchableSurface/searchableBox.C index af6c6566a484adb290f586544d023eafc16352f0..b257b92a1f26624cda567e9b983f406152e70fa1 100644 --- a/src/meshTools/searchableSurface/searchableBox.C +++ b/src/meshTools/searchableSurface/searchableBox.C @@ -232,7 +232,7 @@ Foam::pointField Foam::searchableBox::coordinates() const { pointField ctrs(6); - const pointField pts = treeBoundBox::points(); + const pointField pts(treeBoundBox::points()); const faceList& fcs = treeBoundBox::faces; forAll(fcs, i) diff --git a/src/meshTools/searchableSurface/searchableSurfaceCollection.C b/src/meshTools/searchableSurface/searchableSurfaceCollection.C index a182841060bdb9e376f0bfc1d54c5b6c109bac88..97a2b9301e7fa79043d640655b33a4b0e1a7ec74 100644 --- a/src/meshTools/searchableSurface/searchableSurfaceCollection.C +++ b/src/meshTools/searchableSurface/searchableSurfaceCollection.C @@ -292,7 +292,7 @@ const Foam::wordList& Foam::searchableSurfaceCollection::regions() const Foam::label Foam::searchableSurfaceCollection::size() const { - return indexOffset_[indexOffset_.size()-1]; + return indexOffset_.last(); } diff --git a/src/meshTools/searchableSurface/triSurfaceMesh.C b/src/meshTools/searchableSurface/triSurfaceMesh.C index bc01d8d40ee0d6c5855fcb770ee365b0ff6a4153..937b3945c096bcd71d04aa206aaf0ab432bc826e 100644 --- a/src/meshTools/searchableSurface/triSurfaceMesh.C +++ b/src/meshTools/searchableSurface/triSurfaceMesh.C @@ -162,7 +162,7 @@ bool Foam::triSurfaceMesh::isSurfaceClosed() const facesPerEdge.clear(); forAll(pFaces, i) { - const labelledTri& f = triSurface::operator[](pFaces[i]); + const triSurface::FaceType& f = triSurface::operator[](pFaces[i]); label fp = findIndex(f, pointI); // Something weird: if I expand the code of addFaceToEdge in both @@ -238,7 +238,7 @@ void Foam::triSurfaceMesh::getNextIntersections while (true) { // Start tracking from last hit. - point pt = hits[hits.size()-1].hitPoint() + perturbVec; + point pt = hits.last().hitPoint() + perturbVec; if (((pt-start)&dirVec) > magSqrDirVec) { @@ -293,9 +293,9 @@ void Foam::triSurfaceMesh::calcBounds(boundBox& bb, label& nPoints) const nPoints = 0; bb = boundBox::invertedBox; - forAll(s, triI) + forAll(s, faceI) { - const labelledTri& f = s[triI]; + const triSurface::FaceType& f = s[faceI]; forAll(f, fp) { @@ -475,9 +475,9 @@ void Foam::triSurfaceMesh::clearOut() Foam::pointField Foam::triSurfaceMesh::coordinates() const { // Use copy to calculate face centres so they don't get stored - return PrimitivePatch<labelledTri, SubList, const pointField&> + return PrimitivePatch<triSurface::FaceType, SubList, const pointField&> ( - SubList<labelledTri>(*this, triSurface::size()), + SubList<triSurface::FaceType>(*this, triSurface::size()), triSurface::points() ).faceCentres(); } @@ -804,12 +804,12 @@ void Foam::triSurfaceMesh::getNormal { if (info[i].hit()) { - label triI = info[i].index(); + label faceI = info[i].index(); //- Cached: - //normal[i] = faceNormals()[triI]; + //normal[i] = faceNormals()[faceI]; //- Uncached - normal[i] = triSurface::operator[](triI).normal(points()); + normal[i] = triSurface::operator[](faceI).normal(points()); normal[i] /= mag(normal[i]) + VSMALL; } else diff --git a/src/meshTools/sets/cellSources/faceToCell/faceToCell.C b/src/meshTools/sets/cellSources/faceToCell/faceToCell.C index 9589929aeda44d03e879fbe431cdf40b794a12e5..a04fef9f6d52fbafaa7d21dc9dc7bdda0a336aa3 100644 --- a/src/meshTools/sets/cellSources/faceToCell/faceToCell.C +++ b/src/meshTools/sets/cellSources/faceToCell/faceToCell.C @@ -38,7 +38,11 @@ namespace Foam addToRunTimeSelectionTable(topoSetSource, faceToCell, istream); template<> - const char* Foam::NamedEnum<Foam::faceToCell::faceAction, 4>::names[] = + const char* Foam::NamedEnum + < + Foam::faceToCell::faceAction, + 4 + >::names[] = { "neighbour", "owner", diff --git a/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.C b/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.C index 2d5bd7f4d509c5cf3d5cba9fb5da181231d963d3..26bf40ec32b6cf07698ba2a7bf80e4b38e419184 100644 --- a/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.C +++ b/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.C @@ -37,7 +37,11 @@ namespace Foam addToRunTimeSelectionTable(topoSetSource, faceZoneToCell, istream); template<> - const char* Foam::NamedEnum<Foam::faceZoneToCell::faceAction, 2>::names[] = + const char* Foam::NamedEnum + < + Foam::faceZoneToCell::faceAction, + 2 + >::names[] = { "master", "slave" diff --git a/src/meshTools/sets/cellSources/pointToCell/pointToCell.C b/src/meshTools/sets/cellSources/pointToCell/pointToCell.C index ebb3a010b947d2cdae776f807e8e5579156c7dd5..aaa11f0e1dceb959c03a9e5d3f42aaaa34e3c46d 100644 --- a/src/meshTools/sets/cellSources/pointToCell/pointToCell.C +++ b/src/meshTools/sets/cellSources/pointToCell/pointToCell.C @@ -38,7 +38,11 @@ namespace Foam addToRunTimeSelectionTable(topoSetSource, pointToCell, istream); template<> - const char* Foam::NamedEnum<Foam::pointToCell::pointAction, 1>::names[] = + const char* Foam::NamedEnum + < + Foam::pointToCell::pointAction, + 1 + >::names[] = { "any" }; diff --git a/src/meshTools/sets/cellSources/rotatedBoxToCell/rotatedBoxToCell.C b/src/meshTools/sets/cellSources/rotatedBoxToCell/rotatedBoxToCell.C index c7687e33f13ba2333bfc6600fd2788d7fba75a2d..f7b3b3c65175e7ac19bdb551ca749dfc84a05f7e 100644 --- a/src/meshTools/sets/cellSources/rotatedBoxToCell/rotatedBoxToCell.C +++ b/src/meshTools/sets/cellSources/rotatedBoxToCell/rotatedBoxToCell.C @@ -128,7 +128,7 @@ Foam::rotatedBoxToCell::rotatedBoxToCell ) : topoSetSource(mesh), - origin_(origin_), + origin_(origin), i_(i), j_(j), k_(k) diff --git a/src/meshTools/sets/faceSources/cellToFace/cellToFace.C b/src/meshTools/sets/faceSources/cellToFace/cellToFace.C index 2ff1769c8f9bd301553935142ab8e30947d6f158..1f53ba286404f9c595203a295d8f2b2b50c2180e 100644 --- a/src/meshTools/sets/faceSources/cellToFace/cellToFace.C +++ b/src/meshTools/sets/faceSources/cellToFace/cellToFace.C @@ -39,7 +39,11 @@ namespace Foam addToRunTimeSelectionTable(topoSetSource, cellToFace, istream); template<> - const char* Foam::NamedEnum<Foam::cellToFace::cellAction, 2>::names[] = + const char* Foam::NamedEnum + < + Foam::cellToFace::cellAction, + 2 + >::names[] = { "all", "both" diff --git a/src/meshTools/sets/faceSources/pointToFace/pointToFace.C b/src/meshTools/sets/faceSources/pointToFace/pointToFace.C index 8e272b86dff4e720043331bbeed09e13c469a5ff..59066e87b71383cda28ccc288a8c01098a094e32 100644 --- a/src/meshTools/sets/faceSources/pointToFace/pointToFace.C +++ b/src/meshTools/sets/faceSources/pointToFace/pointToFace.C @@ -38,7 +38,11 @@ namespace Foam addToRunTimeSelectionTable(topoSetSource, pointToFace, istream); template<> - const char* Foam::NamedEnum<Foam::pointToFace::pointAction, 2>::names[] = + const char* Foam::NamedEnum + < + Foam::pointToFace::pointAction, + 2 + >::names[] = { "any", "all" diff --git a/src/meshTools/sets/pointSources/cellToPoint/cellToPoint.C b/src/meshTools/sets/pointSources/cellToPoint/cellToPoint.C index 5026b51cfc119cb0aebe2e9dc2d885bafe1a41cb..52d6ea70370ea8f58e588e2fa3809e511b1e11ed 100644 --- a/src/meshTools/sets/pointSources/cellToPoint/cellToPoint.C +++ b/src/meshTools/sets/pointSources/cellToPoint/cellToPoint.C @@ -38,7 +38,11 @@ namespace Foam addToRunTimeSelectionTable(topoSetSource, cellToPoint, istream); template<> - const char* Foam::NamedEnum<Foam::cellToPoint::cellAction, 1>::names[] = + const char* Foam::NamedEnum + < + Foam::cellToPoint::cellAction, + 1 + >::names[] = { "all" }; diff --git a/src/meshTools/sets/pointSources/faceToPoint/faceToPoint.C b/src/meshTools/sets/pointSources/faceToPoint/faceToPoint.C index 4d0919f7c88b8a94b266c1e8c47c8093cd69a0f1..4a3d8d20287d10801a983ae84c8eace042d07993 100644 --- a/src/meshTools/sets/pointSources/faceToPoint/faceToPoint.C +++ b/src/meshTools/sets/pointSources/faceToPoint/faceToPoint.C @@ -38,7 +38,11 @@ namespace Foam addToRunTimeSelectionTable(topoSetSource, faceToPoint, istream); template<> - const char* Foam::NamedEnum<Foam::faceToPoint::faceAction, 1>::names[] = + const char* Foam::NamedEnum + < + Foam::faceToPoint::faceAction, + 1 + >::names[] = { "all" }; diff --git a/src/meshTools/sets/topoSetSource/topoSetSource.C b/src/meshTools/sets/topoSetSource/topoSetSource.C index f82cf59a90df57b0e3cb87a6a7463c90b617b386..28bf1c33cdfe1024b50e45be1f07ad779fa19141 100644 --- a/src/meshTools/sets/topoSetSource/topoSetSource.C +++ b/src/meshTools/sets/topoSetSource/topoSetSource.C @@ -36,7 +36,11 @@ namespace Foam defineRunTimeSelectionTable(topoSetSource, istream); template<> - const char* Foam::NamedEnum<Foam::topoSetSource::setAction, 8>::names[] = + const char* Foam::NamedEnum + < + Foam::topoSetSource::setAction, + 8 + >::names[] = { "clear", "new", diff --git a/src/meshTools/triSurface/booleanOps/booleanSurface/booleanSurface.C b/src/meshTools/triSurface/booleanOps/booleanSurface/booleanSurface.C index dc0da28405e8607d6f4d88a4a0e24f1c9fe0017b..115149ebd318b4ad68bc3e7fb13ab19b9db5425c 100644 --- a/src/meshTools/triSurface/booleanOps/booleanSurface/booleanSurface.C +++ b/src/meshTools/triSurface/booleanOps/booleanSurface/booleanSurface.C @@ -489,7 +489,7 @@ Foam::booleanSurface::booleanSurface } labelList faceZone1; - (void)cutSurf1.markZones(isIntersectionEdge1, faceZone1); + cutSurf1.markZones(isIntersectionEdge1, faceZone1); // Check whether at least one of sides of intersection has been marked. @@ -537,7 +537,7 @@ Foam::booleanSurface::booleanSurface } labelList faceZone2; - (void)cutSurf2.markZones(isIntersectionEdge2, faceZone2); + cutSurf2.markZones(isIntersectionEdge2, faceZone2); // Check whether at least one of sides of intersection has been marked. @@ -960,20 +960,11 @@ Foam::booleanSurface::booleanSurface forAll(combinedSurf, faceI) { - const labelledTri& f = combinedSurf[faceI]; - - pointHit curHit = - triPointRef - ( - pts[f[0]], - pts[f[1]], - pts[f[2]] - ).nearestPoint(outsidePoint); + pointHit curHit = combinedSurf[faceI].nearestPoint(outsidePoint, pts); if (curHit.distance() < minHit.distance()) { minHit = curHit; - minFaceI = faceI; } } diff --git a/src/meshTools/triSurface/booleanOps/intersectedSurface/intersectedSurface.C b/src/meshTools/triSurface/booleanOps/intersectedSurface/intersectedSurface.C index 672b9efe6cf55f998653aefdfad1d33f0bc06572..592c15bd6231da13a43074c20c6e7b78cae14881 100644 --- a/src/meshTools/triSurface/booleanOps/intersectedSurface/intersectedSurface.C +++ b/src/meshTools/triSurface/booleanOps/intersectedSurface/intersectedSurface.C @@ -219,12 +219,12 @@ bool Foam::intersectedSurface::sameEdgeOrder if (fpB != -1) { // Get prev/next vertex on fA - label vA1 = fA[(fpA + 1) % 3]; - label vAMin1 = fA[fpA ? fpA-1 : 2]; + label vA1 = fA[fA.fcIndex(fpA)]; + label vAMin1 = fA[fA.rcIndex(fpA)]; // Get prev/next vertex on fB - label vB1 = fB[(fpB + 1) % 3]; - label vBMin1 = fB[fpB ? fpB-1 : 2]; + label vB1 = fB[fB.fcIndex(fpB)]; + label vBMin1 = fB[fB.rcIndex(fpB)]; if (vA1 == vB1 || vAMin1 == vBMin1) { diff --git a/src/meshTools/triSurface/booleanOps/surfaceIntersection/edgeIntersections.C b/src/meshTools/triSurface/booleanOps/surfaceIntersection/edgeIntersections.C index c8955f747091e3b79bd7bbb8d0a30d8be4753b6f..12974a0436c7947f486984eec12ae6704197b7f2 100644 --- a/src/meshTools/triSurface/booleanOps/surfaceIntersection/edgeIntersections.C +++ b/src/meshTools/triSurface/booleanOps/surfaceIntersection/edgeIntersections.C @@ -414,23 +414,14 @@ bool Foam::edgeIntersections::offsetPerturb // Classify point on face of surface2 label surf2FaceI = pHit.index(); - const labelledTri& f2 = surf2.localFaces()[surf2FaceI]; - + const triSurface::FaceType& f2 = surf2.localFaces()[surf2FaceI]; const pointField& surf2Pts = surf2.localPoints(); - label nearType; - label nearLabel; - - triPointRef tri - ( - surf2Pts[f2[0]], - surf2Pts[f2[1]], - surf2Pts[f2[2]] - ); + const point ctr = f2.centre(surf2Pts); - point ctr = tri.centre(); + label nearType, nearLabel; - tri.classify(pHit.hitPoint(), nearType, nearLabel); + f2.nearestPointClassify(pHit.hitPoint(), surf2Pts, nearType, nearLabel); if (nearType == triPointRef::POINT || nearType == triPointRef::EDGE) { diff --git a/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersection.C b/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersection.C index 58c206aa75069667f64c5f55a738f452599084b8..561b73d0840e2a8551f282a1be53cf7130f51007 100644 --- a/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersection.C +++ b/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersection.C @@ -53,22 +53,18 @@ bool Foam::surfaceIntersection::excludeEdgeHit const scalar ) { - const labelledTri& f = surf.localFaces()[faceI]; - + const triSurface::FaceType& f = surf.localFaces()[faceI]; const edge& e = surf.edges()[edgeI]; - if - ( - (f[0] == e.start()) - || (f[0] == e.end()) - || (f[1] == e.start()) - || (f[1] == e.end()) - || (f[2] == e.start()) - || (f[2] == e.end()) - ) + forAll(f, fp) { - return true; + if (f[0] == e.start() || f[0] == e.end()) + { + return true; + } + } +// { // // Get edge vector // vector eVec = e.vec(surf.localPoints()); // eVec /= mag(eVec) + VSMALL; @@ -112,11 +108,9 @@ bool Foam::surfaceIntersection::excludeEdgeHit // { // return false; // } - } - else - { - return false; - } +// } + + return false; } @@ -137,14 +131,14 @@ bool Foam::surfaceIntersection::excludeEdgeHit // // const pointField& points = surf.points(); // -// const labelledTri& f = surf.localFaces()[hitFaceI]; +// const triSurface::FaceType& f = surf.localFaces()[hitFaceI]; // // // Plane for intersect test. // plane pl(eStart, n); // // forAll(f, fp) // { -// label fp1 = (fp + 1) % 3; +// label fp1 = f.fcIndex(fp); // // const point& start = points[f[fp]]; // const point& end = points[f[fp1]]; @@ -303,19 +297,12 @@ void Foam::surfaceIntersection::classifyHit // Classify point on surface2 - const labelledTri& f2 = surf2.localFaces()[surf2FaceI]; - + const triSurface::FaceType& f2 = surf2.localFaces()[surf2FaceI]; const pointField& surf2Pts = surf2.localPoints(); - label nearType; - label nearLabel; + label nearType, nearLabel; - (void)triPointRef - ( - surf2Pts[f2[0]], - surf2Pts[f2[1]], - surf2Pts[f2[2]] - ).classify(pHit.hitPoint(), nearType, nearLabel); + f2.nearestPointClassify(pHit.hitPoint(), surf2Pts, nearType, nearLabel); // Classify points on edge of surface1 label edgeEnd = @@ -333,7 +320,7 @@ void Foam::surfaceIntersection::classifyHit if (edgeEnd >= 0) { // 1. Point hits point. Do nothing. - if (debug&2) + if (debug & 2) { Pout<< pHit.hitPoint() << " is surf1:" << " end point of edge " << e @@ -344,7 +331,7 @@ void Foam::surfaceIntersection::classifyHit else { // 2. Edge hits point. Cut edge with new point. - if (debug&2) + if (debug & 2) { Pout<< pHit.hitPoint() << " is surf1:" << " somewhere on edge " << e diff --git a/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersectionFuncs.C b/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersectionFuncs.C index 18ebd6988c075ae141024be6f81fe7076f4a89c2..eb0868ff3f2c3f05838ffed88bdb1e2175923019 100644 --- a/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersectionFuncs.C +++ b/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersectionFuncs.C @@ -90,9 +90,7 @@ Foam::label Foam::surfaceIntersection::getEdge const label fp ) { - const labelledTri& f = surf.localFaces()[faceI]; - - edge faceEdge(f[fp], f[(fp+1) % 3]); + const edge faceEdge = surf.localFaces()[faceI].faceEdge(fp); const labelList& eLabels = surf.faceEdges()[faceI]; diff --git a/src/meshTools/triSurface/octreeData/octreeDataTriSurface.C b/src/meshTools/triSurface/octreeData/octreeDataTriSurface.C index 55e60a3111cd5bd5c698a592edd70b5753ae603e..3fb046c55cf5dfabae2f4e6795289ae4406a5410 100644 --- a/src/meshTools/triSurface/octreeData/octreeDataTriSurface.C +++ b/src/meshTools/triSurface/octreeData/octreeDataTriSurface.C @@ -340,15 +340,7 @@ Foam::label Foam::octreeDataTriSurface::getSampleType << abort(FatalError); } - const pointField& pts = surface_.points(); - const labelledTri& f = surface_[faceI]; - - pointHit curHit = triPointRef - ( - pts[f[0]], - pts[f[1]], - pts[f[2]] - ).nearestPoint(sample); + pointHit curHit = surface_[faceI].nearestPoint(sample, surface_.points()); // Get normal according to position on face. On point -> pointNormal, // on edge-> edge normal, face normal on interior. @@ -387,17 +379,16 @@ bool Foam::octreeDataTriSurface::overlaps // Triangle points const pointField& points = surface_.points(); const labelledTri& f = surface_[index]; - const point& p0 = points[f[0]]; - const point& p1 = points[f[1]]; - const point& p2 = points[f[2]]; // Check if one or more triangle point inside - if (cubeBb.contains(p0) || cubeBb.contains(p1) || cubeBb.contains(p2)) + if (cubeBb.containsAny(points, f)) { - // One or more points inside return true; } + const point& p0 = points[f[0]]; + const point& p1 = points[f[1]]; + const point& p2 = points[f[2]]; // Now we have the difficult case: all points are outside but connecting // edges might go through cube. Use fast intersection of bounding box. @@ -433,18 +424,18 @@ bool Foam::octreeDataTriSurface::intersects return false; } - const pointField& points = surface_.points(); - - const labelledTri& f = surface_[index]; - - triPointRef tri(points[f[0]], points[f[1]], points[f[2]]); - const vector dir(end - start); // Disable picking up intersections behind us. scalar oldTol = intersection::setPlanarTol(0.0); - pointHit inter = tri.ray(start, dir, intersection::HALF_RAY); + pointHit inter = surface_[index].ray + ( + start, + dir, + surface_.points(), + intersection::HALF_RAY + ); intersection::setPlanarTol(oldTol); @@ -512,10 +503,8 @@ Foam::scalar Foam::octreeDataTriSurface::calcSign { n = surface_.faceNormals()[index]; - const labelledTri& tri = surface_[index]; - - // take vector from sample to any point on triangle (we use vertex 0) - vector vec = sample - surface_.points()[tri[0]]; + // take vector from sample to any point on face (we use vertex 0) + vector vec = sample - surface_.points()[surface_[index][0]]; vec /= mag(vec) + VSMALL; diff --git a/src/meshTools/triSurface/orientedSurface/orientedSurface.C b/src/meshTools/triSurface/orientedSurface/orientedSurface.C index 38a7afd4b8ed5ad7524dcdc223a303695d672c2f..9c78bb10530bc68466264efcabdbe89ff2113bd6 100644 --- a/src/meshTools/triSurface/orientedSurface/orientedSurface.C +++ b/src/meshTools/triSurface/orientedSurface/orientedSurface.C @@ -34,38 +34,15 @@ defineTypeNameAndDebug(Foam::orientedSurface, 0); // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -// Return true if face uses edge from start to end. -bool Foam::orientedSurface::edgeOrder -( - const labelledTri& f, - const edge& e -) -{ - if - ( - (f[0] == e[0] && f[1] == e[1]) - || (f[1] == e[0] && f[2] == e[1]) - || (f[2] == e[0] && f[0] == e[1]) - ) - { - return true; - } - else - { - return false; - } -} - - // Return true if edge is used in opposite order in faces bool Foam::orientedSurface::consistentEdge ( const edge& e, - const labelledTri& f0, - const labelledTri& f1 + const triSurface::FaceType& f0, + const triSurface::FaceType& f1 ) { - return edgeOrder(f0, e) ^ edgeOrder(f1, e); + return (f0.edgeDirection(e) > 0) ^ (f1.edgeDirection(e) > 0); } @@ -118,8 +95,8 @@ Foam::labelList Foam::orientedSurface::edgeToFace label face0 = eFaces[0]; label face1 = eFaces[1]; - const labelledTri& f0 = s.localFaces()[face0]; - const labelledTri& f1 = s.localFaces()[face1]; + const triSurface::FaceType& f0 = s.localFaces()[face0]; + const triSurface::FaceType& f1 = s.localFaces()[face1]; if (flip[face0] == UNVISITED) { @@ -401,15 +378,8 @@ bool Foam::orientedSurface::orient { if (flipState[faceI] == UNVISITED) { - const labelledTri& f = s[faceI]; - pointHit curHit = - triPointRef - ( - s.points()[f[0]], - s.points()[f[1]], - s.points()[f[2]] - ).nearestPoint(samplePoint); + s[faceI].nearestPoint(samplePoint, s.points()); if (curHit.distance() < minDist) { diff --git a/src/meshTools/triSurface/orientedSurface/orientedSurface.H b/src/meshTools/triSurface/orientedSurface/orientedSurface.H index c4f15e0dc6ebdc0b5b215c72e53481c9c9a74319..8bfa3106cfc7d26d4a07535c484ccc3d998277ba 100644 --- a/src/meshTools/triSurface/orientedSurface/orientedSurface.H +++ b/src/meshTools/triSurface/orientedSurface/orientedSurface.H @@ -66,15 +66,12 @@ class orientedSurface // Private Member Functions - //- Return true if face uses edge from start to end. - static bool edgeOrder(const labelledTri&, const edge&); - //- Return true if edge is used in opposite order in faces static bool consistentEdge ( const edge& e, - const labelledTri& f0, - const labelledTri& f1 + const triSurface::FaceType& f0, + const triSurface::FaceType& f1 ); //- From changed faces get the changed edges diff --git a/src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.C b/src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.C index 2555c75f82a6f2c59356045408aa59f060363be4..1b4d7938edf16418198e3c9102678ce38600ff8c 100644 --- a/src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.C +++ b/src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.C @@ -31,20 +31,15 @@ License #include "line.H" #include "cpuTime.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -const point triSurfaceSearch::greatPoint(GREAT, GREAT, GREAT); +const Foam::point Foam::triSurfaceSearch::greatPoint(GREAT, GREAT, GREAT); // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // Construct from surface. Holds reference! -triSurfaceSearch::triSurfaceSearch(const triSurface& surface) +Foam::triSurfaceSearch::triSurfaceSearch(const triSurface& surface) : surface_(surface), treePtr_(NULL) @@ -82,7 +77,10 @@ triSurfaceSearch::triSurfaceSearch(const triSurface& surface) // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // Determine inside/outside for samples -boolList triSurfaceSearch::calcInside(const pointField& samples) const +Foam::boolList Foam::triSurfaceSearch::calcInside +( + const pointField& samples +) const { boolList inside(samples.size()); @@ -111,7 +109,7 @@ boolList triSurfaceSearch::calcInside(const pointField& samples) const } -labelList triSurfaceSearch::calcNearestTri +Foam::labelList Foam::triSurfaceSearch::calcNearestTri ( const pointField& samples, const vector& span @@ -142,7 +140,7 @@ labelList triSurfaceSearch::calcNearestTri // Nearest point on surface -tmp<pointField> triSurfaceSearch::calcNearest +Foam::tmp<Foam::pointField> Foam::triSurfaceSearch::calcNearest ( const pointField& samples, const vector& span @@ -173,8 +171,12 @@ tmp<pointField> triSurfaceSearch::calcNearest } -pointIndexHit triSurfaceSearch::nearest(const point& pt, const vector& span) - const +Foam::pointIndexHit Foam::triSurfaceSearch::nearest +( + const point& pt, + const vector& span +) +const { const scalar nearestDistSqr = 0.25*magSqr(span); @@ -182,8 +184,4 @@ pointIndexHit triSurfaceSearch::nearest(const point& pt, const vector& span) } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/meshTools/triSurface/triSurfaceTools/triSurfaceTools.C b/src/meshTools/triSurface/triSurfaceTools/triSurfaceTools.C index af30b3bcc8954ad5e86916ff97d9d62e04c113cf..ba0161219e83d7c5541fb7dd7f7377fbfa87d38a 100644 --- a/src/meshTools/triSurface/triSurfaceTools/triSurfaceTools.C +++ b/src/meshTools/triSurface/triSurfaceTools/triSurfaceTools.C @@ -1111,7 +1111,7 @@ void Foam::triSurfaceTools::snapToEnd if (current.elementType() == triPointRef::NONE) { // endpoint on point; current on triangle - const labelledTri& f = s.localFaces()[current.index()]; + const triSurface::FaceType& f = s.localFaces()[current.index()]; if (findIndex(f, end.index()) != -1) { @@ -1566,8 +1566,7 @@ Foam::label Foam::triSurfaceTools::oppositeVertex const label edgeI ) { - const labelledTri& f = surf.localFaces()[faceI]; - + const triSurface::FaceType& f = surf.localFaces()[faceI]; const edge& e = surf.edges()[edgeI]; forAll(f, fp) @@ -1601,7 +1600,6 @@ Foam::label Foam::triSurfaceTools::getEdge forAll(v1Edges, v1EdgeI) { label edgeI = v1Edges[v1EdgeI]; - const edge& e = surf.edges()[edgeI]; if ((e.start() == v2) || (e.end() == v2)) @@ -2116,18 +2114,12 @@ Foam::vector Foam::triSurfaceTools::surfaceNormal const point& nearestPt ) { - const labelledTri& f = surf[nearestFaceI]; + const triSurface::FaceType& f = surf[nearestFaceI]; const pointField& points = surf.points(); - label nearType; - label nearLabel; + label nearType, nearLabel; - triPointRef - ( - points[f[0]], - points[f[1]], - points[f[2]] - ).classify(nearestPt, nearType, nearLabel); + f.nearestPointClassify(nearestPt, points, nearType, nearLabel); if (nearType == triPointRef::NONE) { @@ -2153,7 +2145,7 @@ Foam::vector Foam::triSurfaceTools::surfaceNormal else { // Nearest to point - const labelledTri& localF = surf.localFaces()[nearestFaceI]; + const triSurface::FaceType& localF = surf.localFaces()[nearestFaceI]; return surf.pointNormals()[localF[nearLabel]]; } } @@ -2203,18 +2195,13 @@ Foam::triSurfaceTools::sideType Foam::triSurfaceTools::surfaceSide const label nearestFaceI ) { - const labelledTri& f = surf[nearestFaceI]; + const triSurface::FaceType& f = surf[nearestFaceI]; const pointField& points = surf.points(); - // Find where point is on triangle. + // Find where point is on face label nearType, nearLabel; - pointHit pHit = triPointRef - ( - points[f[0]], - points[f[1]], - points[f[2]] - ).nearestPointClassify(sample, nearType, nearLabel); + pointHit pHit = f.nearestPointClassify(sample, points, nearType, nearLabel); const point& nearestPoint(pHit.rawPoint()); @@ -2304,7 +2291,7 @@ Foam::triSurfaceTools::sideType Foam::triSurfaceTools::surfaceSide // above (nearType == triPointRef::EDGE). - const labelledTri& localF = surf.localFaces()[nearestFaceI]; + const triSurface::FaceType& localF = surf.localFaces()[nearestFaceI]; label nearPointI = localF[nearLabel]; const edgeList& edges = surf.edges(); @@ -2497,7 +2484,7 @@ Foam::triSurface Foam::triSurfaceTools::triangulateFaceCentre forAll(f, fp) { - label fp1 = (fp + 1) % f.size(); + label fp1 = f.fcIndex(fp); triangles.append(labelledTri(f[fp], f[fp1], fc, newPatchI)); diff --git a/src/parallel/decompose/decompositionMethods/hierarchGeomDecomp/hierarchGeomDecomp.C b/src/parallel/decompose/decompositionMethods/hierarchGeomDecomp/hierarchGeomDecomp.C index 921e04d2aa4f6d7e2d65b3873831c75c47cddb93..a61bc785c101053298a23313abe3190d6aecd2dc 100644 --- a/src/parallel/decompose/decompositionMethods/hierarchGeomDecomp/hierarchGeomDecomp.C +++ b/src/parallel/decompose/decompositionMethods/hierarchGeomDecomp/hierarchGeomDecomp.C @@ -59,7 +59,7 @@ void Foam::hierarchGeomDecomp::setDecompOrder() << exit(FatalIOError); } - for (label i = 0; i < 3; i++) + for (label i = 0; i < 3; ++i) { if (order[i] == 'x') { @@ -693,8 +693,7 @@ Foam::labelList Foam::hierarchGeomDecomp::decompose slice[i] = i; } - pointField rotatedPoints = rotDelta_ & points; - + pointField rotatedPoints(rotDelta_ & points); // Calculate tolerance of cell distribution. For large cases finding // distibution to the cell exact would cause too many iterations so allow @@ -735,7 +734,7 @@ Foam::labelList Foam::hierarchGeomDecomp::decompose slice[i] = i; } - pointField rotatedPoints = rotDelta_ & points; + pointField rotatedPoints(rotDelta_ & points); // Calculate tolerance of cell distribution. For large cases finding // distibution to the cell exact would cause too many iterations so allow @@ -775,6 +774,4 @@ Foam::hierarchGeomDecomp::hierarchGeomDecomp } -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - // ************************************************************************* // diff --git a/src/parallel/decompose/decompositionMethods/simpleGeomDecomp/simpleGeomDecomp.C b/src/parallel/decompose/decompositionMethods/simpleGeomDecomp/simpleGeomDecomp.C index d7f45bb1e73af4d3a27b443f085ff83d77fce93a..99e219f5994fd82172647c1d7a2b3907866a2014 100644 --- a/src/parallel/decompose/decompositionMethods/simpleGeomDecomp/simpleGeomDecomp.C +++ b/src/parallel/decompose/decompositionMethods/simpleGeomDecomp/simpleGeomDecomp.C @@ -139,7 +139,7 @@ Foam::labelList Foam::simpleGeomDecomp::decompose(const pointField& points) pointIndices[i] = i; } - pointField rotatedPoints = rotDelta_ & points; + const pointField rotatedPoints(rotDelta_ & points); // and one to take the processor group id's. For each direction. // we assign the processors to groups of processors labelled @@ -212,7 +212,7 @@ Foam::labelList Foam::simpleGeomDecomp::decompose pointIndices[i] = i; } - pointField rotatedPoints = rotDelta_ & points; + const pointField rotatedPoints(rotDelta_ & points); // and one to take the processor group id's. For each direction. // we assign the processors to groups of processors labelled diff --git a/src/parallel/decompose/decompositionMethods/structuredDecomp/topoDistanceData.C b/src/parallel/decompose/decompositionMethods/structuredDecomp/topoDistanceData.C index 8c74b47a6f92d1260ee8ecb085ed915d398da88c..50ce80d4fee431c2915807bfd8103bcd4a6becee 100644 --- a/src/parallel/decompose/decompositionMethods/structuredDecomp/topoDistanceData.C +++ b/src/parallel/decompose/decompositionMethods/structuredDecomp/topoDistanceData.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/parallel/decompose/decompositionMethods/structuredDecomp/topoDistanceData.H b/src/parallel/decompose/decompositionMethods/structuredDecomp/topoDistanceData.H index 9f4f1ee2cf4a2bbfdc6ed30171983d43ffc2aff3..ba5a60c8e1389c6af0a4584dccd90ee55f5336c7 100644 --- a/src/parallel/decompose/decompositionMethods/structuredDecomp/topoDistanceData.H +++ b/src/parallel/decompose/decompositionMethods/structuredDecomp/topoDistanceData.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/parallel/decompose/decompositionMethods/structuredDecomp/topoDistanceDataI.H b/src/parallel/decompose/decompositionMethods/structuredDecomp/topoDistanceDataI.H index 58d730583e5c1fc8f6e36aaa30168af054fc7424..d34aff7987b6cabbb4c9b75b40a2c01cd674cc3a 100644 --- a/src/parallel/decompose/decompositionMethods/structuredDecomp/topoDistanceDataI.H +++ b/src/parallel/decompose/decompositionMethods/structuredDecomp/topoDistanceDataI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.C b/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.C index f08ab6536369c1286e9433b841372a1d30e75ea8..c9728768ddc73939dc9cfc3d1b75fa64525b6bc1 100644 --- a/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.C +++ b/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.H b/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.H index 6a6937ac79a0d50a2ce66a5a8d90ba29af22390b..898a07870499b6a00cec02bddab17e1222fea73a 100644 --- a/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.H +++ b/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/parallel/decompose/scotchDecomp/scotchDecomp.C b/src/parallel/decompose/scotchDecomp/scotchDecomp.C index e22300e057de8ba273c90b2c574694a85a5dbce6..b569b0bae5c83cfd83b699539a577fa1b32e837e 100644 --- a/src/parallel/decompose/scotchDecomp/scotchDecomp.C +++ b/src/parallel/decompose/scotchDecomp/scotchDecomp.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/parallel/decompose/scotchDecomp/scotchDecomp.H b/src/parallel/decompose/scotchDecomp/scotchDecomp.H index 6ec5c474c24dd431e7762f14f5550b5c6fa37388..a4348a7641337fcc7aa945fbff7f6e7518e4829d 100644 --- a/src/parallel/decompose/scotchDecomp/scotchDecomp.H +++ b/src/parallel/decompose/scotchDecomp/scotchDecomp.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/parallel/distributed/distributedTriSurfaceMesh/distributedTriSurfaceMesh.C b/src/parallel/distributed/distributedTriSurfaceMesh/distributedTriSurfaceMesh.C index 740c2184d5ca0c31c118c33454eda2ba2ff48a90..0043b68af4181c536a27ca0a121114238e5fb1aa 100644 --- a/src/parallel/distributed/distributedTriSurfaceMesh/distributedTriSurfaceMesh.C +++ b/src/parallel/distributed/distributedTriSurfaceMesh/distributedTriSurfaceMesh.C @@ -63,6 +63,7 @@ namespace Foam }; } + const Foam::NamedEnum<Foam::distributedTriSurfaceMesh::distributionType, 3> Foam::distributedTriSurfaceMesh::distributionTypeNames_; @@ -871,18 +872,13 @@ Foam::distributedTriSurfaceMesh::independentlyDistributedBbs point& bbMin = bbs[distribution[triI]][0].min(); point& bbMax = bbs[distribution[triI]][0].max(); - const labelledTri& f = s[triI]; - const point& p0 = s.points()[f[0]]; - const point& p1 = s.points()[f[1]]; - const point& p2 = s.points()[f[2]]; - - bbMin = min(bbMin, p0); - bbMin = min(bbMin, p1); - bbMin = min(bbMin, p2); - - bbMax = max(bbMax, p0); - bbMax = max(bbMax, p1); - bbMax = max(bbMax, p2); + const triSurface::FaceType& f = s[triI]; + forAll(f, fp) + { + const point& pt = s.points()[f[fp]]; + bbMin = ::Foam::min(bbMin, pt); + bbMax = ::Foam::max(bbMax, pt); + } } // Now combine for all processors and convert to correct format. @@ -971,12 +967,12 @@ void Foam::distributedTriSurfaceMesh::subsetMeshMap // Store new faces compact newToOldFaces[faceI++] = oldFacei; - // Renumber labels for triangle - const labelledTri& tri = s[oldFacei]; + // Renumber labels for face + const triSurface::FaceType& f = s[oldFacei]; - forAll(tri, fp) + forAll(f, fp) { - label oldPointI = tri[fp]; + label oldPointI = f[fp]; if (oldToNewPoints[oldPointI] == -1) { @@ -1090,12 +1086,12 @@ Foam::triSurface Foam::distributedTriSurfaceMesh::subsetMesh { if (include[oldFacei]) { - // Renumber labels for triangle - const labelledTri& tri = s[oldFacei]; + // Renumber labels for face + const triSurface::FaceType& f = s[oldFacei]; - forAll(tri, fp) + forAll(f, fp) { - label oldPointI = tri[fp]; + label oldPointI = f[fp]; if (oldToNewPoints[oldPointI] == -1) { diff --git a/src/parallel/reconstruct/reconstruct/fvFieldReconstructor.H b/src/parallel/reconstruct/reconstruct/fvFieldReconstructor.H index c2df14ba473ff04959d0658a6abe9c6ea1f15695..3f18a15a226517f8b42357618b02d10be89ad5ed 100644 --- a/src/parallel/reconstruct/reconstruct/fvFieldReconstructor.H +++ b/src/parallel/reconstruct/reconstruct/fvFieldReconstructor.H @@ -117,7 +117,7 @@ public: const labelUList& directAddressing() const { - return unallocLabelList::null(); + return labelUList::null(); } }; diff --git a/src/parallel/reconstruct/reconstruct/pointFieldReconstructor.H b/src/parallel/reconstruct/reconstruct/pointFieldReconstructor.H index dbb6728c9cc453913d87a871205efd75688cd6dc..6271fc5e40db793cfe0c33bc39ac79982c853487 100644 --- a/src/parallel/reconstruct/reconstruct/pointFieldReconstructor.H +++ b/src/parallel/reconstruct/reconstruct/pointFieldReconstructor.H @@ -114,7 +114,7 @@ public: const labelUList& directAddressing() const { - return unallocLabelList::null(); + return labelUList::null(); } }; diff --git a/src/postProcessing/functionObjects/field/fieldAverage/fieldAverageItem/fieldAverageItem.C b/src/postProcessing/functionObjects/field/fieldAverage/fieldAverageItem/fieldAverageItem.C index ee3d6e4e8ae331cfd04a403cfff6429449d4fba6..183de36c2c6368d607c4a72fafba3a6d4d080bba 100644 --- a/src/postProcessing/functionObjects/field/fieldAverage/fieldAverageItem/fieldAverageItem.C +++ b/src/postProcessing/functionObjects/field/fieldAverage/fieldAverageItem/fieldAverageItem.C @@ -30,7 +30,11 @@ License namespace Foam { template<> - const char* Foam::NamedEnum<Foam::fieldAverageItem::baseType, 2>::names[] = + const char* Foam::NamedEnum + < + Foam::fieldAverageItem::baseType, + 2 + >::names[] = { "iteration", "time" diff --git a/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.C b/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.C index c0f715e71621aafe1527f9b2c2a8363cd217812e..ac9eeab52dd56f3d9b8be1b629473f82b53ced8f 100644 --- a/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.C +++ b/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.C @@ -36,7 +36,11 @@ defineTypeNameAndDebug(Foam::fieldMinMax, 0); namespace Foam { template<> - const char* Foam::NamedEnum<Foam::fieldMinMax::modeType, 2>::names[] = + const char* Foam::NamedEnum + < + Foam::fieldMinMax::modeType, + 2 + >::names[] = { "magnitude", "component" diff --git a/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C index e3755efbb8bc319dd712b21fff771411c30cf24f..896026c35677690b52a49d28b29ea59337e11efd 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C +++ b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C @@ -31,21 +31,42 @@ License defineTypeNameAndDebug(Foam::fieldValues::cellSource, 0); -template<> -const char* Foam::NamedEnum<Foam::fieldValues::cellSource::sourceType, 2>:: -names[] = {"cellZone", "all"}; +namespace Foam +{ + + template<> + const char* Foam::NamedEnum + < + Foam::fieldValues::cellSource::sourceType, + 2 + >::names[] = + { + "cellZone", + "all" + }; + + + template<> + const char* Foam::NamedEnum + < + Foam::fieldValues::cellSource::operationType, + 7 + >::names[] = + { + "none", + "sum", + "volAverage", + "volIntegrate", + "weightedAverage", + "min", + "max" + }; +} + const Foam::NamedEnum<Foam::fieldValues::cellSource::sourceType, 2> Foam::fieldValues::cellSource::sourceTypeNames_; -template<> -const char* Foam::NamedEnum<Foam::fieldValues::cellSource::operationType, 7>:: -names[] = -{ - "none", "sum", "volAverage", - "volIntegrate", "weightedAverage", "min", "max" -}; - const Foam::NamedEnum<Foam::fieldValues::cellSource::operationType, 7> Foam::fieldValues::cellSource::operationTypeNames_; diff --git a/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSourceTemplates.C b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSourceTemplates.C index a04be6c0ba277b0a5acc865e304c4731290c3c30..719393b252b4779edb29e66f1167b8e17e99dd38 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSourceTemplates.C +++ b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSourceTemplates.C @@ -119,12 +119,14 @@ bool Foam::fieldValues::cellSource::writeValues(const word& fieldName) if (ok) { - Field<Type> values = combineFields(setFieldValues<Type>(fieldName)); + Field<Type> values(combineFields(setFieldValues<Type>(fieldName))); - scalarField V = combineFields(filterField(mesh().V())); + scalarField V(combineFields(filterField(mesh().V()))); - scalarField weightField = - combineFields(setFieldValues<scalar>(weightFieldName_)); + scalarField weightField + ( + combineFields(setFieldValues<scalar>(weightFieldName_)) + ); if (Pstream::master()) { diff --git a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C index 472f725dc4275c011a627f813db216f5b9f6de4a..838658d1a26b723cf5ad363551d37f2b1888bdc6 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C +++ b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C @@ -34,24 +34,42 @@ License defineTypeNameAndDebug(Foam::fieldValues::faceSource, 0); -template<> -const char* Foam::NamedEnum<Foam::fieldValues::faceSource::sourceType, 3>:: -names[] = +namespace Foam { - "faceZone", "patch", "sampledSurface" -}; + template<> + const char* Foam::NamedEnum + < + Foam::fieldValues::faceSource::sourceType, + 3 + >::names[] = + { + "faceZone", + "patch", + "sampledSurface" + }; + + + template<> + const char* Foam::NamedEnum + < + Foam::fieldValues::faceSource::operationType, + 7 + >::names[] = + { + "none", + "sum", + "areaAverage", + "areaIntegrate", + "weightedAverage", + "min", + "max" + }; -const Foam::NamedEnum<Foam::fieldValues::faceSource::sourceType, 3> - Foam::fieldValues::faceSource::sourceTypeNames_; +} -template<> -const char* Foam::NamedEnum<Foam::fieldValues::faceSource::operationType, 7>:: -names[] = -{ - "none", "sum", "areaAverage", - "areaIntegrate", "weightedAverage", "min", "max" -}; +const Foam::NamedEnum<Foam::fieldValues::faceSource::sourceType, 3> + Foam::fieldValues::faceSource::sourceTypeNames_; const Foam::NamedEnum<Foam::fieldValues::faceSource::operationType, 7> Foam::fieldValues::faceSource::operationTypeNames_; diff --git a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSourceTemplates.C b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSourceTemplates.C index 9999860a62313f130feadf16df04c45422539831..d8ab9fac28f2fa127d44592af2baba9ba8d6f191 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSourceTemplates.C +++ b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSourceTemplates.C @@ -138,8 +138,8 @@ bool Foam::fieldValues::faceSource::writeValues(const word& fieldName) if (ok) { - Field<Type> values = getFieldValues<Type>(fieldName); - scalarField weightField = getFieldValues<scalar>(weightFieldName_); + Field<Type> values(getFieldValues<Type>(fieldName)); + scalarField weightField(getFieldValues<scalar>(weightFieldName_)); scalarField magSf; if (surfacePtr_.valid()) diff --git a/src/postProcessing/functionObjects/forces/forces/forces.C b/src/postProcessing/functionObjects/forces/forces/forces.C index c04659c92aeb7bc04852ff13bca02bf96d29743f..d70734069c4037a8535720922f2c7db9bab46f6d 100644 --- a/src/postProcessing/functionObjects/forces/forces/forces.C +++ b/src/postProcessing/functionObjects/forces/forces/forces.C @@ -408,22 +408,24 @@ Foam::forces::forcesMoments Foam::forces::calcForcesMoment() const { label patchi = iter.key(); - vectorField Md = mesh.C().boundaryField()[patchi] - CofR_; + vectorField Md(mesh.C().boundaryField()[patchi] - CofR_); - scalarField sA = mag(Sfb[patchi]); + scalarField sA(mag(Sfb[patchi])); // Normal force = surfaceUnitNormal * (surfaceNormal & forceDensity) - vectorField fN = + vectorField fN + ( Sfb[patchi]/sA *( Sfb[patchi] & fD.boundaryField()[patchi] - ); + ) + ); fm.first().first() += sum(fN); fm.second().first() += sum(Md ^ fN); // Tangential force (total force minus normal fN) - vectorField fT = sA*fD.boundaryField()[patchi] - fN; + vectorField fT(sA*fD.boundaryField()[patchi] - fN); fm.first().second() += sum(fT); fm.second().second() += sum(Md ^ fT); @@ -450,14 +452,14 @@ Foam::forces::forcesMoments Foam::forces::calcForcesMoment() const { label patchi = iter.key(); - vectorField Md = mesh.C().boundaryField()[patchi] - CofR_; + vectorField Md(mesh.C().boundaryField()[patchi] - CofR_); - vectorField pf = Sfb[patchi]*(p.boundaryField()[patchi] - pRef); + vectorField pf(Sfb[patchi]*(p.boundaryField()[patchi] - pRef)); fm.first().first() += rho(p)*sum(pf); fm.second().first() += rho(p)*sum(Md ^ pf); - vectorField vf = Sfb[patchi] & devRhoReffb[patchi]; + vectorField vf(Sfb[patchi] & devRhoReffb[patchi]); fm.first().second() += sum(vf); fm.second().second() += sum(Md ^ vf); diff --git a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyDisplacement/sixDoFRigidBodyDisplacementPointPatchVectorField.C b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyDisplacement/sixDoFRigidBodyDisplacementPointPatchVectorField.C index 1049650cb248ca94406a4ac3892fb458e7272a50..6109090ef4c5be74242185daf20b831baa7ee607 100644 --- a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyDisplacement/sixDoFRigidBodyDisplacementPointPatchVectorField.C +++ b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyDisplacement/sixDoFRigidBodyDisplacementPointPatchVectorField.C @@ -268,7 +268,7 @@ void sixDoFRigidBodyDisplacementPointPatchVectorField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePointPatchTypeField +makeNonTemplatedPointPatchTypeField ( pointPatchVectorField, sixDoFRigidBodyDisplacementPointPatchVectorField diff --git a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/uncoupledSixDoFRigidBodyDisplacement/uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField.C b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/uncoupledSixDoFRigidBodyDisplacement/uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField.C index 4ae7651f631baac421c69464281585c5188d4592..f9207a81103b2c55a0517f2aa60385c355ce02a8 100644 --- a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/uncoupledSixDoFRigidBodyDisplacement/uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField.C +++ b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/uncoupledSixDoFRigidBodyDisplacement/uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField.C @@ -185,7 +185,7 @@ void uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField::write // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePointPatchTypeField +makeNonTemplatedPointPatchTypeField ( pointPatchVectorField, uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField diff --git a/src/postProcessing/functionObjects/jobControl/abortCalculation/abortCalculation.C b/src/postProcessing/functionObjects/jobControl/abortCalculation/abortCalculation.C index f26f558fb50cac4044d1b74d51de43c1f9489a3d..90f7b907f1b5232188ed277ab21fbed68286d61a 100644 --- a/src/postProcessing/functionObjects/jobControl/abortCalculation/abortCalculation.C +++ b/src/postProcessing/functionObjects/jobControl/abortCalculation/abortCalculation.C @@ -42,8 +42,8 @@ namespace Foam template<> const char* Foam::NamedEnum < - Foam::abortCalculation::actionType, - 3 + Foam::abortCalculation::actionType, + 3 >::names[] = { "noWriteNow", diff --git a/src/randomProcesses/noise/noiseFFT.C b/src/randomProcesses/noise/noiseFFT.C index d5b8200a14783324f4d1a7da18557d44dffe4b66..0b0be405d26c62bb044163a923dc6eec4283d8b5 100644 --- a/src/randomProcesses/noise/noiseFFT.C +++ b/src/randomProcesses/noise/noiseFFT.C @@ -34,6 +34,7 @@ License Foam::scalar Foam::noiseFFT::p0 = 2e-5; + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // Construct from pressure field @@ -226,9 +227,9 @@ Foam::graph Foam::noiseFFT::meanPf scalarField MeanPf(N/2, 0.0); - scalarField Hwf = Hanning(N); + scalarField Hwf(Hanning(N)); - for (label wi=0; wi<nw; wi++) + for (label wi=0; wi<nw; ++wi) { MeanPf += Pf(Hwf*window(N, wi)); } @@ -272,9 +273,9 @@ Foam::graph Foam::noiseFFT::RMSmeanPf scalarField RMSMeanPf(N/2, 0.0); - scalarField Hwf = Hanning(N); + scalarField Hwf(Hanning(N)); - for (label wi=0; wi<nw; wi++) + for (label wi=0; wi<nw; ++wi) { RMSMeanPf += sqr(Pf(Hwf*window(N, wi))); } diff --git a/src/randomProcesses/turbulence/turbGen.C b/src/randomProcesses/turbulence/turbGen.C index 5b02dbfc2bac756120535da182574f996c331f0b..1bbba2acee3f344e8cad9da2d50cbf2f192ef51a 100644 --- a/src/randomProcesses/turbulence/turbGen.C +++ b/src/randomProcesses/turbulence/turbGen.C @@ -30,15 +30,10 @@ License #include "Ek.H" #include "mathematicalConstants.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// from components -turbGen::turbGen(const Kmesh& k, const scalar EA, const scalar K0) +Foam::turbGen::turbGen(const Kmesh& k, const scalar EA, const scalar K0) : K(k), Ea(EA), @@ -49,8 +44,7 @@ turbGen::turbGen(const Kmesh& k, const scalar EA, const scalar K0) // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -// generate and return a velocity field -vectorField turbGen::U() +Foam::vectorField Foam::turbGen::U() { vectorField s(K.size()); scalarField rndPhases(K.size()); @@ -66,21 +60,18 @@ vectorField turbGen::U() s = Ek(Ea, k0, mag(K))*s; - complexVectorField up = + complexVectorField up + ( fft::reverseTransform ( ComplexField(cos(constant::mathematical::twoPi*rndPhases)*s, sin(constant::mathematical::twoPi*rndPhases)*s), K.nn() - ); + ) + ); return ReImSum(up); } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // - diff --git a/src/sampling/cuttingPlane/cuttingPlane.C b/src/sampling/cuttingPlane/cuttingPlane.C index f2ed510a5522f88cfda40272c67059b1c8a01f15..989791e32faaa405bdf1465461d8ad57781a2156 100644 --- a/src/sampling/cuttingPlane/cuttingPlane.C +++ b/src/sampling/cuttingPlane/cuttingPlane.C @@ -315,7 +315,7 @@ void Foam::cuttingPlane::walkCellCuts // Orient face to point in the same direction as the plane normal if ((f.normal(cutPoints) & normal()) < 0) { - f = f.reverseFace(); + f.flip(); } // the cut faces are usually quite ugly, so optionally triangulate @@ -378,7 +378,7 @@ void Foam::cuttingPlane::reCut MeshStorage::clear(); cutCells_.clear(); - scalarField dotProducts = (mesh.points() - refPoint()) & normal(); + const scalarField dotProducts((mesh.points() - refPoint()) & normal()); // Determine cells that are (probably) cut. calcCutCells(mesh, dotProducts, cellIdLabels); diff --git a/src/sampling/probes/patchProbesTemplates.C b/src/sampling/probes/patchProbesTemplates.C index c8176fb398db5d18f074c2ab6ee2fef9b228150b..e66d3d7c928f53679f8ed6529f57a00753ffa56d 100644 --- a/src/sampling/probes/patchProbesTemplates.C +++ b/src/sampling/probes/patchProbesTemplates.C @@ -36,7 +36,7 @@ void Foam::patchProbes::sampleAndWrite const GeometricField<Type, fvPatchField, volMesh>& vField ) { - Field<Type> values = sample(vField); + Field<Type> values(sample(vField)); if (Pstream::master()) { diff --git a/src/sampling/probes/probesTemplates.C b/src/sampling/probes/probesTemplates.C index 68531abdcac8a5e6df07d18728df8cab53b7cfdf..fdff8e115650cbe5cca57f31e3c34b26a5be038c 100644 --- a/src/sampling/probes/probesTemplates.C +++ b/src/sampling/probes/probesTemplates.C @@ -68,7 +68,7 @@ void Foam::probes::sampleAndWrite const GeometricField<Type, fvPatchField, volMesh>& vField ) { - Field<Type> values = sample(vField); + Field<Type> values(sample(vField)); if (Pstream::master()) { diff --git a/src/sampling/sampledSet/coordSet/coordSet.C b/src/sampling/sampledSet/coordSet/coordSet.C index 24d6b4174cadc7318b4fe72a2b944aa3f299721a..81e322d6a6ff892b2392a85e16590b657a8690a7 100644 --- a/src/sampling/sampledSet/coordSet/coordSet.C +++ b/src/sampling/sampledSet/coordSet/coordSet.C @@ -30,7 +30,11 @@ License namespace Foam { template<> - const char* Foam::NamedEnum<Foam::coordSet::coordFormat, 5>::names[] = + const char* Foam::NamedEnum + < + Foam::coordSet::coordFormat, + 5 + >::names[] = { "xyz", "x", diff --git a/src/sampling/sampledSet/writers/gnuplot/gnuplotSetWriter.C b/src/sampling/sampledSet/writers/gnuplot/gnuplotSetWriter.C index b9c5466b6c79fe354674dd94878e6adfbae1b25d..72359ebb37fe7454e0883eef0a6e2adda0a753b0 100644 --- a/src/sampling/sampledSet/writers/gnuplot/gnuplotSetWriter.C +++ b/src/sampling/sampledSet/writers/gnuplot/gnuplotSetWriter.C @@ -86,7 +86,7 @@ void Foam::gnuplotSetWriter<Type>::write forAll(valueSets, i) { - writeTable(points, *valueSets[i], os); + this->writeTable(points, *valueSets[i], os); os << "e" << nl; } } @@ -131,7 +131,7 @@ void Foam::gnuplotSetWriter<Type>::write forAll(valueSets, i) { - writeTable(trackPoints[trackI], valueSets[i][trackI], os); + this->writeTable(trackPoints[trackI], valueSets[i][trackI], os); os << "e" << nl; } } diff --git a/src/sampling/sampledSet/writers/jplot/jplotSetWriter.C b/src/sampling/sampledSet/writers/jplot/jplotSetWriter.C index 55533ac9f2859d609d199c5662343e0d704fae89..ff22ac2af750dd0e22f84a762b78b820565f6466 100644 --- a/src/sampling/sampledSet/writers/jplot/jplotSetWriter.C +++ b/src/sampling/sampledSet/writers/jplot/jplotSetWriter.C @@ -96,7 +96,7 @@ void Foam::jplotSetWriter<Type>::write columns[i] = valueSets[i]; } - writeTable(points, columns, os); + this->writeTable(points, columns, os); } diff --git a/src/sampling/sampledSet/writers/raw/rawSetWriter.C b/src/sampling/sampledSet/writers/raw/rawSetWriter.C index 81e77e84b9d111fa6ba93ea92f8676a6a444d57f..21fed3c98fb4bdf390d30d21fc6f5d965105ec79 100644 --- a/src/sampling/sampledSet/writers/raw/rawSetWriter.C +++ b/src/sampling/sampledSet/writers/raw/rawSetWriter.C @@ -74,7 +74,7 @@ void Foam::rawSetWriter<Type>::write columns[i] = valueSets[i]; } - writeTable(points, columns, os); + this->writeTable(points, columns, os); } @@ -106,7 +106,7 @@ void Foam::rawSetWriter<Type>::write columns[i] = &valueSets[i][trackI]; } - writeTable(points[trackI], columns, os); + this->writeTable(points[trackI], columns, os); os << nl << nl; } } diff --git a/src/sampling/sampledSet/writers/xmgrace/xmgraceSetWriter.C b/src/sampling/sampledSet/writers/xmgrace/xmgraceSetWriter.C index 1df98d17c6fe1972e1696ddfef1a575ef6db2710..a073956d8390c69f92648131eb6ca41e4939c0f5 100644 --- a/src/sampling/sampledSet/writers/xmgrace/xmgraceSetWriter.C +++ b/src/sampling/sampledSet/writers/xmgrace/xmgraceSetWriter.C @@ -78,7 +78,7 @@ void Foam::xmgraceSetWriter<Type>::write << valueSetNames[i] << '"' << nl << "@target G0.S" << i << nl; - writeTable(points, *valueSets[i], os); + this->writeTable(points, *valueSets[i], os); os << '&' << nl; } @@ -119,7 +119,7 @@ void Foam::xmgraceSetWriter<Type>::write os << "@ s" << sI << " legend " << '"' << valueSetNames[i] << "_track" << i << '"' << nl << "@target G0.S" << sI << nl; - writeTable(trackPoints[trackI], valueSets[i][trackI], os); + this->writeTable(trackPoints[trackI], valueSets[i][trackI], os); os << '&' << nl; sI++; diff --git a/src/sampling/sampledSurface/isoSurface/isoSurfaceCell.C b/src/sampling/sampledSurface/isoSurface/isoSurfaceCell.C index 9ac2a1d0e09a6c3876af0742d2eea493e3cdfcc5..4948b41de183d4ba11c8ba2713884c90c5c43eba 100644 --- a/src/sampling/sampledSurface/isoSurface/isoSurfaceCell.C +++ b/src/sampling/sampledSurface/isoSurface/isoSurfaceCell.C @@ -931,19 +931,17 @@ bool Foam::isoSurfaceCell::validTri(const triSurface& surf, const label faceI) const labelledTri& f = surf[faceI]; - if - ( - (f[0] < 0) || (f[0] >= surf.points().size()) - || (f[1] < 0) || (f[1] >= surf.points().size()) - || (f[2] < 0) || (f[2] >= surf.points().size()) - ) + forAll(f, fp) { - WarningIn("validTri(const triSurface&, const label)") - << "triangle " << faceI << " vertices " << f - << " uses point indices outside point range 0.." - << surf.points().size()-1 << endl; + if (f[fp] < 0 || f[fp] >= surf.points().size()) + { + WarningIn("validTri(const triSurface&, const label)") + << "triangle " << faceI << " vertices " << f + << " uses point indices outside point range 0.." + << surf.points().size()-1 << endl; - return false; + return false; + } } if ((f[0] == f[1]) || (f[0] == f[2]) || (f[1] == f[2])) @@ -1337,12 +1335,12 @@ Foam::triSurface Foam::isoSurfaceCell::subsetMesh { if (include[oldFacei]) { - // Renumber labels for triangle - const labelledTri& tri = s[oldFacei]; + // Renumber labels for face + const triSurface::FaceType& f = s[oldFacei]; - forAll(tri, fp) + forAll(f, fp) { - label oldPointI = tri[fp]; + label oldPointI = f[fp]; if (oldToNewPoints[oldPointI] == -1) { diff --git a/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.C b/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.C index e846221ce8243b9c9adc3591aef918a2af8fcdf4..9a58dc41c266cf71ebed4371269ca7d88bd531da 100644 --- a/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.C +++ b/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.C @@ -239,15 +239,15 @@ bool Foam::sampledTriSurfaceMesh::update() { label newPointI = 0; - label newTriI = 0; + label newFaceI = 0; - forAll(s, triI) + forAll(s, faceI) { - if (include[triI]) + if (include[faceI]) { - faceMap[newTriI++] = triI; + faceMap[newFaceI++] = faceI; - const labelledTri& f = s[triI]; + const triSurface::FaceType& f = s[faceI]; forAll(f, fp) { if (reversePointMap[f[fp]] == -1) @@ -258,7 +258,7 @@ bool Foam::sampledTriSurfaceMesh::update() } } } - faceMap.setSize(newTriI); + faceMap.setSize(newFaceI); pointMap.setSize(newPointI); } diff --git a/src/sampling/sampledSurface/writers/ensight/ensightSurfaceWriter.C b/src/sampling/sampledSurface/writers/ensight/ensightSurfaceWriter.C index dc87c8247a23e3c30e3918bebcf889d8cb227258..cde2d597a839a8a951554539f700afb481a4990c 100644 --- a/src/sampling/sampledSurface/writers/ensight/ensightSurfaceWriter.C +++ b/src/sampling/sampledSurface/writers/ensight/ensightSurfaceWriter.C @@ -77,7 +77,7 @@ void Foam::ensightSurfaceWriter<Type>::writeData { for (direction cmpt = 0; cmpt < vector::nComponents; cmpt++) { - scalarField v = values.component(cmpt); + scalarField v(values.component(cmpt)); forAll(v, i) { os << v[i] << nl; diff --git a/src/surfMesh/MeshedSurface/MeshedSurface.C b/src/surfMesh/MeshedSurface/MeshedSurface.C index f3c4c5bde81ccfa40a01c911bf6fc25cd61afbe7..1735abac079f35403e40a80ce11d4af61353f85e 100644 --- a/src/surfMesh/MeshedSurface/MeshedSurface.C +++ b/src/surfMesh/MeshedSurface/MeshedSurface.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -67,7 +67,7 @@ bool Foam::MeshedSurface<Face>::canReadType const bool verbose ) { - return checkSupport + return fileFormats::surfaceFormatsCore::checkSupport ( readTypes() | FriendType::readTypes(), ext, @@ -84,7 +84,7 @@ bool Foam::MeshedSurface<Face>::canWriteType const bool verbose ) { - return checkSupport + return fileFormats::surfaceFormatsCore::checkSupport ( writeTypes() | ProxyType::writeTypes(), ext, diff --git a/src/surfMesh/MeshedSurface/MeshedSurface.H b/src/surfMesh/MeshedSurface/MeshedSurface.H index b47e2c98d71e0778fd17b4d451fda2f11bda708b..0e15c548c969f071966c2a2c5a3aca75d7e253e8 100644 --- a/src/surfMesh/MeshedSurface/MeshedSurface.H +++ b/src/surfMesh/MeshedSurface/MeshedSurface.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -156,6 +156,11 @@ protected: public: + // Public typedefs + + //- Face type used + typedef Face FaceType; + //- Runtime type information ClassName("MeshedSurface"); diff --git a/src/surfMesh/MeshedSurface/MeshedSurfaceCore.C b/src/surfMesh/MeshedSurface/MeshedSurfaceCore.C index 9efc4ba7fd0da236cb658a63fcf5ab56d54a8212..a1d3864784a20cae8c63e708c63cc59370412bc8 100644 --- a/src/surfMesh/MeshedSurface/MeshedSurfaceCore.C +++ b/src/surfMesh/MeshedSurface/MeshedSurfaceCore.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/MeshedSurface/MeshedSurfaceIO.C b/src/surfMesh/MeshedSurface/MeshedSurfaceIO.C index d3c2fab9e1b943481d6f8dbd4bbb315940bdcc9f..d7795d432b1ee3aa2c38856f55f6f9efc93a2c9f 100644 --- a/src/surfMesh/MeshedSurface/MeshedSurfaceIO.C +++ b/src/surfMesh/MeshedSurface/MeshedSurfaceIO.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/MeshedSurface/MeshedSurfaceNew.C b/src/surfMesh/MeshedSurface/MeshedSurfaceNew.C index 68169388ebb3d575534e234ea5a17af7ab69a1f5..9538b755526b8487f5fc0ae978a961db63cac0fd 100644 --- a/src/surfMesh/MeshedSurface/MeshedSurfaceNew.C +++ b/src/surfMesh/MeshedSurface/MeshedSurfaceNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/MeshedSurface/MeshedSurfaceZones.C b/src/surfMesh/MeshedSurface/MeshedSurfaceZones.C index a61ca0f1b721fb671c9d88f1337a1ff29d867199..f3dc48b01694205b817f246bbaaf4f0f57cfa9e9 100644 --- a/src/surfMesh/MeshedSurface/MeshedSurfaceZones.C +++ b/src/surfMesh/MeshedSurface/MeshedSurfaceZones.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/MeshedSurface/MeshedSurfaces.C b/src/surfMesh/MeshedSurface/MeshedSurfaces.C index b94af3e3f58e2b88566c027b237d6c0c84f5725f..97cb5a295af1177c0a6cb5382642d6bb2618b7e6 100644 --- a/src/surfMesh/MeshedSurface/MeshedSurfaces.C +++ b/src/surfMesh/MeshedSurface/MeshedSurfaces.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/MeshedSurface/MeshedSurfaces.H b/src/surfMesh/MeshedSurface/MeshedSurfaces.H index 21b800bebd2740e916bb70ba4836c231071a6eef..0f2330bc3a8ad0b6041476e055a0f744e2d3d534 100644 --- a/src/surfMesh/MeshedSurface/MeshedSurfaces.H +++ b/src/surfMesh/MeshedSurface/MeshedSurfaces.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/MeshedSurface/MeshedSurfacesFwd.H b/src/surfMesh/MeshedSurface/MeshedSurfacesFwd.H index cb4fd482ebbb510d78efb954dcf4635c5cdc9168..4cbb344b1d2671a8172221efdbf09321c1107135 100644 --- a/src/surfMesh/MeshedSurface/MeshedSurfacesFwd.H +++ b/src/surfMesh/MeshedSurface/MeshedSurfacesFwd.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/MeshedSurfaceAllocator/MeshedSurfaceIOAllocator.C b/src/surfMesh/MeshedSurfaceAllocator/MeshedSurfaceIOAllocator.C index 009a2ad8a0d747e60095c4f29c6284b889c58634..d29c42883f8743c18e437148c8786ec18b5e8b63 100644 --- a/src/surfMesh/MeshedSurfaceAllocator/MeshedSurfaceIOAllocator.C +++ b/src/surfMesh/MeshedSurfaceAllocator/MeshedSurfaceIOAllocator.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/MeshedSurfaceAllocator/MeshedSurfaceIOAllocator.H b/src/surfMesh/MeshedSurfaceAllocator/MeshedSurfaceIOAllocator.H index 716d0c88e710d085f5e56c68bdeb7eafb4051c7d..0d701085df22379c146ae6697bf04b1afd35c72c 100644 --- a/src/surfMesh/MeshedSurfaceAllocator/MeshedSurfaceIOAllocator.H +++ b/src/surfMesh/MeshedSurfaceAllocator/MeshedSurfaceIOAllocator.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/MeshedSurfaceProxy/MeshedSurfaceProxy.C b/src/surfMesh/MeshedSurfaceProxy/MeshedSurfaceProxy.C index b2cf9e26cdd1910433cf381950300641d0348c9c..e5d1f454b30becbe7eb396d17c0d172d22381c9e 100644 --- a/src/surfMesh/MeshedSurfaceProxy/MeshedSurfaceProxy.C +++ b/src/surfMesh/MeshedSurfaceProxy/MeshedSurfaceProxy.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -46,7 +46,10 @@ bool Foam::MeshedSurfaceProxy<Face>::canWriteType const bool verbose ) { - return checkSupport(writeTypes(), ext, verbose, "writing"); + return fileFormats::surfaceFormatsCore::checkSupport + ( + writeTypes(), ext, verbose, "writing" + ); } diff --git a/src/surfMesh/MeshedSurfaceProxy/MeshedSurfaceProxy.H b/src/surfMesh/MeshedSurfaceProxy/MeshedSurfaceProxy.H index 9a11f197e8f7b344ee7694fb6d9c5b341e985baa..ea051f5135790708c127eb8657d9d8c242b430fe 100644 --- a/src/surfMesh/MeshedSurfaceProxy/MeshedSurfaceProxy.H +++ b/src/surfMesh/MeshedSurfaceProxy/MeshedSurfaceProxy.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -78,6 +78,12 @@ class MeshedSurfaceProxy public: + // Public typedefs + + //- Face type used + typedef Face FaceType; + + // Static //- Runtime type information diff --git a/src/surfMesh/MeshedSurfaceProxy/MeshedSurfaceProxyCore.C b/src/surfMesh/MeshedSurfaceProxy/MeshedSurfaceProxyCore.C index ec5b8d64311b2673bf02cc69f778a76884a919c4..6e5bd6b73067e871a69184f0de9ae8ae044a8cc3 100644 --- a/src/surfMesh/MeshedSurfaceProxy/MeshedSurfaceProxyCore.C +++ b/src/surfMesh/MeshedSurfaceProxy/MeshedSurfaceProxyCore.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/UnsortedMeshedSurface/UnsortedMeshedSurface.C b/src/surfMesh/UnsortedMeshedSurface/UnsortedMeshedSurface.C index 660365b28b1ee74722bff8640a7d96e2e06b7e32..6c787fc54dd3a0dad305f0bf4be1a74d0db8580b 100644 --- a/src/surfMesh/UnsortedMeshedSurface/UnsortedMeshedSurface.C +++ b/src/surfMesh/UnsortedMeshedSurface/UnsortedMeshedSurface.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -55,7 +55,7 @@ bool Foam::UnsortedMeshedSurface<Face>::canReadType const bool verbose ) { - return checkSupport + return fileFormats::surfaceFormatsCore::checkSupport ( readTypes() | ParentType::readTypes(), ext, @@ -72,7 +72,7 @@ bool Foam::UnsortedMeshedSurface<Face>::canWriteType const bool verbose ) { - return checkSupport + return fileFormats::surfaceFormatsCore::checkSupport ( writeTypes(), ext, diff --git a/src/surfMesh/UnsortedMeshedSurface/UnsortedMeshedSurface.H b/src/surfMesh/UnsortedMeshedSurface/UnsortedMeshedSurface.H index 61359a938125c8cbde27bdddecbf95f6fb0cc278..1b6dec5b12cd0560b1eefc5e3f8748d53ef15cfa 100644 --- a/src/surfMesh/UnsortedMeshedSurface/UnsortedMeshedSurface.H +++ b/src/surfMesh/UnsortedMeshedSurface/UnsortedMeshedSurface.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -132,6 +132,11 @@ protected: public: + // Public typedefs + + //- Face type used + typedef Face FaceType; + //- Runtime type information TypeName("UnsortedMeshedSurface"); diff --git a/src/surfMesh/UnsortedMeshedSurface/UnsortedMeshedSurfaceNew.C b/src/surfMesh/UnsortedMeshedSurface/UnsortedMeshedSurfaceNew.C index 044f2654bdc951474eacc32cdd46e1eaf6009a76..60e22c887ec23efddafae8c736f2851896a70db8 100644 --- a/src/surfMesh/UnsortedMeshedSurface/UnsortedMeshedSurfaceNew.C +++ b/src/surfMesh/UnsortedMeshedSurface/UnsortedMeshedSurfaceNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/UnsortedMeshedSurface/UnsortedMeshedSurfaces.C b/src/surfMesh/UnsortedMeshedSurface/UnsortedMeshedSurfaces.C index 334928e2f00868543aa13e57939262ab2404eb50..fa556f2ae15ed118e8b1bd8386eb92fc37becdda 100644 --- a/src/surfMesh/UnsortedMeshedSurface/UnsortedMeshedSurfaces.C +++ b/src/surfMesh/UnsortedMeshedSurface/UnsortedMeshedSurfaces.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/UnsortedMeshedSurface/UnsortedMeshedSurfaces.H b/src/surfMesh/UnsortedMeshedSurface/UnsortedMeshedSurfaces.H index 09c25ad0383f33d0ca8d44d43112c2078fc296af..947f49b2733f7196cb03c7076ef8cf7d2d9a0cb3 100644 --- a/src/surfMesh/UnsortedMeshedSurface/UnsortedMeshedSurfaces.H +++ b/src/surfMesh/UnsortedMeshedSurface/UnsortedMeshedSurfaces.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/UnsortedMeshedSurface/UnsortedMeshedSurfacesFwd.H b/src/surfMesh/UnsortedMeshedSurface/UnsortedMeshedSurfacesFwd.H index e7aac1dce05d0e848d0a9e7c4cd9f2927957aec4..fdb95ea4cfd40877d51529515218b895439197d5 100644 --- a/src/surfMesh/UnsortedMeshedSurface/UnsortedMeshedSurfacesFwd.H +++ b/src/surfMesh/UnsortedMeshedSurface/UnsortedMeshedSurfacesFwd.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/surfFields/surfFields/surfFields.C b/src/surfMesh/surfFields/surfFields/surfFields.C index 00b07f738f2d4c2b4e354c93c45ece6bd3815df6..8f50dc6f6b05d1045369ac306257fbc1e0bf916e 100644 --- a/src/surfMesh/surfFields/surfFields/surfFields.C +++ b/src/surfMesh/surfFields/surfFields/surfFields.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/surfFields/surfFields/surfFields.H b/src/surfMesh/surfFields/surfFields/surfFields.H index 2b7acced86c6bbedc4a33a6a6994738d16b252ba..5d42d08c6103f1811b6ef560306ad71620947da8 100644 --- a/src/surfMesh/surfFields/surfFields/surfFields.H +++ b/src/surfMesh/surfFields/surfFields/surfFields.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/surfFields/surfFields/surfFieldsFwd.H b/src/surfMesh/surfFields/surfFields/surfFieldsFwd.H index f55504ddd4568241522f82c5bbe216e4bb33f99a..93a7cc4e1ce9f18362cd5777c2f298b126a2d439 100644 --- a/src/surfMesh/surfFields/surfFields/surfFieldsFwd.H +++ b/src/surfMesh/surfFields/surfFields/surfFieldsFwd.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/surfFields/surfFields/surfGeoMesh.H b/src/surfMesh/surfFields/surfFields/surfGeoMesh.H index 7a49d041de295aef18550bd15320b2c2219038c5..de836524dee305aca54151bab06329992299767f 100644 --- a/src/surfMesh/surfFields/surfFields/surfGeoMesh.H +++ b/src/surfMesh/surfFields/surfFields/surfGeoMesh.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/surfFields/surfPointFields/surfPointFields.C b/src/surfMesh/surfFields/surfPointFields/surfPointFields.C index 6e9d3c7d627d4cee7dfe507caeb26b8f79035b23..f374559506ec7b5c5a24804967a2d9dc2508ecd8 100644 --- a/src/surfMesh/surfFields/surfPointFields/surfPointFields.C +++ b/src/surfMesh/surfFields/surfPointFields/surfPointFields.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/surfFields/surfPointFields/surfPointFields.H b/src/surfMesh/surfFields/surfPointFields/surfPointFields.H index 271effcd0fd0711002c191c0d23cb6d8763057fe..6d169ec516c72a33288d16f8cf7106db442556b4 100644 --- a/src/surfMesh/surfFields/surfPointFields/surfPointFields.H +++ b/src/surfMesh/surfFields/surfPointFields/surfPointFields.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/surfFields/surfPointFields/surfPointFieldsFwd.H b/src/surfMesh/surfFields/surfPointFields/surfPointFieldsFwd.H index 7587100a88a3472ec8d9e6bbeeb0ba2d4783811a..ab89f7544cebaf4376af5921072a1424277e688a 100644 --- a/src/surfMesh/surfFields/surfPointFields/surfPointFieldsFwd.H +++ b/src/surfMesh/surfFields/surfPointFields/surfPointFieldsFwd.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/surfFields/surfPointFields/surfPointGeoMesh.H b/src/surfMesh/surfFields/surfPointFields/surfPointGeoMesh.H index ebe66ad3b414b5173cef7756ed24636aee833daa..a406a6e30e68f6b32461685ebee8e57ddbe865ea 100644 --- a/src/surfMesh/surfFields/surfPointFields/surfPointGeoMesh.H +++ b/src/surfMesh/surfFields/surfPointFields/surfPointGeoMesh.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/surfZone/surfZone/surfZone.C b/src/surfMesh/surfZone/surfZone/surfZone.C index 01d6feb0e61e0585e8b0e5eed10fa0e7aeac0496..51c0cbb1ce09be7c41998fa5c373b34f7e3cc15e 100644 --- a/src/surfMesh/surfZone/surfZone/surfZone.C +++ b/src/surfMesh/surfZone/surfZone/surfZone.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/surfZone/surfZone/surfZone.H b/src/surfMesh/surfZone/surfZone/surfZone.H index 8bebc540e65b5b060404464e46bf21fbb04823e6..3cfda4230f7e03489596814e48c5970acfc7b424 100644 --- a/src/surfMesh/surfZone/surfZone/surfZone.H +++ b/src/surfMesh/surfZone/surfZone/surfZone.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/surfZone/surfZone/surfZoneIOList.C b/src/surfMesh/surfZone/surfZone/surfZoneIOList.C index e9f44025abfbe9ad58ed8741f68846c70b32b160..cb103fab1f4e144273537cf7f6c4b569c151abfe 100644 --- a/src/surfMesh/surfZone/surfZone/surfZoneIOList.C +++ b/src/surfMesh/surfZone/surfZone/surfZoneIOList.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/surfZone/surfZone/surfZoneIOList.H b/src/surfMesh/surfZone/surfZone/surfZoneIOList.H index b8a48b89988ba28b91eb073620df437bcddd6ae2..3c34c621a84bbb53e5a28595e0615e4270a41de7 100644 --- a/src/surfMesh/surfZone/surfZone/surfZoneIOList.H +++ b/src/surfMesh/surfZone/surfZone/surfZoneIOList.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/surfZone/surfZone/surfZoneList.H b/src/surfMesh/surfZone/surfZone/surfZoneList.H index d4b3975622b794ca05219f36700834bb62e224a2..b037693b0bc99a55867cd68ca21bb4e89102d69d 100644 --- a/src/surfMesh/surfZone/surfZone/surfZoneList.H +++ b/src/surfMesh/surfZone/surfZone/surfZoneList.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/surfZone/surfZoneIdentifier/surfZoneIdentifier.C b/src/surfMesh/surfZone/surfZoneIdentifier/surfZoneIdentifier.C index 2ad4c95716d51c1a37fc0f97650cc7f713066ea1..f569660a04bc02749cf55f291d7e34fd7d62c28e 100644 --- a/src/surfMesh/surfZone/surfZoneIdentifier/surfZoneIdentifier.C +++ b/src/surfMesh/surfZone/surfZoneIdentifier/surfZoneIdentifier.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/surfZone/surfZoneIdentifier/surfZoneIdentifier.H b/src/surfMesh/surfZone/surfZoneIdentifier/surfZoneIdentifier.H index b39dd3ac1d8598241533b6155be19b849ddae57f..4f69ef5d9dcbde2a1cd973633d157f76e5be87a6 100644 --- a/src/surfMesh/surfZone/surfZoneIdentifier/surfZoneIdentifier.H +++ b/src/surfMesh/surfZone/surfZoneIdentifier/surfZoneIdentifier.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/surfZone/surfZoneIdentifier/surfZoneIdentifierList.H b/src/surfMesh/surfZone/surfZoneIdentifier/surfZoneIdentifierList.H index fa0acc8a3a722ac68dbaf3d0eccebf17348d6f53..97e3a25c51d9581d44e75f1baada1c95cca21722 100644 --- a/src/surfMesh/surfZone/surfZoneIdentifier/surfZoneIdentifierList.H +++ b/src/surfMesh/surfZone/surfZoneIdentifier/surfZoneIdentifierList.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/surfaceFormats/ac3d/AC3DsurfaceFormat.C b/src/surfMesh/surfaceFormats/ac3d/AC3DsurfaceFormat.C index 70b5455eaad5fea4dfeab35a9ca37a6a65574675..11cdf569414e350bc35815237fa008dc40dbd877 100644 --- a/src/surfMesh/surfaceFormats/ac3d/AC3DsurfaceFormat.C +++ b/src/surfMesh/surfaceFormats/ac3d/AC3DsurfaceFormat.C @@ -286,7 +286,7 @@ void Foam::fileFormats::AC3DsurfaceFormat<Face>::write ( surf.surfZones().size() ? surf.surfZones() - : oneZone(faceLst) + : surfaceFormatsCore::oneZone(faceLst) ); const bool useFaceMap = (surf.useFaceMap() && zones.size() > 1); diff --git a/src/surfMesh/surfaceFormats/nas/NASsurfaceFormat.C b/src/surfMesh/surfaceFormats/nas/NASsurfaceFormat.C index 0fa63e42255e5d7fba4dfd95328aaf4eddf5a96d..2c0412da7e1bd0cb7cfe9d064f56588d51f200a2 100644 --- a/src/surfMesh/surfaceFormats/nas/NASsurfaceFormat.C +++ b/src/surfMesh/surfaceFormats/nas/NASsurfaceFormat.C @@ -379,7 +379,7 @@ bool Foam::fileFormats::NASsurfaceFormat<Face>::read } } - sortFacesAndStore(dynFaces.xfer(), dynZones.xfer(), sorted); + this->sortFacesAndStore(dynFaces.xfer(), dynZones.xfer(), sorted); // add zones, culling empty ones this->addZones(dynSizes, names, true); diff --git a/src/surfMesh/surfaceFormats/obj/OBJsurfaceFormat.C b/src/surfMesh/surfaceFormats/obj/OBJsurfaceFormat.C index bc54486cc335add284204d7fbf3bf63ad43f0f48..a4175f87bf78e61980c1b29d5b292014e6073795 100644 --- a/src/surfMesh/surfaceFormats/obj/OBJsurfaceFormat.C +++ b/src/surfMesh/surfaceFormats/obj/OBJsurfaceFormat.C @@ -202,7 +202,7 @@ bool Foam::fileFormats::OBJsurfaceFormat<Face>::read // transfer to normal lists this->storedPoints().transfer(dynPoints); - sortFacesAndStore(dynFaces.xfer(), dynZones.xfer(), sorted); + this->sortFacesAndStore(dynFaces.xfer(), dynZones.xfer(), sorted); // add zones, culling empty ones this->addZones(dynSizes, dynNames, true); @@ -225,7 +225,7 @@ void Foam::fileFormats::OBJsurfaceFormat<Face>::write const List<surfZone>& zones = ( surf.surfZones().empty() - ? oneZone(faceLst, "") + ? surfaceFormatsCore::oneZone(faceLst, "") : surf.surfZones() ); diff --git a/src/surfMesh/surfaceFormats/off/OFFsurfaceFormat.C b/src/surfMesh/surfaceFormats/off/OFFsurfaceFormat.C index 523791017601a1159f0de20da0bb0f2a26cc6608..ab4d1c9e2f828a9d08cc9964a4cb8528f2841f35 100644 --- a/src/surfMesh/surfaceFormats/off/OFFsurfaceFormat.C +++ b/src/surfMesh/surfaceFormats/off/OFFsurfaceFormat.C @@ -141,7 +141,7 @@ bool Foam::fileFormats::OFFsurfaceFormat<Face>::read } // transfer to normal lists, no zone information - reset(pointLst.xfer(), dynFaces.xfer(), Xfer<surfZoneList>()); + this->reset(pointLst.xfer(), dynFaces.xfer(), Xfer<surfZoneList>()); return true; } diff --git a/src/surfMesh/surfaceFormats/smesh/SMESHsurfaceFormat.C b/src/surfMesh/surfaceFormats/smesh/SMESHsurfaceFormat.C index 3d0c7d3cfd4c7709308ed265eb1791a79c773b7b..3093c7d4fc3c5facb80dcef5610fcde96c261ffd 100644 --- a/src/surfMesh/surfaceFormats/smesh/SMESHsurfaceFormat.C +++ b/src/surfMesh/surfaceFormats/smesh/SMESHsurfaceFormat.C @@ -52,7 +52,7 @@ void Foam::fileFormats::SMESHsurfaceFormat<Face>::write const List<surfZone>& zones = ( surf.surfZones().empty() - ? oneZone(faceLst) + ? surfaceFormatsCore::oneZone(faceLst) : surf.surfZones() ); diff --git a/src/surfMesh/surfaceFormats/starcd/STARCDsurfaceFormat.C b/src/surfMesh/surfaceFormats/starcd/STARCDsurfaceFormat.C index a46884780b920bca9a4514539cc2922f6170a025..ccd81294fbde9df9fad17eb58c6326bc5173dd4a 100644 --- a/src/surfMesh/surfaceFormats/starcd/STARCDsurfaceFormat.C +++ b/src/surfMesh/surfaceFormats/starcd/STARCDsurfaceFormat.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -234,7 +234,7 @@ bool Foam::fileFormats::STARCDsurfaceFormat<Face>::read } mapPointId.clear(); - sortFacesAndStore(dynFaces.xfer(), dynZones.xfer(), sorted); + this->sortFacesAndStore(dynFaces.xfer(), dynZones.xfer(), sorted); // add zones, culling empty ones this->addZones(dynSizes, dynNames, true); @@ -256,7 +256,7 @@ void Foam::fileFormats::STARCDsurfaceFormat<Face>::write const List<surfZone>& zones = ( surf.surfZones().empty() - ? oneZone(faceLst) + ? surfaceFormatsCore::oneZone(faceLst) : surf.surfZones() ); diff --git a/src/surfMesh/surfaceFormats/starcd/STARCDsurfaceFormat.H b/src/surfMesh/surfaceFormats/starcd/STARCDsurfaceFormat.H index 4963368fff8896abc30bd36864fe32f380812539..2bfc0c3358c42c66474b4f09c938f7310d0ad22a 100644 --- a/src/surfMesh/surfaceFormats/starcd/STARCDsurfaceFormat.H +++ b/src/surfMesh/surfaceFormats/starcd/STARCDsurfaceFormat.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/surfaceFormats/starcd/STARCDsurfaceFormatCore.C b/src/surfMesh/surfaceFormats/starcd/STARCDsurfaceFormatCore.C index 80db186628f49475c4c729cd20f3fddb8da0189d..3795d433f93c38ee9a094de290c9c60df9bb8645 100644 --- a/src/surfMesh/surfaceFormats/starcd/STARCDsurfaceFormatCore.C +++ b/src/surfMesh/surfaceFormats/starcd/STARCDsurfaceFormatCore.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/surfaceFormats/starcd/STARCDsurfaceFormatCore.H b/src/surfMesh/surfaceFormats/starcd/STARCDsurfaceFormatCore.H index 3320c547316326ea0559f7ad204034ff8307d9ef..02e99acbb3e93e420c451237d72ca20bf5eb4f8e 100644 --- a/src/surfMesh/surfaceFormats/starcd/STARCDsurfaceFormatCore.H +++ b/src/surfMesh/surfaceFormats/starcd/STARCDsurfaceFormatCore.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/surfaceFormats/starcd/STARCDsurfaceFormatRunTime.C b/src/surfMesh/surfaceFormats/starcd/STARCDsurfaceFormatRunTime.C index ce0fc8c61cde558371384e85cfc26c6333e70612..800734127fa71d0885cdaebc5a495d2cc58425f6 100644 --- a/src/surfMesh/surfaceFormats/starcd/STARCDsurfaceFormatRunTime.C +++ b/src/surfMesh/surfaceFormats/starcd/STARCDsurfaceFormatRunTime.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/surfaceFormats/stl/STLsurfaceFormat.C b/src/surfMesh/surfaceFormats/stl/STLsurfaceFormat.C index 2012467f8be45f13f72a92a93a82eb939017516d..f398b180c4f12812be4ea680c4d4b1289cc22b9c 100644 --- a/src/surfMesh/surfaceFormats/stl/STLsurfaceFormat.C +++ b/src/surfMesh/surfaceFormats/stl/STLsurfaceFormat.C @@ -213,7 +213,7 @@ void Foam::fileFormats::STLsurfaceFormat<Face>::writeAscii const List<surfZone>& zones = ( surf.surfZones().empty() - ? oneZone(faceLst) + ? surfaceFormatsCore::oneZone(faceLst) : surf.surfZones() ); @@ -275,7 +275,7 @@ void Foam::fileFormats::STLsurfaceFormat<Face>::writeBinary ( surf.surfZones().size() > 1 ? surf.surfZones() - : oneZone(faceLst) + : surfaceFormatsCore::oneZone(faceLst) ); const bool useFaceMap = (surf.useFaceMap() && zones.size() > 1); diff --git a/src/surfMesh/surfaceFormats/surfaceFormatsCore.C b/src/surfMesh/surfaceFormats/surfaceFormatsCore.C index e6ba574c5878ba5d2dde69f15373723dafb553e1..1efcc222ab5f371255d70857d49ba3491b10fa43 100644 --- a/src/surfMesh/surfaceFormats/surfaceFormatsCore.C +++ b/src/surfMesh/surfaceFormats/surfaceFormatsCore.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/surfaceFormats/surfaceFormatsCore.H b/src/surfMesh/surfaceFormats/surfaceFormatsCore.H index 4aaf425437ea9fb0100b69a825810c4b2c3141da..fcec9f33837f8fd336b25511a1f427701e88ab7b 100644 --- a/src/surfMesh/surfaceFormats/surfaceFormatsCore.H +++ b/src/surfMesh/surfaceFormats/surfaceFormatsCore.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/surfaceFormats/tri/TRIsurfaceFormat.C b/src/surfMesh/surfaceFormats/tri/TRIsurfaceFormat.C index cb3aeff238815bb2cc27e5210e404e967de24d30..ea5fa5fa073312ee30e224270425354b09695fe5 100644 --- a/src/surfMesh/surfaceFormats/tri/TRIsurfaceFormat.C +++ b/src/surfMesh/surfaceFormats/tri/TRIsurfaceFormat.C @@ -139,7 +139,7 @@ void Foam::fileFormats::TRIsurfaceFormat<Face>::write const List<surfZone>& zones = ( surf.surfZones().empty() - ? oneZone(faceLst) + ? surfaceFormatsCore::oneZone(faceLst) : surf.surfZones() ); diff --git a/src/surfMesh/surfaceFormats/vtk/VTKsurfaceFormat.C b/src/surfMesh/surfaceFormats/vtk/VTKsurfaceFormat.C index 6b5f1dd9c89b41912551749fb55e7d5fe129c75f..9952334e5b0eddb8634a4376b8be3449c30d29ff 100644 --- a/src/surfMesh/surfaceFormats/vtk/VTKsurfaceFormat.C +++ b/src/surfMesh/surfaceFormats/vtk/VTKsurfaceFormat.C @@ -70,7 +70,7 @@ void Foam::fileFormats::VTKsurfaceFormat<Face>::write const List<surfZone>& zones = ( surf.surfZones().empty() - ? oneZone(faceLst) + ? surfaceFormatsCore::oneZone(faceLst) : surf.surfZones() ); diff --git a/src/surfMesh/surfaceFormats/wrl/WRLsurfaceFormat.C b/src/surfMesh/surfaceFormats/wrl/WRLsurfaceFormat.C index aa9f22d9a374150c337c646f350a45ff2ebe9e14..9b54d2637d0998b77404bfacc903cb4bc380c2c1 100644 --- a/src/surfMesh/surfaceFormats/wrl/WRLsurfaceFormat.C +++ b/src/surfMesh/surfaceFormats/wrl/WRLsurfaceFormat.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -53,7 +53,7 @@ void Foam::fileFormats::WRLsurfaceFormat<Face>::write const List<surfZone>& zones = ( surf.surfZones().empty() - ? oneZone(faceLst, "") + ? surfaceFormatsCore::oneZone(faceLst, "") : surf.surfZones() ); diff --git a/src/surfMesh/surfaceFormats/wrl/WRLsurfaceFormat.H b/src/surfMesh/surfaceFormats/wrl/WRLsurfaceFormat.H index 527e0d0e46675454763a12c9f11e9e2d85e58bbe..400233d243823c6c86c755eee1f7d09c66556a33 100644 --- a/src/surfMesh/surfaceFormats/wrl/WRLsurfaceFormat.H +++ b/src/surfMesh/surfaceFormats/wrl/WRLsurfaceFormat.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/surfaceFormats/wrl/WRLsurfaceFormatCore.C b/src/surfMesh/surfaceFormats/wrl/WRLsurfaceFormatCore.C index ff73ac77ca67e87f6cb3381524c8f56c65bdec6e..252cdd2fe396169dbead86b2c58fed2d8f83b98b 100644 --- a/src/surfMesh/surfaceFormats/wrl/WRLsurfaceFormatCore.C +++ b/src/surfMesh/surfaceFormats/wrl/WRLsurfaceFormatCore.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/surfaceFormats/wrl/WRLsurfaceFormatCore.H b/src/surfMesh/surfaceFormats/wrl/WRLsurfaceFormatCore.H index 1b4c96513825be8592d216b359d1bf454fa173a7..a4e913c9bbbe94e96df7b906427fad30f70c6ef6 100644 --- a/src/surfMesh/surfaceFormats/wrl/WRLsurfaceFormatCore.H +++ b/src/surfMesh/surfaceFormats/wrl/WRLsurfaceFormatCore.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/surfaceFormats/wrl/WRLsurfaceFormatRunTime.C b/src/surfMesh/surfaceFormats/wrl/WRLsurfaceFormatRunTime.C index 7cc3382ecc8f9e891443f7e8e6aab58e4207c0f6..d9a0607514a5ed0ff913f227d89fa1f153693100 100644 --- a/src/surfMesh/surfaceFormats/wrl/WRLsurfaceFormatRunTime.C +++ b/src/surfMesh/surfaceFormats/wrl/WRLsurfaceFormatRunTime.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/surfaceFormats/x3d/X3DsurfaceFormat.C b/src/surfMesh/surfaceFormats/x3d/X3DsurfaceFormat.C index e48a55107234ab817767732c110a1aed774267da..245ebdd437f8d1a0edb040dfd261ba2a9f168c27 100644 --- a/src/surfMesh/surfaceFormats/x3d/X3DsurfaceFormat.C +++ b/src/surfMesh/surfaceFormats/x3d/X3DsurfaceFormat.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -55,7 +55,7 @@ void Foam::fileFormats::X3DsurfaceFormat<Face>::write const List<surfZone>& zones = ( surf.surfZones().empty() - ? oneZone(faceLst, "") + ? surfaceFormatsCore::oneZone(faceLst, "") : surf.surfZones() ); diff --git a/src/surfMesh/surfaceFormats/x3d/X3DsurfaceFormat.H b/src/surfMesh/surfaceFormats/x3d/X3DsurfaceFormat.H index 54bf15701d579b1260bed9b839a6583092bb966a..4765fc8740009361ba600b7880bf18b9a4cc1589 100644 --- a/src/surfMesh/surfaceFormats/x3d/X3DsurfaceFormat.H +++ b/src/surfMesh/surfaceFormats/x3d/X3DsurfaceFormat.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/surfaceFormats/x3d/X3DsurfaceFormatCore.C b/src/surfMesh/surfaceFormats/x3d/X3DsurfaceFormatCore.C index aba74a2f082c5b0e6624bfcdab50ec6c4d68776e..94d4761c7a69d00a5c986a97eea6524b43998a41 100644 --- a/src/surfMesh/surfaceFormats/x3d/X3DsurfaceFormatCore.C +++ b/src/surfMesh/surfaceFormats/x3d/X3DsurfaceFormatCore.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/surfaceFormats/x3d/X3DsurfaceFormatCore.H b/src/surfMesh/surfaceFormats/x3d/X3DsurfaceFormatCore.H index ceb17f42bc71a4dd540025744c36ae96509cb55a..a0dfb627063bc1ebe052df295f49e34119b0cd7e 100644 --- a/src/surfMesh/surfaceFormats/x3d/X3DsurfaceFormatCore.H +++ b/src/surfMesh/surfaceFormats/x3d/X3DsurfaceFormatCore.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/surfaceFormats/x3d/X3DsurfaceFormatRunTime.C b/src/surfMesh/surfaceFormats/x3d/X3DsurfaceFormatRunTime.C index 6a5ca6f6f23a973d40aa6c1fe47414ef3e3c7ef1..a1109c06b7b71d77382204ed5df5588fa8d459fa 100644 --- a/src/surfMesh/surfaceFormats/x3d/X3DsurfaceFormatRunTime.C +++ b/src/surfMesh/surfaceFormats/x3d/X3DsurfaceFormatRunTime.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/surfaceRegistry/surfaceRegistry.C b/src/surfMesh/surfaceRegistry/surfaceRegistry.C index 2412064ab65ac5f508f6d920ae0e08afd71c76b6..979adec9fae01669df155fbb43e18d87afeb2f63 100644 --- a/src/surfMesh/surfaceRegistry/surfaceRegistry.C +++ b/src/surfMesh/surfaceRegistry/surfaceRegistry.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfMesh/surfaceRegistry/surfaceRegistry.H b/src/surfMesh/surfaceRegistry/surfaceRegistry.H index fba492b13aadd8f5188a1660d6e5bc4b39b2ed9a..9236ca7b9570833d9e5290fa33c2fd81a17087d5 100644 --- a/src/surfMesh/surfaceRegistry/surfaceRegistry.H +++ b/src/surfMesh/surfaceRegistry/surfaceRegistry.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchField.C b/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchField.C index c524491307e7ac22a58db4aa56609590731577e1..0bbb056b9ac95db68977abe97bb164dbeb90cbbf 100644 --- a/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchField.C +++ b/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchField.C @@ -131,7 +131,7 @@ void directMappedFixedInternalValueFvPatchField<Type>::updateCoeffs() ); // Retrieve the neighbour patch internal field - Field<Type> nbrIntFld = nbrField.patchInternalField(); + Field<Type> nbrIntFld(nbrField.patchInternalField()); distMap.distribute(nbrIntFld); // Assign (this) patch internal field to its neighbour values diff --git a/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFields.H b/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFields.H index 29301f9f0dcaaa7a745eb29f56282e1d2c4bc3e8..efc2b26edfafbff7c70d97fed1d76cd43447c560 100644 --- a/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFields.H +++ b/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(directMappedFixedInternalValue) +makePatchTypeFieldTypedefs(directMappedFixedInternalValue); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFieldsFwd.H b/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFieldsFwd.H index 55ee7d1ab695d9a0beeb27e71a5bc46c2a1255dd..3c1fba79ae83efb096893beb0544ac115891e4c0 100644 --- a/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFieldsFwd.H +++ b/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class directMappedFixedInternalValueFvPatchField; -makePatchTypeFieldTypedefs(directMappedFixedInternalValue) +makePatchTypeFieldTypedefs(directMappedFixedInternalValue); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFields.H b/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFields.H index 9d5a800af54d37013318efe158eeeb5b363a8a57..97b7b7e25cfd0aafda87cca32a391bee42b055d2 100644 --- a/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFields.H +++ b/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(directMappedFixedPushedInternalValue) +makePatchTypeFieldTypedefs(directMappedFixedPushedInternalValue); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFieldsFwd.H b/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFieldsFwd.H index 5ef59b5645745ef3a095e9a5cd7db15c079d9d72..f0c8d864b277faaf4e7934197d0116b669b0380d 100644 --- a/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFieldsFwd.H +++ b/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template<class Type> class directMappedFixedPushedInternalValueFvPatchField; -makePatchTypeFieldTypedefs(directMappedFixedInternalValue) +makePatchTypeFieldTypedefs(directMappedFixedInternalValue); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/surfaceFilmModels/derivedFvPatchFields/filmHeightInletVelocity/filmHeightInletVelocityFvPatchVectorField.C b/src/surfaceFilmModels/derivedFvPatchFields/filmHeightInletVelocity/filmHeightInletVelocityFvPatchVectorField.C index 576d48d6635b910ad8eafe948bae5f3174febfde..78484ccaeb0b0c92901e9f4fb5d3570a6e658341 100644 --- a/src/surfaceFilmModels/derivedFvPatchFields/filmHeightInletVelocity/filmHeightInletVelocityFvPatchVectorField.C +++ b/src/surfaceFilmModels/derivedFvPatchFields/filmHeightInletVelocity/filmHeightInletVelocityFvPatchVectorField.C @@ -122,7 +122,7 @@ void Foam::filmHeightInletVelocityFvPatchVectorField::updateCoeffs() const fvPatchField<scalar>& deltafp = patch().lookupPatchField<volScalarField, scalar>(deltafName_); - vectorField n = patch().nf(); + const vectorField n(patch().nf()); const scalarField& magSf = patch().magSf(); operator==(deltafp*n*phip/(rhop*magSf*sqr(deltafp) + ROOTVSMALL)); @@ -156,7 +156,7 @@ void Foam::filmHeightInletVelocityFvPatchVectorField::operator= namespace Foam { - makePatchTypeField + makeNonTemplatedPatchTypeField ( fvPatchVectorField, filmHeightInletVelocityFvPatchVectorField diff --git a/src/surfaceFilmModels/derivedFvPatchFields/htcConv/htcConvFvPatchScalarField.C b/src/surfaceFilmModels/derivedFvPatchFields/htcConv/htcConvFvPatchScalarField.C index c8ca479b6a9ac1d29bf0221d17acb0d808751ec1..b5137c087b6c11dfa7f684cd31817312ad6458ab 100644 --- a/src/surfaceFilmModels/derivedFvPatchFields/htcConv/htcConvFvPatchScalarField.C +++ b/src/surfaceFilmModels/derivedFvPatchFields/htcConv/htcConvFvPatchScalarField.C @@ -108,16 +108,16 @@ void htcConvFvPatchScalarField::updateCoeffs() const label patchI = patch().index(); const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); - const scalarField alphaEffw = rasModel.alphaEff()().boundaryField()[patchI]; + const scalarField alphaEffw(rasModel.alphaEff()().boundaryField()[patchI]); const scalarField& muw = rasModel.mu().boundaryField()[patchI]; const scalarField& rhow = rasModel.rho().boundaryField()[patchI]; const vectorField& Uc = rasModel.U(); const vectorField& Uw = rasModel.U().boundaryField()[patchI]; const scalarField& Tw = rasModel.thermo().T().boundaryField()[patchI]; - const scalarField Cpw = rasModel.thermo().Cp(Tw, patchI); + const scalarField Cpw(rasModel.thermo().Cp(Tw, patchI)); - const scalarField kappaw = Cpw*alphaEffw; - const scalarField Pr = muw*Cpw/kappaw; + const scalarField kappaw(Cpw*alphaEffw); + const scalarField Pr(muw*Cpw/kappaw); scalarField& htc = *this; forAll(htc, faceI) @@ -150,7 +150,7 @@ void htcConvFvPatchScalarField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField +makeNonTemplatedPatchTypeField ( fvPatchScalarField, htcConvFvPatchScalarField diff --git a/src/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.C b/src/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.C index 3a43ceaa7ae98ae37edb088d3b91b231e2b91efa..23e883cd32e856141a709f8de85c962c0a50917d 100644 --- a/src/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.C +++ b/src/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.C @@ -163,8 +163,10 @@ void alphatFilmWallFunctionFvPatchScalarField::updateCoeffs() } } - scalarField mDotFilm = - filmModel.massPhaseChangeForPrimary().boundaryField()[filmPatchI]; + scalarField mDotFilm + ( + filmModel.massPhaseChangeForPrimary().boundaryField()[filmPatchI] + ); distMap.distribute(mDotFilm); // Retrieve RAS turbulence model @@ -232,7 +234,7 @@ void alphatFilmWallFunctionFvPatchScalarField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField +makeNonTemplatedPatchTypeField ( fvPatchScalarField, alphatFilmWallFunctionFvPatchScalarField diff --git a/src/surfaceFilmModels/derivedFvPatchFields/wallFunctions/mutFilmWallFunction/mutFilmWallFunctionFvPatchScalarField.C b/src/surfaceFilmModels/derivedFvPatchFields/wallFunctions/mutFilmWallFunction/mutFilmWallFunctionFvPatchScalarField.C index f7a44c586ac47fd24e2c412b9416cb25b817b2c3..07afc327399292022cc71ecdfb34b23a36b2e207 100644 --- a/src/surfaceFilmModels/derivedFvPatchFields/wallFunctions/mutFilmWallFunction/mutFilmWallFunctionFvPatchScalarField.C +++ b/src/surfaceFilmModels/derivedFvPatchFields/wallFunctions/mutFilmWallFunction/mutFilmWallFunctionFvPatchScalarField.C @@ -80,8 +80,10 @@ tmp<scalarField> mutFilmWallFunctionFvPatchScalarField::calcUTau } } - scalarField mDotFilm = - filmModel.massPhaseChangeForPrimary().boundaryField()[filmPatchI]; + scalarField mDotFilm + ( + filmModel.massPhaseChangeForPrimary().boundaryField()[filmPatchI] + ); distMap.distribute(mDotFilm); @@ -131,7 +133,7 @@ tmp<scalarField> mutFilmWallFunctionFvPatchScalarField::calcMut() const const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField magGradU = mag(Uw.snGrad()); + const scalarField magGradU(mag(Uw.snGrad())); const scalarField& rhow = rasModel.rho().boundaryField()[patchI]; const scalarField& muw = rasModel.mu().boundaryField()[patchI]; @@ -235,7 +237,11 @@ void mutFilmWallFunctionFvPatchScalarField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField(fvPatchScalarField, mutFilmWallFunctionFvPatchScalarField); +makeNonTemplatedPatchTypeField +( + fvPatchScalarField, + mutFilmWallFunctionFvPatchScalarField +); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModel.C b/src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModel.C index 5e5d7e4077c396487c192046725d6266cdd969c9..0e9b553107e80d04b70950e2ee5aafff5c708480 100644 --- a/src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModel.C +++ b/src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModel.C @@ -50,7 +50,7 @@ void Foam::surfaceFilmModels::injectionModel::correctDetachedFilm const kinematicSingleLayer& film = refCast<const kinematicSingleLayer>(owner_); - const scalarField gNorm = film.gNorm(); + const scalarField gNorm(film.gNorm()); const scalarField& delta = film.delta(); const scalarField& rho = film.rho(); const scalarField& magSf = film.magSf(); diff --git a/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/standardPhaseChange/standardPhaseChange.C b/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/standardPhaseChange/standardPhaseChange.C index 3dea2ae9104069c75904815bb4e3ff5ee5812aeb..29ae7ce8ea6a90f6496b68d3d791bf41a4efb133 100644 --- a/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/standardPhaseChange/standardPhaseChange.C +++ b/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/standardPhaseChange/standardPhaseChange.C @@ -120,10 +120,10 @@ void Foam::surfaceFilmModels::standardPhaseChange::correct const scalarField& rhoInf = film.rhoPrimary(); const scalarField& muInf = film.muPrimary(); const scalarField& magSf = film.magSf(); - const scalarField hInf = film.htcs().h(); - const scalarField hFilm = film.htcw().h(); - const vectorField dU = film.UPrimary() - film.Us(); - const scalarField availableMass = (delta - deltaMin_)*rho*magSf; + const scalarField hInf(film.htcs().h()); + const scalarField hFilm(film.htcw().h()); + const vectorField dU(film.UPrimary() - film.Us()); + const scalarField availableMass((delta - deltaMin_)*rho*magSf); forAll(dMass, cellI) diff --git a/src/surfaceFilmModels/surfaceFilmModel/kinematicSingleLayer/kinematicSingleLayer.C b/src/surfaceFilmModels/surfaceFilmModel/kinematicSingleLayer/kinematicSingleLayer.C index c645552e67aa510940d25b230b78d0cc855c2e5a..903cf1bda1abd1628b5b223313a77103924b40df 100644 --- a/src/surfaceFilmModels/surfaceFilmModel/kinematicSingleLayer/kinematicSingleLayer.C +++ b/src/surfaceFilmModels/surfaceFilmModel/kinematicSingleLayer/kinematicSingleLayer.C @@ -289,12 +289,14 @@ Foam::surfaceFilmModels::kinematicSingleLayer::CourantNumber() const { const scalar deltaT = time_.deltaTValue(); - surfaceScalarField SfUfbyDelta = + surfaceScalarField SfUfbyDelta + ( filmRegion_.surfaceInterpolation::deltaCoeffs()*mag(phi_) /fvc::interpolate ( rho_*(delta_ + dimensionedScalar("SMALL", dimLength, SMALL)) - ); + ) + ); CoNum = max(SfUfbyDelta/filmRegion_.magSf()).value()*deltaT; @@ -310,13 +312,13 @@ Foam::surfaceFilmModels::kinematicSingleLayer::CourantNumber() const void Foam::surfaceFilmModels::kinematicSingleLayer::continuityCheck() { - const volScalarField deltaRho0 = deltaRho_; + const volScalarField deltaRho0(deltaRho_); solveContinuity(); if (debug) { - volScalarField mass = deltaRho_*magSf_; + volScalarField mass(deltaRho_*magSf_); dimensionedScalar totalMass = fvc::domainIntegrate(mass) + dimensionedScalar("SMALL", dimMass*dimVolume, ROOTVSMALL); @@ -478,11 +480,11 @@ void Foam::surfaceFilmModels::kinematicSingleLayer::solveThickness Info<< "kinematicSingleLayer::solveThickness()" << endl; } - volScalarField rAU = 1.0/UEqn.A(); + volScalarField rAU(1.0/UEqn.A()); U_ = rAU*UEqn.H(); - surfaceScalarField deltarAUf = fvc::interpolate(delta_*rAU); - surfaceScalarField rhof = fvc::interpolate(rho_); + surfaceScalarField deltarAUf(fvc::interpolate(delta_*rAU)); + surfaceScalarField rhof(fvc::interpolate(rho_)); surfaceScalarField phiAdd ( @@ -504,8 +506,10 @@ void Foam::surfaceFilmModels::kinematicSingleLayer::solveThickness ); constrainFilmField(phid, 0.0); - surfaceScalarField ddrhorAUppf = - fvc::interpolate(delta_)*deltarAUf*rhof*fvc::interpolate(pp); + surfaceScalarField ddrhorAUppf + ( + fvc::interpolate(delta_)*deltarAUf*rhof*fvc::interpolate(pp) + ); // constrainFilmField(ddrhorAUppf, 0.0); for (int nonOrth=0; nonOrth<=nNonOrthCorr_; nonOrth++) diff --git a/src/surfaceFilmModels/surfaceFilmModel/surfaceFilmModel/surfaceFilmModel.C b/src/surfaceFilmModels/surfaceFilmModel/surfaceFilmModel/surfaceFilmModel.C index 9ac01432fbb55efaf3bab9fcc5d8d993a55c92fe..65e97c62dc77f152e0218913f46bf96a62ed60a6 100644 --- a/src/surfaceFilmModels/surfaceFilmModel/surfaceFilmModel/surfaceFilmModel.C +++ b/src/surfaceFilmModels/surfaceFilmModel/surfaceFilmModel/surfaceFilmModel.C @@ -37,18 +37,19 @@ namespace Foam defineTypeNameAndDebug(surfaceFilmModel, 0); defineRunTimeSelectionTable(surfaceFilmModel, mesh); } -} - -template<> -const char* -Foam::NamedEnum<Foam::surfaceFilmModels::surfaceFilmModel::thermoModelType, 2>:: -names[] = -{ - "constant", - "singleComponent" -}; + template<> + const char* Foam::NamedEnum + < + Foam::surfaceFilmModels::surfaceFilmModel::thermoModelType, + 2 + >::names[] = + { + "constant", + "singleComponent" + }; +} const Foam::NamedEnum<Foam::surfaceFilmModels::surfaceFilmModel::thermoModelType, 2> diff --git a/src/surfaceFilmModels/surfaceFilmModel/thermoSingleLayer/thermoSingleLayer.C b/src/surfaceFilmModels/surfaceFilmModel/thermoSingleLayer/thermoSingleLayer.C index 2d849f580479a2b1619dcae175a3180121856f29..1723c09f711ba96227ad2697675eb9f5de3572c9 100644 --- a/src/surfaceFilmModels/surfaceFilmModel/thermoSingleLayer/thermoSingleLayer.C +++ b/src/surfaceFilmModels/surfaceFilmModel/thermoSingleLayer/thermoSingleLayer.C @@ -618,8 +618,10 @@ Foam::surfaceFilmModels::thermoSingleLayer::Srho() const const label filmPatchI = filmBottomPatchIDs_[i]; - scalarField patchMass = - massPhaseChangeForPrimary_.boundaryField()[filmPatchI]; + scalarField patchMass + ( + massPhaseChangeForPrimary_.boundaryField()[filmPatchI] + ); distMap.distribute(patchMass); @@ -678,8 +680,10 @@ Foam::surfaceFilmModels::thermoSingleLayer::Srho(const label i) const const label filmPatchI = filmBottomPatchIDs_[i]; - scalarField patchMass = - massPhaseChangeForPrimary_.boundaryField()[filmPatchI]; + scalarField patchMass + ( + massPhaseChangeForPrimary_.boundaryField()[filmPatchI] + ); distMap.distribute(patchMass); @@ -737,8 +741,10 @@ Foam::surfaceFilmModels::thermoSingleLayer::Sh() const const label filmPatchI = filmBottomPatchIDs_[i]; - scalarField patchEnergy = - energyPhaseChangeForPrimary_.boundaryField()[filmPatchI]; + scalarField patchEnergy + ( + energyPhaseChangeForPrimary_.boundaryField()[filmPatchI] + ); distMap.distribute(patchEnergy); const labelUList& cells = wpp.faceCells(); diff --git a/src/thermophysicalModels/barotropicCompressibilityModel/Chung/Chung.C b/src/thermophysicalModels/barotropicCompressibilityModel/Chung/Chung.C index a93fbfb8b0d0d7fa66ab073d42bf5298f99e2602..2764c4ce5ff3ab9db5f55766c7ef565a36fcdf4d 100644 --- a/src/thermophysicalModels/barotropicCompressibilityModel/Chung/Chung.C +++ b/src/thermophysicalModels/barotropicCompressibilityModel/Chung/Chung.C @@ -65,10 +65,13 @@ Foam::compressibilityModels::Chung::Chung void Foam::compressibilityModels::Chung::correct() { - volScalarField sfa = sqrt + volScalarField sfa ( - (rhovSat_/psiv_) - /((scalar(1) - gamma_)*rhovSat_/psiv_ + gamma_*rholSat_/psil_) + sqrt + ( + (rhovSat_/psiv_) + /((scalar(1) - gamma_)*rhovSat_/psiv_ + gamma_*rholSat_/psil_) + ) ); psi_ = sqr diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/fixedEnthalpy/fixedEnthalpyFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/fixedEnthalpy/fixedEnthalpyFvPatchScalarField.C index 39a4013c02ab336e9d878434887e1480950de7fd..8dc9d9bd153237a8cda67edba2a0b0f6c8bdba56 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/fixedEnthalpy/fixedEnthalpyFvPatchScalarField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/fixedEnthalpy/fixedEnthalpyFvPatchScalarField.C @@ -120,7 +120,7 @@ void Foam::fixedEnthalpyFvPatchScalarField::updateCoeffs() namespace Foam { - makePatchTypeField + makeNonTemplatedPatchTypeField ( fvPatchScalarField, fixedEnthalpyFvPatchScalarField diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/fixedInternalEnergy/fixedInternalEnergyFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/fixedInternalEnergy/fixedInternalEnergyFvPatchScalarField.C index 33986878fd41342b31be51ee0485dcf2b007cd93..e7dc50385c5d48751165c6a2fe4df4bfba68f3d4 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/fixedInternalEnergy/fixedInternalEnergyFvPatchScalarField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/fixedInternalEnergy/fixedInternalEnergyFvPatchScalarField.C @@ -29,14 +29,10 @@ License #include "volFields.H" #include "basicThermo.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -fixedInternalEnergyFvPatchScalarField::fixedInternalEnergyFvPatchScalarField +Foam::fixedInternalEnergyFvPatchScalarField:: +fixedInternalEnergyFvPatchScalarField ( const fvPatch& p, const DimensionedField<scalar, volMesh>& iF @@ -46,7 +42,8 @@ fixedInternalEnergyFvPatchScalarField::fixedInternalEnergyFvPatchScalarField {} -fixedInternalEnergyFvPatchScalarField::fixedInternalEnergyFvPatchScalarField +Foam::fixedInternalEnergyFvPatchScalarField:: +fixedInternalEnergyFvPatchScalarField ( const fixedInternalEnergyFvPatchScalarField& ptf, const fvPatch& p, @@ -58,7 +55,8 @@ fixedInternalEnergyFvPatchScalarField::fixedInternalEnergyFvPatchScalarField {} -fixedInternalEnergyFvPatchScalarField::fixedInternalEnergyFvPatchScalarField +Foam::fixedInternalEnergyFvPatchScalarField:: +fixedInternalEnergyFvPatchScalarField ( const fvPatch& p, const DimensionedField<scalar, volMesh>& iF, @@ -69,7 +67,8 @@ fixedInternalEnergyFvPatchScalarField::fixedInternalEnergyFvPatchScalarField {} -fixedInternalEnergyFvPatchScalarField::fixedInternalEnergyFvPatchScalarField +Foam::fixedInternalEnergyFvPatchScalarField:: +fixedInternalEnergyFvPatchScalarField ( const fixedInternalEnergyFvPatchScalarField& tppsf ) @@ -78,7 +77,8 @@ fixedInternalEnergyFvPatchScalarField::fixedInternalEnergyFvPatchScalarField {} -fixedInternalEnergyFvPatchScalarField::fixedInternalEnergyFvPatchScalarField +Foam::fixedInternalEnergyFvPatchScalarField:: +fixedInternalEnergyFvPatchScalarField ( const fixedInternalEnergyFvPatchScalarField& tppsf, const DimensionedField<scalar, volMesh>& iF @@ -90,7 +90,7 @@ fixedInternalEnergyFvPatchScalarField::fixedInternalEnergyFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void fixedInternalEnergyFvPatchScalarField::updateCoeffs() +void Foam::fixedInternalEnergyFvPatchScalarField::updateCoeffs() { if (updated()) { @@ -115,10 +115,13 @@ void fixedInternalEnergyFvPatchScalarField::updateCoeffs() // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField(fvPatchScalarField, fixedInternalEnergyFvPatchScalarField); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam +namespace Foam +{ + makeNonTemplatedPatchTypeField + ( + fvPatchScalarField, + fixedInternalEnergyFvPatchScalarField + ); +} // ************************************************************************* // diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/gradientEnthalpy/gradientEnthalpyFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/gradientEnthalpy/gradientEnthalpyFvPatchScalarField.C index c2bba9d1ca5140780c761208713c0eb2c63d8002..af060d6a8709829b3c9502385ce8e0f5378fa6c5 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/gradientEnthalpy/gradientEnthalpyFvPatchScalarField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/gradientEnthalpy/gradientEnthalpyFvPatchScalarField.C @@ -131,7 +131,7 @@ void Foam::gradientEnthalpyFvPatchScalarField::updateCoeffs() namespace Foam { - makePatchTypeField + makeNonTemplatedPatchTypeField ( fvPatchScalarField, gradientEnthalpyFvPatchScalarField diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/gradientInternalEnergy/gradientInternalEnergyFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/gradientInternalEnergy/gradientInternalEnergyFvPatchScalarField.C index 9634ac1039ed03d5ba72b25038856c279b7e678c..56d90f7bd7dd87c313b745098f95dd692f70427d 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/gradientInternalEnergy/gradientInternalEnergyFvPatchScalarField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/gradientInternalEnergy/gradientInternalEnergyFvPatchScalarField.C @@ -29,14 +29,9 @@ License #include "volFields.H" #include "basicThermo.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -gradientInternalEnergyFvPatchScalarField:: +Foam::gradientInternalEnergyFvPatchScalarField:: gradientInternalEnergyFvPatchScalarField ( const fvPatch& p, @@ -47,7 +42,7 @@ gradientInternalEnergyFvPatchScalarField {} -gradientInternalEnergyFvPatchScalarField:: +Foam::gradientInternalEnergyFvPatchScalarField:: gradientInternalEnergyFvPatchScalarField ( const gradientInternalEnergyFvPatchScalarField& ptf, @@ -60,7 +55,7 @@ gradientInternalEnergyFvPatchScalarField {} -gradientInternalEnergyFvPatchScalarField:: +Foam::gradientInternalEnergyFvPatchScalarField:: gradientInternalEnergyFvPatchScalarField ( const fvPatch& p, @@ -72,7 +67,7 @@ gradientInternalEnergyFvPatchScalarField {} -gradientInternalEnergyFvPatchScalarField:: +Foam::gradientInternalEnergyFvPatchScalarField:: gradientInternalEnergyFvPatchScalarField ( const gradientInternalEnergyFvPatchScalarField& tppsf @@ -82,7 +77,7 @@ gradientInternalEnergyFvPatchScalarField {} -gradientInternalEnergyFvPatchScalarField:: +Foam::gradientInternalEnergyFvPatchScalarField:: gradientInternalEnergyFvPatchScalarField ( const gradientInternalEnergyFvPatchScalarField& tppsf, @@ -95,7 +90,7 @@ gradientInternalEnergyFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void gradientInternalEnergyFvPatchScalarField::updateCoeffs() +void Foam::gradientInternalEnergyFvPatchScalarField::updateCoeffs() { if (updated()) { @@ -127,14 +122,13 @@ void gradientInternalEnergyFvPatchScalarField::updateCoeffs() // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField -( - fvPatchScalarField, - gradientInternalEnergyFvPatchScalarField -); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam +namespace Foam +{ + makeNonTemplatedPatchTypeField + ( + fvPatchScalarField, + gradientInternalEnergyFvPatchScalarField + ); +} // ************************************************************************* // diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/mixedEnthalpy/mixedEnthalpyFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/mixedEnthalpy/mixedEnthalpyFvPatchScalarField.C index 8fcca1ac28d10ec27fc8fc821d20f8a6993c251f..1d24cda9e4829974329aea662edd13ea847dc20f 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/mixedEnthalpy/mixedEnthalpyFvPatchScalarField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/mixedEnthalpy/mixedEnthalpyFvPatchScalarField.C @@ -141,7 +141,7 @@ void Foam::mixedEnthalpyFvPatchScalarField::updateCoeffs() namespace Foam { - makePatchTypeField + makeNonTemplatedPatchTypeField ( fvPatchScalarField, mixedEnthalpyFvPatchScalarField diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/mixedInternalEnergy/mixedInternalEnergyFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/mixedInternalEnergy/mixedInternalEnergyFvPatchScalarField.C index 772d9fe6306fa84a00cfd86576d23540ebef141d..84856e621403b57af082df30650a4bdc762c662c 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/mixedInternalEnergy/mixedInternalEnergyFvPatchScalarField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/mixedInternalEnergy/mixedInternalEnergyFvPatchScalarField.C @@ -29,14 +29,11 @@ License #include "volFields.H" #include "basicThermo.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -mixedInternalEnergyFvPatchScalarField::mixedInternalEnergyFvPatchScalarField +Foam::mixedInternalEnergyFvPatchScalarField:: +mixedInternalEnergyFvPatchScalarField ( const fvPatch& p, const DimensionedField<scalar, volMesh>& iF @@ -50,7 +47,8 @@ mixedInternalEnergyFvPatchScalarField::mixedInternalEnergyFvPatchScalarField } -mixedInternalEnergyFvPatchScalarField::mixedInternalEnergyFvPatchScalarField +Foam::mixedInternalEnergyFvPatchScalarField:: +mixedInternalEnergyFvPatchScalarField ( const mixedInternalEnergyFvPatchScalarField& ptf, const fvPatch& p, @@ -62,7 +60,8 @@ mixedInternalEnergyFvPatchScalarField::mixedInternalEnergyFvPatchScalarField {} -mixedInternalEnergyFvPatchScalarField::mixedInternalEnergyFvPatchScalarField +Foam::mixedInternalEnergyFvPatchScalarField:: +mixedInternalEnergyFvPatchScalarField ( const fvPatch& p, const DimensionedField<scalar, volMesh>& iF, @@ -73,7 +72,8 @@ mixedInternalEnergyFvPatchScalarField::mixedInternalEnergyFvPatchScalarField {} -mixedInternalEnergyFvPatchScalarField::mixedInternalEnergyFvPatchScalarField +Foam::mixedInternalEnergyFvPatchScalarField:: +mixedInternalEnergyFvPatchScalarField ( const mixedInternalEnergyFvPatchScalarField& tppsf ) @@ -82,7 +82,8 @@ mixedInternalEnergyFvPatchScalarField::mixedInternalEnergyFvPatchScalarField {} -mixedInternalEnergyFvPatchScalarField::mixedInternalEnergyFvPatchScalarField +Foam::mixedInternalEnergyFvPatchScalarField:: +mixedInternalEnergyFvPatchScalarField ( const mixedInternalEnergyFvPatchScalarField& tppsf, const DimensionedField<scalar, volMesh>& iF @@ -94,7 +95,7 @@ mixedInternalEnergyFvPatchScalarField::mixedInternalEnergyFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void mixedInternalEnergyFvPatchScalarField::updateCoeffs() +void Foam::mixedInternalEnergyFvPatchScalarField::updateCoeffs() { if (updated()) { @@ -131,10 +132,13 @@ void mixedInternalEnergyFvPatchScalarField::updateCoeffs() // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField(fvPatchScalarField, mixedInternalEnergyFvPatchScalarField); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam +namespace Foam +{ + makeNonTemplatedPatchTypeField + ( + fvPatchScalarField, + mixedInternalEnergyFvPatchScalarField + ); +} // ************************************************************************* // diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.C index 5e16528b8ac6c94b126176a715da1962564149d1..967a8e30746097ec00ad3c7c2839b719a3be4999 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.C @@ -157,7 +157,7 @@ void Foam::wallHeatTransferFvPatchScalarField::updateCoeffs() const label patchi = patch().index(); const scalarField& Tw = thermo.T().boundaryField()[patchi]; - scalarField Cpw = thermo.Cp(Tw, patchi); + const scalarField Cpw(thermo.Cp(Tw, patchi)); valueFraction() = 1.0/ @@ -184,7 +184,11 @@ void Foam::wallHeatTransferFvPatchScalarField::write(Ostream& os) const namespace Foam { - makePatchTypeField(fvPatchScalarField, wallHeatTransferFvPatchScalarField); + makeNonTemplatedPatchTypeField + ( + fvPatchScalarField, + wallHeatTransferFvPatchScalarField + ); } // ************************************************************************* // diff --git a/src/thermophysicalModels/basicSolidThermo/solidMixtureThermo/solidMixtureThermo/solidMixtureThermo.C b/src/thermophysicalModels/basicSolidThermo/solidMixtureThermo/solidMixtureThermo/solidMixtureThermo.C index 569525e20d4db5e33b82e34155d2496a464eddf1..36f590e8388cf24bfea3e78b73847ea3b1d0ef9f 100644 --- a/src/thermophysicalModels/basicSolidThermo/solidMixtureThermo/solidMixtureThermo/solidMixtureThermo.C +++ b/src/thermophysicalModels/basicSolidThermo/solidMixtureThermo/solidMixtureThermo/solidMixtureThermo.C @@ -226,7 +226,7 @@ Foam::tmp<Foam::scalarField> Foam::solidMixtureThermo<MixtureType>::rho { const scalarField& patchT = T_.boundaryField()[patchI]; const polyPatch& pp = mesh_.boundaryMesh()[patchI]; - const unallocLabelList& cells = pp.faceCells(); + const labelUList& cells = pp.faceCells(); tmp<scalarField> tRho(new scalarField(patchT.size())); scalarField& Rho = tRho(); @@ -248,7 +248,7 @@ Foam::tmp<Foam::scalarField> Foam::solidMixtureThermo<MixtureType>::Cp { const scalarField& patchT = T_.boundaryField()[patchI]; const polyPatch& pp = mesh_.boundaryMesh()[patchI]; - const unallocLabelList& cells = pp.faceCells(); + const labelUList& cells = pp.faceCells(); tmp<scalarField> tCp(new scalarField(patchT.size())); scalarField& Cp = tCp(); @@ -270,7 +270,7 @@ Foam::tmp<Foam::scalarField> Foam::solidMixtureThermo<MixtureType>::hs { const scalarField& patchT = T_.boundaryField()[patchI]; const polyPatch& pp = mesh_.boundaryMesh()[patchI]; - const unallocLabelList& cells = pp.faceCells(); + const labelUList& cells = pp.faceCells(); tmp<scalarField> ths(new scalarField(patchT.size())); scalarField& hs = ths(); @@ -292,7 +292,7 @@ Foam::tmp<Foam::scalarField> Foam::solidMixtureThermo<MixtureType>::K { const scalarField& patchT = T_.boundaryField()[patchI]; const polyPatch& pp = mesh_.boundaryMesh()[patchI]; - const unallocLabelList& cells = pp.faceCells(); + const labelUList& cells = pp.faceCells(); tmp<scalarField> tK(new scalarField(patchT.size())); scalarField& K = tK(); @@ -314,7 +314,7 @@ Foam::tmp<Foam::scalarField> Foam::solidMixtureThermo<MixtureType>::Hf { const scalarField& patchT = T_.boundaryField()[patchI]; const polyPatch& pp = mesh_.boundaryMesh()[patchI]; - const unallocLabelList& cells = pp.faceCells(); + const labelUList& cells = pp.faceCells(); tmp<scalarField> tHf(new scalarField(patchT.size())); scalarField& Hf = tHf(); @@ -336,7 +336,7 @@ Foam::tmp<Foam::scalarField> Foam::solidMixtureThermo<MixtureType>::sigmaS { const scalarField& patchT = T_.boundaryField()[patchI]; const polyPatch& pp = mesh_.boundaryMesh()[patchI]; - const unallocLabelList& cells = pp.faceCells(); + const labelUList& cells = pp.faceCells(); tmp<scalarField> tsigmaS(new scalarField(patchT.size())); scalarField& sigmaS = tsigmaS(); @@ -359,7 +359,7 @@ Foam::tmp<Foam::scalarField> Foam::solidMixtureThermo<MixtureType>::kappa { const scalarField& patchT = T_.boundaryField()[patchI]; const polyPatch& pp = mesh_.boundaryMesh()[patchI]; - const unallocLabelList& cells = pp.faceCells(); + const labelUList& cells = pp.faceCells(); tmp<scalarField> tKappa(new scalarField(patchT.size())); scalarField& kappa = tKappa(); @@ -382,7 +382,7 @@ Foam::tmp<Foam::scalarField> Foam::solidMixtureThermo<MixtureType>::emissivity { const scalarField& patchT = T_.boundaryField()[patchI]; const polyPatch& pp = mesh_.boundaryMesh()[patchI]; - const unallocLabelList& cells = pp.faceCells(); + const labelUList& cells = pp.faceCells(); tmp<scalarField> te(new scalarField(patchT.size())); scalarField& e = te(); diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModel.C b/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModel.C index 1480fc228d430c0841d3ecde9e65f83e7bcf7be9..6b06924cb36c94f891cd75ba4aa1bc22591336a7 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModel.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModel.C @@ -435,8 +435,8 @@ void Foam::ODEChemistryModel<CompType, ThermoType>::jacobian // calculate the dcdT elements numerically const scalar delta = 1.0e-8; - const scalarField dcdT0 = omega(c2, T - delta, p); - const scalarField dcdT1 = omega(c2, T + delta, p); + const scalarField dcdT0(omega(c2, T - delta, p)); + const scalarField dcdT1(omega(c2, T + delta, p)); for (label i = 0; i < nEqns(); i++) { @@ -653,7 +653,7 @@ void Foam::ODEChemistryModel<CompType, ThermoType>::calculate() c[i] = rhoi*Yi/specieThermo_[i].W(); } - const scalarField dcdt = omega(c, Ti, pi); + const scalarField dcdt(omega(c, Ti, pi)); for (label i=0; i<nSpecie_; i++) { diff --git a/src/thermophysicalModels/liquidMixture/liquidMixture/liquidMixture.C b/src/thermophysicalModels/liquidMixture/liquidMixture/liquidMixture.C index 05660e55f1361ac06d589bd9411d0a61eda8cc18..d42a978d712f54c98e3aef5fd39491d2bb95f20f 100644 --- a/src/thermophysicalModels/liquidMixture/liquidMixture/liquidMixture.C +++ b/src/thermophysicalModels/liquidMixture/liquidMixture/liquidMixture.C @@ -197,7 +197,8 @@ Foam::scalarField Foam::liquidMixture::X(const scalarField& Y) const X[i] = Y[i]/properties_[i].W(); } - return X/Winv; + tmp<scalarField> tfld = X/Winv; + return tfld(); } diff --git a/src/thermophysicalModels/pointSolidMixture/pointSolidMixture/pointSolidMixture.C b/src/thermophysicalModels/pointSolidMixture/pointSolidMixture/pointSolidMixture.C index 23fa254e2ce10d0b0edda42335d7104420328928..45e072140187ea97aa3b91cd57f1559850879f0e 100644 --- a/src/thermophysicalModels/pointSolidMixture/pointSolidMixture/pointSolidMixture.C +++ b/src/thermophysicalModels/pointSolidMixture/pointSolidMixture/pointSolidMixture.C @@ -92,7 +92,8 @@ Foam::scalarField Foam::pointSolidMixture::X(const scalarField& Y) const X[i] = Y[i]/properties_[i].rho(); } - return X/rhoInv; + tmp<scalarField> tfld = X/rhoInv; + return tfld(); } diff --git a/src/thermophysicalModels/pointSolids/Make/options b/src/thermophysicalModels/pointSolids/Make/options index d10d7744b54e2417b3ab238ed1b2aaa4dcdd322e..848cce789f2aad33d9ed6eda979ea31c32377425 100644 --- a/src/thermophysicalModels/pointSolids/Make/options +++ b/src/thermophysicalModels/pointSolids/Make/options @@ -1,3 +1,2 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude - diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationMixedFvPatchScalarField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationMixedFvPatchScalarField.C index 9bc80d5c9fe636f1e77165722bc18b671fd79742..42c6b480002eaf5c86261c5fdda90db90a0b60c8 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationMixedFvPatchScalarField.C +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationMixedFvPatchScalarField.C @@ -176,7 +176,7 @@ void Foam::MarshakRadiationFvPatchScalarField::write(Ostream& os) const namespace Foam { - makePatchTypeField + makeNonTemplatedPatchTypeField ( fvPatchScalarField, MarshakRadiationFvPatchScalarField diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiationFixedT/MarshakRadiationFixedTMixedFvPatchScalarField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiationFixedT/MarshakRadiationFixedTMixedFvPatchScalarField.C index cb8cc7db9733aca96c264a8f3ae1768228c0ea67..2cf82ba23c4df3ccbfa8ab8e5c9f68089fca4e7e 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiationFixedT/MarshakRadiationFixedTMixedFvPatchScalarField.C +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiationFixedT/MarshakRadiationFixedTMixedFvPatchScalarField.C @@ -180,7 +180,7 @@ void Foam::MarshakRadiationFixedTMixedFvPatchScalarField::write namespace Foam { - makePatchTypeField + makeNonTemplatedPatchTypeField ( fvPatchScalarField, MarshakRadiationFixedTMixedFvPatchScalarField diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C index e51aab448f0bb83900599dd547d2fa1e36435de1..59871e8dba30677c3a80255727e9117e9bcd994a 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C @@ -167,7 +167,7 @@ updateCoeffs() } scalarField& Iw = *this; - vectorField n = patch().Sf()/patch().magSf(); + const vectorField n(patch().Sf()/patch().magSf()); radiativeIntensityRay& ray = const_cast<radiativeIntensityRay&>(dom.IRay(rayId)); @@ -236,7 +236,7 @@ namespace Foam { namespace radiation { - makePatchTypeField + makeNonTemplatedPatchTypeField ( fvPatchScalarField, greyDiffusiveRadiationMixedFvPatchScalarField diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C index c3426967c55db0a98eea1f6ccf86618661d40483..8de1c8a2b21faf79fd2b2ff74a0d3e65a7394a9c 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C @@ -162,15 +162,17 @@ updateCoeffs() } scalarField& Iw = *this; - vectorField n = patch().Sf()/patch().magSf(); + const vectorField n(patch().Sf()/patch().magSf()); radiativeIntensityRay& ray = const_cast<radiativeIntensityRay&>(dom.IRay(rayId)); ray.Qr().boundaryField()[patchI] += Iw*(n & ray.dAve()); - const scalarField Eb = - dom.blackBody().bLambda(lambdaId).boundaryField()[patchI]; + const scalarField Eb + ( + dom.blackBody().bLambda(lambdaId).boundaryField()[patchI] + ); forAll(Iw, faceI) { @@ -232,7 +234,7 @@ namespace Foam { namespace radiation { - makePatchTypeField + makeNonTemplatedPatchTypeField ( fvPatchScalarField, wideBandDiffusiveRadiationMixedFvPatchScalarField diff --git a/src/thermophysicalModels/radiation/radiationModel/P1/P1.C b/src/thermophysicalModels/radiation/radiationModel/P1/P1.C index 478512e2f88345f369c07db4c603012abe50a051..4b78c93731c063d680a96be08058e77798ee64b2 100644 --- a/src/thermophysicalModels/radiation/radiationModel/P1/P1.C +++ b/src/thermophysicalModels/radiation/radiationModel/P1/P1.C @@ -151,7 +151,7 @@ void Foam::radiation::P1::calculate() a_ = absorptionEmission_->a(); e_ = absorptionEmission_->e(); E_ = absorptionEmission_->E(); - const volScalarField sigmaEff = scatter_->sigmaEff(); + const volScalarField sigmaEff(scatter_->sigmaEff()); // Construct diffusion const volScalarField gamma diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRay.C b/src/thermophysicalModels/radiation/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRay.C index 155956a0d9d250f53a949312c19179b773792d95..89b8e5725cfc960d238594cf0651a50f22e1f151 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRay.C +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRay.C @@ -191,7 +191,7 @@ Foam::scalar Foam::radiation::radiativeIntensityRay::correct() { const volScalarField& k = dom_.aLambda(lambdaI); - surfaceScalarField Ji = dAve_ & mesh_.Sf(); + const surfaceScalarField Ji(dAve_ & mesh_.Sf()); fvScalarMatrix IiEq ( diff --git a/src/thermophysicalModels/radiation/radiationModel/radiationModel/radiationModel.C b/src/thermophysicalModels/radiation/radiationModel/radiationModel/radiationModel.C index cfbb2b614552e0ae7055dc2738f39705982f9bfb..7cea2cb14da5abd795f811e1157c268f740ee0ec 100644 --- a/src/thermophysicalModels/radiation/radiationModel/radiationModel/radiationModel.C +++ b/src/thermophysicalModels/radiation/radiationModel/radiationModel/radiationModel.C @@ -143,8 +143,8 @@ Foam::tmp<Foam::fvScalarMatrix> Foam::radiation::radiationModel::Sh ) const { volScalarField& h = thermo.h(); - const volScalarField cp = thermo.Cp(); - const volScalarField T3 = pow3(T_); + const volScalarField cp(thermo.Cp()); + const volScalarField T3(pow3(T_)); return ( @@ -161,8 +161,8 @@ Foam::tmp<Foam::fvScalarMatrix> Foam::radiation::radiationModel::Shs ) const { volScalarField& hs = thermo.hs(); - const volScalarField cp = thermo.Cp(); - const volScalarField T3 = pow3(T_); + const volScalarField cp(thermo.Cp()); + const volScalarField T3(pow3(T_)); return ( diff --git a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/wideBandAbsorptionEmission/wideBandAbsorptionEmission.H b/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/wideBandAbsorptionEmission/wideBandAbsorptionEmission.H index 4b93da89de9a4f2a8bea7f12ed2e0f2cfe5c1b6d..1283eb8b5c2b2f389d024f7363edab2bd24210de 100644 --- a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/wideBandAbsorptionEmission/wideBandAbsorptionEmission.H +++ b/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/wideBandAbsorptionEmission/wideBandAbsorptionEmission.H @@ -37,7 +37,7 @@ Description The emission constant proportionality is specified per band (EhrrCoeff). - The coefficients for the species in the LookUpTable have to be specified + The coefficients for the species in the lookup table have to be specified for use in moles x P [atm].i.e. (k[i] = species[i]*p*9.869231e-6). The coefficients for CO and soot or any other added are multiplied by the @@ -156,7 +156,7 @@ private: //- Proportion of the heat released rate emitted FixedList<scalar, maxBands_> iEhrrCoeffs_; - //- Look-up table of species related to ft + //- Lookup table of species related to ft mutable interpolationLookUpTable<scalar> lookUpTable_; //- Thermo package diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.H b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.H index 8450b1dd2f9dcd26cf0ee8affa0cb442d4534d38..cd0fa041109654a0f52ea231cbdac6be1a8715c8 100644 --- a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.H +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.H @@ -122,28 +122,24 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #define makeChemistryReader(Thermo) \ - \ -defineTemplateTypeNameAndDebug \ -( \ - chemistryReader<Thermo>, \ - 0 \ -); \ - \ -defineTemplateRunTimeSelectionTable(chemistryReader<Thermo>, dictionary); + defineTemplateTypeNameAndDebug(chemistryReader<Thermo>, 0); \ + defineTemplateRunTimeSelectionTable(chemistryReader<Thermo>, dictionary); #define makeChemistryReaderType(SS, Thermo) \ - \ defineNamedTemplateTypeNameAndDebug(SS<Thermo>, 0); \ - \ chemistryReader<Thermo>::adddictionaryConstructorToTable<SS<Thermo> > \ add##SS##Thermo##ConstructorToTable_; #define addChemistryReaderType(SS, Thermo) \ - \ defineNamedTemplateTypeNameAndDebug(SS, 0); \ - \ + chemistryReader<Thermo>::adddictionaryConstructorToTable<SS> \ + add##SS##Thermo##ConstructorToTable_; + + +#define addNonTemplatedChemistryReaderType(SS, Thermo) \ + defineTypeNameAndDebug(SS, 0); \ chemistryReader<Thermo>::adddictionaryConstructorToTable<SS> \ add##SS##Thermo##ConstructorToTable_; diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.C b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.C index f1676d5bd352876cdd87fa1fe182e28e56da1700..83aa3a2a3ae5e3b33d9de02851337b69d69246bc 100644 --- a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.C +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.C @@ -45,8 +45,9 @@ License namespace Foam { - addChemistryReaderType(chemkinReader, gasThermoPhysics); -}; + addNonTemplatedChemistryReaderType(chemkinReader, gasThermoPhysics); +} + /* * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * */ diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/foamChemistryReader/foamChemistryReader.C b/src/thermophysicalModels/reactionThermo/chemistryReaders/foamChemistryReader/foamChemistryReader.C index 99c98e6deab8f0b7d6ebf1b87786a0586c6d58cd..4130abf21a1ae69ee0b62ccde85bbf96739ac6e1 100644 --- a/src/thermophysicalModels/reactionThermo/chemistryReaders/foamChemistryReader/foamChemistryReader.C +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/foamChemistryReader/foamChemistryReader.C @@ -37,8 +37,20 @@ Foam::foamChemistryReader<ThermoType>::foamChemistryReader ) : chemistryReader<ThermoType>(), - chemDict_(IFstream(reactionsFileName.expand())), - thermoDict_(IFstream(thermoFileName.expand())), + chemDict_ + ( + IFstream + ( + fileName(reactionsFileName).expand() + )() + ), + thermoDict_ + ( + IFstream + ( + fileName(thermoFileName).expand() + )() + ), speciesThermo_(thermoDict_), speciesTable_(chemDict_.lookup("species")), reactions_(speciesTable_, speciesThermo_, chemDict_) diff --git a/src/thermophysicalModels/reactionThermo/combustionThermo/mixtureThermos/hhuMixtureThermo/hhuMixtureThermo.C b/src/thermophysicalModels/reactionThermo/combustionThermo/mixtureThermos/hhuMixtureThermo/hhuMixtureThermo.C index 6dfcab939cbdce7206e25f5edb39468a6aff4657..26d70d5f31a44c8cb692c2990bb6ab3c1452d104 100644 --- a/src/thermophysicalModels/reactionThermo/combustionThermo/mixtureThermos/hhuMixtureThermo/hhuMixtureThermo.C +++ b/src/thermophysicalModels/reactionThermo/combustionThermo/mixtureThermos/hhuMixtureThermo/hhuMixtureThermo.C @@ -481,7 +481,7 @@ Foam::hhuMixtureThermo<MixtureType>::psib() const volScalarField& psib = tpsib(); scalarField& psibCells = psib.internalField(); - volScalarField Tb_ = Tb(); + const volScalarField Tb_(Tb()); const scalarField& TbCells = Tb_.internalField(); const scalarField& pCells = p_.internalField(); @@ -579,7 +579,7 @@ Foam::hhuMixtureThermo<MixtureType>::mub() const volScalarField& mub_ = tmub(); scalarField& mubCells = mub_.internalField(); - volScalarField Tb_ = Tb(); + const volScalarField Tb_(Tb()); const scalarField& TbCells = Tb_.internalField(); forAll(mubCells, celli) diff --git a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.C b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.C index 1755c8fb938c30f17bcb310a435962176b8bfc9d..7068178d89be3fc6bd87f6aa9a5e10fe1abb8b1f 100644 --- a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.C +++ b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.C @@ -29,14 +29,11 @@ License #include "volFields.H" #include "hhuCombustionThermo.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -fixedUnburntEnthalpyFvPatchScalarField::fixedUnburntEnthalpyFvPatchScalarField +Foam::fixedUnburntEnthalpyFvPatchScalarField:: +fixedUnburntEnthalpyFvPatchScalarField ( const fvPatch& p, const DimensionedField<scalar, volMesh>& iF @@ -46,7 +43,8 @@ fixedUnburntEnthalpyFvPatchScalarField::fixedUnburntEnthalpyFvPatchScalarField {} -fixedUnburntEnthalpyFvPatchScalarField::fixedUnburntEnthalpyFvPatchScalarField +Foam::fixedUnburntEnthalpyFvPatchScalarField:: +fixedUnburntEnthalpyFvPatchScalarField ( const fixedUnburntEnthalpyFvPatchScalarField& ptf, const fvPatch& p, @@ -58,7 +56,8 @@ fixedUnburntEnthalpyFvPatchScalarField::fixedUnburntEnthalpyFvPatchScalarField {} -fixedUnburntEnthalpyFvPatchScalarField::fixedUnburntEnthalpyFvPatchScalarField +Foam::fixedUnburntEnthalpyFvPatchScalarField:: +fixedUnburntEnthalpyFvPatchScalarField ( const fvPatch& p, const DimensionedField<scalar, volMesh>& iF, @@ -69,7 +68,8 @@ fixedUnburntEnthalpyFvPatchScalarField::fixedUnburntEnthalpyFvPatchScalarField {} -fixedUnburntEnthalpyFvPatchScalarField::fixedUnburntEnthalpyFvPatchScalarField +Foam::fixedUnburntEnthalpyFvPatchScalarField:: +fixedUnburntEnthalpyFvPatchScalarField ( const fixedUnburntEnthalpyFvPatchScalarField& tppsf ) @@ -78,7 +78,8 @@ fixedUnburntEnthalpyFvPatchScalarField::fixedUnburntEnthalpyFvPatchScalarField {} -fixedUnburntEnthalpyFvPatchScalarField::fixedUnburntEnthalpyFvPatchScalarField +Foam::fixedUnburntEnthalpyFvPatchScalarField:: +fixedUnburntEnthalpyFvPatchScalarField ( const fixedUnburntEnthalpyFvPatchScalarField& tppsf, const DimensionedField<scalar, volMesh>& iF @@ -90,7 +91,7 @@ fixedUnburntEnthalpyFvPatchScalarField::fixedUnburntEnthalpyFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void fixedUnburntEnthalpyFvPatchScalarField::updateCoeffs() +void Foam::fixedUnburntEnthalpyFvPatchScalarField::updateCoeffs() { if (updated()) { @@ -115,10 +116,13 @@ void fixedUnburntEnthalpyFvPatchScalarField::updateCoeffs() // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField(fvPatchScalarField, fixedUnburntEnthalpyFvPatchScalarField); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam +namespace Foam +{ + makeNonTemplatedPatchTypeField + ( + fvPatchScalarField, + fixedUnburntEnthalpyFvPatchScalarField + ); +} // ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.C b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.C index 9fcf936b3879ea9d054ca33c0ccce8bba97c5243..39707826790b3eaedccd88287c66271410ddf221 100644 --- a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.C +++ b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.C @@ -29,14 +29,9 @@ License #include "volFields.H" #include "hhuCombustionThermo.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -gradientUnburntEnthalpyFvPatchScalarField:: +Foam::gradientUnburntEnthalpyFvPatchScalarField:: gradientUnburntEnthalpyFvPatchScalarField ( const fvPatch& p, @@ -47,7 +42,7 @@ gradientUnburntEnthalpyFvPatchScalarField {} -gradientUnburntEnthalpyFvPatchScalarField:: +Foam::gradientUnburntEnthalpyFvPatchScalarField:: gradientUnburntEnthalpyFvPatchScalarField ( const gradientUnburntEnthalpyFvPatchScalarField& ptf, @@ -60,7 +55,7 @@ gradientUnburntEnthalpyFvPatchScalarField {} -gradientUnburntEnthalpyFvPatchScalarField:: +Foam::gradientUnburntEnthalpyFvPatchScalarField:: gradientUnburntEnthalpyFvPatchScalarField ( const fvPatch& p, @@ -72,7 +67,7 @@ gradientUnburntEnthalpyFvPatchScalarField {} -gradientUnburntEnthalpyFvPatchScalarField:: +Foam::gradientUnburntEnthalpyFvPatchScalarField:: gradientUnburntEnthalpyFvPatchScalarField ( const gradientUnburntEnthalpyFvPatchScalarField& tppsf @@ -82,7 +77,7 @@ gradientUnburntEnthalpyFvPatchScalarField {} -gradientUnburntEnthalpyFvPatchScalarField:: +Foam::gradientUnburntEnthalpyFvPatchScalarField:: gradientUnburntEnthalpyFvPatchScalarField ( const gradientUnburntEnthalpyFvPatchScalarField& tppsf, @@ -95,7 +90,7 @@ gradientUnburntEnthalpyFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void gradientUnburntEnthalpyFvPatchScalarField::updateCoeffs() +void Foam::gradientUnburntEnthalpyFvPatchScalarField::updateCoeffs() { if (updated()) { @@ -127,14 +122,13 @@ void gradientUnburntEnthalpyFvPatchScalarField::updateCoeffs() // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField -( - fvPatchScalarField, - gradientUnburntEnthalpyFvPatchScalarField -); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam +namespace Foam +{ + makeNonTemplatedPatchTypeField + ( + fvPatchScalarField, + gradientUnburntEnthalpyFvPatchScalarField + ); +} // ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.C b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.C index 08436a30cf149ca8d23a45752daca99f2b0d04ce..ad79174e0f5b47a3a4800614ac98300dd874e170 100644 --- a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.C +++ b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.C @@ -29,14 +29,10 @@ License #include "volFields.H" #include "hhuCombustionThermo.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -mixedUnburntEnthalpyFvPatchScalarField::mixedUnburntEnthalpyFvPatchScalarField +Foam::mixedUnburntEnthalpyFvPatchScalarField:: +mixedUnburntEnthalpyFvPatchScalarField ( const fvPatch& p, const DimensionedField<scalar, volMesh>& iF @@ -50,7 +46,8 @@ mixedUnburntEnthalpyFvPatchScalarField::mixedUnburntEnthalpyFvPatchScalarField } -mixedUnburntEnthalpyFvPatchScalarField::mixedUnburntEnthalpyFvPatchScalarField +Foam::mixedUnburntEnthalpyFvPatchScalarField:: +mixedUnburntEnthalpyFvPatchScalarField ( const mixedUnburntEnthalpyFvPatchScalarField& ptf, const fvPatch& p, @@ -62,7 +59,8 @@ mixedUnburntEnthalpyFvPatchScalarField::mixedUnburntEnthalpyFvPatchScalarField {} -mixedUnburntEnthalpyFvPatchScalarField::mixedUnburntEnthalpyFvPatchScalarField +Foam::mixedUnburntEnthalpyFvPatchScalarField:: +mixedUnburntEnthalpyFvPatchScalarField ( const fvPatch& p, const DimensionedField<scalar, volMesh>& iF, @@ -73,7 +71,8 @@ mixedUnburntEnthalpyFvPatchScalarField::mixedUnburntEnthalpyFvPatchScalarField {} -mixedUnburntEnthalpyFvPatchScalarField::mixedUnburntEnthalpyFvPatchScalarField +Foam::mixedUnburntEnthalpyFvPatchScalarField:: +mixedUnburntEnthalpyFvPatchScalarField ( const mixedUnburntEnthalpyFvPatchScalarField& tppsf ) @@ -82,7 +81,8 @@ mixedUnburntEnthalpyFvPatchScalarField::mixedUnburntEnthalpyFvPatchScalarField {} -mixedUnburntEnthalpyFvPatchScalarField::mixedUnburntEnthalpyFvPatchScalarField +Foam::mixedUnburntEnthalpyFvPatchScalarField:: +mixedUnburntEnthalpyFvPatchScalarField ( const mixedUnburntEnthalpyFvPatchScalarField& tppsf, const DimensionedField<scalar, volMesh>& iF @@ -94,7 +94,7 @@ mixedUnburntEnthalpyFvPatchScalarField::mixedUnburntEnthalpyFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void mixedUnburntEnthalpyFvPatchScalarField::updateCoeffs() +void Foam::mixedUnburntEnthalpyFvPatchScalarField::updateCoeffs() { if (updated()) { @@ -130,10 +130,13 @@ void mixedUnburntEnthalpyFvPatchScalarField::updateCoeffs() // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField(fvPatchScalarField, mixedUnburntEnthalpyFvPatchScalarField); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam +namespace Foam +{ + makeNonTemplatedPatchTypeField + ( + fvPatchScalarField, + mixedUnburntEnthalpyFvPatchScalarField + ); +} // ************************************************************************* // diff --git a/src/thermophysicalModels/solid/include/solidThermoPhysicsTypes.H b/src/thermophysicalModels/solid/include/solidThermoPhysicsTypes.H index 30f2268abf3215b1ae02728d7aa6bacf477b5286..fb0ba655dd6345626529e42599b4a596775a0341 100644 --- a/src/thermophysicalModels/solid/include/solidThermoPhysicsTypes.H +++ b/src/thermophysicalModels/solid/include/solidThermoPhysicsTypes.H @@ -68,4 +68,3 @@ namespace Foam #endif // ************************************************************************* // - diff --git a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.C b/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.C index cad5fafc900a1c3ec0b234730638cea0287f7f1b..1fe312057a4cd34f53b6d1764cfd09679165cd42 100644 --- a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.C +++ b/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.C @@ -33,7 +33,7 @@ Foam::string Foam::Reaction<ReactionThermo>::reactionStr() const { OStringStream reaction; - for (label i = 0; i < lhs_.size(); i++) + for (label i = 0; i < lhs_.size(); ++i) { if (i > 0) { @@ -52,7 +52,7 @@ Foam::string Foam::Reaction<ReactionThermo>::reactionStr() const reaction << " = "; - for (label i = 0; i < rhs_.size(); i++) + for (label i = 0; i < rhs_.size(); ++i) { if (i > 0) { @@ -86,9 +86,9 @@ void Foam::Reaction<ReactionThermo>::setThermo rhs_[0].stoichCoeff*(*thermoDatabase[species_[rhs_[0].index]]) ); - for (label i=1; i<rhs_.size(); i++) + for (label i=1; i<rhs_.size(); ++i) { - operator+= + this->operator+= ( rhs_[i].stoichCoeff*(*thermoDatabase[species_[rhs_[i].index]]) ); @@ -96,7 +96,7 @@ void Foam::Reaction<ReactionThermo>::setThermo forAll(lhs_, i) { - operator-= + this->operator-= ( lhs_[i].stoichCoeff*(*thermoDatabase[species_[lhs_[i].index]]) ); diff --git a/src/transportModels/incompressible/incompressibleTwoPhaseMixture/twoPhaseMixture.C b/src/transportModels/incompressible/incompressibleTwoPhaseMixture/twoPhaseMixture.C index d7f49166e55cb3db3aa0513ea9110188014fcb73..1b56e42e91fbea023b60a7fbe94a60b6507d4a16 100644 --- a/src/transportModels/incompressible/incompressibleTwoPhaseMixture/twoPhaseMixture.C +++ b/src/transportModels/incompressible/incompressibleTwoPhaseMixture/twoPhaseMixture.C @@ -37,7 +37,7 @@ void Foam::twoPhaseMixture::calcNu() nuModel1_->correct(); nuModel2_->correct(); - volScalarField limitedAlpha1 + const volScalarField limitedAlpha1 ( "limitedAlpha1", min(max(alpha1_, scalar(0)), scalar(1)) @@ -112,7 +112,10 @@ Foam::twoPhaseMixture::twoPhaseMixture Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixture::mu() const { - volScalarField limitedAlpha1 = min(max(alpha1_, scalar(0)), scalar(1)); + const volScalarField limitedAlpha1 + ( + min(max(alpha1_, scalar(0)), scalar(1)) + ); return tmp<volScalarField> ( @@ -128,8 +131,10 @@ Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixture::mu() const Foam::tmp<Foam::surfaceScalarField> Foam::twoPhaseMixture::muf() const { - surfaceScalarField alpha1f = - min(max(fvc::interpolate(alpha1_), scalar(0)), scalar(1)); + const surfaceScalarField alpha1f + ( + min(max(fvc::interpolate(alpha1_), scalar(0)), scalar(1)) + ); return tmp<surfaceScalarField> ( @@ -145,8 +150,10 @@ Foam::tmp<Foam::surfaceScalarField> Foam::twoPhaseMixture::muf() const Foam::tmp<Foam::surfaceScalarField> Foam::twoPhaseMixture::nuf() const { - surfaceScalarField alpha1f = - min(max(fvc::interpolate(alpha1_), scalar(0)), scalar(1)); + const surfaceScalarField alpha1f + ( + min(max(fvc::interpolate(alpha1_), scalar(0)), scalar(1)) + ); return tmp<surfaceScalarField> ( diff --git a/src/transportModels/interfaceProperties/interfaceProperties.C b/src/transportModels/interfaceProperties/interfaceProperties.C index a68ce1d5992b7aecaa9fdd0ef8bef01f73dc1054..3ed4c86485e1b0ed58a9e1a6aa0ab446df4a5281 100644 --- a/src/transportModels/interfaceProperties/interfaceProperties.C +++ b/src/transportModels/interfaceProperties/interfaceProperties.C @@ -70,31 +70,33 @@ void Foam::interfaceProperties::correctContactAngle ); fvsPatchVectorField& nHatp = nHatb[patchi]; - scalarField theta = - convertToRad*acap.theta(U_.boundaryField()[patchi], nHatp); + const scalarField theta + ( + convertToRad*acap.theta(U_.boundaryField()[patchi], nHatp) + ); - vectorField nf = boundary[patchi].nf(); + const vectorField nf + ( + boundary[patchi].nf() + ); // Reset nHatp to correspond to the contact angle - scalarField a12 = nHatp & nf; - - scalarField b1 = cos(theta); + const scalarField a12(nHatp & nf); + const scalarField b1(cos(theta)); scalarField b2(nHatp.size()); - forAll(b2, facei) { b2[facei] = cos(acos(a12[facei]) - theta[facei]); } - scalarField det = 1.0 - a12*a12; + const scalarField det(1.0 - a12*a12); - scalarField a = (b1 - a12*b2)/det; - scalarField b = (b2 - a12*b1)/det; + scalarField a((b1 - a12*b2)/det); + scalarField b((b2 - a12*b1)/det); nHatp = a*nf + b*nHatp; - nHatp /= (mag(nHatp) + deltaN_.value()); acap.gradient() = (nf & nHatp)*mag(gradAlphaf[patchi]); @@ -109,16 +111,17 @@ void Foam::interfaceProperties::calculateK() const surfaceVectorField& Sf = mesh.Sf(); // Cell gradient of alpha - volVectorField gradAlpha = fvc::grad(alpha1_); + const volVectorField gradAlpha(fvc::grad(alpha1_)); // Interpolated face-gradient of alpha - surfaceVectorField gradAlphaf = fvc::interpolate(gradAlpha); + surfaceVectorField gradAlphaf(fvc::interpolate(gradAlpha)); + //gradAlphaf -= // (mesh.Sf()/mesh.magSf()) // *(fvc::snGrad(alpha1_) - (mesh.Sf() & gradAlphaf)/mesh.magSf()); // Face unit interface normal - surfaceVectorField nHatfv = gradAlphaf/(mag(gradAlphaf) + deltaN_); + surfaceVectorField nHatfv(gradAlphaf/(mag(gradAlphaf) + deltaN_)); correctContactAngle(nHatfv.boundaryField(), gradAlphaf.boundaryField()); // Face unit interface normal flux @@ -130,7 +133,7 @@ void Foam::interfaceProperties::calculateK() // Complex expression for curvature. // Correction is formally zero but numerically non-zero. /* - volVectorField nHat = gradAlpha/(mag(gradAlpha) + deltaN_); + volVectorField nHat(gradAlpha/(mag(gradAlpha) + deltaN_)); forAll(nHat.boundaryField(), patchi) { nHat.boundaryField()[patchi] = nHatfv.boundaryField()[patchi]; diff --git a/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.C b/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.C index 53e2bdc5c8b05cb492814158f6ae9d7a99e2c490..cfeeeb4c48fc20e55a9426f9d3b64692facae74d 100644 --- a/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.C +++ b/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.C @@ -48,6 +48,7 @@ namespace Foam }; } + const Foam::NamedEnum < Foam::alphaContactAngleFvPatchScalarField::limitControls, diff --git a/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.C b/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.C index c2917b3b6a6934379924b724b1225c4fdefb3c33..4306ee7651ca97c3003a3c38485370f662e4ec0b 100644 --- a/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.C +++ b/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -122,7 +122,7 @@ void Foam::constantAlphaContactAngleFvPatchScalarField::write namespace Foam { - makePatchTypeField + makeNonTemplatedPatchTypeField ( fvPatchScalarField, constantAlphaContactAngleFvPatchScalarField diff --git a/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.H b/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.H index 1c3e987067f261f1c6890d6fb1bb5afcd3675df8..ae9e754b90f687891762223ce4757a9a028f4767 100644 --- a/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.H +++ b/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.C b/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.C index eaeba4174e0a3a54336eaf9275d2bbe3301d2b70..04bb1217491ebbe90b75c01f32ab8d996256cf90 100644 --- a/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.C +++ b/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.C @@ -123,21 +123,21 @@ Foam::dynamicAlphaContactAngleFvPatchScalarField::theta return tmp<scalarField>(new scalarField(size(), theta0_)); } - vectorField nf = patch().nf(); + const vectorField nf(patch().nf()); // Calculated the component of the velocity parallel to the wall - vectorField Uwall = Up.patchInternalField() - Up; + vectorField Uwall(Up.patchInternalField() - Up); Uwall -= (nf & Uwall)*nf; // Find the direction of the interface parallel to the wall - vectorField nWall = nHat - (nf & nHat)*nf; + vectorField nWall(nHat - (nf & nHat)*nf); // Normalise nWall nWall /= (mag(nWall) + SMALL); // Calculate Uwall resolved normal to the interface parallel to // the interface - scalarField uwall = nWall & Uwall; + scalarField uwall(nWall & Uwall); return theta0_ + (thetaA_ - thetaR_)*tanh(uwall/uTheta_); } @@ -158,7 +158,7 @@ void Foam::dynamicAlphaContactAngleFvPatchScalarField::write(Ostream& os) const namespace Foam { - makePatchTypeField + makeNonTemplatedPatchTypeField ( fvPatchScalarField, dynamicAlphaContactAngleFvPatchScalarField diff --git a/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.C b/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.C index a4b55a7345432ad062217720a0e16c1e9c253bf1..0266c27b28d2b61a1fd32fe07b8c7b268598e4a0 100644 --- a/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.C +++ b/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.C @@ -143,7 +143,7 @@ void Foam::timeVaryingAlphaContactAngleFvPatchScalarField::write namespace Foam { - makePatchTypeField + makeNonTemplatedPatchTypeField ( fvPatchScalarField, timeVaryingAlphaContactAngleFvPatchScalarField diff --git a/src/transportModels/twoPhaseInterfaceProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C b/src/transportModels/twoPhaseInterfaceProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C index f6265b63039a70c689041fad9cfc5e9e7c36b751..ced344217c972eefc9e30dc1d3a50ca35a431d41 100644 --- a/src/transportModels/twoPhaseInterfaceProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C +++ b/src/transportModels/twoPhaseInterfaceProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C @@ -167,7 +167,7 @@ void Foam::alphaFixedPressureFvPatchScalarField::write namespace Foam { - makePatchTypeField + makeNonTemplatedPatchTypeField ( fvPatchScalarField, alphaFixedPressureFvPatchScalarField diff --git a/src/triSurface/tools/labelledTri/labelledTri.H b/src/triSurface/tools/labelledTri/labelledTri.H index d8d57394be8bb36ff1da4ca30669335091cd3939..70d5fbfffd6d9d7d242245948b65b77f8637eee6 100644 --- a/src/triSurface/tools/labelledTri/labelledTri.H +++ b/src/triSurface/tools/labelledTri/labelledTri.H @@ -62,6 +62,13 @@ public: //- Construct null inline labelledTri(); + //- Construct from triFace and a region label + inline labelledTri + ( + const triFace&, + const label region + ); + //- Construct from three point labels and a region label inline labelledTri ( diff --git a/src/triSurface/tools/labelledTri/labelledTriI.H b/src/triSurface/tools/labelledTri/labelledTriI.H index 91a2347f32056d5a20e6ad3790ce62e5cebda365..91c1a921349e22d0a1c12304d5cd651d7a921870 100644 --- a/src/triSurface/tools/labelledTri/labelledTriI.H +++ b/src/triSurface/tools/labelledTri/labelledTriI.H @@ -21,41 +21,43 @@ License You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. -Description - \*---------------------------------------------------------------------------*/ #include "IOstreams.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -//- Construct null -inline labelledTri::labelledTri() +inline Foam::labelledTri::labelledTri() : region_(-1) {} -//- Construct from components -inline labelledTri::labelledTri +inline Foam::labelledTri::labelledTri +( + const triFace& tri, + const label region +) +: + triFace(tri), + region_(region) +{} + + +inline Foam::labelledTri::labelledTri ( - const label A, - const label B, - const label C, + const label a, + const label b, + const label c, const label region ) : - triFace(A, B, C), + triFace(a, b, c), region_(region) {} -inline labelledTri::labelledTri(Istream& is) +inline Foam::labelledTri::labelledTri(Istream& is) { operator>>(is, *this); } @@ -63,12 +65,12 @@ inline labelledTri::labelledTri(Istream& is) // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -inline label labelledTri::region() const +inline Foam::label Foam::labelledTri::region() const { return region_; } -inline label& labelledTri::region() +inline Foam::label& Foam::labelledTri::region() { return region_; } @@ -76,7 +78,7 @@ inline label& labelledTri::region() // * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // -inline Istream& operator>>(Istream& is, labelledTri& t) +inline Foam::Istream& Foam::operator>>(Istream& is, labelledTri& t) { if (is.format() == IOstream::ASCII) { @@ -100,7 +102,7 @@ inline Istream& operator>>(Istream& is, labelledTri& t) } -inline Ostream& operator<<(Ostream& os, const labelledTri& t) +inline Foam::Ostream& Foam::operator<<(Ostream& os, const labelledTri& t) { if (os.format() == IOstream::ASCII) { @@ -125,8 +127,4 @@ inline Ostream& operator<<(Ostream& os, const labelledTri& t) } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/triSurface/triSurface/interfaces/AC3D/writeAC.C b/src/triSurface/triSurface/interfaces/AC3D/writeAC.C index 8be7289526d9f2f3082382b9f138c4e2d14067d9..53b3b372917db3aaebaa7d580fb803fb60fea768 100644 --- a/src/triSurface/triSurface/interfaces/AC3D/writeAC.C +++ b/src/triSurface/triSurface/interfaces/AC3D/writeAC.C @@ -26,14 +26,10 @@ License #include "triSurface.H" #include "IOmanip.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void triSurface::writeAC(Ostream& os) const +void Foam::triSurface::writeAC(Ostream& os) const { // Write with patches as separate objects under "world" object. // Header is taken over from sample file. @@ -140,8 +136,4 @@ void triSurface::writeAC(Ostream& os) const } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/triSurface/triSurface/interfaces/GTS/readGTS.C b/src/triSurface/triSurface/interfaces/GTS/readGTS.C index 2b45baa8eb9dadead1e13be215fcdfadf69c2230..6ec57e3c39f97f268852c1d3c9467cb9aa82e074 100644 --- a/src/triSurface/triSurface/interfaces/GTS/readGTS.C +++ b/src/triSurface/triSurface/interfaces/GTS/readGTS.C @@ -27,14 +27,10 @@ License #include "IFstream.H" #include "IStringStream.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -bool triSurface::readGTS(const fileName& GTSfileName) +bool Foam::triSurface::readGTS(const fileName& GTSfileName) { IFstream GTSfile(GTSfileName); @@ -162,8 +158,4 @@ bool triSurface::readGTS(const fileName& GTSfileName) } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/triSurface/triSurface/interfaces/OBJ/readOBJ.C b/src/triSurface/triSurface/interfaces/OBJ/readOBJ.C index f2aa25aca7f5bdff2122d36ab17f5a5acaac9e57..8bfe9667517adea6de95c7762638168f5e1a012c 100644 --- a/src/triSurface/triSurface/interfaces/OBJ/readOBJ.C +++ b/src/triSurface/triSurface/interfaces/OBJ/readOBJ.C @@ -27,14 +27,9 @@ License #include "IFstream.H" #include "IStringStream.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -bool triSurface::readOBJ(const fileName& OBJfileName) +bool Foam::triSurface::readOBJ(const fileName& OBJfileName) { IFstream OBJfile(OBJfileName); @@ -195,8 +190,4 @@ bool triSurface::readOBJ(const fileName& OBJfileName) } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/triSurface/triSurface/interfaces/OFF/readOFF.C b/src/triSurface/triSurface/interfaces/OFF/readOFF.C index 66e995c46bbe80b18767894f339115e77e28d53b..67a7cc45a04b36b5ff9404f3f164ac500130264d 100644 --- a/src/triSurface/triSurface/interfaces/OFF/readOFF.C +++ b/src/triSurface/triSurface/interfaces/OFF/readOFF.C @@ -30,14 +30,9 @@ Description #include "IFstream.H" #include "IStringStream.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -bool triSurface::readOFF(const fileName& OFFfileName) +bool Foam::triSurface::readOFF(const fileName& OFFfileName) { IFstream OFFfile(OFFfileName); @@ -136,8 +131,4 @@ bool triSurface::readOFF(const fileName& OFFfileName) } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/triSurface/triSurface/interfaces/STL/readSTLASCII.L b/src/triSurface/triSurface/interfaces/STL/readSTLASCII.L index 3ebe585cca08e372f685c3203f7c635dc4e52b82..36861145d7d7bbe5c0867ec9e1ca94c659b872dd 100644 --- a/src/triSurface/triSurface/interfaces/STL/readSTLASCII.L +++ b/src/triSurface/triSurface/interfaces/STL/readSTLASCII.L @@ -200,7 +200,7 @@ endsolid {space}("endsolid"|"ENDSOLID")({some_space}{word})* %{ // End of read character pointer returned by strtof - char* endPtr; + // char* endPtr; STLpoint normal; STLpoint vertex; diff --git a/src/triSurface/triSurface/interfaces/STL/readSTLBINARY.C b/src/triSurface/triSurface/interfaces/STL/readSTLBINARY.C index 6f153c4e3a3338c2b80d7d10a3b124cefcda8b59..e44ad78ddd798d691c77108635517f87852bc7be 100644 --- a/src/triSurface/triSurface/interfaces/STL/readSTLBINARY.C +++ b/src/triSurface/triSurface/interfaces/STL/readSTLBINARY.C @@ -29,14 +29,10 @@ License #include "OSspecific.H" #include "gzstream.h" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -bool triSurface::readSTLBINARY(const fileName& STLfileName) +bool Foam::triSurface::readSTLBINARY(const fileName& STLfileName) { bool compressed = false; @@ -133,8 +129,4 @@ bool triSurface::readSTLBINARY(const fileName& STLfileName) } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/triSurface/triSurface/interfaces/STL/writeSTL.C b/src/triSurface/triSurface/interfaces/STL/writeSTL.C index 3abcb3dc9adb2335c3c03ca5ece8d1074a874dcf..fd6eefd61ed45dddfd3f9500fb9b0f1374e12f08 100644 --- a/src/triSurface/triSurface/interfaces/STL/writeSTL.C +++ b/src/triSurface/triSurface/interfaces/STL/writeSTL.C @@ -29,14 +29,9 @@ License #include "HashTable.H" #include "hashSignedLabel.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void triSurface::writeSTLASCII(Ostream& os) const +void Foam::triSurface::writeSTLASCII(Ostream& os) const { labelList faceMap; @@ -85,7 +80,7 @@ void triSurface::writeSTLASCII(Ostream& os) const } -void triSurface::writeSTLBINARY(std::ostream& os) const +void Foam::triSurface::writeSTLBINARY(std::ostream& os) const { // Write the STL header string header("Foam binary STL", STLheaderSize); @@ -113,8 +108,4 @@ void triSurface::writeSTLBINARY(std::ostream& os) const } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/triSurface/triSurface/stitchTriangles.C b/src/triSurface/triSurface/stitchTriangles.C index 8771aeaec504315a371a1e8d946422f318324baf..3e50995a2f68c728c26175825d1ff4a084ba6507 100644 --- a/src/triSurface/triSurface/stitchTriangles.C +++ b/src/triSurface/triSurface/stitchTriangles.C @@ -27,14 +27,9 @@ License #include "mergePoints.H" #include "PackedBoolList.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -bool triSurface::stitchTriangles +bool Foam::triSurface::stitchTriangles ( const pointField& rawPoints, const scalar tol, @@ -114,11 +109,11 @@ bool triSurface::stitchTriangles forAll(*this, i) { - const labelledTri& tri = operator[](i); + const triSurface::FaceType& f = operator[](i); - forAll(tri, fp) + forAll(f, fp) { - label pointI = tri[fp]; + label pointI = f[fp]; if (pointIsUsed.set(pointI, 1)) { nPoints++; @@ -161,8 +156,4 @@ bool triSurface::stitchTriangles } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/triSurface/triSurface/triSurface.C b/src/triSurface/triSurface/triSurface.C index 399d0f6b35c13895006364c25eeec167cb65c8ca..172ec32ef59ae07b1b2988cccab63609edf33a2b 100644 --- a/src/triSurface/triSurface/triSurface.C +++ b/src/triSurface/triSurface/triSurface.C @@ -187,20 +187,18 @@ void Foam::triSurface::checkTriangles(const bool verbose) forAll(*this, faceI) { - const labelledTri& f = (*this)[faceI]; + const triSurface::FaceType& f = (*this)[faceI]; - if - ( - (f[0] < 0) || (f[0] > maxPointI) - || (f[1] < 0) || (f[1] > maxPointI) - || (f[2] < 0) || (f[2] > maxPointI) - ) + forAll(f, fp) { - FatalErrorIn("triSurface::checkTriangles(bool)") - << "triangle " << f - << " uses point indices outside point range 0.." - << maxPointI - << exit(FatalError); + if (f[fp] < 0 || f[fp] > maxPointI) + { + FatalErrorIn("triSurface::checkTriangles(bool)") + << "triangle " << f + << " uses point indices outside point range 0.." + << maxPointI + << exit(FatalError); + } } } @@ -516,7 +514,7 @@ Foam::surfacePatchList Foam::triSurface::calcPatches(labelList& faceMap) const maxRegion = max ( maxRegion, - operator[](faceMap[faceMap.size() - 1]).region() + operator[](faceMap.last()).region() ); } @@ -960,42 +958,30 @@ void Foam::triSurface::subsetMeshMap boolList pointHad(nPoints(), false); - forAll(include, oldFacei) + forAll(include, oldFaceI) { - if (include[oldFacei]) + if (include[oldFaceI]) { // Store new faces compact - faceMap[faceI++] = oldFacei; - - // Renumber labels for triangle - const labelledTri& tri = locFaces[oldFacei]; + faceMap[faceI++] = oldFaceI; - label a = tri[0]; - if (!pointHad[a]) - { - pointHad[a] = true; - pointMap[pointI++] = a; - } - - label b = tri[1]; - if (!pointHad[b]) - { - pointHad[b] = true; - pointMap[pointI++] = b; - } + // Renumber labels for face + const triSurface::FaceType& f = locFaces[oldFaceI]; - label c = tri[2]; - if (!pointHad[c]) + forAll(f, fp) { - pointHad[c] = true; - pointMap[pointI++] = c; + label labI = f[fp]; + if (!pointHad[labI]) + { + pointHad[labI] = true; + pointMap[pointI++] = labI; + } } } } // Trim faceMap.setSize(faceI); - pointMap.setSize(pointI); } @@ -1086,9 +1072,9 @@ void Foam::triSurface::writeStats(Ostream& os) const label nPoints = 0; boundBox bb = boundBox::invertedBox; - forAll(*this, triI) + forAll(*this, faceI) { - const labelledTri& f = operator[](triI); + const triSurface::FaceType& f = operator[](faceI); forAll(f, fp) { diff --git a/src/triSurface/triSurface/triSurface.H b/src/triSurface/triSurface/triSurface.H index fc9f532516c1a0b4d5a91d6c422ad56f9234b591..35c8e34a8dd83bfae99255e9462e0b0ef81b9edc 100644 --- a/src/triSurface/triSurface/triSurface.H +++ b/src/triSurface/triSurface/triSurface.H @@ -223,6 +223,9 @@ public: // Public typedefs + //- Face type used + typedef labelledTri FaceType; + //- Placeholder only, but do not remove - it is needed for GeoMesh typedef bool BoundaryMesh; diff --git a/src/triSurface/triSurface/triSurfaceAddressing.C b/src/triSurface/triSurface/triSurfaceAddressing.C index 0bdc2eb020607222a8fce6fbfbd5919b94cd8d8f..aabde669312055a3c93af718b4f6516a435f5224 100644 --- a/src/triSurface/triSurface/triSurfaceAddressing.C +++ b/src/triSurface/triSurface/triSurfaceAddressing.C @@ -32,14 +32,10 @@ Description #include "SortableList.H" #include "transform.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -void triSurface::calcSortedEdgeFaces() const +void Foam::triSurface::calcSortedEdgeFaces() const { if (sortedEdgeFacesPtr_) { @@ -126,7 +122,7 @@ void triSurface::calcSortedEdgeFaces() const } -void triSurface::calcEdgeOwner() const +void Foam::triSurface::calcEdgeOwner() const { if (edgeOwnerPtr_) { @@ -187,8 +183,4 @@ void triSurface::calcEdgeOwner() const } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/turbulenceModels/compressible/LES/DeardorffDiffStress/DeardorffDiffStress.C b/src/turbulenceModels/compressible/LES/DeardorffDiffStress/DeardorffDiffStress.C index ad26f52ffe7685a2195eff8ec3f3a7bf35673447..a1db55fa6c9bcecd047ab13c5a89336cc783baa3 100644 --- a/src/turbulenceModels/compressible/LES/DeardorffDiffStress/DeardorffDiffStress.C +++ b/src/turbulenceModels/compressible/LES/DeardorffDiffStress/DeardorffDiffStress.C @@ -101,11 +101,11 @@ void DeardorffDiffStress::correct(const tmp<volTensorField>& tgradU) GenSGSStress::correct(gradU); - volSymmTensorField D = symm(gradU); + volSymmTensorField D(symm(gradU)); - volSymmTensorField P = -rho()*twoSymm(B_ & gradU); + volSymmTensorField P(-rho()*twoSymm(B_ & gradU)); - volScalarField K = 0.5*tr(B_); + volScalarField K(0.5*tr(B_)); tmp<fvSymmTensorMatrix> BEqn ( diff --git a/src/turbulenceModels/compressible/LES/GenSGSStress/GenSGSStress.H b/src/turbulenceModels/compressible/LES/GenSGSStress/GenSGSStress.H index 36302943fe195f03073700ada21fcc58e59eba99..13c9ff5e1062fad81a9e87e97204bc6d9735bea9 100644 --- a/src/turbulenceModels/compressible/LES/GenSGSStress/GenSGSStress.H +++ b/src/turbulenceModels/compressible/LES/GenSGSStress/GenSGSStress.H @@ -115,7 +115,7 @@ public: //- Return the SGS turbulent dissipation virtual tmp<volScalarField> epsilon() const { - volScalarField K = k(); + const volScalarField K(k()); return ce_*K*sqrt(K)/delta(); } diff --git a/src/turbulenceModels/compressible/LES/Smagorinsky/Smagorinsky.C b/src/turbulenceModels/compressible/LES/Smagorinsky/Smagorinsky.C index 7c7a1fb34e9d2bfe3c0aeb1cec8ae74b80be8846..0276ad5559531cb1964622bd936ac2dbf39f980a 100644 --- a/src/turbulenceModels/compressible/LES/Smagorinsky/Smagorinsky.C +++ b/src/turbulenceModels/compressible/LES/Smagorinsky/Smagorinsky.C @@ -45,11 +45,11 @@ addToRunTimeSelectionTable(LESModel, Smagorinsky, dictionary); void Smagorinsky::updateSubGridScaleFields(const volTensorField& gradU) { - volSymmTensorField D = symm(gradU); + volSymmTensorField D(symm(gradU)); - volScalarField a = ce_/delta(); - volScalarField b = (2.0/3.0)*tr(D); - volScalarField c = 2*ck_*delta()*(dev(D) && D); + volScalarField a(ce_/delta()); + volScalarField b((2.0/3.0)*tr(D)); + volScalarField c(2*ck_*delta()*(dev(D) && D)); k_ = sqr((-b + sqrt(sqr(b) + 4*a*c))/(2*a)); diff --git a/src/turbulenceModels/compressible/LES/SpalartAllmaras/SpalartAllmaras.C b/src/turbulenceModels/compressible/LES/SpalartAllmaras/SpalartAllmaras.C index 57175b380b73a83f6f88cba8b6cc136f63a35889..e29d747c66a3ae19ae3a1e470200d7c78f98123e 100644 --- a/src/turbulenceModels/compressible/LES/SpalartAllmaras/SpalartAllmaras.C +++ b/src/turbulenceModels/compressible/LES/SpalartAllmaras/SpalartAllmaras.C @@ -56,7 +56,7 @@ void SpalartAllmaras::updateSubGridScaleFields() tmp<volScalarField> SpalartAllmaras::fv1() const { - volScalarField chi3 = pow3(rho()*nuTilda_/mu()); + volScalarField chi3(pow3(rho()*nuTilda_/mu())); return chi3/(chi3 + pow3(Cv1_)); } @@ -69,8 +69,8 @@ tmp<volScalarField> SpalartAllmaras::fv2() const tmp<volScalarField> SpalartAllmaras::fv3() const { - volScalarField chi = rho()*nuTilda_/mu(); - volScalarField chiByCv2 = (1/Cv2_)*chi; + volScalarField chi(rho()*nuTilda_/mu()); + volScalarField chiByCv2((1/Cv2_)*chi); return (scalar(1) + chi*fv1()) @@ -82,18 +82,25 @@ tmp<volScalarField> SpalartAllmaras::fv3() const tmp<volScalarField> SpalartAllmaras::fw(const volScalarField& Stilda) const { - volScalarField r = min + volScalarField r ( - nuTilda_ - /( - max(Stilda, dimensionedScalar("SMALL", Stilda.dimensions(), SMALL)) - *sqr(kappa_*dTilda_) - ), - scalar(10.0) + min + ( + nuTilda_ + /( + max + ( + Stilda, + dimensionedScalar("SMALL", Stilda.dimensions(), SMALL) + ) + *sqr(kappa_*dTilda_) + ), + scalar(10.0) + ) ); r.boundaryField() == 0.0; - volScalarField g = r + Cw2_*(pow6(r) - r); + volScalarField g(r + Cw2_*(pow6(r) - r)); return g*pow((1.0 + pow6(Cw3_))/(pow6(g) + pow6(Cw3_)), 1.0/6.0); } @@ -300,8 +307,10 @@ void SpalartAllmaras::correct(const tmp<volTensorField>& tgradU) dTilda_ = min(CDES_*delta(), wallDist(mesh_).y()); } - volScalarField Stilda = - fv3()*::sqrt(2.0)*mag(skew(gradU)) + fv2()*nuTilda_/sqr(kappa_*dTilda_); + volScalarField Stilda + ( + fv3()*::sqrt(2.0)*mag(skew(gradU)) + fv2()*nuTilda_/sqr(kappa_*dTilda_) + ); tmp<fvScalarMatrix> nuTildaEqn ( diff --git a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsJayatillekeWallFunction/alphaSgsJayatillekeWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsJayatillekeWallFunction/alphaSgsJayatillekeWallFunctionFvPatchScalarField.C index d9dffce684eb28cb10a0f971453a7b8883a3ad10..482b33ba37a6cbd6593d097dc41d5bde6cd6ab30 100644 --- a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsJayatillekeWallFunction/alphaSgsJayatillekeWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsJayatillekeWallFunction/alphaSgsJayatillekeWallFunctionFvPatchScalarField.C @@ -205,14 +205,14 @@ void alphaSgsJayatillekeWallFunctionFvPatchScalarField::evaluate const label patchI = patch().index(); const scalarField& muw = lesModel.mu().boundaryField()[patchI]; - const scalarField muSgsw = lesModel.muSgs()().boundaryField()[patchI]; + const scalarField muSgsw(lesModel.muSgs()().boundaryField()[patchI]); const scalarField& alphaw = lesModel.alpha().boundaryField()[patchI]; scalarField& alphaSgsw = *this; const fvPatchVectorField& Uw = lesModel.U().boundaryField()[patchI]; - const scalarField magUp = mag(Uw.patchInternalField() - Uw); - const scalarField magGradUw = mag(Uw.snGrad()); + const scalarField magUp(mag(Uw.patchInternalField() - Uw)); + const scalarField magGradUw(mag(Uw.snGrad())); const scalarField& rhow = lesModel.rho().boundaryField()[patchI]; const fvPatchScalarField& hw = @@ -221,7 +221,7 @@ void alphaSgsJayatillekeWallFunctionFvPatchScalarField::evaluate const scalarField& ry = patch().deltaCoeffs(); // Heat flux [W/m2] - lagging alphaSgsw - const scalarField qDot = (alphaw + alphaSgsw)*hw.snGrad(); + const scalarField qDot((alphaw + alphaSgsw)*hw.snGrad()); // Populate boundary values forAll(alphaSgsw, faceI) @@ -326,7 +326,7 @@ void alphaSgsJayatillekeWallFunctionFvPatchScalarField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField +makeNonTemplatedPatchTypeField ( fvPatchScalarField, alphaSgsJayatillekeWallFunctionFvPatchScalarField diff --git a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsWallFunction/alphaSgsWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsWallFunction/alphaSgsWallFunctionFvPatchScalarField.C index d78adbf35e3b6775b029397c6631a4594dc1bb06..6bd84e09a3b36c154be84220f7ca6776c700de81 100644 --- a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsWallFunction/alphaSgsWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsWallFunction/alphaSgsWallFunctionFvPatchScalarField.C @@ -138,8 +138,10 @@ void alphaSgsWallFunctionFvPatchScalarField::evaluate { const LESModel& lesModel = db().lookupObject<LESModel>("LESProperties"); - const scalarField muSgsw = - lesModel.muSgs()().boundaryField()[patch().index()]; + const scalarField muSgsw + ( + lesModel.muSgs()().boundaryField()[patch().index()] + ); operator==(muSgsw/Prt_); } @@ -147,7 +149,7 @@ void alphaSgsWallFunctionFvPatchScalarField::evaluate // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField +makeNonTemplatedPatchTypeField ( fvPatchScalarField, alphaSgsWallFunctionFvPatchScalarField diff --git a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsUSpaldingWallFunction/muSgsUSpaldingWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsUSpaldingWallFunction/muSgsUSpaldingWallFunctionFvPatchScalarField.C index 5de4d019a9ab028f228eecd6832c890ad4784a90..13c4a76608b37f966cbe871f03ad4506f269c2ed 100644 --- a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsUSpaldingWallFunction/muSgsUSpaldingWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsUSpaldingWallFunction/muSgsUSpaldingWallFunctionFvPatchScalarField.C @@ -134,7 +134,7 @@ void muSgsUSpaldingWallFunctionFvPatchScalarField::evaluate const fvPatchVectorField& U = patch().lookupPatchField<volVectorField, vector>(UName_); - scalarField magUp = mag(U.patchInternalField() - U); + const scalarField magUp(mag(U.patchInternalField() - U)); const scalarField& muw = patch().lookupPatchField<volScalarField, scalar>(muName_); @@ -144,7 +144,7 @@ void muSgsUSpaldingWallFunctionFvPatchScalarField::evaluate scalarField& muSgsw = *this; - scalarField magFaceGradU = mag(U.snGrad()); + const scalarField magFaceGradU(mag(U.snGrad())); forAll(muSgsw, facei) { @@ -208,7 +208,7 @@ void muSgsUSpaldingWallFunctionFvPatchScalarField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField +makeNonTemplatedPatchTypeField ( fvPatchScalarField, muSgsUSpaldingWallFunctionFvPatchScalarField diff --git a/src/turbulenceModels/compressible/LES/dynOneEqEddy/dynOneEqEddy.C b/src/turbulenceModels/compressible/LES/dynOneEqEddy/dynOneEqEddy.C index 2f6960151ab59ed4f741458ed0268ac8b7a57efa..54f8cf22ae5c29535fd2662a6469f6ae558c664e 100644 --- a/src/turbulenceModels/compressible/LES/dynOneEqEddy/dynOneEqEddy.C +++ b/src/turbulenceModels/compressible/LES/dynOneEqEddy/dynOneEqEddy.C @@ -54,12 +54,14 @@ void dynOneEqEddy::updateSubGridScaleFields(const volSymmTensorField& D) dimensionedScalar dynOneEqEddy::ck_(const volSymmTensorField& D) const { - volScalarField KK = 0.5*(filter_(magSqr(U())) - magSqr(filter_(U()))); + volScalarField KK(0.5*(filter_(magSqr(U())) - magSqr(filter_(U())))); - volSymmTensorField LL = dev(filter_(sqr(U())) - (sqr(filter_(U())))); + volSymmTensorField LL(dev(filter_(sqr(U())) - (sqr(filter_(U()))))); - volSymmTensorField MM = - delta()*(filter_(sqrt(k_)*D) - 2*sqrt(KK + filter_(k_))*filter_(D)); + volSymmTensorField MM + ( + delta()*(filter_(sqrt(k_)*D) - 2*sqrt(KK + filter_(k_))*filter_(D)) + ); return average(LL && MM)/average(magSqr(MM)); } @@ -67,17 +69,21 @@ dimensionedScalar dynOneEqEddy::ck_(const volSymmTensorField& D) const dimensionedScalar dynOneEqEddy::ce_(const volSymmTensorField& D) const { - volScalarField KK = 0.5*(filter_(magSqr(U())) - magSqr(filter_(U()))); + volScalarField KK(0.5*(filter_(magSqr(U())) - magSqr(filter_(U())))); - volScalarField mm = - pow(KK + filter_(k_), 1.5)/(2*delta()) - filter_(pow(k_, 1.5))/delta(); + volScalarField mm + ( + pow(KK + filter_(k_), 1.5)/(2*delta()) - filter_(pow(k_, 1.5))/delta() + ); - volScalarField ee = + volScalarField ee + ( 2*delta()*ck_(D) *( filter_(sqrt(k_)*magSqr(D)) - 2*sqrt(KK + filter_(k_))*magSqr(filter_(D)) - ); + ) + ); return average(ee*mm)/average(mm*mm); } @@ -115,9 +121,9 @@ void dynOneEqEddy::correct(const tmp<volTensorField>& tgradU) GenEddyVisc::correct(gradU); - volSymmTensorField D = dev(symm(gradU)); - volScalarField divU = fvc::div(phi()/fvc::interpolate(rho())); - volScalarField G = 2*muSgs_*(gradU && D); + volSymmTensorField D(dev(symm(gradU))); + volScalarField divU(fvc::div(phi()/fvc::interpolate(rho()))); + volScalarField G(2*muSgs_*(gradU && D)); tmp<fvScalarMatrix> kEqn ( diff --git a/src/turbulenceModels/compressible/LES/lowReOneEqEddy/lowReOneEqEddy.C b/src/turbulenceModels/compressible/LES/lowReOneEqEddy/lowReOneEqEddy.C index 02099f6433e4271972c2e3aa46f37d096f9247ed..f4dd6f8cb9d7172f89c35acbb6f112eb2ba98179 100644 --- a/src/turbulenceModels/compressible/LES/lowReOneEqEddy/lowReOneEqEddy.C +++ b/src/turbulenceModels/compressible/LES/lowReOneEqEddy/lowReOneEqEddy.C @@ -104,8 +104,8 @@ void lowReOneEqEddy::correct(const tmp<volTensorField>& tgradU) GenEddyVisc::correct(gradU); - volScalarField divU = fvc::div(phi()/fvc::interpolate(rho())); - volScalarField G = 2*muSgs_*(gradU && dev(symm(gradU))); + volScalarField divU(fvc::div(phi()/fvc::interpolate(rho()))); + volScalarField G(2*muSgs_*(gradU && dev(symm(gradU)))); tmp<fvScalarMatrix> kEqn ( diff --git a/src/turbulenceModels/compressible/LES/oneEqEddy/oneEqEddy.C b/src/turbulenceModels/compressible/LES/oneEqEddy/oneEqEddy.C index c2c4ef4a24661316275ba30f2597e760c8c1e050..b81487e99e1f0f96e3f6d7c13f74dc1df901a1b8 100644 --- a/src/turbulenceModels/compressible/LES/oneEqEddy/oneEqEddy.C +++ b/src/turbulenceModels/compressible/LES/oneEqEddy/oneEqEddy.C @@ -91,8 +91,8 @@ void oneEqEddy::correct(const tmp<volTensorField>& tgradU) GenEddyVisc::correct(gradU); - volScalarField divU = fvc::div(phi()/fvc::interpolate(rho())); - volScalarField G = 2*muSgs_*(gradU && dev(symm(gradU))); + volScalarField divU(fvc::div(phi()/fvc::interpolate(rho()))); + volScalarField G(2*muSgs_*(gradU && dev(symm(gradU)))); tmp<fvScalarMatrix> kEqn ( diff --git a/src/turbulenceModels/compressible/RAS/LRR/LRR.C b/src/turbulenceModels/compressible/RAS/LRR/LRR.C index f07252c7e29e2071b760854bdc324fdfbe1896e6..3bfda7a26778754f4ab1eb5e17e845b1ae5ea2d8 100644 --- a/src/turbulenceModels/compressible/RAS/LRR/LRR.C +++ b/src/turbulenceModels/compressible/RAS/LRR/LRR.C @@ -340,7 +340,7 @@ void LRR::correct() RASModel::correct(); - volSymmTensorField P = -twoSymm(R_ & fvc::grad(U_)); + volSymmTensorField P(-twoSymm(R_ & fvc::grad(U_))); volScalarField G("RASModel::G", 0.5*mag(tr(P))); // Update epsilon and G at the wall @@ -446,7 +446,7 @@ void LRR::correct() const scalarField& rhow = rho_.boundaryField()[patchi]; const scalarField& mutw = mut_.boundaryField()[patchi]; - vectorField snGradU = U_.boundaryField()[patchi].snGrad(); + const vectorField snGradU(U_.boundaryField()[patchi].snGrad()); const vectorField& faceAreas = mesh_.Sf().boundaryField()[patchi]; diff --git a/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C b/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C index 411bde1e35440eef3b1b1e4d08226f9a80fbef11..365190f357cb43a2b7e52c35e764b9b5839ad1a3 100644 --- a/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C +++ b/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C @@ -378,7 +378,7 @@ void LaunderGibsonRSTM::correct() y_.correct(); } - volSymmTensorField P = -twoSymm(R_ & fvc::grad(U_)); + volSymmTensorField P(-twoSymm(R_ & fvc::grad(U_))); volScalarField G("RASModel::G", 0.5*mag(tr(P))); // Update epsilon and G at the wall @@ -426,7 +426,7 @@ void LaunderGibsonRSTM::correct() } } - volSymmTensorField reflect = C1Ref_*epsilon_/k_*R_ - C2Ref_*Clg2_*dev(P); + volSymmTensorField reflect(C1Ref_*epsilon_/k_*R_ - C2Ref_*Clg2_*dev(P)); tmp<fvSymmTensorMatrix> REqn ( @@ -492,7 +492,7 @@ void LaunderGibsonRSTM::correct() const scalarField& mutw = mut_.boundaryField()[patchi]; const scalarField& rhow = rho_.boundaryField()[patchi]; - vectorField snGradU = U_.boundaryField()[patchi].snGrad(); + const vectorField snGradU(U_.boundaryField()[patchi].snGrad()); const vectorField& faceAreas = mesh_.Sf().boundaryField()[patchi]; diff --git a/src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C b/src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C index 94cbc64e76f31d687af015fdcb416dc4718ca82f..6be55f0d903d98c2950b47b8144ad7a9b30d07c0 100644 --- a/src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C +++ b/src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C @@ -293,10 +293,10 @@ void LaunderSharmaKE::correct() // Calculate parameters and coefficients for Launder-Sharma low-Reynolds // number model - volScalarField E = 2.0*mu()*mut_*fvc::magSqrGradGrad(U_)/rho_; - volScalarField D = 2.0*mu()*magSqr(fvc::grad(sqrt(k_)))/rho_; + volScalarField E(2.0*mu()*mut_*fvc::magSqrGradGrad(U_)/rho_); + volScalarField D(2.0*mu()*magSqr(fvc::grad(sqrt(k_)))/rho_); - volScalarField divU = fvc::div(phi_/fvc::interpolate(rho_)); + volScalarField divU(fvc::div(phi_/fvc::interpolate(rho_))); if (mesh_.moving()) { diff --git a/src/turbulenceModels/compressible/RAS/RNGkEpsilon/RNGkEpsilon.C b/src/turbulenceModels/compressible/RAS/RNGkEpsilon/RNGkEpsilon.C index 70aaedec2a410c7244b2951999de17179af366a7..8983ba64cb8404a9d4fc67933e918e36c3a6de39 100644 --- a/src/turbulenceModels/compressible/RAS/RNGkEpsilon/RNGkEpsilon.C +++ b/src/turbulenceModels/compressible/RAS/RNGkEpsilon/RNGkEpsilon.C @@ -292,7 +292,7 @@ void RNGkEpsilon::correct() RASModel::correct(); - volScalarField divU = fvc::div(phi_/fvc::interpolate(rho_)); + volScalarField divU(fvc::div(phi_/fvc::interpolate(rho_))); if (mesh_.moving()) { @@ -300,16 +300,18 @@ void RNGkEpsilon::correct() } tmp<volTensorField> tgradU = fvc::grad(U_); - volScalarField S2 = (tgradU() && dev(twoSymm(tgradU()))); + volScalarField S2((tgradU() && dev(twoSymm(tgradU())))); tgradU.clear(); volScalarField G("RASModel::G", mut_*S2); - volScalarField eta = sqrt(mag(S2))*k_/epsilon_; - volScalarField eta3 = eta*sqr(eta); + volScalarField eta(sqrt(mag(S2))*k_/epsilon_); + volScalarField eta3(eta*sqr(eta)); - volScalarField R = - ((eta*(-eta/eta0_ + scalar(1)))/(beta_*eta3 + scalar(1))); + volScalarField R + ( + ((eta*(-eta/eta0_ + scalar(1)))/(beta_*eta3 + scalar(1))) + ); // Update epsilon and G at the wall epsilon_.boundaryField().updateCoeffs(); diff --git a/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.C b/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.C index 04022940e877a88e678dcd38b744008d85e64c99..9f0880639d94421949254c9f116de6b2d3f419c7 100644 --- a/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.C +++ b/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.C @@ -52,7 +52,7 @@ tmp<volScalarField> SpalartAllmaras::chi() const tmp<volScalarField> SpalartAllmaras::fv1(const volScalarField& chi) const { - volScalarField chi3 = pow3(chi); + volScalarField chi3(pow3(chi)); return chi3/(chi3 + pow3(Cv1_)); } @@ -73,7 +73,7 @@ tmp<volScalarField> SpalartAllmaras::fv3 const volScalarField& fv1 ) const { - volScalarField chiByCv2 = (1/Cv2_)*chi; + volScalarField chiByCv2((1/Cv2_)*chi); return (scalar(1) + chi*fv1) @@ -85,18 +85,25 @@ tmp<volScalarField> SpalartAllmaras::fv3 tmp<volScalarField> SpalartAllmaras::fw(const volScalarField& Stilda) const { - volScalarField r = min + volScalarField r ( - nuTilda_ - /( - max(Stilda, dimensionedScalar("SMALL", Stilda.dimensions(), SMALL)) - *sqr(kappa_*d_) - ), - scalar(10.0) + min + ( + nuTilda_ + /( + max + ( + Stilda, + dimensionedScalar("SMALL", Stilda.dimensions(), SMALL) + ) + *sqr(kappa_*d_) + ), + scalar(10.0) + ) ); r.boundaryField() == 0.0; - volScalarField g = r + Cw2_*(pow6(r) - r); + volScalarField g(r + Cw2_*(pow6(r) - r)); return g*pow((1.0 + pow6(Cw3_))/(pow6(g) + pow6(Cw3_)), 1.0/6.0); } @@ -340,7 +347,7 @@ tmp<volSymmTensorField> SpalartAllmaras::devRhoReff() const tmp<fvVectorMatrix> SpalartAllmaras::divDevRhoReff(volVectorField& U) const { - volScalarField muEff_ = muEff(); + volScalarField muEff_(muEff()); return ( @@ -397,12 +404,14 @@ void SpalartAllmaras::correct() d_.correct(); } - volScalarField chi = this->chi(); - volScalarField fv1 = this->fv1(chi); + volScalarField chi(this->chi()); + volScalarField fv1(this->fv1(chi)); - volScalarField Stilda = + volScalarField Stilda + ( fv3(chi, fv1)*::sqrt(2.0)*mag(skew(fvc::grad(U_))) - + fv2(chi, fv1)*nuTilda_/sqr(kappa_*d_); + + fv2(chi, fv1)*nuTilda_/sqr(kappa_*d_) + ); tmp<fvScalarMatrix> nuTildaEqn ( diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C index 6296caa2eac78cba650d562606d86e7f7d7c794d..6b09d2e56840e59bf09db5bf082fcf00ddeb0c31 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C @@ -137,7 +137,7 @@ void turbulentMixingLengthDissipationRateInletFvPatchScalarField::write // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField +makeNonTemplatedPatchTypeField ( fvPatchScalarField, turbulentMixingLengthDissipationRateInletFvPatchScalarField diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C index 86d2448632b8a3c4b4b10d75e339309293ba35a0..6f27e3f1c5924ec52c7943224f773cc7b30f137d 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C @@ -142,7 +142,7 @@ void turbulentMixingLengthFrequencyInletFvPatchScalarField::write // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField +makeNonTemplatedPatchTypeField ( fvPatchScalarField, turbulentMixingLengthFrequencyInletFvPatchScalarField diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C index 5cf3a2e11390be245751e2bd8da50987832b5b90..68f6d94fc5535eda35a0e0bde1d91c086e437887 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C @@ -216,15 +216,15 @@ void alphatJayatillekeWallFunctionFvPatchScalarField::updateCoeffs() const volScalarField& k = tk(); const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField magUp = mag(Uw.patchInternalField() - Uw); - const scalarField magGradUw = mag(Uw.snGrad()); + const scalarField magUp(mag(Uw.patchInternalField() - Uw)); + const scalarField magGradUw(mag(Uw.snGrad())); const scalarField& rhow = rasModel.rho().boundaryField()[patchI]; const fvPatchScalarField& hw = rasModel.thermo().h().boundaryField()[patchI]; // Heat flux [W/m2] - lagging alphatw - const scalarField qDot = (alphaw + alphatw)*hw.snGrad(); + const scalarField qDot((alphaw + alphatw)*hw.snGrad()); // Populate boundary values forAll(alphatw, faceI) @@ -300,7 +300,7 @@ void alphatJayatillekeWallFunctionFvPatchScalarField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField +makeNonTemplatedPatchTypeField ( fvPatchScalarField, alphatJayatillekeWallFunctionFvPatchScalarField diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C index 83f7fdb19a28711a648d60af2650e6caa598db1c..db8d139ea7becb41f6a55e8807c449a6c7f5f203 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C @@ -135,7 +135,11 @@ void alphatWallFunctionFvPatchScalarField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField(fvPatchScalarField, alphatWallFunctionFvPatchScalarField); +makeNonTemplatedPatchTypeField +( + fvPatchScalarField, + alphatWallFunctionFvPatchScalarField +); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C index e2b54360686d34236ea16ebc0f352fffd01606e6..8942568755583cafe6a66a870c0eb8f70e519bef 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C @@ -212,7 +212,7 @@ void epsilonWallFunctionFvPatchScalarField::updateCoeffs() const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField magGradUw = mag(Uw.snGrad()); + const scalarField magGradUw(mag(Uw.snGrad())); // Set epsilon and G forAll(mutw, faceI) @@ -253,7 +253,7 @@ void epsilonWallFunctionFvPatchScalarField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField +makeNonTemplatedPatchTypeField ( fvPatchScalarField, epsilonWallFunctionFvPatchScalarField diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchFields.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchFields.H index ea220e3d55297e983f421c0d4121f58a97233c0e..8ef4cfc59663d06105e94180c6d802a7a2c1e1f5 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchFields.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchFields.H @@ -40,7 +40,7 @@ namespace RASModels // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(kqRWallFunction) +makePatchTypeFieldTypedefs(kqRWallFunction); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.C index 3b4261da5d4222a34378d68d7464ceb95ac60499..0067555627d19fd4fb1239dbf9fca45e419375f2 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.C @@ -102,7 +102,7 @@ mutLowReWallFunctionFvPatchScalarField::mutLowReWallFunctionFvPatchScalarField // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField +makeNonTemplatedPatchTypeField ( fvPatchScalarField, mutLowReWallFunctionFvPatchScalarField diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutURoughWallFunction/mutURoughWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutURoughWallFunction/mutURoughWallFunctionFvPatchScalarField.C index c4a1bfa84a501201c800b11042142b28b67c136f..cf84331fc1459a703f7e6cf24a50d6d7af6ffbe3 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutURoughWallFunction/mutURoughWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutURoughWallFunction/mutURoughWallFunctionFvPatchScalarField.C @@ -178,7 +178,7 @@ tmp<scalarField> mutURoughWallFunctionFvPatchScalarField::calcMut() const const scalarField& muw = rasModel.mu().boundaryField()[patchI]; const fvPatchScalarField& rho = rasModel.rho().boundaryField()[patchI]; - scalarField magUp = mag(Uw.patchInternalField() - Uw); + scalarField magUp(mag(Uw.patchInternalField() - Uw)); tmp<scalarField> tyPlus = calcYPlus(magUp); scalarField& yPlus = tyPlus(); @@ -277,7 +277,7 @@ tmp<scalarField> mutURoughWallFunctionFvPatchScalarField::yPlus() const const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField magUp = mag(Uw.patchInternalField() - Uw); + const scalarField magUp(mag(Uw.patchInternalField() - Uw)); return calcYPlus(magUp); } @@ -298,7 +298,7 @@ void mutURoughWallFunctionFvPatchScalarField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField +makeNonTemplatedPatchTypeField ( fvPatchScalarField, mutURoughWallFunctionFvPatchScalarField diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUSpaldingWallFunction/mutUSpaldingWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUSpaldingWallFunction/mutUSpaldingWallFunctionFvPatchScalarField.C index bdcb0a8ac7f788dc5649eefd35fdccea62bfda42..16760f81edd28fb535bb82bde3ed90e080090675 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUSpaldingWallFunction/mutUSpaldingWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUSpaldingWallFunction/mutUSpaldingWallFunctionFvPatchScalarField.C @@ -51,7 +51,7 @@ tmp<scalarField> mutUSpaldingWallFunctionFvPatchScalarField::calcUTau const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patch().index()]; - scalarField magUp = mag(Uw.patchInternalField() - Uw); + scalarField magUp(mag(Uw.patchInternalField() - Uw)); const fvPatchScalarField& rhow = rasModel.rho().boundaryField()[patch().index()]; @@ -108,7 +108,7 @@ tmp<scalarField> mutUSpaldingWallFunctionFvPatchScalarField::calcMut() const const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField magGradU = mag(Uw.snGrad()); + const scalarField magGradU(mag(Uw.snGrad())); const scalarField& rhow = rasModel.rho().boundaryField()[patchI]; const scalarField& muw = rasModel.mu().boundaryField()[patchI]; @@ -205,7 +205,7 @@ void mutUSpaldingWallFunctionFvPatchScalarField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField +makeNonTemplatedPatchTypeField ( fvPatchScalarField, mutUSpaldingWallFunctionFvPatchScalarField diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUWallFunction/mutUWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUWallFunction/mutUWallFunctionFvPatchScalarField.C index b1a87182f3e44a733dc651c75e697b830b11b6ed..e1d7a96ac17a5fb67259ab3ab15017c313095f01 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUWallFunction/mutUWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUWallFunction/mutUWallFunctionFvPatchScalarField.C @@ -85,7 +85,7 @@ tmp<scalarField> mutUWallFunctionFvPatchScalarField::calcMut() const const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField magUp = mag(Uw.patchInternalField() - Uw); + const scalarField magUp(mag(Uw.patchInternalField() - Uw)); const fvPatchScalarField& muw = rasModel.mu().boundaryField()[patchI]; tmp<scalarField> tyPlus = calcYPlus(magUp); @@ -168,7 +168,7 @@ tmp<scalarField> mutUWallFunctionFvPatchScalarField::yPlus() const const label patchI = patch().index(); const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField magUp = mag(Uw.patchInternalField() - Uw); + const scalarField magUp(mag(Uw.patchInternalField() - Uw)); return calcYPlus(magUp); } @@ -184,7 +184,7 @@ void mutUWallFunctionFvPatchScalarField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField +makeNonTemplatedPatchTypeField ( fvPatchScalarField, mutUWallFunctionFvPatchScalarField diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkRoughWallFunction/mutkRoughWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkRoughWallFunction/mutkRoughWallFunctionFvPatchScalarField.C index d5e91dac836b94825da735a25e9ab3fdea00c2e8..10e9e7548283cdf2625fd9df3cc25e852719ef46 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkRoughWallFunction/mutkRoughWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkRoughWallFunction/mutkRoughWallFunctionFvPatchScalarField.C @@ -222,7 +222,7 @@ void mutkRoughWallFunctionFvPatchScalarField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField +makeNonTemplatedPatchTypeField ( fvPatchScalarField, mutkRoughWallFunctionFvPatchScalarField diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkWallFunction/mutkWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkWallFunction/mutkWallFunctionFvPatchScalarField.C index b24a32c76af3d6cb44f301b328ac9bbbcf0d9684..079dfb10dd30907ff2929bc0b82da8a9d71deabd 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkWallFunction/mutkWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkWallFunction/mutkWallFunctionFvPatchScalarField.C @@ -210,7 +210,7 @@ tmp<scalarField> mutkWallFunctionFvPatchScalarField::yPlus() const const tmp<volScalarField> tk = rasModel.k(); const volScalarField& k = tk(); - const scalarField kwc = k.boundaryField()[patchI].patchInternalField(); + const scalarField kwc(k.boundaryField()[patchI].patchInternalField()); const scalarField& muw = rasModel.mu().boundaryField()[patchI]; const scalarField& rhow = rasModel.rho().boundaryField()[patchI]; @@ -228,7 +228,11 @@ void mutkWallFunctionFvPatchScalarField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField(fvPatchScalarField, mutkWallFunctionFvPatchScalarField); +makeNonTemplatedPatchTypeField +( + fvPatchScalarField, + mutkWallFunctionFvPatchScalarField +); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C index 6656a69482d50eb6c90bf4f9bfd46d6ec108ca11..70cb5e9ffef1484a58be1b761fc6a78bc7d0399d 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C @@ -216,7 +216,7 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs() const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField magGradUw = mag(Uw.snGrad()); + const scalarField magGradUw(mag(Uw.snGrad())); // Set omega and G forAll(mutw, faceI) @@ -250,7 +250,7 @@ void omegaWallFunctionFvPatchScalarField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField +makeNonTemplatedPatchTypeField ( fvPatchScalarField, omegaWallFunctionFvPatchScalarField diff --git a/src/turbulenceModels/compressible/RAS/kEpsilon/kEpsilon.C b/src/turbulenceModels/compressible/RAS/kEpsilon/kEpsilon.C index 6f26937754b7d23b6cd79f07c95d369a25f306c4..81ad0722c7dbb2db3e99a4e9f1f89f6e43fd6471 100644 --- a/src/turbulenceModels/compressible/RAS/kEpsilon/kEpsilon.C +++ b/src/turbulenceModels/compressible/RAS/kEpsilon/kEpsilon.C @@ -273,7 +273,7 @@ void kEpsilon::correct() RASModel::correct(); - volScalarField divU = fvc::div(phi_/fvc::interpolate(rho_)); + volScalarField divU(fvc::div(phi_/fvc::interpolate(rho_))); if (mesh_.moving()) { diff --git a/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.C b/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.C index c4ad4c93acd402123c5e3894018bc3f2778b9e89..fa2235478dc2ff03db4aa1025e74bc2842f98c08 100644 --- a/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.C +++ b/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.C @@ -46,13 +46,13 @@ addToRunTimeSelectionTable(RASModel, kOmegaSST, dictionary); tmp<volScalarField> kOmegaSST::F1(const volScalarField& CDkOmega) const { - volScalarField CDkOmegaPlus = max + tmp<volScalarField> CDkOmegaPlus = max ( CDkOmega, dimensionedScalar("1.0e-10", dimless/sqr(dimTime), 1.0e-10) ); - volScalarField arg1 = min + tmp<volScalarField> arg1 = min ( min ( @@ -71,7 +71,7 @@ tmp<volScalarField> kOmegaSST::F1(const volScalarField& CDkOmega) const tmp<volScalarField> kOmegaSST::F2() const { - volScalarField arg2 = min + tmp<volScalarField> arg2 = min ( max ( @@ -377,7 +377,7 @@ void kOmegaSST::correct() RASModel::correct(); - volScalarField divU = fvc::div(phi_/fvc::interpolate(rho_)); + volScalarField divU(fvc::div(phi_/fvc::interpolate(rho_))); if (mesh_.changing()) { @@ -390,19 +390,21 @@ void kOmegaSST::correct() } tmp<volTensorField> tgradU = fvc::grad(U_); - volScalarField S2 = magSqr(symm(tgradU())); - volScalarField GbyMu = (tgradU() && dev(twoSymm(tgradU()))); + volScalarField S2(magSqr(symm(tgradU()))); + volScalarField GbyMu((tgradU() && dev(twoSymm(tgradU())))); volScalarField G("RASModel::G", mut_*GbyMu); tgradU.clear(); // Update omega and G at the wall omega_.boundaryField().updateCoeffs(); - volScalarField CDkOmega = - (2*alphaOmega2_)*(fvc::grad(k_) & fvc::grad(omega_))/omega_; + volScalarField CDkOmega + ( + (2*alphaOmega2_)*(fvc::grad(k_) & fvc::grad(omega_))/omega_ + ); - volScalarField F1 = this->F1(CDkOmega); - volScalarField rhoGammaF1 = rho_*gamma(F1); + volScalarField F1(this->F1(CDkOmega)); + volScalarField rhoGammaF1(rho_*gamma(F1)); // Turbulent frequency equation tmp<fvScalarMatrix> omegaEqn diff --git a/src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.C b/src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.C index b32aa5a079e7b103eb79e152d9c543a51c78479a..d6a396aac211068a0772899d43a167e7018dec69 100644 --- a/src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.C +++ b/src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.C @@ -54,19 +54,23 @@ tmp<volScalarField> realizableKE::rCmu tmp<volSymmTensorField> tS = dev(symm(gradU)); const volSymmTensorField& S = tS(); - volScalarField W = + volScalarField W + ( (2*sqrt(2.0))*((S&S)&&S) /( magS*S2 + dimensionedScalar("small", dimensionSet(0, 0, -3, 0, 0), SMALL) - ); + ) + ); tS.clear(); - volScalarField phis = - (1.0/3.0)*acos(min(max(sqrt(6.0)*W, -scalar(1)), scalar(1))); - volScalarField As = sqrt(6.0)*cos(phis); - volScalarField Us = sqrt(S2/2.0 + magSqr(skew(gradU))); + volScalarField phis + ( + (1.0/3.0)*acos(min(max(sqrt(6.0)*W, -scalar(1)), scalar(1))) + ); + volScalarField As(sqrt(6.0)*cos(phis)); + volScalarField Us(sqrt(S2/2.0 + magSqr(skew(gradU)))); return 1.0/(A0_ + As*Us*k_/epsilon_); } @@ -77,8 +81,8 @@ tmp<volScalarField> realizableKE::rCmu const volTensorField& gradU ) { - volScalarField S2 = 2*magSqr(dev(symm(gradU))); - volScalarField magS = sqrt(S2); + volScalarField S2(2*magSqr(dev(symm(gradU)))); + volScalarField magS(sqrt(S2)); return rCmu(gradU, S2, magS); } @@ -303,19 +307,19 @@ void realizableKE::correct() RASModel::correct(); - volScalarField divU = fvc::div(phi_/fvc::interpolate(rho_)); + volScalarField divU(fvc::div(phi_/fvc::interpolate(rho_))); if (mesh_.moving()) { divU += fvc::div(mesh_.phi()); } - volTensorField gradU = fvc::grad(U_); - volScalarField S2 = 2*magSqr(dev(symm(gradU))); - volScalarField magS = sqrt(S2); + volTensorField gradU(fvc::grad(U_)); + volScalarField S2(2*magSqr(dev(symm(gradU)))); + volScalarField magS(sqrt(S2)); - volScalarField eta = magS*k_/epsilon_; - volScalarField C1 = max(eta/(scalar(5) + eta), scalar(0.43)); + volScalarField eta(magS*k_/epsilon_); + volScalarField C1(max(eta/(scalar(5) + eta), scalar(0.43))); volScalarField G("RASModel::G", mut_*(gradU && dev(twoSymm(gradU)))); diff --git a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C index 3fe205f4562f8aeb495b8c26fe7c9c57589cdc0a..954fa1de931d51784b0eb7fa2e6c137aac0882a3 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C +++ b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C @@ -31,18 +31,24 @@ License // * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * * // -template<> -const char* Foam::NamedEnum<Foam::temperatureCoupledBase::KMethodType, 4>:: -names[] = +namespace Foam { - "basicThermo", - "solidThermo", - "directionalSolidThermo", - "lookup" -}; + template<> + const char* Foam::NamedEnum + < + Foam::temperatureCoupledBase::KMethodType, + 4 + >::names[] = + { + "basicThermo", + "solidThermo", + "directionalSolidThermo", + "lookup" + }; +} -const Foam::NamedEnum<Foam::temperatureCoupledBase::KMethodType, 4> +const Foam::NamedEnum<Foam::temperatureCoupledBase::KMethodType, 4> Foam::temperatureCoupledBase::KMethodTypeNames_; @@ -111,7 +117,7 @@ Foam::tmp<Foam::scalarField> Foam::temperatureCoupledBase::K case DIRECTIONALSOLIDTHERMO: { - vectorField n = patch_.nf(); + const vectorField n(patch_.nf()); const basicSolidThermo& thermo = mesh.lookupObject<basicSolidThermo> @@ -136,7 +142,7 @@ Foam::tmp<Foam::scalarField> Foam::temperatureCoupledBase::K const symmTensorField& KWall = patch_.lookupPatchField<volSymmTensorField, scalar>(KName_); - vectorField n = patch_.nf(); + const vectorField n(patch_.nf()); return n & KWall & n; } @@ -162,7 +168,7 @@ Foam::tmp<Foam::scalarField> Foam::temperatureCoupledBase::K << "Please set 'K' to one of " << KMethodTypeNames_.toc() << " and 'KName' to the name of the volScalar" << " or volSymmTensor field (if K=lookup)" - << exit(FatalError); + << exit(FatalError); } break; } diff --git a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C index 083c59dfa8726e11fc5b908242076b1c36013f1b..3cd734d002f99306a7bbfe8d58ea8393887d9c37 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C @@ -28,27 +28,43 @@ License #include "fvPatchFieldMapper.H" #include "volFields.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + // declare specialization within 'Foam' namespace + template<> + const char* NamedEnum + < + Foam::compressible:: + turbulentHeatFluxTemperatureFvPatchScalarField::heatSourceType, + 2 + >::names[] = + { + "power", + "flux" + }; + +} + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + namespace Foam { + namespace compressible { // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -template<> -const char* -NamedEnum<turbulentHeatFluxTemperatureFvPatchScalarField::heatSourceType, 2>:: -names[] = - { - "power", - "flux" - }; - -const -NamedEnum<turbulentHeatFluxTemperatureFvPatchScalarField::heatSourceType, 2> - turbulentHeatFluxTemperatureFvPatchScalarField::heatSourceTypeNames_; +const NamedEnum +< + turbulentHeatFluxTemperatureFvPatchScalarField::heatSourceType, + 2 +> turbulentHeatFluxTemperatureFvPatchScalarField::heatSourceTypeNames_; // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -214,7 +230,7 @@ void turbulentHeatFluxTemperatureFvPatchScalarField::write // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField +makeNonTemplatedPatchTypeField ( fvPatchScalarField, turbulentHeatFluxTemperatureFvPatchScalarField diff --git a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureCoupledBaffle/turbulentTemperatureCoupledBaffleFvPatchScalarField.C b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureCoupledBaffle/turbulentTemperatureCoupledBaffleFvPatchScalarField.C index 3d6a68a0f4c1d72a3ede9d3b6b9e904453470443..89ca4c2cc7cf51e33c44558a39bb1fafc2e81d51 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureCoupledBaffle/turbulentTemperatureCoupledBaffleFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureCoupledBaffle/turbulentTemperatureCoupledBaffleFvPatchScalarField.C @@ -221,11 +221,11 @@ void Foam::turbulentTemperatureCoupledBaffleFvPatchScalarField::updateCoeffs() ); // Swap to obtain full local values of neighbour internal field - scalarField nbrIntFld = nbrField.patchInternalField(); + scalarField nbrIntFld(nbrField.patchInternalField()); distMap.distribute(nbrIntFld); // Swap to obtain full local values of neighbour K*delta - scalarField nbrKDelta = nbrField.K(nbrField)*nbrPatch.deltaCoeffs(); + scalarField nbrKDelta(nbrField.K(nbrField)*nbrPatch.deltaCoeffs()); distMap.distribute(nbrKDelta); tmp<scalarField> myKDelta = K(*this)*patch().deltaCoeffs(); @@ -289,7 +289,7 @@ void Foam::turbulentTemperatureCoupledBaffleFvPatchScalarField::write namespace Foam { -makePatchTypeField +makeNonTemplatedPatchTypeField ( fvPatchScalarField, turbulentTemperatureCoupledBaffleFvPatchScalarField diff --git a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C index dc62bfd4e6477518e04edc2502642f38e8884dd4..99991e69382578c04be7611c903ada4b978eace1 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C @@ -178,11 +178,11 @@ void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs() ); // Swap to obtain full local values of neighbour internal field - scalarField nbrIntFld = nbrField.patchInternalField(); + scalarField nbrIntFld(nbrField.patchInternalField()); distMap.distribute(nbrIntFld); // Swap to obtain full local values of neighbour K*delta - scalarField nbrKDelta = nbrField.K(nbrField)*nbrPatch.deltaCoeffs(); + scalarField nbrKDelta(nbrField.K(nbrField)*nbrPatch.deltaCoeffs()); distMap.distribute(nbrKDelta); tmp<scalarField> myKDelta = K(*this)*patch().deltaCoeffs(); @@ -247,7 +247,7 @@ void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::write // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField +makeNonTemplatedPatchTypeField ( fvPatchScalarField, turbulentTemperatureCoupledBaffleMixedFvPatchScalarField diff --git a/src/turbulenceModels/incompressible/LES/DeardorffDiffStress/DeardorffDiffStress.C b/src/turbulenceModels/incompressible/LES/DeardorffDiffStress/DeardorffDiffStress.C index b0b24389e8aadbebf4c83dbcde7e02f2b527c171..c3d726f7e51d273cc80aa26e6dd7d97a6b5f4b01 100644 --- a/src/turbulenceModels/incompressible/LES/DeardorffDiffStress/DeardorffDiffStress.C +++ b/src/turbulenceModels/incompressible/LES/DeardorffDiffStress/DeardorffDiffStress.C @@ -96,12 +96,12 @@ void DeardorffDiffStress::correct(const tmp<volTensorField>& tgradU) GenSGSStress::correct(gradU); - volSymmTensorField D = symm(gradU); + const volSymmTensorField D(symm(gradU)); - volSymmTensorField P = -twoSymm(B_ & gradU); + const volSymmTensorField P(-twoSymm(B_ & gradU)); - volScalarField K = 0.5*tr(B_); - volScalarField Epsilon = 2*nuEff()*magSqr(D); + volScalarField K(0.5*tr(B_)); + volScalarField Epsilon(2*nuEff()*magSqr(D)); tmp<fvSymmTensorMatrix> BEqn ( diff --git a/src/turbulenceModels/incompressible/LES/GenSGSStress/GenSGSStress.H b/src/turbulenceModels/incompressible/LES/GenSGSStress/GenSGSStress.H index 6db2c5d6fbd510e1311a258218a2f003a6578c1d..8f86660343cd43d10bc203e140e43032ad330a0a 100644 --- a/src/turbulenceModels/incompressible/LES/GenSGSStress/GenSGSStress.H +++ b/src/turbulenceModels/incompressible/LES/GenSGSStress/GenSGSStress.H @@ -110,7 +110,7 @@ public: //- Return the SGS turbulent dissipation. virtual tmp<volScalarField> epsilon() const { - volScalarField K = k(); + const volScalarField K(k()); return ce_*K*sqrt(K)/delta(); } diff --git a/src/turbulenceModels/incompressible/LES/LRRDiffStress/LRRDiffStress.C b/src/turbulenceModels/incompressible/LES/LRRDiffStress/LRRDiffStress.C index bc5264d68041a52fa3043d6189d04a782bec4962..c95a297120dbcc1e88abc8092e5acb7c423cf429 100644 --- a/src/turbulenceModels/incompressible/LES/LRRDiffStress/LRRDiffStress.C +++ b/src/turbulenceModels/incompressible/LES/LRRDiffStress/LRRDiffStress.C @@ -91,7 +91,7 @@ LRRDiffStress::LRRDiffStress ) ) { - volScalarField K = 0.5*tr(B_); + volScalarField K(0.5*tr(B_)); bound(K, kMin_); updateSubGridScaleFields(K); @@ -108,12 +108,12 @@ void LRRDiffStress::correct(const tmp<volTensorField>& tgradU) GenSGSStress::correct(gradU); - volSymmTensorField D = symm(gradU); + const volSymmTensorField D(symm(gradU)); - volSymmTensorField P = -twoSymm(B_ & gradU); + const volSymmTensorField P(-twoSymm(B_ & gradU)); - volScalarField K = 0.5*tr(B_); - volScalarField Epsilon = 2*nuEff()*magSqr(D); + volScalarField K(0.5*tr(B_)); + const volScalarField Epsilon(2*nuEff()*magSqr(D)); tmp<fvSymmTensorMatrix> BEqn ( diff --git a/src/turbulenceModels/incompressible/LES/Smagorinsky2/Smagorinsky2.C b/src/turbulenceModels/incompressible/LES/Smagorinsky2/Smagorinsky2.C index 5e853c054a7c723f4c8d75c735e5e7cc37609bd9..ad4f62b425a79d2eaf56a840f1f3a662502a9e95 100644 --- a/src/turbulenceModels/incompressible/LES/Smagorinsky2/Smagorinsky2.C +++ b/src/turbulenceModels/incompressible/LES/Smagorinsky2/Smagorinsky2.C @@ -75,7 +75,7 @@ Smagorinsky2::Smagorinsky2 tmp<volSymmTensorField> Smagorinsky2::B() const { - volSymmTensorField D = dev(symm(fvc::grad(U()))); + volSymmTensorField D(dev(symm(fvc::grad(U())))); return (((2.0/3.0)*I)*k() - 2.0*nuSgs_*D - (2.0*cD2_)*delta()*(D&D)); } @@ -86,7 +86,7 @@ tmp<fvVectorMatrix> Smagorinsky2::divDevBeff volVectorField& U ) const { - volTensorField gradU = fvc::grad(U); + volTensorField gradU(fvc::grad(U)); volSymmTensorField aniNuEff ( diff --git a/src/turbulenceModels/incompressible/LES/SpalartAllmaras/SpalartAllmaras.C b/src/turbulenceModels/incompressible/LES/SpalartAllmaras/SpalartAllmaras.C index ba09ee6572c6f2805bf82526f111a1830e548d20..7bd43c4eb1d2c47de1e5d0ad6a96b8dc70ea06d4 100644 --- a/src/turbulenceModels/incompressible/LES/SpalartAllmaras/SpalartAllmaras.C +++ b/src/turbulenceModels/incompressible/LES/SpalartAllmaras/SpalartAllmaras.C @@ -53,7 +53,7 @@ void SpalartAllmaras::updateSubGridScaleFields() tmp<volScalarField> SpalartAllmaras::fv1() const { - volScalarField chi3 = pow3(nuTilda_/nu()); + const volScalarField chi3(pow3(nuTilda_/nu())); return chi3/(chi3 + pow3(Cv1_)); } @@ -66,8 +66,8 @@ tmp<volScalarField> SpalartAllmaras::fv2() const tmp<volScalarField> SpalartAllmaras::fv3() const { - volScalarField chi = nuTilda_/nu(); - volScalarField chiByCv2 = (1/Cv2_)*chi; + const volScalarField chi(nuTilda_/nu()); + const volScalarField chiByCv2((1/Cv2_)*chi); return (scalar(1) + chi*fv1()) @@ -128,9 +128,8 @@ tmp<volScalarField> SpalartAllmaras::fw const volScalarField& dTilda ) const { - volScalarField r = this->r(nuTilda_, S, dTilda); - - volScalarField g = r + Cw2_*(pow6(r) - r); + const volScalarField r(this->r(nuTilda_, S, dTilda)); + const volScalarField g(r + Cw2_*(pow6(r) - r)); return g*pow((1 + pow6(Cw3_))/(pow6(g) + pow6(Cw3_)), 1.0/6.0); } @@ -291,9 +290,9 @@ void SpalartAllmaras::correct(const tmp<volTensorField>& gradU) y_.boundaryField() = max(y_.boundaryField(), VSMALL); } - const volScalarField S = this->S(gradU); - const volScalarField dTilda = this->dTilda(S); - const volScalarField STilda = this->STilda(S, dTilda); + const volScalarField S(this->S(gradU)); + const volScalarField dTilda(this->dTilda(S)); + const volScalarField STilda(this->STilda(S, dTilda)); tmp<fvScalarMatrix> nuTildaEqn ( diff --git a/src/turbulenceModels/incompressible/LES/SpalartAllmarasIDDES/SpalartAllmarasIDDES.C b/src/turbulenceModels/incompressible/LES/SpalartAllmarasIDDES/SpalartAllmarasIDDES.C index e06b1d2615a36dbb7aa6b307079844cb7f2c65d6..a15b3d064eb1c30c306512f15c9456a1c14efd4f 100644 --- a/src/turbulenceModels/incompressible/LES/SpalartAllmarasIDDES/SpalartAllmarasIDDES.C +++ b/src/turbulenceModels/incompressible/LES/SpalartAllmarasIDDES/SpalartAllmarasIDDES.C @@ -107,24 +107,27 @@ tmp<volScalarField> SpalartAllmarasIDDES::fd(const volScalarField& S) const tmp<volScalarField> SpalartAllmarasIDDES::dTilda(const volScalarField& S) const { - volScalarField alpha = this->alpha(); - volScalarField expTerm = exp(sqr(alpha)); + const volScalarField alpha(this->alpha()); + const volScalarField expTerm(exp(sqr(alpha))); - volScalarField fHill = + tmp<volScalarField> fHill = 2*(pos(alpha)*pow(expTerm, -11.09) + neg(alpha)*pow(expTerm, -9.0)); - volScalarField fStep = min(2*pow(expTerm, -9.0), scalar(1)); - volScalarField fHyb = max(1 - fd(S), fStep); - volScalarField fAmp = 1 - max(ft(S), fl(S)); - volScalarField fRestore = max(fHill - 1, scalar(0))*fAmp; + tmp<volScalarField> fStep = min(2*pow(expTerm, -9.0), scalar(1)); + const volScalarField fHyb(max(1 - fd(S), fStep)); + tmp<volScalarField> fAmp = 1 - max(ft(S), fl(S)); + tmp<volScalarField> fRestore = max(fHill - 1, scalar(0))*fAmp; // IGNORING ft2 terms - volScalarField Psi = sqrt + const volScalarField Psi ( - min + sqrt ( - scalar(100), - (1 - Cb1_/(Cw1_*sqr(kappa_)*fwStar_)*fv2())/max(SMALL, fv1()) + min + ( + scalar(100), + (1 - Cb1_/(Cw1_*sqr(kappa_)*fwStar_)*fv2())/max(SMALL, fv1()) + ) ) ); diff --git a/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsUSpaldingWallFunction/nuSgsUSpaldingWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsUSpaldingWallFunction/nuSgsUSpaldingWallFunctionFvPatchScalarField.C index d108232304f7f8da53e72a0088be9763d5930ff0..4ed165edc87ae1100c1bac998ccc475a7cc6ab90 100644 --- a/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsUSpaldingWallFunction/nuSgsUSpaldingWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsUSpaldingWallFunction/nuSgsUSpaldingWallFunctionFvPatchScalarField.C @@ -128,14 +128,14 @@ void nuSgsUSpaldingWallFunctionFvPatchScalarField::evaluate const fvPatchVectorField& U = patch().lookupPatchField<volVectorField, vector>(UName_); - scalarField magUp = mag(U.patchInternalField() - U); + const scalarField magUp(mag(U.patchInternalField() - U)); const scalarField& nuw = patch().lookupPatchField<volScalarField, scalar>(nuName_); scalarField& nuSgsw = *this; - scalarField magFaceGradU = mag(U.snGrad()); + const scalarField magFaceGradU(mag(U.snGrad())); forAll(nuSgsw, facei) { @@ -195,7 +195,7 @@ void nuSgsUSpaldingWallFunctionFvPatchScalarField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField +makeNonTemplatedPatchTypeField ( fvPatchScalarField, nuSgsUSpaldingWallFunctionFvPatchScalarField diff --git a/src/turbulenceModels/incompressible/LES/dynLagrangian/dynLagrangian.C b/src/turbulenceModels/incompressible/LES/dynLagrangian/dynLagrangian.C index 7b69178230aa4ce208696674c90043a1e3325f70..f75df11c8c9811db9735140cd64dcdfd869c7aae 100644 --- a/src/turbulenceModels/incompressible/LES/dynLagrangian/dynLagrangian.C +++ b/src/turbulenceModels/incompressible/LES/dynLagrangian/dynLagrangian.C @@ -118,24 +118,26 @@ void dynLagrangian::correct(const tmp<volTensorField>& gradU) { LESModel::correct(gradU); - volSymmTensorField S = dev(symm(gradU())); + volSymmTensorField S(dev(symm(gradU()))); - volScalarField magS = mag(S); + volScalarField magS(mag(S)); - volVectorField Uf = filter_(U()); + volVectorField Uf(filter_(U())); - volSymmTensorField Sf = dev(symm(fvc::grad(Uf))); + volSymmTensorField Sf(dev(symm(fvc::grad(Uf)))); - volScalarField magSf = mag(Sf); + volScalarField magSf(mag(Sf)); - volSymmTensorField L = dev(filter_(sqr(U())) - (sqr(filter_(U())))); + volSymmTensorField L(dev(filter_(sqr(U())) - (sqr(filter_(U()))))); - volSymmTensorField M = 2.0*sqr(delta())*(filter_(magS*S) - 4.0*magSf*Sf); + volSymmTensorField M(2.0*sqr(delta())*(filter_(magS*S) - 4.0*magSf*Sf)); - volScalarField invT = - (1.0/(theta_.value()*delta()))*pow(flm_*fmm_, 1.0/8.0); + volScalarField invT + ( + (1.0/(theta_.value()*delta()))*pow(flm_*fmm_, 1.0/8.0) + ); - volScalarField LM = L && M; + volScalarField LM(L && M); fvScalarMatrix flmEqn ( @@ -151,7 +153,7 @@ void dynLagrangian::correct(const tmp<volTensorField>& gradU) bound(flm_, flm0_); - volScalarField MM = M && M; + volScalarField MM(M && M); fvScalarMatrix fmmEqn ( diff --git a/src/turbulenceModels/incompressible/LES/dynOneEqEddy/dynOneEqEddy.C b/src/turbulenceModels/incompressible/LES/dynOneEqEddy/dynOneEqEddy.C index 179326d835cccbb3c364bfa58e30f8a97fcbe76f..f408e50fe3ecc80bb48704302faa86e6a2cba08e 100644 --- a/src/turbulenceModels/incompressible/LES/dynOneEqEddy/dynOneEqEddy.C +++ b/src/turbulenceModels/incompressible/LES/dynOneEqEddy/dynOneEqEddy.C @@ -51,17 +51,19 @@ void dynOneEqEddy::updateSubGridScaleFields(const volSymmTensorField& D) dimensionedScalar dynOneEqEddy::ck(const volSymmTensorField& D) const { - volScalarField KK = 0.5*(filter_(magSqr(U())) - magSqr(filter_(U()))); + tmp<volScalarField> KK = 0.5*(filter_(magSqr(U())) - magSqr(filter_(U()))); - volSymmTensorField LL = dev(filter_(sqr(U())) - sqr(filter_(U()))); - - volSymmTensorField MM = - delta()*(filter_(sqrt(k_)*D) - 2*sqrt(KK + filter_(k_))*filter_(D)); + const volSymmTensorField MM + ( + delta()*(filter_(sqrt(k_)*D) - 2*sqrt(KK + filter_(k_))*filter_(D)) + ); dimensionedScalar MMMM = average(magSqr(MM)); if (MMMM.value() > VSMALL) { + tmp<volSymmTensorField> LL = dev(filter_(sqr(U())) - sqr(filter_(U()))); + return average(LL && MM)/MMMM; } else @@ -73,22 +75,29 @@ dimensionedScalar dynOneEqEddy::ck(const volSymmTensorField& D) const dimensionedScalar dynOneEqEddy::ce(const volSymmTensorField& D) const { - volScalarField KK = 0.5*(filter_(magSqr(U())) - magSqr(filter_(U()))); - - volScalarField mm = - pow(KK + filter_(k_), 1.5)/(2*delta()) - filter_(pow(k_, 1.5))/delta(); + const volScalarField KK + ( + 0.5*(filter_(magSqr(U())) - magSqr(filter_(U()))) + ); - volScalarField ee = - 2*delta()*ck(D) - *( - filter_(sqrt(k_)*magSqr(D)) - - 2*sqrt(KK + filter_(k_))*magSqr(filter_(D)) - ); + const volScalarField mm + ( + pow(KK + filter_(k_), 1.5)/(2*delta()) - filter_(pow(k_, 1.5))/delta() + ); dimensionedScalar mmmm = average(magSqr(mm)); if (mmmm.value() > VSMALL) { + tmp<volScalarField> ee = + ( + 2*delta()*ck(D) + * ( + filter_(sqrt(k_)*magSqr(D)) + - 2*sqrt(KK + filter_(k_))*magSqr(filter_(D)) + ) + ); + return average(ee*mm)/mmmm; } else @@ -144,9 +153,9 @@ void dynOneEqEddy::correct(const tmp<volTensorField>& tgradU) GenEddyVisc::correct(gradU); - volSymmTensorField D = symm(gradU); + const volSymmTensorField D(symm(gradU)); - volScalarField P = 2.0*nuSgs_*magSqr(D); + const volScalarField P(2.0*nuSgs_*magSqr(D)); tmp<fvScalarMatrix> kEqn ( diff --git a/src/turbulenceModels/incompressible/LES/dynSmagorinsky/dynSmagorinsky.C b/src/turbulenceModels/incompressible/LES/dynSmagorinsky/dynSmagorinsky.C index 796d0110764e84bcaeebff7369263aecd2d255f3..90d7fe1e7753a262bd9948562a1f0a3458674943 100644 --- a/src/turbulenceModels/incompressible/LES/dynSmagorinsky/dynSmagorinsky.C +++ b/src/turbulenceModels/incompressible/LES/dynSmagorinsky/dynSmagorinsky.C @@ -51,15 +51,18 @@ void dynSmagorinsky::updateSubGridScaleFields(const volSymmTensorField& D) dimensionedScalar dynSmagorinsky::cD(const volSymmTensorField& D) const { - volSymmTensorField LL = dev(filter_(sqr(U())) - (sqr(filter_(U())))); - - volSymmTensorField MM = - sqr(delta())*(filter_(mag(D)*(D)) - 4*mag(filter_(D))*filter_(D)); + const volSymmTensorField MM + ( + sqr(delta())*(filter_(mag(D)*(D)) - 4*mag(filter_(D))*filter_(D)) + ); dimensionedScalar MMMM = average(magSqr(MM)); if (MMMM.value() > VSMALL) { + tmp<volSymmTensorField> LL = + dev(filter_(sqr(U())) - (sqr(filter_(U())))); + return average(LL && MM)/MMMM; } else @@ -71,15 +74,18 @@ dimensionedScalar dynSmagorinsky::cD(const volSymmTensorField& D) const dimensionedScalar dynSmagorinsky::cI(const volSymmTensorField& D) const { - volScalarField KK = 0.5*(filter_(magSqr(U())) - magSqr(filter_(U()))); - - volScalarField mm = - sqr(delta())*(4*sqr(mag(filter_(D))) - filter_(sqr(mag(D)))); + const volScalarField mm + ( + sqr(delta())*(4*sqr(mag(filter_(D))) - filter_(sqr(mag(D)))) + ); dimensionedScalar mmmm = average(magSqr(mm)); if (mmmm.value() > VSMALL) { + tmp<volScalarField> KK = + 0.5*(filter_(magSqr(U())) - magSqr(filter_(U()))); + return average(KK*mm)/mmmm; } else @@ -133,7 +139,7 @@ void dynSmagorinsky::correct(const tmp<volTensorField>& gradU) { LESModel::correct(gradU); - volSymmTensorField D = dev(symm(gradU)); + const volSymmTensorField D(dev(symm(gradU))); k_ = cI(D)*sqr(delta())*magSqr(D); bound(k_, kMin_); diff --git a/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.C b/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.C index 3a1c1eb75a55f63f60cd23ed856275a889408331..c94f2f1bad0e0907182a015749f6587e299f8907 100644 --- a/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.C +++ b/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.C @@ -52,13 +52,13 @@ void kOmegaSSTSAS::updateSubGridScaleFields(const volScalarField& S2) tmp<volScalarField> kOmegaSSTSAS::F1(const volScalarField& CDkOmega) const { - volScalarField CDkOmegaPlus = max + tmp<volScalarField> CDkOmegaPlus = max ( CDkOmega, dimensionedScalar("1.0e-10", dimless/sqr(dimTime), 1.0e-10) ); - volScalarField arg1 = min + tmp<volScalarField> arg1 = min ( min ( @@ -78,7 +78,7 @@ tmp<volScalarField> kOmegaSSTSAS::F1(const volScalarField& CDkOmega) const tmp<volScalarField> kOmegaSSTSAS::F2() const { - volScalarField arg2 = min + tmp<volScalarField> arg2 = min ( max ( @@ -345,15 +345,15 @@ void kOmegaSSTSAS::correct(const tmp<volTensorField>& gradU) y_.correct(); } - volScalarField S2 = magSqr(2.0*symm(gradU())); + volScalarField S2(magSqr(2.0*symm(gradU()))); gradU.clear(); - volVectorField gradK = fvc::grad(k_); - volVectorField gradOmega = fvc::grad(omega_); - volScalarField L = sqrt(k_)/(pow025(Cmu_)*omega_); - volScalarField CDkOmega = (2.0*alphaOmega2_)*(gradK & gradOmega)/omega_; - volScalarField F1 = this->F1(CDkOmega); - volScalarField G = nuSgs_*0.5*S2; + volVectorField gradK(fvc::grad(k_)); + volVectorField gradOmega(fvc::grad(omega_)); + volScalarField L(sqrt(k_)/(pow025(Cmu_)*omega_)); + volScalarField CDkOmega((2.0*alphaOmega2_)*(gradK & gradOmega)/omega_); + volScalarField F1(this->F1(CDkOmega)); + volScalarField G(nuSgs_*0.5*S2); // Turbulent kinetic energy equation { @@ -373,7 +373,7 @@ void kOmegaSSTSAS::correct(const tmp<volTensorField>& gradU) } bound(k_, kMin_); - volScalarField grad_omega_k = max + tmp<volScalarField> grad_omega_k = max ( magSqr(gradOmega)/sqr(omega_), magSqr(gradK)/sqr(k_) diff --git a/src/turbulenceModels/incompressible/LES/laminar/laminar.C b/src/turbulenceModels/incompressible/LES/laminar/laminar.C index 767dfeae22575e64f400112d729ea32e898eba70..d654fddc712f31166ec46eb63415c98b0ebf6cde 100644 --- a/src/turbulenceModels/incompressible/LES/laminar/laminar.C +++ b/src/turbulenceModels/incompressible/LES/laminar/laminar.C @@ -98,7 +98,7 @@ tmp<volScalarField> laminar::nuSgs() const IOobject::NO_WRITE ), mesh_, - dimensionedScalar("nuSgs", nu().dimensions(), 0.0) + dimensionedScalar("nuSgs", nu()().dimensions(), 0.0) ) ); } diff --git a/src/turbulenceModels/incompressible/LES/locDynOneEqEddy/locDynOneEqEddy.C b/src/turbulenceModels/incompressible/LES/locDynOneEqEddy/locDynOneEqEddy.C index 3eae38e2aba8a018a14e146c3ad0f9750c746581..6a85b1a3ee1bf80a73f78f0a914cae772bfb75a9 100644 --- a/src/turbulenceModels/incompressible/LES/locDynOneEqEddy/locDynOneEqEddy.C +++ b/src/turbulenceModels/incompressible/LES/locDynOneEqEddy/locDynOneEqEddy.C @@ -59,19 +59,27 @@ volScalarField locDynOneEqEddy::ck const volScalarField& KK ) const { - volSymmTensorField LL = - simpleFilter_(dev(filter_(sqr(U())) - (sqr(filter_(U()))))); + const volSymmTensorField LL + ( + simpleFilter_(dev(filter_(sqr(U())) - (sqr(filter_(U()))))) + ); - volSymmTensorField MM = simpleFilter_(-2.0*delta()*pow(KK, 0.5)*filter_(D)); + const volSymmTensorField MM + ( + simpleFilter_(-2.0*delta()*pow(KK, 0.5)*filter_(D)) + ); - volScalarField ck = + const volScalarField ck + ( simpleFilter_(0.5*(LL && MM)) /( simpleFilter_(magSqr(MM)) + dimensionedScalar("small", sqr(MM.dimensions()), VSMALL) - ); + ) + ); - return 0.5*(mag(ck) + ck); + tmp<volScalarField> tfld = 0.5*(mag(ck) + ck); + return tfld(); } @@ -81,11 +89,14 @@ volScalarField locDynOneEqEddy::ce const volScalarField& KK ) const { - volScalarField ce = + const volScalarField ce + ( simpleFilter_(nuEff()*(filter_(magSqr(D)) - magSqr(filter_(D)))) - /simpleFilter_(pow(KK, 1.5)/(2.0*delta())); + /simpleFilter_(pow(KK, 1.5)/(2.0*delta())) + ); - return 0.5*(mag(ce) + ce); + tmp<volScalarField> tfld = 0.5*(mag(ce) + ce); + return tfld(); } @@ -122,7 +133,7 @@ locDynOneEqEddy::locDynOneEqEddy { bound(k_, kMin_); - volScalarField KK = 0.5*(filter_(magSqr(U)) - magSqr(filter_(U))); + const volScalarField KK(0.5*(filter_(magSqr(U)) - magSqr(filter_(U)))); updateSubGridScaleFields(symm(fvc::grad(U)), KK); printCoeffs(); @@ -135,12 +146,12 @@ void locDynOneEqEddy::correct(const tmp<volTensorField>& gradU) { LESModel::correct(gradU); - volSymmTensorField D = symm(gradU); + const volSymmTensorField D(symm(gradU)); - volScalarField KK = 0.5*(filter_(magSqr(U())) - magSqr(filter_(U()))); + volScalarField KK(0.5*(filter_(magSqr(U())) - magSqr(filter_(U())))); KK.max(dimensionedScalar("small", KK.dimensions(), SMALL)); - volScalarField P = 2.0*nuSgs_*magSqr(D); + const volScalarField P(2.0*nuSgs_*magSqr(D)); tmp<fvScalarMatrix> kEqn ( diff --git a/src/turbulenceModels/incompressible/LES/oneEqEddy/oneEqEddy.C b/src/turbulenceModels/incompressible/LES/oneEqEddy/oneEqEddy.C index c18c505a9b93b842c89509c180178842e25ee68a..8696419da6b1077043f3d0f3a1d9cb610f750e81 100644 --- a/src/turbulenceModels/incompressible/LES/oneEqEddy/oneEqEddy.C +++ b/src/turbulenceModels/incompressible/LES/oneEqEddy/oneEqEddy.C @@ -101,7 +101,7 @@ void oneEqEddy::correct(const tmp<volTensorField>& gradU) { GenEddyVisc::correct(gradU); - volScalarField G = 2.0*nuSgs_*magSqr(symm(gradU)); + tmp<volScalarField> G = 2.0*nuSgs_*magSqr(symm(gradU)); tmp<fvScalarMatrix> kEqn ( diff --git a/src/turbulenceModels/incompressible/LES/scaleSimilarity/scaleSimilarity.C b/src/turbulenceModels/incompressible/LES/scaleSimilarity/scaleSimilarity.C index d23b71b30cff4b50568afa75d7856e0f3e4ea7c2..f172af5165498a2477d1427aa0fd0bf91e152d83 100644 --- a/src/turbulenceModels/incompressible/LES/scaleSimilarity/scaleSimilarity.C +++ b/src/turbulenceModels/incompressible/LES/scaleSimilarity/scaleSimilarity.C @@ -67,7 +67,7 @@ tmp<volScalarField> scaleSimilarity::k() const tmp<volScalarField> scaleSimilarity::epsilon() const { - volSymmTensorField D = symm(fvc::grad(U())); + tmp<volSymmTensorField> D = symm(fvc::grad(U())); return((filter_(sqr(U())) - sqr(filter_(U()))) && D); } diff --git a/src/turbulenceModels/incompressible/LES/spectEddyVisc/spectEddyVisc.C b/src/turbulenceModels/incompressible/LES/spectEddyVisc/spectEddyVisc.C index 3c5015acb3a23d9df22e04f30bf5f3d5196f7f93..d28664f4ac0653f32f9b2e9f25ee1dc983904060 100644 --- a/src/turbulenceModels/incompressible/LES/spectEddyVisc/spectEddyVisc.C +++ b/src/turbulenceModels/incompressible/LES/spectEddyVisc/spectEddyVisc.C @@ -44,7 +44,7 @@ addToRunTimeSelectionTable(LESModel, spectEddyVisc, dictionary); void spectEddyVisc::updateSubGridScaleFields(const volTensorField& gradU) { - volScalarField Re = sqr(delta())*mag(symm(gradU))/nu(); + const volScalarField Re(sqr(delta())*mag(symm(gradU))/nu()); for (label i=0; i<5; i++) { nuSgs_ = @@ -129,7 +129,7 @@ spectEddyVisc::spectEddyVisc tmp<volScalarField> spectEddyVisc::k() const { - volScalarField eps = 2*nuEff()*magSqr(symm(fvc::grad(U()))); + const volScalarField eps(2*nuEff()*magSqr(symm(fvc::grad(U())))); return cK1_*pow(delta()*eps, 2.0/3.0) diff --git a/src/turbulenceModels/incompressible/LES/vanDriestDelta/vanDriestDelta.C b/src/turbulenceModels/incompressible/LES/vanDriestDelta/vanDriestDelta.C index f6c77ad9838fd71929b691d2f3beb4fed7c7b41b..d27b71cbbd2300287fed14b5149d95cc95fb4d5e 100644 --- a/src/turbulenceModels/incompressible/LES/vanDriestDelta/vanDriestDelta.C +++ b/src/turbulenceModels/incompressible/LES/vanDriestDelta/vanDriestDelta.C @@ -51,7 +51,8 @@ void vanDriestDelta::calcDelta() const LESModel& lesModel = mesh_.lookupObject<LESModel>("LESProperties"); const volVectorField& U = lesModel.U(); - const volScalarField& nu = lesModel.nu(); + const tmp<volScalarField> tnu = lesModel.nu(); + const volScalarField& nu = tnu(); tmp<volScalarField> nuSgs = lesModel.nuSgs(); volScalarField ystar diff --git a/src/turbulenceModels/incompressible/RAS/LRR/LRR.C b/src/turbulenceModels/incompressible/RAS/LRR/LRR.C index 3950df0e8cd6ee156720aa6c3d932b3accb534ad..0a834017dce4fe18e9dc418af85fdb87db07d984 100644 --- a/src/turbulenceModels/incompressible/RAS/LRR/LRR.C +++ b/src/turbulenceModels/incompressible/RAS/LRR/LRR.C @@ -300,7 +300,7 @@ void LRR::correct() return; } - volSymmTensorField P = -twoSymm(R_ & fvc::grad(U_)); + volSymmTensorField P(-twoSymm(R_ & fvc::grad(U_))); volScalarField G("RASModel::G", 0.5*mag(tr(P))); // Update epsilon and G at the wall @@ -403,7 +403,7 @@ void LRR::correct() const scalarField& nutw = nut_.boundaryField()[patchi]; - vectorField snGradU = U_.boundaryField()[patchi].snGrad(); + const vectorField snGradU(U_.boundaryField()[patchi].snGrad()); const vectorField& faceAreas = mesh_.Sf().boundaryField()[patchi]; diff --git a/src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.C b/src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.C index c60df67eeec3b04fd2fccb0cd828d464f471c1ab..06d84a25922eaa8c86ee659aafd258d6fd7e1df8 100644 --- a/src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.C +++ b/src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.C @@ -242,12 +242,12 @@ void LamBremhorstKE::correct() // Calculate parameters and coefficients for low-Reynolds number model Rt_ = sqr(k_)/(nu()*epsilon_); - volScalarField Ry = sqrt(k_)*y_/nu(); + tmp<volScalarField> Ry = sqrt(k_)*y_/nu(); fMu_ = sqr(scalar(1) - exp(-0.0165*Ry))*(scalar(1) + 20.5/(Rt_ + SMALL)); - volScalarField f1 = scalar(1) + pow(0.05/(fMu_ + SMALL), 3); - volScalarField f2 = scalar(1) - exp(-sqr(Rt_)); + tmp<volScalarField> f1 = scalar(1) + pow(0.05/(fMu_ + SMALL), 3); + tmp<volScalarField> f2 = scalar(1) - exp(-sqr(Rt_)); // Dissipation equation diff --git a/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C b/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C index a72babb1a09f9974150595bd86d70d14e438e051..3095d76a3f0e154b055d55ff69d8dfbf9a60d261 100644 --- a/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C +++ b/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C @@ -342,7 +342,7 @@ void LaunderGibsonRSTM::correct() yr_.correct(); } - volSymmTensorField P = -twoSymm(R_ & fvc::grad(U_)); + volSymmTensorField P(-twoSymm(R_ & fvc::grad(U_))); volScalarField G("RASModel::G", 0.5*mag(tr(P))); // Update epsilon and G at the wall @@ -388,7 +388,10 @@ void LaunderGibsonRSTM::correct() } } - volSymmTensorField reflect = C1Ref_*epsilon_/k_*R_ - C2Ref_*Clg2_*dev(P); + const volSymmTensorField reflect + ( + C1Ref_*epsilon_/k_*R_ - C2Ref_*Clg2_*dev(P) + ); tmp<fvSymmTensorMatrix> REqn ( @@ -451,7 +454,7 @@ void LaunderGibsonRSTM::correct() const scalarField& nutw = nut_.boundaryField()[patchi]; - vectorField snGradU = U_.boundaryField()[patchi].snGrad(); + const vectorField snGradU(U_.boundaryField()[patchi].snGrad()); const vectorField& faceAreas = mesh_.Sf().boundaryField()[patchi]; diff --git a/src/turbulenceModels/incompressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C b/src/turbulenceModels/incompressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C index 3d92720c3cc8920338f2a2776875d51f9aaa3d6d..504e54abae7126b066312581a974140088aa1650 100644 --- a/src/turbulenceModels/incompressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C +++ b/src/turbulenceModels/incompressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C @@ -237,12 +237,12 @@ void LaunderSharmaKE::correct() return; } - volScalarField S2 = 2*magSqr(symm(fvc::grad(U_))); + tmp<volScalarField> S2 = 2*magSqr(symm(fvc::grad(U_))); volScalarField G("RASModel::G", nut_*S2); - volScalarField E = 2.0*nu()*nut_*fvc::magSqrGradGrad(U_); - volScalarField D = 2.0*nu()*magSqr(fvc::grad(sqrt(k_))); + const volScalarField E(2.0*nu()*nut_*fvc::magSqrGradGrad(U_)); + const volScalarField D(2.0*nu()*magSqr(fvc::grad(sqrt(k_)))); // Dissipation rate equation diff --git a/src/turbulenceModels/incompressible/RAS/LienCubicKE/LienCubicKE.C b/src/turbulenceModels/incompressible/RAS/LienCubicKE/LienCubicKE.C index c7ad938fe272046d63c96d12d3c92a66e3f083c4..82b4b31fd9d88f99e445ae5108ad83b22daa890e 100644 --- a/src/turbulenceModels/incompressible/RAS/LienCubicKE/LienCubicKE.C +++ b/src/turbulenceModels/incompressible/RAS/LienCubicKE/LienCubicKE.C @@ -335,7 +335,7 @@ void LienCubicKE::correct() gradU_ = fvc::grad(U_); // generation term - volScalarField S2 = symm(gradU_) && gradU_; + tmp<volScalarField> S2 = symm(gradU_) && gradU_; volScalarField G ( diff --git a/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.C b/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.C index c81f604388f47b2e0a9bcfe4a51a21f0181ac294..6b696c7c4a1896069ce2cef37bc1cf1a2ab58e98 100644 --- a/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.C +++ b/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.C @@ -409,19 +409,25 @@ void LienCubicKELowRe::correct() gradU_ = fvc::grad(U_); // generation term - volScalarField S2 = symm(gradU_) && gradU_; + tmp<volScalarField> S2 = symm(gradU_) && gradU_; yStar_ = sqrt(k_)*y_/nu() + SMALL; - volScalarField Rt = sqr(k_)/(nu()*epsilon_); + tmp<volScalarField> Rt = sqr(k_)/(nu()*epsilon_); - volScalarField fMu = + const volScalarField fMu + ( (scalar(1) - exp(-Am_*yStar_)) - /(scalar(1) - exp(-Aepsilon_*yStar_) + SMALL); - - volScalarField f2 = scalar(1) - 0.3*exp(-sqr(Rt)); + /(scalar(1) - exp(-Aepsilon_*yStar_) + SMALL) + ); + const volScalarField f2 + ( + scalar(1) - 0.3*exp(-sqr(Rt)) + ); - volScalarField G = - Cmu_*fMu*sqr(k_)/epsilon_*S2 - (nonlinearStress_ && gradU_); + volScalarField G + ( + Cmu_*fMu*sqr(k_)/epsilon_*S2 - (nonlinearStress_ && gradU_) + ); // Dissipation equation tmp<fvScalarMatrix> epsEqn diff --git a/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.C b/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.C index b12f4774c0abdec0eb2db8048cac1e4f887a12fd..33df77c3771aa778643baed5a210384e2b8a798d 100644 --- a/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.C +++ b/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.C @@ -197,7 +197,7 @@ LienLeschzinerLowRe::LienLeschzinerLowRe tmp<volSymmTensorField> LienLeschzinerLowRe::R() const { - volTensorField gradU = fvc::grad(U_); + tmp<volTensorField> gradU = fvc::grad(U_); return tmp<volSymmTensorField> ( @@ -288,19 +288,21 @@ void LienLeschzinerLowRe::correct() scalar Cmu75 = pow(Cmu_.value(), 0.75); - volTensorField gradU = fvc::grad(U_); + const volTensorField gradU(fvc::grad(U_)); // generation term - volScalarField S2 = symm(gradU) && gradU; + tmp<volScalarField> S2 = symm(gradU) && gradU; yStar_ = sqrt(k_)*y_/nu() + SMALL; - volScalarField Rt = sqr(k_)/(nu()*epsilon_); + tmp<volScalarField> Rt = sqr(k_)/(nu()*epsilon_); - volScalarField fMu = + volScalarField fMu + ( (scalar(1) - exp(-Am_*yStar_)) - /(scalar(1) - exp(-Aepsilon_*yStar_) + SMALL); + /(scalar(1) - exp(-Aepsilon_*yStar_) + SMALL) + ); - volScalarField f2 = scalar(1) - 0.3*exp(-sqr(Rt)); + const volScalarField f2(scalar(1) - 0.3*exp(-sqr(Rt))); volScalarField G("RASModel::G", Cmu_*fMu*sqr(k_)/epsilon_*S2); diff --git a/src/turbulenceModels/incompressible/RAS/NonlinearKEShih/NonlinearKEShih.C b/src/turbulenceModels/incompressible/RAS/NonlinearKEShih/NonlinearKEShih.C index 318791559f553b08ce8ff472e79a92790c60a311..7732ebb0db23914920398b1b460e68571cdd0940 100644 --- a/src/turbulenceModels/incompressible/RAS/NonlinearKEShih/NonlinearKEShih.C +++ b/src/turbulenceModels/incompressible/RAS/NonlinearKEShih/NonlinearKEShih.C @@ -237,8 +237,6 @@ NonlinearKEShih::NonlinearKEShih tmp<volSymmTensorField> NonlinearKEShih::R() const { - volTensorField gradU_ = fvc::grad(U_); - return tmp<volSymmTensorField> ( new volSymmTensorField @@ -251,7 +249,7 @@ tmp<volSymmTensorField> NonlinearKEShih::R() const IOobject::NO_READ, IOobject::NO_WRITE ), - ((2.0/3.0)*I)*k_ - nut_*twoSymm(gradU_) + nonlinearStress_, + ((2.0/3.0)*I)*k_ - nut_*twoSymm(fvc::grad(U_)) + nonlinearStress_, k_.boundaryField().types() ) ); @@ -328,7 +326,7 @@ void NonlinearKEShih::correct() gradU_ = fvc::grad(U_); // generation term - volScalarField S2 = symm(gradU_) && gradU_; + tmp<volScalarField> S2 = symm(gradU_) && gradU_; volScalarField G ( diff --git a/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.C b/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.C index 2b93114c49f7e9939ea5454dc70eea3bf46b54e2..556fbcc48188084ea0314bf229f5f81a1af53779 100644 --- a/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.C +++ b/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.C @@ -182,7 +182,7 @@ tmp<scalarField> RASModel::yPlus(const label patchNo, const scalar Cmu) const Yp = pow025(Cmu) *y_[patchNo] *sqrt(k()().boundaryField()[patchNo].patchInternalField()) - /nu().boundaryField()[patchNo]; + /nu()().boundaryField()[patchNo]; } else { diff --git a/src/turbulenceModels/incompressible/RAS/RNGkEpsilon/RNGkEpsilon.C b/src/turbulenceModels/incompressible/RAS/RNGkEpsilon/RNGkEpsilon.C index 9d9f8f009395d38f9d5317831f750ac07379d8d2..1c39d36c71f5bc39adaacd18448cff3cee0aff1a 100644 --- a/src/turbulenceModels/incompressible/RAS/RNGkEpsilon/RNGkEpsilon.C +++ b/src/turbulenceModels/incompressible/RAS/RNGkEpsilon/RNGkEpsilon.C @@ -250,13 +250,14 @@ void RNGkEpsilon::correct() return; } - volScalarField S2 = 2*magSqr(symm(fvc::grad(U_))); - + const volScalarField S2(2*magSqr(symm(fvc::grad(U_)))); volScalarField G("RASModel::G", nut_*S2); - volScalarField eta = sqrt(S2)*k_/epsilon_; - volScalarField R = - ((eta*(scalar(1) - eta/eta0_))/(scalar(1) + beta_*eta*sqr(eta))); + const volScalarField eta(sqrt(S2)*k_/epsilon_); + volScalarField R + ( + ((eta*(scalar(1) - eta/eta0_))/(scalar(1) + beta_*eta*sqr(eta))) + ); // Update epsilon and G at the wall epsilon_.boundaryField().updateCoeffs(); diff --git a/src/turbulenceModels/incompressible/RAS/SpalartAllmaras/SpalartAllmaras.C b/src/turbulenceModels/incompressible/RAS/SpalartAllmaras/SpalartAllmaras.C index 02eeaa318f5cb2b7b4db8508c82b4caf70c7da8d..b830558334da663fc6e81fb9f6fdeb33e29ddd69 100644 --- a/src/turbulenceModels/incompressible/RAS/SpalartAllmaras/SpalartAllmaras.C +++ b/src/turbulenceModels/incompressible/RAS/SpalartAllmaras/SpalartAllmaras.C @@ -50,7 +50,7 @@ tmp<volScalarField> SpalartAllmaras::chi() const tmp<volScalarField> SpalartAllmaras::fv1(const volScalarField& chi) const { - volScalarField chi3 = pow3(chi); + const volScalarField chi3(pow3(chi)); return chi3/(chi3 + pow3(Cv1_)); } @@ -71,7 +71,7 @@ tmp<volScalarField> SpalartAllmaras::fv3 const volScalarField& fv1 ) const { - volScalarField chiByCv2 = (1/Cv2_)*chi; + const volScalarField chiByCv2((1/Cv2_)*chi); return (scalar(1) + chi*fv1) @@ -83,18 +83,25 @@ tmp<volScalarField> SpalartAllmaras::fv3 tmp<volScalarField> SpalartAllmaras::fw(const volScalarField& Stilda) const { - volScalarField r = min + volScalarField r ( - nuTilda_ - /( - max(Stilda, dimensionedScalar("SMALL", Stilda.dimensions(), SMALL)) - *sqr(kappa_*d_) - ), - scalar(10.0) + min + ( + nuTilda_ + /( + max + ( + Stilda, + dimensionedScalar("SMALL", Stilda.dimensions(), SMALL) + ) + *sqr(kappa_*d_) + ), + scalar(10.0) + ) ); r.boundaryField() == 0.0; - volScalarField g = r + Cw2_*(pow6(r) - r); + const volScalarField g(r + Cw2_*(pow6(r) - r)); return g*pow((1.0 + pow6(Cw3_))/(pow6(g) + pow6(Cw3_)), 1.0/6.0); } @@ -320,7 +327,7 @@ tmp<volSymmTensorField> SpalartAllmaras::devReff() const tmp<fvVectorMatrix> SpalartAllmaras::divDevReff(volVectorField& U) const { - volScalarField nuEff_ = nuEff(); + const volScalarField nuEff_(nuEff()); return ( @@ -368,12 +375,14 @@ void SpalartAllmaras::correct() d_.correct(); } - volScalarField chi = this->chi(); - volScalarField fv1 = this->fv1(chi); + const volScalarField chi(this->chi()); + const volScalarField fv1(this->fv1(chi)); - volScalarField Stilda = + const volScalarField Stilda + ( fv3(chi, fv1)*::sqrt(2.0)*mag(skew(fvc::grad(U_))) - + fv2(chi, fv1)*nuTilda_/sqr(kappa_*d_); + + fv2(chi, fv1)*nuTilda_/sqr(kappa_*d_) + ); tmp<fvScalarMatrix> nuTildaEqn ( diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C index 18a3bb091589f63aee6f778457ae72a9d1af6fa0..2a1e75d2e7893480e5adf8964af47a73d0d05be5 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C @@ -130,7 +130,7 @@ atmBoundaryLayerInletEpsilonFvPatchScalarField void atmBoundaryLayerInletEpsilonFvPatchScalarField::updateCoeffs() { const vectorField& c = patch().Cf(); - scalarField coord = (c & z_); + tmp<scalarField> coord = (c & z_); scalarField::operator=(pow3(Ustar_)/(kappa_*(coord - zGround_ + z0_))); } @@ -154,7 +154,7 @@ void atmBoundaryLayerInletEpsilonFvPatchScalarField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField +makeNonTemplatedPatchTypeField ( fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C index cdbf4bfc7de887cc12f5f69070b85859647b63c4..c31daa7cb3a15f462787b5e59ef0ba4628d1223c 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C @@ -145,12 +145,12 @@ atmBoundaryLayerInletVelocityFvPatchVectorField void atmBoundaryLayerInletVelocityFvPatchVectorField::updateCoeffs() { const vectorField& c = patch().Cf(); - scalarField coord = (c & z_); + const scalarField coord(c & z_); scalarField Un(coord.size()); forAll(coord, i) { - if((coord[i] - zGround_) < Href_) + if ((coord[i] - zGround_) < Href_) { Un[i] = (Ustar_/kappa_)*log((coord[i] - zGround_ + z0_)/z0_); } @@ -189,7 +189,7 @@ void atmBoundaryLayerInletVelocityFvPatchVectorField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField +makeNonTemplatedPatchTypeField ( fvPatchVectorField, atmBoundaryLayerInletVelocityFvPatchVectorField diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C index 31a6509819ed8d42acca37bfbbc8eb973a97bb4e..993673a4fec84374221278c154733edbbd730d90 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C @@ -112,23 +112,23 @@ void fixedShearStressFvPatchVectorField::updateCoeffs() const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const vectorField Ui = Uw.patchInternalField(); + const vectorField Ui(Uw.patchInternalField()); vector tauHat = tau0_/(mag(tau0_) + ROOTVSMALL); const scalarField& ry = patch().deltaCoeffs(); - scalarField nuEffw = rasModel.nuEff()().boundaryField()[patchI]; + tmp<scalarField> nuEffw = rasModel.nuEff()().boundaryField()[patchI]; - vectorField UwUpdated = + tmp<vectorField> UwUpdated = tauHat*(tauHat & (tau0_*(1.0/(ry*nuEffw)) + Ui)); operator==(UwUpdated); if (debug) { - vectorField nHat = this->patch().nf(); - volSymmTensorField Reff = rasModel.devReff(); + tmp<vectorField> nHat = this->patch().nf(); + volSymmTensorField Reff(rasModel.devReff()); Info << "tau : " << (nHat & Reff.boundaryField()[patchI])() << endl; } @@ -146,7 +146,7 @@ void fixedShearStressFvPatchVectorField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField +makeNonTemplatedPatchTypeField ( fvPatchVectorField, fixedShearStressFvPatchVectorField diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C index 40af0b6b9f96a843716344c4d382bd8d61ec9b95..1f75a6a145d4018394561f85f9d97e9734f4bf5f 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C @@ -29,27 +29,41 @@ License #include "volFields.H" #include "RASModel.H" +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + // declare specialization within 'Foam' namespace + template<> + const char* NamedEnum + < + Foam::incompressible:: + turbulentHeatFluxTemperatureFvPatchScalarField::heatSourceType, + 2 + >::names[] = + { + "power", + "flux" + }; +} + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + namespace Foam { + namespace incompressible { // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -template<> -const char* -NamedEnum<turbulentHeatFluxTemperatureFvPatchScalarField::heatSourceType, 2>:: -names[] = - { - "power", - "flux" - }; - -const -NamedEnum<turbulentHeatFluxTemperatureFvPatchScalarField::heatSourceType, 2> - turbulentHeatFluxTemperatureFvPatchScalarField::heatSourceTypeNames_; +const NamedEnum +< + turbulentHeatFluxTemperatureFvPatchScalarField::heatSourceType, + 2 +> turbulentHeatFluxTemperatureFvPatchScalarField::heatSourceTypeNames_; // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -223,7 +237,7 @@ void turbulentHeatFluxTemperatureFvPatchScalarField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField +makeNonTemplatedPatchTypeField ( fvPatchScalarField, turbulentHeatFluxTemperatureFvPatchScalarField diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C index f0d66d95f772c5ab9c94c95611db397b15be1bc0..6e5b714811d7ad9fb2451b40537c152fa7210e96 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C @@ -137,7 +137,7 @@ void turbulentMixingLengthDissipationRateInletFvPatchScalarField::write // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField +makeNonTemplatedPatchTypeField ( fvPatchScalarField, turbulentMixingLengthDissipationRateInletFvPatchScalarField diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C index d12b1ebd0d3f1142fe6f3e9e0cbe0fde8a191f44..7762231747aee552a829d9e188b5159aaadc15de 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C @@ -143,7 +143,7 @@ void turbulentMixingLengthFrequencyInletFvPatchScalarField::write // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField +makeNonTemplatedPatchTypeField ( fvPatchScalarField, turbulentMixingLengthFrequencyInletFvPatchScalarField diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C index 6cc67cf0eec5f7eb606b474f8efb2f8517aeace9..a7e31ff80b1e9015bcd441586e7743249385c691 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C @@ -199,7 +199,8 @@ void epsilonWallFunctionFvPatchScalarField::updateCoeffs() const tmp<volScalarField> tk = rasModel.k(); const volScalarField& k = tk(); - const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; + const tmp<volScalarField> tnu = rasModel.nu(); + const scalarField& nuw = tnu().boundaryField()[patchI]; const tmp<volScalarField> tnut = rasModel.nut(); const volScalarField& nut = tnut(); @@ -207,7 +208,7 @@ void epsilonWallFunctionFvPatchScalarField::updateCoeffs() const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField magGradUw = mag(Uw.snGrad()); + const scalarField magGradUw(mag(Uw.snGrad())); // Set epsilon and G forAll(nutw, faceI) @@ -248,7 +249,7 @@ void epsilonWallFunctionFvPatchScalarField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField +makeNonTemplatedPatchTypeField ( fvPatchScalarField, epsilonWallFunctionFvPatchScalarField diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kappatWallFunctions/kappatJayatillekeWallFunction/kappatJayatillekeWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kappatWallFunctions/kappatJayatillekeWallFunction/kappatJayatillekeWallFunctionFvPatchScalarField.C index 005c3be5db8e26656902c18af8e88fd5e00a174a..a33441d83f0182bd0fdee80c759b7b3f49916cfa 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kappatWallFunctions/kappatJayatillekeWallFunction/kappatJayatillekeWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kappatWallFunctions/kappatJayatillekeWallFunction/kappatJayatillekeWallFunctionFvPatchScalarField.C @@ -207,7 +207,7 @@ void kappatJayatillekeWallFunctionFvPatchScalarField::updateCoeffs() const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); const scalar Cmu25 = pow(Cmu_, 0.25); const scalarField& y = rasModel.y()[patchI]; - const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; + const scalarField& nuw = rasModel.nu()().boundaryField()[patchI]; const tmp<volScalarField> tk = rasModel.k(); const volScalarField& k = tk(); @@ -261,7 +261,7 @@ void kappatJayatillekeWallFunctionFvPatchScalarField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField +makeNonTemplatedPatchTypeField ( fvPatchScalarField, kappatJayatillekeWallFunctionFvPatchScalarField diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchFields.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchFields.H index da9986766cd6f269f61c514168b9d1e584a622aa..3cb5fe57ec81c243e323bdfbed1e526f1bb04c8b 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchFields.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchFields.H @@ -40,7 +40,7 @@ namespace RASModels // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(kqRWallFunction) +makePatchTypeFieldTypedefs(kqRWallFunction); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.C index 53918ee8dad8b366dcbdb546752eeeb168c8f74c..daa6af1ea57c1e8eded3a70fcd8b7593ea5368f6 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.C @@ -102,7 +102,11 @@ nutLowReWallFunctionFvPatchScalarField::nutLowReWallFunctionFvPatchScalarField // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField(fvPatchScalarField, nutLowReWallFunctionFvPatchScalarField); +makeNonTemplatedPatchTypeField +( + fvPatchScalarField, + nutLowReWallFunctionFvPatchScalarField +); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C index 0175c38a730c32ee5a650381db55ac7c4d0ae431..29f0fc0bbe6c508ed46b34079d3edf2c019d39b1 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C @@ -47,10 +47,10 @@ tmp<scalarField> nutURoughWallFunctionFvPatchScalarField::calcNut() const const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); const scalarField& y = rasModel.y()[patchI]; const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; + const scalarField& nuw = rasModel.nu()().boundaryField()[patchI]; // The flow velocity at the adjacent cell centre - const scalarField magUp = mag(Uw.patchInternalField() - Uw); + const scalarField magUp(mag(Uw.patchInternalField() - Uw)); tmp<scalarField> tyPlus = calcYPlus(magUp); scalarField& yPlus = tyPlus(); @@ -80,7 +80,7 @@ tmp<scalarField> nutURoughWallFunctionFvPatchScalarField::calcYPlus const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); const scalarField& y = rasModel.y()[patchI]; - const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; + const scalarField& nuw = rasModel.nu()().boundaryField()[patchI]; tmp<scalarField> tyPlus(new scalarField(patch().size(), 0.0)); scalarField& yPlus = tyPlus(); @@ -272,9 +272,9 @@ tmp<scalarField> nutURoughWallFunctionFvPatchScalarField::yPlus() const const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField magUp = mag(Uw.patchInternalField() - Uw); + tmp<scalarField> magUp = mag(Uw.patchInternalField() - Uw); - return calcYPlus(magUp); + return calcYPlus(magUp()); } @@ -294,7 +294,7 @@ void nutURoughWallFunctionFvPatchScalarField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField +makeNonTemplatedPatchTypeField ( fvPatchScalarField, nutURoughWallFunctionFvPatchScalarField diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C index 6b0f8ddf8c46763e656c631838347bdf8175dc48..f236357c6a13122ec0be59c5c0a9e26ec7ab85f0 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C @@ -46,8 +46,8 @@ tmp<scalarField> nutUSpaldingWallFunctionFvPatchScalarField::calcNut() const const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField magGradU = mag(Uw.snGrad()); - const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; + const scalarField magGradU(mag(Uw.snGrad())); + const scalarField& nuw = rasModel.nu()().boundaryField()[patchI]; return max ( @@ -67,9 +67,9 @@ tmp<scalarField> nutUSpaldingWallFunctionFvPatchScalarField::calcUTau const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patch().index()]; - const scalarField magUp = mag(Uw.patchInternalField() - Uw); + const scalarField magUp(mag(Uw.patchInternalField() - Uw)); - const scalarField& nuw = rasModel.nu().boundaryField()[patch().index()]; + const scalarField& nuw = rasModel.nu()().boundaryField()[patch().index()]; const scalarField& nutw = *this; tmp<scalarField> tuTau(new scalarField(patch().size(), 0.0)); @@ -181,7 +181,7 @@ tmp<scalarField> nutUSpaldingWallFunctionFvPatchScalarField::yPlus() const const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); const scalarField& y = rasModel.y()[patchI]; const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; + const scalarField& nuw = rasModel.nu()().boundaryField()[patchI]; return y*calcUTau(mag(Uw.snGrad()))/nuw; } @@ -197,7 +197,7 @@ void nutUSpaldingWallFunctionFvPatchScalarField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField +makeNonTemplatedPatchTypeField ( fvPatchScalarField, nutUSpaldingWallFunctionFvPatchScalarField diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.C index 8d3673ecc79526f501007cacef66678c27d747e8..7d4a9ede5d01f71487e0b7ab7f623655b0dd0337 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.C @@ -47,9 +47,9 @@ tmp<scalarField> nutUTabulatedWallFunctionFvPatchScalarField::calcNut() const const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); const scalarField& y = rasModel.y()[patchI]; const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField magUp = mag(Uw.patchInternalField() - Uw); - const scalarField magGradU = mag(Uw.snGrad()); - const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; + const scalarField magUp(mag(Uw.patchInternalField() - Uw)); + const scalarField magGradU(mag(Uw.snGrad())); + const scalarField& nuw = rasModel.nu()().boundaryField()[patchI]; return max @@ -181,9 +181,9 @@ tmp<scalarField> nutUTabulatedWallFunctionFvPatchScalarField::yPlus() const const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); const scalarField& y = rasModel.y()[patchI]; const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField magUp = mag(Uw.patchInternalField() - Uw); - const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; - const scalarField Rey = magUp*y/nuw; + const scalarField magUp(mag(Uw.patchInternalField() - Uw)); + const scalarField& nuw = rasModel.nu()().boundaryField()[patchI]; + const scalarField Rey(magUp*y/nuw); return Rey/(calcUPlus(Rey) + ROOTVSMALL); } @@ -200,7 +200,7 @@ void nutUTabulatedWallFunctionFvPatchScalarField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField +makeNonTemplatedPatchTypeField ( fvPatchScalarField, nutUTabulatedWallFunctionFvPatchScalarField diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C index 72a0ee907c048b6c9beac7e2afa81b237a440179..572fba9c68314509755d601d1bf6d80e93d88bfa 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C @@ -46,8 +46,8 @@ tmp<scalarField> nutUWallFunctionFvPatchScalarField::calcNut() const const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField magUp = mag(Uw.patchInternalField() - Uw); - const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; + const scalarField magUp(mag(Uw.patchInternalField() - Uw)); + const scalarField& nuw = rasModel.nu()().boundaryField()[patchI]; tmp<scalarField> tyPlus = calcYPlus(magUp); scalarField& yPlus = tyPlus(); @@ -77,7 +77,7 @@ tmp<scalarField> nutUWallFunctionFvPatchScalarField::calcYPlus const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); const scalarField& y = rasModel.y()[patchI]; - const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; + const scalarField& nuw = rasModel.nu()().boundaryField()[patchI]; tmp<scalarField> tyPlus(new scalarField(patch().size(), 0.0)); scalarField& yPlus = tyPlus(); @@ -167,7 +167,7 @@ tmp<scalarField> nutUWallFunctionFvPatchScalarField::yPlus() const const label patchI = patch().index(); const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField magUp = mag(Uw.patchInternalField() - Uw); + const scalarField magUp(mag(Uw.patchInternalField() - Uw)); return calcYPlus(magUp); } @@ -183,7 +183,7 @@ void nutUWallFunctionFvPatchScalarField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField +makeNonTemplatedPatchTypeField ( fvPatchScalarField, nutUWallFunctionFvPatchScalarField diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C index 2919d5d76b0b8e919e20d98b6b84f0c3424c9ff8..27c10083002cb81f7198d72e361a4a31e4dd0aaa 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C @@ -71,7 +71,7 @@ tmp<scalarField> nutkRoughWallFunctionFvPatchScalarField::calcNut() const const scalarField& y = rasModel.y()[patchI]; const tmp<volScalarField> tk = rasModel.k(); const volScalarField& k = tk(); - const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; + const scalarField& nuw = rasModel.nu()().boundaryField()[patchI]; const scalar Cmu25 = pow025(Cmu_); @@ -230,7 +230,7 @@ void nutkRoughWallFunctionFvPatchScalarField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField +makeNonTemplatedPatchTypeField ( fvPatchScalarField, nutkRoughWallFunctionFvPatchScalarField diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C index d11684ad6d8de1cd704215871f6dbddaf2f4c346..8b4949ba68dbd5b028d9da2992691f0030e0de86 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C @@ -80,7 +80,7 @@ tmp<scalarField> nutkWallFunctionFvPatchScalarField::calcNut() const const scalarField& y = rasModel.y()[patchI]; const tmp<volScalarField> tk = rasModel.k(); const volScalarField& k = tk(); - const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; + const scalarField& nuw = rasModel.nu()().boundaryField()[patchI]; const scalar Cmu25 = pow025(Cmu_); @@ -219,8 +219,8 @@ tmp<scalarField> nutkWallFunctionFvPatchScalarField::yPlus() const const tmp<volScalarField> tk = rasModel.k(); const volScalarField& k = tk(); - const scalarField kwc = k.boundaryField()[patchI].patchInternalField(); - const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; + tmp<scalarField> kwc = k.boundaryField()[patchI].patchInternalField(); + const scalarField& nuw = rasModel.nu()().boundaryField()[patchI]; return pow025(Cmu_)*y*sqrt(kwc)/nuw; } @@ -236,7 +236,11 @@ void nutkWallFunctionFvPatchScalarField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField(fvPatchScalarField, nutkWallFunctionFvPatchScalarField); +makeNonTemplatedPatchTypeField +( + fvPatchScalarField, + nutkWallFunctionFvPatchScalarField +); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C index 933e9bdcc929d425ebcf1671f9dedd6ae7667b64..c715658615eb161644a25458d5c58f5e3ee74de6 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C @@ -204,7 +204,8 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs() const tmp<volScalarField> tk = rasModel.k(); const volScalarField& k = tk(); - const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; + const tmp<volScalarField> tnu = rasModel.nu(); + const scalarField& nuw = tnu().boundaryField()[patchI]; const tmp<volScalarField> tnut = rasModel.nut(); const volScalarField& nut = tnut(); @@ -212,7 +213,7 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs() const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField magGradUw = mag(Uw.snGrad()); + const scalarField magGradUw(mag(Uw.snGrad())); // Set omega and G forAll(nutw, faceI) @@ -248,7 +249,7 @@ void omegaWallFunctionFvPatchScalarField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField +makeNonTemplatedPatchTypeField ( fvPatchScalarField, omegaWallFunctionFvPatchScalarField diff --git a/src/turbulenceModels/incompressible/RAS/include/nonLinearWallFunctionsI.H b/src/turbulenceModels/incompressible/RAS/include/nonLinearWallFunctionsI.H index 76ef430618e6095a2ff1f0eb15962a12851e64ca..71746b4ebfe2e18668dacbd91f820f43e9dad8f8 100644 --- a/src/turbulenceModels/incompressible/RAS/include/nonLinearWallFunctionsI.H +++ b/src/turbulenceModels/incompressible/RAS/include/nonLinearWallFunctionsI.H @@ -54,6 +54,8 @@ Description } } + const volScalarField nuLam(this->nu()); + //- Accumulate the wall face contributions to epsilon and G // Increment cellBoundaryFaceCount for each face for averaging forAll(patches, patchi) @@ -64,10 +66,13 @@ Description { #include "checkPatchFieldTypes.H" - const scalarField& nuw = nu().boundaryField()[patchi]; + const scalarField& nuw = nuLam.boundaryField()[patchi]; const scalarField& nutw = nut_.boundaryField()[patchi]; - scalarField magFaceGradU = mag(U_.boundaryField()[patchi].snGrad()); + const scalarField magFaceGradU + ( + mag(U_.boundaryField()[patchi].snGrad()) + ); forAll(curPatch, facei) { diff --git a/src/turbulenceModels/incompressible/RAS/include/wallNonlinearViscosityI.H b/src/turbulenceModels/incompressible/RAS/include/wallNonlinearViscosityI.H index 67b28ab3fbcf4141583af54bd1c578daedf035be..de3f3833a62b42cfef6fbd0216c6e42beefd171d 100644 --- a/src/turbulenceModels/incompressible/RAS/include/wallNonlinearViscosityI.H +++ b/src/turbulenceModels/incompressible/RAS/include/wallNonlinearViscosityI.H @@ -34,13 +34,15 @@ Description const scalar yPlusLam = this->yPlusLam(kappa_.value(), E_.value()); + const volScalarField nuLam(this->nu()); + forAll(patches, patchi) { const fvPatch& curPatch = patches[patchi]; if (isA<wallFvPatch>(curPatch)) { - const scalarField& nuw = nu().boundaryField()[patchi]; + const scalarField& nuw = nuLam.boundaryField()[patchi]; scalarField& nutw = nut_.boundaryField()[patchi]; forAll(curPatch, facei) diff --git a/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C b/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C index 60dc98395ab37b200ba547a3e929a79b76fec682..390960d3bdc187a01c00b509a14896c49e42e411 100644 --- a/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C +++ b/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C @@ -46,13 +46,13 @@ addToRunTimeSelectionTable(RASModel, kOmegaSST, dictionary); tmp<volScalarField> kOmegaSST::F1(const volScalarField& CDkOmega) const { - volScalarField CDkOmegaPlus = max + tmp<volScalarField> CDkOmegaPlus = max ( CDkOmega, dimensionedScalar("1.0e-10", dimless/sqr(dimTime), 1.0e-10) ); - volScalarField arg1 = min + tmp<volScalarField> arg1 = min ( min ( @@ -71,7 +71,7 @@ tmp<volScalarField> kOmegaSST::F1(const volScalarField& CDkOmega) const tmp<volScalarField> kOmegaSST::F2() const { - volScalarField arg2 = min + tmp<volScalarField> arg2 = min ( max ( @@ -347,16 +347,18 @@ void kOmegaSST::correct() y_.correct(); } - volScalarField S2 = magSqr(symm(fvc::grad(U_))); + const volScalarField S2(magSqr(symm(fvc::grad(U_)))); volScalarField G("RASModel::G", nut_*2*S2); // Update omega and G at the wall omega_.boundaryField().updateCoeffs(); - volScalarField CDkOmega = - (2*alphaOmega2_)*(fvc::grad(k_) & fvc::grad(omega_))/omega_; + const volScalarField CDkOmega + ( + (2*alphaOmega2_)*(fvc::grad(k_) & fvc::grad(omega_))/omega_ + ); - volScalarField F1 = this->F1(CDkOmega); + const volScalarField F1(this->F1(CDkOmega)); // Turbulent frequency equation tmp<fvScalarMatrix> omegaEqn diff --git a/src/turbulenceModels/incompressible/RAS/laminar/laminar.C b/src/turbulenceModels/incompressible/RAS/laminar/laminar.C index 9a7a2a3e0fab9541be4744df06af919b45e4b47e..e73b32046fa91ec0827d26368a77e924b0fde93c 100644 --- a/src/turbulenceModels/incompressible/RAS/laminar/laminar.C +++ b/src/turbulenceModels/incompressible/RAS/laminar/laminar.C @@ -72,7 +72,7 @@ tmp<volScalarField> laminar::nut() const IOobject::NO_WRITE ), mesh_, - dimensionedScalar("nut", nu().dimensions(), 0.0) + dimensionedScalar("nut", nu()().dimensions(), 0.0) ) ); } diff --git a/src/turbulenceModels/incompressible/RAS/qZeta/qZeta.C b/src/turbulenceModels/incompressible/RAS/qZeta/qZeta.C index 8fb23887ce34d2416c4b399fff0e5b6aad60a2cf..ad05a27765e2b6c15f18dfc407995159c9e9d4c0 100644 --- a/src/turbulenceModels/incompressible/RAS/qZeta/qZeta.C +++ b/src/turbulenceModels/incompressible/RAS/qZeta/qZeta.C @@ -46,7 +46,7 @@ addToRunTimeSelectionTable(RASModel, qZeta, dictionary); tmp<volScalarField> qZeta::fMu() const { - volScalarField Rt = q_*k_/(2.0*nu()*zeta_); + const volScalarField Rt(q_*k_/(2.0*nu()*zeta_)); if (anisotropic_) { @@ -63,7 +63,7 @@ tmp<volScalarField> qZeta::fMu() const tmp<volScalarField> qZeta::f2() const { - volScalarField Rt = q_*k_/(2.0*nu()*zeta_); + tmp<volScalarField> Rt = q_*k_/(2.0*nu()*zeta_); return scalar(1) - 0.3*exp(-sqr(Rt)); } @@ -293,10 +293,10 @@ void qZeta::correct() return; } - volScalarField S2 = 2*magSqr(symm(fvc::grad(U_))); + tmp<volScalarField> S2 = 2*magSqr(symm(fvc::grad(U_))); volScalarField G("RASModel::G", nut_/(2.0*q_)*S2); - volScalarField E = nu()*nut_/q_*fvc::magSqrGradGrad(U_); + const volScalarField E(nu()*nut_/q_*fvc::magSqrGradGrad(U_)); // Zeta equation diff --git a/src/turbulenceModels/incompressible/RAS/realizableKE/realizableKE.C b/src/turbulenceModels/incompressible/RAS/realizableKE/realizableKE.C index d6e49f0b666005408a9c156c614cddf16272d89f..c9d24bca70f280d1d6f669d51df2c998c5e6ab22 100644 --- a/src/turbulenceModels/incompressible/RAS/realizableKE/realizableKE.C +++ b/src/turbulenceModels/incompressible/RAS/realizableKE/realizableKE.C @@ -54,19 +54,23 @@ tmp<volScalarField> realizableKE::rCmu tmp<volSymmTensorField> tS = dev(symm(gradU)); const volSymmTensorField& S = tS(); - volScalarField W = + tmp<volScalarField> W + ( (2*sqrt(2.0))*((S&S)&&S) /( magS*S2 + dimensionedScalar("small", dimensionSet(0, 0, -3, 0, 0), SMALL) - ); + ) + ); tS.clear(); - volScalarField phis = - (1.0/3.0)*acos(min(max(sqrt(6.0)*W, -scalar(1)), scalar(1))); - volScalarField As = sqrt(6.0)*cos(phis); - volScalarField Us = sqrt(S2/2.0 + magSqr(skew(gradU))); + tmp<volScalarField> phis + ( + (1.0/3.0)*acos(min(max(sqrt(6.0)*W, -scalar(1)), scalar(1))) + ); + tmp<volScalarField> As = sqrt(6.0)*cos(phis); + tmp<volScalarField> Us = sqrt(S2/2.0 + magSqr(skew(gradU))); return 1.0/(A0_ + As*Us*k_/epsilon_); } @@ -77,8 +81,8 @@ tmp<volScalarField> realizableKE::rCmu const volTensorField& gradU ) { - volScalarField S2 = 2*magSqr(dev(symm(gradU))); - volScalarField magS = sqrt(S2); + const volScalarField S2(2*magSqr(dev(symm(gradU)))); + tmp<volScalarField> magS = sqrt(S2); return rCmu(gradU, S2, magS); } @@ -270,12 +274,12 @@ void realizableKE::correct() return; } - volTensorField gradU = fvc::grad(U_); - volScalarField S2 = 2*magSqr(dev(symm(gradU))); - volScalarField magS = sqrt(S2); + const volTensorField gradU(fvc::grad(U_)); + const volScalarField S2(2*magSqr(dev(symm(gradU)))); + const volScalarField magS(sqrt(S2)); - volScalarField eta = magS*k_/epsilon_; - volScalarField C1 = max(eta/(scalar(5) + eta), scalar(0.43)); + const volScalarField eta(magS*k_/epsilon_); + tmp<volScalarField> C1 = max(eta/(scalar(5) + eta), scalar(0.43)); volScalarField G("RASModel::G", nut_*S2); diff --git a/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.C b/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.C index 7ab42b7fb8854b8f1c8db1889a012111ba1dec1a..99d48b23da529ab19d1812d93097bd7a7be4e3f2 100644 --- a/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.C +++ b/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.C @@ -92,7 +92,7 @@ tmp<volScalarField> laminar::nut() const IOobject::NO_WRITE ), mesh_, - dimensionedScalar("nut", nu().dimensions(), 0.0) + dimensionedScalar("nut", nu()().dimensions(), 0.0) ) ); } diff --git a/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.H b/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.H index 9bd85eabbb49bee377c1051df852c5bcec47d643..cba88c5cc53a704dea8fb1e9a36d5c7bc91c324c 100644 --- a/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.H +++ b/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.H @@ -168,7 +168,7 @@ public: } //- Return the laminar viscosity - const volScalarField& nu() const + inline tmp<volScalarField> nu() const { return transportModel_.nu(); } diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/constant/heater/solidThermophysicalProperties b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/constant/heater/solidThermophysicalProperties index 89fd12c0fc44c0904fa58c784581f59140bda351..36d4e5bc3b20d5500b6965973b988074fd7fe323 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/constant/heater/solidThermophysicalProperties +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/constant/heater/solidThermophysicalProperties @@ -46,7 +46,6 @@ isotropicKSolidThermoCoeffs cpValues (1700 1700); KValues (80 40); - //- radiative properties emissivityValues (1 1); kappaValues (0 0); diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/heater/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/heater/changeDictionaryDict index 2026e3a745e3356355e1c8d91f04358e8a6e97ea..72a3a7d85ec09790be937c17de4fe78a734be0f8 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/heater/changeDictionaryDict +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/heater/changeDictionaryDict @@ -62,8 +62,8 @@ dictionaryReplacement Ypmma { internalField uniform 0.5; - - + + boundaryField { ".*" @@ -72,13 +72,13 @@ dictionaryReplacement value uniform 0.5; } } - + } Ychar { internalField uniform 0.5; - + boundaryField { ".*" diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/leftSolid/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/leftSolid/changeDictionaryDict index a697b72d6444722a573bcf1de160f9d938da1b7d..e74354543d739dbf2426c417d74e9e80ad108893 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/leftSolid/changeDictionaryDict +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/leftSolid/changeDictionaryDict @@ -53,8 +53,7 @@ dictionaryReplacement Ypmma { internalField uniform 0.5; - - + boundaryField { ".*" @@ -63,13 +62,13 @@ dictionaryReplacement value uniform 0.5; } } - + } Ychar { internalField uniform 0.5; - + boundaryField { ".*" diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/rightSolid/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/rightSolid/changeDictionaryDict index 63fdaefa6de2b37665094a9ed9e362408b6a41d1..c92853717e5bb0e1c84209326c1039d2583bfa12 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/rightSolid/changeDictionaryDict +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/rightSolid/changeDictionaryDict @@ -53,8 +53,7 @@ dictionaryReplacement Ypmma { internalField uniform 0.5; - - + boundaryField { ".*" @@ -63,13 +62,13 @@ dictionaryReplacement value uniform 0.5; } } - + } Ychar { internalField uniform 0.5; - + boundaryField { ".*" diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionLiquidHeater/constant/heater/solidThermophysicalProperties b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionLiquidHeater/constant/heater/solidThermophysicalProperties index 711183f0ffeefbb51222c0918c6887f17eaad3fd..9bf5dc34670b2ab5e4be8048a73faeba92fd1abb 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionLiquidHeater/constant/heater/solidThermophysicalProperties +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionLiquidHeater/constant/heater/solidThermophysicalProperties @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | +| \\ / O peration | Version: dev | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ @@ -46,7 +46,7 @@ isotropicKSolidThermoCoeffs cpValues (1700 1700); KValues (80 40); - + //- radiative properties emissivityValues (1 1); kappaValues (0 0); diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionLiquidHeater/system/heater/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionLiquidHeater/system/heater/changeDictionaryDict index 72b74f25a9ceef42153d396bcefc665e44d1c8fd..ac501cfbbb83ed37d2320c37eda30d521fb32d83 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionLiquidHeater/system/heater/changeDictionaryDict +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionLiquidHeater/system/heater/changeDictionaryDict @@ -36,7 +36,7 @@ dictionaryReplacement { internalField uniform 300; - + boundaryField { ".*" @@ -63,8 +63,8 @@ dictionaryReplacement Ypmma { internalField uniform 0.5; - - + + boundaryField { ".*" @@ -73,13 +73,13 @@ dictionaryReplacement value uniform 0.5; } } - + } Ychar { internalField uniform 0.5; - + boundaryField { ".*" diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionLiquidHeater/system/leftSolid/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionLiquidHeater/system/leftSolid/changeDictionaryDict index 9f91c50aa1b7ecfb3fa36b7bbc48c283e9505ebb..a0d6058f1f735900c7b9cf26e59175508d46d565 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionLiquidHeater/system/leftSolid/changeDictionaryDict +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionLiquidHeater/system/leftSolid/changeDictionaryDict @@ -53,7 +53,7 @@ dictionaryReplacement Ypmma { internalField uniform 0.5; - + boundaryField { ".*" @@ -67,7 +67,7 @@ dictionaryReplacement Ychar { internalField uniform 0.5; - + boundaryField { ".*" diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionLiquidHeater/system/rightSolid/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionLiquidHeater/system/rightSolid/changeDictionaryDict index 822022bd1520fa3adf03abf60ba7d7bf7c207c22..e21597a0266af6bb58de22c246f3d6bbc3f2a541 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionLiquidHeater/system/rightSolid/changeDictionaryDict +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionLiquidHeater/system/rightSolid/changeDictionaryDict @@ -53,7 +53,7 @@ dictionaryReplacement Ypmma { internalField uniform 0.5; - + boundaryField { ".*" @@ -67,7 +67,7 @@ dictionaryReplacement Ychar { internalField uniform 0.5; - + boundaryField { ".*" diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/constant/heater/solidThermophysicalProperties b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/constant/heater/solidThermophysicalProperties index 711183f0ffeefbb51222c0918c6887f17eaad3fd..5d187a22e97e9ddd9e196aff37b299e89a6a5147 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/constant/heater/solidThermophysicalProperties +++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/constant/heater/solidThermophysicalProperties @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | +| \\ / O peration | Version: dev | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ @@ -46,7 +46,6 @@ isotropicKSolidThermoCoeffs cpValues (1700 1700); KValues (80 40); - //- radiative properties emissivityValues (1 1); kappaValues (0 0); diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/heater/solidThermophysicalProperties b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/heater/solidThermophysicalProperties index 711183f0ffeefbb51222c0918c6887f17eaad3fd..cf23dbfef9577bd5ed4a09f39fa5d2df00332eae 100644 --- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/heater/solidThermophysicalProperties +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/heater/solidThermophysicalProperties @@ -46,7 +46,7 @@ isotropicKSolidThermoCoeffs cpValues (1700 1700); KValues (80 40); - + //- radiative properties emissivityValues (1 1); kappaValues (0 0); diff --git a/tutorials/incompressible/MRFSimpleFoam/MRFSimpleFoam/MRFSimpleFoam.C b/tutorials/incompressible/MRFSimpleFoam/MRFSimpleFoam/MRFSimpleFoam.C index 433b7707a93712f49c8b094ee65666e978346a34..b92cc165c317867772eee4c768a96e57fc084424 100644 --- a/tutorials/incompressible/MRFSimpleFoam/MRFSimpleFoam/MRFSimpleFoam.C +++ b/tutorials/incompressible/MRFSimpleFoam/MRFSimpleFoam/MRFSimpleFoam.C @@ -73,7 +73,7 @@ int main(int argc, char *argv[]) solve(UEqn() == -fvc::grad(p)); p.boundaryField().updateCoeffs(); - volScalarField rAU = 1.0/UEqn().A(); + volScalarField rAU(1.0/UEqn().A()); U = rAU*UEqn().H(); UEqn.clear(); diff --git a/tutorials/incompressible/simpleFoam/windTurbineTerrain/system/changeDictionaryDict b/tutorials/incompressible/simpleFoam/windTurbineTerrain/system/changeDictionaryDict index 09a5e24c6ae1de2226a52c58b83fb321b57eca36..343f0faf1ce72b8ed74fbb745c6e75e42ae10d7b 100644 --- a/tutorials/incompressible/simpleFoam/windTurbineTerrain/system/changeDictionaryDict +++ b/tutorials/incompressible/simpleFoam/windTurbineTerrain/system/changeDictionaryDict @@ -20,7 +20,7 @@ FoamFile dictionaryReplacement { - // Specify + // Specify // - all fvPatchFields with potential non-uniform values // - all fvPatchFields originating from meshing // - all fvPatchFields originating from mesh-redistribution diff --git a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/system/fvSolution b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/system/fvSolution index c40ce42cf8c252cfc620a4d4000ad9ae9f00a918..f36568277b7d50d975e66f86fb196a12a74f8405 100644 --- a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/system/fvSolution +++ b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/system/fvSolution @@ -36,15 +36,15 @@ solvers { solver GAMG; tolerance 1e-06; - relTol 0.01; + relTol 0.01; smoother GaussSeidel; - nPreSweeps 0; - nPostSweeps 2; - nFinestSweeps 2; - cacheAgglomeration false; - nCellsInCoarsestLevel 10; - agglomerator faceAreaPair; - mergeLevels 1; + nPreSweeps 0; + nPostSweeps 2; + nFinestSweeps 2; + cacheAgglomeration false; + nCellsInCoarsestLevel 10; + agglomerator faceAreaPair; + mergeLevels 1; } pFinal diff --git a/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/createFields.H b/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/createFields.H index 4a6bc55de51cc9a7192dc3b341176b8fc80775b9..83aed2ffa489fa7d96734f7d6a33482222c31dab 100644 --- a/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/createFields.H +++ b/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/createFields.H @@ -57,5 +57,7 @@ Info<< "Creating field DpDt\n" << endl; - volScalarField DpDt = - fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); + volScalarField DpDt + ( + fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p) + ); diff --git a/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/pEqn.H b/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/pEqn.H index 3d414f4af63f8ba4f3885a39872b0f628c45070c..4168eb0e3461f9e5c15868dfaed51eb954b25ff0 100644 --- a/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/pEqn.H +++ b/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/pEqn.H @@ -1,6 +1,6 @@ rho = thermo.rho(); -volScalarField rAU = 1.0/UEqn.A(); +volScalarField rAU(1.0/UEqn.A()); U = rAU*UEqn.H(); if (transonic) diff --git a/wmake/wmakeScheduler b/wmake/wmakeScheduler index fc60b9be4dd844e82b30b1490099a4044865322f..919c34ea050bb4816ecce93668831076ddc27979 100755 --- a/wmake/wmakeScheduler +++ b/wmake/wmakeScheduler @@ -108,19 +108,20 @@ fi # Construct test string for remote execution. # Source WM_PROJECT settings if WM_PROJECT environment not set. # attempt to preserve the installation directory 'FOAM_INST_DIR' +# use FOAM_SETTINGS to pass command-line settings case $sourceFoam in */bashrc) if [ "$FOAM_INST_DIR" ] then - sourceFoam='[ "$WM_PROJECT" ] || '"FOAM_INST_DIR=$FOAM_INST_DIR . $sourceFoam" + sourceFoam='[ "$WM_PROJECT" ] || '"FOAM_INST_DIR=$FOAM_INST_DIR . $sourceFoam $FOAM_SETTINGS" else - sourceFoam='[ "$WM_PROJECT" ] || '". $sourceFoam" + sourceFoam='[ "$WM_PROJECT" ] || '". $sourceFoam $FOAM_SETTINGS" fi ;; */cshrc) # TODO: csh equivalent to bash code (preserving FOAM_INST_DIR) - sourceFoam='if ( ! $?WM_PROJECT ) source '"$sourceFoam" + sourceFoam='if ( ! $?WM_PROJECT ) source '"$sourceFoam $FOAM_SETTINGS" ;; esac