CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

.boundary() in parallel

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By MartinB

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 8, 2013, 07:50
Default .boundary() in parallel
  #1
Member
 
Nicklas Linder
Join Date: Jul 2012
Location: Germany
Posts: 35
Rep Power: 13
nlinder is on a distinguished road
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;
...
The output of the Info statement on a single core is correct:
Code:
U.boundaryField()[wallPatchID].size(): 2500
If I run it in parallel with two domains the output is
Code:
U.boundaryField()[wallPatchID].size(): 0
How can I make that work in parallel? What changes when I run this in parallel concerning the numbering of the boundary-patches?

Thanks in advance!
Nicklas
nlinder is offline   Reply With Quote

Old   January 11, 2013, 08:18
Default
  #2
Member
 
Nicklas Linder
Join Date: Jul 2012
Location: Germany
Posts: 35
Rep Power: 13
nlinder is on a distinguished road
After playing around with the decomposition methods, I looks as if the code only "runs" on the processor0. Anyone knows what to do?

Thanks
nlinder is offline   Reply With Quote

Old   January 11, 2013, 08:26
Default
  #3
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 21
MartinB will become famous soon enough
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
Loki Kerry likes this.
MartinB is offline   Reply With Quote

Old   January 11, 2013, 08:33
Default
  #4
Member
 
Nicklas Linder
Join Date: Jul 2012
Location: Germany
Posts: 35
Rep Power: 13
nlinder is on a distinguished road
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
nlinder is offline   Reply With Quote

Old   January 11, 2013, 08:36
Default
  #5
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 21
MartinB will become famous soon enough
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
MartinB is offline   Reply With Quote

Old   January 11, 2013, 08:37
Default
  #6
Member
 
Nicklas Linder
Join Date: Jul 2012
Location: Germany
Posts: 35
Rep Power: 13
nlinder is on a distinguished road
Allright, I'll try that, thanks for your help!
nlinder is offline   Reply With Quote

Old   January 11, 2013, 08:59
Default
  #7
Member
 
Nicklas Linder
Join Date: Jul 2012
Location: Germany
Posts: 35
Rep Power: 13
nlinder is on a distinguished road
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
nlinder is offline   Reply With Quote

Old   January 11, 2013, 09:25
Default
  #8
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 21
MartinB will become famous soon enough
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
MartinB is offline   Reply With Quote

Old   January 11, 2013, 10:00
Default
  #9
Member
 
Nicklas Linder
Join Date: Jul 2012
Location: Germany
Posts: 35
Rep Power: 13
nlinder is on a distinguished road
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
nlinder is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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 22:51
CFX parallel multi-node jobs fail w/ SLURM on Ubuntu 10.04 danieru CFX 0 February 17, 2012 06:20
parallel performance on BX900 uzawa OpenFOAM Installation 3 September 5, 2011 15:52
IcoFoam parallel woes msrinath80 OpenFOAM Running, Solving & CFD 9 July 22, 2007 02:58
Parallel Computing Classes at San Diego Supercomputer Center Jan. 20-22 Amitava Majumdar Main CFD Forum 0 January 5, 1999 12:00


All times are GMT -4. The time now is 03:47.