diff --git a/applications/solvers/DNS/dnsFoam/dnsFoam.C b/applications/solvers/DNS/dnsFoam/dnsFoam.C index 277a78002d15ea67faa7ea63fa607ac46edefbd4..cc41c03969388a2339c174346420387a28f13888 100644 --- a/applications/solvers/DNS/dnsFoam/dnsFoam.C +++ b/applications/solvers/DNS/dnsFoam/dnsFoam.C @@ -55,8 +55,9 @@ int main(int argc, char *argv[]) Info<< nl << "Starting time loop" << endl; - for (runTime++; !runTime.end(); runTime++) + while (runTime.run()) { + runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; # include "readPISOControls.H" diff --git a/applications/solvers/basic/laplacianFoam/laplacianFoam.C b/applications/solvers/basic/laplacianFoam/laplacianFoam.C index 4a804d01bb23aabab153f69a917fc22305a9441d..5b56c72a8c97c42c5e64cc1ba8c5a43316df5eaa 100644 --- a/applications/solvers/basic/laplacianFoam/laplacianFoam.C +++ b/applications/solvers/basic/laplacianFoam/laplacianFoam.C @@ -48,8 +48,9 @@ int main(int argc, char *argv[]) Info<< "\nCalculating temperature distribution\n" << endl; - for (runTime++; !runTime.end(); runTime++) + while (runTime.run()) { + runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; # include "readSIMPLEControls.H" diff --git a/applications/solvers/basic/scalarTransportFoam/scalarTransportFoam.C b/applications/solvers/basic/scalarTransportFoam/scalarTransportFoam.C index d2d2eb4e6dbd63a6fa2b6965e266bd2cae9ed2ae..ad0107319f8f9a3b44de62bfd5c61b522addfb66 100644 --- a/applications/solvers/basic/scalarTransportFoam/scalarTransportFoam.C +++ b/applications/solvers/basic/scalarTransportFoam/scalarTransportFoam.C @@ -50,8 +50,9 @@ int main(int argc, char *argv[]) # include "CourantNo.H" - for (runTime++; !runTime.end(); runTime++) + while (runTime.run()) { + runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; # include "readSIMPLEControls.H" diff --git a/applications/solvers/combustion/dieselFoam/dieselFoam.C b/applications/solvers/combustion/dieselFoam/dieselFoam.C index 64df8bcc8fdff239be9a60a66d4799a824d7d0c6..4c41a0db2d75d60ff031f1c8307ee1da80baa360 100644 --- a/applications/solvers/combustion/dieselFoam/dieselFoam.C +++ b/applications/solvers/combustion/dieselFoam/dieselFoam.C @@ -63,7 +63,7 @@ int main(int argc, char *argv[]) Info << "\nStarting time loop\n" << endl; - while(runTime.run()) + while (runTime.run()) { # include "readPISOControls.H" # include "compressibleCourantNo.H" diff --git a/applications/solvers/compressible/rhoPorousSimpleFoam/rhoPorousSimpleFoam.C b/applications/solvers/compressible/rhoPorousSimpleFoam/rhoPorousSimpleFoam.C index b0bd54d3b3fac3089a3dd068b25c3d8510ac9768..b1b11a7cec902ce47e23e0356bef8136da7a78ac 100644 --- a/applications/solvers/compressible/rhoPorousSimpleFoam/rhoPorousSimpleFoam.C +++ b/applications/solvers/compressible/rhoPorousSimpleFoam/rhoPorousSimpleFoam.C @@ -51,8 +51,9 @@ int main(int argc, char *argv[]) Info<< "\nStarting time loop\n" << endl; - for (runTime++; !runTime.end(); runTime++) + while (runTime.run()) { + runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; # include "readSIMPLEControls.H" diff --git a/applications/solvers/compressible/rhoSimpleFoam/rhoSimpleFoam.C b/applications/solvers/compressible/rhoSimpleFoam/rhoSimpleFoam.C index ba2b0afd606b9888198d50b2da8ff813d5083bf1..d985abe25d85e8278a65296869961ee589fcb815 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/rhoSimpleFoam.C +++ b/applications/solvers/compressible/rhoSimpleFoam/rhoSimpleFoam.C @@ -49,8 +49,9 @@ int main(int argc, char *argv[]) Info<< "\nStarting time loop\n" << endl; - for (runTime++; !runTime.end(); runTime++) + while (runTime.run()) { + runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; #include "readSIMPLEControls.H" diff --git a/applications/solvers/compressible/rhoSonicFoam/rhoSonicFoam.C b/applications/solvers/compressible/rhoSonicFoam/rhoSonicFoam.C index 662a4f0ad306930b1cdb737a0bc7cd2bff2374b5..b4bdc9e4933cca7a131084d92a779f2caa128313 100644 --- a/applications/solvers/compressible/rhoSonicFoam/rhoSonicFoam.C +++ b/applications/solvers/compressible/rhoSonicFoam/rhoSonicFoam.C @@ -47,8 +47,9 @@ int main(int argc, char *argv[]) Info<< "\nStarting time loop\n" << endl; - for (runTime++; !runTime.end(); runTime++) + while (runTime.run()) { + runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; surfaceScalarField phiv diff --git a/applications/solvers/compressible/rhopSonicFoam/rhopSonicFoam.C b/applications/solvers/compressible/rhopSonicFoam/rhopSonicFoam.C index b1be4d711eeb54a29afd1dfa817635f0aed00fda..b3f1c8e06d47fd61674431b4721463ed3ecafe4c 100644 --- a/applications/solvers/compressible/rhopSonicFoam/rhopSonicFoam.C +++ b/applications/solvers/compressible/rhopSonicFoam/rhopSonicFoam.C @@ -53,8 +53,9 @@ int main(int argc, char *argv[]) Info<< "\nStarting time loop\n" << endl; - for (runTime++; !runTime.end(); runTime++) + while (runTime.run()) { + runTime++; Info<< "Time = " << runTime.value() << nl << endl; # include "readPISOControls.H" diff --git a/applications/solvers/compressible/sonicDyMFoam/sonicDyMFoam.C b/applications/solvers/compressible/sonicDyMFoam/sonicDyMFoam.C index 34faaf78facb1c0690bc9f956f8fcd39c02d1d33..593bc742cf96c9f0fa246f49877749a2ca1ae719 100644 --- a/applications/solvers/compressible/sonicDyMFoam/sonicDyMFoam.C +++ b/applications/solvers/compressible/sonicDyMFoam/sonicDyMFoam.C @@ -52,8 +52,9 @@ int main(int argc, char *argv[]) autoPtr<Foam::motionSolver> motionPtr = motionSolver::New(mesh); - for (runTime++; !runTime.end(); runTime++) + while (runTime.run()) { + runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; #include "readPISOControls.H" diff --git a/applications/solvers/compressible/sonicFoam/sonicFoam.C b/applications/solvers/compressible/sonicFoam/sonicFoam.C index 08d1f85fec0189af83e5861f69893948b3e87423..741141c1c4e3218778969ca7200405e8e9ea5475 100644 --- a/applications/solvers/compressible/sonicFoam/sonicFoam.C +++ b/applications/solvers/compressible/sonicFoam/sonicFoam.C @@ -49,8 +49,9 @@ int main(int argc, char *argv[]) Info<< "\nStarting time loop\n" << endl; - for (runTime++; !runTime.end(); runTime++) + while (runTime.run()) { + runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; #include "readPISOControls.H" diff --git a/applications/solvers/compressible/sonicLiquidFoam/sonicLiquidFoam.C b/applications/solvers/compressible/sonicLiquidFoam/sonicLiquidFoam.C index 90243b2322ce27fb2b1a9ba20da215dee1910f48..87dcf947b03565549bfd34248124a3bc2ad3816e 100644 --- a/applications/solvers/compressible/sonicLiquidFoam/sonicLiquidFoam.C +++ b/applications/solvers/compressible/sonicLiquidFoam/sonicLiquidFoam.C @@ -50,8 +50,9 @@ int main(int argc, char *argv[]) Info<< "\nStarting time loop\n" << endl; - for (runTime++; !runTime.end(); runTime++) + while (runTime.run()) { + runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; # include "readPISOControls.H" diff --git a/applications/solvers/electromagnetics/electrostaticFoam/electrostaticFoam.C b/applications/solvers/electromagnetics/electrostaticFoam/electrostaticFoam.C index 13438974ac82383690b05e9f0b7a6a86ad9c83a9..11daf2e0b4a86817e4564f25ec1d4af4566f11b2 100644 --- a/applications/solvers/electromagnetics/electrostaticFoam/electrostaticFoam.C +++ b/applications/solvers/electromagnetics/electrostaticFoam/electrostaticFoam.C @@ -47,8 +47,9 @@ int main(int argc, char *argv[]) Info<< "\nStarting iteration loop\n" << endl; - for (runTime++; !runTime.end(); runTime++) + while (runTime.run()) { + runTime++; Info<< "Iteration = " << runTime.timeName() << nl << endl; solve diff --git a/applications/solvers/electromagnetics/mhdFoam/mhdFoam.C b/applications/solvers/electromagnetics/mhdFoam/mhdFoam.C index 9da017da3a7cf6d695fce6808c51f99d79a066c8..e121150c7a3d4f207220738ad5634a89d5ff53b2 100644 --- a/applications/solvers/electromagnetics/mhdFoam/mhdFoam.C +++ b/applications/solvers/electromagnetics/mhdFoam/mhdFoam.C @@ -71,8 +71,9 @@ int main(int argc, char *argv[]) Info<< nl << "Starting time loop" << endl; - for (runTime++; !runTime.end(); runTime++) + while (runTime.run()) { + runTime++; # include "readPISOControls.H" # include "readBPISOControls.H" diff --git a/applications/solvers/financial/financialFoam/financialFoam.C b/applications/solvers/financial/financialFoam/financialFoam.C index eabbafaf7396bdc458957fb9fc45409fa9709009..9edd07a8d0a21c4b2e9ab8de8aa9bb2af4e489d1 100644 --- a/applications/solvers/financial/financialFoam/financialFoam.C +++ b/applications/solvers/financial/financialFoam/financialFoam.C @@ -55,8 +55,9 @@ int main(int argc, char *argv[]) Info<< "Starting time loop\n" << endl; - for (runTime++; !runTime.end(); runTime++) + while (runTime.run()) { + runTime++; delta == fvc::grad(V)().component(Foam::vector::X); solve diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqFoam/Make/files b/applications/solvers/heatTransfer/buoyantBoussinesqFoam/Make/files deleted file mode 100644 index d6a7819c0e016c560a996d803a3b0e160ebce735..0000000000000000000000000000000000000000 --- a/applications/solvers/heatTransfer/buoyantBoussinesqFoam/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -buoyantBoussinesqFoam.C - -EXE = $(FOAM_APPBIN)/buoyantBoussinesqFoam diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/Make/files b/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..d7b85221d8cc06678b43d79372979e01f5606600 --- /dev/null +++ b/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/Make/files @@ -0,0 +1,3 @@ +buoyantBoussinesqPisoFoam.C + +EXE = $(FOAM_APPBIN)/buoyantBoussinesqPisoFoam diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqFoam/Make/options b/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/Make/options similarity index 100% rename from applications/solvers/heatTransfer/buoyantBoussinesqFoam/Make/options rename to applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/Make/options diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqFoam/TEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/TEqn.H similarity index 100% rename from applications/solvers/heatTransfer/buoyantBoussinesqFoam/TEqn.H rename to applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/TEqn.H diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqFoam/UEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/UEqn.H similarity index 100% rename from applications/solvers/heatTransfer/buoyantBoussinesqFoam/UEqn.H rename to applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/UEqn.H diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqFoam/buoyantBoussinesqFoam.C b/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/buoyantBoussinesqPisoFoam.C similarity index 95% rename from applications/solvers/heatTransfer/buoyantBoussinesqFoam/buoyantBoussinesqFoam.C rename to applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/buoyantBoussinesqPisoFoam.C index 72aab39ac044b8fe3ce59501c04204be4ce2808e..1a9f02325380fcdf22461b78323251dd0d5f90bd 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqFoam/buoyantBoussinesqFoam.C +++ b/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/buoyantBoussinesqPisoFoam.C @@ -23,10 +23,10 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Application - buoyantBoussinesqSimpleFoam + buoyantBoussinesqPisoFoam Description - Steady-state solver for buoyant, turbulent flow of incompressible fluids + Transient solver for buoyant, turbulent flow of incompressible fluids Uses the Boussinesq approximation: \f[ @@ -69,8 +69,9 @@ int main(int argc, char *argv[]) Info<< "\nStarting time loop\n" << endl; - for (runTime++; !runTime.end(); runTime++) + while (runTime.run()) { + runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; # include "readTimeControls.H" diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqFoam/createFields.H b/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/createFields.H similarity index 100% rename from applications/solvers/heatTransfer/buoyantBoussinesqFoam/createFields.H rename to applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/createFields.H diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqFoam/pdEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/pdEqn.H similarity index 100% rename from applications/solvers/heatTransfer/buoyantBoussinesqFoam/pdEqn.H rename to applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/pdEqn.H diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqFoam/readTransportProperties.H b/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/readTransportProperties.H similarity index 100% rename from applications/solvers/heatTransfer/buoyantBoussinesqFoam/readTransportProperties.H rename to applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/readTransportProperties.H diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqFoam/writeAdditionalFields.H b/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/writeAdditionalFields.H similarity index 100% rename from applications/solvers/heatTransfer/buoyantBoussinesqFoam/writeAdditionalFields.H rename to applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/writeAdditionalFields.H diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/buoyantBoussinesqSimpleFoam.C b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/buoyantBoussinesqSimpleFoam.C index 5e9deff76449eda684405bbd010aa5e611404bda..c8e62813e8fd838beb1ce0c405572aa7d17b5680 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/buoyantBoussinesqSimpleFoam.C +++ b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/buoyantBoussinesqSimpleFoam.C @@ -66,8 +66,9 @@ int main(int argc, char *argv[]) Info<< "\nStarting time loop\n" << endl; - for (runTime++; !runTime.end(); runTime++) + while (runTime.run()) { + runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; # include "readSIMPLEControls.H" diff --git a/applications/solvers/heatTransfer/buoyantFoam/Make/files b/applications/solvers/heatTransfer/buoyantFoam/Make/files deleted file mode 100644 index fccde862b263aca3909e34fc47dbb69a0d06f658..0000000000000000000000000000000000000000 --- a/applications/solvers/heatTransfer/buoyantFoam/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -buoyantFoam.C - -EXE = $(FOAM_APPBIN)/buoyantFoam diff --git a/applications/solvers/heatTransfer/buoyantPisoFoam/Make/files b/applications/solvers/heatTransfer/buoyantPisoFoam/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..65e5d52305884cf1ae68525236f7aee9537a4528 --- /dev/null +++ b/applications/solvers/heatTransfer/buoyantPisoFoam/Make/files @@ -0,0 +1,3 @@ +buoyantPisoFoam.C + +EXE = $(FOAM_APPBIN)/buoyantPisoFoam diff --git a/applications/solvers/heatTransfer/buoyantFoam/Make/options b/applications/solvers/heatTransfer/buoyantPisoFoam/Make/options similarity index 100% rename from applications/solvers/heatTransfer/buoyantFoam/Make/options rename to applications/solvers/heatTransfer/buoyantPisoFoam/Make/options diff --git a/applications/solvers/heatTransfer/buoyantFoam/UEqn.H b/applications/solvers/heatTransfer/buoyantPisoFoam/UEqn.H similarity index 100% rename from applications/solvers/heatTransfer/buoyantFoam/UEqn.H rename to applications/solvers/heatTransfer/buoyantPisoFoam/UEqn.H diff --git a/applications/solvers/heatTransfer/buoyantFoam/buoyantFoam.C b/applications/solvers/heatTransfer/buoyantPisoFoam/buoyantPisoFoam.C similarity index 99% rename from applications/solvers/heatTransfer/buoyantFoam/buoyantFoam.C rename to applications/solvers/heatTransfer/buoyantPisoFoam/buoyantPisoFoam.C index 75eb401d3db5a512a14734f29460b6bfc76957f2..18dadabf8baaf398d16e0be06cb69eb726fd7fae 100644 --- a/applications/solvers/heatTransfer/buoyantFoam/buoyantFoam.C +++ b/applications/solvers/heatTransfer/buoyantPisoFoam/buoyantPisoFoam.C @@ -23,7 +23,7 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Application - buoyantFoam + buoyantPisoFoam Description Transient Solver for buoyant, turbulent flow of compressible fluids for diff --git a/applications/solvers/heatTransfer/buoyantFoam/createFields.H b/applications/solvers/heatTransfer/buoyantPisoFoam/createFields.H similarity index 100% rename from applications/solvers/heatTransfer/buoyantFoam/createFields.H rename to applications/solvers/heatTransfer/buoyantPisoFoam/createFields.H diff --git a/applications/solvers/heatTransfer/buoyantFoam/hEqn.H b/applications/solvers/heatTransfer/buoyantPisoFoam/hEqn.H similarity index 100% rename from applications/solvers/heatTransfer/buoyantFoam/hEqn.H rename to applications/solvers/heatTransfer/buoyantPisoFoam/hEqn.H diff --git a/applications/solvers/heatTransfer/buoyantFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantPisoFoam/pEqn.H similarity index 100% rename from applications/solvers/heatTransfer/buoyantFoam/pEqn.H rename to applications/solvers/heatTransfer/buoyantPisoFoam/pEqn.H diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C b/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C index ebe0f4579a226a2c58ea408e02fa98dfcd733ec2..e9c48b937f876419fc118414fdfc74168c987fa6 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C @@ -51,8 +51,9 @@ int main(int argc, char *argv[]) Info<< "\nStarting time loop\n" << endl; - for (runTime++; !runTime.end(); runTime++) + while (runTime.run()) { + runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; # include "readSIMPLEControls.H" diff --git a/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam.C b/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam.C index 21059f5064914672975bace6a4bffdaf9a4f48c5..21e4912ae70a3d7971454e7ef0abce84d24d688d 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam.C +++ b/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam.C @@ -54,8 +54,9 @@ int main(int argc, char *argv[]) Info<< "\nStarting time loop\n" << endl; - for (runTime++; !runTime.end(); runTime++) + while (runTime.run()) { + runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; # include "readSIMPLEControls.H" diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C index 84c7c1180634d4bc1ba25b504769c7bc98001e1b..8a19fd0264c75072bd1ae1dae6df375e63cb3dc7 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C @@ -64,7 +64,7 @@ int main(int argc, char *argv[]) # include "setInitialDeltaT.H" } - while(runTime.run()) + while (runTime.run()) { # include "readTimeControls.H" diff --git a/applications/solvers/incompressible/boundaryFoam/boundaryFoam.C b/applications/solvers/incompressible/boundaryFoam/boundaryFoam.C index a8e063c2dbc3e8124174121c744fcef4403bc946..2360fb6677cf0d10a414b6516112e54c9084861d 100644 --- a/applications/solvers/incompressible/boundaryFoam/boundaryFoam.C +++ b/applications/solvers/incompressible/boundaryFoam/boundaryFoam.C @@ -58,8 +58,9 @@ int main(int argc, char *argv[]) Info<< "\nStarting time loop\n" << endl; - for (runTime++; !runTime.end(); runTime++) + while (runTime.run()) { + runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; fvVectorMatrix divR = turbulence->divDevReff(U); diff --git a/applications/solvers/incompressible/channelFoam/channelFoam.C b/applications/solvers/incompressible/channelFoam/channelFoam.C index fe245ed82db46fdd2224694f51e7865ad2fd8f77..94d8f4acd4d3b60731369a04414b2bf903750664 100644 --- a/applications/solvers/incompressible/channelFoam/channelFoam.C +++ b/applications/solvers/incompressible/channelFoam/channelFoam.C @@ -51,8 +51,9 @@ int main(int argc, char *argv[]) Info<< "\nStarting time loop\n" << endl; - for(runTime++; !runTime.end(); runTime++) + while (runTime.run()) { + runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; #include "readPISOControls.H" diff --git a/applications/solvers/incompressible/icoFoam/icoFoam.C b/applications/solvers/incompressible/icoFoam/icoFoam.C index 993f328905ea65bce0d666ae9242e1a64c888fe0..d8c549668f58a523b6456fde6005c290025e88e9 100644 --- a/applications/solvers/incompressible/icoFoam/icoFoam.C +++ b/applications/solvers/incompressible/icoFoam/icoFoam.C @@ -48,8 +48,9 @@ int main(int argc, char *argv[]) Info<< "\nStarting time loop\n" << endl; - for (runTime++; !runTime.end(); runTime++) + while (runTime.run()) { + runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; # include "readPISOControls.H" diff --git a/applications/solvers/incompressible/nonNewtonianIcoFoam/nonNewtonianIcoFoam.C b/applications/solvers/incompressible/nonNewtonianIcoFoam/nonNewtonianIcoFoam.C index b1ce2450174eca78f5717f197a9aef300c33befc..f949b39cfc614e2706fc897eda5a5b56686a494c 100644 --- a/applications/solvers/incompressible/nonNewtonianIcoFoam/nonNewtonianIcoFoam.C +++ b/applications/solvers/incompressible/nonNewtonianIcoFoam/nonNewtonianIcoFoam.C @@ -49,8 +49,9 @@ int main(int argc, char *argv[]) Info<< "\nStarting time loop\n" << endl; - for (runTime++; !runTime.end(); runTime++) + while (runTime.run()) { + runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; # include "readPISOControls.H" diff --git a/applications/solvers/incompressible/pisoFoam/pisoFoam.C b/applications/solvers/incompressible/pisoFoam/pisoFoam.C index 01b349e9fa0ec0f75102e978d17cc6b169c7c162..95b4bc0843c2b1e488d42a1dda73f6a48554e0c4 100644 --- a/applications/solvers/incompressible/pisoFoam/pisoFoam.C +++ b/applications/solvers/incompressible/pisoFoam/pisoFoam.C @@ -52,8 +52,9 @@ int main(int argc, char *argv[]) Info<< "\nStarting time loop\n" << endl; - for (runTime++; !runTime.end(); runTime++) + while (runTime.run()) { + runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; # include "readPISOControls.H" diff --git a/applications/solvers/incompressible/simpleFoam/simpleFoam.C b/applications/solvers/incompressible/simpleFoam/simpleFoam.C index d5b99e33ea545c9790a387dea23316dba40ff080..ec0515aa19e9fc5a1232720d37797ec430b20a91 100644 --- a/applications/solvers/incompressible/simpleFoam/simpleFoam.C +++ b/applications/solvers/incompressible/simpleFoam/simpleFoam.C @@ -49,8 +49,9 @@ int main(int argc, char *argv[]) Info<< "\nStarting time loop\n" << endl; - for (runTime++; !runTime.end(); runTime++) + while (runTime.run()) { + runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; # include "readSIMPLEControls.H" diff --git a/applications/solvers/multiphase/bubbleFoam/bubbleFoam.C b/applications/solvers/multiphase/bubbleFoam/bubbleFoam.C index 4344f5d4719e5f4ce34733089e370bd9023dc1c4..4a6f845fd89c6d109ccf81e4d5e8c57ceb1933a4 100644 --- a/applications/solvers/multiphase/bubbleFoam/bubbleFoam.C +++ b/applications/solvers/multiphase/bubbleFoam/bubbleFoam.C @@ -53,8 +53,9 @@ int main(int argc, char *argv[]) Info<< "\nStarting time loop\n" << endl; - for (runTime++; !runTime.end(); runTime++) + while (runTime.run()) { + runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; # include "readBubbleFoamControls.H" diff --git a/applications/solvers/multiphase/settlingFoam/settlingFoam.C b/applications/solvers/multiphase/settlingFoam/settlingFoam.C index 70fe56a37c03a1220279e1c627bac0a78cec84af..a43dd5408b7c623745dfc6a2a4c8483b521f013e 100644 --- a/applications/solvers/multiphase/settlingFoam/settlingFoam.C +++ b/applications/solvers/multiphase/settlingFoam/settlingFoam.C @@ -57,8 +57,9 @@ int main(int argc, char *argv[]) Info<< "\nStarting time loop\n" << endl; - for (runTime++; !runTime.end(); runTime++) + while (runTime.run()) { + runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; # include "readPISOControls.H" diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C b/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C index 6501f24a503b8275bc867a99f28d185124f37cb0..dbc8b2774f5588f1571c6b83c1fffc8fb7bbb47e 100644 --- a/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C @@ -52,8 +52,9 @@ int main(int argc, char *argv[]) Info<< "\nStarting time loop\n" << endl; - for (runTime++; !runTime.end(); runTime++) + while (runTime.run()) { + runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; # include "readPISOControls.H" diff --git a/applications/solvers/stressAnalysis/solidDisplacementFoam/solidDisplacementFoam.C b/applications/solvers/stressAnalysis/solidDisplacementFoam/solidDisplacementFoam.C index 4405652cd408c3739828c985a34292840129ee32..afa3c6600103181b52dee6512e480b67fa3b46a9 100644 --- a/applications/solvers/stressAnalysis/solidDisplacementFoam/solidDisplacementFoam.C +++ b/applications/solvers/stressAnalysis/solidDisplacementFoam/solidDisplacementFoam.C @@ -57,8 +57,9 @@ int main(int argc, char *argv[]) Info<< "\nCalculating displacement field\n" << endl; - for (runTime++; !runTime.end(); runTime++) + while (runTime.run()) { + runTime++; Info<< "Iteration: " << runTime.value() << nl << endl; # include "readSolidDisplacementFoamControls.H" diff --git a/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/solidEquilibriumDisplacementFoam.C b/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/solidEquilibriumDisplacementFoam.C index f0f93112b9d3a0549376543f97639c3abaebf0df..00a98b25310c2d3fb7813c944ebdb9c78d971450 100644 --- a/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/solidEquilibriumDisplacementFoam.C +++ b/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/solidEquilibriumDisplacementFoam.C @@ -55,8 +55,9 @@ int main(int argc, char *argv[]) Info<< "\nCalculating displacement field\n" << endl; - for (runTime++; !runTime.end(); runTime++) + while (runTime.run()) { + runTime++; Info<< "Iteration: " << runTime.value() << nl << endl; # include "readSteadyStressFoamControls.H" diff --git a/applications/test/LduMatrix/LduMatrixTest3.C b/applications/test/LduMatrix/LduMatrixTest3.C index 18f3a7391fe3bdab8a8de6263264a02ecda10d37..729bc593295b49cf38f391af7286e67bc196acfd 100644 --- a/applications/test/LduMatrix/LduMatrixTest3.C +++ b/applications/test/LduMatrix/LduMatrixTest3.C @@ -53,8 +53,9 @@ int main(int argc, char *argv[]) Info<< "\nStarting time loop\n" << endl; - for (runTime++; !runTime.end(); runTime++) + while (runTime.run()) { + runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; # include "readPISOControls.H" diff --git a/applications/test/nearWallDist-wave/testWallDist2.C b/applications/test/nearWallDist-wave/testWallDist2.C index c84b7fb118cc98a587d2a0296f1c76967e7b2ac8..304cdba3d6560da29ebc360cb28e819070da2518 100644 --- a/applications/test/nearWallDist-wave/testWallDist2.C +++ b/applications/test/nearWallDist-wave/testWallDist2.C @@ -120,8 +120,9 @@ int main(int argc, char *argv[]) Info<< "\nStarting time loop\n" << endl; - for (runTime++; !runTime.end(); runTime++) + while (runTime.run()) { + runTime++; Info<< "Time = " << runTime.timeName() << endl; diff --git a/applications/utilities/mesh/manipulation/moveDynamicMesh/moveDynamicMesh.C b/applications/utilities/mesh/manipulation/moveDynamicMesh/moveDynamicMesh.C index 1e2ec46744ce128dacb0c5b31d5cfa0d6c6d9986..64d65e3affa927e4e3f77d5395106fbfb728a4d4 100644 --- a/applications/utilities/mesh/manipulation/moveDynamicMesh/moveDynamicMesh.C +++ b/applications/utilities/mesh/manipulation/moveDynamicMesh/moveDynamicMesh.C @@ -46,8 +46,9 @@ int main(int argc, char *argv[]) # include "createTime.H" # include "createDynamicFvMesh.H" - for (runTime++; !runTime.end(); runTime++) + while (runTime.run()) { + runTime++; Info<< "Time = " << runTime.timeName() << endl; mesh.update(); diff --git a/applications/utilities/mesh/manipulation/moveEngineMesh/moveEngineMesh.C b/applications/utilities/mesh/manipulation/moveEngineMesh/moveEngineMesh.C index 75cd8ef583d876f490773e9d63309d127854ec3d..a10782b553c5b4b9c94674a2473e248b3c53780c 100644 --- a/applications/utilities/mesh/manipulation/moveEngineMesh/moveEngineMesh.C +++ b/applications/utilities/mesh/manipulation/moveEngineMesh/moveEngineMesh.C @@ -47,8 +47,9 @@ int main(int argc, char *argv[]) Info<< "\nStarting time loop\n" << endl; - for (runTime++; !runTime.end(); runTime++) + while (runTime.run()) { + runTime++; Info<< "Time = " << runTime.theta() << " CA-deg\n" << endl; mesh.move(); diff --git a/applications/utilities/mesh/manipulation/moveMesh/moveMesh.C b/applications/utilities/mesh/manipulation/moveMesh/moveMesh.C index da82839b1b7c3edd429e66a8f7dad9bad71c69d0..82e6e45a752293648cabf0a845e0117e9f5c419e 100644 --- a/applications/utilities/mesh/manipulation/moveMesh/moveMesh.C +++ b/applications/utilities/mesh/manipulation/moveMesh/moveMesh.C @@ -46,8 +46,9 @@ int main(int argc, char *argv[]) autoPtr<Foam::motionSolver> motionPtr = motionSolver::New(mesh); - for (runTime++; !runTime.end(); runTime++) + while (runTime.run()) { + runTime++; Info<< "Time = " << runTime.timeName() << endl; mesh.movePoints(motionPtr->newPoints()); diff --git a/applications/utilities/postProcessing/miscellaneous/execFlowFunctionObjects/execFlowFunctionObjects.C b/applications/utilities/postProcessing/miscellaneous/execFlowFunctionObjects/execFlowFunctionObjects.C index 3132872c035eba953925e5361020252a8be3e018..45faede694f7a240f624fd4b6054da2207b49693 100644 --- a/applications/utilities/postProcessing/miscellaneous/execFlowFunctionObjects/execFlowFunctionObjects.C +++ b/applications/utilities/postProcessing/miscellaneous/execFlowFunctionObjects/execFlowFunctionObjects.C @@ -74,7 +74,7 @@ namespace Foam } else { - functionObjectList fol(runTime, runTime.controlDict()); + functionObjectList fol(runTime); fol.start(); fol.execute(); } diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files index 92c81085ab93aad0624f2bd3ba873d54dcd9dd9d..833be5ccd565a1f21b19382b5eeb4a3150f38fbf 100644 --- a/src/OpenFOAM/Make/files +++ b/src/OpenFOAM/Make/files @@ -144,11 +144,14 @@ $(regIOobject)/regIOobjectWrite.C db/IOobjectList/IOobjectList.C db/objectRegistry/objectRegistry.C -db/functionObject/functionObject.C -db/functionObjectList/functionObjectList.C db/CallbackRegistry/CallbackRegistryName.C db/dlLibraryTable/dlLibraryTable.C +db/functionObjects/functionObject/functionObject.C +db/functionObjects/functionObjectList/functionObjectList.C +db/functionObjects/outputFilterOutputControl/outputFilterOutputControl.C + + Time = db/Time $(Time)/TimePaths.C $(Time)/TimeState.C diff --git a/src/OpenFOAM/db/Time/Time.C b/src/OpenFOAM/db/Time/Time.C index 26d2182e95fbe6c5c9b5c68bd44d73cf819f4e8b..f52303220f27347e315f1acffa61c5f7676925a0 100644 --- a/src/OpenFOAM/db/Time/Time.C +++ b/src/OpenFOAM/db/Time/Time.C @@ -352,25 +352,27 @@ Foam::Time::Time // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::Time::~Time() -{} +{ + // destroy function objects first + functionObjects_.clear(); +} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // Foam::word Foam::Time::timeName(const scalar t) { - std::ostringstream osBuffer; - osBuffer.setf(ios_base::fmtflags(format_), ios_base::floatfield); - osBuffer.precision(precision_); - osBuffer << t; - return osBuffer.str(); + std::ostringstream buf; + buf.setf(ios_base::fmtflags(format_), ios_base::floatfield); + buf.precision(precision_); + buf << t; + return buf.str(); } Foam::word Foam::Time::timeName() const { return dimensionedScalar::name(); - //return timeName(timeOutputValue()); } @@ -432,7 +434,7 @@ Foam::instant Foam::Time::findClosestTime(const scalar t) const return times[nearestIndex]; } -// + // This should work too, // if we don't worry about checking "constant" explicitly // @@ -490,9 +492,15 @@ bool Foam::Time::run() const { bool running = value() < (endTime_ - 0.5*deltaT_); - if (!subCycling_ && !running && timeIndex_ != startTimeIndex_) + if (!subCycling_) { - const_cast<functionObjectList&>(functionObjects_).execute(); + // only execute when the condition is no longer true + // ie, when exiting the control loop + if (!running && timeIndex_ != startTimeIndex_) + { + // Note, end() also calls an indirect start() as required + functionObjects_.end(); + } } return running; @@ -501,7 +509,7 @@ bool Foam::Time::run() const bool Foam::Time::end() const { - return (value() > (endTime_ + 0.5*deltaT_)); + return value() > (endTime_ + 0.5*deltaT_); } @@ -611,9 +619,7 @@ Foam::Time& Foam::Time::operator+=(const dimensionedScalar& deltaT) Foam::Time& Foam::Time::operator+=(const scalar deltaT) { setDeltaT(deltaT); - operator++(); - - return *this; + return operator++(); } @@ -643,22 +649,22 @@ Foam::Time& Foam::Time::operator++() setTime(0.0, timeIndex_); } - switch(writeControl_) + switch (writeControl_) { case wcTimeStep: - outputTime_ = !(timeIndex_%label(writeInterval_)); + outputTime_ = !(timeIndex_ % label(writeInterval_)); break; case wcRunTime: case wcAdjustableRunTime: { - label outputTimeIndex = + label outputIndex = label(((value() - startTime_) + 0.5*deltaT_)/writeInterval_); - if (outputTimeIndex > outputTimeIndex_) + if (outputIndex > outputTimeIndex_) { outputTime_ = true; - outputTimeIndex_ = outputTimeIndex; + outputTimeIndex_ = outputIndex; } else { @@ -669,13 +675,11 @@ Foam::Time& Foam::Time::operator++() case wcCpuTime: { - label outputTimeIndex = - label(elapsedCpuTime()/writeInterval_); - - if (outputTimeIndex > outputTimeIndex_) + label outputIndex = label(elapsedCpuTime()/writeInterval_); + if (outputIndex > outputTimeIndex_) { outputTime_ = true; - outputTimeIndex_ = outputTimeIndex; + outputTimeIndex_ = outputIndex; } else { @@ -686,11 +690,11 @@ Foam::Time& Foam::Time::operator++() case wcClockTime: { - label outputTimeIndex = label(elapsedClockTime()/writeInterval_); - if (outputTimeIndex > outputTimeIndex_) + label outputIndex = label(elapsedClockTime()/writeInterval_); + if (outputIndex > outputTimeIndex_) { outputTime_ = true; - outputTimeIndex_ = outputTimeIndex; + outputTimeIndex_ = outputIndex; } else { @@ -698,8 +702,9 @@ Foam::Time& Foam::Time::operator++() } } break; - }; + } + // see if endTime needs adjustment to stop at the next run()/end() check if (!end()) { if (stopAt_ == saNoWriteNow) diff --git a/src/OpenFOAM/db/Time/Time.H b/src/OpenFOAM/db/Time/Time.H index f69f11b581f87ba334c0af3e20b1e3fe2799d938..70f6985b4142b349cca2ca2a9971fafe6e93268e 100644 --- a/src/OpenFOAM/db/Time/Time.H +++ b/src/OpenFOAM/db/Time/Time.H @@ -26,7 +26,7 @@ Class Foam::Time Description - Class to control time during FOAM simulations which is also the + Class to control time during OpenFOAM simulations that is also the top-level objectRegistry. SourceFiles @@ -109,7 +109,7 @@ protected: // Protected data - label startTimeIndex_; + label startTimeIndex_; scalar startTime_; scalar endTime_; @@ -121,10 +121,10 @@ protected: scalar writeInterval_; - label purgeWrite_; + label purgeWrite_; mutable FIFOStack<word> previousOutputTimes_; - //- Is the time currently being sub-cycled + //- Is the time currently being sub-cycled? bool subCycling_; //- Time directory name format @@ -157,21 +157,21 @@ private: //- Default graph format word graphFormat_; - //- Is runtim modification of dictionaries allowed + //- Is runtime modification of dictionaries allowed? Switch runTimeModifiable_; //- Instantiate a dummy class to cause the reading of dynamic libraries dlLibraryTable::readDlLibrary readLibs_; //- Function objects executed at start and on ++, += - functionObjectList functionObjects_; + mutable functionObjectList functionObjects_; public: TypeName("time"); - //- The default control dictionary name + //- The default control dictionary name (normally "controlDict") static word controlDictName; @@ -282,8 +282,8 @@ public: void readModifiedObjects(); //- Return the location of "dir" containing the file "name". - // (Used in reading mesh data) - // If name is null search for the directory "dir" only + // (eg, used in reading mesh data) + // If name is null, search for the directory "dir" only word findInstance ( const fileName& dir, @@ -291,7 +291,7 @@ public: const IOobject::readOption rOpt = IOobject::MUST_READ ) const; - //- Search tha case for valid time directories + //- Search the case for valid time directories instantList times() const; //- Search the case for the time directory path @@ -307,9 +307,9 @@ public: //- Write using given format, version and compression virtual bool writeObject ( - IOstream::streamFormat fmt, - IOstream::versionNumber ver, - IOstream::compressionType cmp + IOstream::streamFormat, + IOstream::versionNumber, + IOstream::compressionType ) const; //- Write the objects now and continue the run @@ -348,10 +348,28 @@ public: // Check - //- Return true if run should continue + //- Return true if run should continue, + // also invokes the functionObjectList::end() method + // when the time goes out of range + // @note + // For correct baheviour, the following style of time-loop + // is recommended: + // @code + // while (runTime.run()) + // { + // runTime++; + // solve; + // runTime.write(); + // } + // @endcode virtual bool run() const; - //- Return true if end of run + //- Return true if end of run, + // does not invoke any functionObject methods + // @note + // The rounding heuristics near endTime mean that + // @code run() @endcode and @code !end() @endcode may + // not yield the same result virtual bool end() const; @@ -400,16 +418,18 @@ public: // Member operators - //- Set deltaT to that specified and increment time + //- Set deltaT to that specified and increment time via operator++() virtual Time& operator+=(const dimensionedScalar&); - //- Set deltaT to that specified and increment time + //- Set deltaT to that specified and increment time via operator++() virtual Time& operator+=(const scalar); - //- Prefix increment + //- Prefix increment, + // also invokes the functionObjectList::start() or + // functionObjectList::execute() method, depending on the time-index virtual Time& operator++(); - //- Postfix increment + //- Postfix increment, this is identical to the prefix increment virtual Time& operator++(int); }; diff --git a/src/OpenFOAM/db/Time/TimeIO.C b/src/OpenFOAM/db/Time/TimeIO.C index 1f1df0507e9340410546d9fc5fb222d11740a0c7..58197b520e455b5c0623c133755d37d99eb8d343 100644 --- a/src/OpenFOAM/db/Time/TimeIO.C +++ b/src/OpenFOAM/db/Time/TimeIO.C @@ -61,7 +61,7 @@ void Foam::Time::readDict() if (oldWriteInterval != writeInterval_) { - switch(writeControl_) + switch (writeControl_) { case wcRunTime: case wcAdjustableRunTime: @@ -180,11 +180,7 @@ void Foam::Time::readDict() } controlDict_.readIfPresent("graphFormat", graphFormat_); - - if (controlDict_.found("runTimeModifiable")) - { - runTimeModifiable_ = Switch(controlDict_.lookup("runTimeModifiable")); - } + controlDict_.readIfPresent("runTimeModifiable", runTimeModifiable_); } @@ -268,25 +264,14 @@ bool Foam::Time::writeObject timeDict.add("deltaT", deltaT_); timeDict.add("deltaT0", deltaT0_); - timeDict.regIOobject::writeObject - ( - fmt, - ver, - cmp - ); - - bool writeOK = objectRegistry::writeObject - ( - fmt, - ver, - cmp - ); + timeDict.regIOobject::writeObject(fmt, ver, cmp); + bool writeOK = objectRegistry::writeObject(fmt, ver, cmp); if (writeOK && purgeWrite_) { previousOutputTimes_.push(timeName()); - while(previousOutputTimes_.size() > purgeWrite_) + while (previousOutputTimes_.size() > purgeWrite_) { rmDir(objectRegistry::path(previousOutputTimes_.pop())); } @@ -310,7 +295,7 @@ bool Foam::Time::writeNow() bool Foam::Time::writeAndEnd() { - stopAt_ = saWriteNow; + stopAt_ = saWriteNow; endTime_ = value(); return writeNow(); diff --git a/src/OpenFOAM/db/Time/subCycleTime.H b/src/OpenFOAM/db/Time/subCycleTime.H index 8081edbb1718a8822a4b83e0b57174e2bf007d4e..01082625fbb03179cd94c1f528a249a01a25c9e3 100644 --- a/src/OpenFOAM/db/Time/subCycleTime.H +++ b/src/OpenFOAM/db/Time/subCycleTime.H @@ -44,7 +44,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class subCycleTimeTime Declaration + Class subCycleTime Declaration \*---------------------------------------------------------------------------*/ class subCycleTime @@ -62,7 +62,7 @@ public: // Constructors //- Construct from original time and number of sub-cycles - subCycleTime(Time& t, const label nSubCycles); + subCycleTime(Time&, const label nSubCycles); // Destructor @@ -72,6 +72,7 @@ public: // Member functions + //- Return true if the number of sub-cycles has been reached bool end() const; //- End the sub-cycling and reset the time-state diff --git a/src/sampling/outputFilters/IOOutputFilter/IOOutputFilter.C b/src/OpenFOAM/db/functionObjects/IOOutputFilter/IOOutputFilter.C similarity index 100% rename from src/sampling/outputFilters/IOOutputFilter/IOOutputFilter.C rename to src/OpenFOAM/db/functionObjects/IOOutputFilter/IOOutputFilter.C diff --git a/src/sampling/outputFilters/IOOutputFilter/IOOutputFilter.H b/src/OpenFOAM/db/functionObjects/IOOutputFilter/IOOutputFilter.H similarity index 100% rename from src/sampling/outputFilters/IOOutputFilter/IOOutputFilter.H rename to src/OpenFOAM/db/functionObjects/IOOutputFilter/IOOutputFilter.H diff --git a/src/sampling/outputFilters/OutputFilterFunctionObject/OutputFilterFunctionObject.C b/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.C similarity index 93% rename from src/sampling/outputFilters/OutputFilterFunctionObject/OutputFilterFunctionObject.C rename to src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.C index 45305257e9f760ea57028d8dd395937c36a56479..15a32c1e8e3b979d53da4aefac77e0e65afe4682 100644 --- a/src/sampling/outputFilters/OutputFilterFunctionObject/OutputFilterFunctionObject.C +++ b/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.C @@ -65,6 +65,20 @@ Foam::OutputFilterFunctionObject<OutputFilter>::OutputFilterFunctionObject // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template<class OutputFilter> +void Foam::OutputFilterFunctionObject<OutputFilter>::on() +{ + enabled_ = true; +} + + +template<class OutputFilter> +void Foam::OutputFilterFunctionObject<OutputFilter>::off() +{ + enabled_ = false; +} + + template<class OutputFilter> bool Foam::OutputFilterFunctionObject<OutputFilter>::start() { @@ -120,16 +134,19 @@ bool Foam::OutputFilterFunctionObject<OutputFilter>::execute() template<class OutputFilter> -void Foam::OutputFilterFunctionObject<OutputFilter>::on() +bool Foam::OutputFilterFunctionObject<OutputFilter>::end() { - enabled_ = true; -} + if (enabled_) + { + ptr_->end(); + if (enabled_ && outputControl_.output()) + { + ptr_->write(); + } + } -template<class OutputFilter> -void Foam::OutputFilterFunctionObject<OutputFilter>::off() -{ - enabled_ = false; + return true; } diff --git a/src/sampling/outputFilters/OutputFilterFunctionObject/OutputFilterFunctionObject.H b/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.H similarity index 89% rename from src/sampling/outputFilters/OutputFilterFunctionObject/OutputFilterFunctionObject.H rename to src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.H index 7800d764a626728cdd421401a9fd8ab47a769a80..5ab4ebbecec37c35c8e76d5d1eb5653e0ed13fad 100644 --- a/src/sampling/outputFilters/OutputFilterFunctionObject/OutputFilterFunctionObject.H +++ b/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.H @@ -53,7 +53,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class OutputFilterFunctionObject Declaration + Class OutputFilterFunctionObject Declaration \*---------------------------------------------------------------------------*/ template<class OutputFilter> @@ -69,7 +69,7 @@ class OutputFilterFunctionObject word regionName_; word dictName_; - //- Switch for the execution of the functionObjects + //- Switch for the execution of the functionObject bool enabled_; outputFilterOutputControl outputControl_; @@ -114,20 +114,25 @@ public: return name_; } - //- start is called at the start of the time-loop - virtual bool start(); - - //- execute is called at each ++ or += of the time-loop - virtual bool execute(); - //- Switch the function object on virtual void on(); //- Switch the function object off virtual void off(); - //- Read and set the function object if its data has changed - virtual bool read(const dictionary& dict); + + //- Called at the start of the time-loop + virtual bool start(); + + //- Called at each ++ or += of the time-loop + virtual bool execute(); + + //- Called when Time::run() determines that the time-loop exits + virtual bool end(); + + + //- Read and set the function object if its data have changed + virtual bool read(const dictionary&); }; diff --git a/src/OpenFOAM/db/functionObject/functionObject.C b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C similarity index 84% rename from src/OpenFOAM/db/functionObject/functionObject.C rename to src/OpenFOAM/db/functionObjects/functionObject/functionObject.C index c7eb2793035faa1619e2baa7a2735802a96ac12d..a731621ff676fae227b64f15f4387b2a006170dd 100644 --- a/src/OpenFOAM/db/functionObject/functionObject.C +++ b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C @@ -30,11 +30,8 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -namespace Foam -{ - defineRunTimeSelectionTable(functionObject, dictionary); - int functionObject::debug(::Foam::debug::debugSwitch("functionObject", 0)); -} +defineRunTimeSelectionTable(Foam::functionObject, dictionary); +int Foam::functionObject::debug(Foam::debug::debugSwitch("functionObject", 0)); // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -71,10 +68,10 @@ Foam::autoPtr<Foam::functionObject> Foam::functionObject::New FatalErrorIn ( "functionObject::New" - "(const word& functionType, const Time&, const dictionary&)" + "(const word& name, const Time&, const dictionary&)" ) << "Unknown function type " - << functionType << endl << endl - << "Table of functionObjects is empty" + << functionType << nl << nl + << "Table of functionObjects is empty" << endl << exit(FatalError); } @@ -86,11 +83,11 @@ Foam::autoPtr<Foam::functionObject> Foam::functionObject::New FatalErrorIn ( "functionObject::New" - "(const word& functionType, const Time&, const dictionary&)" + "(const word& name, const Time&, const dictionary&)" ) << "Unknown function type " - << functionType << endl << endl - << "Valid functions are : " << endl - << dictionaryConstructorTablePtr_->toc() + << functionType << nl << nl + << "Valid functions are : " << nl + << dictionaryConstructorTablePtr_->toc() << endl << exit(FatalError); } @@ -106,6 +103,12 @@ Foam::functionObject::~functionObject() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +bool Foam::functionObject::end() +{ + return execute(); +} + + Foam::autoPtr<Foam::functionObject> Foam::functionObject::iNew::operator() ( const word& name, diff --git a/src/OpenFOAM/db/functionObject/functionObject.H b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H similarity index 89% rename from src/OpenFOAM/db/functionObject/functionObject.H rename to src/OpenFOAM/db/functionObjects/functionObject/functionObject.H index 72bf1b166cb7297206f66eae85a6307989a1a578..94a2f7aea4848f65b2279142f4dc0eb8e2c9b642 100644 --- a/src/OpenFOAM/db/functionObject/functionObject.H +++ b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H @@ -121,7 +121,7 @@ public: // Selectors - //- Select from Time and Istream + //- Select from dictionary, based on its "type" entry static autoPtr<functionObject> New ( const word& name, @@ -137,14 +137,18 @@ public: // Member Functions - //- start is called at the start of the time-loop + //- Called at the start of the time-loop virtual bool start() = 0; - //- execute is called at each ++ or += of the time-loop + //- Called at each ++ or += of the time-loop virtual bool execute() = 0; - //- Read and set the function object if its data has changed - virtual bool read(const dictionary& dict) = 0; + //- Called when Time::run() determines that the time-loop exits. + // By default it simply calls execute(). + virtual bool end(); + + //- Read and set the function object if its data have changed + virtual bool read(const dictionary&) = 0; }; diff --git a/src/OpenFOAM/db/functionObjectList/functionObjectList.C b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C similarity index 68% rename from src/OpenFOAM/db/functionObjectList/functionObjectList.C rename to src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C index 00f6131547f6e364bd211c2fafd10e0e06973ea4..0e52db7fc71ae2cff6e5307884af84000cd8a5d3 100644 --- a/src/OpenFOAM/db/functionObjectList/functionObjectList.C +++ b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C @@ -29,7 +29,8 @@ License // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // -Foam::functionObject* Foam::functionObjectList::remove(const word& key) +Foam::functionObject* +Foam::functionObjectList::remove(const word& key, label& oldIndex) { functionObject* ptr = 0; @@ -38,10 +39,16 @@ Foam::functionObject* Foam::functionObjectList::remove(const word& key) if (fnd != indices_.end()) { - // remove the pointer from the old list - ptr = functions_.set(fnd(), 0).ptr(); + oldIndex = fnd(); + + // retrieve the pointer and remove it from the old list + ptr = this->set(oldIndex, 0).ptr(); indices_.erase(fnd); } + else + { + oldIndex = -1; + } return ptr; } @@ -55,7 +62,8 @@ Foam::functionObjectList::functionObjectList const bool execution ) : - functions_(), + PtrList<functionObject>(), + digests_(), indices_(), time_(t), parentDict_(t.controlDict()), @@ -71,7 +79,8 @@ Foam::functionObjectList::functionObjectList const bool execution ) : - functions_(), + PtrList<functionObject>(), + digests_(), indices_(), time_(t), parentDict_(parentDict), @@ -88,6 +97,34 @@ Foam::functionObjectList::~functionObjectList() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +void Foam::functionObjectList::clear() +{ + PtrList<functionObject>::clear(); + digests_.clear(); + indices_.clear(); + updated_ = false; +} + + +void Foam::functionObjectList::on() +{ + execution_ = true; +} + + +void Foam::functionObjectList::off() +{ + // for safety, also force a read() when execution is turned back on + updated_ = execution_ = false; +} + + +bool Foam::functionObjectList::status() const +{ + return execution_; +} + + bool Foam::functionObjectList::start() { return read(); @@ -105,7 +142,12 @@ bool Foam::functionObjectList::execute() read(); } - forAllIter(PtrList<functionObject>, functions_, iter) + forAllIter + ( + PtrList<functionObject>, + static_cast<PtrList<functionObject>&>(*this), + iter + ) { ok = iter().execute() && ok; } @@ -115,15 +157,29 @@ bool Foam::functionObjectList::execute() } -void Foam::functionObjectList::on() +bool Foam::functionObjectList::end() { - execution_ = true; -} + bool ok = true; + + if (execution_) + { + if (!updated_) + { + read(); + } + forAllIter + ( + PtrList<functionObject>, + static_cast<PtrList<functionObject>&>(*this), + iter + ) + { + ok = iter().end() && ok; + } + } -void Foam::functionObjectList::off() -{ - execution_ = false; + return ok; } @@ -143,6 +199,7 @@ bool Foam::functionObjectList::read() if (entryPtr) { PtrList<functionObject> newPtrs; + List<SHA1Digest> newDigs; HashTable<label> newIndices; label nFunc = 0; @@ -151,7 +208,9 @@ bool Foam::functionObjectList::read() { // a dictionary of functionObjects const dictionary& functionDicts = entryPtr->dict(); + newPtrs.setSize(functionDicts.size()); + newDigs.setSize(functionDicts.size()); forAllConstIter(dictionary, functionDicts, iter) { @@ -163,11 +222,17 @@ bool Foam::functionObjectList::read() const word& key = iter().keyword(); const dictionary& dict = iter().dict(); - functionObject* objPtr = remove(key); + newDigs[nFunc] = dict.digest(); + + label oldIndex; + functionObject* objPtr = remove(key, oldIndex); if (objPtr) { - // existing functionObject - ok = objPtr->read(dict) && ok; + // an existing functionObject, and dictionary changed + if (newDigs[nFunc] != digests_[oldIndex]) + { + ok = objPtr->read(dict) && ok; + } } else { @@ -185,7 +250,9 @@ bool Foam::functionObjectList::read() { // a list of functionObjects PtrList<entry> functionDicts(entryPtr->stream()); + newPtrs.setSize(functionDicts.size()); + newDigs.setSize(functionDicts.size()); forAllIter(PtrList<entry>, functionDicts, iter) { @@ -197,11 +264,17 @@ bool Foam::functionObjectList::read() const word& key = iter().keyword(); const dictionary& dict = iter().dict(); - functionObject* objPtr = remove(key); + newDigs[nFunc] = dict.digest(); + + label oldIndex; + functionObject* objPtr = remove(key, oldIndex); if (objPtr) { - // existing functionObject - ok = objPtr->read(dict) && ok; + // an existing functionObject, and dictionary changed + if (newDigs[nFunc] != digests_[oldIndex]) + { + ok = objPtr->read(dict) && ok; + } } else { @@ -218,15 +291,18 @@ bool Foam::functionObjectList::read() // safety: newPtrs.setSize(nFunc); + newDigs.setSize(nFunc); - // update PtrList of functionObjects - // also deletes existing, unused functionObjects - functions_.transfer(newPtrs); + // updating the PtrList of functionObjects also deletes any existing, + // but unused functionObjects + PtrList<functionObject>::transfer(newPtrs); + digests_.transfer(newDigs); indices_.transfer(newIndices); } else { - functions_.clear(); + PtrList<functionObject>::clear(); + digests_.clear(); indices_.clear(); } diff --git a/src/OpenFOAM/db/functionObjectList/functionObjectList.H b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H similarity index 68% rename from src/OpenFOAM/db/functionObjectList/functionObjectList.H rename to src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H index f8be2e44baa518d6c2096e5ae7f87cf7ed2982dc..ea2c43adf328e285fcde866a85a9997449ce8353 100644 --- a/src/OpenFOAM/db/functionObjectList/functionObjectList.H +++ b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H @@ -26,8 +26,8 @@ Class Foam::functionObjectList Description - List of function objects with execute() function that is called for each - object. + List of function objects with start(), execute() and end() functions + that is called for each object. See Also Foam::functionObject and Foam::OutputFilterFunctionObject @@ -40,9 +40,10 @@ SourceFiles #ifndef functionObjectList_H #define functionObjectList_H +#include "PtrList.H" #include "functionObject.H" +#include "SHA1Digest.H" #include "HashTable.H" -#include "PtrList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -54,20 +55,20 @@ namespace Foam \*---------------------------------------------------------------------------*/ class functionObjectList +: + private PtrList<functionObject> { // Private data - //- A list of function objects - // Avoid 'is-a' relationship for protection - PtrList<functionObject> functions_; + //- A list of SHA1 digests for the function object dictionaries + List<SHA1Digest> digests_; - //- Quick lookup of the index into the PtrList<functionObject> - // Currently only used to manage rereading/deletion - HashTable<label> indices_; + //- Quick lookup of the index into functions/digests + HashTable<label> indices_; const Time& time_; - //- Dictionary containing the "functions" entry + //- The parent dictionary containing a "functions" entry // This entry can either be a list or a dictionary of // functionObject specifications. const dictionary& parentDict_; @@ -75,15 +76,16 @@ class functionObjectList //- Switch for the execution of the functionObjects bool execution_; - //- Tracks if read() was called while execution was turned off + //- Tracks if read() was called while execution is on bool updated_; // Private Member Functions - //- Remove and return the function object pointer by name. - // Return NULL if it didn't exist. - functionObject* remove(const word&); + //- Remove and return the function object pointer by name, + // and returns the old index via the parameter. + // Returns a NULL pointer (and index -1) if it didn't exist. + functionObject* remove(const word&, label& oldIndex); //- Disallow default bitwise copy construct functionObjectList(const functionObjectList&); @@ -105,8 +107,11 @@ public: ); - //- Construct from Time, dictionary with "functions" entry - // and the execution setting + //- Construct from Time, a dictionary with "functions" entry + // and the execution setting. + // @param[in] parentDict - the parent dictionary containing + // a "functions" entry, which can either be a list or a dictionary + // of functionObject specifications. functionObjectList ( const Time&, @@ -122,11 +127,15 @@ public: // Member Functions - //- Start is called at the start of the time-loop - virtual bool start(); + //- Return the number of elements in the List. + using PtrList<functionObject>::size; + + //- Return true if the List is empty (ie, size() is zero). + using PtrList<functionObject>::empty; + + //- Clear the list of function objects + virtual void clear(); - //- Execute is called at each ++ or += of the time-loop - virtual bool execute(); //- Switch the function objects on virtual void on(); @@ -134,8 +143,22 @@ public: //- Switch the function objects off virtual void off(); + //- Return the execution status (on/off) of the function objects + virtual bool status() const; + + + //- Called at the start of the time-loop + virtual bool start(); + + //- Called at each ++ or += of the time-loop + virtual bool execute(); + + //- Called when Time::run() determines that the time-loop exits + virtual bool end(); + //- Read and set the function objects if their data have changed virtual bool read(); + }; diff --git a/src/sampling/outputFilters/outputFilterOutputControl/outputFilterOutputControl.C b/src/OpenFOAM/db/functionObjects/outputFilterOutputControl/outputFilterOutputControl.C similarity index 95% rename from src/sampling/outputFilters/outputFilterOutputControl/outputFilterOutputControl.C rename to src/OpenFOAM/db/functionObjects/outputFilterOutputControl/outputFilterOutputControl.C index 02f8174670759c9e1e65a74aca14b01b8eeef849..9ef684cbac87e3803933e73bf78cc1013a3f2fcf 100644 --- a/src/sampling/outputFilters/outputFilterOutputControl/outputFilterOutputControl.C +++ b/src/OpenFOAM/db/functionObjects/outputFilterOutputControl/outputFilterOutputControl.C @@ -47,11 +47,11 @@ const Foam::NamedEnum<Foam::outputFilterOutputControl::outputControls, 2> Foam::outputFilterOutputControl::outputFilterOutputControl ( - const Time& time, + const Time& t, const dictionary& dict ) : - time_(time), + time_(t), outputControl_(ocTimeStep), outputInterval_(0) { @@ -93,8 +93,8 @@ bool Foam::outputFilterOutputControl::output() const { return ( - !(time_.timeIndex() % outputInterval_) - || (outputInterval_ <= 1) + (outputInterval_ <= 1) + || !(time_.timeIndex() % outputInterval_) ); break; } diff --git a/src/sampling/outputFilters/outputFilterOutputControl/outputFilterOutputControl.H b/src/OpenFOAM/db/functionObjects/outputFilterOutputControl/outputFilterOutputControl.H similarity index 92% rename from src/sampling/outputFilters/outputFilterOutputControl/outputFilterOutputControl.H rename to src/OpenFOAM/db/functionObjects/outputFilterOutputControl/outputFilterOutputControl.H index 4e1f90b9a3876acea6a8904da5bd9d522dfe25b3..2b95917739a177e352cc34d6efa7781ee7076fe3 100644 --- a/src/sampling/outputFilters/outputFilterOutputControl/outputFilterOutputControl.H +++ b/src/OpenFOAM/db/functionObjects/outputFilterOutputControl/outputFilterOutputControl.H @@ -88,22 +88,18 @@ public: // Constructors - //- Construct from dictionary and Time object - outputFilterOutputControl - ( - const Time& time, - const dictionary& dict - ); + //- Construct from Time object and dictionary + outputFilterOutputControl(const Time&, const dictionary&); // Destructor - ~outputFilterOutputControl(); + ~outputFilterOutputControl(); // Member Functions //- Read from dictionary - void read(const dictionary& dict); + void read(const dictionary&); //- Return const access to the Time object const Time& time() const diff --git a/src/OpenFOAM/db/objectRegistry/objectRegistry.C b/src/OpenFOAM/db/objectRegistry/objectRegistry.C index 36ae0e3c448a2c8f8feb69895cb325154b4b166f..1038ecffa10de97c47b2eb8c9b2a3ca273061113 100644 --- a/src/OpenFOAM/db/objectRegistry/objectRegistry.C +++ b/src/OpenFOAM/db/objectRegistry/objectRegistry.C @@ -29,10 +29,7 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -namespace Foam -{ - defineTypeNameAndDebug(objectRegistry, 0); -} +defineTypeNameAndDebug(Foam::objectRegistry, 0); // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -86,9 +83,9 @@ Foam::objectRegistry::~objectRegistry() { if (iter()->ownedByRegistry()) { - regIOobject* elemPtr = iter(); + regIOobject* object = iter(); erase(iter); - delete elemPtr; + delete object; } } } @@ -206,18 +203,15 @@ bool Foam::objectRegistry::checkOut(regIOobject& io) const bool Foam::objectRegistry::modified() const { - bool anyModified = false; - for (const_iterator iter = begin(); iter != end(); ++iter) { if (iter()->modified()) { - anyModified = true; - break; + return true; } } - return anyModified; + return false; } diff --git a/src/OpenFOAM/db/regIOobject/regIOobject.C b/src/OpenFOAM/db/regIOobject/regIOobject.C index 139577256187938edc7a8288e0deab7c6df4502d..611dd5a923ac2c58145ed4356a44f5fd692c27ea 100644 --- a/src/OpenFOAM/db/regIOobject/regIOobject.C +++ b/src/OpenFOAM/db/regIOobject/regIOobject.C @@ -31,25 +31,20 @@ Description #include "Time.H" #include "polyMesh.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -defineTypeNameAndDebug(regIOobject, 0); +defineTypeNameAndDebug(Foam::regIOobject, 0); -int regIOobject::fileModificationSkew +int Foam::regIOobject::fileModificationSkew ( - debug::optimisationSwitch("fileModificationSkew", 30) + Foam::debug::optimisationSwitch("fileModificationSkew", 30) ); // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // Construct from IOobject -regIOobject::regIOobject(const IOobject& io) +Foam::regIOobject::regIOobject(const IOobject& io) : IOobject(io), registered_(false), @@ -66,7 +61,7 @@ regIOobject::regIOobject(const IOobject& io) // Construct as copy -regIOobject::regIOobject(const regIOobject& rio) +Foam::regIOobject::regIOobject(const regIOobject& rio) : IOobject(rio), registered_(false), @@ -80,7 +75,7 @@ regIOobject::regIOobject(const regIOobject& rio) // Construct as copy, and transfering objectRegistry registration to copy // if registerCopy is true -regIOobject::regIOobject(const regIOobject& rio, bool registerCopy) +Foam::regIOobject::regIOobject(const regIOobject& rio, bool registerCopy) : IOobject(rio), registered_(false), @@ -99,7 +94,7 @@ regIOobject::regIOobject(const regIOobject& rio, bool registerCopy) // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // Delete read stream, checkout from objectRegistry and destroy -regIOobject::~regIOobject() +Foam::regIOobject::~regIOobject() { if (objectRegistry::debug) { @@ -125,7 +120,7 @@ regIOobject::~regIOobject() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void regIOobject::checkIn() +void Foam::regIOobject::checkIn() { if (!registered_) { @@ -153,7 +148,7 @@ void regIOobject::checkIn() } -void regIOobject::checkOut() +void Foam::regIOobject::checkOut() { if (registered_) { @@ -164,7 +159,7 @@ void regIOobject::checkOut() // Rename object and re-register with objectRegistry under new name -void regIOobject::rename(const word& newName) +void Foam::regIOobject::rename(const word& newName) { // Check out of objectRegistry checkOut(); @@ -177,7 +172,7 @@ void regIOobject::rename(const word& newName) // Assign to IOobject -void regIOobject::operator=(const IOobject& io) +void Foam::regIOobject::operator=(const IOobject& io) { if (isPtr_) { @@ -195,8 +190,4 @@ void regIOobject::operator=(const IOobject& io) } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/postProcessing/Allwmake b/src/postProcessing/Allwmake index ab7328b651f0ec2e2094722574fcf0f3243a7d59..169c9c833fc09068cdd05989c6cd1119fd909c90 100755 --- a/src/postProcessing/Allwmake +++ b/src/postProcessing/Allwmake @@ -5,6 +5,6 @@ set -x wmake libo postCalc wmake libso foamCalcFunctions -(cd functionObjects && ./Allwmake) +functionObjects/Allwmake # ----------------------------------------------------------------- end-of-file diff --git a/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverage.C b/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverage.C index b9c4023401a4fbcb744cacc684fc6e567aef531d..8f047d1d41f03bd38589fe3360cc87bf6e9f41ec 100644 --- a/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverage.C +++ b/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverage.C @@ -26,19 +26,13 @@ License #include "fieldAverage.H" #include "volFields.H" -#include "dictionary.H" #include "Time.H" -#include "IFstream.H" -#include "OFstream.H" #include "fieldAverageItem.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -namespace Foam -{ - defineTypeNameAndDebug(fieldAverage, 0); -} +defineTypeNameAndDebug(Foam::fieldAverage, 0); const Foam::word Foam::fieldAverage::EXT_MEAN = "Mean"; const Foam::word Foam::fieldAverage::EXT_PRIME2MEAN = "Prime2Mean"; @@ -46,100 +40,81 @@ const Foam::word Foam::fieldAverage::EXT_PRIME2MEAN = "Prime2Mean"; // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -void Foam::fieldAverage::checkoutFields(const wordList& fieldNames) const +void Foam::fieldAverage::resetFields(wordList& names) { - forAll(fieldNames, i) + forAll(names, fieldI) { - if (fieldNames[i] != word::null) + if (names[fieldI].size()) { - obr_.checkOut(*obr_[fieldNames[i]]); + obr_.checkOut(*obr_[names[fieldI]]); } } + + names.clear(); + names.setSize(faItems_.size()); } -void Foam::fieldAverage::resetLists(const label nItems) +void Foam::fieldAverage::initialize() { - checkoutFields(meanScalarFields_); - meanScalarFields_.clear(); - meanScalarFields_.setSize(nItems); - - checkoutFields(meanVectorFields_); - meanVectorFields_.clear(); - meanVectorFields_.setSize(nItems); - - checkoutFields(meanSphericalTensorFields_); - meanSphericalTensorFields_.clear(); - meanSphericalTensorFields_.setSize(nItems); - - checkoutFields(meanSymmTensorFields_); - meanSymmTensorFields_.clear(); - meanSymmTensorFields_.setSize(nItems); + resetFields(meanScalarFields_); + resetFields(meanVectorFields_); + resetFields(meanSphericalTensorFields_); + resetFields(meanSymmTensorFields_); + resetFields(meanTensorFields_); - checkoutFields(meanTensorFields_); - meanTensorFields_.clear(); - meanTensorFields_.setSize(nItems); - - checkoutFields(prime2MeanScalarFields_); - prime2MeanScalarFields_.clear(); - prime2MeanScalarFields_.setSize(nItems); - - checkoutFields(prime2MeanSymmTensorFields_); - prime2MeanSymmTensorFields_.clear(); - prime2MeanSymmTensorFields_.setSize(nItems); + resetFields(prime2MeanScalarFields_); + resetFields(prime2MeanSymmTensorFields_); totalIter_.clear(); - totalIter_.setSize(nItems, 1); + totalIter_.setSize(faItems_.size(), 1); totalTime_.clear(); - totalTime_.setSize(nItems, obr_.time().deltaT().value()); -} + totalTime_.setSize(faItems_.size(), obr_.time().deltaT().value()); -void Foam::fieldAverage::initialise() -{ // Add mean fields to the field lists - forAll(faItems_, i) + forAll(faItems_, fieldI) { - const word& fieldName = faItems_[i].fieldName(); + const word& fieldName = faItems_[fieldI].fieldName(); if (obr_.foundObject<volScalarField>(fieldName)) { - addMeanField<scalar>(i, meanScalarFields_); + addMeanField<scalar>(fieldI, meanScalarFields_); } else if (obr_.foundObject<volVectorField>(fieldName)) { - addMeanField<vector>(i, meanVectorFields_); + addMeanField<vector>(fieldI, meanVectorFields_); } else if (obr_.foundObject<volSphericalTensorField>(fieldName)) { - addMeanField<sphericalTensor>(i, meanSphericalTensorFields_); + addMeanField<sphericalTensor>(fieldI, meanSphericalTensorFields_); } else if (obr_.foundObject<volSymmTensorField>(fieldName)) { - addMeanField<symmTensor>(i, meanSymmTensorFields_); + addMeanField<symmTensor>(fieldI, meanSymmTensorFields_); } else if (obr_.foundObject<volTensorField>(fieldName)) { - addMeanField<tensor>(i, meanTensorFields_); + addMeanField<tensor>(fieldI, meanTensorFields_); } else { - FatalErrorIn("Foam::fieldAverage::initialise()") - << "Requested field " << faItems_[i].fieldName() + FatalErrorIn("Foam::fieldAverage::initialize()") + << "Requested field " << faItems_[fieldI].fieldName() << " does not exist in the database" << nl << exit(FatalError); } } // Add prime-squared mean fields to the field lists - forAll(faItems_, i) + forAll(faItems_, fieldI) { - if (faItems_[i].prime2Mean()) + if (faItems_[fieldI].prime2Mean()) { - const word& fieldName = faItems_[i].fieldName(); - if (!faItems_[i].mean()) + const word& fieldName = faItems_[fieldI].fieldName(); + if (!faItems_[fieldI].mean()) { - FatalErrorIn("Foam::fieldAverage::initialise()") + FatalErrorIn("Foam::fieldAverage::initialize()") << "To calculate the prime-squared average, the " << "mean average must also be selected for field " << fieldName << nl << exit(FatalError); @@ -149,7 +124,7 @@ void Foam::fieldAverage::initialise() { addPrime2MeanField<scalar, scalar> ( - i, + fieldI, meanScalarFields_, prime2MeanScalarFields_ ); @@ -158,14 +133,14 @@ void Foam::fieldAverage::initialise() { addPrime2MeanField<vector, symmTensor> ( - i, + fieldI, meanVectorFields_, prime2MeanSymmTensorFields_ ); } else { - FatalErrorIn("Foam::fieldAverage::initialise()") + FatalErrorIn("Foam::fieldAverage::initialize()") << "prime2Mean average can only be applied to " << "volScalarFields and volVectorFields" << nl << " Field: " << fieldName << nl @@ -176,102 +151,26 @@ void Foam::fieldAverage::initialise() } -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::fieldAverage::fieldAverage -( - const word& name, - const objectRegistry& obr, - const dictionary& dict, - const bool loadFromFiles -) -: - name_(name), - obr_(obr), - active_(true), - cleanRestart_(dict.lookupOrDefault<Switch>("cleanRestart", false)), - faItems_(dict.lookup("fields")), - meanScalarFields_(faItems_.size()), - meanVectorFields_(faItems_.size()), - meanSphericalTensorFields_(faItems_.size()), - meanSymmTensorFields_(faItems_.size()), - meanTensorFields_(faItems_.size()), - prime2MeanScalarFields_(faItems_.size()), - prime2MeanSymmTensorFields_(faItems_.size()), - totalIter_(faItems_.size(), 1), - totalTime_(faItems_.size(), obr_.time().deltaT().value()) -{ - // Check if the available mesh is an fvMesh otherise deactivate - if (!isA<fvMesh>(obr_)) - { - active_ = false; - WarningIn - ( - "fieldAverage::fieldAverage\n" - "(\n" - "const word&,\n" - "const objectRegistry&,\n" - "const dictionary&,\n" - "const bool\n" - ")" - ) << "No fvMesh available, deactivating." - << nl << endl; - } - - read(dict); -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::fieldAverage::~fieldAverage() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void Foam::fieldAverage::read(const dictionary& dict) +void Foam::fieldAverage::calcAverages() { - if (active_) - { - faItems_.clear(); - faItems_ = List<fieldAverageItem>(dict.lookup("fields")); - - resetLists(faItems_.size()); - - initialise(); - - readAveragingProperties(); - } -} - + const label currentTimeIndex = + static_cast<const fvMesh&>(obr_).time().timeIndex(); -void Foam::fieldAverage::execute() -{ - if (active_) + if (prevTimeIndex_ == currentTimeIndex) { - calcAverages(); + return; } -} - - -void Foam::fieldAverage::write() -{ - if (active_) + else { - writeAverages(); - writeAveragingProperties(); + prevTimeIndex_ = currentTimeIndex; } -} -void Foam::fieldAverage::calcAverages() -{ Info<< "Calculating averages" << nl << endl; - forAll(faItems_, i) + forAll(faItems_, fieldI) { - totalIter_[i]++; - totalTime_[i] += obr_.time().deltaT().value(); + totalIter_[fieldI]++; + totalTime_[fieldI] += obr_.time().deltaT().value(); } addMeanSqrToPrime2Mean<scalar, scalar> @@ -333,12 +232,12 @@ void Foam::fieldAverage::writeAveragingProperties() const ) ); - forAll(faItems_, i) + forAll(faItems_, fieldI) { - const word& fieldName = faItems_[i].fieldName(); + const word& fieldName = faItems_[fieldI].fieldName(); propsDict.add(fieldName, dictionary()); - propsDict.subDict(fieldName).add("totalIter", totalIter_[i]); - propsDict.subDict(fieldName).add("totalTime", totalTime_[i]); + propsDict.subDict(fieldName).add("totalIter", totalIter_[fieldI]); + propsDict.subDict(fieldName).add("totalTime", totalTime_[fieldI]); } propsDict.regIOobject::write(); @@ -354,34 +253,39 @@ void Foam::fieldAverage::readAveragingProperties() } else { - IFstream propsFile + IOobject propsDictHeader ( - obr_.time().path()/obr_.time().timeName() - /"uniform"/"fieldAveragingProperties" + "fieldAveragingProperties", + obr_.time().timeName(), + "uniform", + obr_, + IOobject::NO_READ, + IOobject::NO_WRITE, + false ); - if (!propsFile.good()) + if (!propsDictHeader.headerOk()) { Info<< "fieldAverage: starting averaging at time " << obr_.time().timeName() << nl << endl; return; } - dictionary propsDict(dictionary::null, propsFile); + IOdictionary propsDict(propsDictHeader); Info<< "fieldAverage: restarting averaging for fields:" << endl; - forAll(faItems_, i) + forAll(faItems_, fieldI) { - const word& fieldName = faItems_[i].fieldName(); + const word& fieldName = faItems_[fieldI].fieldName(); if (propsDict.found(fieldName)) { dictionary fieldDict(propsDict.subDict(fieldName)); - totalIter_[i] = readLabel(fieldDict.lookup("totalIter")); - totalTime_[i] = readScalar(fieldDict.lookup("totalTime")); + totalIter_[fieldI] = readLabel(fieldDict.lookup("totalIter")); + totalTime_[fieldI] = readScalar(fieldDict.lookup("totalTime")); Info<< " " << fieldName - << " iters = " << totalIter_[i] - << " time = " << totalTime_[i] << endl; + << " iters = " << totalIter_[fieldI] + << " time = " << totalTime_[fieldI] << endl; } } Info<< endl; @@ -389,6 +293,104 @@ void Foam::fieldAverage::readAveragingProperties() } +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::fieldAverage::fieldAverage +( + const word& name, + const objectRegistry& obr, + const dictionary& dict, + const bool loadFromFiles +) +: + name_(name), + obr_(obr), + active_(true), + prevTimeIndex_(-1), + cleanRestart_(false), + faItems_(), + meanScalarFields_(), + meanVectorFields_(), + meanSphericalTensorFields_(), + meanSymmTensorFields_(), + meanTensorFields_(), + prime2MeanScalarFields_(), + prime2MeanSymmTensorFields_(), + totalIter_(), + totalTime_() +{ + // Only active if a fvMesh is available + if (isA<fvMesh>(obr_)) + { + read(dict); + } + else + { + active_ = false; + WarningIn + ( + "fieldAverage::fieldAverage\n" + "(\n" + "const word&,\n" + "const objectRegistry&,\n" + "const dictionary&,\n" + "const bool\n" + ")" + ) << "No fvMesh available, deactivating." + << nl << endl; + } +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::fieldAverage::~fieldAverage() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::fieldAverage::read(const dictionary& dict) +{ + if (active_) + { + dict.readIfPresent("cleanRestart", cleanRestart_); + dict.lookup("fields") >> faItems_; + + initialize(); + readAveragingProperties(); + + // ensure first averaging works unconditionally + prevTimeIndex_ = -1; + } +} + + +void Foam::fieldAverage::execute() +{ + if (active_) + { + calcAverages(); + } +} + + +void Foam::fieldAverage::end() +{ +} + + +void Foam::fieldAverage::write() +{ + if (active_) + { + calcAverages(); + writeAverages(); + writeAveragingProperties(); + } +} + + void Foam::fieldAverage::updateMesh(const mapPolyMesh&) { // Do nothing diff --git a/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverage.H b/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverage.H index 2cb245b14d0c387c9f1cbbf14bd13f50f079c646..bffb23b2e0b0f34ae52ca292f3bd672442692bda 100644 --- a/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverage.H +++ b/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverage.H @@ -41,7 +41,7 @@ Description // averaging info if available cleanRestart true; - // Fields to be probed. runTime modifiable! + // Fields to be averaged. runTime modifiable! fields ( U @@ -107,6 +107,14 @@ class fieldAverage { protected: + // File and field name extensions + + //- Mean average + static const word EXT_MEAN; + + //- Prime-squared average + static const word EXT_PRIME2MEAN; + // Private data //- Name of this set of field averages. @@ -118,6 +126,9 @@ protected: //- On/off switch bool active_; + //- Time at last call, prevents repeated averaging + label prevTimeIndex_; + //- Clean restart flag Switch cleanRestart_; @@ -125,15 +136,6 @@ protected: // calculated and output List<fieldAverageItem> faItems_; - // File and field name extensions - - //- Mean average - static const word EXT_MEAN; - - //- Prime-squared average - static const word EXT_PRIME2MEAN; - - // Lists of averages // Arithmetic mean fields @@ -143,7 +145,8 @@ protected: wordList meanSymmTensorFields_; wordList meanTensorFields_; - // Prime-squared fields - applicable to volVectorFields only + // Prime-squared fields + // Only applicable to volScalarFields / volVectorFields wordList prime2MeanScalarFields_; wordList prime2MeanSymmTensorFields_; @@ -162,20 +165,18 @@ protected: // Initialisation routines //- Checkout fields (causes deletion) from the database - void checkoutFields(const wordList&) const; + // and reset lists + void resetFields(wordList&); - //- Reset size of lists (clear existing values) - void resetLists(const label nItems); + //- Reset lists (clear existing values) and initialize averaging. + // Check requested field averages are valid, populate field lists + void initialize(); - //- Intitialise averaging. Check requested field averages are - // valid, and populate field lists - void initialise(); - - //- Add mean average field to PtrList + //- Add mean average field to list template<class Type> void addMeanField(const label, wordList&) const; - //- Add prime-squared average field to PtrList + //- Add prime-squared average field to list template<class Type1, class Type2> void addPrime2MeanField ( @@ -211,7 +212,7 @@ protected: ) const; - // I-O + // IO //- Write averages virtual void writeAverages() const; @@ -281,6 +282,9 @@ public: //- Execute the averaging virtual void execute(); + //- Execute the averaging at the final time-loop, currently does nothing + virtual void end(); + //- Calculate the field average data and write virtual void write(); }; diff --git a/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverageTemplates.C b/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverageTemplates.C index c6e57835a726bc85d4c37f1e0a13fda554137932..a69dce41b7d613e1d2032e0ed393d57fcfec9545 100644 --- a/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverageTemplates.C +++ b/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverageTemplates.C @@ -33,15 +33,15 @@ License template<class Type> void Foam::fieldAverage::addMeanField ( - const label fieldi, + const label fieldI, wordList& meanFieldList ) const { - if (faItems_[fieldi].mean()) + if (faItems_[fieldI].mean()) { typedef GeometricField<Type, fvPatchField, volMesh> fieldType; - const word& fieldName = faItems_[fieldi].fieldName(); + const word& fieldName = faItems_[fieldI].fieldName(); const word meanFieldName = fieldName + EXT_MEAN; @@ -49,14 +49,14 @@ void Foam::fieldAverage::addMeanField if (obr_.foundObject<fieldType>(meanFieldName)) { - meanFieldList[fieldi] = meanFieldName; + meanFieldList[fieldI] = meanFieldName; } else if (obr_.found(meanFieldName)) { Info<< "Cannot allocate average field " << meanFieldName << " since an object with that name already exists." << " Disabling averaging." << nl << endl; - meanFieldList[fieldi] = word::null; + meanFieldList[fieldI] = word::null; } else { @@ -79,7 +79,7 @@ void Foam::fieldAverage::addMeanField // Store on registry fPtr->store(); - meanFieldList[fieldi] = meanFieldName; + meanFieldList[fieldI] = meanFieldName; } } } @@ -88,38 +88,38 @@ void Foam::fieldAverage::addMeanField template<class Type1, class Type2> void Foam::fieldAverage::addPrime2MeanField ( - const label fieldi, + const label fieldI, const wordList& meanFieldList, wordList& prime2MeanFieldList ) const { - if (faItems_[fieldi].mean() && meanFieldList[fieldi] != word::null) + if (faItems_[fieldI].mean() && meanFieldList[fieldI].size()) { typedef GeometricField<Type1, fvPatchField, volMesh> fieldType1; typedef GeometricField<Type2, fvPatchField, volMesh> fieldType2; - const word& fieldName = faItems_[fieldi].fieldName(); + const word& fieldName = faItems_[fieldI].fieldName(); const word meanFieldName = fieldName + EXT_PRIME2MEAN; Info<< "Reading/calculating field " << meanFieldName << nl << endl; if (obr_.foundObject<fieldType2>(meanFieldName)) { - prime2MeanFieldList[fieldi] = meanFieldName; + prime2MeanFieldList[fieldI] = meanFieldName; } else if (obr_.found(meanFieldName)) { Info<< "Cannot allocate average field " << meanFieldName << " since an object with that name already exists." << " Disabling averaging." << nl << endl; - prime2MeanFieldList[fieldi] = word::null; + prime2MeanFieldList[fieldI] = word::null; } else { const fieldType1& baseField = obr_.lookupObject<fieldType1>(fieldName); const fieldType1& meanField = - obr_.lookupObject<fieldType1>(meanFieldList[fieldi]); + obr_.lookupObject<fieldType1>(meanFieldList[fieldI]); fieldType2* fPtr = new fieldType2 ( @@ -137,7 +137,7 @@ void Foam::fieldAverage::addPrime2MeanField // Store on registry fPtr->store(); - prime2MeanFieldList[fieldi] = meanFieldName; + prime2MeanFieldList[fieldI] = meanFieldName; } } } @@ -153,7 +153,7 @@ const forAll(faItems_, i) { - if (faItems_[i].mean() && meanFieldList[i] != word::null) + if (faItems_[i].mean() && meanFieldList[i].size()) { const word& fieldName = faItems_[i].fieldName(); const fieldType& baseField = @@ -199,8 +199,8 @@ void Foam::fieldAverage::calculatePrime2MeanFields if ( faItems_[i].prime2Mean() - && meanFieldList[i] != word::null - && prime2MeanFieldList[i] != word::null + && meanFieldList[i].size() + && prime2MeanFieldList[i].size() ) { const word& fieldName = faItems_[i].fieldName(); @@ -250,8 +250,8 @@ void Foam::fieldAverage::addMeanSqrToPrime2Mean if ( faItems_[i].prime2Mean() - && meanFieldList[i] != word::null - && prime2MeanFieldList[i] != word::null + && meanFieldList[i].size() + && prime2MeanFieldList[i].size() ) { const fieldType1& meanField = @@ -274,7 +274,7 @@ void Foam::fieldAverage::writeFieldList(const wordList& fieldList) const forAll(fieldList, i) { - if (fieldList[i] != word::null) + if (fieldList[i].size()) { const fieldType& f = obr_.lookupObject<fieldType>(fieldList[i]); f.write(); diff --git a/src/postProcessing/functionObjects/field/fieldAverage/fieldAverageItem/fieldAverageItemIO.C b/src/postProcessing/functionObjects/field/fieldAverage/fieldAverageItem/fieldAverageItemIO.C index 82c934e1941f63b8f5fb512fc13a0538828387d6..d149063b0601edf260391eba4bec9516e30e93dd 100644 --- a/src/postProcessing/functionObjects/field/fieldAverage/fieldAverageItem/fieldAverageItemIO.C +++ b/src/postProcessing/functionObjects/field/fieldAverage/fieldAverageItem/fieldAverageItemIO.C @@ -76,14 +76,12 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const fieldAverageItem& faItem) "(Foam::Ostream&, const Foam::fieldAverageItem&)" ); - os<< faItem.fieldName_ << nl; - os<< token::BEGIN_BLOCK << nl; + os << faItem.fieldName_ << nl << token::BEGIN_BLOCK << nl; os.writeKeyword("mean") << faItem.mean_ << token::END_STATEMENT << nl; os.writeKeyword("prime2Mean") << faItem.mean_ << token::END_STATEMENT << nl; os.writeKeyword("base") << faItem.baseTypeNames_[faItem.base_] - << token::END_STATEMENT << nl; - os<< token::END_BLOCK << nl; + << token::END_STATEMENT << nl << token::END_BLOCK << nl; os.check ( diff --git a/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.C b/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.C index 051f9f9a6dc95b7ce492557f245e0636f8899a7b..509e483f2b79c0b07b7d928a998f9d1b8b67f1fe 100644 --- a/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.C +++ b/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.C @@ -163,6 +163,13 @@ void Foam::fieldMinMax::execute() // Do nothing - only valid on write } + +void Foam::fieldMinMax::end() +{ + // Do nothing - only valid on write +} + + void Foam::fieldMinMax::write() { if (active_) diff --git a/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.H b/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.H index 17cfcf54e333083cfca9a3f89228d7305b874a2a..812359f71caa3edffcf8b43629c58db520f05823 100644 --- a/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.H +++ b/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.H @@ -80,8 +80,8 @@ protected: // Protected data - //- Name of this set of forces, - // Also used as the name of the probes directory. + //- Name of this set of field min/max. + // Also used as the name of the output directory. word name_; const objectRegistry& obr_; @@ -108,7 +108,7 @@ protected: // Private Member Functions - //- If the forces file has not been created create it + //- If the output file has not been created create it void makeFile(); //- Disallow default bitwise copy construct @@ -147,18 +147,21 @@ public: // Member Functions - //- Return name of the set of forces + //- Return name of the set of field min/max virtual const word& name() const { return name_; } - //- Read the forces data + //- Read the field min/max data virtual void read(const dictionary&); - //- Execute + //- Execute, currently does nothing virtual void execute(); + //- Execute at the final time-loop, currently does nothing + virtual void end(); + //- Calculate the field min/max template<class Type> void calcMinMaxFields(const word& fieldName); diff --git a/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.C b/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.C index d76b7fdd2856cea2adbab9129fc473e5c974faab..5fe1b846707dcd266b5fc67b536c34a3ac8b9dc8 100644 --- a/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.C +++ b/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.C @@ -104,6 +104,12 @@ void Foam::forceCoeffs::execute() } +void Foam::forceCoeffs::end() +{ + // Do nothing - only valid on write +} + + void Foam::forceCoeffs::write() { if (active_) diff --git a/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.H b/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.H index 87e6cf47c84a23abba7dce113a23d1d7119452f8..d9a948db0896e2115d8de42adf671ef98315de51 100644 --- a/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.H +++ b/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.H @@ -126,9 +126,12 @@ public: //- Read the forces data virtual void read(const dictionary&); - //- Execute + //- Execute, currently does nothing virtual void execute(); + //- Execute at the final time-loop, currently does nothing + virtual void end(); + //- Write the forces virtual void write(); }; diff --git a/src/postProcessing/functionObjects/forces/forces/forces.C b/src/postProcessing/functionObjects/forces/forces/forces.C index 3ed12ef475e35e9cc3cd48d10959bc10001954cd..3fb9cc135a3d571cd7a218aa5c5a497ebcb8a99c 100644 --- a/src/postProcessing/functionObjects/forces/forces/forces.C +++ b/src/postProcessing/functionObjects/forces/forces/forces.C @@ -273,6 +273,13 @@ void Foam::forces::execute() // Do nothing - only valid on write } + +void Foam::forces::end() +{ + // Do nothing - only valid on write +} + + void Foam::forces::write() { if (active_) diff --git a/src/postProcessing/functionObjects/forces/forces/forces.H b/src/postProcessing/functionObjects/forces/forces/forces.H index 08d9d09ce2195d1d618f3af639710fb7cda47a1f..73edae9da13c1aa12ba87c34fd03bbd8bccdc208 100644 --- a/src/postProcessing/functionObjects/forces/forces/forces.H +++ b/src/postProcessing/functionObjects/forces/forces/forces.H @@ -200,9 +200,12 @@ public: //- Read the forces data virtual void read(const dictionary&); - //- Execute + //- Execute, currently does nothing virtual void execute(); + //- Execute at the final time-loop, currently does nothing + virtual void end(); + //- Write the forces virtual void write(); diff --git a/src/postProcessing/functionObjects/systemCall/systemCall.C b/src/postProcessing/functionObjects/systemCall/systemCall.C index f0cc9f9c08886d3577ad6375ef412ff41538f1ba..6fdf84d70c6adf76c53cb729e58d4667e38b9379 100644 --- a/src/postProcessing/functionObjects/systemCall/systemCall.C +++ b/src/postProcessing/functionObjects/systemCall/systemCall.C @@ -41,15 +41,14 @@ namespace Foam Foam::systemCall::systemCall ( const word& name, - const objectRegistry& obr, + const objectRegistry&, const dictionary& dict, - const bool loadFromFiles + const bool ) : name_(name), - obr_(obr), - active_(true), executeCalls_(), + endCalls_(), writeCalls_() { read(dict); @@ -66,8 +65,16 @@ Foam::systemCall::~systemCall() void Foam::systemCall::read(const dictionary& dict) { - dict.lookup("executeCalls") >> executeCalls_; - dict.lookup("writeCalls") >> writeCalls_; + dict.readIfPresent("executeCalls", executeCalls_); + dict.readIfPresent("endCalls", endCalls_); + dict.readIfPresent("writeCalls", writeCalls_); + + if (executeCalls_.empty() && endCalls_.empty() && writeCalls_.empty()) + { + WarningIn("Foam::system::read(const dictionary&)") + << "no executeCalls, endCalls or writeCalls defined." + << endl; + } } @@ -79,6 +86,16 @@ void Foam::systemCall::execute() } } + +void Foam::systemCall::end() +{ + forAll(endCalls_, callI) + { + ::system(endCalls_[callI].c_str()); + } +} + + void Foam::systemCall::write() { forAll(writeCalls_, callI) diff --git a/src/postProcessing/functionObjects/systemCall/systemCall.H b/src/postProcessing/functionObjects/systemCall/systemCall.H index e516159b695868ae1458e307303bd9024c166761..6dc8fed5294e6f3d7a8b58f17208581cb09437d3 100644 --- a/src/postProcessing/functionObjects/systemCall/systemCall.H +++ b/src/postProcessing/functionObjects/systemCall/systemCall.H @@ -63,14 +63,12 @@ protected: //- Name of this set of system calls word name_; - const objectRegistry& obr_; - - //- on/off switch - bool active_; - //- List of calls to execute - every step stringList executeCalls_; + //- List of calls to execute when exiting the time-loop + stringList endCalls_; + //- List of calls to execute - write steps stringList writeCalls_; @@ -97,9 +95,9 @@ public: systemCall ( const word& name, - const objectRegistry&, + const objectRegistry& unused, const dictionary&, - const bool loadFromFiles = false + const bool loadFromFilesUnused = false ); @@ -119,10 +117,13 @@ public: //- Read the system calls virtual void read(const dictionary&); - //- Execute + //- Execute the "executeCalls" at each time-step virtual void execute(); - //- Write + //- Execute the "endCalls" at the final time-loop + virtual void end(); + + //- Write, execute the "writeCalls" virtual void write(); //- Update for changes of mesh diff --git a/src/postProcessing/functionObjects/utilities/dynamicPressure/dynamicPressure.C b/src/postProcessing/functionObjects/utilities/dynamicPressure/dynamicPressure.C index f5398a84415853923a3296156271e2dbe452c5b8..a31c913ba78a4a515d38ee93cf5b57e6a4b4bf90 100644 --- a/src/postProcessing/functionObjects/utilities/dynamicPressure/dynamicPressure.C +++ b/src/postProcessing/functionObjects/utilities/dynamicPressure/dynamicPressure.C @@ -58,7 +58,7 @@ Foam::dynamicPressure::dynamicPressure name_(name), obr_(obr), active_(true), - pName_(dict.lookup("p")), + pName_(dict.lookupOrDefault<word>("p", "p")), rho_(readScalar(dict.lookup("rho"))) { // Check if the available mesh is an fvMesh, otherwise deactivate @@ -68,7 +68,7 @@ Foam::dynamicPressure::dynamicPressure WarningIn ( "dynamicPressure::dynamicPressure" - "(const objectRegistry& obr, const dictionary& dict)" + "(const objectRegistry&, const dictionary&)" ) << "No fvMesh available, deactivating." << nl << endl; } @@ -81,7 +81,7 @@ Foam::dynamicPressure::dynamicPressure WarningIn ( "dynamicPressure::dynamicPressure" - "(const objectRegistry& obr, const dictionary& dict)" + "(const objectRegistry&, const dictionary&)" ) << "Pressure is not kinematic pressure, deactivating." << nl << endl; } @@ -103,7 +103,7 @@ void Foam::dynamicPressure::read(const dictionary& dict) { if (active_) { - dict.lookup("p") >> pName_; + dict.readIfPresent("p", pName_); dict.lookup("rho") >> rho_; } } @@ -115,6 +115,12 @@ void Foam::dynamicPressure::execute() } +void Foam::dynamicPressure::end() +{ + // Do nothing - only valid on write +} + + void Foam::dynamicPressure::write() { if (active_) diff --git a/src/postProcessing/functionObjects/utilities/dynamicPressure/dynamicPressure.H b/src/postProcessing/functionObjects/utilities/dynamicPressure/dynamicPressure.H index cf7f5530f3d8dfa258bbb4171f6d660065aaaacb..c3c6bdbb0f3d60afe65274a0bdbb014a260bdd38 100644 --- a/src/postProcessing/functionObjects/utilities/dynamicPressure/dynamicPressure.H +++ b/src/postProcessing/functionObjects/utilities/dynamicPressure/dynamicPressure.H @@ -66,10 +66,10 @@ class dynamicPressure //- on/off switch bool active_; - //- Name of pressure field + //- Name of pressure field, default is "p" word pName_; - //- Density + //- Density value scalar rho_; @@ -120,9 +120,12 @@ public: //- Read the dynamicPressure data virtual void read(const dictionary&); - //- Execute + //- Execute, currently does nothing virtual void execute(); + //- Execute at the final time-loop, currently does nothing + virtual void end(); + //- Calculate the dynamicPressure and write virtual void write(); diff --git a/src/sampling/Make/files b/src/sampling/Make/files index 004f81d435793d392ca76af730cd3c28509d5faa..c52803251940c51fa2ee40d702e4a25be6bd3760 100644 --- a/src/sampling/Make/files +++ b/src/sampling/Make/files @@ -48,8 +48,6 @@ graphField/writePatchGraph.C graphField/writeCellGraph.C graphField/makeGraph.C -outputFilters/outputFilterOutputControl/outputFilterOutputControl.C - meshToMesh = meshToMeshInterpolation/meshToMesh $(meshToMesh)/meshToMesh.C $(meshToMesh)/calculateMeshToMeshAddressing.C diff --git a/src/sampling/probes/probes.C b/src/sampling/probes/probes.C index f0596ea5631a7431e26552f9ae4d2c4c77e22b26..91c588c6d3ef1128ca0d7f47325f092cd027c0a8 100644 --- a/src/sampling/probes/probes.C +++ b/src/sampling/probes/probes.C @@ -304,6 +304,12 @@ void Foam::probes::execute() } +void Foam::probes::end() +{ + // Do nothing - only valid on write +} + + void Foam::probes::write() { if (probeLocations_.size() && checkFieldTypes()) diff --git a/src/sampling/probes/probes.H b/src/sampling/probes/probes.H index 27c2a9a3bb6c97ef72650ea8d980a182589f4a0f..33e4f39e25056cda02b95f87a2fa8ae676ad5869 100644 --- a/src/sampling/probes/probes.H +++ b/src/sampling/probes/probes.H @@ -194,15 +194,18 @@ public: return cellList_; } + //- Execute, currently does nothing + virtual void execute(); + + //- Execute at the final time-loop, currently does nothing + virtual void end(); + //- Sample and write virtual void write(); //- Read the probes virtual void read(const dictionary&); - //- Execute - virtual void execute(); - //- Update for changes of mesh virtual void updateMesh(const mapPolyMesh&) {} diff --git a/src/sampling/sampledSet/sampledSets/sampledSets.C b/src/sampling/sampledSet/sampledSets/sampledSets.C index f09a82e30aeab74afb48ce2e390fc1b1721afbd7..621efba7a51244df2150d9105e97dac5168ab1bf 100644 --- a/src/sampling/sampledSet/sampledSets/sampledSets.C +++ b/src/sampling/sampledSet/sampledSets/sampledSets.C @@ -275,6 +275,12 @@ void Foam::sampledSets::execute() } +void Foam::sampledSets::end() +{ + // Do nothing - only valid on write +} + + void Foam::sampledSets::write() { if (size() && checkFieldTypes()) diff --git a/src/sampling/sampledSet/sampledSets/sampledSets.H b/src/sampling/sampledSet/sampledSets/sampledSets.H index baf21e450bfe47f2ba4da9a07ea15d363de40b31..da38f9e1c50ef5d43adf9426fb0517dbadd94a9a 100644 --- a/src/sampling/sampledSet/sampledSets/sampledSets.H +++ b/src/sampling/sampledSet/sampledSets/sampledSets.H @@ -270,9 +270,12 @@ public: //- set verbosity level void verbose(const bool verbosity = true); - //- Execute + //- Execute, currently does nothing virtual void execute(); + //- Execute at the final time-loop, currently does nothing + virtual void end(); + //- Sample and write virtual void write(); diff --git a/src/sampling/sampledSurface/isoSurface/sampledIsoSurface.C b/src/sampling/sampledSurface/isoSurface/sampledIsoSurface.C index 2cbe93c40abd1c863bdb73de74f7fc9f54079f1b..5fd09bda66e9ba888e5f0212c05cca58c567a70f 100644 --- a/src/sampling/sampledSurface/isoSurface/sampledIsoSurface.C +++ b/src/sampling/sampledSurface/isoSurface/sampledIsoSurface.C @@ -335,7 +335,7 @@ bool Foam::sampledIsoSurface::updateGeometry() const subMeshPtr_.reset ( - new fvMeshSubset(static_cast<const fvMesh&>(mesh())) + new fvMeshSubset(fvm) ); subMeshPtr_().setLargeCellSubset ( diff --git a/src/sampling/sampledSurface/isoSurface/sampledIsoSurface.H b/src/sampling/sampledSurface/isoSurface/sampledIsoSurface.H index 4cf334ecbd504924344a3b6a4b51224f3a9ffbdc..99324cdf5f398a66b1f1e3416d1454e12ff07f20 100644 --- a/src/sampling/sampledSurface/isoSurface/sampledIsoSurface.H +++ b/src/sampling/sampledSurface/isoSurface/sampledIsoSurface.H @@ -87,7 +87,7 @@ class sampledIsoSurface // Recreated for every isoSurface - //- Time at last call, also track it surface needs an update + //- Time at last call, also track if surface needs an update mutable label prevTimeIndex_; //- Cached volfield diff --git a/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C b/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C index 003515c7d403160b9f41119016ce45ffee38639a..9eb0e73f1116eeef237df6f048fe5738e6796712 100644 --- a/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C +++ b/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C @@ -203,7 +203,6 @@ Foam::sampledSurfaces::~sampledSurfaces() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - void Foam::sampledSurfaces::verbose(const bool verbosity) { verbose_ = verbosity; @@ -216,6 +215,12 @@ void Foam::sampledSurfaces::execute() } +void Foam::sampledSurfaces::end() +{ + // Do nothing - only valid on write +} + + void Foam::sampledSurfaces::write() { if (size() && checkFieldTypes()) diff --git a/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.H b/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.H index 263578340906a08937a80a6cc9f55aa444ad17db..7bf12aaba8e1099501ef31424a3917f1c4562a34 100644 --- a/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.H +++ b/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.H @@ -257,9 +257,12 @@ public: //- set verbosity level void verbose(const bool verbosity = true); - //- Execute + //- Execute, currently does nothing virtual void execute(); + //- Execute at the final time-loop, currently does nothing + virtual void end(); + //- Sample and write virtual void write(); diff --git a/src/turbulenceModels/Allwmake b/src/turbulenceModels/Allwmake index 4c49ec6163362cc9eaa8858cb0c99799253a38ef..80dc9dc1ee0053a356519db504dcc8514e6a86a5 100755 --- a/src/turbulenceModels/Allwmake +++ b/src/turbulenceModels/Allwmake @@ -2,8 +2,8 @@ cd ${0%/*} || exit 1 # run from this directory set -x -(cd LES && ./Allwmake ) -(cd incompressible && ./Allwmake ) -(cd compressible && ./Allwmake ) +LES/Allwmake +incompressible/Allwmake +compressible/Allwmake # ----------------------------------------------------------------- end-of-file diff --git a/tutorials/heatTransfer/buoyantFoam/hotRoom/0/T b/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/0/T similarity index 100% rename from tutorials/heatTransfer/buoyantFoam/hotRoom/0/T rename to tutorials/heatTransfer/buoyantPisoFoam/hotRoom/0/T diff --git a/tutorials/heatTransfer/buoyantFoam/hotRoom/0/T.org b/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/0/T.org similarity index 100% rename from tutorials/heatTransfer/buoyantFoam/hotRoom/0/T.org rename to tutorials/heatTransfer/buoyantPisoFoam/hotRoom/0/T.org diff --git a/tutorials/heatTransfer/buoyantFoam/hotRoom/0/U b/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/0/U similarity index 100% rename from tutorials/heatTransfer/buoyantFoam/hotRoom/0/U rename to tutorials/heatTransfer/buoyantPisoFoam/hotRoom/0/U diff --git a/tutorials/heatTransfer/buoyantFoam/hotRoom/0/epsilon b/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/0/epsilon similarity index 100% rename from tutorials/heatTransfer/buoyantFoam/hotRoom/0/epsilon rename to tutorials/heatTransfer/buoyantPisoFoam/hotRoom/0/epsilon diff --git a/tutorials/heatTransfer/buoyantFoam/hotRoom/0/k b/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/0/k similarity index 100% rename from tutorials/heatTransfer/buoyantFoam/hotRoom/0/k rename to tutorials/heatTransfer/buoyantPisoFoam/hotRoom/0/k diff --git a/tutorials/heatTransfer/buoyantFoam/hotRoom/0/p b/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/0/p similarity index 100% rename from tutorials/heatTransfer/buoyantFoam/hotRoom/0/p rename to tutorials/heatTransfer/buoyantPisoFoam/hotRoom/0/p diff --git a/tutorials/heatTransfer/buoyantFoam/hotRoom/0/pd b/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/0/pd similarity index 100% rename from tutorials/heatTransfer/buoyantFoam/hotRoom/0/pd rename to tutorials/heatTransfer/buoyantPisoFoam/hotRoom/0/pd diff --git a/tutorials/heatTransfer/buoyantFoam/hotRoom/Allclean b/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/Allclean similarity index 100% rename from tutorials/heatTransfer/buoyantFoam/hotRoom/Allclean rename to tutorials/heatTransfer/buoyantPisoFoam/hotRoom/Allclean diff --git a/tutorials/heatTransfer/buoyantFoam/hotRoom/Allrun b/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/Allrun similarity index 100% rename from tutorials/heatTransfer/buoyantFoam/hotRoom/Allrun rename to tutorials/heatTransfer/buoyantPisoFoam/hotRoom/Allrun diff --git a/tutorials/heatTransfer/buoyantFoam/hotRoom/constant/RASProperties b/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/constant/RASProperties similarity index 100% rename from tutorials/heatTransfer/buoyantFoam/hotRoom/constant/RASProperties rename to tutorials/heatTransfer/buoyantPisoFoam/hotRoom/constant/RASProperties diff --git a/tutorials/heatTransfer/buoyantFoam/hotRoom/constant/environmentalProperties b/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/constant/environmentalProperties similarity index 100% rename from tutorials/heatTransfer/buoyantFoam/hotRoom/constant/environmentalProperties rename to tutorials/heatTransfer/buoyantPisoFoam/hotRoom/constant/environmentalProperties diff --git a/tutorials/heatTransfer/buoyantFoam/hotRoom/constant/polyMesh/blockMeshDict b/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/constant/polyMesh/blockMeshDict similarity index 100% rename from tutorials/heatTransfer/buoyantFoam/hotRoom/constant/polyMesh/blockMeshDict rename to tutorials/heatTransfer/buoyantPisoFoam/hotRoom/constant/polyMesh/blockMeshDict diff --git a/tutorials/heatTransfer/buoyantFoam/hotRoom/constant/polyMesh/boundary b/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/constant/polyMesh/boundary similarity index 100% rename from tutorials/heatTransfer/buoyantFoam/hotRoom/constant/polyMesh/boundary rename to tutorials/heatTransfer/buoyantPisoFoam/hotRoom/constant/polyMesh/boundary diff --git a/tutorials/heatTransfer/buoyantFoam/hotRoom/constant/thermophysicalProperties b/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/constant/thermophysicalProperties similarity index 100% rename from tutorials/heatTransfer/buoyantFoam/hotRoom/constant/thermophysicalProperties rename to tutorials/heatTransfer/buoyantPisoFoam/hotRoom/constant/thermophysicalProperties diff --git a/tutorials/heatTransfer/buoyantFoam/hotRoom/constant/turbulenceProperties b/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/constant/turbulenceProperties similarity index 100% rename from tutorials/heatTransfer/buoyantFoam/hotRoom/constant/turbulenceProperties rename to tutorials/heatTransfer/buoyantPisoFoam/hotRoom/constant/turbulenceProperties diff --git a/tutorials/heatTransfer/buoyantFoam/hotRoom/setHotRoom/Make/files b/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/setHotRoom/Make/files similarity index 100% rename from tutorials/heatTransfer/buoyantFoam/hotRoom/setHotRoom/Make/files rename to tutorials/heatTransfer/buoyantPisoFoam/hotRoom/setHotRoom/Make/files diff --git a/tutorials/heatTransfer/buoyantFoam/hotRoom/setHotRoom/Make/options b/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/setHotRoom/Make/options similarity index 100% rename from tutorials/heatTransfer/buoyantFoam/hotRoom/setHotRoom/Make/options rename to tutorials/heatTransfer/buoyantPisoFoam/hotRoom/setHotRoom/Make/options diff --git a/tutorials/heatTransfer/buoyantFoam/hotRoom/setHotRoom/createFields.H b/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/setHotRoom/createFields.H similarity index 100% rename from tutorials/heatTransfer/buoyantFoam/hotRoom/setHotRoom/createFields.H rename to tutorials/heatTransfer/buoyantPisoFoam/hotRoom/setHotRoom/createFields.H diff --git a/tutorials/heatTransfer/buoyantFoam/hotRoom/setHotRoom/setHotRoom.C b/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/setHotRoom/setHotRoom.C similarity index 100% rename from tutorials/heatTransfer/buoyantFoam/hotRoom/setHotRoom/setHotRoom.C rename to tutorials/heatTransfer/buoyantPisoFoam/hotRoom/setHotRoom/setHotRoom.C diff --git a/tutorials/heatTransfer/buoyantFoam/hotRoom/system/controlDict b/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/system/controlDict similarity index 100% rename from tutorials/heatTransfer/buoyantFoam/hotRoom/system/controlDict rename to tutorials/heatTransfer/buoyantPisoFoam/hotRoom/system/controlDict diff --git a/tutorials/heatTransfer/buoyantFoam/hotRoom/system/fvSchemes b/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/system/fvSchemes similarity index 100% rename from tutorials/heatTransfer/buoyantFoam/hotRoom/system/fvSchemes rename to tutorials/heatTransfer/buoyantPisoFoam/hotRoom/system/fvSchemes diff --git a/tutorials/heatTransfer/buoyantFoam/hotRoom/system/fvSolution b/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/system/fvSolution similarity index 100% rename from tutorials/heatTransfer/buoyantFoam/hotRoom/system/fvSolution rename to tutorials/heatTransfer/buoyantPisoFoam/hotRoom/system/fvSolution diff --git a/tutorials/incompressible/MRFSimpleFoam/MRFSimpleFoam/MRFSimpleFoam.C b/tutorials/incompressible/MRFSimpleFoam/MRFSimpleFoam/MRFSimpleFoam.C index 7e1faab80578359690e6a7aa8ee590523aec3303..9fc36826fe69d29b6164386dc74e19eb6b5df6ff 100644 --- a/tutorials/incompressible/MRFSimpleFoam/MRFSimpleFoam/MRFSimpleFoam.C +++ b/tutorials/incompressible/MRFSimpleFoam/MRFSimpleFoam/MRFSimpleFoam.C @@ -52,8 +52,9 @@ int main(int argc, char *argv[]) Info<< "\nStarting time loop\n" << endl; - for (runTime++; !runTime.end(); runTime++) + while (runTime.run()) { + runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; # include "readSIMPLEControls.H" diff --git a/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/simpleSRFFoam.C b/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/simpleSRFFoam.C index f0ce70e69350084925f7061e4d78d663a9f44155..fecc4cb717f8fd676b00c1a1be15720d0f4f065f 100644 --- a/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/simpleSRFFoam.C +++ b/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/simpleSRFFoam.C @@ -53,8 +53,9 @@ int main(int argc, char *argv[]) Info<< "\nStarting time loop\n" << endl; - for (runTime++; !runTime.end(); runTime++) + while (runTime.run()) { + runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; # include "readSIMPLEControls.H"