CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Programming & Development (
-   -   Variable outside brackets? (

sega August 10, 2009 03:04

Variable outside brackets?
Hello World.

I'm sure this is a C++ related question.

I created a variable inside a bracked {} and I'm filling it with content in it..

      scalarField myVariable;

What I want to do is to have access to this variable outside of the bracket!

Do you know how this can be done?!

henrik August 10, 2009 03:06

Dear Sega,

define it outside, not inside.


sega August 10, 2009 03:11

And I can access the variable inside the bracket if defined outside?!

henrik August 10, 2009 03:27

Dear Sebastian,

of course. Have a look at icoFoam. p is defined outside of the PISO-loop, but used within.


All times are GMT -4. The time now is 07:36.