git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@371 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -14,7 +14,6 @@
|
||||
#include "stdlib.h"
|
||||
#include "atom_vec_charge.h"
|
||||
#include "atom.h"
|
||||
#include "domain.h"
|
||||
#include "modify.h"
|
||||
#include "fix.h"
|
||||
#include "memory.h"
|
||||
@ -134,12 +133,13 @@ void AtomVecCharge::copy(int i, int j)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
int AtomVecCharge::pack_comm(int n, int *list, double *buf, int *pbc_flags)
|
||||
int AtomVecCharge::pack_comm(int n, int *list, double *buf,
|
||||
int pbc_flag, double *pbc_dist)
|
||||
{
|
||||
int i,j,m;
|
||||
|
||||
m = 0;
|
||||
if (pbc_flags[0] == 0) {
|
||||
if (pbc_flag == 0) {
|
||||
for (i = 0; i < n; i++) {
|
||||
j = list[i];
|
||||
buf[m++] = x[j][0];
|
||||
@ -147,14 +147,11 @@ int AtomVecCharge::pack_comm(int n, int *list, double *buf, int *pbc_flags)
|
||||
buf[m++] = x[j][2];
|
||||
}
|
||||
} else {
|
||||
double xprd = domain->xprd;
|
||||
double yprd = domain->yprd;
|
||||
double zprd = domain->zprd;
|
||||
for (i = 0; i < n; i++) {
|
||||
j = list[i];
|
||||
buf[m++] = x[j][0] + pbc_flags[1]*xprd;
|
||||
buf[m++] = x[j][1] + pbc_flags[2]*yprd;
|
||||
buf[m++] = x[j][2] + pbc_flags[3]*zprd;
|
||||
buf[m++] = x[j][0] + pbc_dist[0];
|
||||
buf[m++] = x[j][1] + pbc_dist[1];
|
||||
buf[m++] = x[j][2] + pbc_dist[2];
|
||||
}
|
||||
}
|
||||
return m;
|
||||
@ -208,12 +205,13 @@ void AtomVecCharge::unpack_reverse(int n, int *list, double *buf)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
int AtomVecCharge::pack_border(int n, int *list, double *buf, int *pbc_flags)
|
||||
int AtomVecCharge::pack_border(int n, int *list, double *buf,
|
||||
int pbc_flag, double *pbc_dist)
|
||||
{
|
||||
int i,j,m;
|
||||
|
||||
m = 0;
|
||||
if (pbc_flags[0] == 0) {
|
||||
if (pbc_flag == 0) {
|
||||
for (i = 0; i < n; i++) {
|
||||
j = list[i];
|
||||
buf[m++] = x[j][0];
|
||||
@ -225,14 +223,11 @@ int AtomVecCharge::pack_border(int n, int *list, double *buf, int *pbc_flags)
|
||||
buf[m++] = q[j];
|
||||
}
|
||||
} else {
|
||||
double xprd = domain->xprd;
|
||||
double yprd = domain->yprd;
|
||||
double zprd = domain->zprd;
|
||||
for (i = 0; i < n; i++) {
|
||||
j = list[i];
|
||||
buf[m++] = x[j][0] + pbc_flags[1]*xprd;
|
||||
buf[m++] = x[j][1] + pbc_flags[2]*yprd;
|
||||
buf[m++] = x[j][2] + pbc_flags[3]*zprd;
|
||||
buf[m++] = x[j][0] + pbc_dist[0];
|
||||
buf[m++] = x[j][1] + pbc_dist[1];
|
||||
buf[m++] = x[j][2] + pbc_dist[2];
|
||||
buf[m++] = tag[j];
|
||||
buf[m++] = type[j];
|
||||
buf[m++] = mask[j];
|
||||
@ -437,21 +432,20 @@ int AtomVecCharge::unpack_restart(double *buf)
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
create one atom of type itype at x0,y0,z0
|
||||
create one atom of itype at coord
|
||||
set other values to defaults
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void AtomVecCharge::create_atom(int itype, double x0, double y0, double z0,
|
||||
int ihybrid)
|
||||
void AtomVecCharge::create_atom(int itype, double *coord, int ihybrid)
|
||||
{
|
||||
int nlocal = atom->nlocal;
|
||||
if (nlocal == nmax) grow(0);
|
||||
|
||||
tag[nlocal] = 0;
|
||||
type[nlocal] = itype;
|
||||
x[nlocal][0] = x0;
|
||||
x[nlocal][1] = y0;
|
||||
x[nlocal][2] = z0;
|
||||
x[nlocal][0] = coord[0];
|
||||
x[nlocal][1] = coord[1];
|
||||
x[nlocal][2] = coord[2];
|
||||
mask[nlocal] = 1;
|
||||
image[nlocal] = (512 << 20) | (512 << 10) | 512;
|
||||
v[nlocal][0] = 0.0;
|
||||
@ -468,8 +462,8 @@ void AtomVecCharge::create_atom(int itype, double x0, double y0, double z0,
|
||||
initialize other atom quantities
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void AtomVecCharge::data_atom(double xtmp, double ytmp, double ztmp,
|
||||
int imagetmp, char **values, int ihybrid)
|
||||
void AtomVecCharge::data_atom(double *coord, int imagetmp, char **values,
|
||||
int ihybrid)
|
||||
{
|
||||
int nlocal = atom->nlocal;
|
||||
if (nlocal == nmax) grow(0);
|
||||
@ -484,9 +478,9 @@ void AtomVecCharge::data_atom(double xtmp, double ytmp, double ztmp,
|
||||
|
||||
q[nlocal] = atof(values[2]);
|
||||
|
||||
x[nlocal][0] = xtmp;
|
||||
x[nlocal][1] = ytmp;
|
||||
x[nlocal][2] = ztmp;
|
||||
x[nlocal][0] = coord[0];
|
||||
x[nlocal][1] = coord[1];
|
||||
x[nlocal][2] = coord[2];
|
||||
|
||||
image[nlocal] = imagetmp;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user