|
[Sponsors] |
January 26, 2010, 04:17 |
Questions about the code
|
#1 |
New Member
Alice
Join Date: Nov 2009
Posts: 16
Rep Power: 16 |
Hi everyone,
I got some questions about the code...Can somebody explain what's the meaning of: 1. instantList Times = runTime.times(); 2. runTime.setTime(Times[startTime], startTime); ? Thanks! Alice |
|
January 27, 2010, 04:09 |
|
#2 |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,677
Rep Power: 40 |
The code states that it get the list of time instants and set the current time to be one of them from the list. What exactly is your question?
|
|
January 28, 2010, 01:59 |
|
#3 |
New Member
Alice
Join Date: Nov 2009
Posts: 16
Rep Power: 16 |
Thanks for your reply...I want to know that in
Code:
runTime.setTime(Times[startTime], startTime); Alice |
|
January 28, 2010, 03:42 |
|
#4 | |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,677
Rep Power: 40 |
Quote:
Code:
void Foam::Time::setTime(const instant& inst, const label newIndex) { value() = inst.value(); dimensionedScalar::name() = inst.name(); timeIndex_ = newIndex; IOdictionary timeDict ( IOobject ( "time", timeName(), "uniform", *this, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false ) ); timeDict.readIfPresent("deltaT", deltaT_); timeDict.readIfPresent("deltaT0", deltaT0_); timeDict.readIfPresent("index", timeIndex_); } If you really want to bypass the read dictionary semantics, you could specifying the time value directly as a scalar. For example, Code:
runTime.setTime(Times[startTime].value(), startTime); Code:
int someTime = 7; runTime.setTime(Times[someTime], someTime); |
||
January 29, 2010, 02:49 |
|
#5 |
New Member
Alice
Join Date: Nov 2009
Posts: 16
Rep Power: 16 |
Dear olesen,
Thanks for your explanation. It helps Alice |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
some questions on using unsteady code | pangpang | Phoenics | 0 | January 25, 2002 23:22 |
Design Integration with CFD? | John C. Chien | Main CFD Forum | 19 | May 17, 2001 16:56 |
What is the Better Way to Do CFD? | John C. Chien | Main CFD Forum | 54 | April 23, 2001 09:10 |
own Code vs. commercial code | Bernhard Mueck | Main CFD Forum | 10 | February 16, 2000 11:07 |
public CFD Code development | Heinz Wilkening | Main CFD Forum | 38 | March 5, 1999 12:44 |