diff --git a/src/compute_gyration.cpp b/src/compute_gyration.cpp index 438914278e..1025b8fc2a 100644 --- a/src/compute_gyration.cpp +++ b/src/compute_gyration.cpp @@ -109,5 +109,5 @@ void ComputeGyration::compute_vector() MPI_Allreduce(rg,vector,6,MPI_DOUBLE,MPI_SUM,world); if (masstotal == 0.0) return; - for (int i = 0; i < 6; i++) vector[i] = sqrt(vector[i]/masstotal); + for (int i = 0; i < 6; i++) vector[i] = vector[i]/masstotal; } diff --git a/src/compute_gyration_molecule.cpp b/src/compute_gyration_molecule.cpp index 179d4f5f92..cd36fe2021 100644 --- a/src/compute_gyration_molecule.cpp +++ b/src/compute_gyration_molecule.cpp @@ -212,7 +212,7 @@ void ComputeGyrationMolecule::compute_array() for (i = 0; i < nmolecules; i++) for (j = 0; j < 6; j++) - array[i][j] = sqrt(array[i][j]/masstotal[i]); + array[i][j] = array[i][j]/masstotal[i]; } diff --git a/src/fix_ave_spatial.cpp b/src/fix_ave_spatial.cpp index dab6749ea9..5369dc2fd2 100644 --- a/src/fix_ave_spatial.cpp +++ b/src/fix_ave_spatial.cpp @@ -158,6 +158,8 @@ FixAveSpatial::FixAveSpatial(LAMMPS *lmp, int narg, char **arg) : iarg++; } + if (nvalues == 0) error->all(FLERR,"No input values for fix ave/spatial"); + // optional args regionflag = 0;