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 00014 #include <Foundation/quadtuple.h> 00015 00023 template <typename T> 00024 VectorInteractionFieldSlave<T>::VectorInteractionFieldSlave(TML_Comm* comm,TParallelInteractionStorage<T>* pis,typename T::VectorFieldFunction rdf) 00025 :InteractionFieldSlave<T>(comm,pis) 00026 { 00027 m_rdf=rdf; 00028 } 00029 00033 template <typename T> 00034 void VectorInteractionFieldSlave<T>::SendDataFull() 00035 { 00036 vector<pair<Vec3,Vec3> > data; 00037 00038 data=this->m_pis->forAllInnerInteractionsGetWithPos(m_rdf); 00039 00040 // send data to master 00041 this->m_comm->send_gather(data,0); 00042 } 00043 00047 template <typename T> 00048 void VectorInteractionFieldSlave<T>::SendDataFull2() 00049 { 00050 vector<pair<esys::lsm::quintuple<Vec3,double,Vec3,double,Vec3>,Vec3> > data; 00051 00052 data=this->m_pis->forAllInnerInteractionsGetRaw2(m_rdf); 00053 00054 // send data to master 00055 this->m_comm->send_gather(data,0); 00056 } 00057 00061 template <typename T> 00062 void VectorInteractionFieldSlave<T>::SendDataWithID() 00063 { 00064 vector<pair<esys::lsm::triplet<int,int,Vec3>, Vec3> > data; 00065 00066 // debug output 00067 console.XDebug() << "VectorInteractionFieldSlave<T>::SendDataWithID()\n"; 00068 00069 data=this->m_pis->forAllInnerInteractionsGetDataWithID(m_rdf); 00070 00071 // debug output 00072 console.XDebug() << "sending " << data.size() << " data\n"; 00073 00074 // send data to master 00075 this->m_comm->send_gather(data,0); 00076 } 00077 00081 template <typename T> 00082 void VectorInteractionFieldSlave<T>::SendDataWithPosID() 00083 { 00084 vector<pair<esys::lsm::quintuple<int,int,Vec3,Vec3,Vec3>, Vec3> > data; 00085 00086 // debug output 00087 console.XDebug() << "VectorInteractionFieldSlave<T>::SendDataWithPosID()\n"; 00088 00089 data=this->m_pis->forAllInnerInteractionsGetDataWithPosID(m_rdf); 00090 00091 // debug output 00092 console.XDebug() << "sending " << data.size() << " data\n"; 00093 00094 // send data to master 00095 this->m_comm->send_gather(data,0); 00096 } 00097 00101 template <typename T> 00102 void VectorInteractionFieldSlave<T>::SendDataSum() 00103 { 00104 vector<Vec3> data_vec; 00105 00106 // get data from interactions 00107 this->m_pis->forAllInnerInteractionsGet(data_vec,m_rdf); 00108 00109 // sum data 00110 Vec3 sum=Vec3(0.0,0.0,0.0); 00111 for(vector<Vec3>::iterator iter=data_vec.begin(); 00112 iter!=data_vec.end(); 00113 iter++){ 00114 sum=sum+(*iter); 00115 } 00116 00117 vector<Vec3> sum_vec; 00118 sum_vec.push_back(sum); 00119 this->m_comm->send_gather(sum_vec,0); 00120 } 00121 00125 template <typename T> 00126 void VectorInteractionFieldSlave<T>::SendDataMax() 00127 {}