diff --git a/applications/solvers/basic/potentialFoam/potentialFoam.C b/applications/solvers/basic/potentialFoam/potentialFoam.C index 49188fcf00..a9c5d67211 100644 --- a/applications/solvers/basic/potentialFoam/potentialFoam.C +++ b/applications/solvers/basic/potentialFoam/potentialFoam.C @@ -38,11 +38,9 @@ Description int main(int argc, char *argv[]) { - - argList::validOptions.insert("writep", ""); + argList::addBoolOption("writep", "write the final pressure field"); # include "setRootCase.H" - # include "createTime.H" # include "createMesh.H" # include "createFields.H" diff --git a/applications/solvers/combustion/PDRFoam/XiEqns b/applications/solvers/combustion/PDRFoam/XiEqns index bd5ca3066a..8de3bffe4b 100644 --- a/applications/solvers/combustion/PDRFoam/XiEqns +++ b/applications/solvers/combustion/PDRFoam/XiEqns @@ -22,7 +22,7 @@ volScalarField GEta = GEtaCoef/tauEta; volScalarField XiEqEta = 1.0 + XiCoef*sqrt(up/(Su + SuMin))*Reta; - volScalarField R = + volScalarField R = GEta*XiEqEta/(XiEqEta - 0.999) + GIn*XiIn/(XiIn - 0.999); volScalarField XiEqStar = R/(R - GEta - GIn); @@ -42,7 +42,7 @@ volScalarField GEta = GEtaCoef/tauEta; volScalarField XiEqEta = 1.0 + XiCoef*sqrt(up/(Su + SuMin))*Reta; - volScalarField R = + volScalarField R = GEta*XiEqEta/(XiEqEta - 0.999) + GIn*XiIn/(XiIn - 0.999); volScalarField XiEqStar = R/(R - GEta - GIn); diff --git a/applications/solvers/combustion/PDRFoam/XiModels/algebraic/algebraic.C b/applications/solvers/combustion/PDRFoam/XiModels/algebraic/algebraic.C index 59fc746507..3ab7587431 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/algebraic/algebraic.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/algebraic/algebraic.C @@ -91,7 +91,7 @@ bool Foam::XiModels::algebraic::read(const dictionary& XiProperties) XiModel::read(XiProperties); XiModelCoeffs_.lookup("XiShapeCoef") >> XiShapeCoef; - + return true; } diff --git a/applications/solvers/combustion/PDRFoam/laminarFlameSpeed/SCOPE/SCOPELaminarFlameSpeed.C b/applications/solvers/combustion/PDRFoam/laminarFlameSpeed/SCOPE/SCOPELaminarFlameSpeed.C index 9f42a4cc97..e98ff38adc 100644 --- a/applications/solvers/combustion/PDRFoam/laminarFlameSpeed/SCOPE/SCOPELaminarFlameSpeed.C +++ b/applications/solvers/combustion/PDRFoam/laminarFlameSpeed/SCOPE/SCOPELaminarFlameSpeed.C @@ -117,7 +117,7 @@ inline Foam::scalar Foam::laminarFlameSpeedModels::SCOPE::polyPhi { scalar x = phi - 1.0; - return + return a[0] *( scalar(1) diff --git a/applications/solvers/combustion/PDRFoam/setDeltaT.H b/applications/solvers/combustion/PDRFoam/setDeltaT.H index c40bc4a1d7..4a4cc4e6bf 100644 --- a/applications/solvers/combustion/PDRFoam/setDeltaT.H +++ b/applications/solvers/combustion/PDRFoam/setDeltaT.H @@ -45,7 +45,7 @@ if (adjustTimeStep) maxDeltaT ) ); - + Info<< "deltaT = " << runTime.deltaTValue() << endl; } diff --git a/applications/solvers/combustion/dieselEngineFoam/createFields.H b/applications/solvers/combustion/dieselEngineFoam/createFields.H index 6987608006..a75c6a7d07 100644 --- a/applications/solvers/combustion/dieselEngineFoam/createFields.H +++ b/applications/solvers/combustion/dieselEngineFoam/createFields.H @@ -88,7 +88,7 @@ volScalarField DpDt = multivariateSurfaceInterpolationScheme::fieldTable fields; -forAll (Y, i) +forAll(Y, i) { fields.add(Y[i]); } diff --git a/applications/solvers/combustion/reactingFoam/createFields.H b/applications/solvers/combustion/reactingFoam/createFields.H index d92766db54..0b2238031c 100644 --- a/applications/solvers/combustion/reactingFoam/createFields.H +++ b/applications/solvers/combustion/reactingFoam/createFields.H @@ -77,7 +77,7 @@ volScalarField DpDt = multivariateSurfaceInterpolationScheme::fieldTable fields; -forAll (Y, i) +forAll(Y, i) { fields.add(Y[i]); } diff --git a/applications/solvers/combustion/rhoReactingFoam/createFields.H b/applications/solvers/combustion/rhoReactingFoam/createFields.H index d44b4b9171..d2f6f5e4d4 100644 --- a/applications/solvers/combustion/rhoReactingFoam/createFields.H +++ b/applications/solvers/combustion/rhoReactingFoam/createFields.H @@ -77,7 +77,7 @@ volScalarField DpDt = multivariateSurfaceInterpolationScheme::fieldTable fields; -forAll (Y, i) +forAll(Y, i) { fields.add(Y[i]); } diff --git a/applications/solvers/compressible/rhoCentralFoam/Allwmake b/applications/solvers/compressible/rhoCentralFoam/Allwmake index 698558da0b..5f01d96a75 100755 --- a/applications/solvers/compressible/rhoCentralFoam/Allwmake +++ b/applications/solvers/compressible/rhoCentralFoam/Allwmake @@ -2,7 +2,7 @@ cd ${0%/*} || exit 1 # run from this directory set -x -wmake libso BCs +wmake libso BCs wmake # ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/Make/options b/applications/solvers/compressible/rhoCentralFoam/BCs/Make/options index d4fb23181c..87f38a6a03 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/Make/options +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/Make/options @@ -6,5 +6,5 @@ EXE_INC = \ EXE_LIBS = \ -lfiniteVolume \ -lbasicThermophysicalModels \ - -lspecie + -lspecie diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C b/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C index 3b69386ed6..9f1ea906c1 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C @@ -22,8 +22,6 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -Description - \*---------------------------------------------------------------------------*/ #include "maxwellSlipUFvPatchVectorField.H" diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/mixedFixedValueSlip/mixedFixedValueSlipFvPatchFields.C b/applications/solvers/compressible/rhoCentralFoam/BCs/mixedFixedValueSlip/mixedFixedValueSlipFvPatchFields.C index ac3d40b00e..23386a197f 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/mixedFixedValueSlip/mixedFixedValueSlipFvPatchFields.C +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/mixedFixedValueSlip/mixedFixedValueSlipFvPatchFields.C @@ -22,8 +22,6 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -Description - \*---------------------------------------------------------------------------*/ #include "mixedFixedValueSlipFvPatchFields.H" diff --git a/applications/solvers/compressible/rhoSonicFoam/rhoSonicFoam.C b/applications/solvers/compressible/rhoSonicFoam/rhoSonicFoam.C index f06b13e5de..0375185a88 100644 --- a/applications/solvers/compressible/rhoSonicFoam/rhoSonicFoam.C +++ b/applications/solvers/compressible/rhoSonicFoam/rhoSonicFoam.C @@ -84,7 +84,7 @@ int main(int argc, char *argv[]) ( fvm::ddt(rhoU) + fvm::div(phiv, rhoU) - == + == - fvc::grad(p) ); diff --git a/applications/solvers/compressible/rhopSonicFoam/Allwmake b/applications/solvers/compressible/rhopSonicFoam/Allwmake index 698558da0b..5f01d96a75 100755 --- a/applications/solvers/compressible/rhopSonicFoam/Allwmake +++ b/applications/solvers/compressible/rhopSonicFoam/Allwmake @@ -2,7 +2,7 @@ cd ${0%/*} || exit 1 # run from this directory set -x -wmake libso BCs +wmake libso BCs wmake # ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/compressible/rhopSonicFoam/BCs/p/inviscidWallPFvPatchScalarField.C b/applications/solvers/compressible/rhopSonicFoam/BCs/p/inviscidWallPFvPatchScalarField.C index 27fa4db29a..6acbe1b0ca 100644 --- a/applications/solvers/compressible/rhopSonicFoam/BCs/p/inviscidWallPFvPatchScalarField.C +++ b/applications/solvers/compressible/rhopSonicFoam/BCs/p/inviscidWallPFvPatchScalarField.C @@ -131,7 +131,7 @@ void inviscidWallPFvPatchScalarField::updateCoeffs() const fvPatchField& rhoUp = patch().lookupPatchField("rhoU"); - const fvsPatchField& phip = + const fvsPatchField& phip = patch().lookupPatchField("phi"); const fvsPatchField& rAp = @@ -147,7 +147,7 @@ void inviscidWallPFvPatchScalarField::updateCoeffs() void inviscidWallPFvPatchScalarField::write(Ostream& os) const { fixedGradientFvPatchScalarField::write(os); - os.writeKeyword("fluxFraction") + os.writeKeyword("fluxFraction") << fluxFraction_ << token::END_STATEMENT << nl; writeEntry("value", os); } diff --git a/applications/solvers/compressible/rhopSonicFoam/BCs/rhoE/mixedRhoEFvPatchScalarField.C b/applications/solvers/compressible/rhopSonicFoam/BCs/rhoE/mixedRhoEFvPatchScalarField.C index 8f63d984f5..b334d39c3a 100644 --- a/applications/solvers/compressible/rhopSonicFoam/BCs/rhoE/mixedRhoEFvPatchScalarField.C +++ b/applications/solvers/compressible/rhopSonicFoam/BCs/rhoE/mixedRhoEFvPatchScalarField.C @@ -145,7 +145,7 @@ void mixedRhoEFvPatchScalarField::updateCoeffs() const volScalarField& T = db().lookupObject("T"); const label patchi = patch().index(); - fvPatchScalarField& Tp = + fvPatchScalarField& Tp = const_cast(T.boundaryField()[patchi]); Tp.evaluate(); @@ -164,7 +164,7 @@ void mixedRhoEFvPatchScalarField::updateCoeffs() refGrad() = rhop*Cv.value()*Tp.snGrad() + ( - refValue() + refValue() - (0.5*rhop.patchInternalField()* magSqr(rhoUp.patchInternalField()/rhop.patchInternalField())) )*patch().deltaCoeffs(); diff --git a/applications/solvers/compressible/rhopSonicFoam/BCs/rhoU/fixedRhoUFvPatchVectorField.H b/applications/solvers/compressible/rhopSonicFoam/BCs/rhoU/fixedRhoUFvPatchVectorField.H index 091f9b6d58..1f3665b760 100644 --- a/applications/solvers/compressible/rhopSonicFoam/BCs/rhoU/fixedRhoUFvPatchVectorField.H +++ b/applications/solvers/compressible/rhopSonicFoam/BCs/rhoU/fixedRhoUFvPatchVectorField.H @@ -66,7 +66,7 @@ public: const dictionary& ); - //- Construct by mapping given fixedRhoUFvPatchVectorField + //- Construct by mapping given fixedRhoUFvPatchVectorField // onto a new patch fixedRhoUFvPatchVectorField ( diff --git a/applications/solvers/electromagnetics/electrostaticFoam/Make/files b/applications/solvers/electromagnetics/electrostaticFoam/Make/files index 073ad4cd76..d5cb4f1395 100644 --- a/applications/solvers/electromagnetics/electrostaticFoam/Make/files +++ b/applications/solvers/electromagnetics/electrostaticFoam/Make/files @@ -1,3 +1,3 @@ -electrostaticFoam.C +electrostaticFoam.C EXE = $(FOAM_APPBIN)/electrostaticFoam diff --git a/applications/solvers/incompressible/icoFoam/Make/files b/applications/solvers/incompressible/icoFoam/Make/files index 964e46e159..f1564ba482 100644 --- a/applications/solvers/incompressible/icoFoam/Make/files +++ b/applications/solvers/incompressible/icoFoam/Make/files @@ -1,3 +1,3 @@ -icoFoam.C +icoFoam.C EXE = $(FOAM_APPBIN)/icoFoam diff --git a/applications/solvers/incompressible/nonNewtonianIcoFoam/Make/files b/applications/solvers/incompressible/nonNewtonianIcoFoam/Make/files index ad5215ffda..8b68719cc8 100644 --- a/applications/solvers/incompressible/nonNewtonianIcoFoam/Make/files +++ b/applications/solvers/incompressible/nonNewtonianIcoFoam/Make/files @@ -1,3 +1,3 @@ -nonNewtonianIcoFoam.C +nonNewtonianIcoFoam.C EXE = $(FOAM_APPBIN)/nonNewtonianIcoFoam diff --git a/applications/solvers/incompressible/simpleFoam/Make/files b/applications/solvers/incompressible/simpleFoam/Make/files index 22ef538832..693d26fd80 100644 --- a/applications/solvers/incompressible/simpleFoam/Make/files +++ b/applications/solvers/incompressible/simpleFoam/Make/files @@ -1,3 +1,3 @@ -simpleFoam.C +simpleFoam.C EXE = $(FOAM_APPBIN)/simpleFoam diff --git a/applications/solvers/lagrangian/coalChemistryFoam/createFields.H b/applications/solvers/lagrangian/coalChemistryFoam/createFields.H index 14d6f6f229..f79e48c17b 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/createFields.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/createFields.H @@ -28,7 +28,7 @@ multivariateSurfaceInterpolationScheme::fieldTable fields; - forAll (Y, i) + forAll(Y, i) { fields.add(Y[i]); } diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createFields.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createFields.H index 3d6c5500ea..68c0f8aee8 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createFields.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createFields.H @@ -84,7 +84,7 @@ Info<< "Creating multi-variate interpolation scheme\n" << endl; multivariateSurfaceInterpolationScheme::fieldTable fields; - forAll (Y, i) + forAll(Y, i) { fields.add(Y[i]); } diff --git a/applications/solvers/lagrangian/reactingParcelFoam/createFields.H b/applications/solvers/lagrangian/reactingParcelFoam/createFields.H index 359599a61f..e825c2cffb 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/createFields.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/createFields.H @@ -90,7 +90,7 @@ multivariateSurfaceInterpolationScheme::fieldTable fields; - forAll (Y, i) + forAll(Y, i) { fields.add(Y[i]); } diff --git a/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/createFields.H b/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/createFields.H index 78b0e8b552..5b5767ef3e 100644 --- a/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/createFields.H +++ b/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/createFields.H @@ -47,8 +47,10 @@ ) ); - word kinematicCloudName("kinematicCloud"); - args.optionReadIfPresent("cloudName", kinematicCloudName); + const word kinematicCloudName + ( + args.optionLookupOrDefault("cloudName", "kinematicCloud") + ); Info<< "Constructing kinematicCloud " << kinematicCloudName << endl; basicKinematicCloud kinematicCloud diff --git a/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/uncoupledKinematicParcelFoam.C b/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/uncoupledKinematicParcelFoam.C index 625a306466..ee0088c397 100644 --- a/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/uncoupledKinematicParcelFoam.C +++ b/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/uncoupledKinematicParcelFoam.C @@ -42,7 +42,7 @@ Description int main(int argc, char *argv[]) { - argList::validOptions.insert("cloudName", "cloud name"); + argList::addOption("cloudName", "cloud name"); #include "setRootCase.H" #include "createTime.H" diff --git a/applications/solvers/multiphase/bubbleFoam/UEqns.H b/applications/solvers/multiphase/bubbleFoam/UEqns.H index e692f9f5fe..64cc5db462 100644 --- a/applications/solvers/multiphase/bubbleFoam/UEqns.H +++ b/applications/solvers/multiphase/bubbleFoam/UEqns.H @@ -41,7 +41,7 @@ fvVectorMatrix UbEqn(Ub, Ub.dimensions()*dimVol/dimTime); - fvc::interpolate(nuEffb) *mesh.magSf()*fvc::snGrad(beta)/fvc::interpolate(beta + scalar(0.001)); - UbEqn = + UbEqn = ( (scalar(1) + Cvm*rhob*alpha/rhob)* ( diff --git a/applications/solvers/multiphase/cavitatingFoam/CourantNo.H b/applications/solvers/multiphase/cavitatingFoam/CourantNo.H index a9d43535ec..8e9e9cb00c 100644 --- a/applications/solvers/multiphase/cavitatingFoam/CourantNo.H +++ b/applications/solvers/multiphase/cavitatingFoam/CourantNo.H @@ -36,7 +36,7 @@ scalar acousticCoNum = 0.0; if (mesh.nInternalFaces()) { - surfaceScalarField SfUfbyDelta = + surfaceScalarField SfUfbyDelta = mesh.surfaceInterpolation::deltaCoeffs()*mag(phiv); CoNum = max(SfUfbyDelta/mesh.magSf()) diff --git a/applications/solvers/multiphase/cavitatingFoam/continuityErrs.H b/applications/solvers/multiphase/cavitatingFoam/continuityErrs.H index 6f1622510f..c5e93c7efb 100644 --- a/applications/solvers/multiphase/cavitatingFoam/continuityErrs.H +++ b/applications/solvers/multiphase/cavitatingFoam/continuityErrs.H @@ -3,12 +3,12 @@ dimensionedScalar totalMass = fvc::domainIntegrate(rho); - scalar sumLocalContErr = + scalar sumLocalContErr = ( fvc::domainIntegrate(mag(rho - thermoRho))/totalMass ).value(); - scalar globalContErr = + scalar globalContErr = ( fvc::domainIntegrate(rho - thermoRho)/totalMass ).value(); diff --git a/applications/solvers/multiphase/cavitatingFoam/setDeltaT.H b/applications/solvers/multiphase/cavitatingFoam/setDeltaT.H index dd8f23464a..26f0b43108 100644 --- a/applications/solvers/multiphase/cavitatingFoam/setDeltaT.H +++ b/applications/solvers/multiphase/cavitatingFoam/setDeltaT.H @@ -47,7 +47,7 @@ if (adjustTimeStep) maxDeltaT ) ); - + Info<< "deltaT = " << runTime.deltaTValue() << endl; } diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.C index c948063408..d975577dbc 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.C +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.C @@ -63,7 +63,7 @@ Ostream& operator<< ) { os << tp.theta0_ << token::SPACE - << tp.uTheta_ << token::SPACE + << tp.uTheta_ << token::SPACE << tp.thetaA_ << token::SPACE << tp.thetaR_; diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/phase/phase.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/phase/phase.C index 20beaa4da3..00e7deb644 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/phase/phase.C +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/phase/phase.C @@ -28,7 +28,7 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::phase::phase +Foam::phase::phase ( const word& name, const dictionary& phaseDict, diff --git a/applications/solvers/multiphase/settlingFoam/correctViscosity.H b/applications/solvers/multiphase/settlingFoam/correctViscosity.H index 0c22a12ea2..ddc539dcdb 100644 --- a/applications/solvers/multiphase/settlingFoam/correctViscosity.H +++ b/applications/solvers/multiphase/settlingFoam/correctViscosity.H @@ -1,5 +1,5 @@ { - mul = muc + + mul = muc + plasticViscosity ( plasticViscosityCoeff, diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/UEqns.H b/applications/solvers/multiphase/twoPhaseEulerFoam/UEqns.H index 93593196af..9f0417045b 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/UEqns.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/UEqns.H @@ -56,7 +56,7 @@ fvVectorMatrix UbEqn(Ub, Ub.dimensions()*dimVol/dimTime); -fvc::interpolate(nuEffb)*mesh.magSf()*fvc::snGrad(beta) /fvc::interpolate(beta + scalar(0.001)); - UbEqn = + UbEqn = ( (scalar(1) + Cvm*rhob*alpha/rhob)* ( diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C index 7d6e41bf4c..95b35e9031 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C @@ -89,7 +89,7 @@ Foam::tmp Foam::GidaspowErgunWenYu::K volScalarField& KWenYu = tKWenYu(); // Ergun - forAll (beta, cellj) + forAll(beta, cellj) { if (beta[cellj] <= 0.8) { diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.C index 52d847c854..497612462d 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.C @@ -73,7 +73,7 @@ Foam::tmp Foam::SyamlalOBrien::K volScalarField A = pow(beta, 4.14); volScalarField B = 0.8*pow(beta, 1.28); - forAll (beta, celli) + forAll(beta, celli) { if (beta[celli] > 0.85) { diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C index e5d27350b3..999dc887d8 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C @@ -35,9 +35,9 @@ Foam::autoPtr Foam::conductivityModel::New { word conductivityModelType(dict.lookup("conductivityModel")); - Info<< "Selecting conductivityModel " + Info<< "Selecting conductivityModel " << conductivityModelType << endl; - + dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(conductivityModelType); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C index a7c65bc13f..174ff70a50 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C @@ -73,7 +73,7 @@ frictionalPressure ) const { - return + return Fr*pow(max(alpha - alphaMinFriction, scalar(0)), eta) /pow(max(alphaMax - alpha, scalar(5.0e-2)), p); } @@ -104,9 +104,9 @@ Foam::tmp Foam::JohnsonJacksonFrictionalStress::muf const dimensionedScalar& alphaMax, const volScalarField& pf, const volTensorField& D, - const dimensionedScalar& phi + const dimensionedScalar& phi ) const -{ +{ return dimensionedScalar("0.5", dimTime, 0.5)*pf*sin(phi); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C index 3abba4d80b..3c992a4cbe 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C @@ -125,7 +125,7 @@ Foam::tmp Foam::SchaefferFrictionalStress::muf volScalarField& muff = tmuf(); - forAll (D, celli) + forAll(D, celli) { if (alpha[celli] > alphaMax.value()-5e-2) { diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C index fed001e0c0..7e542fc978 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C @@ -35,9 +35,9 @@ Foam::autoPtr Foam::frictionalStressModel::New { word frictionalStressModelType(dict.lookup("frictionalStressModel")); - Info<< "Selecting frictionalStressModel " + Info<< "Selecting frictionalStressModel " << frictionalStressModelType << endl; - + dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(frictionalStressModelType); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C index cda9814b46..e673544a9b 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C @@ -35,9 +35,9 @@ Foam::autoPtr Foam::granularPressureModel::New { word granularPressureModelType(dict.lookup("granularPressureModel")); - Info<< "Selecting granularPressureModel " + Info<< "Selecting granularPressureModel " << granularPressureModelType << endl; - + dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(granularPressureModelType); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/CarnahanStarling/CarnahanStarlingRadial.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/CarnahanStarling/CarnahanStarlingRadial.C index e2114f9baf..f7651d2279 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/CarnahanStarling/CarnahanStarlingRadial.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/CarnahanStarling/CarnahanStarlingRadial.C @@ -65,7 +65,7 @@ Foam::tmp Foam::CarnahanStarlingRadial::g0 ) const { - return + return 1.0/(1.0 - alpha) + 3.0*alpha/(2.0*sqr(1.0 - alpha)) + sqr(alpha)/(2.0*pow(1.0 - alpha, 3)); @@ -78,8 +78,8 @@ Foam::tmp Foam::CarnahanStarlingRadial::g0prime const dimensionedScalar& alphaMax ) const { - return - - alpha/sqr(1.0 - alpha) + return + - alpha/sqr(1.0 - alpha) + (3.0*(1.0 - alpha) + 6.0*sqr(alpha))/(2.0*(1.0 - alpha)) + (2.0*alpha*(1.0 - alpha) + 3.0*pow(alpha, 3)) /(2.0*pow(1.0 - alpha, 4)); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/Gidaspow/GidaspowRadial.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/Gidaspow/GidaspowRadial.C index d62a9c1c65..9ef25b9340 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/Gidaspow/GidaspowRadial.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/Gidaspow/GidaspowRadial.C @@ -74,7 +74,7 @@ Foam::tmp Foam::GidaspowRadial::g0prime const dimensionedScalar& alphaMax ) const { - return + return (-1.0/5.0)*pow(alpha/alphaMax, -2.0/3.0) /(alphaMax*sqr(1.0 - pow(alpha/alphaMax, 1.0/3.0))); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/SinclairJackson/SinclairJacksonRadial.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/SinclairJackson/SinclairJacksonRadial.C index a600b350a8..f9f4a68c09 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/SinclairJackson/SinclairJacksonRadial.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/SinclairJackson/SinclairJacksonRadial.C @@ -74,7 +74,7 @@ Foam::tmp Foam::SinclairJacksonRadial::g0prime const dimensionedScalar& alphaMax ) const { - return + return (-1.0/3.0)*pow(alpha/alphaMax, -2.0/3.0) /(alphaMax*sqr(1.0 - pow(alpha/alphaMax, 1.0/3.0))); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/radialModel/newRadialModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/radialModel/newRadialModel.C index fc6b2ed5d9..72d7a1193d 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/radialModel/newRadialModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/radialModel/newRadialModel.C @@ -35,9 +35,9 @@ Foam::autoPtr Foam::radialModel::New { word radialModelType(dict.lookup("radialModel")); - Info<< "Selecting radialModel " + Info<< "Selecting radialModel " << radialModelType << endl; - + dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(radialModelType); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H b/applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H index 57a25a299d..7645aeb204 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H @@ -42,7 +42,7 @@ phib = (fvc::interpolate(Ub) & mesh.Sf()) + fvc::ddtPhiCorr(rUbA, Ub, phib) + phiDragb; - + phi = alphaf*phia + betaf*phib; surfaceScalarField Dp("(rho*(1|A(U)))", alphaf*rUaAf/rhoa + betaf*rUbAf/rhob); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/packingLimiter.H b/applications/solvers/multiphase/twoPhaseEulerFoam/packingLimiter.H index 457e476b28..60c3bc8fa0 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/packingLimiter.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/packingLimiter.H @@ -7,20 +7,20 @@ labelListList neighbour = mesh.cellCells(); scalarField cellVolumes = mesh.cellVolumes(); - forAll (alphaEx, celli) + forAll(alphaEx, celli) { // Finding the labels of the neighbouring cells labelList neighbourCell = neighbour[celli]; // Initializing neighbouring cells contribution scalar neighboursEx = 0.0; - - forAll (neighbourCell, cellj) + + forAll(neighbourCell, cellj) { labelList neighboursNeighbour = neighbour[neighbourCell[cellj]]; scalar neighboursNeighbourCellVolumes = 0.0; - - forAll (neighboursNeighbour, cellk) + + forAll(neighboursNeighbour, cellk) { neighboursNeighbourCellVolumes += cellVolumes[neighboursNeighbour[cellk]]; diff --git a/applications/solvers/stressAnalysis/solidDisplacementFoam/tractionDisplacement/tractionDisplacementFvPatchVectorField.C b/applications/solvers/stressAnalysis/solidDisplacementFoam/tractionDisplacement/tractionDisplacementFvPatchVectorField.C index 515e638be4..92039de085 100644 --- a/applications/solvers/stressAnalysis/solidDisplacementFoam/tractionDisplacement/tractionDisplacementFvPatchVectorField.C +++ b/applications/solvers/stressAnalysis/solidDisplacementFoam/tractionDisplacement/tractionDisplacementFvPatchVectorField.C @@ -177,7 +177,7 @@ void tractionDisplacementFvPatchVectorField::updateCoeffs() gradient() = ( (traction_ + pressure_*n)/rho.value() - + twoMuLambda*fvPatchField::snGrad() - (n & sigmaD) + + twoMuLambda*fvPatchField::snGrad() - (n & sigmaD) )/twoMuLambda; Switch thermalStress(thermalProperties.lookup("thermalStress")); @@ -187,7 +187,7 @@ void tractionDisplacementFvPatchVectorField::updateCoeffs() dimensionedScalar alpha(thermalProperties.lookup("alpha")); dimensionedScalar threeKalpha = threeK*alpha; - const fvPatchField& T = + const fvPatchField& T = patch().lookupPatchField("T"); gradient() += n*threeKalpha.value()*T/twoMuLambda; diff --git a/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/solidEquilibriumDisplacementFoam.C b/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/solidEquilibriumDisplacementFoam.C index 4c14b00cc6..70b8b76d39 100644 --- a/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/solidEquilibriumDisplacementFoam.C +++ b/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/solidEquilibriumDisplacementFoam.C @@ -72,7 +72,7 @@ int main(int argc, char *argv[]) { volTensorField gradDcorr = fvc::grad(Dcorr); - sigmaExp = + sigmaExp = (lambda - mu)*gradDcorr + mu*gradDcorr.T() + (lambda*I)*tr(gradDcorr); diff --git a/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/tractionDisplacementCorrection/tractionDisplacementCorrectionFvPatchVectorField.C b/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/tractionDisplacementCorrection/tractionDisplacementCorrectionFvPatchVectorField.C index d071ff7c78..3cec9205f5 100644 --- a/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/tractionDisplacementCorrection/tractionDisplacementCorrectionFvPatchVectorField.C +++ b/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/tractionDisplacementCorrection/tractionDisplacementCorrectionFvPatchVectorField.C @@ -171,7 +171,7 @@ void tractionDisplacementCorrectionFvPatchVectorField::updateCoeffs() const fvPatchField& sigmaD = patch().lookupPatchField("sigmaD"); - const fvPatchField& sigmaExp = + const fvPatchField& sigmaExp = patch().lookupPatchField("sigmaExp"); gradient() = diff --git a/applications/test/BSpline/Make/files b/applications/test/BSpline/Make/files deleted file mode 100644 index be66810067..0000000000 --- a/applications/test/BSpline/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -BSplineTest.C - -EXE = $(FOAM_USER_APPBIN)/BSplineTest diff --git a/applications/test/BSpline/test-splines b/applications/test/BSpline/test-splines deleted file mode 100644 index f5c3a46ae4..0000000000 --- a/applications/test/BSpline/test-splines +++ /dev/null @@ -1,69 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.6 | -| \\ / A nd | Web: http://www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -( - // Upper body longitudinal splines. - ( - (-0.22685 -0.01125166 0) // 7 - (-0.21685 -0.01340204 0) - (-0.20685 -0.01529684 0) - (-0.19685 -0.01694748 0) - (-0.18685 -0.01836538 0) - (-0.17685 -0.01956197 0) - (-0.16685 -0.02054868 0) - (-0.15685 -0.02133693 0) - (-0.14685 -0.02193816 0) - (-0.13685 -0.02236377 0) - (-0.12685 -0.02262521 0) - (-0.11685 -0.02273389 0) // 2 - ) - - ( - (-0.22685 0 0.01125166) // 8 - (-0.21685 0 0.01340204) - (-0.20685 0 0.01529684) - (-0.19685 0 0.01694748) - (-0.18685 0 0.01836538) - (-0.17685 0 0.01956197) - (-0.16685 0 0.02054868) - (-0.15685 0 0.02133693) - (-0.14685 0 0.02193816) - (-0.13685 0 0.02236377) - (-0.12685 0 0.02262521) - (-0.11685 0 0.02273389) // 3 - ) - - ( - (-0.22685 0.01125166 0) // 9 - (-0.21685 0.01340204 0) - (-0.20685 0.01529684 0) - (-0.19685 0.01694748 0) - (-0.18685 0.01836538 0) - (-0.17685 0.01956197 0) - (-0.16685 0.02054868 0) - (-0.15685 0.02133693 0) - (-0.14685 0.02193816 0) - (-0.13685 0.02236377 0) - (-0.12685 0.02262521 0) - (-0.11685 0.02273389 0) // 4 - ) - - ( - (-0.22685 0 -0.01125166) // 6 - (-0.21685 0 -0.01340204) - (-0.20685 0 -0.01529684) - (-0.19685 0 -0.01694748) - (-0.18685 0 -0.01836538) - (-0.17685 0 -0.01956197) - (-0.16685 0 -0.02054868) - (-0.15685 0 -0.02133693) - (-0.14685 0 -0.02193816) - (-0.13685 0 -0.02236377) - (-0.12685 0 -0.02262521) - (-0.11685 0 -0.02273389) // 1 - ) -); diff --git a/applications/test/List/ListTest.C b/applications/test/List/ListTest.C index 0fee9a9e3b..b9f69fd043 100644 --- a/applications/test/List/ListTest.C +++ b/applications/test/List/ListTest.C @@ -47,11 +47,11 @@ using namespace Foam; int main(int argc, char *argv[]) { argList::noParallel(); - argList::validOptions.insert("reList", "reList"); - argList::validOptions.insert("wordList", "wordList"); - argList::validOptions.insert("stringList", "stringList"); - argList::validOptions.insert("float", "xx"); - argList::validOptions.insert("flag", ""); + argList::addOption("reList", "reList"); + argList::addOption("wordList", "wordList"); + argList::addOption("stringList", "stringList"); + argList::addOption("float", "xx"); + argList::addBoolOption("flag"); # include "setRootCase.H" diff --git a/applications/test/PackedList/PackedListTest.C b/applications/test/PackedList/PackedListTest.C index 9bf29923fe..e5670b3cbe 100644 --- a/applications/test/PackedList/PackedListTest.C +++ b/applications/test/PackedList/PackedListTest.C @@ -82,9 +82,13 @@ int main(int argc, char *argv[]) argList::noParallel(); argList::validArgs.insert("file .. fileN"); - argList::validOptions.insert("mask", ""); - argList::validOptions.insert("count", ""); - argList::validOptions.insert("info", ""); + argList::addBoolOption("mask", "report information about the bit masks"); + argList::addBoolOption("count", "test the count() method"); + argList::addBoolOption + ( + "info", + "print an ascii representation of the storage" + ); argList args(argc, argv, false, true); diff --git a/applications/test/PackedList1/PackedListTest1.C b/applications/test/PackedList1/PackedListTest1.C index 05f3a077f8..4cd231cc3e 100644 --- a/applications/test/PackedList1/PackedListTest1.C +++ b/applications/test/PackedList1/PackedListTest1.C @@ -58,9 +58,15 @@ int main(int argc, char *argv[]) list1.print(Info); Info<< "\ntest set() with default argument (max_value)\n"; + list1.set(1); list1.set(3); list1.print(Info); + Info<< "\ntest unset() with in-range and out-of-range\n"; + list1.unset(3); + list1.unset(100000); + list1.print(Info); + Info<< "\ntest assign between references\n"; list1[2] = 3; list1[4] = list1[2]; diff --git a/applications/test/PackedList3/Make/files b/applications/test/PackedList3/Make/files new file mode 100644 index 0000000000..0e119bc4f3 --- /dev/null +++ b/applications/test/PackedList3/Make/files @@ -0,0 +1,3 @@ +PackedListTest3.C + +EXE = $(FOAM_USER_APPBIN)/PackedListTest3 diff --git a/applications/test/PackedList3/Make/options b/applications/test/PackedList3/Make/options new file mode 100644 index 0000000000..e69de29bb2 diff --git a/applications/test/BSpline/BSplineTest.C b/applications/test/PackedList3/PackedListTest3.C similarity index 69% rename from applications/test/BSpline/BSplineTest.C rename to applications/test/PackedList3/PackedListTest3.C index 91f3efad23..9b5b60a118 100644 --- a/applications/test/BSpline/BSplineTest.C +++ b/applications/test/PackedList3/PackedListTest3.C @@ -22,43 +22,51 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -\*---------------------------------------------------------------------------*/ -#include "argList.H" +Application -#include "vector.H" -#include "IFstream.H" -#include "BSpline.H" +Description + +\*---------------------------------------------------------------------------*/ + +#include "argList.H" +#include "boolList.H" +#include "HashSet.H" +#include "StaticHashTable.H" +#include "cpuTime.H" +#include +#include "PackedList.H" +#include "PackedBoolList.H" using namespace Foam; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + // Main program: int main(int argc, char *argv[]) { - argList::noParallel(); - argList::validArgs.insert("file .. fileN"); + const label n = 100000000; + const label nReport = 1000000; - argList args(argc, argv, false, true); + cpuTime timer; - forAll(args.additionalArgs(), argI) + // test inserts + // PackedBoolList + PackedBoolList packed; + for (label i = 0; i < n; i++) { - const string& srcFile = args.additionalArgs()[argI]; - Info<< nl << "reading " << srcFile << nl; - IFstream ifs(srcFile); - - List splinePointFields(ifs); - - forAll(splinePointFields, splineI) + if ((i % nReport) == 0 && i) { - Info<<"convert " << splinePointFields[splineI] << " to bspline" << endl; - - BSpline spl(splinePointFields[splineI], vector::zero, vector::zero); - - Info<< "1/2 = " << spl.position(0.5) << endl; + Info<< "i:" << i << " in " << timer.cpuTimeIncrement() << " s" + <> pathName; + + Info<< nl + << "-case" << nl + << "path = " << args.path() << nl + << "root = " << args.rootPath() << nl + << "case = " << args.caseName() << nl + << "FOAM_CASE=" << getEnv("FOAM_CASE") << nl + << "FOAM_CASENAME=" << getEnv("FOAM_CASENAME") << nl + << endl; + printCleaning(pathName); } diff --git a/applications/test/fvSolutionCombine/fvSolutionCombine.C b/applications/test/fvSolutionCombine/fvSolutionCombine.C index 1d9f1017c0..e409d5db4b 100644 --- a/applications/test/fvSolutionCombine/fvSolutionCombine.C +++ b/applications/test/fvSolutionCombine/fvSolutionCombine.C @@ -98,8 +98,9 @@ bool checkDictionaryContent(const dictionary& dict1, const dictionary& dict2) int main(int argc, char *argv[]) { argList::noParallel(); - argList::validOptions.insert("rewrite", ""); - argList::validOptions.insert("show", ""); + argList::addBoolOption("rewrite"); + argList::addBoolOption("show"); + argList args(argc, argv); Time runTime(args.rootPath(), args.caseName()); diff --git a/applications/test/mvBak/mvBakTest.C b/applications/test/mvBak/mvBakTest.C index 6580ed421c..5cc25161dd 100644 --- a/applications/test/mvBak/mvBakTest.C +++ b/applications/test/mvBak/mvBakTest.C @@ -39,8 +39,9 @@ int main(int argc, char *argv[]) argList::noBanner(); argList::noParallel(); argList::validArgs.insert("file .. fileN"); - argList::validOptions.erase("case"); - argList::validOptions.insert("ext", "bak"); + + argList::removeOption("case"); + argList::addOption("ext", "bak"); argList args(argc, argv, false, true); diff --git a/applications/test/nearWallDist-wave/testWallDist2.C b/applications/test/nearWallDist-wave/testWallDist2.C index 724702810c..a6a59d1780 100644 --- a/applications/test/nearWallDist-wave/testWallDist2.C +++ b/applications/test/nearWallDist-wave/testWallDist2.C @@ -73,7 +73,7 @@ int main(int argc, char *argv[]) // Count walls label nWalls = 0; - forAll (mesh.boundary(), patchI) + forAll(mesh.boundary(), patchI) { const fvPatch& patch = mesh.boundary()[patchI]; @@ -87,13 +87,13 @@ int main(int argc, char *argv[]) labelList changedFaces(nWalls); label nChangedFaces = 0; - forAll (mesh.boundary(), patchI) + forAll(mesh.boundary(), patchI) { const fvPatch& patch = mesh.boundary()[patchI]; if (isA(patch)) { - forAll (patch.Cf(), patchFaceI) + forAll(patch.Cf(), patchFaceI) { const polyPatch& polyPatch = mesh.boundaryMesh()[patchI]; @@ -170,7 +170,7 @@ int main(int argc, char *argv[]) } // Copy boundary values - forAll (wallDistUncorrected.boundaryField(), patchI) + forAll(wallDistUncorrected.boundaryField(), patchI) { fvPatchScalarField& patchField = wallDistUncorrected.boundaryField()[patchI]; diff --git a/applications/test/readCHEMKINIII/readCHEMKINIII.C b/applications/test/readCHEMKINIII/readCHEMKINIII.C index 10514de3fe..01653ae705 100644 --- a/applications/test/readCHEMKINIII/readCHEMKINIII.C +++ b/applications/test/readCHEMKINIII/readCHEMKINIII.C @@ -38,7 +38,7 @@ int main(int argc, char *argv[]) { argList::validArgs.clear(); argList::validArgs.append("CHEMKINIIIFile"); - argList::validOptions.insert("thermo", "fileName"); + argList::addOption("thermo", "fileName"); argList args(argc, argv); fileName thermoFileName = fileName::null; @@ -72,7 +72,7 @@ int main(int argc, char *argv[]) PtrList testReactions(nReactions); - forAll (testReactions, i) + forAll(testReactions, i) { testReactions.set ( diff --git a/applications/test/router/processorRouter.C b/applications/test/router/processorRouter.C index 5f68822cf3..3965d5b019 100644 --- a/applications/test/router/processorRouter.C +++ b/applications/test/router/processorRouter.C @@ -53,7 +53,7 @@ labelList procNeighbours(const polyMesh& mesh) label nNeighbours = 0; - forAll (mesh.boundaryMesh(), patchI) + forAll(mesh.boundaryMesh(), patchI) { if (isA(mesh.boundaryMesh()[patchI])) { @@ -65,7 +65,7 @@ labelList procNeighbours(const polyMesh& mesh) nNeighbours = 0; - forAll (mesh.boundaryMesh(), patchI) + forAll(mesh.boundaryMesh(), patchI) { if (isA(mesh.boundaryMesh()[patchI])) { diff --git a/applications/test/sizeof/Make/files b/applications/test/sizeof/Make/files new file mode 100644 index 0000000000..c0a650baca --- /dev/null +++ b/applications/test/sizeof/Make/files @@ -0,0 +1,3 @@ +sizeofTest.C + +EXE = $(FOAM_USER_APPBIN)/sizeofTest diff --git a/applications/test/sizeof/Make/options b/applications/test/sizeof/Make/options new file mode 100644 index 0000000000..6a9e9810b3 --- /dev/null +++ b/applications/test/sizeof/Make/options @@ -0,0 +1,2 @@ +/* EXE_INC = -I$(LIB_SRC)/cfdTools/include */ +/* EXE_LIBS = -lfiniteVolume */ diff --git a/src/OpenFOAM/global/argList/argListTemplates.C b/applications/test/sizeof/sizeofTest.C similarity index 51% rename from src/OpenFOAM/global/argList/argListTemplates.C rename to applications/test/sizeof/sizeofTest.C index 8bc3da3469..aa1b720bb5 100644 --- a/src/OpenFOAM/global/argList/argListTemplates.C +++ b/applications/test/sizeof/sizeofTest.C @@ -22,41 +22,83 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +Description + Test the sizeof various classes. + \*---------------------------------------------------------------------------*/ -#include "argList.H" +#include "bool.H" +#include "Switch.H" +#include "string.H" +#include "dictionary.H" +#include "nil.H" +#include "IOstreams.H" +#include "IStringStream.H" -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -template -T Foam::argList::optionRead(const word& opt) const +namespace Foam { - T val; + class hasBoolClass + { + public: + bool b_; + + hasBoolClass(const bool val=false) + : + b_(false) + {} + }; - optionLookup(opt)() >> val; - return val; } -template -bool Foam::argList::optionReadIfPresent(const word& opt, T& val) const +using namespace Foam; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Main program: + +int main(int argc, char *argv[]) { - if (optionFound(opt)) + cout<<"sizeof\n------\n"; { - val = optionRead(opt); - return true; + nil x; + cout<<"nil:" << sizeof(x) << nl; } - else { - return false; + bool x(0); + cout<<"bool:" << sizeof(x) << nl; + } + { + hasBoolClass x(true); + cout<<"hasBoolClass:" << sizeof(x) << nl; + } + + { + Switch x("n"); + cout<<"Switch:" << sizeof(x) << nl; + cout<<"Switch::switchType=" << sizeof(Switch::switchType) << nl; + } + + { + scalar x(0); + cout<<"scalar:" << sizeof(x) << nl; + } + + { + label x(0); + cout<<"label:" << sizeof(x) << nl; + } + + { + cout<<"int:" << sizeof(int) << nl; + cout<<"long:" << sizeof(long) << nl; + cout<<"float:" << sizeof(float) << nl; + cout<<"double:" << sizeof(double) << nl; } -} -template -Foam::List Foam::argList::optionReadList(const word& opt) const -{ - return readList(optionLookup(opt)()); + Info << "---\nEnd\n" << endl; + + return 0; } diff --git a/applications/test/spline/Make/files b/applications/test/spline/Make/files new file mode 100644 index 0000000000..68f1cca994 --- /dev/null +++ b/applications/test/spline/Make/files @@ -0,0 +1,3 @@ +splineTest.C + +EXE = $(FOAM_USER_APPBIN)/splineTest diff --git a/applications/test/BSpline/Make/options b/applications/test/spline/Make/options similarity index 100% rename from applications/test/BSpline/Make/options rename to applications/test/spline/Make/options diff --git a/applications/test/spline/splineTest.C b/applications/test/spline/splineTest.C new file mode 100644 index 0000000000..3d92a7dd24 --- /dev/null +++ b/applications/test/spline/splineTest.C @@ -0,0 +1,137 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ +#include "argList.H" + +#include "vector.H" +#include "IFstream.H" + +#include "BSpline.H" +#include "CatmullRomSpline.H" + +using namespace Foam; + +inline Ostream& printPoint(Ostream& os, const point& p) +{ + os << p.x() << ' ' << p.y() << ' ' << p.z() << nl; + return os; +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Main program: + +int main(int argc, char *argv[]) +{ + argList::noParallel(); + argList::validArgs.insert("file .. fileN"); + argList::addBoolOption("B", "B-Spline implementation"); + argList::addBoolOption("CMR", "catmull-rom spline (default)"); + argList::addOption + ( + "n", + "INT", + "number of segments for evaluation - default 20" + ); + + argList args(argc, argv, false, true); + + if (args.additionalArgs().empty()) + { + args.printUsage(); + } + + bool useBSpline = args.optionFound("B"); + bool useCatmullRom = args.optionFound("CMR"); + label nSeg = args.optionLookupOrDefault