43 "No operator()(unsigned) for this element type!!");
54 "No operator()(unsigned,unsigned) for this element type!!");
65 "No operator()(unsigned,unsigned,unsigned) for this element type!!");
105 typename ParticleList_t::iterator putloc =
ParticleList.begin() + I;
115 while (getloc != endloc)
116 *putloc++ = *getloc++;
122 typename ParticleList_t::iterator loc =
ParticleList.begin() + I;
145 if (dlist.empty())
return;
146 typedef std::vector< std::pair<size_t,size_t> > dlist_t;
149 dlist_t::const_reverse_iterator rbeg, rend = dlist.rend();
151 typename ParticleList_t::iterator putloc, saveloc;
155 size_t I, M, numParts=0;
156 for (rbeg = dlist.rbegin(); rbeg != rend; ++rbeg) {
168 while (getloc != saveloc) {
169 *putloc++ = *getloc++;
179 for (
size_t m=0; m<M; ++m)
180 *putloc++ = *getloc++;
191 dlist_t::const_iterator dnext = dlist.begin(), dend = dlist.end();
192 size_t putIndex, getIndex, endIndex =
LocalSize;
193 putIndex = (*dnext).first;
194 getIndex = putIndex + (*dnext).second;
197 while (dnext != dend && getIndex == (*dnext).first) {
198 getIndex += (*dnext).second;
201 while (dnext != dend) {
203 ParticleList[putIndex++] = ParticleList[getIndex++];
205 while (dnext != dend && getIndex == (*dnext).first) {
206 getIndex += (*dnext).second;
211 while (getIndex < endIndex) {
213 ParticleList[putIndex++] = ParticleList[getIndex++];
217 ParticleList.erase(loc, ParticleList.begin()+LocalSize);
218 LocalSize -= ParticleList.begin()+LocalSize - loc;
221 attributeIsDirty_ =
true;
239 typename ParticleList_t::iterator currp =
ParticleList.begin() + I;
240 typename ParticleList_t::iterator endp = currp + M;
255 const std::vector<size_t>& putList)
258 std::vector<size_t>::size_type M = putList.size();
290 size_t currsize =
size();
383 static bool compare(
const T &,
const T &,
bool)
390#define PA_SORT_COMPARE_SCALAR(SCALAR) \
392struct PASortCompare<SCALAR> \
394 static bool compare(const SCALAR &a, const SCALAR &b, bool ascending) \
396 return (ascending ? (a < b) : (a > b)); \
430 SortList_t::size_type slsize = slist.size();
431 size_t mysize =
size();
432 if (slsize < mysize) {
434 slist.insert(slist.end(), mysize - slsize, (SortList_t::value_type) 0);
441 for (i=0; i < mysize; ++i)
448 int lastindx = (mysize - 1);
449 for (i=0; i < mysize; ++i) {
450 int currindx = firstindx;
453 for (j=(firstindx + 1); j <= lastindx; ++j) {
473 while (slist[firstindx] >= 0 && firstindx < lastindx)
475 while (slist[lastindx] >= 0 && firstindx < lastindx)
501 int i = 0, j = 0, k = -1, mysize =
size();
502 while ( i < mysize ) {
507 if ( i == k || slist[i] < 0 ) {
514 j = ( k > 0 ) ? k : slist[i];
521 std::iter_swap(ParticleList.begin() + i, ParticleList.begin() + j);
532 for (i=0; i < mysize; ++i) {
560template <
class FT,
unsigned Dim,
class M,
class C,
class PT,
class IntOp>
563 const IntOp& , FT val) {
574 for (ppiter = pp.
cbegin(); i < pp.
size(); ++i,++ppiter)
575 IntOp::scatter(val,f,*ppiter,mesh);
584template <
class FT,
unsigned Dim,
class M,
class C,
class PT,
585 class IntOp,
class CacheData>
600 for (ppiter = pp.
begin(); i < pp.
size(); ++i, ++ppiter, ++citer)
601 IntOp::scatter(val,f,*ppiter,mesh,*citer);
610template <
class FT,
unsigned Dim,
class M,
class C,
611 class IntOp,
class CacheData>
623 for (citer = cache.
begin(); citer != cend; ++citer)
624 IntOp::scatter(val,f,*citer);
void putMessage(Message &m, const T &t)
void getMessage_iter(Message &m, OutputIterator o)
void getMessage(Message &m, T &t)
void scatter(Field< FT, Dim, M, C > &f, const ParticleAttrib< Vektor< PT, Dim > > &pp, const IntOp &, FT val)
#define PA_SORT_COMPARE_SCALAR(SCALAR)
#define INCIPPLSTAT(stat)
Mesh_t & get_mesh() const
ParticleAttribIterator< T > iterator
ParticleAttribElem< T, 1U > operator()(unsigned)
virtual void printDebug(Inform &)
ParticleList_t ParticleList
ParticleAttribBase::SortList_t SortList_t
virtual void ghostCreate(size_t)
virtual void sort(SortList_t &slist)
virtual size_t ghostGetMessage(Message &, size_t)
virtual size_t putMessage(Message &, size_t, size_t)
virtual void destroy(size_t M, size_t I, bool optDestroy=true)
virtual size_t getMessage(Message &, size_t)
const_iterator cbegin() const
virtual size_t ghostDestroy(size_t, size_t)
virtual size_t ghostPutMessage(Message &, size_t, size_t)
virtual void create(size_t)
virtual void calcSortList(SortList_t &slist, bool ascending=true)
void setGuardCells(const T &) const
static bool compare(const T &, const T &, bool)