|
[Sponsors] |
January 8, 2013, 08:50 |
.boundary() in parallel
|
#1 |
Member
Nicklas Linder
Join Date: Jul 2012
Location: Germany
Posts: 35
Rep Power: 14 |
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) { if (mesh.boundary()[patchI].type() == "wall") { wallPatchID = patchI; Info << "U.boundaryField()[wallPatchID].size(): " << U.boundaryField()[wallPatchID].size() << endl; ... Code:
U.boundaryField()[wallPatchID].size(): 2500 Code:
U.boundaryField()[wallPatchID].size(): 0 Thanks in advance! Nicklas |
|
January 11, 2013, 09:18 |
|
#2 |
Member
Nicklas Linder
Join Date: Jul 2012
Location: Germany
Posts: 35
Rep Power: 14 |
After playing around with the decomposition methods, I looks as if the code only "runs" on the processor0. Anyone knows what to do?
Thanks |
|
January 11, 2013, 09:26 |
|
#3 |
Senior Member
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 22 |
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 |
|
January 11, 2013, 09:33 |
|
#4 |
Member
Nicklas Linder
Join Date: Jul 2012
Location: Germany
Posts: 35
Rep Power: 14 |
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 |
|
January 11, 2013, 09:36 |
|
#5 |
Senior Member
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 22 |
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 |
|
January 11, 2013, 09:37 |
|
#6 |
Member
Nicklas Linder
Join Date: Jul 2012
Location: Germany
Posts: 35
Rep Power: 14 |
Allright, I'll try that, thanks for your help!
|
|
January 11, 2013, 09:59 |
|
#7 |
Member
Nicklas Linder
Join Date: Jul 2012
Location: Germany
Posts: 35
Rep Power: 14 |
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 |
|
January 11, 2013, 10:25 |
|
#8 |
Senior Member
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 22 |
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 |
|
January 11, 2013, 11:00 |
|
#9 |
Member
Nicklas Linder
Join Date: Jul 2012
Location: Germany
Posts: 35
Rep Power: 14 |
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 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Script to Run Parallel Jobs in Rocks Cluster | asaha | OpenFOAM Running, Solving & CFD | 12 | July 4, 2012 23:51 |
CFX parallel multi-node jobs fail w/ SLURM on Ubuntu 10.04 | danieru | CFX | 0 | February 17, 2012 07:20 |
parallel performance on BX900 | uzawa | OpenFOAM Installation | 3 | September 5, 2011 16:52 |
IcoFoam parallel woes | msrinath80 | OpenFOAM Running, Solving & CFD | 9 | July 22, 2007 03:58 |
Parallel Computing Classes at San Diego Supercomputer Center Jan. 20-22 | Amitava Majumdar | Main CFD Forum | 0 | January 5, 1999 13:00 |