ESyS-Particle  4.0.1
VectorWallFieldSlave.hpp
00001 
00002 //                                                         //
00003 // Copyright (c) 2003-2011 by The University of Queensland //
00004 // Earth Systems Science Computational Centre (ESSCC)      //
00005 // http://www.uq.edu.au/esscc                              //
00006 //                                                         //
00007 // Primary Business: Brisbane, Queensland, Australia       //
00008 // Licensed under the Open Software License version 3.0    //
00009 // http://www.opensource.org/licenses/osl-3.0.php          //
00010 //                                                         //
00012 
00013 // --- project includes ---
00014 #include "Foundation/console.h"
00015 
00023 template <typename WallType>
00024 VectorWallFieldSlave<WallType>::VectorWallFieldSlave(TML_Comm* comm,typename WallType::VectorFieldFunction rdf) 
00025   : AWallFieldSlave(comm)
00026 {
00027   console.XDebug() << "VectorWallFieldSlave::VectorWallFieldSlave()\n";
00028   m_rdf=rdf;
00029 }
00030 
00034 template <typename WallType>
00035 void VectorWallFieldSlave<WallType>::sendData()
00036 {
00037   console.XDebug() << "VectorWallFieldSlave::sendData()\n";
00038   vector<pair<int,Vec3> > data; 
00039   // get data from wall
00040   int cnt=0;
00041   for(typename vector<WallType*>::const_iterator iter=m_wall.begin();
00042       iter!=m_wall.end();
00043       iter++){
00044     data.push_back(make_pair(cnt,((*iter)->*m_rdf)()));
00045     cnt++;
00046   }
00047   // send it to master
00048   m_comm->send_gather(data,0);
00049   console.XDebug() << " end VectorWallFieldSlave::sendData()\n";
00050 }