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

This commit is contained in:
sjplimp 2012-06-20 13:46:30 +00:00
parent b96c9934ca
commit 7000d43d10
5 changed files with 68 additions and 34 deletions

View File

@ -129,8 +129,10 @@ int ComputeAngleLocal::compute_angles(int flag)
if (tflag >= 0) tbuf = vector;
if (eflag >= 0) ebuf = vector;
} else {
if (tflag >= 0) tbuf = &array[0][tflag];
if (eflag >= 0) ebuf = &array[0][eflag];
if (tflag >= 0 && array) tbuf = &array[0][tflag];
else tbuf = NULL;
if (eflag >= 0 && array) ebuf = &array[0][eflag];
else ebuf = NULL;
}
}

View File

@ -125,8 +125,10 @@ int ComputeBondLocal::compute_bonds(int flag)
if (dflag >= 0) dbuf = vector;
if (eflag >= 0) ebuf = vector;
} else {
if (dflag >= 0) dbuf = &array[0][dflag];
if (eflag >= 0) ebuf = &array[0][eflag];
if (dflag >= 0 && array) dbuf = &array[0][dflag];
else dbuf = NULL;
if (eflag >= 0 && array) ebuf = &array[0][eflag];
else ebuf = NULL;
}
}

View File

@ -38,7 +38,8 @@ ComputeDihedralLocal::ComputeDihedralLocal(LAMMPS *lmp, int narg, char **arg) :
if (narg < 4) error->all(FLERR,"Illegal compute dihedral/local command");
if (atom->avec->dihedrals_allow == 0)
error->all(FLERR,"Compute dihedral/local used when dihedrals are not allowed");
error->all(FLERR,
"Compute dihedral/local used when dihedrals are not allowed");
local_flag = 1;
nvalues = narg - 3;
@ -126,7 +127,8 @@ int ComputeDihedralLocal::compute_dihedrals(int flag)
if (nvalues == 1) {
if (pflag >= 0) pbuf = vector;
} else {
if (pflag >= 0) pbuf = &array[0][pflag];
if (pflag >= 0 && array) pbuf = &array[0][pflag];
else pbuf = NULL;
}
}

View File

@ -39,7 +39,8 @@ ComputeImproperLocal::ComputeImproperLocal(LAMMPS *lmp, int narg, char **arg) :
if (narg < 4) error->all(FLERR,"Illegal compute improper/local command");
if (atom->avec->impropers_allow == 0)
error->all(FLERR,"Compute improper/local used when impropers are not allowed");
error->all(FLERR,
"Compute improper/local used when impropers are not allowed");
local_flag = 1;
nvalues = narg - 3;
@ -127,7 +128,8 @@ int ComputeImproperLocal::compute_impropers(int flag)
if (nvalues == 1) {
if (cflag >= 0) cbuf = vector;
} else {
if (cflag >= 0) cbuf = &array[0][cflag];
if (cflag >= 0 && array) cbuf = &array[0][cflag];
else cbuf = NULL;
}
}

View File

@ -53,127 +53,153 @@ ComputePropertyLocal::ComputePropertyLocal(LAMMPS *lmp, int narg, char **arg) :
if (strcmp(arg[iarg],"natom1") == 0) {
pack_choice[i] = &ComputePropertyLocal::pack_patom1;
if (kindflag != NONE && kindflag != NEIGH)
error->all(FLERR,"Compute property/local cannot use these inputs together");
error->all(FLERR,
"Compute property/local cannot use these inputs together");
kindflag = NEIGH;
} else if (strcmp(arg[iarg],"natom2") == 0) {
pack_choice[i] = &ComputePropertyLocal::pack_patom2;
if (kindflag != NONE && kindflag != NEIGH)
error->all(FLERR,"Compute property/local cannot use these inputs together");
error->all(FLERR,
"Compute property/local cannot use these inputs together");
kindflag = NEIGH;
} else if (strcmp(arg[iarg],"patom1") == 0) {
pack_choice[i] = &ComputePropertyLocal::pack_patom1;
if (kindflag != NONE && kindflag != PAIR)
error->all(FLERR,"Compute property/local cannot use these inputs together");
error->all(FLERR,
"Compute property/local cannot use these inputs together");
kindflag = PAIR;
} else if (strcmp(arg[iarg],"patom2") == 0) {
pack_choice[i] = &ComputePropertyLocal::pack_patom2;
if (kindflag != NONE && kindflag != PAIR)
error->all(FLERR,"Compute property/local cannot use these inputs together");
error->all(FLERR,
"Compute property/local cannot use these inputs together");
kindflag = PAIR;
} else if (strcmp(arg[iarg],"batom1") == 0) {
pack_choice[i] = &ComputePropertyLocal::pack_batom1;
if (kindflag != NONE && kindflag != BOND)
error->all(FLERR,"Compute property/local cannot use these inputs together");
error->all(FLERR,
"Compute property/local cannot use these inputs together");
kindflag = BOND;
} else if (strcmp(arg[iarg],"batom2") == 0) {
pack_choice[i] = &ComputePropertyLocal::pack_batom2;
if (kindflag != NONE && kindflag != BOND)
error->all(FLERR,"Compute property/local cannot use these inputs together");
error->all(FLERR,
"Compute property/local cannot use these inputs together");
kindflag = BOND;
} else if (strcmp(arg[iarg],"btype") == 0) {
pack_choice[i] = &ComputePropertyLocal::pack_btype;
if (kindflag != NONE && kindflag != BOND)
error->all(FLERR,"Compute property/local cannot use these inputs together");
error->all(FLERR,
"Compute property/local cannot use these inputs together");
kindflag = BOND;
} else if (strcmp(arg[iarg],"aatom1") == 0) {
pack_choice[i] = &ComputePropertyLocal::pack_aatom1;
if (kindflag != NONE && kindflag != ANGLE)
error->all(FLERR,"Compute property/local cannot use these inputs together");
error->all(FLERR,
"Compute property/local cannot use these inputs together");
kindflag = ANGLE;
} else if (strcmp(arg[iarg],"aatom2") == 0) {
pack_choice[i] = &ComputePropertyLocal::pack_aatom2;
if (kindflag != NONE && kindflag != ANGLE)
error->all(FLERR,"Compute property/local cannot use these inputs together");
error->all(FLERR,
"Compute property/local cannot use these inputs together");
kindflag = ANGLE;
} else if (strcmp(arg[iarg],"aatom3") == 0) {
pack_choice[i] = &ComputePropertyLocal::pack_aatom3;
if (kindflag != NONE && kindflag != ANGLE)
error->all(FLERR,"Compute property/local cannot use these inputs together");
error->all(FLERR,
"Compute property/local cannot use these inputs together");
kindflag = ANGLE;
} else if (strcmp(arg[iarg],"atype") == 0) {
pack_choice[i] = &ComputePropertyLocal::pack_atype;
if (kindflag != NONE && kindflag != ANGLE)
error->all(FLERR,"Compute property/local cannot use these inputs together");
error->all(FLERR,
"Compute property/local cannot use these inputs together");
kindflag = ANGLE;
} else if (strcmp(arg[iarg],"datom1") == 0) {
pack_choice[i] = &ComputePropertyLocal::pack_datom1;
if (kindflag != NONE && kindflag != DIHEDRAL)
error->all(FLERR,"Compute property/local cannot use these inputs together");
error->all(FLERR,
"Compute property/local cannot use these inputs together");
kindflag = DIHEDRAL;
} else if (strcmp(arg[iarg],"datom2") == 0) {
pack_choice[i] = &ComputePropertyLocal::pack_datom2;
if (kindflag != NONE && kindflag != DIHEDRAL)
error->all(FLERR,"Compute property/local cannot use these inputs together");
error->all(FLERR,
"Compute property/local cannot use these inputs together");
kindflag = DIHEDRAL;
} else if (strcmp(arg[iarg],"datom3") == 0) {
pack_choice[i] = &ComputePropertyLocal::pack_datom3;
if (kindflag != NONE && kindflag != DIHEDRAL)
error->all(FLERR,"Compute property/local cannot use these inputs together");
error->all(FLERR,
"Compute property/local cannot use these inputs together");
kindflag = DIHEDRAL;
} else if (strcmp(arg[iarg],"datom4") == 0) {
pack_choice[i] = &ComputePropertyLocal::pack_datom4;
if (kindflag != NONE && kindflag != DIHEDRAL)
error->all(FLERR,"Compute property/local cannot use these inputs together");
error->all(FLERR,
"Compute property/local cannot use these inputs together");
kindflag = DIHEDRAL;
} else if (strcmp(arg[iarg],"dtype") == 0) {
pack_choice[i] = &ComputePropertyLocal::pack_dtype;
if (kindflag != NONE && kindflag != DIHEDRAL)
error->all(FLERR,"Compute property/local cannot use these inputs together");
error->all(FLERR,
"Compute property/local cannot use these inputs together");
kindflag = DIHEDRAL;
} else if (strcmp(arg[iarg],"iatom1") == 0) {
pack_choice[i] = &ComputePropertyLocal::pack_iatom1;
if (kindflag != NONE && kindflag != IMPROPER)
error->all(FLERR,"Compute property/local cannot use these inputs together");
error->all(FLERR,
"Compute property/local cannot use these inputs together");
kindflag = IMPROPER;
} else if (strcmp(arg[iarg],"iatom2") == 0) {
pack_choice[i] = &ComputePropertyLocal::pack_iatom2;
if (kindflag != NONE && kindflag != IMPROPER)
error->all(FLERR,"Compute property/local cannot use these inputs together");
error->all(FLERR,
"Compute property/local cannot use these inputs together");
kindflag = IMPROPER;
} else if (strcmp(arg[iarg],"iatom3") == 0) {
pack_choice[i] = &ComputePropertyLocal::pack_iatom3;
if (kindflag != NONE && kindflag != IMPROPER)
error->all(FLERR,"Compute property/local cannot use these inputs together");
error->all(FLERR,
"Compute property/local cannot use these inputs together");
kindflag = IMPROPER;
} else if (strcmp(arg[iarg],"iatom4") == 0) {
pack_choice[i] = &ComputePropertyLocal::pack_iatom4;
if (kindflag != NONE && kindflag != IMPROPER)
error->all(FLERR,"Compute property/local cannot use these inputs together");
error->all(FLERR,
"Compute property/local cannot use these inputs together");
kindflag = IMPROPER;
} else if (strcmp(arg[iarg],"itype") == 0) {
pack_choice[i] = &ComputePropertyLocal::pack_itype;
if (kindflag != NONE && kindflag != IMPROPER)
error->all(FLERR,"Compute property/local cannot use these inputs together");
error->all(FLERR,
"Compute property/local cannot use these inputs together");
kindflag = IMPROPER;
} else error->all(FLERR,"Invalid keyword in compute property/local command");
} else error->all(FLERR,
"Invalid keyword in compute property/local command");
}
// error check
if (kindflag == BOND && atom->avec->bonds_allow == 0)
error->all(FLERR,"Compute property/local for property that isn't allocated");
error->all(FLERR,
"Compute property/local for property that isn't allocated");
if (kindflag == ANGLE && atom->avec->angles_allow == 0)
error->all(FLERR,"Compute property/local for property that isn't allocated");
error->all(FLERR,
"Compute property/local for property that isn't allocated");
if (kindflag == DIHEDRAL && atom->avec->dihedrals_allow == 0)
error->all(FLERR,"Compute property/local for property that isn't allocated");
error->all(FLERR,
"Compute property/local for property that isn't allocated");
if (kindflag == IMPROPER && atom->avec->impropers_allow == 0)
error->all(FLERR,"Compute property/local for property that isn't allocated");
error->all(FLERR,
"Compute property/local for property that isn't allocated");
nmax = 0;
vector = NULL;