CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   create an output file only at the endTime (https://www.cfd-online.com/Forums/openfoam-programming-development/85642-create-output-file-only-endtime.html)

Cyp March 3, 2011 05:53

create an output file only at the endTime
 
Hi!

I would like to create an output file at my last time step. I wondered if an command similar to
Code:

    if (runTime.outputTime())
    {
          logFile << balbalbalblalba << endl;
    }

exist for the last time step ?

Any help would be appreciated.

Best regards,
Cyp

marupio March 3, 2011 11:18

I believe you're looking for:

Code:

if (runTime.end())

Cyp March 3, 2011 11:29

Hi Marupio!

Thank you for your answer. I tried your suggestion but nothing is written inside my output file...

akidess March 4, 2011 04:15

You could also put your write command behind the time loop:

Code:

while (runTime.run())
{
        [...]
}
logfile << STUFF;

Of course you will only be able to output variables that were defined outside the time loop brackets, e.g. in createFields.H.


All times are GMT -4. The time now is 21:14.