CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   Problem on multiple fine on single processor! (

skabilan December 3, 2009 19:35

Printing the gradient value on a particular patch
Hi Foamers,

I would like to print the values of the gradient of T on a particular patch before changing its works fine on single processor. While on multiple processors, the patch is distributed on a number of processors, how would i make it print all the values from all the processors?

forAll (T.boundaryField(), patchi)
if(T.boundaryField()[patchi].type() == "fixedGradient")
fixedGradientFvPatchScalarField& bufferMesh1= refCast<fixedGradientFvPatchScalarField>(T.boundar yField()[patchi]);
forAll(bufferMesh1, faceI)
Info << bufferMesh1.gradient()[faceI] << endl;
// bufferMesh1.gradient()[faceI] = blah blah;

Can anyone help me with this problem?


l_r_mcglashan December 5, 2009 05:16

You can either gather all the data onto a single processor using 'Pstream', or you can just use 'Pout' instead of 'Info'. Pout will output your values but with the processor number at the beginning of the line. So they won't be ordered particularly well in standard output, but you can always paste them into excel and sort them.

skabilan December 5, 2009 13:19

Hi Laurence,

Thanks a lot for the reply. I think the easiest way is to use pout instead of Info...


All times are GMT -4. The time now is 02:20.