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

This commit is contained in:
sjplimp
2012-06-06 22:47:51 +00:00
parent f46eb9dedb
commit ef9e700545
1408 changed files with 58053 additions and 57983 deletions

View File

@ -5,7 +5,7 @@
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
@ -49,7 +49,7 @@ AtomVecAngle::AtomVecAngle(LAMMPS *lmp, int narg, char **arg) :
/* ----------------------------------------------------------------------
grow atom arrays
n = 0 grows arrays by DELTA
n > 0 allocates arrays to size n
n > 0 allocates arrays to size n
------------------------------------------------------------------------- */
void AtomVecAngle::grow(int n)
@ -69,28 +69,28 @@ void AtomVecAngle::grow(int n)
f = memory->grow(atom->f,nmax*comm->nthreads,3,"atom:f");
molecule = memory->grow(atom->molecule,nmax,"atom:molecule");
nspecial = memory->grow(atom->nspecial,nmax,3,"atom:nspecial");
special = memory->grow(atom->special,nmax,atom->maxspecial,"atom:special");
num_bond = memory->grow(atom->num_bond,nmax,"atom:num_bond");
bond_type = memory->grow(atom->bond_type,nmax,atom->bond_per_atom,
"atom:bond_type");
"atom:bond_type");
bond_atom = memory->grow(atom->bond_atom,nmax,atom->bond_per_atom,
"atom:bond_atom");
"atom:bond_atom");
num_angle = memory->grow(atom->num_angle,nmax,"atom:num_angle");
angle_type = memory->grow(atom->angle_type,nmax,atom->angle_per_atom,
"atom:angle_type");
"atom:angle_type");
angle_atom1 = memory->grow(atom->angle_atom1,nmax,atom->angle_per_atom,
"atom:angle_atom1");
"atom:angle_atom1");
angle_atom2 = memory->grow(atom->angle_atom2,nmax,atom->angle_per_atom,
"atom:angle_atom2");
"atom:angle_atom2");
angle_atom3 = memory->grow(atom->angle_atom3,nmax,atom->angle_per_atom,
"atom:angle_atom3");
"atom:angle_atom3");
if (atom->nextra_grow)
for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
modify->fix[atom->extra_grow[iextra]]->grow_arrays(nmax);
}
@ -153,14 +153,14 @@ void AtomVecAngle::copy(int i, int j, int delflag)
for (k = 0; k < nspecial[j][2]; k++) special[j][k] = special[i][k];
if (atom->nextra_grow)
for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
modify->fix[atom->extra_grow[iextra]]->copy_arrays(i,j);
}
/* ---------------------------------------------------------------------- */
int AtomVecAngle::pack_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
int pbc_flag, int *pbc)
{
int i,j,m;
double dx,dy,dz;
@ -196,7 +196,7 @@ int AtomVecAngle::pack_comm(int n, int *list, double *buf,
/* ---------------------------------------------------------------------- */
int AtomVecAngle::pack_comm_vel(int n, int *list, double *buf,
int pbc_flag, int *pbc)
int pbc_flag, int *pbc)
{
int i,j,m;
double dx,dy,dz,dvx,dvy,dvz;
@ -224,32 +224,32 @@ int AtomVecAngle::pack_comm_vel(int n, int *list, double *buf,
}
if (!deform_vremap) {
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = x[j][0] + dx;
buf[m++] = x[j][1] + dy;
buf[m++] = x[j][2] + dz;
buf[m++] = v[j][0];
buf[m++] = v[j][1];
buf[m++] = v[j][2];
j = list[i];
buf[m++] = x[j][0] + dx;
buf[m++] = x[j][1] + dy;
buf[m++] = x[j][2] + dz;
buf[m++] = v[j][0];
buf[m++] = v[j][1];
buf[m++] = v[j][2];
}
} else {
dvx = pbc[0]*h_rate[0] + pbc[5]*h_rate[5] + pbc[4]*h_rate[4];
dvy = pbc[1]*h_rate[1] + pbc[3]*h_rate[3];
dvz = pbc[2]*h_rate[2];
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = x[j][0] + dx;
buf[m++] = x[j][1] + dy;
buf[m++] = x[j][2] + dz;
if (mask[i] & deform_groupbit) {
buf[m++] = v[j][0] + dvx;
buf[m++] = v[j][1] + dvy;
buf[m++] = v[j][2] + dvz;
} else {
buf[m++] = v[j][0];
buf[m++] = v[j][1];
buf[m++] = v[j][2];
}
j = list[i];
buf[m++] = x[j][0] + dx;
buf[m++] = x[j][1] + dy;
buf[m++] = x[j][2] + dz;
if (mask[i] & deform_groupbit) {
buf[m++] = v[j][0] + dvx;
buf[m++] = v[j][1] + dvy;
buf[m++] = v[j][2] + dvz;
} else {
buf[m++] = v[j][0];
buf[m++] = v[j][1];
buf[m++] = v[j][2];
}
}
}
}
@ -323,7 +323,7 @@ void AtomVecAngle::unpack_reverse(int n, int *list, double *buf)
/* ---------------------------------------------------------------------- */
int AtomVecAngle::pack_border(int n, int *list, double *buf,
int pbc_flag, int *pbc)
int pbc_flag, int *pbc)
{
int i,j,m;
double dx,dy,dz;
@ -367,7 +367,7 @@ int AtomVecAngle::pack_border(int n, int *list, double *buf,
/* ---------------------------------------------------------------------- */
int AtomVecAngle::pack_border_vel(int n, int *list, double *buf,
int pbc_flag, int *pbc)
int pbc_flag, int *pbc)
{
int i,j,m;
double dx,dy,dz,dvx,dvy,dvz;
@ -399,40 +399,40 @@ int AtomVecAngle::pack_border_vel(int n, int *list, double *buf,
}
if (!deform_vremap) {
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = x[j][0] + dx;
buf[m++] = x[j][1] + dy;
buf[m++] = x[j][2] + dz;
buf[m++] = tag[j];
buf[m++] = type[j];
buf[m++] = mask[j];
buf[m++] = molecule[j];
buf[m++] = v[j][0];
buf[m++] = v[j][1];
buf[m++] = v[j][2];
j = list[i];
buf[m++] = x[j][0] + dx;
buf[m++] = x[j][1] + dy;
buf[m++] = x[j][2] + dz;
buf[m++] = tag[j];
buf[m++] = type[j];
buf[m++] = mask[j];
buf[m++] = molecule[j];
buf[m++] = v[j][0];
buf[m++] = v[j][1];
buf[m++] = v[j][2];
}
} else {
dvx = pbc[0]*h_rate[0] + pbc[5]*h_rate[5] + pbc[4]*h_rate[4];
dvy = pbc[1]*h_rate[1] + pbc[3]*h_rate[3];
dvz = pbc[2]*h_rate[2];
for (i = 0; i < n; i++) {
j = list[i];
buf[m++] = x[j][0] + dx;
buf[m++] = x[j][1] + dy;
buf[m++] = x[j][2] + dz;
buf[m++] = tag[j];
buf[m++] = type[j];
buf[m++] = mask[j];
buf[m++] = molecule[j];
if (mask[i] & deform_groupbit) {
buf[m++] = v[j][0] + dvx;
buf[m++] = v[j][1] + dvy;
buf[m++] = v[j][2] + dvz;
} else {
buf[m++] = v[j][0];
buf[m++] = v[j][1];
buf[m++] = v[j][2];
}
j = list[i];
buf[m++] = x[j][0] + dx;
buf[m++] = x[j][1] + dy;
buf[m++] = x[j][2] + dz;
buf[m++] = tag[j];
buf[m++] = type[j];
buf[m++] = mask[j];
buf[m++] = molecule[j];
if (mask[i] & deform_groupbit) {
buf[m++] = v[j][0] + dvx;
buf[m++] = v[j][1] + dvy;
buf[m++] = v[j][2] + dvz;
} else {
buf[m++] = v[j][0];
buf[m++] = v[j][1];
buf[m++] = v[j][2];
}
}
}
}
@ -511,7 +511,7 @@ int AtomVecAngle::unpack_border_hybrid(int n, int first, double *buf)
/* ----------------------------------------------------------------------
pack data for atom I for sending to another proc
xyz must be 1st 3 values, so comm::exchange() can test on them
xyz must be 1st 3 values, so comm::exchange() can test on them
------------------------------------------------------------------------- */
int AtomVecAngle::pack_exchange(int i, double *buf)
@ -552,7 +552,7 @@ int AtomVecAngle::pack_exchange(int i, double *buf)
for (k = 0; k < nspecial[i][2]; k++) buf[m++] = special[i][k];
if (atom->nextra_grow)
for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
m += modify->fix[atom->extra_grow[iextra]]->pack_exchange(i,&buf[m]);
buf[0] = m;
@ -603,9 +603,9 @@ int AtomVecAngle::unpack_exchange(double *buf)
special[nlocal][k] = static_cast<int> (buf[m++]);
if (atom->nextra_grow)
for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
m += modify->fix[atom->extra_grow[iextra]]->
unpack_exchange(nlocal,&buf[m]);
unpack_exchange(nlocal,&buf[m]);
atom->nlocal++;
return m;
@ -626,9 +626,9 @@ int AtomVecAngle::size_restart()
n += 14 + 2*num_bond[i] + 4*num_angle[i];
if (atom->nextra_restart)
for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
for (i = 0; i < nlocal; i++)
n += modify->fix[atom->extra_restart[iextra]]->size_restart(i);
n += modify->fix[atom->extra_restart[iextra]]->size_restart(i);
return n;
}
@ -636,7 +636,7 @@ int AtomVecAngle::size_restart()
/* ----------------------------------------------------------------------
pack atom I's data for restart file including extra quantities
xyz must be 1st 3 values, so that read_restart can test on them
molecular types may be negative, but write as positive
molecular types may be negative, but write as positive
------------------------------------------------------------------------- */
int AtomVecAngle::pack_restart(int i, double *buf)
@ -656,7 +656,7 @@ int AtomVecAngle::pack_restart(int i, double *buf)
buf[m++] = v[i][2];
buf[m++] = molecule[i];
buf[m++] = num_bond[i];
for (k = 0; k < num_bond[i]; k++) {
buf[m++] = MAX(bond_type[i][k],-bond_type[i][k]);
@ -672,7 +672,7 @@ int AtomVecAngle::pack_restart(int i, double *buf)
}
if (atom->nextra_restart)
for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
m += modify->fix[atom->extra_restart[iextra]]->pack_restart(i,&buf[m]);
buf[0] = m;
@ -707,7 +707,7 @@ int AtomVecAngle::unpack_restart(double *buf)
v[nlocal][2] = buf[m++];
molecule[nlocal] = static_cast<int> (buf[m++]);
num_bond[nlocal] = static_cast<int> (buf[m++]);
for (k = 0; k < num_bond[nlocal]; k++) {
bond_type[nlocal][k] = static_cast<int> (buf[m++]);
@ -813,7 +813,7 @@ int AtomVecAngle::data_atom_hybrid(int nlocal, char **values)
}
/* ----------------------------------------------------------------------
return # of bytes of allocated memory
return # of bytes of allocated memory
------------------------------------------------------------------------- */
bigint AtomVecAngle::memory_usage()
@ -830,23 +830,23 @@ bigint AtomVecAngle::memory_usage()
if (atom->memcheck("molecule")) bytes += memory->usage(molecule,nmax);
if (atom->memcheck("nspecial")) bytes += memory->usage(nspecial,nmax,3);
if (atom->memcheck("special"))
if (atom->memcheck("special"))
bytes += memory->usage(special,nmax,atom->maxspecial);
if (atom->memcheck("num_bond")) bytes += memory->usage(num_bond,nmax);
if (atom->memcheck("bond_type"))
if (atom->memcheck("bond_type"))
bytes += memory->usage(bond_type,nmax,atom->bond_per_atom);
if (atom->memcheck("bond_atom"))
if (atom->memcheck("bond_atom"))
bytes += memory->usage(bond_atom,nmax,atom->bond_per_atom);
if (atom->memcheck("num_angle")) bytes += memory->usage(num_angle,nmax);
if (atom->memcheck("angle_type"))
if (atom->memcheck("angle_type"))
bytes += memory->usage(angle_type,nmax,atom->angle_per_atom);
if (atom->memcheck("angle_atom1"))
if (atom->memcheck("angle_atom1"))
bytes += memory->usage(angle_atom1,nmax,atom->angle_per_atom);
if (atom->memcheck("angle_atom2"))
if (atom->memcheck("angle_atom2"))
bytes += memory->usage(angle_atom2,nmax,atom->angle_per_atom);
if (atom->memcheck("angle_atom3"))
if (atom->memcheck("angle_atom3"))
bytes += memory->usage(angle_atom3,nmax,atom->angle_per_atom);
return bytes;