|
[Sponsors] | |||||
|
|
|
#1 |
|
New Member
Alice
Join Date: Nov 2009
Posts: 16
Rep Power: 5 ![]() |
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 |
|
|
|
|
|
|
|
|
#2 |
|
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: http://olesenm.github.com/
Posts: 766
Rep Power: 16 ![]() |
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?
|
|
|
|
|
|
|
|
|
#3 |
|
New Member
Alice
Join Date: Nov 2009
Posts: 16
Rep Power: 5 ![]() |
Thanks for your reply...I want to know that in
Code:
runTime.setTime(Times[startTime], startTime); Alice |
|
|
|
|
|
|
|
|
#4 | |
|
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: http://olesenm.github.com/
Posts: 766
Rep Power: 16 ![]() |
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); |
||
|
|
|
||
|
|
|
#5 |
|
New Member
Alice
Join Date: Nov 2009
Posts: 16
Rep Power: 5 ![]() |
Dear olesen,
Thanks for your explanation. It helps ![]() Alice |
|
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| some questions on using unsteady code | pangpang | Phoenics | 0 | January 25, 2002 22:22 |
| Design Integration with CFD? | John C. Chien | Main CFD Forum | 19 | May 17, 2001 15:56 |
| What is the Better Way to Do CFD? | John C. Chien | Main CFD Forum | 54 | April 23, 2001 08:10 |
| own Code vs. commercial code | Bernhard Mueck | Main CFD Forum | 10 | February 16, 2000 10:07 |
| public CFD Code development | Heinz Wilkening | Main CFD Forum | 38 | March 5, 1999 11:44 |