|
[Sponsors] |
May 27, 2011, 03:44 |
Accessing private variables
|
#1 |
New Member
Robert Maier
Join Date: Apr 2011
Posts: 9
Rep Power: 15 |
Hello,
I'm still quite new to OpenFOAM. Maybe someone can help me? I'm making a variation on the interFoam solver. I'd like to use the nHatfv variable calculated in the interfaceProperties.C code. This information is private, however. Is there a way to access this yet, or must I simply rewrite the portion of the code to get what I want? Thanks! Robert |
|
May 27, 2011, 06:28 |
|
#2 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
So rewrite the model or make a bug-report requesting that variable to be moved to the protected stuff |
||
May 27, 2011, 08:10 |
|
#3 |
Member
Robertas N.
Join Date: Mar 2009
Location: Kaunas, Lithuania
Posts: 53
Rep Power: 17 |
There is a public function interfaceProperties::nHatf (). Can it be of any help?
|
|
May 30, 2011, 04:14 |
|
#4 |
Member
Robertas N.
Join Date: Mar 2009
Location: Kaunas, Lithuania
Posts: 53
Rep Power: 17 |
And I forgot to mention this: http://en.wikipedia.org/wiki/Visitor_pattern
|
|
May 30, 2011, 08:06 |
|
#5 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
That "only" gives you back a const reference so officially you can't modify the field. There is a workaround ... but you havn't got this from me and don't ask further .... google for const_cast
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Accessing other variables in defining boundary condition | Cynthia Poon | OpenFOAM Running, Solving & CFD | 1 | September 27, 2021 07:28 |
$FOAM_USER_APPBIN & LIBBIN variables not set | rassilon | OpenFOAM Installation | 2 | February 16, 2010 21:54 |
Accessing Variables from Previous Timestep | Vinayak Barve | FLUENT | 1 | March 10, 2004 08:40 |
PHI file structure | Eugene | Phoenics | 9 | November 2, 2001 23:00 |
Saving variables on a user patch with physical coordinates | Zoltan Turzo | CFX | 2 | April 20, 2000 16:05 |