26template <
class T,
unsigned Dim,
class Mesh,
class CachingPolicy >
36template <
class T,
unsigned Dim,
class Mesh,
class CachingPolicy >
47template <
class T,
unsigned Dim,
class Mesh,
class CachingPolicy >
58template <
class T,
unsigned Dim,
class Mesh,
class CachingPolicy >
67template <
class T,
unsigned Dim,
class Mesh,
class CachingPolicy >
76 RLayout.checkin(*
this);
81 for (i = 0; i <
Dim; ++i)
82 SwapNodeList[i] =
new bool[N];
83 PutList =
new std::vector<size_t>[N];
87 NodeCount =
new size_t[N];
88 EmptyNode =
new bool[N];
89 for (i = 0; i < N; ++i)
99template <
class T,
unsigned Dim,
class Mesh,
class CachingPolicy >
105 delete [] SwapMsgList;
106 for (
unsigned int i=0; i <
Dim; i++)
107 delete [] (SwapNodeList[i]);
111 RLayout.checkout(*
this);
120template <
class T,
unsigned Dim,
class Mesh,
class CachingPolicy>
128 size_t LocalNum = PData.getLocalNum();
129 size_t DestroyNum = PData.getDestroyNum();
138 PData.performDestroy();
139 LocalNum -= DestroyNum;
143 if ( ! RLayout.initialized())
144 rebuild_layout(LocalNum,PData);
148 this->apply_bconds(LocalNum, PData.R, this->getBConds(), RLayout.getDomain());
151 this->updateCacheInformation(*
this);
165 LocalNum = new_swap_particles(LocalNum, PData);
167 LocalNum = new_swap_particles(LocalNum, PData, *canSwap);
173 TotalNum = NodeCount[myN] = LocalNum;
195 recmsg->
get(NodeCount);
196 recmsg->
get(TotalNum);
202 int notrecvd = N - 1;
209 size_t remNodeCount = 0;
210 recmsg->
get(remNodeCount);
215 TotalNum += remNodeCount;
216 NodeCount[node] = remNodeCount;
221 msg->
put(NodeCount, NodeCount + N);
228 PData.setTotalNum(TotalNum);
229 PData.setLocalNum(LocalNum);
232 this->updateGhostParticles(PData, *
this);
244template <
class T,
unsigned Dim,
class Mesh,
class CachingPolicy >
248 out <<
"ParticleSpatialLayout, with particle distribution:\n ";
250 out <<
"Number of particles " << L.
getNodeCount(i) <<
" ";
251 out <<
"\nSpatialLayout decomposition = " << L.
getLayout();
258template <
class T,
unsigned Dim,
class Mesh,
class CachingPolicy >
262 o <<
"PSpatial: distrib = ";
264 o << NodeCount[i] <<
" ";
272template <
class T,
unsigned Dim,
class Mesh,
class CachingPolicy >
281template <
class T,
unsigned Dim,
class Mesh,
class CachingPolicy >
#define P_SPATIAL_RETURN_TAG
#define P_SPATIAL_LAYOUT_TAG
std::ostream & operator<<(std::ostream &out, const ParticleSpatialLayout< T, Dim, Mesh, CachingPolicy > &L)
bool send(Message *, int node, int tag, bool delmsg=true)
virtual int broadcast_others(Message *, int, bool delmsg=true)
Message * receive_block(int &node, int &tag)
Message & put(const T &val)
Message & get(const T &cval)
int next_tag(int t, int s=1000)
int getNodeCount(unsigned i) const
virtual void Repartition(UserList *)
RegionLayout< T, Dim, Mesh > & getLayout()
virtual void notifyUserOfDelete(UserList *)
void update(IpplParticleBase< ParticleSpatialLayout< T, Dim, Mesh, CachingPolicy > > &p, const ParticleAttrib< char > *canSwap=0)
void printDebug(Inform &)
static Communicate * Comm