CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Bugs (
-   -   Proposal for an extension for the timeoptions of Utilities (

gschaider March 14, 2008 10:37

Hi! One problem I encounter

One problem I encounter frequently is that the options -time/-latestTime only let me specify either all or one time-step. This is sometimes quite inconvenient (for instance a reconstructPar of a case of which one half has already been reconstructed only gives me the possibility to reconstruct the first half of the timesteps anew or reconstruct one time-step at a time; for utilities like sample that remove old data when being called this is also quite annoying if you want to sample only two time-steps out of 100)

I thought it would be nice to have an option -times that gives the possibility to specifie multiple times:
-times 100,101.5,105
or specify a range
-times 100_110
or an open range
-times 100_
or only ever 2 seconds
-times 100_2_110
or only every 5th time-step in the range
-times 100:5:110
or a combination
-times 0,50,100_

What do you think?

Actually I did an example implementation. It's a bit clumsy because I tried not to modify the application-sources and did not want to modify kernel-classes, but it works alright and as far as I can tell it does not break compatibility with the old options. I'll append it as a patch. timesOption.patch

henry March 14, 2008 10:59

Yes I totally agree and a more
Yes I totally agree and a more general time and time-range selection scheme has already been implemented which will be in included in the next release.


gschaider August 20, 2008 09:23

Excuse me for being a bit slow
Excuse me for being a bit slow-witted. That would be what the point "Extended time command line options." in the 1.5 Release-Notes is referring to, wouldn't it? My problem is, that I can't see how to select such a thing with the stock utilities (reconstructPar/checkMesh), I didn't find any reference in the documentation and in the source ($FOAM_SRC/OpenFOAM/include/addTime*.H etc would be the place to look at, wouldn't it?).

Did I miss something or is it possible that that feature got stuck in git somewhere and simply isn't in the release?


olesen August 21, 2008 12:09

Hi Bernhard, I'm not at my
Hi Bernhard,

I'm not at my desk at the moment, but take a look at the timeSelector class (I think), it is used in some of the utils like Mach etc.

gschaider August 25, 2008 16:28

Hi Mark! Thanks. Didn't see
Hi Mark!

Thanks. Didn't see that.

As a repentance I wrote this little page on the Wiki for all those who don't want to look it up in the source:


msrinath80 August 26, 2008 19:13

Thanks for those tips Bernhard
Thanks for those tips Bernhard :-)

All times are GMT -4. The time now is 12:29.