diff --git a/applications/solvers/basic/laplacianFoam/laplacianFoam.C b/applications/solvers/basic/laplacianFoam/laplacianFoam.C index 76745227dd..755465bb9d 100644 --- a/applications/solvers/basic/laplacianFoam/laplacianFoam.C +++ b/applications/solvers/basic/laplacianFoam/laplacianFoam.C @@ -31,19 +31,17 @@ Description #include "fvCFD.H" - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // int main(int argc, char *argv[]) { + #include "setRootCase.H" -# include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + #include "createFields.H" -# include "createTime.H" -# include "createMesh.H" -# include "createFields.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nCalculating temperature distribution\n" << endl; @@ -51,7 +49,7 @@ int main(int argc, char *argv[]) { Info<< "Time = " << runTime.timeName() << nl << endl; -# include "readSIMPLEControls.H" + #include "readSIMPLEControls.H" for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { @@ -61,7 +59,7 @@ int main(int argc, char *argv[]) ); } -# include "write.H" + #include "write.H" Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" diff --git a/applications/solvers/basic/potentialFoam/potentialFoam.C b/applications/solvers/basic/potentialFoam/potentialFoam.C index 1e0afd6dd4..81df893bac 100644 --- a/applications/solvers/basic/potentialFoam/potentialFoam.C +++ b/applications/solvers/basic/potentialFoam/potentialFoam.C @@ -39,13 +39,13 @@ int main(int argc, char *argv[]) { argList::addBoolOption("writep", "write the final pressure field"); -# include "setRootCase.H" -# include "createTime.H" -# include "createMesh.H" -# include "createFields.H" -# include "readSIMPLEControls.H" + #include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + #include "createFields.H" + #include "readSIMPLEControls.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< nl << "Calculating potential flow" << endl; diff --git a/applications/solvers/combustion/PDRFoam/Make/files b/applications/solvers/combustion/PDRFoam/Make/files index 889eebc33e..d1b1d5a8f8 100644 --- a/applications/solvers/combustion/PDRFoam/Make/files +++ b/applications/solvers/combustion/PDRFoam/Make/files @@ -1,25 +1,25 @@ XiModels/XiModel/XiModel.C -XiModels/XiModel/newXiModel.C +XiModels/XiModel/XiModelNew.C XiModels/fixed/fixed.C XiModels/algebraic/algebraic.C XiModels/transport/transport.C XiModels/XiEqModels/XiEqModel/XiEqModel.C -XiModels/XiEqModels/XiEqModel/newXiEqModel.C +XiModels/XiEqModels/XiEqModel/XiEqModelNew.C XiModels/XiEqModels/Gulder/Gulder.C XiModels/XiEqModels/instabilityXiEq/instabilityXiEq.C XiModels/XiEqModels/SCOPEBlendXiEq/SCOPEBlendXiEq.C XiModels/XiEqModels/SCOPEXiEq/SCOPEXiEq.C XiModels/XiGModels/XiGModel/XiGModel.C -XiModels/XiGModels/XiGModel/newXiGModel.C +XiModels/XiGModels/XiGModel/XiGModelNew.C XiModels/XiGModels/KTS/KTS.C XiModels/XiGModels/instabilityG/instabilityG.C PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C PDRModels/dragModels/PDRDragModel/PDRDragModel.C -PDRModels/dragModels/PDRDragModel/newPDRDragModel.C +PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C PDRModels/dragModels/basic/basic.C PDRModels/XiEqModels/basicXiSubXiEq/basicXiSubXiEq.C diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/newPDRDragModel.C b/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C similarity index 88% rename from applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/newPDRDragModel.C rename to applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C index 3208681241..0c208d44cc 100644 --- a/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/newPDRDragModel.C +++ b/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C @@ -36,12 +36,12 @@ Foam::autoPtr Foam::PDRDragModel::New const surfaceScalarField& phi ) { - word PDRDragModelTypeName = PDRProperties.lookup("PDRDragModel"); + const word modelType(PDRProperties.lookup("PDRDragModel")); - Info<< "Selecting flame-wrinkling model " << PDRDragModelTypeName << endl; + Info<< "Selecting flame-wrinkling model " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(PDRDragModelTypeName); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -49,7 +49,7 @@ Foam::autoPtr Foam::PDRDragModel::New ( "PDRDragModel::New" ) << "Unknown PDRDragModel type " - << PDRDragModelTypeName << endl << endl + << modelType << nl << nl << "Valid PDRDragModels are : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/newXiEqModel.C b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModelNew.C similarity index 82% rename from applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/newXiEqModel.C rename to applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModelNew.C index b785c5b8e0..6f347bbe2d 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/newXiEqModel.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModelNew.C @@ -29,18 +29,18 @@ License Foam::autoPtr Foam::XiEqModel::New ( - const dictionary& XiEqProperties, + const dictionary& propDict, const hhuCombustionThermo& thermo, const compressible::RASModel& turbulence, const volScalarField& Su ) { - word XiEqModelTypeName = XiEqProperties.lookup("XiEqModel"); + const word modelType(propDict.lookup("XiEqModel")); - Info<< "Selecting flame-wrinkling model " << XiEqModelTypeName << endl; + Info<< "Selecting flame-wrinkling model " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(XiEqModelTypeName); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -53,14 +53,13 @@ Foam::autoPtr Foam::XiEqModel::New " const volScalarField& Su" ")" ) << "Unknown XiEqModel type " - << XiEqModelTypeName << endl << endl - << "Valid XiEqModels are : " << endl + << modelType << nl << nl + << "Valid XiEqModels are : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } - return autoPtr - (cstrIter()(XiEqProperties, thermo, turbulence, Su)); + return autoPtr(cstrIter()(propDict, thermo, turbulence, Su)); } diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/newXiGModel.C b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModelNew.C similarity index 82% rename from applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/newXiGModel.C rename to applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModelNew.C index 728bce124b..b675e7f334 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/newXiGModel.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModelNew.C @@ -29,18 +29,18 @@ License Foam::autoPtr Foam::XiGModel::New ( - const dictionary& XiGProperties, + const dictionary& propDict, const hhuCombustionThermo& thermo, const compressible::RASModel& turbulence, const volScalarField& Su ) { - word XiGModelTypeName = XiGProperties.lookup("XiGModel"); + const word modelType(propDict.lookup("XiGModel")); - Info<< "Selecting flame-wrinkling model " << XiGModelTypeName << endl; + Info<< "Selecting flame-wrinkling model " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(XiGModelTypeName); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -53,14 +53,13 @@ Foam::autoPtr Foam::XiGModel::New " const volScalarField& Su" ")" ) << "Unknown XiGModel type " - << XiGModelTypeName << endl << endl - << "Valid XiGModels are : " << endl + << modelType << nl << nl + << "Valid XiGModels are : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } - return autoPtr - (cstrIter()(XiGProperties, thermo, turbulence, Su)); + return autoPtr(cstrIter()(propDict, thermo, turbulence, Su)); } diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiModel/newXiModel.C b/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModelNew.C similarity index 82% rename from applications/solvers/combustion/PDRFoam/XiModels/XiModel/newXiModel.C rename to applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModelNew.C index dfd748265c..a77f8e8a20 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiModel/newXiModel.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModelNew.C @@ -29,7 +29,7 @@ License Foam::autoPtr Foam::XiModel::New ( - const dictionary& XiProperties, + const dictionary& propDict, const hhuCombustionThermo& thermo, const compressible::RASModel& turbulence, const volScalarField& Su, @@ -38,12 +38,12 @@ Foam::autoPtr Foam::XiModel::New const surfaceScalarField& phi ) { - word XiModelTypeName = XiProperties.lookup("XiModel"); + const word modelType(propDict.lookup("XiModel")); - Info<< "Selecting flame-wrinkling model " << XiModelTypeName << endl; + Info<< "Selecting flame-wrinkling model " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(XiModelTypeName); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -51,14 +51,14 @@ Foam::autoPtr Foam::XiModel::New ( "XiModel::New" ) << "Unknown XiModel type " - << XiModelTypeName << endl << endl - << "Valid XiModels are : " << endl + << modelType << nl << nl + << "Valid XiModels are : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } return autoPtr - (cstrIter()(XiProperties, thermo, turbulence, Su, rho, b, phi)); + (cstrIter()(propDict, thermo, turbulence, Su, rho, b, phi)); } diff --git a/applications/solvers/combustion/fireFoam/combustionModels/Make/files b/applications/solvers/combustion/fireFoam/combustionModels/Make/files index 5b1262b70d..86696b0709 100644 --- a/applications/solvers/combustion/fireFoam/combustionModels/Make/files +++ b/applications/solvers/combustion/fireFoam/combustionModels/Make/files @@ -1,5 +1,5 @@ combustionModel/combustionModel.C -combustionModel/newCombustionModel.C +combustionModel/combustionModelNew.C infinitelyFastChemistry/infinitelyFastChemistry.C diff --git a/applications/solvers/combustion/fireFoam/combustionModels/combustionModel/newCombustionModel.C b/applications/solvers/combustion/fireFoam/combustionModels/combustionModel/combustionModelNew.C similarity index 80% rename from applications/solvers/combustion/fireFoam/combustionModels/combustionModel/newCombustionModel.C rename to applications/solvers/combustion/fireFoam/combustionModels/combustionModel/combustionModelNew.C index 40f2bb2e2f..ff1e54b0dc 100644 --- a/applications/solvers/combustion/fireFoam/combustionModels/combustionModel/newCombustionModel.C +++ b/applications/solvers/combustion/fireFoam/combustionModels/combustionModel/combustionModelNew.C @@ -29,22 +29,19 @@ License Foam::autoPtr Foam::combustionModel::New ( - const dictionary& combustionProperties, + const dictionary& propDict, const hsCombustionThermo& thermo, const compressible::turbulenceModel& turbulence, const surfaceScalarField& phi, const volScalarField& rho ) { - word combustionModelTypeName = combustionProperties.lookup - ( - "combustionModel" - ); + const word modelType(propDict.lookup("combustionModel")); - Info<< "Selecting combustion model " << combustionModelTypeName << endl; + Info<< "Selecting combustion model " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(combustionModelTypeName); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -52,14 +49,14 @@ Foam::autoPtr Foam::combustionModel::New ( "combustionModel::New" ) << "Unknown combustionModel type " - << combustionModelTypeName << endl << endl - << "Valid combustionModels are : " << endl + << modelType << nl << nl + << "Valid combustionModels are : " << endl << dictionaryConstructorTablePtr_->toc() << exit(FatalError); } return autoPtr - (cstrIter()(combustionProperties, thermo, turbulence, phi, rho)); + (cstrIter()(propDict, thermo, turbulence, phi, rho)); } diff --git a/applications/solvers/combustion/fireFoam/createFields.H b/applications/solvers/combustion/fireFoam/createFields.H index a399df8536..95bda05606 100644 --- a/applications/solvers/combustion/fireFoam/createFields.H +++ b/applications/solvers/combustion/fireFoam/createFields.H @@ -71,9 +71,9 @@ IOdictionary combustionProperties ); Info<< "Creating combustion model\n" << endl; -autoPtr combustion +autoPtr combustion ( - combustionModel::combustionModel::New + combustionModel::New ( combustionProperties, thermo, diff --git a/applications/solvers/compressible/rhoCentralFoam/Allwclean b/applications/solvers/compressible/rhoCentralFoam/Allwclean index 21ee42fadb..cc5398c04e 100755 --- a/applications/solvers/compressible/rhoCentralFoam/Allwclean +++ b/applications/solvers/compressible/rhoCentralFoam/Allwclean @@ -4,5 +4,6 @@ set -x wclean libso BCs wclean +wclean rhoCentralDyMFoam # ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/compressible/rhoCentralFoam/Allwmake b/applications/solvers/compressible/rhoCentralFoam/Allwmake index 5f01d96a75..671c640231 100755 --- a/applications/solvers/compressible/rhoCentralFoam/Allwmake +++ b/applications/solvers/compressible/rhoCentralFoam/Allwmake @@ -4,5 +4,6 @@ set -x wmake libso BCs wmake +wmake rhoCentralDyMFoam # ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/Make/files b/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/Make/files new file mode 100644 index 0000000000..f78400aa8d --- /dev/null +++ b/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/Make/files @@ -0,0 +1,3 @@ +rhoCentralDyMFoam.C + +EXE = $(FOAM_APPBIN)/rhoCentralDyMFoam diff --git a/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/Make/options b/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/Make/options new file mode 100644 index 0000000000..403ffc1eef --- /dev/null +++ b/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/Make/options @@ -0,0 +1,17 @@ +EXE_INC = \ + -I.. \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ + -I../BCs/lnInclude \ + -I$(LIB_SRC)/sampling/lnInclude \ + -I$(LIB_SRC)/dynamicMesh/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude + +EXE_LIBS = \ + -lfiniteVolume \ + -lbasicThermophysicalModels \ + -lspecie \ + -lrhoCentralFoam \ + -ldynamicMesh \ + -lmeshTools diff --git a/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/rhoCentralDyMFoam.C b/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/rhoCentralDyMFoam.C new file mode 100644 index 0000000000..274a8e80be --- /dev/null +++ b/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/rhoCentralDyMFoam.C @@ -0,0 +1,245 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Application + rhoCentralFoam + +Description + Density-based compressible flow solver based on central-upwind schemes of + Kurganov and Tadmor + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "basicPsiThermo.H" +#include "zeroGradientFvPatchFields.H" +#include "fixedRhoFvPatchScalarField.H" +#include "motionSolver.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + #include "setRootCase.H" + + #include "createTime.H" + #include "createMesh.H" + #include "createFields.H" + #include "readThermophysicalProperties.H" + #include "readTimeControls.H" + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + #include "readFluxScheme.H" + + dimensionedScalar v_zero("v_zero", dimVolume/dimTime, 0.0); + + Info<< "\nStarting time loop\n" << endl; + + autoPtr motionPtr = motionSolver::New(mesh); + + while (runTime.run()) + { + // --- 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)"); + + 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)"); + + 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; + + 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(); + + 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 a_pos = ap/(ap - am); + + surfaceScalarField amaxSf("amaxSf", max(mag(am), mag(ap))); + + surfaceScalarField aSf = am*a_pos; + + if (fluxScheme == "Tadmor") + { + aSf = -0.5*amaxSf; + a_pos = 0.5; + } + + 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; + + // Reuse amaxSf for the maximum positive and negative fluxes + // estimated by the central scheme + amaxSf = max(mag(aphiv_pos), mag(aphiv_neg)); + + #include "compressibleCourantNo.H" + #include "readTimeControls.H" + #include "setDeltaT.H" + + runTime++; + + Info<< "Time = " << runTime.timeName() << nl << endl; + + mesh.movePoints(motionPtr->newPoints()); + phiv_pos = U_pos & mesh.Sf(); + phiv_neg = U_neg & mesh.Sf(); + fvc::makeRelative(phiv_pos, U); + fvc::makeRelative(phiv_neg, U); + phiv_neg -= mesh.phi(); + phiv_pos *= a_pos; + phiv_neg *= a_neg; + aphiv_pos = phiv_pos - aSf; + aphiv_neg = phiv_neg + aSf; + + surfaceScalarField phi("phi", aphiv_pos*rho_pos + aphiv_neg*rho_neg); + + surfaceVectorField phiUp = + (aphiv_pos*rhoU_pos + aphiv_neg*rhoU_neg) + + (a_pos*p_pos + a_neg*p_neg)*mesh.Sf(); + + 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; + + volTensorField tauMC("tauMC", mu*dev2(fvc::grad(U)().T())); + + // --- Solve density + Info<< max(rho) << " " << min(rho) << endl; + solve(fvm::ddt(rho) + fvc::div(phi)); + Info<< max(rho) << " " << min(rho) << endl; + + // --- Solve momentum + solve(fvm::ddt(rhoU) + fvc::div(phiUp)); + + U.dimensionedInternalField() = + rhoU.dimensionedInternalField() + /rho.dimensionedInternalField(); + U.correctBoundaryConditions(); + rhoU.boundaryField() = rho.boundaryField()*U.boundaryField(); + + if (!inviscid) + { + solve + ( + fvm::ddt(rho, U) - fvc::ddt(rho, U) + - fvm::laplacian(mu, U) + - fvc::div(tauMC) + ); + rhoU = rho*U; + } + + // --- Solve energy + surfaceScalarField sigmaDotU = + ( + ( + fvc::interpolate(mu)*mesh.magSf()*fvc::snGrad(U) + + (mesh.Sf() & fvc::interpolate(tauMC)) + ) + & (a_pos*U_pos + a_neg*U_neg) + ); + + solve + ( + fvm::ddt(rhoE) + + fvc::div(phiEp) + - fvc::div(sigmaDotU) + ); + + e = rhoE/rho - 0.5*magSqr(U); + e.correctBoundaryConditions(); + thermo.correct(); + rhoE.boundaryField() = + rho.boundaryField()* + ( + e.boundaryField() + 0.5*magSqr(U.boundaryField()) + ); + + if (!inviscid) + { + volScalarField k("k", thermo.Cp()*mu/Pr); + solve + ( + fvm::ddt(rho, e) - fvc::ddt(rho, e) + - fvm::laplacian(thermo.alpha(), e) + + fvc::laplacian(thermo.alpha(), e) + - fvc::laplacian(k, T) + ); + thermo.correct(); + rhoE = rho*(e + 0.5*magSqr(U)); + } + + p.dimensionedInternalField() = + rho.dimensionedInternalField() + /psi.dimensionedInternalField(); + p.correctBoundaryConditions(); + rho.boundaryField() = psi.boundaryField()*p.boundaryField(); + + runTime.write(); + + Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" + << " ClockTime = " << runTime.elapsedClockTime() << " s" + << nl << endl; + } + + Info<< "End\n" << endl; + + return 0; +} + +// ************************************************************************* // diff --git a/applications/solvers/compressible/sonicDyMFoam/sonicDyMFoam.C b/applications/solvers/compressible/sonicDyMFoam/sonicDyMFoam.C index 4bd0cdc61f..312952bcbf 100644 --- a/applications/solvers/compressible/sonicDyMFoam/sonicDyMFoam.C +++ b/applications/solvers/compressible/sonicDyMFoam/sonicDyMFoam.C @@ -49,7 +49,7 @@ int main(int argc, char *argv[]) Info<< "\nStarting time loop\n" << endl; - autoPtr motionPtr = motionSolver::New(mesh); + autoPtr motionPtr = motionSolver::New(mesh); while (runTime.loop()) { diff --git a/applications/solvers/discreteMethods/molecularDynamics/mdEquilibrationFoam/mdEquilibrationFoam.C b/applications/solvers/discreteMethods/molecularDynamics/mdEquilibrationFoam/mdEquilibrationFoam.C index f2ddf13741..c3ae69847d 100644 --- a/applications/solvers/discreteMethods/molecularDynamics/mdEquilibrationFoam/mdEquilibrationFoam.C +++ b/applications/solvers/discreteMethods/molecularDynamics/mdEquilibrationFoam/mdEquilibrationFoam.C @@ -39,6 +39,20 @@ int main(int argc, char *argv[]) # include "createTime.H" # include "createMesh.H" + Info<< "\nReading field U\n" << endl; + volVectorField U + ( + IOobject + ( + "U", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + potential pot(mesh); moleculeCloud molecules(mesh, pot); diff --git a/applications/solvers/discreteMethods/molecularDynamics/mdFoam/mdFoam.C b/applications/solvers/discreteMethods/molecularDynamics/mdFoam/mdFoam.C index 3aa2532c3e..ade0895a2a 100644 --- a/applications/solvers/discreteMethods/molecularDynamics/mdFoam/mdFoam.C +++ b/applications/solvers/discreteMethods/molecularDynamics/mdFoam/mdFoam.C @@ -39,6 +39,20 @@ int main(int argc, char *argv[]) # include "createTime.H" # include "createMesh.H" + Info<< "\nReading field U\n" << endl; + volVectorField U + ( + IOobject + ( + "U", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + potential pot(mesh); moleculeCloud molecules(mesh, pot); diff --git a/applications/solvers/electromagnetics/magneticFoam/Make/files b/applications/solvers/electromagnetics/magneticFoam/Make/files new file mode 100644 index 0000000000..abc57d5437 --- /dev/null +++ b/applications/solvers/electromagnetics/magneticFoam/Make/files @@ -0,0 +1,3 @@ +magneticFoam.C + +EXE = $(FOAM_APPBIN)/magneticFoam diff --git a/applications/solvers/electromagnetics/magneticFoam/Make/options b/applications/solvers/electromagnetics/magneticFoam/Make/options new file mode 100644 index 0000000000..725122ea1d --- /dev/null +++ b/applications/solvers/electromagnetics/magneticFoam/Make/options @@ -0,0 +1,4 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude + +EXE_LIBS = -lfiniteVolume diff --git a/applications/solvers/electromagnetics/magneticFoam/createFields.H b/applications/solvers/electromagnetics/magneticFoam/createFields.H new file mode 100644 index 0000000000..1a5b7095a9 --- /dev/null +++ b/applications/solvers/electromagnetics/magneticFoam/createFields.H @@ -0,0 +1,81 @@ + Info<< "Reading field psi\n" << endl; + volScalarField psi + ( + IOobject + ( + "psi", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + Info<< "Reading transportProperties\n" << endl; + + IOdictionary transportProperties + ( + IOobject + ( + "transportProperties", + runTime.constant(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ); + + List magnets(transportProperties.lookup("magnets")); + + surfaceScalarField murf + ( + IOobject + ( + "murf", + runTime.timeName(), + mesh + ), + mesh, + 1 + ); + + surfaceScalarField Mrf + ( + IOobject + ( + "Mrf", + runTime.timeName(), + mesh + ), + mesh, + dimensionedScalar("Mr", dimensionSet(0, 1, 0, 0, 0, 1, 0), 0) + ); + + forAll(magnets, i) + { + label magnetZonei = mesh.faceZones().findZoneID(magnets[i].name()); + + if (magnetZonei == -1) + { + FatalIOErrorIn(args.executable().c_str(), transportProperties) + << "Cannot find faceZone for magnet " << magnets[i].name() + << exit(FatalIOError); + } + + const labelList& faces = + mesh.faceZones()[magnetZonei]; + + const scalar muri = magnets[i].mur(); + const scalar Mri = magnets[i].Mr().value(); + const vector& orientationi = magnets[i].orientation(); + + const surfaceVectorField& Sf = mesh.Sf(); + + forAll(faces, i) + { + label facei = faces[i]; + murf[facei] = muri; + Mrf[facei] = Mri*(orientationi & Sf[facei]); + } + } diff --git a/applications/solvers/electromagnetics/magneticFoam/magnet.H b/applications/solvers/electromagnetics/magneticFoam/magnet.H new file mode 100644 index 0000000000..765d513a74 --- /dev/null +++ b/applications/solvers/electromagnetics/magneticFoam/magnet.H @@ -0,0 +1,169 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 . + +Class + Foam::magnet + +Description + Class to hold the defining data for a permanent magnet, in particular + the name, relative permeability and remanence. + +SourceFiles + +\*---------------------------------------------------------------------------*/ + +#ifndef magnet_H +#define magnet_H + +#include "dimensionedVector.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of classes +class Istream; +class Ostream; + +// Forward declaration of friend functions and operators +class magnet; +Istream& operator>>(Istream&, magnet&); +Ostream& operator<<(Ostream&, const magnet&); + +/*---------------------------------------------------------------------------*\ + Class magnet Declaration +\*---------------------------------------------------------------------------*/ + +class magnet +{ + // Private data + + word name_; + scalar relativePermeability_; + dimensionedScalar remanence_; + vector orientation_; + +public: + + // Constructors + + //- Null constructor for lists + inline magnet() + : + remanence_("Mr", dimensionSet(0, -1, 0, 0, 0, 1, 0), 0), + orientation_(vector::zero) + {} + + //- Construct from components + inline magnet + ( + const word& name, + const scalar mur, + const scalar Mr, + const vector& orientation + ) + : + name_(name), + relativePermeability_(mur), + remanence_("Mr", dimensionSet(0, -1, 0, 0, 0, 1, 0), Mr), + orientation_(orientation) + {} + + //- Construct from Istream + inline magnet(Istream& is) + : + remanence_("Mr", dimensionSet(0, -1, 0, 0, 0, 1, 0), 0), + orientation_(vector::zero) + { + is >> *this; + } + + + // Member Functions + + //- Return name + inline const word& name() const + { + return name_; + } + + //- Return relative permeability + inline scalar mur() const + { + return relativePermeability_; + } + + //- Return remenance + inline const dimensionedScalar& Mr() const + { + return remanence_; + } + + //- Return orientation + inline const vector& orientation() const + { + return orientation_; + } + + + // IOstream operators + + inline friend Istream& operator>>(Istream& is, magnet& m) + { + is.readBegin("magnet"); + is >> m.name_ + >> m.relativePermeability_ + >> m.remanence_.value() + >> m.orientation_; + is.readEnd("magnet"); + + // Check state of Istream + is.check("operator>>(Istream&, magnet&)"); + + return is; + } + + inline friend Ostream& operator<<(Ostream& os, const magnet& m) + { + os << token::BEGIN_LIST + << m.name_ << token::SPACE + << m.relativePermeability_ << token::SPACE + << m.remanence_.value() + << m.orientation_ + << token::END_LIST; + + return os; + } +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/electromagnetics/magneticFoam/magneticFoam.C b/applications/solvers/electromagnetics/magneticFoam/magneticFoam.C new file mode 100644 index 0000000000..151d17a398 --- /dev/null +++ b/applications/solvers/electromagnetics/magneticFoam/magneticFoam.C @@ -0,0 +1,153 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 . + +Application + magneticFoam + +Description + Solver for the magnetic field generated by permanent magnets. + + A Poisson's equation for the magnetic scalar potential psi is solved + from which the magnetic field intensity H and magnetic flux density B + are obtained. The paramagnetic particle force field (H dot grad(H)) + is optionally available. + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "OSspecific.H" +#include "magnet.H" +#include "electromagneticConstants.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + argList::addBoolOption + ( + "noH", + "do not write the magnetic field intensity field" + ); + + argList::addBoolOption + ( + "noB", + "do not write the magnetic flux density field" + ); + + argList::addBoolOption + ( + "HdotGradH", + "write the paramagnetic particle force field" + ); + + #include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + #include "createFields.H" + #include "readSIMPLEControls.H" + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + Info<< "Calculating the magnetic field potential" << endl; + + runTime++; + + for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + { + solve(fvm::laplacian(murf, psi) + fvc::div(murf*Mrf)); + } + + psi.write(); + + if (!args.optionFound("noH") || args.optionFound("HdotGradH")) + { + volVectorField H + ( + IOobject + ( + "H", + runTime.timeName(), + mesh + ), + fvc::reconstruct(fvc::snGrad(psi)*mesh.magSf()) + ); + + if (!args.optionFound("noH")) + { + Info<< nl + << "Creating field H for time " + << runTime.timeName() << endl; + + H.write(); + } + + if (args.optionFound("HdotGradH")) + { + Info<< nl + << "Creating field HdotGradH for time " + << runTime.timeName() << endl; + + volVectorField HdotGradH + ( + IOobject + ( + "HdotGradH", + runTime.timeName(), + mesh + ), + H & fvc::grad(H) + ); + + HdotGradH.write(); + } + } + + if (!args.optionFound("noB")) + { + Info<< nl + << "Creating field B for time " + << runTime.timeName() << endl; + + volVectorField B + ( + IOobject + ( + "B", + runTime.timeName(), + mesh + ), + constant::electromagnetic::mu0 + *fvc::reconstruct(murf*fvc::snGrad(psi)*mesh.magSf() + murf*Mrf) + ); + + B.write(); + } + + Info<< "\nEnd\n" << endl; + + return 0; +} + + +// ************************************************************************* // diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C index 1a5f871d96..50d8cde2fd 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C @@ -169,6 +169,21 @@ void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs() gradient() = q_/K(); fixedGradientFvPatchScalarField::updateCoeffs(); + + if (debug) + { + scalar Q = gSum(K()*patch().magSf()*snGrad()); + + Info<< patch().boundaryMesh().mesh().name() << ':' + << patch().name() << ':' + << this->dimensionedInternalField().name() << " :" + << " heatFlux:" << Q + << " walltemperature " + << " min:" << gMin(*this) + << " max:" << gMax(*this) + << " avg:" << gAverage(*this) + << endl; + } } diff --git a/applications/solvers/lagrangian/coalChemistryFoam/createFields.H b/applications/solvers/lagrangian/coalChemistryFoam/createFields.H index 65be09775c..ea325dabe0 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/createFields.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/createFields.H @@ -11,7 +11,7 @@ basicMultiComponentMixture& composition = thermo.composition(); PtrList& Y = composition.Y(); - word inertSpecie(thermo.lookup("inertSpecie")); + const word inertSpecie(thermo.lookup("inertSpecie")); if (!composition.contains(inertSpecie)) { diff --git a/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelFoam/Make/files b/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelFoam/Make/files new file mode 100644 index 0000000000..7a27f008c8 --- /dev/null +++ b/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelFoam/Make/files @@ -0,0 +1,3 @@ +incompressibleUncoupledKinematicParcelFoam.C + +EXE = $(FOAM_APPBIN)/incompressibleUncoupledKinematicParcelFoam diff --git a/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelFoam/Make/options b/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelFoam/Make/options new file mode 100644 index 0000000000..1ad3529232 --- /dev/null +++ b/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelFoam/Make/options @@ -0,0 +1,27 @@ +EXE_INC = \ + -I$(LIB_SRC)/lagrangian/basic/lnInclude \ + -I$(LIB_SRC)/lagrangian/intermediate/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ + -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \ + -I$(LIB_SRC)/transportModels \ + -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/surfaceFilmModels/lnInclude + +EXE_LIBS = \ + -llagrangian \ + -llagrangianIntermediate \ + -lthermophysicalFunctions \ + -lbasicThermophysicalModels \ + -lspecie \ + -lradiation \ + -lincompressibleRASModels \ + -lincompressibleLESModels \ + -lincompressibleTransportModels \ + -lfiniteVolume \ + -lmeshTools \ + -lsurfaceFilmModels diff --git a/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelFoam/createFields.H b/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelFoam/createFields.H new file mode 100644 index 0000000000..d98e9369b8 --- /dev/null +++ b/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelFoam/createFields.H @@ -0,0 +1,147 @@ + Info<< "Reading transportProperties\n" << endl; + + IOdictionary transportProperties + ( + IOobject + ( + "transportProperties", + runTime.constant(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ); + + dimensionedScalar rhoInfValue + ( + transportProperties.lookup("rhoInf") + ); + + volScalarField rhoInf + ( + IOobject + ( + "rho", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + mesh, + rhoInfValue + ); + + Info<< "\nReading field U\n" << endl; + volVectorField U + ( + IOobject + ( + "U", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + #include "createPhi.H" + + Info<< "Creating turbulence model\n" << endl; + + singlePhaseTransportModel laminarTransport(U, phi); + + const volScalarField nu = laminarTransport.nu(); + + autoPtr turbulence + ( + incompressible::turbulenceModel::New(U, phi, laminarTransport) + ); + + volScalarField mu + ( + IOobject + ( + "mu", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + nu*rhoInfValue + ); + + word kinematicCloudName("kinematicCloud"); + args.optionReadIfPresent("cloudName", kinematicCloudName); + + Info<< "Constructing kinematicCloud " << kinematicCloudName << endl; + basicKinematicCloud kinematicCloud + ( + kinematicCloudName, + rhoInf, + U, + mu, + g + ); + + IOobject Hheader + ( + "H", + runTime.timeName(), + mesh, + IOobject::NO_READ + ); + + autoPtr HPtr_; + + if (Hheader.headerOk()) + { + Info<< "\nReading field H\n" << endl; + + HPtr_.reset + ( + new volVectorField + ( + IOobject + ( + "H", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ) + ); + } + + IOobject HdotGradHheader + ( + "HdotGradH", + runTime.timeName(), + mesh, + IOobject::NO_READ + ); + + autoPtr HdotGradHPtr_; + + if (HdotGradHheader.headerOk()) + { + Info<< "\nReading field HdotGradH\n" << endl; + + HdotGradHPtr_.reset + ( + new volVectorField + ( + IOobject + ( + "HdotGradH", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ) + ); + } diff --git a/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelFoam/incompressibleUncoupledKinematicParcelFoam.C b/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelFoam/incompressibleUncoupledKinematicParcelFoam.C new file mode 100644 index 0000000000..bc87b5118f --- /dev/null +++ b/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelFoam/incompressibleUncoupledKinematicParcelFoam.C @@ -0,0 +1,81 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Application + uncoupledKinematicParcelFoam + +Description + Transient solver for the passive transport of a single kinematic + particle could. + + Uses a pre-calculated velocity field to evolve the cloud. + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "singlePhaseTransportModel.H" +#include "turbulenceModel.H" +#include "basicKinematicCloud.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + argList::addOption("cloudName", "cloud name"); + + #include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + #include "readGravitationalAcceleration.H" + #include "createFields.H" + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + Info<< "\nStarting time loop\n" << endl; + + while (runTime.loop()) + { + Info<< "Time = " << runTime.timeName() << nl << endl; + + Info<< "Evolving " << kinematicCloud.name() << endl; + + laminarTransport.correct(); + + mu = nu*rhoInfValue; + + kinematicCloud.evolve(); + + runTime.write(); + + Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" + << " ClockTime = " << runTime.elapsedClockTime() << " s" + << nl << endl; + } + + Info<< "End\n" << endl; + + return 0; +} + + +// ************************************************************************* // diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createFields.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createFields.H index cf3f484bdb..3ad06c22b3 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createFields.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createFields.H @@ -11,7 +11,7 @@ basicMultiComponentMixture& composition = thermo.composition(); PtrList& Y = composition.Y(); - word inertSpecie(thermo.lookup("inertSpecie")); + const word inertSpecie(thermo.lookup("inertSpecie")); if (!composition.contains(inertSpecie)) { diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/createFields.H b/applications/solvers/lagrangian/reactingParcelFilmFoam/createFields.H index 9c196e2905..8048acd648 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/createFields.H +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/createFields.H @@ -11,7 +11,7 @@ basicMultiComponentMixture& composition = thermo.composition(); PtrList& Y = composition.Y(); - word inertSpecie(thermo.lookup("inertSpecie")); + const word inertSpecie(thermo.lookup("inertSpecie")); volScalarField& p = thermo.p(); volScalarField& hs = thermo.hs(); diff --git a/applications/solvers/lagrangian/reactingParcelFoam/createFields.H b/applications/solvers/lagrangian/reactingParcelFoam/createFields.H index e071ac8b3d..0fd631fb7f 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/createFields.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/createFields.H @@ -11,7 +11,7 @@ basicMultiComponentMixture& composition = thermo.composition(); PtrList& Y = composition.Y(); - word inertSpecie(thermo.lookup("inertSpecie")); + const word inertSpecie(thermo.lookup("inertSpecie")); if (!composition.contains(inertSpecie)) { diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/Make/files b/applications/solvers/multiphase/interPhaseChangeFoam/Make/files index 5f65a3a4c2..5a7f01e980 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/Make/files +++ b/applications/solvers/multiphase/interPhaseChangeFoam/Make/files @@ -1,6 +1,6 @@ interPhaseChangeFoam.C phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.C -phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C +phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixtureNew.C phaseChangeTwoPhaseMixtures/Kunz/Kunz.C phaseChangeTwoPhaseMixtures/Merkle/Merkle.C phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.H b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.H index 0aa466b06e..5c345db148 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.H @@ -28,7 +28,7 @@ Description SourceFiles phaseChangeTwoPhaseMixture.C - newPhaseChangeModel.C + phaseChangeModelNew.C \*---------------------------------------------------------------------------*/ diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixtureNew.C similarity index 74% rename from applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C rename to applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixtureNew.C index c45a772e4a..bffffd6aae 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixtureNew.C @@ -36,30 +36,27 @@ Foam::phaseChangeTwoPhaseMixture::New const word& alpha1Name ) { - IOdictionary transportPropertiesDict + // get model name, but do not register the dictionary + const word mixtureType ( - IOobject + IOdictionary ( - "transportProperties", - U.time().constant(), - U.db(), - IOobject::MUST_READ, - IOobject::NO_WRITE, - false - ) + IOobject + ( + "transportProperties", + U.time().constant(), + U.db(), + IOobject::MUST_READ, + IOobject::NO_WRITE, + false + ) + ).lookup("phaseChangeTwoPhaseMixture") ); - word phaseChangeTwoPhaseMixtureTypeName - ( - transportPropertiesDict.lookup("phaseChangeTwoPhaseMixture") - ); - - Info<< "Selecting phaseChange model " - << phaseChangeTwoPhaseMixtureTypeName << endl; + Info<< "Selecting phaseChange model " << mixtureType << endl; componentsConstructorTable::iterator cstrIter = - componentsConstructorTablePtr_ - ->find(phaseChangeTwoPhaseMixtureTypeName); + componentsConstructorTablePtr_->find(mixtureType); if (cstrIter == componentsConstructorTablePtr_->end()) { @@ -67,8 +64,8 @@ Foam::phaseChangeTwoPhaseMixture::New ( "phaseChangeTwoPhaseMixture::New" ) << "Unknown phaseChangeTwoPhaseMixture type " - << phaseChangeTwoPhaseMixtureTypeName << endl << endl - << "Valid phaseChangeTwoPhaseMixtures are : " << endl + << mixtureType << nl << nl + << "Valid phaseChangeTwoPhaseMixture types are : " << endl << componentsConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.C index 990db1cda3..3cf76bab1b 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.C +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.C @@ -50,7 +50,7 @@ Istream& operator>> alphaContactAngleFvPatchScalarField::interfaceThetaProps& tp ) { - is >> tp.theta0_ >> tp.uTheta_ >> tp.thetaA_ >> tp.thetaR_; + is >> tp.theta0_ >> tp.uTheta_ >> tp.thetaA_ >> tp.thetaR_; return is; } diff --git a/applications/solvers/multiphase/settlingFoam/createFields.H b/applications/solvers/multiphase/settlingFoam/createFields.H index 6833c90ec9..c8e05c4209 100644 --- a/applications/solvers/multiphase/settlingFoam/createFields.H +++ b/applications/solvers/multiphase/settlingFoam/createFields.H @@ -159,7 +159,7 @@ Info<< "Selecting Drift-Flux model " << endl; - word VdjModel(transportProperties.lookup("VdjModel")); + const word VdjModel(transportProperties.lookup("VdjModel")); Info<< tab << VdjModel << " selected\n" << endl; diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/Make/files b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/Make/files index 8d23cb9550..cf4603e1f8 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/Make/files +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/Make/files @@ -1,5 +1,5 @@ dragModels/dragModel/dragModel.C -dragModels/dragModel/newDragModel.C +dragModels/dragModel/dragModelNew.C dragModels/Ergun/Ergun.C dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.C diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/dragModel.H b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/dragModel.H index 4dbcbe86e6..7e05bcb464 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/dragModel.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/dragModel.H @@ -28,7 +28,7 @@ Description SourceFiles dragModel.C - newDragModel.C + dragModelNew.C \*---------------------------------------------------------------------------*/ diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/dragModelNew.C similarity index 72% rename from applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C rename to applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/dragModelNew.C index 2f147a0dee..d916f84693 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/dragModelNew.C @@ -35,28 +35,24 @@ Foam::autoPtr Foam::dragModel::New const phaseModel& phaseb ) { - word dragModelType - ( - interfaceDict.lookup("dragModel" + phasea.name()) - ); + const word modelType(interfaceDict.lookup("dragModel" + phasea.name())); - Info<< "Selecting dragModel for phase " - << phasea.name() - << ": " - << dragModelType << endl; + Info<< "Selecting dragModel for phase " << phasea.name() + << ": " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(dragModelType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalError - << "dragModel::New : " << endl - << " unknown dragModelType type " - << dragModelType - << ", constructor not in hash table" << endl << endl - << " Valid dragModel types are : " << endl; - Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); + FatalErrorIn + ( + "dragModel::New(...)" + ) << "Unknown dragModel type " + << modelType << nl << nl + << "Valid dragModel types are : " << endl + << dictionaryConstructorTablePtr_->sortedToc() + << abort(FatalError); } return cstrIter()(interfaceDict, alpha, phasea, phaseb); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/Make/files b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/Make/files index a6ff2ca0f0..43c2f6df9d 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/Make/files +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/Make/files @@ -1,32 +1,32 @@ kineticTheoryModel/kineticTheoryModel.C viscosityModel/viscosityModel/viscosityModel.C -viscosityModel/viscosityModel/newViscosityModel.C +viscosityModel/viscosityModel/viscosityModelNew.C viscosityModel/Gidaspow/GidaspowViscosity.C viscosityModel/Syamlal/SyamlalViscosity.C viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C viscosityModel/none/noneViscosity.C conductivityModel/conductivityModel/conductivityModel.C -conductivityModel/conductivityModel/newConductivityModel.C +conductivityModel/conductivityModel/conductivityModelNew.C conductivityModel/Gidaspow/GidaspowConductivity.C conductivityModel/Syamlal/SyamlalConductivity.C conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C radialModel/radialModel/radialModel.C -radialModel/radialModel/newRadialModel.C +radialModel/radialModel/radialModelNew.C radialModel/CarnahanStarling/CarnahanStarlingRadial.C radialModel/Gidaspow/GidaspowRadial.C radialModel/LunSavage/LunSavageRadial.C radialModel/SinclairJackson/SinclairJacksonRadial.C granularPressureModel/granularPressureModel/granularPressureModel.C -granularPressureModel/granularPressureModel/newGranularPressureModel.C +granularPressureModel/granularPressureModel/granularPressureModelNew.C granularPressureModel/Lun/LunPressure.C granularPressureModel/SyamlalRogersOBrien/SyamlalRogersOBrienPressure.C frictionalStressModel/frictionalStressModel/frictionalStressModel.C -frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C +frictionalStressModel/frictionalStressModel/frictionalStressModelNew.C frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModelNew.C similarity index 72% rename from applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C rename to applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModelNew.C index 74b2a1fbcc..8b29862356 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModelNew.C @@ -32,23 +32,23 @@ Foam::autoPtr Foam::conductivityModel::New const dictionary& dict ) { - word conductivityModelType(dict.lookup("conductivityModel")); + const word modelType(dict.lookup("conductivityModel")); - Info<< "Selecting conductivityModel " - << conductivityModelType << endl; + Info<< "Selecting conductivityModel " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(conductivityModelType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalError - << "conductivityModel::New(const dictionary&) : " << endl - << " unknown conductivityModelType type " - << conductivityModelType - << ", constructor not in hash table" << endl << endl - << " Valid conductivityModelType types are :" << endl; - Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); + FatalErrorIn + ( + "conductivityModel::New(const dictionary&)" + ) << "Unknown conductivityModel type " + << modelType << nl << nl + << "Valid conductivityModel types are :" << endl + << dictionaryConstructorTablePtr_->sortedToc() + << abort(FatalError); } return autoPtr(cstrIter()(dict)); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModelNew.C similarity index 71% rename from applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C rename to applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModelNew.C index 391737f16b..447298e219 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModelNew.C @@ -32,23 +32,24 @@ Foam::autoPtr Foam::frictionalStressModel::New const dictionary& dict ) { - word frictionalStressModelType(dict.lookup("frictionalStressModel")); + const word modelType(dict.lookup("frictionalStressModel")); - Info<< "Selecting frictionalStressModel " - << frictionalStressModelType << endl; + Info<< "Selecting frictionalStressModel " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(frictionalStressModelType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalError - << "frictionalStressModel::New(const dictionary&) : " << endl - << " unknown frictionalStressModelType type " - << frictionalStressModelType - << ", constructor not in hash table" << endl << endl - << " Valid frictionalStressModelType types are :" << endl; - Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); + FatalErrorIn + ( + "frictionalStressModel::New(const dictionary&)" + ) + << "Unknown frictionalStressModel type " + << modelType << nl << nl + << "Valid frictionalStressModel types are :" << endl + << dictionaryConstructorTablePtr_->sortedToc() + << abort(FatalError); } return autoPtr(cstrIter()(dict)); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModelNew.C similarity index 71% rename from applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C rename to applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModelNew.C index f9697eca51..682ce1781a 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModelNew.C @@ -32,23 +32,23 @@ Foam::autoPtr Foam::granularPressureModel::New const dictionary& dict ) { - word granularPressureModelType(dict.lookup("granularPressureModel")); + const word modelType(dict.lookup("granularPressureModel")); - Info<< "Selecting granularPressureModel " - << granularPressureModelType << endl; + Info<< "Selecting granularPressureModel " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(granularPressureModelType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalError - << "granularPressureModel::New(const dictionary&) : " << endl - << " unknown granularPressureModelType type " - << granularPressureModelType - << ", constructor not in hash table" << endl << endl - << " Valid granularPressureModelType types are :" << endl; - Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); + FatalErrorIn + ( + "granularPressureModel::New(const dictionary&)" + ) << "Unknown granularPressureModel type " + << modelType << nl << nl + << "Valid granularPressureModel types are :" << endl + << dictionaryConstructorTablePtr_->sortedToc() + << abort(FatalError); } return autoPtr(cstrIter()(dict)); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/radialModel/newRadialModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/radialModel/radialModelNew.C similarity index 74% rename from applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/radialModel/newRadialModel.C rename to applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/radialModel/radialModelNew.C index f2a46d79c4..14bd1a52e8 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/radialModel/newRadialModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/radialModel/radialModelNew.C @@ -32,23 +32,24 @@ Foam::autoPtr Foam::radialModel::New const dictionary& dict ) { - word radialModelType(dict.lookup("radialModel")); + const word modelType(dict.lookup("radialModel")); - Info<< "Selecting radialModel " - << radialModelType << endl; + Info<< "Selecting radialModel " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(radialModelType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalError - << "radialModel::New(const dictionary&) : " << endl - << " unknown radialModelType type " - << radialModelType - << ", constructor not in hash table" << endl << endl - << " Valid radialModelType types are :" << endl; - Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); + FatalErrorIn + ( + "radialModel::New(const dictionary&)" + ) + << "Unknown radialModel type " + << modelType << nl << nl + << "Valid radialModel types are :" << endl + << dictionaryConstructorTablePtr_->sortedToc() + << abort(FatalError); } return autoPtr(cstrIter()(dict)); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModelNew.C similarity index 73% rename from applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C rename to applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModelNew.C index 8998c45053..35b9684509 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModelNew.C @@ -33,23 +33,23 @@ Foam::kineticTheoryModels::viscosityModel::New const dictionary& dict ) { - word viscosityModelType(dict.lookup("viscosityModel")); + const word modelType(dict.lookup("viscosityModel")); - Info<< "Selecting viscosityModel " - << viscosityModelType << endl; + Info<< "Selecting viscosityModel " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(viscosityModelType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalError - << "viscosityModel::New(const dictionary&) : " << endl - << " unknown viscosityModelType type " - << viscosityModelType - << ", constructor not in hash table" << endl << endl - << " Valid viscosityModelType types are :" << endl; - Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); + FatalErrorIn + ( + "viscosityModel::New(const dictionary&)" + ) << "Unknown viscosityModel type " + << modelType << nl << nl + << "Valid viscosityModel types are :" << endl + << dictionaryConstructorTablePtr_->sortedToc() + << abort(FatalError); } return autoPtr(cstrIter()(dict)); diff --git a/applications/test/Dictionary/DictionaryTest.C b/applications/test/Dictionary/DictionaryTest.C index 2844489f72..db4bc1ce75 100644 --- a/applications/test/Dictionary/DictionaryTest.C +++ b/applications/test/Dictionary/DictionaryTest.C @@ -59,7 +59,7 @@ public: friend Ostream& operator<<(Ostream& os, const ent& e) { - os << e.keyword_ << ' ' << e.i_ << endl; + os << e.keyword_ << ' ' << e.i_ << endl; return os; } }; @@ -88,7 +88,7 @@ public: friend Ostream& operator<<(Ostream& os, const Scalar& val) { - os << val.data_; + os << val.data_; return os; } }; diff --git a/applications/test/Field/testField.H b/applications/test/Field/testField.H index d43452fea7..530b662525 100644 --- a/applications/test/Field/testField.H +++ b/applications/test/Field/testField.H @@ -38,7 +38,7 @@ public: friend std::ostream& operator<<(std::ostream& os, const Vector& v) { - os << v.X << '\t' << v.Y << '\n'; + os << v.X << '\t' << v.Y << '\n'; return os; } }; diff --git a/applications/test/HashTable/hashTableTest.C b/applications/test/HashTable/hashTableTest.C index a109f1d911..0cbd4ded85 100644 --- a/applications/test/HashTable/hashTableTest.C +++ b/applications/test/HashTable/hashTableTest.C @@ -89,7 +89,7 @@ int main() { OStringStream os; - os << table1; + os << table1; HASHTABLE_CLASS readTable(IStringStream(os.str())(), 100); Info<< "Istream constructor:" << readTable << endl; diff --git a/applications/test/ISLList/ISLListTest.C b/applications/test/ISLList/ISLListTest.C index 1991aa4f24..7ebff5dbc0 100644 --- a/applications/test/ISLList/ISLListTest.C +++ b/applications/test/ISLList/ISLListTest.C @@ -54,7 +54,7 @@ public: friend Ostream& operator<<(Ostream& os, const Scalar& s) { - os << s.data_; + os << s.data_; return os; } diff --git a/applications/test/PtrList/PtrListTest.C b/applications/test/PtrList/PtrListTest.C index ffcde48b96..d17f56885a 100644 --- a/applications/test/PtrList/PtrListTest.C +++ b/applications/test/PtrList/PtrListTest.C @@ -60,7 +60,7 @@ public: friend Ostream& operator<<(Ostream& os, const Scalar& val) { - os << val.data_; + os << val.data_; return os; } }; diff --git a/applications/test/StaticHashTable/staticHashTableTest.C b/applications/test/StaticHashTable/staticHashTableTest.C index 77a456f2ba..d51bf1f5d2 100644 --- a/applications/test/StaticHashTable/staticHashTableTest.C +++ b/applications/test/StaticHashTable/staticHashTableTest.C @@ -83,7 +83,7 @@ int main() { OStringStream os; - os << table1; + os << table1; HASHTABLE_CLASS readTable(IStringStream(os.str())(), 100); Info<< "Istream constructor:" << readTable << endl; diff --git a/applications/test/UDictionary/UDictionaryTest.C b/applications/test/UDictionary/UDictionaryTest.C index 57fc55c0b3..e884bcddd8 100644 --- a/applications/test/UDictionary/UDictionaryTest.C +++ b/applications/test/UDictionary/UDictionaryTest.C @@ -56,7 +56,7 @@ public: friend Ostream& operator<<(Ostream& os, const ent& e) { - os << e.keyword_ << ' ' << e.i_ << endl; + os << e.keyword_ << ' ' << e.i_ << endl; return os; } }; diff --git a/applications/test/globalIndex/Make/files b/applications/test/globalIndex/Make/files index 6d7dd88f14..cb25b3090f 100644 --- a/applications/test/globalIndex/Make/files +++ b/applications/test/globalIndex/Make/files @@ -1,4 +1,3 @@ -globalIndex.C globalIndexTest.C EXE = $(FOAM_USER_APPBIN)/globalIndexTest diff --git a/applications/test/nearWallDist-wave/testWallDist2.C b/applications/test/nearWallDist-wave/testWallDist2.C index e5d528e7d3..49322a558d 100644 --- a/applications/test/nearWallDist-wave/testWallDist2.C +++ b/applications/test/nearWallDist-wave/testWallDist2.C @@ -108,13 +108,17 @@ int main(int argc, char *argv[]) } } + List allFaceInfo(mesh.nFaces()); + List allCellInfo(mesh.nCells()); - MeshWave wallDistCalc + FaceCellWave wallDistCalc ( mesh, changedFaces, faceDist, - 0 // max iterations + allFaceInfo, + allCellInfo, + 0 // max iterations ); Info<< "\nStarting time loop\n" << endl; @@ -148,16 +152,13 @@ int main(int argc, char *argv[]) // Copy face and cell values into field // - const List& cellInfo = wallDistCalc.allCellInfo(); - const List& faceInfo = wallDistCalc.allFaceInfo(); - label nIllegal = 0; // Copy cell values - forAll(cellInfo, cellI) + forAll(allCellInfo, cellI) { - scalar dist = cellInfo[cellI].distSqr(); - if (cellInfo[cellI].valid()) + scalar dist = allCellInfo[cellI].distSqr(); + if (allCellInfo[cellI].valid()) { wallDistUncorrected[cellI] = Foam::sqrt(dist); } @@ -176,11 +177,10 @@ int main(int argc, char *argv[]) forAll(patchField, patchFaceI) { - label meshFaceI = - patchField.patch().patch().start() + patchFaceI; + const label meshFaceI = patchField.patch().start() + patchFaceI; - scalar dist = faceInfo[meshFaceI].distSqr(); - if (faceInfo[meshFaceI].valid()) + scalar dist = allFaceInfo[meshFaceI].distSqr(); + if (allFaceInfo[meshFaceI].valid()) { patchField[patchFaceI] = Foam::sqrt(dist); } diff --git a/applications/test/primitivePatch/testPrimitivePatch.C b/applications/test/primitivePatch/testPrimitivePatch.C index 37fd7b32eb..e2336530e6 100644 --- a/applications/test/primitivePatch/testPrimitivePatch.C +++ b/applications/test/primitivePatch/testPrimitivePatch.C @@ -47,8 +47,7 @@ void writeObj(Ostream& os,const pointField& points) { const point& pt = points[pointI]; - os << "v " << pt.x() << ' ' << pt.y() - << ' ' << pt.z() << endl; + os << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << endl; } } diff --git a/applications/test/sha1/testSHA1.C b/applications/test/sha1/testSHA1.C index 45fd3814b8..c3e3685108 100644 --- a/applications/test/sha1/testSHA1.C +++ b/applications/test/sha1/testSHA1.C @@ -92,14 +92,14 @@ int main(int argc, char * argv[]) { OSHA1stream os; - os << str; + os << str; Info<< os.digest() << endl; - os << str; + os << str; Info<< os.digest() << endl; os.rewind(); - os << "The quick brown fox jumps over the lazy dog"; + os << "The quick brown fox jumps over the lazy dog"; Info<< os.digest() << endl; } diff --git a/applications/utilities/mesh/conversion/cfx4ToFoam/block.C b/applications/utilities/mesh/conversion/cfx4ToFoam/block.C index 906ebac9ec..e61b80ce08 100644 --- a/applications/utilities/mesh/conversion/cfx4ToFoam/block.C +++ b/applications/utilities/mesh/conversion/cfx4ToFoam/block.C @@ -110,9 +110,9 @@ const labelListListList& block::boundaryPatches() const Ostream& operator<<(Ostream& os, const block& b) { - os << b.Vertices << nl - << b.Cells << nl - << b.BoundaryPatches << endl; + os << b.Vertices << nl + << b.Cells << nl + << b.BoundaryPatches << endl; return os; } diff --git a/applications/utilities/mesh/conversion/cfx4ToFoam/hexBlock.C b/applications/utilities/mesh/conversion/cfx4ToFoam/hexBlock.C index e4dc4d82c5..2bdc448ed4 100644 --- a/applications/utilities/mesh/conversion/cfx4ToFoam/hexBlock.C +++ b/applications/utilities/mesh/conversion/cfx4ToFoam/hexBlock.C @@ -57,7 +57,7 @@ void hexBlock::readPoints(Istream& is) { forAll(points_, i) { - is >> points_[i].x() >> points_[i].y() >> points_[i].z(); + is >> points_[i].x() >> points_[i].y() >> points_[i].z(); } // Calculate the handedness of the block diff --git a/applications/utilities/mesh/conversion/plot3dToFoam/hexBlock.C b/applications/utilities/mesh/conversion/plot3dToFoam/hexBlock.C index 74543ed4c1..e7ab90647a 100644 --- a/applications/utilities/mesh/conversion/plot3dToFoam/hexBlock.C +++ b/applications/utilities/mesh/conversion/plot3dToFoam/hexBlock.C @@ -128,13 +128,13 @@ void hexBlock::readPoints Info<< "Reading " << nPoints << " x coordinates..." << endl; for (label i=0; i < nPoints; i++) { - is >> points_[i].x(); + is >> points_[i].x(); } Info<< "Reading " << nPoints << " y coordinates..." << endl; for (label i=0; i < nPoints; i++) { - is >> points_[i].y(); + is >> points_[i].y(); } if (twoDThicknes > 0) @@ -156,7 +156,7 @@ void hexBlock::readPoints Info<< "Reading " << nPoints << " z coordinates..." << endl; for (label i=0; i < nPoints; i++) { - is >> points_[i].z(); + is >> points_[i].z(); } } @@ -166,7 +166,7 @@ void hexBlock::readPoints Info<< "Reading " << nPoints << " blanks..." << endl; for (label i=0; i < nPoints; i++) { - is >> iBlank; + is >> iBlank; } } diff --git a/applications/utilities/mesh/conversion/star3ToFoam/createBoundaryFaces.C b/applications/utilities/mesh/conversion/star3ToFoam/createBoundaryFaces.C index 5f6c995929..341b2b8e26 100644 --- a/applications/utilities/mesh/conversion/star3ToFoam/createBoundaryFaces.C +++ b/applications/utilities/mesh/conversion/star3ToFoam/createBoundaryFaces.C @@ -166,7 +166,9 @@ void starMesh::markBoundaryFaces() } } - FatalError << " $ bset,add,vset,all" << abort(FatalError); + FatalError + << " $ bset,add,vset,all" + << abort(FatalError); } } } diff --git a/applications/utilities/mesh/conversion/writeMeshObj/writeMeshObj.C b/applications/utilities/mesh/conversion/writeMeshObj/writeMeshObj.C index d0e067a070..2d37090daa 100644 --- a/applications/utilities/mesh/conversion/writeMeshObj/writeMeshObj.C +++ b/applications/utilities/mesh/conversion/writeMeshObj/writeMeshObj.C @@ -51,7 +51,7 @@ using namespace Foam; void writeOBJ(const point& pt, Ostream& os) { - os << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << nl; + os << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << nl; } // All edges of mesh diff --git a/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/Make/files b/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/Make/files index 91b2eccf28..fdd7c3e7b7 100644 --- a/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/Make/files +++ b/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/Make/files @@ -1,5 +1,5 @@ extrudeModel/extrudeModel.C -extrudeModel/newExtrudeModel.C +extrudeModel/extrudeModelNew.C linearNormal/linearNormal.C linearDirection/linearDirection.C linearRadial/linearRadial.C diff --git a/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/extrudeModel/newExtrudeModel.C b/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/extrudeModel/extrudeModelNew.C similarity index 79% rename from applications/utilities/mesh/generation/extrudeMesh/extrudeModel/extrudeModel/newExtrudeModel.C rename to applications/utilities/mesh/generation/extrudeMesh/extrudeModel/extrudeModel/extrudeModelNew.C index e242e5fada..eed1abdb70 100644 --- a/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/extrudeModel/newExtrudeModel.C +++ b/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/extrudeModel/extrudeModelNew.C @@ -32,20 +32,21 @@ Foam::autoPtr Foam::extrudeModel::New const dictionary& dict ) { - word extrudeModelType(dict.lookup("extrudeModel")); + const word modelType(dict.lookup("extrudeModel")); - Info<< "Selecting extrudeModel " << extrudeModelType << endl; + Info<< "Selecting extrudeModel " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(extrudeModelType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalErrorIn("extrudeModel::New(const dictionary&)") - << "Unknown extrudeModelType type " - << extrudeModelType - << ", constructor not in hash table" << nl << nl - << " Valid extrudeModel types are :" << nl + FatalErrorIn + ( + "extrudeModel::New(const dictionary&)" + ) << "Unknown extrudeModel type " + << modelType << nl << nl + << "Valid extrudeModel types are :" << nl << dictionaryConstructorTablePtr_->sortedToc() << nl << exit(FatalError); } @@ -55,4 +56,3 @@ Foam::autoPtr Foam::extrudeModel::New // ************************************************************************* // - diff --git a/applications/utilities/mesh/generation/extrudeToRegionMesh/patchPointEdgeCirculator.C b/applications/utilities/mesh/generation/extrudeToRegionMesh/patchPointEdgeCirculator.C index b91f06fe3f..67db0ccbab 100644 --- a/applications/utilities/mesh/generation/extrudeToRegionMesh/patchPointEdgeCirculator.C +++ b/applications/utilities/mesh/generation/extrudeToRegionMesh/patchPointEdgeCirculator.C @@ -58,7 +58,7 @@ Foam::Ostream& Foam::operator<< if (faceI != -1) { - os<< " fc:" << c.patch_.localFaces()[faceI].centre(pts); + os << " fc:" << c.patch_.localFaces()[faceI].centre(pts); } return os; } diff --git a/applications/utilities/mesh/generation/extrudeToRegionMesh/patchPointEdgeCirculatorI.H b/applications/utilities/mesh/generation/extrudeToRegionMesh/patchPointEdgeCirculatorI.H index ae147cd102..78feb859a9 100644 --- a/applications/utilities/mesh/generation/extrudeToRegionMesh/patchPointEdgeCirculatorI.H +++ b/applications/utilities/mesh/generation/extrudeToRegionMesh/patchPointEdgeCirculatorI.H @@ -233,7 +233,7 @@ void Foam::patchPointEdgeCirculator::setCanonical() //- Step to next edge. -Foam::patchPointEdgeCirculator::patchPointEdgeCirculator& +Foam::patchPointEdgeCirculator& Foam::patchPointEdgeCirculator::operator++() { if (index_ == -1) diff --git a/applications/utilities/mesh/manipulation/cellSet/cellSet.C b/applications/utilities/mesh/manipulation/cellSet/cellSet.C index 276614687a..3eafef872b 100644 --- a/applications/utilities/mesh/manipulation/cellSet/cellSet.C +++ b/applications/utilities/mesh/manipulation/cellSet/cellSet.C @@ -59,9 +59,8 @@ int main(int argc, char *argv[]) ); - word setName(cellSetDict.lookup("name")); - - word actionName(cellSetDict.lookup("action")); + const word setName(cellSetDict.lookup("name")); + const word actionName(cellSetDict.lookup("action")); topoSetSource::setAction action = topoSetSource::toAction(actionName); diff --git a/applications/utilities/mesh/manipulation/faceSet/faceSet.C b/applications/utilities/mesh/manipulation/faceSet/faceSet.C index 63e7a68c66..7c97b95ef5 100644 --- a/applications/utilities/mesh/manipulation/faceSet/faceSet.C +++ b/applications/utilities/mesh/manipulation/faceSet/faceSet.C @@ -59,9 +59,8 @@ int main(int argc, char *argv[]) ); - word setName(faceSetDict.lookup("name")); - - word actionName(faceSetDict.lookup("action")); + const word setName(faceSetDict.lookup("name")); + const word actionName(faceSetDict.lookup("action")); topoSetSource::setAction action = topoSetSource::toAction(actionName); diff --git a/applications/utilities/mesh/manipulation/moveMesh/moveMesh.C b/applications/utilities/mesh/manipulation/moveMesh/moveMesh.C index 191cfef5eb..c975f36e66 100644 --- a/applications/utilities/mesh/manipulation/moveMesh/moveMesh.C +++ b/applications/utilities/mesh/manipulation/moveMesh/moveMesh.C @@ -43,7 +43,7 @@ int main(int argc, char *argv[]) # include "createTime.H" # include "createMesh.H" - autoPtr motionPtr = motionSolver::New(mesh); + autoPtr motionPtr = motionSolver::New(mesh); while (runTime.loop()) { diff --git a/applications/utilities/mesh/manipulation/objToVTK/objToVTK.C b/applications/utilities/mesh/manipulation/objToVTK/objToVTK.C index a9f3472ea1..2cb7ef6c5b 100644 --- a/applications/utilities/mesh/manipulation/objToVTK/objToVTK.C +++ b/applications/utilities/mesh/manipulation/objToVTK/objToVTK.C @@ -113,7 +113,7 @@ int main(int argc, char *argv[]) argList::validArgs.clear(); argList::validArgs.append("OBJ file"); argList::validArgs.append("output VTK file"); - argList::argList args(argc, argv); + argList args(argc, argv); const fileName objName = args[1]; const fileName outName = args[2]; diff --git a/applications/utilities/mesh/manipulation/pointSet/pointSet.C b/applications/utilities/mesh/manipulation/pointSet/pointSet.C index 79ed4fae71..8219ec41b6 100644 --- a/applications/utilities/mesh/manipulation/pointSet/pointSet.C +++ b/applications/utilities/mesh/manipulation/pointSet/pointSet.C @@ -59,9 +59,8 @@ int main(int argc, char *argv[]) ); - word setName(pointSetDict.lookup("name")); - - word actionName(pointSetDict.lookup("action")); + const word setName(pointSetDict.lookup("name")); + const word actionName(pointSetDict.lookup("action")); topoSetSource::setAction action = topoSetSource::toAction(actionName); diff --git a/applications/utilities/mesh/manipulation/refineMesh/refineMesh.C b/applications/utilities/mesh/manipulation/refineMesh/refineMesh.C index b3a8efdc79..783848d09b 100644 --- a/applications/utilities/mesh/manipulation/refineMesh/refineMesh.C +++ b/applications/utilities/mesh/manipulation/refineMesh/refineMesh.C @@ -331,7 +331,7 @@ int main(int argc, char *argv[]) ) ); - word setName(refineDict.lookup("set")); + const word setName(refineDict.lookup("set")); cellSet cells(mesh, setName); diff --git a/applications/utilities/mesh/manipulation/setSet/setSet.C b/applications/utilities/mesh/manipulation/setSet/setSet.C index 9750237161..d8c216c662 100644 --- a/applications/utilities/mesh/manipulation/setSet/setSet.C +++ b/applications/utilities/mesh/manipulation/setSet/setSet.C @@ -974,7 +974,7 @@ int main(int argc, char *argv[]) IStringStream is(rawLine + ' '); // Type: cellSet, faceSet, pointSet, faceZoneSet - is >> setType; + is >> setType; stat = parseType(runTime, mesh, setType, is); diff --git a/applications/utilities/mesh/manipulation/setSet/writeFuns.C b/applications/utilities/mesh/manipulation/setSet/writeFuns.C index e7a67bc09b..d347bcc7f4 100644 --- a/applications/utilities/mesh/manipulation/setSet/writeFuns.C +++ b/applications/utilities/mesh/manipulation/setSet/writeFuns.C @@ -85,20 +85,20 @@ void Foam::writeFuns::write fField.size()*sizeof(float) ); - os << std::endl; + os << std::endl; } else { forAll(fField, i) { - os << fField[i] << ' '; + os << fField[i] << ' '; if (i > 0 && (i % 10) == 0) { - os << std::endl; + os << std::endl; } } - os << std::endl; + os << std::endl; } } @@ -134,20 +134,20 @@ void Foam::writeFuns::write elems.size()*sizeof(label) ); - os << std::endl; + os << std::endl; } else { forAll(elems, i) { - os << elems[i] << ' '; + os << elems[i] << ' '; if (i > 0 && (i % 10) == 0) { - os << std::endl; + os << std::endl; } } - os << std::endl; + os << std::endl; } } diff --git a/applications/utilities/miscellaneous/foamFormatConvert/foamFormatConvert.C b/applications/utilities/miscellaneous/foamFormatConvert/foamFormatConvert.C index 12e04eb3e3..6a6e0cfce1 100644 --- a/applications/utilities/miscellaneous/foamFormatConvert/foamFormatConvert.C +++ b/applications/utilities/miscellaneous/foamFormatConvert/foamFormatConvert.C @@ -64,13 +64,13 @@ namespace Foam // Hack to do zones which have Lists in them. See above. -bool writeZones(const word& name, Time& runTime) +bool writeZones(const word& name, const fileName& meshDir, Time& runTime) { IOobject io ( name, runTime.timeName(), - polyMesh::meshSubDir, + meshDir, runTime, IOobject::MUST_READ, IOobject::NO_WRITE, @@ -144,8 +144,20 @@ bool writeZones(const word& name, Time& runTime) int main(int argc, char *argv[]) { timeSelector::addOptions(); +# include "addRegionOption.H" # include "setRootCase.H" # include "createTime.H" + + fileName meshDir = polyMesh::meshSubDir; + fileName regionPrefix = ""; + word regionName = polyMesh::defaultRegion; + if (args.optionReadIfPresent("region", regionName)) + { + Info<< "Using region " << regionName << nl << endl; + regionPrefix = regionName; + meshDir = regionName/polyMesh::meshSubDir; + } + Foam::instantList timeDirs = Foam::timeSelector::select0(runTime, args); forAll(timeDirs, timeI) @@ -154,27 +166,32 @@ int main(int argc, char *argv[]) Info<< "Time = " << runTime.timeName() << endl; // Convert all the standard mesh files - writeMeshObject("cells", runTime); - writeMeshObject("owner", runTime); - writeMeshObject("neighbour", runTime); - writeMeshObject("faces", runTime); - writeMeshObject("points", runTime); - writeMeshObject("pointProcAddressing", runTime); - writeMeshObject("faceProcAddressing", runTime); - writeMeshObject("cellProcAddressing", runTime); - writeMeshObject("boundaryProcAddressing", runTime); + writeMeshObject("cells", meshDir, runTime); + writeMeshObject("owner", meshDir, runTime); + writeMeshObject("neighbour", meshDir, runTime); + writeMeshObject("faces", meshDir, runTime); + writeMeshObject("points", meshDir, runTime); + writeMeshObject("pointProcAddressing", meshDir, runTime); + writeMeshObject("faceProcAddressing", meshDir, runTime); + writeMeshObject("cellProcAddressing", meshDir, runTime); + writeMeshObject + ( + "boundaryProcAddressing", + meshDir, + runTime + ); if (runTime.writeFormat() == IOstream::ASCII) { // Only do zones when converting from binary to ascii // The other way gives problems since working on dictionary level. - writeZones("cellZones", runTime); - writeZones("faceZones", runTime); - writeZones("pointZones", runTime); + writeZones("cellZones", meshDir, runTime); + writeZones("faceZones", meshDir, runTime); + writeZones("pointZones", meshDir, runTime); } // Get list of objects from the database - IOobjectList objects(runTime, runTime.timeName()); + IOobjectList objects(runTime, runTime.timeName(), regionPrefix); forAllConstIter(IOobjectList, objects, iter) { diff --git a/applications/utilities/miscellaneous/foamFormatConvert/writeMeshObject.H b/applications/utilities/miscellaneous/foamFormatConvert/writeMeshObject.H index 390c76ca03..717f5f4c02 100644 --- a/applications/utilities/miscellaneous/foamFormatConvert/writeMeshObject.H +++ b/applications/utilities/miscellaneous/foamFormatConvert/writeMeshObject.H @@ -40,13 +40,18 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // template -inline bool writeMeshObject(const word& name, Time& runTime) +inline bool writeMeshObject +( + const word& name, + const fileName& meshDir, + Time& runTime +) { IOobject io ( name, runTime.timeName(), - polyMesh::meshSubDir, + meshDir, runTime, IOobject::MUST_READ, IOobject::NO_WRITE, diff --git a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C index 4325029f20..33961fd6dc 100644 --- a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C +++ b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C @@ -153,9 +153,9 @@ int main(int argc, char *argv[]) } // get requested numberOfSubdomains - label nDomains = 0; - { - IOdictionary decompDict + const label nDomains = readLabel + ( + IOdictionary ( IOobject ( @@ -167,10 +167,8 @@ int main(int argc, char *argv[]) IOobject::NO_WRITE, false ) - ); - - decompDict.lookup("numberOfSubdomains") >> nDomains; - } + ).lookup("numberOfSubdomains") + ); if (decomposeFieldsOnly) { diff --git a/applications/utilities/postProcessing/dataConversion/foamToFieldview9/calcFaceAddressing.C b/applications/utilities/postProcessing/dataConversion/foamToFieldview9/calcFaceAddressing.C index 1546fcdea5..0aa65dc1b5 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToFieldview9/calcFaceAddressing.C +++ b/applications/utilities/postProcessing/dataConversion/foamToFieldview9/calcFaceAddressing.C @@ -72,14 +72,17 @@ labelList calcFaceAddressing << " face labels:" << faces << endl << " cellI:" << cellI << endl; - FatalError << "Faces consist of vertices:" << endl; + FatalError + << "Faces consist of vertices:" << endl; + forAll(faces, faceI) { FatalError << " face:" << faces[faceI] << allFaces[faces[faceI]] << endl; } - FatalError << exit(FatalError); + FatalError + << exit(FatalError); } } return shapeToMesh; diff --git a/applications/utilities/postProcessing/dataConversion/foamToFieldview9/writeFunctions.C b/applications/utilities/postProcessing/dataConversion/foamToFieldview9/writeFunctions.C index 2de1128c63..eec0beea36 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToFieldview9/writeFunctions.C +++ b/applications/utilities/postProcessing/dataConversion/foamToFieldview9/writeFunctions.C @@ -85,12 +85,12 @@ void writeBytes(char* start, int nBytes) // Debug: write wall flags data void writeWallFlags(Ostream& os, label cellI, const labelList& wallFlags) { - os << "cell " << cellI << " wallsFlags:"; + os << "cell " << cellI << " wallsFlags:"; forAll(wallFlags, wallFaceI) { - os << wallFlags[wallFaceI] << " "; + os << wallFlags[wallFaceI] << ' '; } - os << endl; + os << endl; } diff --git a/applications/utilities/postProcessing/dataConversion/foamToGMV/readConversionProperties.H b/applications/utilities/postProcessing/dataConversion/foamToGMV/readConversionProperties.H index c1a0cd7c78..b19e03ab19 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToGMV/readConversionProperties.H +++ b/applications/utilities/postProcessing/dataConversion/foamToGMV/readConversionProperties.H @@ -28,7 +28,8 @@ word format if ((format != "ascii") && (format != "ieeei4r8")) { - FatalError << "format type: " << format << " unknown." + FatalError + << "format type: " << format << " unknown." << " Valid options are: ascii ieeei4r8" << abort(FatalError); @@ -44,6 +45,7 @@ if (cells != "hex") ) { - FatalError << "cells type: " << cells << " unknown." + FatalError + << "cells type: " << cells << " unknown." << abort(FatalError); } diff --git a/applications/utilities/postProcessing/dataConversion/foamToTecplot360/foamToTecplot360.C b/applications/utilities/postProcessing/dataConversion/foamToTecplot360/foamToTecplot360.C index 0231e15938..2ba61565d9 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToTecplot360/foamToTecplot360.C +++ b/applications/utilities/postProcessing/dataConversion/foamToTecplot360/foamToTecplot360.C @@ -99,12 +99,12 @@ void print(const char* msg, Ostream& os, const PtrList& flds) { if (flds.size()) { - os << msg; + os << msg; forAll(flds, i) { - os<< ' ' << flds[i].name(); + os << ' ' << flds[i].name(); } - os << endl; + os << endl; } } @@ -113,9 +113,9 @@ void print(Ostream& os, const wordList& flds) { forAll(flds, i) { - os<< ' ' << flds[i]; + os << ' ' << flds[i]; } - os << endl; + os << endl; } diff --git a/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK.C b/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK.C index 0637dabbd6..a93885d976 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK.C +++ b/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK.C @@ -163,12 +163,12 @@ void print(const char* msg, Ostream& os, const PtrList& flds) { if (flds.size()) { - os << msg; + os << msg; forAll(flds, i) { - os<< ' ' << flds[i].name(); + os << ' ' << flds[i].name(); } - os << endl; + os << endl; } } @@ -177,9 +177,9 @@ void print(Ostream& os, const wordList& flds) { forAll(flds, i) { - os<< ' ' << flds[i]; + os << ' ' << flds[i]; } - os << endl; + os << endl; } diff --git a/applications/utilities/postProcessing/dataConversion/foamToVTK/writeFuns.C b/applications/utilities/postProcessing/dataConversion/foamToVTK/writeFuns.C index 5e657f87cf..89f0a59327 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToVTK/writeFuns.C +++ b/applications/utilities/postProcessing/dataConversion/foamToVTK/writeFuns.C @@ -94,20 +94,20 @@ void Foam::writeFuns::write fField.size()*sizeof(float) ); - os << std::endl; + os << std::endl; } else { forAll(fField, i) { - os << fField[i] << ' '; + os << fField[i] << ' '; if (i > 0 && (i % 10) == 0) { - os << std::endl; + os << std::endl; } } - os << std::endl; + os << std::endl; } } @@ -143,20 +143,20 @@ void Foam::writeFuns::write elems.size()*sizeof(label) ); - os << std::endl; + os << std::endl; } else { forAll(elems, i) { - os << elems[i] << ' '; + os << elems[i] << ' '; if (i > 0 && (i % 10) == 0) { - os << std::endl; + os << std::endl; } } - os << std::endl; + os << std::endl; } } @@ -186,11 +186,11 @@ void Foam::writeFuns::writeHeader if (binary) { - os << "BINARY" << std::endl; + os << "BINARY" << std::endl; } else { - os << "ASCII" << std::endl; + os << "ASCII" << std::endl; } } diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.cxx b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.cxx index 74f8f013a8..b508d21ec0 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.cxx +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.cxx @@ -502,15 +502,14 @@ void vtkPV3FoamReader::PrintSelf(ostream& os, vtkIndent indent) vtkDebugMacro(<<"PrintSelf"); this->Superclass::PrintSelf(os,indent); - os<< indent << "File name: " - << (this->FileName ? this->FileName : "(none)") << "\n"; + os << indent << "File name: " + << (this->FileName ? this->FileName : "(none)") << "\n"; foamData_->PrintSelf(os, indent); - os<< indent << "Time step range: " - << this->TimeStepRange[0] << " - " << this->TimeStepRange[1] - << "\n"; - os<< indent << "Time step: " << this->GetTimeStep() << endl; + os << indent << "Time step range: " + << this->TimeStepRange[0] << " - " << this->TimeStepRange[1] << "\n" + << indent << "Time step: " << this->GetTimeStep() << endl; } diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.cxx b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.cxx index 89532a6dde..547c4ff66b 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.cxx +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.cxx @@ -283,8 +283,8 @@ void vtkPV3blockMeshReader::PrintSelf(ostream& os, vtkIndent indent) vtkDebugMacro(<<"PrintSelf"); this->Superclass::PrintSelf(os,indent); - os<< indent << "File name: " - << (this->FileName ? this->FileName : "(none)") << "\n"; + os << indent << "File name: " + << (this->FileName ? this->FileName : "(none)") << "\n"; foamData_->PrintSelf(os, indent); } diff --git a/applications/utilities/postProcessing/miscellaneous/postChannel/sumData.C b/applications/utilities/postProcessing/miscellaneous/postChannel/sumData.C index 9f929b4814..73fdaf2038 100644 --- a/applications/utilities/postProcessing/miscellaneous/postChannel/sumData.C +++ b/applications/utilities/postProcessing/miscellaneous/postChannel/sumData.C @@ -41,7 +41,7 @@ Foam::Ostream& Foam::operator<< Foam::Istream& Foam::operator>>(Foam::Istream& is, Foam::sumData& wDist) { - return is >> wDist.oldFace_ >> wDist.sum_ >> wDist.count_; + return is >> wDist.oldFace_ >> wDist.sum_ >> wDist.count_; } diff --git a/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/Make/files b/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/Make/files index 77c9217ded..96d2bb2a85 100644 --- a/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/Make/files +++ b/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/Make/files @@ -1,5 +1,5 @@ tabulatedWallFunction/tabulatedWallFunction.C -tabulatedWallFunction/newTabulatedWallFunction.C +tabulatedWallFunction/tabulatedWallFunctionNew.C SpaldingsLaw/SpaldingsLaw.C general/general.C diff --git a/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/tabulatedWallFunction/newTabulatedWallFunction.C b/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/tabulatedWallFunction/tabulatedWallFunctionNew.C similarity index 100% rename from applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/tabulatedWallFunction/newTabulatedWallFunction.C rename to applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/tabulatedWallFunction/tabulatedWallFunctionNew.C diff --git a/applications/utilities/surface/surfaceClean/surfaceClean.C b/applications/utilities/surface/surfaceClean/surfaceClean.C index b5bf012549..46d9bb90da 100644 --- a/applications/utilities/surface/surfaceClean/surfaceClean.C +++ b/applications/utilities/surface/surfaceClean/surfaceClean.C @@ -51,7 +51,7 @@ int main(int argc, char *argv[]) argList::validArgs.append("surface file"); argList::validArgs.append("min length"); argList::validArgs.append("output surface file"); - argList::argList args(argc, argv); + argList args(argc, argv); const fileName inFileName = args[1]; const scalar minLen = args.argRead(2); diff --git a/applications/utilities/surface/surfaceRefineRedGreen/surfaceRefineRedGreen.C b/applications/utilities/surface/surfaceRefineRedGreen/surfaceRefineRedGreen.C index 424e06a67a..d7e84e1303 100644 --- a/applications/utilities/surface/surfaceRefineRedGreen/surfaceRefineRedGreen.C +++ b/applications/utilities/surface/surfaceRefineRedGreen/surfaceRefineRedGreen.C @@ -50,7 +50,7 @@ int main(int argc, char *argv[]) argList::validArgs.clear(); argList::validArgs.append("surface file"); argList::validArgs.append("output surface file"); - argList::argList args(argc, argv); + argList args(argc, argv); const fileName surfFileName = args[1]; const fileName outFileName = args[2]; diff --git a/applications/utilities/surface/surfaceSplitByPatch/surfaceSplitByPatch.C b/applications/utilities/surface/surfaceSplitByPatch/surfaceSplitByPatch.C index 87d27ed1e5..50502faebe 100644 --- a/applications/utilities/surface/surfaceSplitByPatch/surfaceSplitByPatch.C +++ b/applications/utilities/surface/surfaceSplitByPatch/surfaceSplitByPatch.C @@ -39,7 +39,7 @@ int main(int argc, char *argv[]) argList::noParallel(); argList::validArgs.clear(); argList::validArgs.append("input file"); - argList::argList args(argc, argv); + argList args(argc, argv); const fileName surfName = args[1]; diff --git a/applications/utilities/surface/surfaceSplitNonManifolds/surfaceSplitNonManifolds.C b/applications/utilities/surface/surfaceSplitNonManifolds/surfaceSplitNonManifolds.C index ce32c54206..32975365c8 100644 --- a/applications/utilities/surface/surfaceSplitNonManifolds/surfaceSplitNonManifolds.C +++ b/applications/utilities/surface/surfaceSplitNonManifolds/surfaceSplitNonManifolds.C @@ -65,7 +65,7 @@ void writeOBJ(Ostream& os, const pointField& pts) { const point& pt = pts[i]; - os << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << endl; + os << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << endl; } } @@ -85,7 +85,7 @@ void dumpPoints(const triSurface& surf, const labelList& borderPoint) { const point& pt = surf.localPoints()[pointI]; - os << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << endl; + os << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << endl; } } } @@ -108,7 +108,7 @@ void dumpEdges(const triSurface& surf, const boolList& borderEdge) { const edge& e = surf.edges()[edgeI]; - os << "l " << e.start()+1 << ' ' << e.end()+1 << endl; + os << "l " << e.start()+1 << ' ' << e.end()+1 << endl; } } } diff --git a/applications/utilities/thermophysical/adiabaticFlameT/adiabaticFlameT.C b/applications/utilities/thermophysical/adiabaticFlameT/adiabaticFlameT.C index d7d282ec9b..5139b8c499 100644 --- a/applications/utilities/thermophysical/adiabaticFlameT/adiabaticFlameT.C +++ b/applications/utilities/thermophysical/adiabaticFlameT/adiabaticFlameT.C @@ -70,7 +70,7 @@ int main(int argc, char *argv[]) scalar T0(readScalar(control.lookup("T0"))); - word fuelName(control.lookup("fuel")); + const word fuelName(control.lookup("fuel")); scalar n(readScalar(control.lookup("n"))); scalar m(readScalar(control.lookup("m"))); diff --git a/applications/utilities/thermophysical/equilibriumFlameT/equilibriumFlameT.C b/applications/utilities/thermophysical/equilibriumFlameT/equilibriumFlameT.C index 0549688e34..2990cc81dc 100644 --- a/applications/utilities/thermophysical/equilibriumFlameT/equilibriumFlameT.C +++ b/applications/utilities/thermophysical/equilibriumFlameT/equilibriumFlameT.C @@ -71,7 +71,7 @@ int main(int argc, char *argv[]) scalar P(readScalar(control.lookup("P"))); - word fuel(control.lookup("fuel")); + const word fuelName(control.lookup("fuel")); scalar n(readScalar(control.lookup("n"))); scalar m(readScalar(control.lookup("m"))); @@ -97,7 +97,7 @@ int main(int argc, char *argv[]) Info<< nl << "Reading Burcat data for relevant species" << nl << endl; // Reactants - thermo FUEL(thermoData.lookup(fuel)); + thermo FUEL(thermoData.lookup(fuelName)); thermo O2(thermoData.lookup("O2")); thermo N2(thermoData.lookup("N2")); diff --git a/applications/utilities/thermophysical/mixtureAdiabaticFlameT/substance.H b/applications/utilities/thermophysical/mixtureAdiabaticFlameT/substance.H index b7232cc2c7..561e3fc1b6 100644 --- a/applications/utilities/thermophysical/mixtureAdiabaticFlameT/substance.H +++ b/applications/utilities/thermophysical/mixtureAdiabaticFlameT/substance.H @@ -95,13 +95,13 @@ public: friend Istream& operator>>(Istream& is, substance& s) { - is >> s.name_ >> s.volFrac_; + is >> s.name_ >> s.volFrac_; return is; } friend Ostream& operator<<(Ostream& os, const substance& s) { - os << s.name_ << token::SPACE << s.volFrac_; + os << s.name_ << token::SPACE << s.volFrac_; return os; } }; diff --git a/doc/Allwmake b/doc/Allwmake index e180b24e0f..5d8ed9c5a0 100755 --- a/doc/Allwmake +++ b/doc/Allwmake @@ -2,9 +2,8 @@ cd ${0%/*} || exit 1 # run from this directory set -x -chmod a+rX $WM_PROJECT_DIR -chmod a+rX $WM_PROJECT_DIR/doc -chmod -R a+rX Doxygen +# fix permissions (NB: '+X' and not '+x'!) +chmod a+rX $WM_PROJECT_DIR $WM_PROJECT_DIR/doc Doxygen Doxygen/Allwmake diff --git a/doc/Doxygen/Allwmake b/doc/Doxygen/Allwmake index dab44579b8..a34eb3fd7e 100755 --- a/doc/Doxygen/Allwmake +++ b/doc/Doxygen/Allwmake @@ -2,11 +2,21 @@ cd ${0%/*} || exit 1 # run from this directory set -x +rm -rf latex man + +# remove html directory in background +mv html html-stagedRemove$$ 2> /dev/null +rm -rf html-stagedRemove$$ >/dev/null 2>&1 & + +# ensure that created files are readable by everyone umask 22 -rm -rf html latex man doxygen # fix permissions (NB: '+X' and not '+x'!) -chmod -R a+rX ./ +chmod -R a+rX html latex man 2>/dev/null + +echo +echo "Done doxygen" +echo # ----------------------------------------------------------------- end-of-file diff --git a/doc/Doxygen/FoamHeader.html b/doc/Doxygen/FoamHeader.html index 3d16a4804a..e67053d4ae 100644 --- a/doc/Doxygen/FoamHeader.html +++ b/doc/Doxygen/FoamHeader.html @@ -14,7 +14,9 @@ - +
- - - - - @@ -64,6 +66,8 @@ horizontal-align: left; ">
  +   Source Guide + OpenCFD + Features + Contact + OpenFOAM
- +
diff --git a/doc/Doxygen/tabs.css b/doc/Doxygen/tabs.css index 2acf4cd239..3c567bb529 100644 --- a/doc/Doxygen/tabs.css +++ b/doc/Doxygen/tabs.css @@ -1,101 +1,100 @@ /* tabs styles, based on http://www.alistapart.com/articles/slidingdoors */ -DIV.tabs +div.tabs { - float : left; - width : 100%; - margin-bottom : 2px; - padding-bottom : 6px; + float : left; + width : 100%; + margin-bottom : 2px; + padding-bottom : 6px; } -DIV.tabs UL +div.tabs ul { - margin : 0px; - padding-left : 0px; - border-right : 1px solid #84B0C7; - list-style : none; + margin : 0px; + padding-left : 0px; + border-right : 1px solid #84B0C7; + list-style : none; } -DIV.tabs LI, DIV.tabs FORM +div.tabs li, div.tabs form { - display : inline; - margin : 0px; - padding : 0px; + display : inline; + margin : 0px; + padding : 0px; } -DIV.tabs FORM +div.tabs form { - float : left; - padding : 0px 9px; + float : left; + padding : 0px 9px; } -DIV.tabs A +div.tabs a { - float : left; - font-size : 12px; - font-weight : bold; - text-decoration : none; - border-right : 1px solid #000000; + float : left; + font-size : 12px; + font-weight : bold; + text-decoration : none; + border-right : 1px solid #000000; } -DIV.tabs A:hover +div.tabs a:hover { - background-position: 100% -150px; + background-position: 100% -150px; } -DIV.tabs A:link, DIV.tabs A:visited, -DIV.tabs A:active, DIV.tabs A:hover +div.tabs a:link, div.tabs a:visited, div.tabs a:active, div.tabs a:hover { - color: #000000; + color : #000000; } -DIV.tabs SPAN +div.tabs span { - float : left; - display : block; - padding : 0px 9px; - white-space : nowrap; + float : left; + display : block; + padding : 0px 9px; + white-space : nowrap; } -DIV.tabs INPUT +div.tabs input { - float : right; - display : inline; - font-size : 12px; + float : right; + display : inline; + font-size : 12px; } -DIV.tabs TD +div.tabs td { - font-size : 12px; - font-weight : bold; - text-decoration : none; + font-size : 12px; + font-weight : bold; + text-decoration : none; } -/* Commented Backslash Hack hides rule from IE5-Mac \*/ -DIV.tabs SPAN {float : none;} +/* Commented backslash hack hides rule from IE5-Mac \*/ +div.tabs span { float : none; } /* End IE5-Mac hack */ -DIV.tabs A:hover SPAN +div.tabs a:hover span { - background-position: 0% -150px; + background-position: 0% -150px; } -DIV.tabs LI#current A +div.tabs li#current a { - border-width : 0px; - border-right : 1px solid #000000; - color: #0000ff; + border-width : 0px; + border-right : 1px solid #000000; + color : #0000ff; } -DIV.tabs LI#current SPAN +div.tabs li#current span { - padding-bottom : 0px; + padding-bottom : 0px; } -DIV.nav +div.nav { - background : none; - border : none; - border-bottom : 1px solid #000000; + background : none; + border : none; + border-bottom : 1px solid #000000; } diff --git a/doc/Doxygen/tools/find-its b/doc/Doxygen/tools/find-its deleted file mode 100755 index 2276183628..0000000000 --- a/doc/Doxygen/tools/find-its +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/perl -w -use strict; -use File::Find (); - -# ----------------------------------------------------------------------------- -# -# Script -# find-its -# -# Description -# Search for *.[CH] files with "it's" -# This contraction (== "it is") looks too much like "its" (possesive) -# and confuses non-native (and some native) English speakers. -# -# - print filename and lineNumber -# -# ----------------------------------------------------------------------------- - -my $re_filespec = qr{^.+\.[CH]$}; - -# for the convenience of &wanted calls, including -eval statements: -## use vars qw( *name *dir *prune ); -## *name = *File::Find::name; -## *dir = *File::Find::dir; -## *prune = *File::Find::prune; - -sub wanted { - unless ( lstat($_) and -f _ and -r _ and not -l _ and /$re_filespec/ ) { - return; - } - - local @ARGV = $_; - while (<>) { - if (m{it\'s}) { - print "$File::Find::name line=$.\n"; - } - } - - close ARGV; -} - -## Traverse desired filesystems -for my $dir (@ARGV) { - no warnings 'File::Find'; - warn "(**) checking '$dir' ...\n"; - File::Find::find( { wanted => \&wanted }, $dir ); -} - diff --git a/doc/Doxygen/tools/README b/doc/tools/README similarity index 100% rename from doc/Doxygen/tools/README rename to doc/tools/README diff --git a/doc/tools/find-its b/doc/tools/find-its new file mode 100755 index 0000000000..7f8996b32b --- /dev/null +++ b/doc/tools/find-its @@ -0,0 +1,17 @@ +#!/bin/sh +# ----------------------------------------------------------------------------- +# Script +# find-its +# +# Description +# Search for files with "it's" +# This contraction (== "it is") looks too much like "its" (possesive) +# and confuses non-native (and some native) English speakers. +# +# ----------------------------------------------------------------------------- +set -x +cd $WM_PROJECT_DIR || exit 1 + +git grep -e "it's" + +#------------------------------------------------------------------ end-of-file diff --git a/doc/Doxygen/tools/find-junkFiles b/doc/tools/find-junkFiles similarity index 100% rename from doc/Doxygen/tools/find-junkFiles rename to doc/tools/find-junkFiles diff --git a/doc/Doxygen/tools/find-longlines b/doc/tools/find-longlines similarity index 100% rename from doc/Doxygen/tools/find-longlines rename to doc/tools/find-longlines diff --git a/doc/Doxygen/tools/find-placeholderDescription b/doc/tools/find-placeholderDescription similarity index 100% rename from doc/Doxygen/tools/find-placeholderDescription rename to doc/tools/find-placeholderDescription diff --git a/doc/Doxygen/tools/find-retagged b/doc/tools/find-retagged similarity index 100% rename from doc/Doxygen/tools/find-retagged rename to doc/tools/find-retagged diff --git a/doc/Doxygen/tools/find-suspiciousTags b/doc/tools/find-suspiciousTags similarity index 100% rename from doc/Doxygen/tools/find-suspiciousTags rename to doc/tools/find-suspiciousTags diff --git a/doc/Doxygen/tools/find-templateInComments b/doc/tools/find-templateInComments similarity index 100% rename from doc/Doxygen/tools/find-templateInComments rename to doc/tools/find-templateInComments diff --git a/doc/Doxygen/tools/find-tinyDescription b/doc/tools/find-tinyDescription similarity index 100% rename from doc/Doxygen/tools/find-tinyDescription rename to doc/tools/find-tinyDescription diff --git a/doc/Doxygen/tools/fix-Class b/doc/tools/fix-Class similarity index 100% rename from doc/Doxygen/tools/fix-Class rename to doc/tools/fix-Class diff --git a/etc/codeTemplates/source/_Template.C b/etc/codeTemplates/source/_Template.C index 43c2dc7253..ed2b7283af 100644 --- a/etc/codeTemplates/source/_Template.C +++ b/etc/codeTemplates/source/_Template.C @@ -64,7 +64,8 @@ Foam::CLASSNAME::CLASSNAME(const CLASSNAME&) // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::CLASSNAME::New() +Foam::autoPtr +Foam::CLASSNAME::New() { return autoPtr(new CLASSNAME); } diff --git a/etc/settings.csh b/etc/settings.csh index d56788ee57..44a25b32a9 100644 --- a/etc/settings.csh +++ b/etc/settings.csh @@ -75,7 +75,7 @@ _foamAddLib ${FOAM_USER_LIBBIN}:${FOAM_SITE_LIBBIN}:${FOAM_LIBBIN}:${FOAM_LIBBI # Compiler settings # ~~~~~~~~~~~~~~~~~ -unset gcc_version gmp_version mpfr_version +unset gcc_version gmp_version mpfr_version mpc_version unsetenv MPFR_ARCH_PATH @@ -92,25 +92,22 @@ case OpenFOAM: set gmp_version=gmp-5.0.1 set mpfr_version=mpfr-2.4.2 breaksw - - case Gcc442: - set gcc_version=gcc-4.4.2 - set gmp_version=gmp-4.2.4 - set mpfr_version=mpfr-2.4.1 + case Gcc45: + set gcc_version=gcc-4.5.0 + set gmp_version=gmp-5.0.1 + set mpfr_version=mpfr-2.4.2 + set mpc_version=mpc-0.8.1 breaksw - case Gcc44: - set gcc_version=gcc-4.4.2 - set gmp_version=gmp-4.2.4 - set mpfr_version=mpfr-2.4.1 + set gcc_version=gcc-4.4.3 + set gmp_version=gmp-5.0.1 + set mpfr_version=mpfr-2.4.2 breaksw - case Gcc43: set gcc_version=gcc-4.3.3 set gmp_version=gmp-4.2.4 set mpfr_version=mpfr-2.4.1 breaksw - default: echo echo "Warning in $WM_PROJECT_DIR/etc/settings.csh:" @@ -118,7 +115,6 @@ case OpenFOAM: echo " Please check your settings" echo breaksw - endsw if ( $?gcc_version ) then @@ -126,6 +122,10 @@ case OpenFOAM: set gmpDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$gmp_version set mpfrDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$mpfr_version + if ( $?mpc_version ) then + set mpcDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$mpc_version + endif + # Check that the compiler directory can be found if ( ! -d "$gccDir" ) then echo @@ -138,17 +138,28 @@ case OpenFOAM: _foamAddMan $gccDir/man _foamAddPath $gccDir/bin - _foamAddLib $gccDir/lib${WM_COMPILER_LIB_ARCH}:$gccDir/lib + + # 64-bit needs lib64, but 32-bit needs lib (not lib32) + if ($WM_ARCH_OPTION == 64) then + _foamAddLib $gccDir/lib$WM_COMPILER_LIB_ARCH + else + _foamAddLib $gccDir/lib + endif # add in gmp/mpfr libraries _foamAddLib $gmpDir/lib _foamAddLib $mpfrDir/lib + # add in mpc libraries (not need for older gcc) + if ( $?mpc_version ) then + _foamAddLib $mpcDir/lib + endif + # used by boost/CGAL: setenv MPFR_ARCH_PATH $mpfrDir endif - unset gcc_version gccDir gmp_version gmpDir mpfr_version mpfrDir - + unset gcc_version gccDir + unset gmp_version gmpDir mpfr_version mpfrDir mpc_version mpcDir breaksw endsw @@ -199,18 +210,14 @@ case OPENMPI: breaksw case SYSTEMOPENMPI: - # This uses the installed openmpi. It needs mpicc installed! + # use the system installed openmpi, get library directory via mpicc set mpi_version=openmpi-system - - # Set compilation flags here instead of in wmake/rules/../mplibSYSTEMOPENMPI - setenv PINC `mpicc --showme:compile` - setenv PLIBS `mpicc --showme:link` - set libDir=`echo "$PLIBS" | sed -e 's/.*-L\([^ ]*\).*/\1/'` + set libDir=`mpicc --showme:link | sed -e 's/.*-L\([^ ]*\).*/\1/'` if ($?FOAM_VERBOSE && $?prompt) then - echo "Using system installed MPI:" - echo " compile flags : $PINC" - echo " link flags : $PLIBS" + echo "Using system installed OpenMPI:" + echo " compile flags : `mpicc --showme:compile`" + echo " link flags : `mpicc --showme:link`" echo " libmpi dir : $libDir" endif diff --git a/etc/settings.sh b/etc/settings.sh index abbde906b9..17f029539a 100644 --- a/etc/settings.sh +++ b/etc/settings.sh @@ -99,7 +99,8 @@ _foamAddLib $FOAM_USER_LIBBIN:$FOAM_SITE_LIBBIN:$FOAM_LIBBIN:$FOAM_LIBBIN/dummy # Compiler settings # ~~~~~~~~~~~~~~~~~ -unset gcc_version gmp_version mpfr_version MPFR_ARCH_PATH +unset gcc_version gmp_version mpfr_version mpc_version +unset MPFR_ARCH_PATH # Select compiler installation # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -114,15 +115,16 @@ OpenFOAM) gmp_version=gmp-5.0.1 mpfr_version=mpfr-2.4.2 ;; - Gcc442) - gcc_version=gcc-4.4.2 - gmp_version=gmp-4.2.4 - mpfr_version=mpfr-2.4.1 + Gcc45) + gcc_version=gcc-4.5.0 + gmp_version=gmp-5.0.1 + mpfr_version=mpfr-2.4.2 + mpc_version=mpc-0.8.1 ;; Gcc44) - gcc_version=gcc-4.4.2 - gmp_version=gmp-4.2.4 - mpfr_version=mpfr-2.4.1 + gcc_version=gcc-4.4.3 + gmp_version=gmp-5.0.1 + mpfr_version=mpfr-2.4.2 ;; Gcc43) gcc_version=gcc-4.3.3 @@ -143,6 +145,7 @@ OpenFOAM) gccDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$gcc_version gmpDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$gmp_version mpfrDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$mpfr_version + mpcDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$mpc_version # Check that the compiler directory can be found [ -d "$gccDir" ] || { @@ -156,22 +159,30 @@ OpenFOAM) _foamAddMan $gccDir/man _foamAddPath $gccDir/bin - _foamAddLib $gccDir/lib # 64-bit needs lib64, but 32-bit needs lib (not lib32) if [ "$WM_ARCH_OPTION" = 64 ] then _foamAddLib $gccDir/lib$WM_COMPILER_LIB_ARCH + else + _foamAddLib $gccDir/lib fi # add in gmp/mpfr libraries _foamAddLib $gmpDir/lib _foamAddLib $mpfrDir/lib + # add in mpc libraries (not need for older gcc) + if [ -n "$mpc_version" ] + then + _foamAddLib $mpcDir/lib + fi + # used by boost/CGAL: export MPFR_ARCH_PATH=$mpfrDir fi - unset gcc_version gccDir gmp_version gmpDir mpfr_version mpfrDir + unset gcc_version gccDir + unset gmp_version gmpDir mpfr_version mpfrDir mpc_version mpcDir ;; esac @@ -224,19 +235,15 @@ OPENMPI) ;; SYSTEMOPENMPI) - # This uses the installed openmpi. It needs mpicc installed! + # use the system installed openmpi, get library directory via mpicc mpi_version=openmpi-system - - # Set compilation flags here instead of in wmake/rules/../mplibSYSTEMOPENMPI - export PINC=`mpicc --showme:compile` - export PLIBS=`mpicc --showme:link` - libDir=`echo "$PLIBS" | sed -e 's/.*-L\([^ ]*\).*/\1/'` + libDir=`mpicc --showme:link | sed -e 's/.*-L\([^ ]*\).*/\1/'` if [ "$FOAM_VERBOSE" -a "$PS1" ] then - echo "Using system installed MPI:" - echo " compile flags : $PINC" - echo " link flags : $PLIBS" + echo "Using system installed OpenMPI:" + echo " compile flags : `mpicc --showme:compile`" + echo " link flags : `mpicc --showme:link`" echo " libmpi dir : $libDir" fi diff --git a/src/ODE/Make/files b/src/ODE/Make/files index bf01c69130..0e6c49a915 100644 --- a/src/ODE/Make/files +++ b/src/ODE/Make/files @@ -6,7 +6,7 @@ ODESolversRK = ODESolvers/RK ODESolversSIBS = ODESolvers/SIBS $(ODESolversODESolver)/ODESolver.C -$(ODESolversODESolver)/newODESolver.C +$(ODESolversODESolver)/ODESolverNew.C $(ODESolversRK)/RK.C diff --git a/src/ODE/ODESolvers/ODESolver/newODESolver.C b/src/ODE/ODESolvers/ODESolver/ODESolverNew.C similarity index 95% rename from src/ODE/ODESolvers/ODESolver/newODESolver.C rename to src/ODE/ODESolvers/ODESolver/ODESolverNew.C index 03b1578017..10bb45f96d 100644 --- a/src/ODE/ODESolvers/ODESolver/newODESolver.C +++ b/src/ODE/ODESolvers/ODESolver/ODESolverNew.C @@ -44,8 +44,8 @@ Foam::autoPtr Foam::ODESolver::New ( "ODESolver::New(const word& ODESolverTypeName, const ODE& ode)" ) << "Unknown ODESolver type " - << ODESolverTypeName << endl << endl - << "Valid ODESolvers are : " << endl + << ODESolverTypeName << nl << nl + << "Valid ODESolvers are : " << endl << ODEConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/OSspecific/POSIX/printStack.C b/src/OSspecific/POSIX/printStack.C index 323c812a98..87482265db 100644 --- a/src/OSspecific/POSIX/printStack.C +++ b/src/OSspecific/POSIX/printStack.C @@ -122,19 +122,18 @@ void printSourceFileAndLine if (line == "") { - os << " addr2line failed"; + os << " addr2line failed"; } else if (line == "??:0") { - os << " in " << filename; + os << " in " << filename; } else { string cwdLine(line.replaceAll(cwd() + '/', "")); - string homeLine(cwdLine.replaceAll(home(), '~')); - os << " at " << homeLine.c_str(); + os << " at " << homeLine.c_str(); } } } @@ -160,11 +159,11 @@ void getSymbolForRaw if (fcnt != "") { - os << fcnt.c_str(); + os << fcnt.c_str(); return; } } - os << "Uninterpreted: " << raw.c_str(); + os << "Uninterpreted: " << raw.c_str(); } @@ -210,8 +209,8 @@ void error::printStack(Ostream& os) fileName programFile; word address; - os << '#' << label(i) << " "; - //os << "Raw : " << msg << "\n\t"; + os << '#' << label(i) << " "; + //os << "Raw : " << msg << "\n\t"; { string::size_type lPos = msg.find('['); string::size_type rPos = msg.find(']'); @@ -263,12 +262,12 @@ void error::printStack(Ostream& os) if (status == 0 && cplusNamePtr) { - os << cplusNamePtr; + os << cplusNamePtr; free(cplusNamePtr); } else { - os << cName.c_str(); + os << cName.c_str(); } } else @@ -279,7 +278,7 @@ void error::printStack(Ostream& os) { string fullName(msg.substr(start, endBracketPos-start)); - os << fullName.c_str() << nl; + os << fullName.c_str() << nl; } else { @@ -296,7 +295,7 @@ void error::printStack(Ostream& os) printSourceFileAndLine(os, addressMap, programFile, address); - os << nl; + os << nl; } free(strings); diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files index cc8055051a..bf28d148dd 100644 --- a/src/OpenFOAM/Make/files +++ b/src/OpenFOAM/Make/files @@ -258,14 +258,14 @@ $(GAMG)/GAMGSolverSolve.C GAMGInterfaces = $(GAMG)/interfaces $(GAMGInterfaces)/GAMGInterface/GAMGInterface.C -$(GAMGInterfaces)/GAMGInterface/newGAMGInterface.C +$(GAMGInterfaces)/GAMGInterface/GAMGInterfaceNew.C $(GAMGInterfaces)/processorGAMGInterface/processorGAMGInterface.C $(GAMGInterfaces)/processorCyclicGAMGInterface/processorCyclicGAMGInterface.C $(GAMGInterfaces)/cyclicGAMGInterface/cyclicGAMGInterface.C GAMGInterfaceFields = $(GAMG)/interfaceFields $(GAMGInterfaceFields)/GAMGInterfaceField/GAMGInterfaceField.C -$(GAMGInterfaceFields)/GAMGInterfaceField/newGAMGInterfaceField.C +$(GAMGInterfaceFields)/GAMGInterfaceField/GAMGInterfaceFieldNew.C $(GAMGInterfaceFields)/processorGAMGInterfaceField/processorGAMGInterfaceField.C $(GAMGInterfaceFields)/processorCyclicGAMGInterfaceField/processorCyclicGAMGInterfaceField.C $(GAMGInterfaceFields)/cyclicGAMGInterfaceField/cyclicGAMGInterfaceField.C @@ -330,7 +330,7 @@ polyMesh = meshes/polyMesh polyPatches = $(polyMesh)/polyPatches $(polyPatches)/polyPatch/polyPatch.C -$(polyPatches)/polyPatch/newPolyPatch.C +$(polyPatches)/polyPatch/polyPatchNew.C basicPolyPatches = $(polyPatches)/basic $(basicPolyPatches)/coupled/coupledPolyPatch.C @@ -365,15 +365,15 @@ $(zone)/zone.C cellZone = $(polyMesh)/zones/cellZone $(cellZone)/cellZone.C -$(cellZone)/newCellZone.C +$(cellZone)/cellZoneNew.C faceZone = $(polyMesh)/zones/faceZone $(faceZone)/faceZone.C -$(faceZone)/newFaceZone.C +$(faceZone)/faceZoneNew.C pointZone = $(polyMesh)/zones/pointZone $(pointZone)/pointZone.C -$(pointZone)/newPointZone.C +$(pointZone)/pointZoneNew.C $(polyMesh)/polyMesh.C $(polyMesh)/polyMeshFromShapeMesh.C @@ -441,7 +441,7 @@ $(pointMeshMapper)/pointPatchMapper.C pointPatches = $(pointMesh)/pointPatches $(pointPatches)/pointPatch/pointPatch.C $(pointPatches)/facePointPatch/facePointPatch.C -$(pointPatches)/facePointPatch/newFacePointPatch.C +$(pointPatches)/facePointPatch/facePointPatchNew.C basicPointPatches = $(pointPatches)/basic $(basicPointPatches)/coupled/coupledPointPatch.C diff --git a/src/OpenFOAM/db/IOobject/IOobjectReadHeader.C b/src/OpenFOAM/db/IOobject/IOobjectReadHeader.C index 3fb364d9bb..fc85d5fa26 100644 --- a/src/OpenFOAM/db/IOobject/IOobjectReadHeader.C +++ b/src/OpenFOAM/db/IOobject/IOobjectReadHeader.C @@ -72,7 +72,7 @@ bool Foam::IOobject::readHeader(Istream& is) is.format(headerDict.lookup("format")); headerClassName_ = word(headerDict.lookup("class")); - word headerObject(headerDict.lookup("object")); + const word headerObject(headerDict.lookup("object")); if (IOobject::debug && headerObject != name()) { IOWarningIn("IOobject::readHeader(Istream&)", is) diff --git a/src/OpenFOAM/db/IOstreams/IOstreams/IOstream.C b/src/OpenFOAM/db/IOstreams/IOstreams/IOstream.C index 478080a099..90b8613b83 100644 --- a/src/OpenFOAM/db/IOstreams/IOstreams/IOstream.C +++ b/src/OpenFOAM/db/IOstreams/IOstreams/IOstream.C @@ -61,9 +61,9 @@ Foam::IOstream::compressionType Foam::IOstream::compressionEnum(const word& compression) { // get Switch (bool) value, but allow it to fail - Switch::switchType sw = Switch::asEnum(compression, true); + Switch sw(compression, true); - if (sw != Switch::INVALID) + if (sw.valid()) { return sw ? IOstream::COMPRESSED : IOstream::UNCOMPRESSED; } diff --git a/src/OpenFOAM/db/Time/Time.C b/src/OpenFOAM/db/Time/Time.C index 35525f65f4..0afa8d69b3 100644 --- a/src/OpenFOAM/db/Time/Time.C +++ b/src/OpenFOAM/db/Time/Time.C @@ -95,7 +95,7 @@ void Foam::Time::adjustDeltaT() void Foam::Time::setControls() { // default is to resume calculation from "latestTime" - word startFrom = controlDict_.lookupOrDefault + const word startFrom = controlDict_.lookupOrDefault ( "startFrom", "latestTime" diff --git a/src/OpenFOAM/db/Time/TimeIO.C b/src/OpenFOAM/db/Time/TimeIO.C index d16b4c8014..11031875df 100644 --- a/src/OpenFOAM/db/Time/TimeIO.C +++ b/src/OpenFOAM/db/Time/TimeIO.C @@ -94,7 +94,7 @@ void Foam::Time::readDict() if (controlDict_.found("timeFormat")) { - word formatName(controlDict_.lookup("timeFormat")); + const word formatName(controlDict_.lookup("timeFormat")); if (formatName == "general") { diff --git a/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.C b/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.C index dfd4a27417..e19c807bf8 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.C +++ b/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.C @@ -82,7 +82,7 @@ bool Foam::functionEntry::execute "(const word& functionName, dictionary& parentDict, Istream&)" ) << "Unknown functionEntry '" << functionName << "' in " << is.name() << " near line " << is.lineNumber() - << endl << endl + << nl << nl << "Valid functionEntries are :" << endl << executedictionaryIstreamMemberFunctionTablePtr_->toc() << exit(FatalError); @@ -128,7 +128,7 @@ bool Foam::functionEntry::execute "(const word&, const dictionary&, primitiveEntry&, Istream&)" ) << "Unknown functionEntry '" << functionName << "' in " << is.name() << " near line " << is.lineNumber() - << endl << endl + << nl << nl << "Valid functionEntries are :" << endl << executeprimitiveEntryIstreamMemberFunctionTablePtr_->toc() << exit(FatalError); diff --git a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C index 79bfcdb3b2..83c4b337fc 100644 --- a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C +++ b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C @@ -50,7 +50,7 @@ Foam::autoPtr Foam::functionObject::New const dictionary& functionDict ) { - word functionType(functionDict.lookup("type")); + const word functionType(functionDict.lookup("type")); if (debug) { diff --git a/src/OpenFOAM/fields/pointPatchFields/basic/basicSymmetry/basicSymmetryPointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/basic/basicSymmetry/basicSymmetryPointPatchField.H index 5d77b05804..0a53bd4795 100644 --- a/src/OpenFOAM/fields/pointPatchFields/basic/basicSymmetry/basicSymmetryPointPatchField.H +++ b/src/OpenFOAM/fields/pointPatchFields/basic/basicSymmetry/basicSymmetryPointPatchField.H @@ -121,12 +121,6 @@ public: // Evaluation functions - //- Return the constraint type this pointPatchField implements - virtual const word& constraintType() const - { - return symmetryPointPatch::typeName; - } - //- Update the patch field virtual void evaluate ( diff --git a/src/OpenFOAM/fields/pointPatchFields/constraint/symmetry/symmetryPointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/constraint/symmetry/symmetryPointPatchField.H index a7a2e349d1..d27c8496df 100644 --- a/src/OpenFOAM/fields/pointPatchFields/constraint/symmetry/symmetryPointPatchField.H +++ b/src/OpenFOAM/fields/pointPatchFields/constraint/symmetry/symmetryPointPatchField.H @@ -119,6 +119,16 @@ public: ) ); } + + + // Member functions + + //- Return the constraint type this pointPatchField implements + virtual const word& constraintType() const + { + return symmetryPointPatch::typeName; + } + }; diff --git a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.C b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.C index cb68121c1e..03dbf43fd4 100644 --- a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.C +++ b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.C @@ -338,6 +338,6 @@ Ostream& operator<< // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "newPointPatchField.C" +#include "pointPatchFieldNew.C" // ************************************************************************* // diff --git a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/newPointPatchField.C b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldNew.C similarity index 94% rename from src/OpenFOAM/fields/pointPatchFields/pointPatchField/newPointPatchField.C rename to src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldNew.C index 749511b2cf..09a3a3e03c 100644 --- a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/newPointPatchField.C +++ b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldNew.C @@ -53,8 +53,7 @@ Foam::autoPtr > Foam::pointPatchField::New "PointPatchField::New" "(const word&, const word&, const pointPatch&, const Field&)" ) << "Unknown patchFieldType type " - << patchFieldType - << endl << endl + << patchFieldType << nl << nl << "Valid patchField types are :" << endl << pointPatchConstructorTablePtr_->sortedToc() << exit(FatalError); @@ -143,7 +142,7 @@ Foam::autoPtr > Foam::pointPatchField::New "New(const pointPatch&, const Field&, const dictionary&)", dict ) << "Unknown patchField type " << patchFieldType - << " for patch type " << p.type() << endl << endl + << " for patch type " << p.type() << nl << nl << "Valid patchField types are :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalIOError); @@ -219,12 +218,15 @@ Foam::autoPtr > Foam::pointPatchField::New { FatalErrorIn ( - "PointPatchField::" - "New(const pointPatchField&, " - "const pointPatch&, const Field&, " - "const pointPatchFieldMapper&)" - ) << "unknown patchTypefield type " - << ptf.type() << endl << endl + "PointPatchField::New" + "(" + "const pointPatchField&, " + "const pointPatch&, " + "const DimensionedField&, " + "const pointPatchFieldMapper&" + ")" + ) << "Unknown patchField type " + << ptf.type() << nl << nl << "Valid patchField types are :" << endl << patchMapperConstructorTablePtr_->sortedToc() << exit(FatalError); diff --git a/src/OpenFOAM/global/constants/electromagnetic/electromagneticConstants.C b/src/OpenFOAM/global/constants/electromagnetic/electromagneticConstants.C index ca7a80d19d..fbdd85d32a 100644 --- a/src/OpenFOAM/global/constants/electromagnetic/electromagneticConstants.C +++ b/src/OpenFOAM/global/constants/electromagnetic/electromagneticConstants.C @@ -44,7 +44,7 @@ const Foam::dimensionedScalar Foam::constant::electromagnetic::mu0 dimensionedScalar ( "mu0", - dimless, + dimensionSet(1, 2, -1, 0, 0, -2, 0), 4.0*constant::mathematical::pi*1e-07 ) ) diff --git a/src/OpenFOAM/global/foamDoc.H b/src/OpenFOAM/global/foamDoc.H index 076223436d..91af8ece83 100644 --- a/src/OpenFOAM/global/foamDoc.H +++ b/src/OpenFOAM/global/foamDoc.H @@ -40,8 +40,8 @@ License OpenFOAM comes with full commercial support from OpenCFD, including software support, - contracted developments - and a programme of training courses. + contracted developments + and a programme of training courses. These activities fund the development, maintenance and release of OpenFOAM to make it an extremely viable commercial open source product. diff --git a/src/OpenFOAM/graph/graph.C b/src/OpenFOAM/graph/graph.C index 1257377608..c0c15260f5 100644 --- a/src/OpenFOAM/graph/graph.C +++ b/src/OpenFOAM/graph/graph.C @@ -28,19 +28,18 @@ License #include "IOmanip.H" #include "Pair.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { + defineTypeNameAndDebug(graph::writer, 0); + defineRunTimeSelectionTable(graph::writer, word); +} -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -defineTypeNameAndDebug(graph::writer, 0); -defineRunTimeSelectionTable(graph::writer, word); // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -void graph::readCurves(Istream& is) +void Foam::graph::readCurves(Istream& is) { List xyData(is); @@ -59,7 +58,7 @@ void graph::readCurves(Istream& is) // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -graph::graph +Foam::graph::graph ( const string& title, const string& xName, @@ -74,7 +73,7 @@ graph::graph {} -graph::graph +Foam::graph::graph ( const string& title, const string& xName, @@ -92,7 +91,7 @@ graph::graph } -graph::graph +Foam::graph::graph ( const string& title, const string& xName, @@ -108,7 +107,7 @@ graph::graph } -graph::graph(Istream& is) +Foam::graph::graph(Istream& is) : title_(is), xName_(is), @@ -118,7 +117,7 @@ graph::graph(Istream& is) } -const scalarField& graph::y() const +const Foam::scalarField& Foam::graph::y() const { if (size() != 1) { @@ -130,7 +129,8 @@ const scalarField& graph::y() const return *begin()(); } -scalarField& graph::y() + +Foam::scalarField& Foam::graph::y() { if (size() != 1) { @@ -143,7 +143,10 @@ scalarField& graph::y() } -autoPtr graph::writer::New(const word& graphFormat) +Foam::autoPtr Foam::graph::writer::New +( + const word& graphFormat +) { if (!wordConstructorTablePtr_) { @@ -173,7 +176,7 @@ autoPtr graph::writer::New(const word& graphFormat) } -void graph::writer::writeXY +void Foam::graph::writer::writeXY ( const scalarField& x, const scalarField& y, @@ -187,7 +190,7 @@ void graph::writer::writeXY } -void graph::writeTable(Ostream& os) const +void Foam::graph::writeTable(Ostream& os) const { forAll(x_, xi) { @@ -202,13 +205,13 @@ void graph::writeTable(Ostream& os) const } -void graph::write(Ostream& os, const word& format) const +void Foam::graph::write(Ostream& os, const word& format) const { writer::New(format)().write(*this, os); } -void graph::write(const fileName& fName, const word& format) const +void Foam::graph::write(const fileName& fName, const word& format) const { autoPtr graphWriter(writer::New(format)); @@ -227,7 +230,7 @@ void graph::write(const fileName& fName, const word& format) const } -Ostream& operator<<(Ostream& os, const graph& g) +Foam::Ostream& Foam::operator<<(Ostream& os, const graph& g) { g.writeTable(os); os.check("Ostream& operator<<(Ostream&, const graph&)"); @@ -235,8 +238,4 @@ Ostream& operator<<(Ostream& os, const graph& g) } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/OpenFOAM/matrices/LUscalarMatrix/procLduInterface.C b/src/OpenFOAM/matrices/LUscalarMatrix/procLduInterface.C index e374ea0f76..a66d777dc7 100644 --- a/src/OpenFOAM/matrices/LUscalarMatrix/procLduInterface.C +++ b/src/OpenFOAM/matrices/LUscalarMatrix/procLduInterface.C @@ -58,7 +58,8 @@ Foam::procLduInterface::procLduInterface ( "procLduInterface::procLduInterface" "(const lduInterfaceField&, const scalarField&" - ) << "unknown lduInterface type " << interface.interface().type() + ) << "Unknown lduInterface type " + << interface.interface().type() << exit(FatalError); } } diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixPreconditioner.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixPreconditioner.C index b492ed9821..eb9d9190f0 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixPreconditioner.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixPreconditioner.C @@ -36,8 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -Foam::word -Foam::lduMatrix::preconditioner::getName +Foam::word Foam::lduMatrix::preconditioner::getName ( const dictionary& solverControls ) diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C index f34e5334dc..a9c3516aa8 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C @@ -47,7 +47,7 @@ Foam::autoPtr Foam::lduMatrix::solver::New const dictionary& solverControls ) { - word name(solverControls.lookup("solver")); + const word name(solverControls.lookup("solver")); if (matrix.diagonal()) { diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixTests.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixTests.C index c4c8774098..6ec7861bc8 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixTests.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixTests.C @@ -118,7 +118,7 @@ void Foam::lduMatrix::solverPerformance::print() const } -Foam::lduMatrix::solverPerformance::solverPerformance Foam::max +Foam::lduMatrix::solverPerformance Foam::max ( const lduMatrix::solverPerformance& sp1, const lduMatrix::solverPerformance& sp2 diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C index 4431db24df..9196ad0a12 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C @@ -102,7 +102,7 @@ const Foam::GAMGAgglomeration& Foam::GAMGAgglomeration::New ) ) { - word agglomeratorType(controlDict.lookup("agglomerator")); + const word agglomeratorType(controlDict.lookup("agglomerator")); dlLibraryTable::open ( @@ -157,7 +157,7 @@ const Foam::GAMGAgglomeration& Foam::GAMGAgglomeration::New ) ) { - word agglomeratorType(controlDict.lookup("agglomerator")); + const word agglomeratorType(controlDict.lookup("agglomerator")); dlLibraryTable::open ( diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/GAMGInterfaceField/newGAMGInterfaceField.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/GAMGInterfaceField/GAMGInterfaceFieldNew.C similarity index 93% rename from src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/GAMGInterfaceField/newGAMGInterfaceField.C rename to src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/GAMGInterfaceField/GAMGInterfaceFieldNew.C index c5d1cebda6..b5bd371d93 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/GAMGInterfaceField/newGAMGInterfaceField.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/GAMGInterfaceField/GAMGInterfaceFieldNew.C @@ -33,7 +33,7 @@ Foam::autoPtr Foam::GAMGInterfaceField::New const lduInterfaceField& fineInterface ) { - word coupleType(fineInterface.interfaceFieldType()); + const word coupleType(fineInterface.interfaceFieldType()); lduInterfaceConstructorTable::iterator cstrIter = lduInterfaceConstructorTablePtr_->find(coupleType); @@ -45,7 +45,8 @@ Foam::autoPtr Foam::GAMGInterfaceField::New "GAMGInterfaceField::New" "(const GAMGInterface& GAMGCp, " "const lduInterfaceField& fineInterface)" - ) << "Unknown GAMGInterfaceField type " << coupleType << ".\n" + ) << "Unknown GAMGInterfaceField type " + << coupleType << nl << "Valid GAMGInterfaceField types are :" << lduInterfaceConstructorTablePtr_->sortedToc() << exit(FatalError); diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/newGAMGInterface.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/GAMGInterfaceNew.C similarity index 98% rename from src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/newGAMGInterface.C rename to src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/GAMGInterfaceNew.C index 18a22d2c66..28f6e0481a 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/newGAMGInterface.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/GAMGInterfaceNew.C @@ -38,7 +38,7 @@ Foam::autoPtr Foam::GAMGInterface::New const labelField& neighbourRestrictAddressing ) { - word coupleType(fineInterface.type()); + const word coupleType(fineInterface.type()); lduInterfaceConstructorTable::iterator cstrIter = lduInterfaceConstructorTablePtr_->find(coupleType); diff --git a/src/OpenFOAM/matrices/tolerances/tolerances.C b/src/OpenFOAM/matrices/tolerances/tolerances.C index 487d8ec1a7..dead8a2490 100644 --- a/src/OpenFOAM/matrices/tolerances/tolerances.C +++ b/src/OpenFOAM/matrices/tolerances/tolerances.C @@ -62,7 +62,7 @@ bool tolerances::read() { if (regIOobject::read()) { - word toleranceSetName(lookup("toleranceSet")); + const word toleranceSetName(lookup("toleranceSet")); const dictionary& toleranceSet(subDict(toleranceSetName)); if (toleranceSet.found("relaxationFactors")) diff --git a/src/OpenFOAM/memory/autoPtr/autoPtr.H b/src/OpenFOAM/memory/autoPtr/autoPtr.H index 5f4afc765a..2ade60924a 100644 --- a/src/OpenFOAM/memory/autoPtr/autoPtr.H +++ b/src/OpenFOAM/memory/autoPtr/autoPtr.H @@ -96,7 +96,7 @@ public: // pointer inline void reset(T* = 0); - //- Delete object and set pointer to NULL, if the pointer is valid. + //- Delete object (if the pointer is valid) and set pointer to NULL. inline void clear(); @@ -108,9 +108,7 @@ public: //- Return const reference to the object data inline const T& operator()() const; - // inline T& operator*(); - // inline const T& operator*() const; - + //- Const cast to the underlying type reference inline operator const T&() const; //- Return object pointer @@ -119,7 +117,7 @@ public: //- Return const object pointer inline const T* operator->() const; - //- Take over object pointer from parameter + //- Take over the object pointer from parameter inline void operator=(const autoPtr&); }; diff --git a/src/OpenFOAM/memory/autoPtr/autoPtrI.H b/src/OpenFOAM/memory/autoPtr/autoPtrI.H index 1a6fce01f7..ead0d62640 100644 --- a/src/OpenFOAM/memory/autoPtr/autoPtrI.H +++ b/src/OpenFOAM/memory/autoPtr/autoPtrI.H @@ -80,7 +80,7 @@ inline void Foam::autoPtr::set(T* p) { if (ptr_) { - FatalErrorIn("void autoPtr::set(T*)") + FatalErrorIn("void Foam::autoPtr::set(T*)") << "object already allocated" << abort(FatalError); } @@ -115,7 +115,7 @@ inline T& Foam::autoPtr::operator()() { if (!ptr_) { - FatalErrorIn("T& autoPtr::operator()()") + FatalErrorIn("T& Foam::autoPtr::operator()()") << "object is not allocated" << abort(FatalError); } @@ -129,7 +129,7 @@ inline const T& Foam::autoPtr::operator()() const { if (!ptr_) { - FatalErrorIn("const T& autoPtr::operator()() const") + FatalErrorIn("const T& Foam::autoPtr::operator()() const") << "object is not allocated" << abort(FatalError); } @@ -138,22 +138,6 @@ inline const T& Foam::autoPtr::operator()() const } -/* -template -inline T& Foam::autoPtr::operator*() -{ - return operator()(); -} - - -template -inline const T& Foam::autoPtr::operator*() const -{ - return operator()(); -} -*/ - - template inline Foam::autoPtr::operator const T&() const { @@ -166,7 +150,7 @@ inline T* Foam::autoPtr::operator->() { if (!ptr_) { - FatalErrorIn("autoPtr::operator->()") + FatalErrorIn("Foam::autoPtr::operator->()") << "object is not allocated" << abort(FatalError); } diff --git a/src/OpenFOAM/memory/tmp/refCount.H b/src/OpenFOAM/memory/refCount/refCount.H similarity index 98% rename from src/OpenFOAM/memory/tmp/refCount.H rename to src/OpenFOAM/memory/refCount/refCount.H index 9974ff0cb1..c3b5914211 100644 --- a/src/OpenFOAM/memory/tmp/refCount.H +++ b/src/OpenFOAM/memory/refCount/refCount.H @@ -25,7 +25,7 @@ Class Foam::refCount Description - Reference counter for tmp\. + Reference counter for various OpenFOAM components. \*---------------------------------------------------------------------------*/ diff --git a/src/OpenFOAM/memory/tmp/tmp.H b/src/OpenFOAM/memory/tmp/tmp.H index 90fa6f5684..f1a9f81fae 100644 --- a/src/OpenFOAM/memory/tmp/tmp.H +++ b/src/OpenFOAM/memory/tmp/tmp.H @@ -62,7 +62,7 @@ class tmp //- Pointer to temporary object mutable T* ptr_; - // Const reference to constant object + //- Const reference to constant object const T& ref_; diff --git a/src/OpenFOAM/memory/tmp/tmpI.H b/src/OpenFOAM/memory/tmp/tmpI.H index 144977f727..18c41ae646 100644 --- a/src/OpenFOAM/memory/tmp/tmpI.H +++ b/src/OpenFOAM/memory/tmp/tmpI.H @@ -60,7 +60,7 @@ inline Foam::tmp::tmp(const tmp& t) } else { - FatalErrorIn("tmp::tmp(const tmp&)") + FatalErrorIn("Foam::tmp::tmp(const tmp&)") << "attempted copy of a deallocated temporary" << abort(FatalError); } @@ -116,7 +116,7 @@ inline T* Foam::tmp::ptr() const { if (!ptr_) { - FatalErrorIn("tmp::ptr() const") + FatalErrorIn("Foam::tmp::ptr() const") << "temporary deallocated" << abort(FatalError); } @@ -155,7 +155,7 @@ inline T& Foam::tmp::operator()() { if (!ptr_) { - FatalErrorIn("T& tmp::operator()()") + FatalErrorIn("T& Foam::tmp::operator()()") << "temporary deallocated" << abort(FatalError); } @@ -184,7 +184,7 @@ inline const T& Foam::tmp::operator()() const { if (!ptr_) { - FatalErrorIn("const T& tmp::operator()() const") + FatalErrorIn("const T& Foam::tmp::operator()() const") << "temporary deallocated" << abort(FatalError); } @@ -212,7 +212,7 @@ inline T* Foam::tmp::operator->() { if (!ptr_) { - FatalErrorIn("tmp::operator->()") + FatalErrorIn("Foam::tmp::operator->()") << "temporary deallocated" << abort(FatalError); } @@ -260,14 +260,14 @@ inline void Foam::tmp::operator=(const tmp& t) } else { - FatalErrorIn("tmp::operator=(const tmp& t)") + FatalErrorIn("Foam::tmp::operator=(const tmp&)") << "attempted copy of a deallocated temporary" << abort(FatalError); } } else { - FatalErrorIn("tmp::operator=(const tmp& t)") + FatalErrorIn("Foam::tmp::operator=(const tmp&)") << "attempted to assign to a const reference to constant object" << abort(FatalError); } diff --git a/src/OpenFOAM/meshes/pointMesh/pointPatches/facePointPatch/newFacePointPatch.C b/src/OpenFOAM/meshes/pointMesh/pointPatches/facePointPatch/facePointPatchNew.C similarity index 88% rename from src/OpenFOAM/meshes/pointMesh/pointPatches/facePointPatch/newFacePointPatch.C rename to src/OpenFOAM/meshes/pointMesh/pointPatches/facePointPatch/facePointPatchNew.C index 718bbab1bf..da4f8f6ec5 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointPatches/facePointPatch/newFacePointPatch.C +++ b/src/OpenFOAM/meshes/pointMesh/pointPatches/facePointPatch/facePointPatchNew.C @@ -27,12 +27,7 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -namespace Foam -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -autoPtr facePointPatch::New +Foam::autoPtr Foam::facePointPatch::New ( const polyPatch& patch, const pointBoundaryMesh& bm @@ -57,7 +52,7 @@ autoPtr facePointPatch::New "const pointBoundaryMesh&) : " ) << "Unknown facePointPatch type " << patch.type() - << endl << endl + << nl << nl << "Valid facePointPatch types are :" << endl << polyPatchConstructorTablePtr_->sortedToc() << exit(FatalError); @@ -67,8 +62,4 @@ autoPtr facePointPatch::New } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.C index 99cba70411..d1fd870879 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.C @@ -71,7 +71,7 @@ void Foam::coupledPolyPatch::writeOBJ writeOBJ(os, p1); vertI++; - os<< "l " << vertI-1 << ' ' << vertI << nl; + os << "l " << vertI-1 << ' ' << vertI << nl; } diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.H b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.H index 80da076163..b84f345ebf 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.H +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.H @@ -32,7 +32,7 @@ Description SourceFiles polyPatch.C - newPolyPatch.C + polyPatchNew.C \*---------------------------------------------------------------------------*/ diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/newPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatchNew.C similarity index 93% rename from src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/newPolyPatch.C rename to src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatchNew.C index 2e821e9036..fb77cc19d9 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/newPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatchNew.C @@ -55,8 +55,8 @@ Foam::autoPtr Foam::polyPatch::New ( "polyPatch::New(const word&, const word&, const label, " "const label, const label, const polyBoundaryMesh&) " - ) << "Unknown polyPatch type " << patchType << " for patch " << name - << endl << endl + ) << "Unknown polyPatch type " + << patchType << " for patch " << name << nl << nl << "Valid polyPatch types are :" << endl << wordConstructorTablePtr_->sortedToc() << exit(FatalError); @@ -82,7 +82,6 @@ Foam::autoPtr Foam::polyPatch::New } word patchType(dict.lookup("type")); - dict.readIfPresent("geometricType", patchType); dictionaryConstructorTable::iterator cstrIter = @@ -102,9 +101,8 @@ Foam::autoPtr Foam::polyPatch::New "polyPatch::New(const word&, const dictionary&, " "const label, const polyBoundaryMesh&)", dict - ) << "Unknown polyPatch type " << patchType - << " for patch " << name - << endl << endl + ) << "Unknown polyPatch type " + << patchType << " for patch " << name << nl << nl << "Valid polyPatch types are :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalIOError); diff --git a/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZone.H b/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZone.H index 2186ba2116..fd0dfc5b11 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZone.H +++ b/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZone.H @@ -34,7 +34,7 @@ Description SourceFiles cellZone.C - newCellZone.C + cellZoneNew.C \*---------------------------------------------------------------------------*/ diff --git a/src/OpenFOAM/meshes/polyMesh/zones/cellZone/newCellZone.C b/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZoneNew.C similarity index 94% rename from src/OpenFOAM/meshes/polyMesh/zones/cellZone/newCellZone.C rename to src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZoneNew.C index 3c1efbb1a2..83461c88a4 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/cellZone/newCellZone.C +++ b/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZoneNew.C @@ -43,7 +43,7 @@ Foam::autoPtr Foam::cellZone::New << endl; } - word zoneType(dict.lookup("type")); + const word zoneType(dict.lookup("type")); dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(zoneType); @@ -55,7 +55,8 @@ Foam::autoPtr Foam::cellZone::New "cellZone::New(const word&, const dictionary&, " "const label, const cellZoneMesh&)", dict - ) << "Unknown cellZone type " << zoneType << endl << endl + ) << "Unknown cellZone type " + << zoneType << nl << nl << "Valid cellZone types are:" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalIOError); diff --git a/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.H b/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.H index bdfc52bb58..291d18db74 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.H +++ b/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.H @@ -33,7 +33,7 @@ Description SourceFiles faceZone.C - newFaceZone.C + faceZoneNew.C \*---------------------------------------------------------------------------*/ diff --git a/src/OpenFOAM/meshes/polyMesh/zones/faceZone/newFaceZone.C b/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZoneNew.C similarity index 94% rename from src/OpenFOAM/meshes/polyMesh/zones/faceZone/newFaceZone.C rename to src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZoneNew.C index 8948833404..417c614733 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/faceZone/newFaceZone.C +++ b/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZoneNew.C @@ -43,7 +43,7 @@ Foam::autoPtr Foam::faceZone::New << endl; } - word zoneType(dict.lookup("type")); + const word zoneType(dict.lookup("type")); dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(zoneType); @@ -55,7 +55,8 @@ Foam::autoPtr Foam::faceZone::New "faceZone::New(const word&, const dictionary&, " "const label, const faceZoneMesh&)", dict - ) << "Unknown faceZone type " << zoneType << endl << endl + ) << "Unknown faceZone type " + << zoneType << nl << nl << "Valid faceZone types are:" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalIOError); diff --git a/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZone.H b/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZone.H index 44f510d958..0aaf2a6a05 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZone.H +++ b/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZone.H @@ -35,7 +35,7 @@ Description SourceFiles pointZone.C - newPointZone.C + pointZoneNew.C \*---------------------------------------------------------------------------*/ diff --git a/src/OpenFOAM/meshes/polyMesh/zones/pointZone/newPointZone.C b/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZoneNew.C similarity index 94% rename from src/OpenFOAM/meshes/polyMesh/zones/pointZone/newPointZone.C rename to src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZoneNew.C index bac22f1e18..90f739c782 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/pointZone/newPointZone.C +++ b/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZoneNew.C @@ -43,7 +43,7 @@ Foam::autoPtr Foam::pointZone::New << endl; } - word zoneType(dict.lookup("type")); + const word zoneType(dict.lookup("type")); dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(zoneType); @@ -55,7 +55,8 @@ Foam::autoPtr Foam::pointZone::New "pointZone::New(const word&, const dictionary&, " "const label, const pointZoneMesh&)", dict - ) << "Unknown pointZone type " << zoneType << endl << endl + ) << "Unknown pointZone type " + << zoneType << nl << nl << "Valid pointZone types are:" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalIOError); diff --git a/src/OpenFOAM/meshes/primitiveShapes/plane/plane.C b/src/OpenFOAM/meshes/primitiveShapes/plane/plane.C index 9fadac3ca5..5cdc5e9d89 100644 --- a/src/OpenFOAM/meshes/primitiveShapes/plane/plane.C +++ b/src/OpenFOAM/meshes/primitiveShapes/plane/plane.C @@ -189,7 +189,7 @@ Foam::plane::plane(const dictionary& dict) unitVector_(vector::zero), basePoint_(point::zero) { - word planeType(dict.lookup("planeType")); + const word planeType(dict.lookup("planeType")); if (planeType == "planeEquation") { diff --git a/src/OpenFOAM/primitives/bools/Switch/Switch.C b/src/OpenFOAM/primitives/bools/Switch/Switch.C index 4def20a77c..0b87ca6e27 100644 --- a/src/OpenFOAM/primitives/bools/Switch/Switch.C +++ b/src/OpenFOAM/primitives/bools/Switch/Switch.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -44,23 +44,17 @@ const char* Foam::Switch::names[Foam::Switch::INVALID+1] = // * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * * // -Foam::Switch::switchType Foam::Switch::asEnum(const bool b) -{ - return b ? Switch::TRUE : Switch::FALSE; -} - - Foam::Switch::switchType Foam::Switch::asEnum ( const std::string& str, const bool allowInvalid ) { - for (int sw = 0; sw < Switch::INVALID; sw++) + for (int sw = 0; sw < Switch::INVALID; ++sw) { if (str == names[sw]) { - // convert n/y to no/yes (perhaps should deprecate y/n) + // convert n/y to no/yes - perhaps should deprecate y/n if (sw == Switch::NO_1 || sw == Switch::NONE) { return Switch::NO; @@ -78,57 +72,12 @@ Foam::Switch::switchType Foam::Switch::asEnum if (!allowInvalid) { - FatalErrorIn("Switch::asEnum(const std::string&)") + FatalErrorIn("Switch::asEnum(const std::string&, const bool)") << "unknown switch word " << str << nl << abort(FatalError); } - return INVALID; -} - - -bool Foam::Switch::asBool(const switchType sw) -{ - // relies on (INVALID & 0x1) evaluating to false - return (sw & 0x1); -} - - -bool Foam::Switch::asBool -( - const std::string& str, - const bool allowInvalid -) -{ - // allow invalid values, but catch after for correct error message - switchType sw = asEnum(str, true); - - if (sw == Switch::INVALID) - { - if (!allowInvalid) - { - FatalErrorIn("Switch::asBool(const std::string&)") - << "unknown switch word " << str << nl - << abort(FatalError); - } - - return false; - } - - - return (sw & 0x1); -} - - -const char* Foam::Switch::asText(const bool b) -{ - return b ? names[Switch::TRUE] : names[Switch::FALSE]; -} - - -const char* Foam::Switch::asText(const switchType sw) -{ - return names[sw]; + return Switch::INVALID; } @@ -145,6 +94,18 @@ Foam::Switch Foam::Switch::lookupOrAddToDict // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // +bool Foam::Switch::valid() const +{ + return switch_ <= Switch::NONE; +} + + +const char* Foam::Switch::asText() const +{ + return names[switch_]; +} + + bool Foam::Switch::readIfPresent(const word& name, const dictionary& dict) { return dict.readIfPresent(name, *this); diff --git a/src/OpenFOAM/primitives/bools/Switch/Switch.H b/src/OpenFOAM/primitives/bools/Switch/Switch.H index 2a4e22f227..e68be1a2de 100644 --- a/src/OpenFOAM/primitives/bools/Switch/Switch.H +++ b/src/OpenFOAM/primitives/bools/Switch/Switch.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -48,11 +48,11 @@ namespace Foam // Forward declaration of friend functions and operators class Switch; +class dictionary; Istream& operator>>(Istream&, Switch&); Ostream& operator<<(Ostream&, const Switch&); -class dictionary; /*---------------------------------------------------------------------------*\ Class Switch Declaration @@ -60,8 +60,6 @@ class dictionary; class Switch { -private: - // Private data //- The logic and enumerated text representation stored as a single byte @@ -71,19 +69,21 @@ public: // Public data types + // avoid issues with pre-processor defines + #undef FALSE + #undef TRUE + #undef OFF + #undef ON + #undef NO + #undef YES + #undef NO_1 + #undef YES_1 + #undef NONE + #undef PLACEHOLDER + #undef INVALID + //- The various text representations for a switch value. // These also correspond to the entries in names. -# undef FALSE -# undef TRUE -# undef OFF -# undef ON -# undef NO -# undef YES -# undef NO_1 -# undef YES_1 -# undef NONE -# undef PLACEHOLDER -# undef INVALID enum switchType { FALSE = 0, TRUE = 1, @@ -94,7 +94,6 @@ public: INVALID }; - // Static data members //- The set of names corresponding to the switchType enumeration @@ -102,36 +101,15 @@ public: static const char* names[INVALID+1]; +private: + // Static Member Functions - //- Return a switchType representation of a bool - static switchType asEnum(const bool); - //- Return a switchType representation of a word - // Optionally allow bad words, and catch the error elsewhere - static switchType asEnum - ( - const std::string&, - const bool allowInvalid=false - ); + static switchType asEnum(const std::string&, const bool allowInvalid); - //- Return a bool representation of a switchType - static bool asBool(const switchType); - - //- Return a bool representation of a word - // Optionally allow bad words, and catch the error elsewhere - static bool asBool - ( - const std::string&, - const bool allowInvalid=false - ); - - //- Return a text representation of a bool value - static const char* asText(const bool); - - //- Return a text representation of a switchType - static const char* asText(const switchType); +public: // Constructors @@ -141,28 +119,36 @@ public: switch_(Switch::FALSE) {} - //- Construct from bool - Switch(const bool value) + //- Construct from enumerated value + Switch(const switchType sw) : - switch_(asEnum(value)) + switch_(sw) + {} + + //- Construct from bool + Switch(const bool b) + : + switch_(b ? Switch::TRUE : Switch::FALSE) {} //- Construct from integer values (treats integer as bool value) - Switch(const int value) + Switch(const int i) : - switch_(asEnum(bool(value))) + switch_(i ? Switch::TRUE : Switch::FALSE) {} //- Construct from std::string, string, word - Switch(const std::string& value) + // Optionally allow bad words, and catch the error elsewhere + Switch(const std::string& str, const bool allowInvalid=false) : - switch_(asEnum(value)) + switch_(asEnum(str, allowInvalid)) {} //- Construct from character array - Switch(const char* value) + // Optionally allow bad words, and catch the error elsewhere + Switch(const char* str, const bool allowInvalid=false) : - switch_(asEnum(std::string(value))) + switch_(asEnum(std::string(str), allowInvalid)) {} //- Construct from Istream @@ -178,6 +164,18 @@ public: ); + // Member Functions + + //- Return true if the Switch has a valid value + bool valid() const; + + //- Return a text representation of the Switch + const char* asText() const; + + //- Update the value of the Switch if it is found in the dictionary + bool readIfPresent(const word&, const dictionary&); + + // Member Operators //- Conversion to bool @@ -186,6 +184,13 @@ public: return (switch_ & 0x1); } + //- Assignment from enumerated value + const Switch& operator=(const switchType sw) + { + switch_ = sw; + return *this; + } + //- Assignment from bool const Switch& operator=(const bool b) { @@ -194,12 +199,6 @@ public: } - // Member fuctions - - //- Update the value of the Switch if it is found in the dictionary - bool readIfPresent(const word&, const dictionary&); - - // IOstream Operators friend Istream& operator>>(Istream&, Switch&); diff --git a/src/OpenFOAM/primitives/bools/Switch/SwitchIO.C b/src/OpenFOAM/primitives/bools/Switch/SwitchIO.C index f55b49bc91..cf217ba468 100644 --- a/src/OpenFOAM/primitives/bools/Switch/SwitchIO.C +++ b/src/OpenFOAM/primitives/bools/Switch/SwitchIO.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -48,26 +48,26 @@ Foam::Istream& Foam::operator>>(Istream& is, Switch& s) if (t.isLabel()) { - s.switch_ = Switch::asEnum(bool(t.labelToken())); + s = bool(t.labelToken()); } else if (t.isWord()) { // allow invalid values, but catch after for correct error message - Switch::switchType sw = Switch::asEnum(t.wordToken(), true); + Switch sw(t.wordToken(), true); - if (sw == Switch::INVALID) + if (sw.valid()) + { + s = sw; + } + else { is.setBad(); - FatalIOErrorIn("operator>>(Istream&, Switch&)", is) + FatalIOErrorIn("operator>>(Istream&, bool/Switch&)", is) << "expected 'true/false', 'on/off' ... found " << t.wordToken() << exit(FatalIOError); return is; } - else - { - s.switch_ = sw; - } } else { diff --git a/src/OpenFOAM/primitives/bools/bool/boolIO.C b/src/OpenFOAM/primitives/bools/bool/boolIO.C index 607a2437e4..88b5139f32 100644 --- a/src/OpenFOAM/primitives/bools/bool/boolIO.C +++ b/src/OpenFOAM/primitives/bools/bool/boolIO.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -50,7 +50,7 @@ Foam::Istream& Foam::operator>>(Istream& is, bool& b) Foam::Ostream& Foam::operator<<(Ostream& os, const bool b) { // we could also write as text string without any difficulty - // os << Switch::asText(b); + // os << (b ? "true" : "false"); os.write(label(b)); os.check("Ostream& operator<<(Ostream&, const bool)"); return os; @@ -59,10 +59,10 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const bool b) bool Foam::readBool(Istream& is) { - bool val; - is >> val; + bool b; + is >> b; - return val; + return b; } diff --git a/src/Pstream/gamma/Make/options b/src/Pstream/gamma/Make/options index 90632e801e..74b6659671 100644 --- a/src/Pstream/gamma/Make/options +++ b/src/Pstream/gamma/Make/options @@ -1,4 +1,5 @@ -include $(RULES)/mplib$(WM_MPLIB) +sinclude $(GENERAL_RULES)/mplib$(WM_MPLIB) +sinclude $(RULES)/mplib$(WM_MPLIB) -EXE_INC = $(PFLAGS) $(PINC) +EXE_INC = $(PFLAGS) $(PINC) LIB_LIBS = $(PLIBS) diff --git a/src/Pstream/mpi/Make/options b/src/Pstream/mpi/Make/options index 90632e801e..74b6659671 100644 --- a/src/Pstream/mpi/Make/options +++ b/src/Pstream/mpi/Make/options @@ -1,4 +1,5 @@ -include $(RULES)/mplib$(WM_MPLIB) +sinclude $(GENERAL_RULES)/mplib$(WM_MPLIB) +sinclude $(RULES)/mplib$(WM_MPLIB) -EXE_INC = $(PFLAGS) $(PINC) +EXE_INC = $(PFLAGS) $(PINC) LIB_LIBS = $(PLIBS) diff --git a/src/conversion/ensight/part/ensightPart.C b/src/conversion/ensight/part/ensightPart.C index 2321946d3a..b20990137c 100644 --- a/src/conversion/ensight/part/ensightPart.C +++ b/src/conversion/ensight/part/ensightPart.C @@ -128,7 +128,7 @@ Foam::ensightPart::ensightPart(const ensightPart& part) Foam::autoPtr Foam::ensightPart::New(Istream& is) { - word partType(is); + const word partType(is); istreamConstructorTable::iterator cstrIter = istreamConstructorTablePtr_->find(partType); @@ -139,7 +139,8 @@ Foam::autoPtr Foam::ensightPart::New(Istream& is) ( "ensightPart::New(Istream&)", is - ) << "unknown ensightPart type " << partType << endl << endl + ) << "unknown ensightPart type " + << partType << nl << nl << "Valid ensightPart types are :" << endl << istreamConstructorTablePtr_->sortedToc() << exit(FatalIOError); diff --git a/src/dynamicFvMesh/Make/files b/src/dynamicFvMesh/Make/files index ca9a99aca6..ecfb8bc9f7 100644 --- a/src/dynamicFvMesh/Make/files +++ b/src/dynamicFvMesh/Make/files @@ -1,5 +1,5 @@ dynamicFvMesh/dynamicFvMesh.C -dynamicFvMesh/newDynamicFvMesh.C +dynamicFvMesh/dynamicFvMeshNew.C staticFvMesh/staticFvMesh.C dynamicMotionSolverFvMesh/dynamicMotionSolverFvMesh.C dynamicInkJetFvMesh/dynamicInkJetFvMesh.C @@ -8,7 +8,7 @@ dynamicRefineFvMesh/dynamicRefineFvMesh.C solidBodyMotionFvMesh/solidBodyMotionFvMesh.C solidBodyMotionFunctions = solidBodyMotionFvMesh/solidBodyMotionFunctions $(solidBodyMotionFunctions)/solidBodyMotionFunction/solidBodyMotionFunction.C -$(solidBodyMotionFunctions)/solidBodyMotionFunction/newSolidBodyMotionFunction.C +$(solidBodyMotionFunctions)/solidBodyMotionFunction/solidBodyMotionFunctionNew.C $(solidBodyMotionFunctions)/SDA/SDA.C $(solidBodyMotionFunctions)/tabulated6DoFMotion/tabulated6DoFMotion.C $(solidBodyMotionFunctions)/linearMotion/linearMotion.C diff --git a/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMesh.H b/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMesh.H index 31d68d43ef..adfd30fb2c 100644 --- a/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMesh.H +++ b/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMesh.H @@ -29,7 +29,7 @@ Description SourceFiles dynamicFvMesh.C - newDynamicFvMesh.C + dynamicFvMeshNew.C \*---------------------------------------------------------------------------*/ diff --git a/src/dynamicFvMesh/dynamicFvMesh/newDynamicFvMesh.C b/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMeshNew.C similarity index 86% rename from src/dynamicFvMesh/dynamicFvMesh/newDynamicFvMesh.C rename to src/dynamicFvMesh/dynamicFvMesh/dynamicFvMeshNew.C index 536c397923..9a4c920dfa 100644 --- a/src/dynamicFvMesh/dynamicFvMesh/newDynamicFvMesh.C +++ b/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMeshNew.C @@ -31,10 +31,8 @@ License Foam::autoPtr Foam::dynamicFvMesh::New(const IOobject& io) { - // Enclose the creation of the dynamicMesh to ensure it is - // deleted before the dynamicFvMesh is created otherwise the dictionary - // is entered in the database twice - IOdictionary dynamicMeshDict + // do not register the dictionary + IOdictionary dict ( IOobject ( @@ -47,13 +45,13 @@ Foam::autoPtr Foam::dynamicFvMesh::New(const IOobject& io) ) ); - word dynamicFvMeshTypeName(dynamicMeshDict.lookup("dynamicFvMesh")); + const word dynamicFvMeshTypeName(dict.lookup("dynamicFvMesh")); Info<< "Selecting dynamicFvMesh " << dynamicFvMeshTypeName << endl; dlLibraryTable::open ( - dynamicMeshDict, + dict, "dynamicFvMeshLibs", IOobjectConstructorTablePtr_ ); @@ -75,8 +73,8 @@ Foam::autoPtr Foam::dynamicFvMesh::New(const IOobject& io) FatalErrorIn ( "dynamicFvMesh::New(const IOobject&)" - ) << "Unknown dynamicFvMesh type " << dynamicFvMeshTypeName - << endl << endl + ) << "Unknown dynamicFvMesh type " + << dynamicFvMeshTypeName << nl << nl << "Valid dynamicFvMesh types are :" << endl << IOobjectConstructorTablePtr_->sortedToc() << exit(FatalError); diff --git a/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.C b/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.C index 9d5da95de0..5ecd3efdb9 100644 --- a/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.C +++ b/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.C @@ -332,7 +332,7 @@ Foam::dynamicRefineFvMesh::refine const fvsPatchScalarField& patchPhiU = phiU.boundaryField()[patchI]; - label faceI = patchPhi.patch().patch().start(); + label faceI = patchPhi.patch().start(); forAll(patchPhi, i) { @@ -1072,9 +1072,9 @@ bool Foam::dynamicRefineFvMesh::update() << exit(FatalError); } - word field(refineDict.lookup("field")); + const word fieldName(refineDict.lookup("field")); - const volScalarField& vFld = lookupObject(field); + const volScalarField& vFld = lookupObject(fieldName); const scalar lowerRefineLevel = readScalar(refineDict.lookup("lowerRefineLevel")); diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.H b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.H index 0f0bcb7787..367649d076 100644 --- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.H +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.H @@ -36,7 +36,7 @@ Description SourceFiles solidBodyMotionFunction.C - newDynamicFvMesh.C + dynamicFvMeshNew.C \*---------------------------------------------------------------------------*/ diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/solidBodyMotionFunction/newSolidBodyMotionFunction.C b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunctionNew.C similarity index 83% rename from src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/solidBodyMotionFunction/newSolidBodyMotionFunction.C rename to src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunctionNew.C index 3619122c6b..abc90561ae 100644 --- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/solidBodyMotionFunction/newSolidBodyMotionFunction.C +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunctionNew.C @@ -33,14 +33,12 @@ Foam::autoPtr Foam::solidBodyMotionFunction::New const Time& runTime ) { - word solidBodyMotionFunctionTypeName = - SBMFCoeffs.lookup("solidBodyMotionFunction"); + const word motionType(SBMFCoeffs.lookup("solidBodyMotionFunction")); - Info<< "Selecting solid-body motion function " - << solidBodyMotionFunctionTypeName << endl; + Info<< "Selecting solid-body motion function " << motionType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(solidBodyMotionFunctionTypeName); + dictionaryConstructorTablePtr_->find(motionType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -52,8 +50,8 @@ Foam::autoPtr Foam::solidBodyMotionFunction::New " const Time& runTime" ")" ) << "Unknown solidBodyMotionFunction type " - << solidBodyMotionFunctionTypeName << endl << endl - << "Valid solidBodyMotionFunctions are : " << endl + << motionType << nl << nl + << "Valid solidBodyMotionFunctions are : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/dynamicMesh/Make/files b/src/dynamicMesh/Make/files index 8201b7236d..02e9ad7ce4 100644 --- a/src/dynamicMesh/Make/files +++ b/src/dynamicMesh/Make/files @@ -19,7 +19,7 @@ $(enrichedPatch)/enrichedPatchMasterPoints.C polyMeshModifier = polyTopoChange/polyMeshModifier $(polyMeshModifier)/polyMeshModifier.C -$(polyMeshModifier)/newPolyMeshModifier.C +$(polyMeshModifier)/polyMeshModifierNew.C polyTopoChange/polyTopoChange/topoAction/topoActions.C polyTopoChange/polyTopoChanger/polyTopoChanger.C diff --git a/src/dynamicMesh/fvMeshDistribute/fvMeshDistributeTemplates.C b/src/dynamicMesh/fvMeshDistribute/fvMeshDistributeTemplates.C index 588dda7566..5d29abaf90 100644 --- a/src/dynamicMesh/fvMeshDistribute/fvMeshDistributeTemplates.C +++ b/src/dynamicMesh/fvMeshDistribute/fvMeshDistributeTemplates.C @@ -186,7 +186,7 @@ void Foam::fvMeshDistribute::mapBoundaryFields forAll(bfld, patchI) { fvsPatchField& patchFld = bfld[patchI]; - label faceI = patchFld.patch().patch().start(); + label faceI = patchFld.patch().start(); forAll(patchFld, i) { diff --git a/src/dynamicMesh/meshCut/cellCuts/cellCuts.C b/src/dynamicMesh/meshCut/cellCuts/cellCuts.C index e429782622..0a856360c4 100644 --- a/src/dynamicMesh/meshCut/cellCuts/cellCuts.C +++ b/src/dynamicMesh/meshCut/cellCuts/cellCuts.C @@ -3036,12 +3036,12 @@ void Foam::cellCuts::writeOBJ vertI++; } - os << 'f'; + os << 'f'; forAll(loopPts, fp) { os << ' ' << startVertI + fp + 1; } - os<< endl; + os << endl; } diff --git a/src/dynamicMesh/meshCut/cellLooper/cellLooper.C b/src/dynamicMesh/meshCut/cellLooper/cellLooper.C index 0dbb3e7377..8484897761 100644 --- a/src/dynamicMesh/meshCut/cellLooper/cellLooper.C +++ b/src/dynamicMesh/meshCut/cellLooper/cellLooper.C @@ -28,36 +28,33 @@ License #include "ListOps.H" #include "meshTools.H" - +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -defineTypeNameAndDebug(cellLooper, 0); -defineRunTimeSelectionTable(cellLooper, word); + defineTypeNameAndDebug(cellLooper, 0); + defineRunTimeSelectionTable(cellLooper, word); +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// Construct named object from given arguments -autoPtr cellLooper::New +Foam::autoPtr Foam::cellLooper::New ( const word& type, const polyMesh& mesh ) { wordConstructorTable::iterator cstrIter = - wordConstructorTablePtr_ - ->find(type); + wordConstructorTablePtr_->find(type); if (cstrIter == wordConstructorTablePtr_->end()) { FatalErrorIn ( "cellLooper::New(const word&, const polyMesh&)" - ) << "Unknown set type " << type - << endl << endl + ) << "Unknown set type " + << type << nl << nl << "Valid cellLooper types : " << endl << wordConstructorTablePtr_->sortedToc() << exit(FatalError); @@ -66,7 +63,6 @@ autoPtr cellLooper::New return autoPtr(cstrIter()(mesh)); } -} // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -207,7 +203,6 @@ Foam::label Foam::cellLooper::getMisAlignedEdge // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::cellLooper::cellLooper(const polyMesh& mesh) : edgeVertex(mesh) diff --git a/src/dynamicMesh/meshCut/directions/directions.C b/src/dynamicMesh/meshCut/directions/directions.C index 0ea45f5f04..b49dc435dc 100644 --- a/src/dynamicMesh/meshCut/directions/directions.C +++ b/src/dynamicMesh/meshCut/directions/directions.C @@ -303,7 +303,7 @@ Foam::directions::directions label nDirs = 0; - word coordSystem(dict.lookup("coordinateSystem")); + const word coordSystem(dict.lookup("coordinateSystem")); if (coordSystem == "global") { @@ -341,7 +341,7 @@ Foam::directions::directions { const dictionary& patchDict = dict.subDict("patchLocalCoeffs"); - word patchName(patchDict.lookup("patch")); + const word patchName(patchDict.lookup("patch")); label patchI = mesh.boundaryMesh().findPatchID(patchName); @@ -352,7 +352,8 @@ Foam::directions::directions "directions::directions(const polyMesh&, const dictionary&," "const twoDPointCorrector*" ) << "Cannot find patch " - << patchName << exit(FatalError); + << patchName + << exit(FatalError); } // Take zeroth face on patch @@ -440,7 +441,8 @@ Foam::directions::directions "const twoDPointCorrector*" ) << "Unknown coordinate system " << coordSystem << endl - << "Known types are global and patchLocal" << exit(FatalError); + << "Known types are global and patchLocal" + << exit(FatalError); } } diff --git a/src/dynamicMesh/motionSolver/motionSolver.C b/src/dynamicMesh/motionSolver/motionSolver.C index 764ad193ad..efc29c2afc 100644 --- a/src/dynamicMesh/motionSolver/motionSolver.C +++ b/src/dynamicMesh/motionSolver/motionSolver.C @@ -75,7 +75,7 @@ Foam::autoPtr Foam::motionSolver::New(const polyMesh& mesh) Istream& msData = solverDict.lookup("solver"); - word solverTypeName(msData); + const word solverTypeName(msData); Info<< "Selecting motion solver: " << solverTypeName << endl; @@ -103,9 +103,9 @@ Foam::autoPtr Foam::motionSolver::New(const polyMesh& mesh) FatalErrorIn ( "motionSolver::New(const polyMesh& mesh)" - ) << "Unknown solver type " << solverTypeName - << endl << endl - << "Valid solver types are: " << endl + ) << "Unknown solver type " + << solverTypeName << nl << nl + << "Valid solver types are:" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/dynamicMesh/polyTopoChange/polyMeshModifier/newPolyMeshModifier.C b/src/dynamicMesh/polyTopoChange/polyMeshModifier/polyMeshModifierNew.C similarity index 83% rename from src/dynamicMesh/polyTopoChange/polyMeshModifier/newPolyMeshModifier.C rename to src/dynamicMesh/polyTopoChange/polyMeshModifier/polyMeshModifierNew.C index f900853459..4a34685eba 100644 --- a/src/dynamicMesh/polyTopoChange/polyMeshModifier/newPolyMeshModifier.C +++ b/src/dynamicMesh/polyTopoChange/polyMeshModifier/polyMeshModifierNew.C @@ -26,14 +26,9 @@ License #include "polyMeshModifier.H" #include "dictionary.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -autoPtr polyMeshModifier::New +Foam::autoPtr Foam::polyMeshModifier::New ( const word& name, const dictionary& dict, @@ -49,10 +44,10 @@ autoPtr polyMeshModifier::New << endl; } - word patchType(dict.lookup("type")); + const word modifierType(dict.lookup("type")); dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(patchType); + dictionaryConstructorTablePtr_->find(modifierType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -61,7 +56,8 @@ autoPtr polyMeshModifier::New "polyMeshModifier::New(const word&, const dictionary&, " "const label, const polyMesh&)", dict - ) << "Unknown polyMeshModifier type " << patchType << endl << endl + ) << "Unknown polyMeshModifier type " + << modifierType << nl << nl << "Valid polyMeshModifier types are :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalIOError); @@ -71,8 +67,4 @@ autoPtr polyMeshModifier::New } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/edgeMesh/edgeMeshNew.C b/src/edgeMesh/edgeMeshNew.C index 4dce59a4c2..c212758c12 100644 --- a/src/edgeMesh/edgeMeshNew.C +++ b/src/edgeMesh/edgeMeshNew.C @@ -27,8 +27,11 @@ License // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::autoPtr< Foam::edgeMesh > -Foam::edgeMesh::New(const fileName& name, const word& ext) +Foam::autoPtr Foam::edgeMesh::New +( + const fileName& name, + const word& ext +) { fileExtensionConstructorTable::iterator cstrIter = fileExtensionConstructorTablePtr_->find(ext); @@ -49,8 +52,10 @@ Foam::edgeMesh::New(const fileName& name, const word& ext) } -Foam::autoPtr< Foam::edgeMesh > -Foam::edgeMesh::New(const fileName& name) +Foam::autoPtr Foam::edgeMesh::New +( + const fileName& name +) { word ext = name.ext(); if (ext == "gz") diff --git a/src/engine/Make/files b/src/engine/Make/files index 81cb8ea6ba..a11ecaf06f 100644 --- a/src/engine/Make/files +++ b/src/engine/Make/files @@ -8,7 +8,7 @@ engineValve/engineValve.C enginePiston/enginePiston.C engineMesh/engineMesh/engineMesh.C -engineMesh/engineMesh/newEngineMesh.C +engineMesh/engineMesh/engineMeshNew.C engineMesh/staticEngineMesh/staticEngineMesh.C engineMesh/layeredEngineMesh/layeredEngineMesh.C engineMesh/fvMotionSolverEngineMesh/fvMotionSolverEngineMesh.C diff --git a/src/engine/engineMesh/engineMesh/newEngineMesh.C b/src/engine/engineMesh/engineMesh/engineMeshNew.C similarity index 78% rename from src/engine/engineMesh/engineMesh/newEngineMesh.C rename to src/engine/engineMesh/engineMesh/engineMeshNew.C index 16db348f1f..b827036fd3 100644 --- a/src/engine/engineMesh/engineMesh/newEngineMesh.C +++ b/src/engine/engineMesh/engineMesh/engineMeshNew.C @@ -33,13 +33,11 @@ Foam::autoPtr Foam::engineMesh::New const Foam::IOobject& io ) { - word engineMeshTypeName; - - // Enclose the creation of the engineGeometry to ensure it is - // deleted before the engineMesh is created otherwise the dictionary - // is entered in the database twice - { - IOdictionary engineGeometryDict + // get model name, but do not register the dictionary + // otherwise it is registered in the database twice + const word modelType + ( + IOdictionary ( IOobject ( @@ -50,23 +48,21 @@ Foam::autoPtr Foam::engineMesh::New IOobject::NO_WRITE, false ) - ); + ).lookup("engineMesh") + ); - engineGeometryDict.lookup("engineMesh") >> engineMeshTypeName; - } - - Info<< "Selecting engineMesh " << engineMeshTypeName << endl; + Info<< "Selecting engineMesh " << modelType << endl; IOobjectConstructorTable::iterator cstrIter = - IOobjectConstructorTablePtr_->find(engineMeshTypeName); + IOobjectConstructorTablePtr_->find(modelType); if (cstrIter == IOobjectConstructorTablePtr_->end()) { FatalErrorIn ( "engineMesh::New(const IOobject&)" - ) << "Unknown engineMesh type " << engineMeshTypeName - << endl << endl + ) << "Unknown engineMesh type " + << modelType << nl << nl << "Valid engineMesh types are :" << endl << IOobjectConstructorTablePtr_->sortedToc() << exit(FatalError); diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index c4b4424264..581f53638a 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -9,7 +9,7 @@ $(fvBoundaryMesh)/fvBoundaryMesh.C fvPatches = fvMesh/fvPatches $(fvPatches)/fvPatch/fvPatch.C -$(fvPatches)/fvPatch/newFvPatch.C +$(fvPatches)/fvPatch/fvPatchNew.C basicFvPatches = $(fvPatches)/basic $(basicFvPatches)/coupled/coupledFvPatch.C @@ -192,7 +192,9 @@ $(interpolation)/interpolationCellPointWallModified/cellPointWeightWallModified/ $(interpolation)/interpolationCellPointWallModified/makeInterpolationCellPointWallModified.C volPointInterpolation = interpolation/volPointInterpolation -/* $(volPointInterpolation)/pointPatchInterpolation/pointPatchInterpolation.C */ +/* +$(volPointInterpolation)/pointPatchInterpolation/pointPatchInterpolation.C +*/ $(volPointInterpolation)/volPointInterpolation.C surfaceInterpolation = interpolation/surfaceInterpolation @@ -310,8 +312,10 @@ $(snGradSchemes)/snGradScheme/snGradSchemes.C $(snGradSchemes)/correctedSnGrad/correctedSnGrads.C $(snGradSchemes)/limitedSnGrad/limitedSnGrads.C $(snGradSchemes)/uncorrectedSnGrad/uncorrectedSnGrads.C -//$(snGradSchemes)/quadraticFitSnGrad/quadraticFitSnGradData.C -//$(snGradSchemes)/quadraticFitSnGrad/quadraticFitSnGrads.C +/* +$(snGradSchemes)/quadraticFitSnGrad/quadraticFitSnGradData.C +$(snGradSchemes)/quadraticFitSnGrad/quadraticFitSnGrads.C +*/ convectionSchemes = finiteVolume/convectionSchemes $(convectionSchemes)/convectionScheme/convectionSchemes.C @@ -339,7 +343,7 @@ $(MRF)/MRFZones.C SRF = $(general)/SRF $(SRF)/SRFModel/SRFModel/SRFModel.C -$(SRF)/SRFModel/SRFModel/newSRFModel.C +$(SRF)/SRFModel/SRFModel/SRFModelNew.C $(SRF)/SRFModel/rpm/rpm.C $(SRF)/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.C diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZone.C b/src/finiteVolume/cfdTools/general/MRF/MRFZone.C index e8ca39b089..ffa1d2bc6a 100644 --- a/src/finiteVolume/cfdTools/general/MRF/MRFZone.C +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZone.C @@ -375,6 +375,45 @@ void Foam::MRFZone::relativeVelocity(volVectorField& U) const } +void Foam::MRFZone::absoluteVelocity(volVectorField& U) const +{ + const volVectorField& C = mesh_.C(); + + const vector& origin = origin_.value(); + const vector& Omega = Omega_.value(); + + const labelList& cells = mesh_.cellZones()[cellZoneID_]; + + forAll(cells, i) + { + label celli = cells[i]; + U[celli] += (Omega ^ (C[celli] - origin)); + } + + // Included patches + forAll(includedFaces_, patchi) + { + forAll(includedFaces_[patchi], i) + { + label patchFacei = includedFaces_[patchi][i]; + U.boundaryField()[patchi][patchFacei] = + (Omega ^ (C.boundaryField()[patchi][patchFacei] - origin)); + } + } + + // Excluded patches + forAll(excludedFaces_, patchi) + { + forAll(excludedFaces_[patchi], i) + { + label patchFacei = excludedFaces_[patchi][i]; + U.boundaryField()[patchi][patchFacei] += + (Omega ^ (C.boundaryField()[patchi][patchFacei] - origin)); + } + } +} + + void Foam::MRFZone::relativeFlux(surfaceScalarField& phi) const { relativeRhoFlux(geometricOneField(), phi); diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZone.H b/src/finiteVolume/cfdTools/general/MRF/MRFZone.H index d925f70392..c9b0429951 100644 --- a/src/finiteVolume/cfdTools/general/MRF/MRFZone.H +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZone.H @@ -175,6 +175,9 @@ public: //- Make the given absolute velocity relative within the MRF region void relativeVelocity(volVectorField& U) const; + //- Make the given relative velocity absolute within the MRF region + void absoluteVelocity(volVectorField& U) const; + //- Make the given absolute flux relative within the MRF region void relativeFlux(surfaceScalarField& phi) const; diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZones.C b/src/finiteVolume/cfdTools/general/MRF/MRFZones.C index d95d20ab0e..5ceb48af51 100644 --- a/src/finiteVolume/cfdTools/general/MRF/MRFZones.C +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZones.C @@ -86,6 +86,15 @@ void Foam::MRFZones::relativeVelocity(volVectorField& U) const } +void Foam::MRFZones::absoluteVelocity(volVectorField& U) const +{ + forAll(*this, i) + { + operator[](i).absoluteVelocity(U); + } +} + + void Foam::MRFZones::relativeFlux(surfaceScalarField& phi) const { forAll(*this, i) diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZones.H b/src/finiteVolume/cfdTools/general/MRF/MRFZones.H index 53a561a9e8..ae7f4c374f 100644 --- a/src/finiteVolume/cfdTools/general/MRF/MRFZones.H +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZones.H @@ -81,6 +81,9 @@ public: //- Make the given absolute velocity relative within the MRF region void relativeVelocity(volVectorField& U) const; + //- Make the given relative velocity absolute within the MRF region + void absoluteVelocity(volVectorField& U) const; + //- Make the given absolute flux relative within the MRF region void relativeFlux(surfaceScalarField& phi) const; diff --git a/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/newSRFModel.C b/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModelNew.C similarity index 69% rename from src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/newSRFModel.C rename to src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModelNew.C index d181f56835..5c2eb2ea76 100644 --- a/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/newSRFModel.C +++ b/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModelNew.C @@ -25,27 +25,18 @@ License #include "SRFModel.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace SRF -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -autoPtr SRFModel::New +Foam::autoPtr Foam::SRF::SRFModel::New ( const volVectorField& Urel ) { - word SRFModelTypeName; - - // Enclose the creation of the SRFPropertiesDict to ensure it is - // deleted before the SRFModel is created - otherwise the dictionary - // is entered in the database twice - { - IOdictionary SRFPropertiesDict + // get model name, but do not register the dictionary + // otherwise it is registered in the database twice + const word modelType + ( + IOdictionary ( IOobject ( @@ -53,25 +44,24 @@ autoPtr SRFModel::New Urel.time().constant(), Urel.db(), IOobject::MUST_READ, - IOobject::NO_WRITE + IOobject::NO_WRITE, + false ) - ); + ).lookup("SRFModel") + ); - SRFPropertiesDict.lookup("SRFModel") >> SRFModelTypeName; - } - - Info<< "Selecting SRFModel " << SRFModelTypeName << endl; + Info<< "Selecting SRFModel " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(SRFModelTypeName); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorIn ( "SRFModel::New(const fvMesh&)" - ) << "Unknown SRFModel type " << SRFModelTypeName - << nl << nl + ) << "Unknown SRFModel type " + << modelType << nl << nl << "Valid SRFModel types are :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); @@ -81,9 +71,4 @@ autoPtr SRFModel::New } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace SRF -} // End namespace Foam - // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C index b141095d7d..c7288f621f 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C @@ -262,7 +262,7 @@ void Foam::activeBaffleVelocityFvPatchVectorField::updateCoeffs() Info<< "openFraction = " << openFraction_ << endl; - vectorField::subField Sfw = patch().patch().faceAreas(); + vectorField::subField Sfw = this->patch().patch().faceAreas(); vectorField newSfw = (1 - openFraction_)*initWallSf_; forAll(Sfw, facei) { diff --git a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedValue/directMappedFixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedValue/directMappedFixedValueFvPatchField.C index a3d7598451..f988a562ab 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedValue/directMappedFixedValueFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedValue/directMappedFixedValueFvPatchField.C @@ -112,13 +112,6 @@ directMappedFixedValueFvPatchField::directMappedFixedValueFvPatchField << " in file " << this->dimensionedInternalField().objectPath() << exit(FatalError); } - - //// Force calculation of schedule (uses parallel comms) - //const directMappedPatchBase& mpp = refCast - //( - // this->patch().patch() - //); - //(void)mpp.map().schedule(); } @@ -249,7 +242,7 @@ void directMappedFixedValueFvPatchField::updateCoeffs() { const fvPatchField& pf = nbrField.boundaryField()[patchI]; - label faceStart = pf.patch().patch().start(); + label faceStart = pf.patch().start(); forAll(pf, faceI) { diff --git a/src/finiteVolume/fields/fvPatchFields/derived/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C index 80f50e4808..402ec5ea56 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C @@ -116,7 +116,7 @@ directMappedVelocityFluxFixedValueFvPatchField // Force calculation of schedule (uses parallel comms) const directMappedPolyPatch& mpp = refCast ( - patch().patch() + this->patch().patch() ); (void)mpp.map().schedule(); } @@ -187,7 +187,7 @@ void directMappedVelocityFluxFixedValueFvPatchField::updateCoeffs() const fvPatchVectorField& Upf = UField.boundaryField()[patchI]; const scalarField& phipf = phiField.boundaryField()[patchI]; - label faceStart = Upf.patch().patch().start(); + label faceStart = Upf.patch().start(); forAll(Upf, faceI) { diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C index 4e7c797c11..aba51a3404 100644 --- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C @@ -479,6 +479,6 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const fvPatchField& ptf) // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -# include "newFvPatchField.C" +# include "fvPatchFieldNew.C" // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H index b1df3530ee..69ee851768 100644 --- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H @@ -37,7 +37,7 @@ Description SourceFiles fvPatchField.C - newFvPatchField.C + fvPatchFieldNew.C \*---------------------------------------------------------------------------*/ diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/newFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchFieldNew.C similarity index 95% rename from src/finiteVolume/fields/fvPatchFields/fvPatchField/newFvPatchField.C rename to src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchFieldNew.C index 86884666a9..0e119e7d32 100644 --- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/newFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchFieldNew.C @@ -52,8 +52,8 @@ Foam::tmp > Foam::fvPatchField::New ( "fvPatchField::New(const word&, const word&, const fvPatch&, " "const DimensionedField&)" - ) << "Unknown patchTypefield type " << patchFieldType - << endl << endl + ) << "Unknown patchField type " + << patchFieldType << nl << nl << "Valid patchField types are :" << endl << patchConstructorTablePtr_->sortedToc() << exit(FatalError); @@ -104,7 +104,7 @@ Foam::tmp > Foam::fvPatchField::New const dictionary& dict ) { - word patchFieldType(dict.lookup("type")); + const word patchFieldType(dict.lookup("type")); if (debug) { @@ -133,7 +133,7 @@ Foam::tmp > Foam::fvPatchField::New "const dictionary&)", dict ) << "Unknown patchField type " << patchFieldType - << " for patch type " << p.type() << endl << endl + << " for patch type " << p.type() << nl << nl << "Valid patchField types are :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalIOError); @@ -200,7 +200,7 @@ Foam::tmp > Foam::fvPatchField::New "fvPatchField::New(const fvPatchField&, " "const fvPatch&, const DimensionedField&, " "const fvPatchFieldMapper&)" - ) << "unknown patchTypefield type " << ptf.type() << endl << endl + ) << "Unknown patchField type " << ptf.type() << nl << nl << "Valid patchField types are :" << endl << patchMapperConstructorTablePtr_->sortedToc() << exit(FatalError); diff --git a/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.C b/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.C index 10660e68c1..2b0514a5de 100644 --- a/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.C +++ b/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.C @@ -403,6 +403,6 @@ Ostream& operator<<(Ostream& os, const fvsPatchField& ptf) // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -# include "newFvsPatchField.C" +# include "fvsPatchFieldNew.C" // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.H index c400d78d20..b5011eefcd 100644 --- a/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.H +++ b/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.H @@ -37,7 +37,7 @@ Description SourceFiles fvsPatchField.C - newFvsPatchField.C + fvsPatchFieldNew.C \*---------------------------------------------------------------------------*/ diff --git a/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/newFvsPatchField.C b/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchFieldNew.C similarity index 95% rename from src/finiteVolume/fields/fvsPatchFields/fvsPatchField/newFvsPatchField.C rename to src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchFieldNew.C index b8ad302fdd..dd9b25f1a4 100644 --- a/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/newFvsPatchField.C +++ b/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchFieldNew.C @@ -56,8 +56,8 @@ tmp > fvsPatchField::New ( "fvsPatchField::New(const word&, const word&, const fvPatch&" ", const Field&)" - ) << "Unknown patchTypefield type " << patchFieldType - << endl << endl + ) << "Unknown patchField type " + << patchFieldType << nl << nl << "Valid patchField types are :" << endl << patchConstructorTablePtr_->sortedToc() << exit(FatalError); @@ -116,7 +116,7 @@ tmp > fvsPatchField::New << endl; } - word patchFieldType(dict.lookup("type")); + const word patchFieldType(dict.lookup("type")); typename dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(patchFieldType); @@ -136,7 +136,7 @@ tmp > fvsPatchField::New "const dictionary&)", dict ) << "Unknown patchField type " << patchFieldType - << " for patch type " << p.type() << endl << endl + << " for patch type " << p.type() << nl << nl << "Valid patchField types are :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalIOError); @@ -204,7 +204,7 @@ tmp > fvsPatchField::New "fvsPatchField::New(const fvsPatchField&, " "const fvPatch&, const Field&, " "const fvPatchFieldMapper&)" - ) << "unknown patchTypefield type " << ptf.type() << endl << endl + ) << "Unknown patchField type " << ptf.type() << nl << nl << "Valid patchField types are :" << endl << patchMapperConstructorTablePtr_->sortedToc() << exit(FatalError); diff --git a/src/finiteVolume/finiteVolume/convectionSchemes/convectionScheme/convectionScheme.C b/src/finiteVolume/finiteVolume/convectionSchemes/convectionScheme/convectionScheme.C index 225aea40c2..f072f57001 100644 --- a/src/finiteVolume/finiteVolume/convectionSchemes/convectionScheme/convectionScheme.C +++ b/src/finiteVolume/finiteVolume/convectionSchemes/convectionScheme/convectionScheme.C @@ -82,7 +82,7 @@ tmp > convectionScheme::New << exit(FatalIOError); } - word schemeName(schemeData); + const word schemeName(schemeData); typename IstreamConstructorTable::iterator cstrIter = IstreamConstructorTablePtr_->find(schemeName); @@ -94,7 +94,7 @@ tmp > convectionScheme::New "convectionScheme::New" "(const fvMesh&, const surfaceScalarField&, Istream&)", schemeData - ) << "unknown convection scheme " << schemeName << endl << endl + ) << "Unknown convection scheme " << schemeName << nl << nl << "Valid convection schemes are :" << endl << IstreamConstructorTablePtr_->sortedToc() << exit(FatalIOError); @@ -139,7 +139,7 @@ tmp > convectionScheme::New << exit(FatalIOError); } - word schemeName(schemeData); + const word schemeName(schemeData); typename MultivariateConstructorTable::iterator cstrIter = MultivariateConstructorTablePtr_->find(schemeName); @@ -153,7 +153,7 @@ tmp > convectionScheme::New "const typename multivariateSurfaceInterpolationScheme" "::fieldTable&, const surfaceScalarField&, Istream&)", schemeData - ) << "unknown convection scheme " << schemeName << endl << endl + ) << "Unknown convection scheme " << schemeName << nl << nl << "Valid convection schemes are :" << endl << MultivariateConstructorTablePtr_->sortedToc() << exit(FatalIOError); diff --git a/src/finiteVolume/finiteVolume/d2dt2Schemes/d2dt2Scheme/d2dt2Scheme.C b/src/finiteVolume/finiteVolume/d2dt2Schemes/d2dt2Scheme/d2dt2Scheme.C index 858e6ecd9a..72c3b907cf 100644 --- a/src/finiteVolume/finiteVolume/d2dt2Schemes/d2dt2Scheme/d2dt2Scheme.C +++ b/src/finiteVolume/finiteVolume/d2dt2Schemes/d2dt2Scheme/d2dt2Scheme.C @@ -67,7 +67,7 @@ tmp > d2dt2Scheme::New << exit(FatalIOError); } - word schemeName(schemeData); + const word schemeName(schemeData); typename IstreamConstructorTable::iterator cstrIter = IstreamConstructorTablePtr_->find(schemeName); @@ -78,7 +78,7 @@ tmp > d2dt2Scheme::New ( "d2dt2Scheme::New(const fvMesh&, Istream&)", schemeData - ) << "unknown d2dt2 scheme " << schemeName << endl << endl + ) << "Unknown d2dt2 scheme " << schemeName << nl << nl << "Valid d2dt2 schemes are :" << endl << IstreamConstructorTablePtr_->sortedToc() << exit(FatalIOError); diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C index 71022e571f..260eaec08f 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C @@ -65,7 +65,7 @@ tmp > ddtScheme::New << exit(FatalIOError); } - word schemeName(schemeData); + const word schemeName(schemeData); typename IstreamConstructorTable::iterator cstrIter = IstreamConstructorTablePtr_->find(schemeName); @@ -76,7 +76,7 @@ tmp > ddtScheme::New ( "ddtScheme::New(const fvMesh&, Istream&)", schemeData - ) << "unknown ddt scheme " << schemeName << endl << endl + ) << "Unknown ddt scheme " << schemeName << nl << nl << "Valid ddt schemes are :" << endl << IstreamConstructorTablePtr_->sortedToc() << exit(FatalIOError); diff --git a/src/finiteVolume/finiteVolume/divSchemes/divScheme/divScheme.C b/src/finiteVolume/finiteVolume/divSchemes/divScheme/divScheme.C index 51502b701a..9045e8b509 100644 --- a/src/finiteVolume/finiteVolume/divSchemes/divScheme/divScheme.C +++ b/src/finiteVolume/finiteVolume/divSchemes/divScheme/divScheme.C @@ -68,7 +68,7 @@ tmp > divScheme::New << exit(FatalIOError); } - word schemeName(schemeData); + const word schemeName(schemeData); typename IstreamConstructorTable::iterator cstrIter = IstreamConstructorTablePtr_->find(schemeName); @@ -79,7 +79,8 @@ tmp > divScheme::New ( "divScheme::New(const fvMesh&, Istream&)", schemeData - ) << "unknown div scheme " << schemeName << endl << endl + ) << "unknown div scheme " + << schemeName << nl << nl << "Valid div schemes are :" << endl << IstreamConstructorTablePtr_->sortedToc() << exit(FatalIOError); diff --git a/src/finiteVolume/finiteVolume/gradSchemes/gradScheme/gradScheme.C b/src/finiteVolume/finiteVolume/gradSchemes/gradScheme/gradScheme.C index 7667e6325f..faba3c984d 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/gradScheme/gradScheme.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/gradScheme/gradScheme.C @@ -57,7 +57,7 @@ Foam::tmp > Foam::fv::gradScheme::New << exit(FatalIOError); } - word schemeName(schemeData); + const word schemeName(schemeData); typename IstreamConstructorTable::iterator cstrIter = IstreamConstructorTablePtr_->find(schemeName); @@ -69,7 +69,7 @@ Foam::tmp > Foam::fv::gradScheme::New "gradScheme::New" "(const fvMesh& mesh, Istream& schemeData)", schemeData - ) << "unknown grad scheme " << schemeName << endl << endl + ) << "Unknown grad scheme " << schemeName << nl << nl << "Valid grad schemes are :" << endl << IstreamConstructorTablePtr_->sortedToc() << exit(FatalIOError); diff --git a/src/finiteVolume/finiteVolume/laplacianSchemes/laplacianScheme/laplacianScheme.C b/src/finiteVolume/finiteVolume/laplacianSchemes/laplacianScheme/laplacianScheme.C index 6ee704dbe4..fa55b32dbd 100644 --- a/src/finiteVolume/finiteVolume/laplacianSchemes/laplacianScheme/laplacianScheme.C +++ b/src/finiteVolume/finiteVolume/laplacianSchemes/laplacianScheme/laplacianScheme.C @@ -66,7 +66,7 @@ tmp > laplacianScheme::New << exit(FatalIOError); } - word schemeName(schemeData); + const word schemeName(schemeData); typename IstreamConstructorTable::iterator cstrIter = IstreamConstructorTablePtr_->find(schemeName); @@ -77,7 +77,7 @@ tmp > laplacianScheme::New ( "laplacianScheme::New(const fvMesh&, Istream&)", schemeData - ) << "unknown laplacian scheme " << schemeName << endl << endl + ) << "Unknown laplacian scheme " << schemeName << nl << nl << "Valid laplacian schemes are :" << endl << IstreamConstructorTablePtr_->sortedToc() << exit(FatalIOError); diff --git a/src/finiteVolume/finiteVolume/snGradSchemes/snGradScheme/snGradScheme.C b/src/finiteVolume/finiteVolume/snGradSchemes/snGradScheme/snGradScheme.C index 9ebba2a0f1..4c0cf42e7f 100644 --- a/src/finiteVolume/finiteVolume/snGradSchemes/snGradScheme/snGradScheme.C +++ b/src/finiteVolume/finiteVolume/snGradSchemes/snGradScheme/snGradScheme.C @@ -68,7 +68,7 @@ tmp > snGradScheme::New << exit(FatalIOError); } - word schemeName(schemeData); + const word schemeName(schemeData); typename MeshConstructorTable::iterator constructorIter = MeshConstructorTablePtr_->find(schemeName); @@ -79,8 +79,8 @@ tmp > snGradScheme::New ( "snGradScheme::New(const fvMesh&, Istream&)", schemeData - ) << "Unknown discretisation scheme " << schemeName - << endl << endl + ) << "Unknown discretisation scheme " + << schemeName << nl << nl << "Valid schemes are :" << endl << MeshConstructorTablePtr_->sortedToc() << exit(FatalIOError); diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencilTemplates.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencilTemplates.C index 25caa5a090..e37d17f60a 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencilTemplates.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencilTemplates.C @@ -139,7 +139,7 @@ Foam::extendedCellToFaceStencil::weightedSum if (pSfCorr.coupled()) { - label faceI = pSfCorr.patch().patch().start(); + label faceI = pSfCorr.patch().start(); forAll(pSfCorr, i) { diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedUpwindCellToFaceStencilTemplates.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedUpwindCellToFaceStencilTemplates.C index 27eb7032ef..9ba34e2282 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedUpwindCellToFaceStencilTemplates.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedUpwindCellToFaceStencilTemplates.C @@ -106,7 +106,7 @@ Foam::extendedUpwindCellToFaceStencil::weightedSum if (pSfCorr.coupled()) { - label faceI = pSfCorr.patch().patch().start(); + label faceI = pSfCorr.patch().start(); forAll(pSfCorr, i) { diff --git a/src/finiteVolume/fvMesh/fvMeshSubset/fvMeshSubsetInterpolate.C b/src/finiteVolume/fvMesh/fvMeshSubset/fvMeshSubsetInterpolate.C index 4a7078723c..4fa17952ec 100644 --- a/src/finiteVolume/fvMesh/fvMeshSubset/fvMeshSubsetInterpolate.C +++ b/src/finiteVolume/fvMesh/fvMeshSubset/fvMeshSubsetInterpolate.C @@ -73,14 +73,14 @@ tmp > fvMeshSubset::interpolate // Construct addressing const fvPatch& subPatch = sMesh.boundary()[patchI]; const fvPatch& basePatch = vf.mesh().boundary()[patchMap[patchI]]; - label baseStart = basePatch.patch().start(); - label baseSize = basePatch.size(); + const label baseStart = basePatch.start(); + const label baseSize = basePatch.size(); labelList directAddressing(subPatch.size()); forAll(directAddressing, i) { - label baseFaceI = faceMap[subPatch.patch().start()+i]; + label baseFaceI = faceMap[subPatch.start()+i]; if (baseFaceI >= baseStart && baseFaceI < baseStart+baseSize) { @@ -197,14 +197,14 @@ tmp > fvMeshSubset::interpolate // Construct addressing const fvPatch& subPatch = sMesh.boundary()[patchI]; const fvPatch& basePatch = vf.mesh().boundary()[patchMap[patchI]]; - label baseStart = basePatch.patch().start(); - label baseSize = basePatch.size(); + const label baseStart = basePatch.start(); + const label baseSize = basePatch.size(); labelList directAddressing(subPatch.size()); forAll(directAddressing, i) { - label baseFaceI = faceMap[subPatch.patch().start()+i]; + label baseFaceI = faceMap[subPatch.start()+i]; if (baseFaceI >= baseStart && baseFaceI < baseStart+baseSize) { @@ -239,7 +239,7 @@ tmp > fvMeshSubset::interpolate { fvsPatchField& pfld = patchFields[patchI]; - label meshFaceI = pfld.patch().patch().start(); + label meshFaceI = pfld.patch().start(); forAll(pfld, i) { diff --git a/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatch.C b/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatch.C index c546459875..0b42c7f6bb 100644 --- a/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatch.C +++ b/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatch.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -31,21 +31,18 @@ License #include "volFields.H" #include "surfaceFields.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -defineTypeNameAndDebug(fvPatch, 0); -defineRunTimeSelectionTable(fvPatch, polyPatch); -addToRunTimeSelectionTable(fvPatch, fvPatch, polyPatch); - + defineTypeNameAndDebug(fvPatch, 0); + defineRunTimeSelectionTable(fvPatch, polyPatch); + addToRunTimeSelectionTable(fvPatch, fvPatch, polyPatch); +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -fvPatch::fvPatch(const polyPatch& p, const fvBoundaryMesh& bm) +Foam::fvPatch::fvPatch(const polyPatch& p, const fvBoundaryMesh& bm) : polyPatch_(p), boundaryMesh_(bm) @@ -54,19 +51,19 @@ fvPatch::fvPatch(const polyPatch& p, const fvBoundaryMesh& bm) // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -fvPatch::~fvPatch() +Foam::fvPatch::~fvPatch() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -bool fvPatch::constraintType(const word& pt) +bool Foam::fvPatch::constraintType(const word& pt) { return fvPatchField::patchConstructorTablePtr_->found(pt); } -wordList fvPatch::constraintTypes() +Foam::wordList Foam::fvPatch::constraintTypes() { wordList cTypes(polyPatchConstructorTablePtr_->size()); @@ -92,19 +89,19 @@ wordList fvPatch::constraintTypes() } -const unallocLabelList& fvPatch::faceCells() const +const Foam::unallocLabelList& Foam::fvPatch::faceCells() const { return polyPatch_.faceCells(); } -const vectorField& fvPatch::Cf() const +const Foam::vectorField& Foam::fvPatch::Cf() const { return boundaryMesh().mesh().Cf().boundaryField()[index()]; } -tmp fvPatch::Cn() const +Foam::tmp Foam::fvPatch::Cn() const { tmp tcc(new vectorField(size())); vectorField& cc = tcc(); @@ -123,64 +120,60 @@ tmp fvPatch::Cn() const } -tmp fvPatch::nf() const +Foam::tmp Foam::fvPatch::nf() const { return Sf()/magSf(); } -const vectorField& fvPatch::Sf() const +const Foam::vectorField& Foam::fvPatch::Sf() const { return boundaryMesh().mesh().Sf().boundaryField()[index()]; } -const scalarField& fvPatch::magSf() const +const Foam::scalarField& Foam::fvPatch::magSf() const { return boundaryMesh().mesh().magSf().boundaryField()[index()]; } -tmp fvPatch::delta() const +Foam::tmp Foam::fvPatch::delta() const { return Cf() - Cn(); } -void fvPatch::makeWeights(scalarField& w) const +void Foam::fvPatch::makeWeights(scalarField& w) const { w = 1.0; } -void fvPatch::makeDeltaCoeffs(scalarField& dc) const +void Foam::fvPatch::makeDeltaCoeffs(scalarField& dc) const { dc = 1.0/(nf() & delta()); } -void fvPatch::initMovePoints() +void Foam::fvPatch::initMovePoints() {} -void fvPatch::movePoints() +void Foam::fvPatch::movePoints() {} -const scalarField& fvPatch::deltaCoeffs() const +const Foam::scalarField& Foam::fvPatch::deltaCoeffs() const { return boundaryMesh().mesh().deltaCoeffs().boundaryField()[index()]; } -const scalarField& fvPatch::weights() const +const Foam::scalarField& Foam::fvPatch::weights() const { return boundaryMesh().mesh().weights().boundaryField()[index()]; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatch.H b/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatch.H index 1b57ab0601..7d9cd8a7b9 100644 --- a/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatch.H +++ b/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatch.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,11 +25,11 @@ Class Foam::fvPatch Description - Foam::fvPatch + A finiteVolume patch using a polyPatch and a fvBoundaryMesh SourceFiles fvPatch.C - newFvPatch.C + fvPatchNew.C \*---------------------------------------------------------------------------*/ @@ -121,14 +121,18 @@ public: // Constructors - //- Construct from polyPatch + //- Construct from polyPatch and fvBoundaryMesh fvPatch(const polyPatch&, const fvBoundaryMesh&); // Selectors //- Return a pointer to a new patch created on freestore from polyPatch - static autoPtr New(const polyPatch&, const fvBoundaryMesh&); + static autoPtr New + ( + const polyPatch&, + const fvBoundaryMesh& + ); //- Destructor @@ -151,6 +155,12 @@ public: return polyPatch_.name(); } + //- Return start label of this patch in the polyMesh face list + label start() const + { + return polyPatch_.start(); + } + //- Return size virtual label size() const { @@ -185,7 +195,7 @@ public: template const typename List::subList patchSlice(const List& l) const { - return typename List::subList(l, size(), polyPatch_.start()); + return typename List::subList(l, size(), start()); } //- Return faceCells diff --git a/src/finiteVolume/fvMesh/fvPatches/fvPatch/newFvPatch.C b/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatchNew.C similarity index 97% rename from src/finiteVolume/fvMesh/fvPatches/fvPatch/newFvPatch.C rename to src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatchNew.C index 4a7facee23..7cac8a003d 100644 --- a/src/finiteVolume/fvMesh/fvPatches/fvPatch/newFvPatch.C +++ b/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatchNew.C @@ -47,7 +47,7 @@ Foam::autoPtr Foam::fvPatch::New if (cstrIter == polyPatchConstructorTablePtr_->end()) { FatalErrorIn("fvPatch::New(const polyPatch&, const fvBoundaryMesh&)") - << "Unknown fvPatch type " << patch.type() << ".\n" + << "Unknown fvPatch type " << patch.type() << nl << "Valid fvPatch types are :" << polyPatchConstructorTablePtr_->sortedToc() << exit(FatalError); diff --git a/src/finiteVolume/interpolation/interpolation/interpolation/interpolation.C b/src/finiteVolume/interpolation/interpolation/interpolation/interpolation.C index c5a6c94438..4a58469a7d 100644 --- a/src/finiteVolume/interpolation/interpolation/interpolation/interpolation.C +++ b/src/finiteVolume/interpolation/interpolation/interpolation/interpolation.C @@ -56,6 +56,6 @@ interpolation::interpolation // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -# include "newInterpolation.C" +# include "interpolationNew.C" // ************************************************************************* // diff --git a/src/finiteVolume/interpolation/interpolation/interpolation/newInterpolation.C b/src/finiteVolume/interpolation/interpolation/interpolation/interpolationNew.C similarity index 91% rename from src/finiteVolume/interpolation/interpolation/interpolation/newInterpolation.C rename to src/finiteVolume/interpolation/interpolation/interpolation/interpolationNew.C index 8a7b66ecc4..55eddc7bed 100644 --- a/src/finiteVolume/interpolation/interpolation/interpolation/newInterpolation.C +++ b/src/finiteVolume/interpolation/interpolation/interpolation/interpolationNew.C @@ -29,16 +29,14 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // template -Foam::autoPtr > -Foam::interpolation::New +Foam::autoPtr > Foam::interpolation::New ( const word& interpolationType, const GeometricField& psi ) { typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_ - ->find(interpolationType); + dictionaryConstructorTablePtr_->find(interpolationType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -58,8 +56,7 @@ Foam::interpolation::New template -Foam::autoPtr > -Foam::interpolation::New +Foam::autoPtr > Foam::interpolation::New ( const dictionary& interpolationSchemes, const GeometricField& psi diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/limitedSurfaceInterpolationScheme/limitedSurfaceInterpolationScheme.C b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/limitedSurfaceInterpolationScheme/limitedSurfaceInterpolationScheme.C index 2618a1a570..313f6ad1d8 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/limitedSurfaceInterpolationScheme/limitedSurfaceInterpolationScheme.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/limitedSurfaceInterpolationScheme/limitedSurfaceInterpolationScheme.C @@ -65,7 +65,7 @@ limitedSurfaceInterpolationScheme::New << exit(FatalIOError); } - word schemeName(schemeData); + const word schemeName(schemeData); typename MeshConstructorTable::iterator constructorIter = MeshConstructorTablePtr_->find(schemeName); @@ -77,8 +77,8 @@ limitedSurfaceInterpolationScheme::New "limitedSurfaceInterpolationScheme::" "New(const fvMesh&, Istream&)", schemeData - ) << "Unknown discretisation scheme " << schemeName - << endl << endl + ) << "Unknown discretisation scheme " + << schemeName << nl << nl << "Valid schemes are :" << endl << MeshConstructorTablePtr_->sortedToc() << exit(FatalIOError); @@ -120,7 +120,7 @@ limitedSurfaceInterpolationScheme::New << exit(FatalIOError); } - word schemeName(schemeData); + const word schemeName(schemeData); typename MeshFluxConstructorTable::iterator constructorIter = MeshFluxConstructorTablePtr_->find(schemeName); @@ -132,8 +132,8 @@ limitedSurfaceInterpolationScheme::New "limitedSurfaceInterpolationScheme::New" "(const fvMesh&, const surfaceScalarField&, Istream&)", schemeData - ) << "Unknown discretisation scheme " << schemeName - << endl << endl + ) << "Unknown discretisation scheme " + << schemeName << nl << nl << "Valid schemes are :" << endl << MeshFluxConstructorTablePtr_->sortedToc() << exit(FatalIOError); diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/multivariateSchemes/multivariateSurfaceInterpolationScheme/multivariateSurfaceInterpolationScheme.C b/src/finiteVolume/interpolation/surfaceInterpolation/multivariateSchemes/multivariateSurfaceInterpolationScheme/multivariateSurfaceInterpolationScheme.C index aa349204a8..c7d3cfb451 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/multivariateSchemes/multivariateSurfaceInterpolationScheme/multivariateSurfaceInterpolationScheme.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/multivariateSchemes/multivariateSurfaceInterpolationScheme/multivariateSurfaceInterpolationScheme.C @@ -76,7 +76,7 @@ multivariateSurfaceInterpolationScheme::New << endl; } - word schemeName(schemeData); + const word schemeName(schemeData); typename IstreamConstructorTable::iterator constructorIter = IstreamConstructorTablePtr_->find(schemeName); @@ -89,7 +89,7 @@ multivariateSurfaceInterpolationScheme::New "(const fvMesh& mesh, const fieldTable&, " "const surfaceScalarField&, Istream&)", schemeData - ) << "unknown discretisation scheme " << schemeName << endl << endl + ) << "Unknown discretisation scheme " << schemeName << nl << nl << "Valid schemes are :" << endl << IstreamConstructorTablePtr_->sortedToc() << exit(FatalIOError); diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CentredFitScheme/CentredFitData.C b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CentredFitScheme/CentredFitData.C index bca4e0aaf6..a10c1cc22b 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CentredFitScheme/CentredFitData.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CentredFitScheme/CentredFitData.C @@ -103,7 +103,7 @@ void Foam::CentredFitData::calcFit() if (pw.coupled()) { - label facei = pw.patch().patch().start(); + label facei = pw.patch().start(); forAll(pw, i) { diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/UpwindFitScheme/UpwindFitData.C b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/UpwindFitScheme/UpwindFitData.C index 4a7689b5e9..b28ec8d4a8 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/UpwindFitScheme/UpwindFitData.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/UpwindFitScheme/UpwindFitData.C @@ -120,7 +120,7 @@ void Foam::UpwindFitData::calcFit() if (pw.coupled()) { - label facei = pw.patch().patch().start(); + label facei = pw.patch().start(); forAll(pw, i) { @@ -179,7 +179,7 @@ void Foam::UpwindFitData::calcFit() if (pw.coupled()) { - label facei = pw.patch().patch().start(); + label facei = pw.patch().start(); forAll(pw, i) { diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolationScheme/surfaceInterpolationScheme.C b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolationScheme/surfaceInterpolationScheme.C index 0a51f574f1..43f52f271b 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolationScheme/surfaceInterpolationScheme.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolationScheme/surfaceInterpolationScheme.C @@ -59,7 +59,7 @@ tmp > surfaceInterpolationScheme::New << exit(FatalIOError); } - word schemeName(schemeData); + const word schemeName(schemeData); if (surfaceInterpolation::debug || surfaceInterpolationScheme::debug) { @@ -79,8 +79,8 @@ tmp > surfaceInterpolationScheme::New ( "surfaceInterpolationScheme::New(const fvMesh&, Istream&)", schemeData - ) << "Unknown discretisation scheme " << schemeName - << endl << endl + ) << "Unknown discretisation scheme " + << schemeName << nl << nl << "Valid schemes are :" << endl << MeshConstructorTablePtr_->sortedToc() << exit(FatalIOError); @@ -113,7 +113,7 @@ tmp > surfaceInterpolationScheme::New << exit(FatalIOError); } - word schemeName(schemeData); + const word schemeName(schemeData); if (surfaceInterpolation::debug || surfaceInterpolationScheme::debug) { @@ -134,8 +134,8 @@ tmp > surfaceInterpolationScheme::New "surfaceInterpolationScheme::New" "(const fvMesh&, const surfaceScalarField&, Istream&)", schemeData - ) << "Unknown discretisation scheme " << schemeName - << endl << endl + ) << "Unknown discretisation scheme " + << schemeName << nl << nl << "Valid schemes are :" << endl << MeshFluxConstructorTablePtr_->sortedToc() << exit(FatalIOError); diff --git a/src/fvMotionSolver/fvMotionSolvers/displacement/layeredSolver/displacementLayeredMotionFvMotionSolver.C b/src/fvMotionSolver/fvMotionSolvers/displacement/layeredSolver/displacementLayeredMotionFvMotionSolver.C index 4c950ab8c4..8ade7abb49 100644 --- a/src/fvMotionSolver/fvMotionSolvers/displacement/layeredSolver/displacementLayeredMotionFvMotionSolver.C +++ b/src/fvMotionSolver/fvMotionSolvers/displacement/layeredSolver/displacementLayeredMotionFvMotionSolver.C @@ -221,7 +221,7 @@ Foam::displacementLayeredMotionFvMotionSolver::faceZoneEvaluate tmp tfld(new vectorField(meshPoints.size())); vectorField& fld = tfld(); - const word& type = dict.lookup("type"); + const word type(dict.lookup("type")); if (type == "fixedValue") { diff --git a/src/fvMotionSolver/motionDiffusivity/inverseFaceDistance/inverseFaceDistanceDiffusivity.C b/src/fvMotionSolver/motionDiffusivity/inverseFaceDistance/inverseFaceDistanceDiffusivity.C index 2ef5a2a1fc..934f29e018 100644 --- a/src/fvMotionSolver/motionDiffusivity/inverseFaceDistance/inverseFaceDistanceDiffusivity.C +++ b/src/fvMotionSolver/motionDiffusivity/inverseFaceDistance/inverseFaceDistanceDiffusivity.C @@ -144,7 +144,7 @@ void Foam::inverseFaceDistanceDiffusivity::correct() } else { - label start = bfld.patch().patch().start(); + const label start = bfld.patch().start(); forAll(bfld, i) { diff --git a/src/fvMotionSolver/motionDiffusivity/inversePointDistance/inversePointDistanceDiffusivity.C b/src/fvMotionSolver/motionDiffusivity/inversePointDistance/inversePointDistanceDiffusivity.C index ec47a05a6c..00063e203c 100644 --- a/src/fvMotionSolver/motionDiffusivity/inversePointDistance/inversePointDistanceDiffusivity.C +++ b/src/fvMotionSolver/motionDiffusivity/inversePointDistance/inversePointDistanceDiffusivity.C @@ -190,7 +190,7 @@ void Foam::inversePointDistanceDiffusivity::correct() } else { - label start = bfld.patch().patch().start(); + const label start = bfld.patch().start(); forAll(bfld, i) { diff --git a/src/fvMotionSolver/motionDiffusivity/motionDiffusivity/motionDiffusivity.C b/src/fvMotionSolver/motionDiffusivity/motionDiffusivity/motionDiffusivity.C index aad5896b41..ed4c2930ba 100644 --- a/src/fvMotionSolver/motionDiffusivity/motionDiffusivity/motionDiffusivity.C +++ b/src/fvMotionSolver/motionDiffusivity/motionDiffusivity/motionDiffusivity.C @@ -30,7 +30,6 @@ License namespace Foam { defineTypeNameAndDebug(motionDiffusivity, 0); - defineRunTimeSelectionTable(motionDiffusivity, Istream); } @@ -51,12 +50,12 @@ Foam::autoPtr Foam::motionDiffusivity::New Istream& mdData ) { - word diffTypeName(mdData); + const word motionType(mdData); - Info<< "Selecting motion diffusion: " << diffTypeName << endl; + Info<< "Selecting motion diffusion: " << motionType << endl; IstreamConstructorTable::iterator cstrIter = - IstreamConstructorTablePtr_->find(diffTypeName); + IstreamConstructorTablePtr_->find(motionType); if (cstrIter == IstreamConstructorTablePtr_->end()) { @@ -64,8 +63,8 @@ Foam::autoPtr Foam::motionDiffusivity::New ( "motionDiffusivity::New(const tetPolyMesh& tetMesh, " "const Istream& dict)" - ) << "Unknown diffusion type " << diffTypeName - << endl << endl + ) << "Unknown diffusion type " + << motionType << nl << nl << "Valid diffusion types are :" << endl << IstreamConstructorTablePtr_->sortedToc() << exit(FatalError); diff --git a/src/lagrangian/basic/Cloud/Cloud.C b/src/lagrangian/basic/Cloud/Cloud.C index ef43828c4c..ceaf1c44d4 100644 --- a/src/lagrangian/basic/Cloud/Cloud.C +++ b/src/lagrangian/basic/Cloud/Cloud.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/lagrangian/basic/Cloud/Cloud.H b/src/lagrangian/basic/Cloud/Cloud.H index b173f60fe4..0520c51869 100644 --- a/src/lagrangian/basic/Cloud/Cloud.H +++ b/src/lagrangian/basic/Cloud/Cloud.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/lagrangian/basic/Cloud/CloudIO.C b/src/lagrangian/basic/Cloud/CloudIO.C index d607a3a068..24a65c1685 100644 --- a/src/lagrangian/basic/Cloud/CloudIO.C +++ b/src/lagrangian/basic/Cloud/CloudIO.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -39,7 +39,7 @@ Foam::word Foam::Cloud::cloudPropertiesName("cloudProperties"); template void Foam::Cloud::readCloudUniformProperties() { - IOobject uniformPropsDictHeader + IOobject dictObj ( cloudPropertiesName, time().timeName(), @@ -50,11 +50,11 @@ void Foam::Cloud::readCloudUniformProperties() false ); - if (uniformPropsDictHeader.headerOk()) + if (dictObj.headerOk()) { - const IOdictionary uniformPropsDict(uniformPropsDictHeader); + const IOdictionary uniformPropsDict(dictObj); - word procName("processor" + Foam::name(Pstream::myProcNo())); + const word procName("processor" + Foam::name(Pstream::myProcNo())); if (uniformPropsDict.found(procName)) { uniformPropsDict.subDict(procName).lookup("particleCount") diff --git a/src/lagrangian/basic/IOPosition/IOPosition.C b/src/lagrangian/basic/IOPosition/IOPosition.C index b3345417c0..c62898895a 100644 --- a/src/lagrangian/basic/IOPosition/IOPosition.C +++ b/src/lagrangian/basic/IOPosition/IOPosition.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -67,7 +67,7 @@ bool Foam::IOPosition::write() const template bool Foam::IOPosition::writeData(Ostream& os) const { - os<< cloud_.size() << nl << token::BEGIN_LIST << nl; + os << cloud_.size() << nl << token::BEGIN_LIST << nl; forAllConstIter(typename Cloud, cloud_, iter) { @@ -80,7 +80,7 @@ bool Foam::IOPosition::writeData(Ostream& os) const os << nl; } - os<< token::END_LIST << endl; + os << token::END_LIST << endl; return os.good(); } diff --git a/src/lagrangian/basic/IOPosition/IOPosition.H b/src/lagrangian/basic/IOPosition/IOPosition.H index 52c9a2cedd..a421fa29ac 100644 --- a/src/lagrangian/basic/IOPosition/IOPosition.H +++ b/src/lagrangian/basic/IOPosition/IOPosition.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/lagrangian/basic/InteractionLists/InteractionLists.C b/src/lagrangian/basic/InteractionLists/InteractionLists.C new file mode 100644 index 0000000000..83ab477ee4 --- /dev/null +++ b/src/lagrangian/basic/InteractionLists/InteractionLists.C @@ -0,0 +1,1208 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 . + +\*---------------------------------------------------------------------------*/ + +#include "InteractionLists.H" + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +template +void Foam::InteractionLists::buildInteractionLists() +{ + Info<< "Building InteractionLists with interaction distance " + << maxDistance_ << endl; + + Random rndGen(419715); + + const vector interactionVec = maxDistance_*vector::one; + + treeBoundBox procBb(treeBoundBox(mesh_.points())); + + treeBoundBox extendedProcBb + ( + procBb.min() - interactionVec, + procBb.max() + interactionVec + ); + + treeBoundBoxList allExtendedProcBbs(Pstream::nProcs()); + + allExtendedProcBbs[Pstream::myProcNo()] = extendedProcBb; + + Pstream::gatherList(allExtendedProcBbs); + + Pstream::scatterList(allExtendedProcBbs); + + List extendedProcBbsInRange; + List