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

.boundary() in parallel

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   January 8, 2013, 08:50
Default .boundary() in parallel
  #1
Member
 
Nicklas Linder
Join Date: Jul 2012
Location: Germany
Posts: 33
Rep Power: 5
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, 09:18
Default
  #2
Member
 
Nicklas Linder
Join Date: Jul 2012
Location: Germany
Posts: 33
Rep Power: 5
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, 09:26
Default
  #3
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 252
Rep Power: 11
MartinB is on a distinguished road
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
MartinB is offline   Reply With Quote

Old   January 11, 2013, 09:33
Default
  #4
Member
 
Nicklas Linder
Join Date: Jul 2012
Location: Germany
Posts: 33
Rep Power: 5
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, 09:36
Default
  #5
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 252
Rep Power: 11
MartinB is on a distinguished road
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, 09:37
Default
  #6
Member
 
Nicklas Linder
Join Date: Jul 2012
Location: Germany
Posts: 33
Rep Power: 5
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, 09:59
Default
  #7
Member
 
Nicklas Linder
Join Date: Jul 2012
Location: Germany
Posts: 33
Rep Power: 5
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, 10:25
Default
  #8
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 252
Rep Power: 11
MartinB is on a distinguished road
May be you can find the answer in this code snippet, where slave processors are sending data to the master processor with Pstream:
Improve simpleFoam convergence

Martin
MartinB is offline   Reply With Quote

Old   January 11, 2013, 11:00
Default
  #9
Member
 
Nicklas Linder
Join Date: Jul 2012
Location: Germany
Posts: 33
Rep Power: 5
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

Thread Tools
Display Modes

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 On
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 07:20
parallel performance on BX900 uzawa OpenFOAM Installation on Windows, Mac and other Unsupported Platforms 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 13:00


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