diff --git a/src/OpenFOAM/db/functionObjects/functionObjectList/postProcess.H b/src/OpenFOAM/db/functionObjects/functionObjectList/postProcess.H index 2f8032d03f..f4729909f1 100644 --- a/src/OpenFOAM/db/functionObjects/functionObjectList/postProcess.H +++ b/src/OpenFOAM/db/functionObjects/functionObjectList/postProcess.H @@ -92,42 +92,12 @@ if (argList::postProcess(argc, argv)) #include INCLUDE_FILE(CREATE_CONTROL) #endif - // Externally stored dictionary for functionObjectList - // if not constructed from runTime - dictionary functionsControlDict("controlDict"); - - HashSet selectedFields; - - // Construct functionObjectList - autoPtr functionsPtr - ( - functionObjectList::New - ( - args, - runTime, - functionsControlDict, - selectedFields - ) - ); - forAll(timeDirs, timei) { runTime.setTime(timeDirs[timei], timei); Info<< "Time = " << runTime.timeName() << endl; - if (mesh.readUpdate() != polyMesh::UNCHANGED) - { - // Update functionObjects if mesh changes - functionsPtr = functionObjectList::New - ( - args, - runTime, - functionsControlDict, - selectedFields - ); - } - FatalIOError.throwExceptions(); try @@ -142,13 +112,25 @@ if (argList::postProcess(argc, argv)) #include INCLUDE_FILE(CREATE_FIELDS_3) #endif - functionsPtr->execute(); + // Externally stored dictionary for functionObjectList + // if not constructed from runTime + dictionary functionsControlDict("controlDict"); - // Execute the functionObject 'end()' function for the last time - if (timei == timeDirs.size()-1) - { - functionsPtr->end(); - } + HashSet selectedFields; + + // Construct functionObjectList + autoPtr functionsPtr + ( + functionObjectList::New + ( + args, + runTime, + functionsControlDict, + selectedFields + ) + ); + + functionsPtr->execute(); } catch (IOerror& err) { diff --git a/src/thermophysicalModels/reactionThermo/functionObjects/moleFractions/moleFractions.C b/src/thermophysicalModels/reactionThermo/functionObjects/moleFractions/moleFractions.C index 166d9bc684..5a8954ba00 100644 --- a/src/thermophysicalModels/reactionThermo/functionObjects/moleFractions/moleFractions.C +++ b/src/thermophysicalModels/reactionThermo/functionObjects/moleFractions/moleFractions.C @@ -84,9 +84,7 @@ Foam::moleFractions::moleFractions ( "X_" + Y[i].name(), mesh_.time().timeName(), - mesh_, - IOobject::NO_READ, - IOobject::AUTO_WRITE + mesh_ ), mesh_, dimensionedScalar("X", dimless, 0) @@ -136,6 +134,11 @@ bool Foam::moleFractions::execute() template bool Foam::moleFractions::write() { + forAll(X_, i) + { + X_[i].write(); + } + return true; }