CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Problem on multiple processors..works fine on single processor! (https://www.cfd-online.com/Forums/openfoam-solving/70729-problem-multiple-processors-works-fine-single-processor.html)

skabilan December 3, 2009 18: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 value...it 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?

Thanks
Senthil

l_r_mcglashan December 5, 2009 04: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 12:19

Hi Laurence,

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

Regards,
Senthil


All times are GMT -4. The time now is 05:17.