diff --git a/src/compute.cpp b/src/compute.cpp index 5f41cbf837..f3b24f7bbc 100644 --- a/src/compute.cpp +++ b/src/compute.cpp @@ -93,6 +93,11 @@ Compute::Compute(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) datamask = ALL_MASK; datamask_ext = ALL_MASK; + + // force init to zero in case these are used as logicals + + vector = vector_atom = vector_local = NULL; + array = array_atom = array_local = NULL; } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_atom_molecule.cpp b/src/compute_atom_molecule.cpp index 4442a72255..8b0d413c23 100644 --- a/src/compute_atom_molecule.cpp +++ b/src/compute_atom_molecule.cpp @@ -106,7 +106,7 @@ ComputeAtomMolecule(LAMMPS *lmp, int narg, char **arg) : int ifix = modify->find_fix(ids[i]); if (ifix < 0) error->all(FLERR,"Fix ID for compute atom/molecule does not exist"); - if (modify->fix[ifix]->peratom_flag) + if (modify->fix[ifix]->peratom_flag == 0) error->all(FLERR,"Compute atom/molecule fix does not " "calculate per-atom values"); if (argindex[i] == 0 && @@ -299,9 +299,8 @@ void ComputeAtomMolecule::compute_one(int m) peratom = compute->vector_atom; nstride = 1; } else { - if (compute->array_atom) peratom = &compute->array_atom[0][aidx-1]; - else peratom = NULL; - nstride = compute->size_array_cols; + peratom = &compute->array_atom[0][aidx-1]; + nstride = compute->size_peratom_cols; } // access fix fields, check if fix frequency is a match @@ -317,7 +316,7 @@ void ComputeAtomMolecule::compute_one(int m) nstride = 1; } else { peratom = &fix->array_atom[0][aidx-1]; - nstride = fix->size_array_cols; + nstride = fix->size_peratom_cols; } // evaluate atom-style variable diff --git a/src/fix_gravity.cpp b/src/fix_gravity.cpp index 24bc7b4b3c..2e9d6e40f4 100644 --- a/src/fix_gravity.cpp +++ b/src/fix_gravity.cpp @@ -41,6 +41,7 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) : { if (narg < 5) error->all(FLERR,"Illegal fix gravity command"); + dynamic_group_allow = 1; scalar_flag = 1; global_freq = 1; extscalar = 1;