|
[Sponsors] |
June 14, 2012, 12:22 |
lookupObject
|
#1 |
Senior Member
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,267
Blog Entries: 1
Rep Power: 25 |
Hi dear foamer
i need to read runTime from main solver in a class, i tried to use the following implementation: const Time& runTime = alpha1_.db().lookupObject<Time>("runTime"); it compiles fine, but when it runs it gives the following error: request for time runTime from objectRegistry region0 failed available objects of type time are 0 ( ) now: How can i resolve this error? and better question How i can read runTime.deltaT() in subclass from solver.C ? Best Regards |
|
June 14, 2012, 15:07 |
|
#2 |
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28 |
In chemistryModel and other classes, I've seen time access handled through the mesh, like mesh.time().timeName(). Its been a while before I looked at it, but I think that mesh is a part of that class (referencing a previously created mesh.
|
|
June 15, 2012, 13:23 |
|
#4 |
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28 |
Awesome, glad it works.
|
|
Tags |
runtime |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
lookupObject | nimasam | OpenFOAM Bugs | 0 | July 3, 2011 08:55 |
dynamic_cast and lookupObject | kev4573 | OpenFOAM Programming & Development | 0 | December 10, 2009 19:12 |