lookupObject
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 :D How i can read runTime.deltaT() in subclass from solver.C ? Best Regards |
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.
|
yep, it works ;)
Code:
dimensionedScalar deltaT = U.mesh().time().deltaT(); |
Awesome, glad it works.
|
All times are GMT -4. The time now is 02:03. |