ESyS-Particle  2.3.2
VectorWallFieldSlave.hpp
Go to the documentation of this file.
1 
2 // //
3 // Copyright (c) 2003-2014 by The University of Queensland //
4 // Centre for Geoscience Computing //
5 // http://earth.uq.edu.au/centre-geoscience-computing //
6 // //
7 // Primary Business: Brisbane, Queensland, Australia //
8 // Licensed under the Open Software License version 3.0 //
9 // http://www.opensource.org/licenses/osl-3.0.php //
10 // //
12 
13 // --- project includes ---
14 #include "Foundation/console.h"
15 
23 template <typename WallType>
24 VectorWallFieldSlave<WallType>::VectorWallFieldSlave(TML_Comm* comm,typename WallType::VectorFieldFunction rdf)
25  : AWallFieldSlave(comm)
26 {
27  console.XDebug() << "VectorWallFieldSlave::VectorWallFieldSlave()\n";
28  m_rdf=rdf;
29 }
30 
34 template <typename WallType>
36 {
37  console.XDebug() << "VectorWallFieldSlave::sendData()\n";
38  vector<pair<int,Vec3> > data;
39  // get data from wall
40  int cnt=0;
41  for(typename vector<WallType*>::const_iterator iter=m_wall.begin();
42  iter!=m_wall.end();
43  iter++){
44  data.push_back(make_pair(cnt,((*iter)->*m_rdf)()));
45  cnt++;
46  }
47  // send it to master
48  m_comm->send_gather(data,0);
49  console.XDebug() << " end VectorWallFieldSlave::sendData()\n";
50 }