|
[Sponsors] |
January 8, 2015, 05:02 |
Read a field at different times
|
#1 |
Senior Member
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 339
Rep Power: 28 |
Hi,
I want to create a post-processing utility, which traverses all time steps and compares the data with the data of all other time steps. So I end up with two nested loops traversing all time steps. So, in pseudo code, it looks like this: Code:
// go over all time steps forAll(timeDirs, timeI) { runTime.setTime(timeDirs[timeI], timeI); // go over all time steps forAll(timeDirs, timeJ) { secTime.setTime(timeDirs[timeJ], timeJ); if (timeI == timeJ) { // easy recurrenceMatrixAlpha[timeI][timeJ] = 1; } else { // do stuff } } } Code:
volScalarField alpha1 ( IOobject ( "alpha.air", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE ), mesh ); volScalarField alpha2 ( IOobject ( "alpha.air", secTime.timeName(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE ), mesh ); I assume, that this might be done faster. Is there a way to just read the field at the current time, like read()? |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Foam::error::PrintStack | almir | OpenFOAM Running, Solving & CFD | 92 | May 21, 2024 07:56 |
problems after decomposing for running | alessio.nz | OpenFOAM | 7 | March 5, 2021 04:49 |
creating an internal field? | maybee | OpenFOAM Programming & Development | 2 | February 4, 2021 17:15 |
Starting field averaging using libFunctionObject after certain time | eelcovv | OpenFOAM Programming & Development | 25 | December 7, 2015 22:28 |
Jobs are exited | simanoj | FLUENT | 0 | June 20, 2013 05:36 |