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

Gather/scatter in boundary code

Register Blogs Community New Posts Updated Threads Search

Like Tree5Likes
  • 1 Post By ngj
  • 3 Post By ngj
  • 1 Post By bigphil

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   October 22, 2013, 08:40
Default Gather/scatter in boundary code
  #1
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
Dear all,

I have a implementation issue, which gives me a lot of problems. I need to perform a bit of manual exchange of parallel data in my code, because of two boundaries, which are physically connected, but they are not necessarily placed on the same processor. For that I am using the gatherList and scatterList code, and the following is a dummy example of it:

Code:
List<scalarField> test(Pstream::nProcs());
test[Pstream::myProcNo()].setSize(100, Pstream::myProcNo());

Pstream::gatherList<scalarField>(test);
Pstream::scatterList<scalarField>(test);

Pout << test << endl;
If I place this piece of code in a solver, then I get the expected output, namely:

Code:
[1] 
[1] 2
[1] (
[1] 100{0}
[1] 100{1}
[1] )
[1] 
[0] 
[0] 2
[0] (
[0] 100{0}
[0] 100{1}
[0] )
[0]
But if I place the exact same code inside a boundary condition, where I need to exchange the information between the processors for my boundary conditions, then I receive given the following error:

Code:
[0] 
[0] 
[0] --> FOAM FATAL IO ERROR: 
[0] error in IOstream "IOstream" for operation operator>>(Istream&, List<T>&) : reading first token
[0] 
[0] file: IOstream at line 0.
[0] 
[0]     From function IOstream::fatalCheck(const char*) const
[0]     in file db/IOstreams/IOstreams/IOstream.C at line 109.
[0] 
[0]
I have tried leaving either gatherList or scatterList out of the code, but the result is the same.

It should be said that irrespectively of where I use this piece of code, it compiles.

Any help on this problem is greatly appreciated.

Kind regards,

Niels
blue8803 likes this.
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote

 


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
Low Mixing time Problem Mavier CFX 5 April 29, 2013 00:00
domain imbalance for enrgy equation happy CFX 14 September 6, 2012 01:54
inlet velocity boundary condition murali CFX 5 August 3, 2012 08:56
CFX13 Post Periodic interface EtaEta CFX 7 December 8, 2011 17:15
Boundary conditions? Tom Main CFD Forum 0 November 5, 2002 01:54


All times are GMT -4. The time now is 08:59.