.boundary() in parallel
Hi,
in my solver I have a loop through all my boundaries to extract those of type wall. This is realised by Code:
forAll (mesh.boundary(), patchI) Code:
U.boundaryField()[wallPatchID].size(): 2500 Code:
U.boundaryField()[wallPatchID].size(): 0 Thanks in advance! Nicklas |
After playing around with the decomposition methods, I looks as if the code only "runs" on the processor0. Anyone knows what to do?
Thanks |
Hi Nicklas,
use "Pout<< " instead of "Info<< ", then each processor will output its local size. With "Info<< " only processor0 will print its value, and you must use a gSum command to gather the information from all processors to processor0 first. Martin |
Hi Martin,
thanks for the hint.. Ok, for the output it is clear. But if i e.g. want to set U as U^2 on a boundary I first have to "gSum" the velocity fields, then square them, and redistribute? Nicklas |
Since every processor calls the gSum, too, the sum is distributed already, I think. So every processor can calculate the U^2 value and set it locally.
You can check it with the Pout command again. Martin |
Allright, I'll try that, thanks for your help!
|
Sorry to bother again, but...
gSum returns only the sum.. I actually want a vector(or scalar)Field of a patch which is split to several processors. That seems to be sth different?! Greetings Nicklas |
May be you can find the answer in this code snippet, where slave processors are sending data to the master processor with Pstream:
http://www.cfd-online.com/Forums/ope...tml#post282446 Martin |
Hi Martin,
I think I now understood what was going wrong. I just added a condition, that the operations on the boundary are only performed, if it's size is greater than 0. No all warnings and Errors disappeared and it seems to work! Thanks for your help! Nicklas |
All times are GMT -4. The time now is 21:51. |