printf in DEFINE_PROFILE
Hi all,
there is an "easy" thing that I cannot understand: why the following code do not generate a single output "h=..." in the console, but more than one and less than the face cell number or I don't know what? Code:
DEFINE_PROFILE (name,t,i){ Can anyone help me on that? Thanks in advance, philus |
How many times is the output "h=..." repeated? Are you running Fluent in serial or parallel? I suspect this output would be repeated for each parallel process if it's outside a loop. Each process executes this DEFINE_PROFILE macro.
|
I also thought that, but when I ran Fluent in serial I had it 11 times...
Otherwise I have 100 cells on the boundary, 3 domains... |
How many times was this phrase repeated in parallel, and how many processors were used? When are these outputs printed to the screen: during initialisation, iterations or otherwise?
|
This code is called every time Fluent needs to know the profile.
To make it more concrete, suppose that this is a pressure boundary condition. In every iteration, Fluent may need this profile more than once, depending on which numerical scheme is used, which discretization, and maybe depending on more factors. And if you plot the pressure, Fluent also collects this information, so this code is also run. Fluent could have been programmed differently, such that it executes the code once per iteration, and stores the result in memory, but that is not how it is implemented. |
I copy paste what happens in parallel mode on 2 CPUs. At the beginning I read an initialized simulation. I think that the first time it compute h frome the results of the initialization. After this it does the update (don't know what is it..) and then starts the iterations. There it do 2 times per iteration (so, there you were right!), but at the end...incomprehensible!
Sorry for the long code Code:
Reading "\"| gunzip -c \\\"Flower-h2o-v8-2.dat.gz\\\"\""... |
Ok, thank you pakk and sorry: you answered during I was writing the reply.
I now understand what it happens. I must now understand why, some time, I got different values, but this is my task ;-) Thanks a lot, thanks to everybody! philus |
All times are GMT -4. The time now is 10:35. |