lookup a scalar
Hi,
I would like to insert a scalar into the for-loop condition which is looked up in any datafile like controlDict or fvSolution. I tried to use these two examples located in the main funtion of myFoam.C Code:
dictionary outerloop = mesh.solutionDict().subDict("OUTERLOOP"); Code:
for (int m=0; m<nOuterCorr; m++) Code:
OUTERLOOP Thanks for advise! David |
what does not work? do you get an error upon compiling? do you get an error at all? does it run without complaining and just not read the value?
|
Thank you for your reply Roman.
It does not read the scalar mIt and in the second case the compiling-report tells: unused parameter nOuterCorr (but it should be used in the for-condition). Do you use the same or similar code successfully? |
hej,
if you dfine your scalar before as for example Code:
scalar mIt_; // in the header Code:
outerLoop.lookup("mIt") >> mIt ; |
thank you so much, I will try it!
What is the meaning of the _ (underline) and does the >> perform a shift? |
underlines like "_" are usually appended to a variable in order to show that we speak about a private variable in a class
the ">>" gives the stream into a variable. It is part of the standard IO package of c++ |
Hi,
I am sorry, it returns: Code:
TPlusLTest.C: In function âint main(int, char**)â: Code:
#include "fvCFD.H" |
Quote:
|
It works finally, thanks a lot!
|
All times are GMT -4. The time now is 16:47. |