diff --git a/src/compute_sum_atom.cpp b/src/compute_sum_atom.cpp index a6dd97a7cd..9d20496958 100644 --- a/src/compute_sum_atom.cpp +++ b/src/compute_sum_atom.cpp @@ -42,22 +42,30 @@ ComputeSumAtom::ComputeSumAtom(LAMMPS *lmp, int narg, char **arg) : compute = new Compute*[npre]; - // check consistency of set of pre-computes for scalar & vector output + // all sub-computes must be peratom + // check consistency of sub-computes for scalar & vector output - peratom_flag = 1; - int icompute = modify->find_compute(id_pre[0]); - size_peratom = modify->compute[icompute]->size_peratom; - - for (int i = 1; i < npre; i++) { + int icompute; + for (int i = 0; i < npre; i++) { icompute = modify->find_compute(id_pre[i]); if (icompute < 0) error->all("Could not find compute sum/atom pre-compute ID"); if (modify->compute[icompute]->peratom_flag == 0) - error->all("Compute sum/atom compute does not compute vector per atom"); - if (modify->compute[icompute]->size_peratom != size_peratom) - error->all("Inconsistent sizes of compute sum/atom compute vectors"); + error->all("Compute sum/atom compute is not a per-atom compute"); } + peratom_flag = 1; + icompute = modify->find_compute(id_pre[0]); + size_peratom = modify->compute[icompute]->size_peratom; + + for (int i = 1; i < npre; i++) { + icompute = modify->find_compute(id_pre[i]); + if (modify->compute[icompute]->size_peratom != size_peratom) + error->all("Inconsistent sizes of compute sum/atom compute quantities"); + } + + // values generated by this compute + nmax = 0; s_value = NULL; v_value = NULL; diff --git a/src/fix_ave_atom.cpp b/src/fix_ave_atom.cpp index 3ec3440cd9..9fa515e8e4 100644 --- a/src/fix_ave_atom.cpp +++ b/src/fix_ave_atom.cpp @@ -115,7 +115,8 @@ int FixAveAtom::setmask() void FixAveAtom::init() { - // set ptrs to one or more computes called each end-of-step + // set ptrs to compute and its pre-computes called each end-of-step + // put pre-computes in list before compute int icompute = modify->find_compute(id_compute); if (icompute < 0) error->all("Compute ID for fix ave/atom does not exist"); diff --git a/src/fix_ave_spatial.cpp b/src/fix_ave_spatial.cpp index ba2559aec5..f4d10b32d6 100644 --- a/src/fix_ave_spatial.cpp +++ b/src/fix_ave_spatial.cpp @@ -285,7 +285,8 @@ void FixAveSpatial::init() error->all("Fix ave/spatial settings invalid with changing box"); } - // set ptrs to one or more computes called each end-of-step + // set ptrs to compute and its pre-computes called each end-of-step + // put pre-computes in list before compute if (which == COMPUTE) { int icompute = modify->find_compute(id_compute); diff --git a/src/fix_ave_time.cpp b/src/fix_ave_time.cpp index e7bd6ffdfd..1f10068ddc 100644 --- a/src/fix_ave_time.cpp +++ b/src/fix_ave_time.cpp @@ -230,7 +230,8 @@ int FixAveTime::setmask() void FixAveTime::init() { - // set ptrs to one or more computes called each end-of-step + // set ptrs to compute and its pre-computes called each end-of-step + // put pre-computes in list before compute if (which == COMPUTE) { int icompute = modify->find_compute(id); diff --git a/src/style.h b/src/style.h index d37d050c97..c1be5c0330 100644 --- a/src/style.h +++ b/src/style.h @@ -86,6 +86,7 @@ CommandStyle(write_restart,WriteRestart) #include "compute_rotate_dipole.h" #include "compute_rotate_gran.h" #include "compute_stress_atom.h" +#include "compute_sum.h" #include "compute_sum_atom.h" #include "compute_temp.h" #include "compute_temp_deform.h" @@ -107,6 +108,7 @@ ComputeStyle(pressure,ComputePressure) ComputeStyle(rotate/dipole,ComputeRotateDipole) ComputeStyle(rotate/gran,ComputeRotateGran) ComputeStyle(stress/atom,ComputeStressAtom) +ComputeStyle(sum,ComputeSum) ComputeStyle(sum/atom,ComputeSumAtom) ComputeStyle(temp,ComputeTemp) ComputeStyle(temp/deform,ComputeTempDeform) diff --git a/src/style_kspace.h b/src/style_kspace.h index 8c7244afb9..313bef990a 100644 --- a/src/style_kspace.h +++ b/src/style_kspace.h @@ -28,6 +28,7 @@ KSpaceStyle(pppm/tip4p,PPPMTIP4P) #include "pair_coul_long.h" #include "pair_lj_cut_coul_long.h" #include "pair_lj_cut_coul_long_tip4p.h" +#include "pair_new.h" #include "pair_lj_charmm_coul_long.h" #endif @@ -36,5 +37,6 @@ PairStyle(buck/coul/long,PairBuckCoulLong) PairStyle(coul/long,PairCoulLong) PairStyle(lj/cut/coul/long,PairLJCutCoulLong) PairStyle(lj/cut/coul/long/tip4p,PairLJCutCoulLongTIP4P) +PairStyle(lj/cut/coul/long/tip4p2,PairLJCutCoulLongTIP4P2) PairStyle(lj/charmm/coul/long,PairLJCharmmCoulLong) #endif diff --git a/src/thermo.cpp b/src/thermo.cpp index 1778ab76c4..5cd9951831 100644 --- a/src/thermo.cpp +++ b/src/thermo.cpp @@ -793,7 +793,7 @@ void Thermo::addfield(const char *key, FnPtr func, int typeflag) /* ---------------------------------------------------------------------- add compute ID to list of Compute objects to call - return index of where this Compute is in list + return location of where this Compute is in list if already in list, do not add, just return index, else add to list convert index into which param index = 0 -> scalar, index >= 1 -> vector diff --git a/src/variable.cpp b/src/variable.cpp index 55563edaed..369e2633a8 100644 --- a/src/variable.cpp +++ b/src/variable.cpp @@ -701,7 +701,7 @@ double Variable::evaluate(char *str, Tree *tree) modify->compute[icompute]->init(); // call compute_scalar() if index = 0, else compute_vector() - // make pre-call to Compute object's pre-compute(s) if defined + // if defined, first call Compute object's pre-compute(s) int index = atoi(arg); if (index == 0) {