ESyS-Particle  2.3.2
VectorInteractionFieldSlave.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 
14 #include <Foundation/quadtuple.h>
15 
23 template <typename T>
25  :InteractionFieldSlave<T>(comm,pis)
26 {
27  m_rdf=rdf;
28 }
29 
33 template <typename T>
35 {
36  vector<pair<Vec3,Vec3> > data;
37 
38  data=this->m_pis->forAllInnerInteractionsGetWithPos(m_rdf);
39 
40  // send data to master
41  this->m_comm->send_gather(data,0);
42 }
43 
47 template <typename T>
49 {
50  vector<pair<esys::lsm::quintuple<Vec3,double,Vec3,double,Vec3>,Vec3> > data;
51 
52  data=this->m_pis->forAllInnerInteractionsGetRaw2(m_rdf);
53 
54  // send data to master
55  this->m_comm->send_gather(data,0);
56 }
57 
61 template <typename T>
63 {
64  vector<pair<esys::lsm::triplet<int,int,Vec3>, Vec3> > data;
65 
66  // debug output
67  console.XDebug() << "VectorInteractionFieldSlave<T>::SendDataWithID()\n";
68 
69  data=this->m_pis->forAllInnerInteractionsGetDataWithID(m_rdf);
70 
71  // debug output
72  console.XDebug() << "sending " << data.size() << " data\n";
73 
74  // send data to master
75  this->m_comm->send_gather(data,0);
76 }
77 
81 template <typename T>
83 {
84  vector<pair<esys::lsm::quintuple<int,int,Vec3,Vec3,Vec3>, Vec3> > data;
85 
86  // debug output
87  console.XDebug() << "VectorInteractionFieldSlave<T>::SendDataWithPosID()\n";
88 
89  data=this->m_pis->forAllInnerInteractionsGetDataWithPosID(m_rdf);
90 
91  // debug output
92  console.XDebug() << "sending " << data.size() << " data\n";
93 
94  // send data to master
95  this->m_comm->send_gather(data,0);
96 }
97 
101 template <typename T>
103 {
104  vector<Vec3> data_vec;
105 
106  // get data from interactions
107  this->m_pis->forAllInnerInteractionsGet(data_vec,m_rdf);
108 
109  // sum data
110  Vec3 sum=Vec3(0.0,0.0,0.0);
111  for(vector<Vec3>::iterator iter=data_vec.begin();
112  iter!=data_vec.end();
113  iter++){
114  sum=sum+(*iter);
115  }
116 
117  vector<Vec3> sum_vec;
118  sum_vec.push_back(sum);
119  this->m_comm->send_gather(sum_vec,0);
120 }
121 
125 template <typename T>
127 {}