ESyS-Particle
4.0.1
|
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 //-- STL includes -- 00014 #include <vector> 00015 #include <utility> 00016 00017 using std::vector; 00018 using std::pair; 00019 00020 // -- IO includes -- 00021 #include <iostream> 00022 00023 using std::cout; 00024 using std::endl; 00025 00035 template <typename T> 00036 VectorParticleFieldSlaveTagged<T>::VectorParticleFieldSlaveTagged(TML_Comm* comm,ParallelParticleArray<T>* ppa,typename T::VectorFieldFunction rdf,int tag,int mask):VectorParticleFieldSlave<T>(comm,ppa,rdf) 00037 { 00038 m_tag=tag; 00039 m_mask=mask; 00040 } 00041 00042 template <typename T> 00043 void VectorParticleFieldSlaveTagged<T>::sendData() 00044 { 00045 vector<pair<int,Vec3> > data_vec; 00046 vector<pair<int,Vec3> > pos_vec; 00047 00048 data_vec = 00049 this->m_ppa->forAllInnerTaggedParticlesGetIndexed( 00050 this->m_rdf, 00051 m_tag, 00052 m_mask 00053 ); 00054 pos_vec = 00055 this->m_ppa->forAllInnerTaggedParticlesGetIndexed( 00056 typename T::VectorFieldFunction(&T::getPos), 00057 m_tag, 00058 m_mask 00059 ); 00060 00061 // send data to master 00062 this->m_comm->send_gather(data_vec,0); 00063 this->m_comm->send_gather(pos_vec,0); 00064 }