|
[Sponsors] |
September 19, 2012, 04:22 |
runTime out of scope in functionObject
|
#1 |
New Member
Sune Niemann
Join Date: Aug 2011
Posts: 18
Rep Power: 15 |
Hi all,
My situation: I have created a new functionObject by dublicating the existing forceCoeffs functionObject. I modified it to do various averaging functions on the fly, and check if forces have stabilized. My problem: I want to writeAndEnd (or any equivalent) when a certain criteria is met, but runTime is not in scope. Another problem: I am new to OF programming. My setup: I'm running OF-2.1 in parallel, the layout of the code is much like the original forceCoeffs functionObject, so it includes Time.H. The code work as I intend and compiles when I do not include any runTime functions. Question: I can access time information from the objectRegistry like obr_.time().timeName() but so far as I can see, it does not inherit the member functions I am interested in. Can I include runTime in the functionObject scope or is there another way I can write and stop simulation? What I have tried so far: Code:
runTime.writeAndEnd(); //produce the error: runTime is not in scope Code:
obr_.time().writeAndEnd(); //produce the error: class has no member named writeAndEnd My feeling is that my main problem is in my programming skills and that I am doing something embarisingly wrong, so I hope someone can give me a pointer to the right solution, thank you in advance. |
|
September 24, 2012, 18:30 |
|
#2 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
September 26, 2012, 03:11 |
|
#3 | |
New Member
Sune Niemann
Join Date: Aug 2011
Posts: 18
Rep Power: 15 |
Quote:
Code:
obr_.time().stopAt(Time::saNextWrite) |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Compile calcMassFlowC | aurore | OpenFOAM Programming & Development | 13 | March 23, 2018 08:43 |
error compiling modified applications | yvyan | OpenFOAM Programming & Development | 21 | March 1, 2016 05:53 |
checking the system setup and Qt version | vivek070176 | OpenFOAM Installation | 22 | June 1, 2010 13:34 |
Installation OF1.5-dev | ttdtud | OpenFOAM Installation | 46 | May 5, 2009 03:32 |
How to get the max value of the whole field | waynezw0618 | OpenFOAM Running, Solving & CFD | 4 | June 17, 2008 06:07 |