|
[Sponsors] |
RunTimevalue and runTimetimeName with %3d%3d operator |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 1, 2006, 20:20 |
I noticed that when I write a
|
#1 |
Senior Member
Maka Mohu
Join Date: Mar 2009
Posts: 305
Rep Power: 18 |
I noticed that when I write a condition like :
This refere to OpenFOAM V1.2: (a) If(runTime.timeName() == runTime.endTime().value()) {// do something} (b) If(runTime.value() == runTime.endTime().value()) {// do something} condition (b) works while condition (a) does not. I looked further, I found that the compiler sees those expressions as: (a) Foam::Time::timeName() const() == Foam::Time::endTime() const().Foam::dimensioned<type>::value [with Type = Foam::scalar]() (b) runTime.Foam::Time::<anonymous>.Foam::TimeState::< anonymous>.Foam::dimensioned<t ype>::value [with Type = Foam::scalar]() == Foam::Time::endTime() const().Foam::dimensioned<type>::value [with Type = Foam::scalar]() with the nearest candidate operator== as: int Foam::operator==(const Foam::instant&, const Foam::instant&) I'm aware that there is automatic conversion between word and instant that is why (a) works but why (b) does not work? after all it returned & scalar. I noticed that runTime.value() is not a const member function, but how that can have such an effect? Can any body help explain why that happens? Thanks. Best regards, Maka |
|
May 1, 2006, 20:22 |
correction: sorry for the typi
|
#2 |
Senior Member
Maka Mohu
Join Date: Mar 2009
Posts: 305
Rep Power: 18 |
correction: sorry for the typing mistake
condition (a) works while condition (b) does not. / Maka |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Question about fvmlaplacian operator | cosimobianchini | OpenFOAM Running, Solving & CFD | 0 | February 1, 2007 14:40 |
Template for operator overloading | shuo | OpenFOAM | 0 | November 10, 2006 22:17 |
Operator Splitting. | Maria. | Main CFD Forum | 5 | September 17, 2005 23:10 |
Operator precedence | hemph | OpenFOAM | 1 | September 13, 2005 13:40 |
a math operator in UDF | lichun Dong | FLUENT | 7 | June 18, 2005 23:04 |