git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@9566 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp
2013-03-04 23:09:29 +00:00
parent fe7a7c25f1
commit a5c6bfb1c5
94 changed files with 482 additions and 825 deletions

View File

@ -72,8 +72,8 @@ AtomVecBody::~AtomVecBody()
{
int nall = nlocal_bonus + nghost_bonus;
for (int i = 0; i < nall; i++) {
memory->destroy(bonus[i].ivalue);
memory->destroy(bonus[i].dvalue);
icp->put(bonus[i].iindex);
dcp->put(bonus[i].dindex);
}
memory->sfree(bonus);
@ -105,6 +105,8 @@ void AtomVecBody::settings(int narg, char **arg)
else error->all(FLERR,"Invalid body style");
bptr->avec = this;
icp = bptr->icp;
dcp = bptr->dcp;
// max size of forward/border comm
// 7,16 are packed in pack_comm/pack_border
@ -212,8 +214,8 @@ void AtomVecBody::copy(int i, int j, int delflag)
// if deleting atom J via delflag and J has bonus data, then delete it
if (delflag && body[j] >= 0) {
memory->destroy(bonus[body[j]].ivalue);
memory->destroy(bonus[body[j]].dvalue);
icp->put(bonus[body[j]].iindex);
dcp->put(bonus[body[j]].dindex);
copy_bonus(nlocal_bonus-1,body[j]);
nlocal_bonus--;
}
@ -249,8 +251,8 @@ void AtomVecBody::clear_bonus()
{
int nall = nlocal_bonus + nghost_bonus;
for (int i = nlocal_bonus; i < nall; i++) {
memory->destroy(bonus[i].ivalue);
memory->destroy(bonus[i].dvalue);
icp->put(bonus[i].iindex);
dcp->put(bonus[i].dindex);
}
nghost_bonus = 0;
}
@ -841,8 +843,8 @@ void AtomVecBody::unpack_border(int n, int first, double *buf)
inertia[2] = buf[m++];
bonus[j].ninteger = static_cast<int> (buf[m++]);
bonus[j].ndouble = static_cast<int> (buf[m++]);
memory->create(bonus[j].ivalue,bonus[j].ninteger,"body:ivalue");
memory->create(bonus[j].dvalue,bonus[j].ndouble,"body:dvalue");
bonus[j].ivalue = icp->get(bonus[j].ninteger,bonus[j].iindex);
bonus[j].dvalue = dcp->get(bonus[j].ndouble,bonus[j].dindex);
m += bptr->unpack_border_body(&bonus[j],&buf[m]);
bonus[j].ilocal = i;
body[i] = j;
@ -884,8 +886,8 @@ void AtomVecBody::unpack_border_vel(int n, int first, double *buf)
inertia[2] = buf[m++];
bonus[j].ninteger = static_cast<int> (buf[m++]);
bonus[j].ndouble = static_cast<int> (buf[m++]);
memory->create(bonus[j].ivalue,bonus[j].ninteger,"body:ivalue");
memory->create(bonus[j].dvalue,bonus[j].ndouble,"body:dvalue");
bonus[j].ivalue = icp->get(bonus[j].ninteger,bonus[j].iindex);
bonus[j].dvalue = dcp->get(bonus[j].ndouble,bonus[j].dindex);
m += bptr->unpack_border_body(&bonus[j],&buf[m]);
bonus[j].ilocal = i;
body[i] = j;
@ -926,8 +928,8 @@ int AtomVecBody::unpack_border_hybrid(int n, int first, double *buf)
inertia[2] = buf[m++];
bonus[j].ninteger = static_cast<int> (buf[m++]);
bonus[j].ndouble = static_cast<int> (buf[m++]);
memory->create(bonus[j].ivalue,bonus[j].ninteger,"body:ivalue");
memory->create(bonus[j].dvalue,bonus[j].ndouble,"body:dvalue");
bonus[j].ivalue = icp->get(bonus[j].ninteger,bonus[j].iindex);
bonus[j].dvalue = dcp->get(bonus[j].ndouble,bonus[j].dindex);
m += bptr->unpack_border_body(&bonus[j],&buf[m]);
bonus[j].ilocal = i;
body[i] = j;
@ -1030,10 +1032,10 @@ int AtomVecBody::unpack_exchange(double *buf)
inertia[2] = buf[m++];
bonus[nlocal_bonus].ninteger = static_cast<int> (buf[m++]);
bonus[nlocal_bonus].ndouble = static_cast<int> (buf[m++]);
memory->create(bonus[nlocal_bonus].ivalue,bonus[nlocal_bonus].ninteger,
"body:ivalue");
memory->create(bonus[nlocal_bonus].dvalue,bonus[nlocal_bonus].ndouble,
"body:dvalue");
bonus[nlocal_bonus].ivalue = icp->get(bonus[nlocal_bonus].ninteger,
bonus[nlocal_bonus].iindex);
bonus[nlocal_bonus].dvalue = dcp->get(bonus[nlocal_bonus].ndouble,
bonus[nlocal_bonus].dindex);
memcpy(bonus[nlocal_bonus].ivalue,&buf[m],
bonus[nlocal_bonus].ninteger*sizeof(int));
if (intdoubleratio == 1) m += bonus[nlocal_bonus].ninteger;
@ -1182,10 +1184,10 @@ int AtomVecBody::unpack_restart(double *buf)
inertia[2] = buf[m++];
bonus[nlocal_bonus].ninteger = static_cast<int> (buf[m++]);
bonus[nlocal_bonus].ndouble = static_cast<int> (buf[m++]);
memory->create(bonus[nlocal_bonus].ivalue,bonus[nlocal_bonus].ninteger,
"body:ivalue");
memory->create(bonus[nlocal_bonus].dvalue,bonus[nlocal_bonus].ndouble,
"body:dvalue");
bonus[nlocal_bonus].ivalue = icp->get(bonus[nlocal_bonus].ninteger,
bonus[nlocal_bonus].iindex);
bonus[nlocal_bonus].dvalue = dcp->get(bonus[nlocal_bonus].ndouble,
bonus[nlocal_bonus].dindex);
memcpy(bonus[nlocal_bonus].ivalue,&buf[m],
bonus[nlocal_bonus].ninteger*sizeof(int));
if (intdoubleratio == 1) m += bonus[nlocal_bonus].ninteger;
@ -1399,6 +1401,7 @@ bigint AtomVecBody::memory_usage()
if (atom->memcheck("body")) bytes += memory->usage(body,nmax);
bytes += nmax_bonus*sizeof(Bonus);
bytes += icp->size + dcp->size;
int nall = nlocal_bonus + nghost_bonus;
for (int i = 0; i < nall; i++) {