From 903e33d86e47c79b7a624d148f49ec5d4bed3299 Mon Sep 17 00:00:00 2001 From: Sievers Date: Mon, 9 Mar 2020 10:33:04 -0600 Subject: [PATCH] Added atom map into example, enforce atom map added to fix_numdiff, added error statement to fix_numdiff.h --- examples/numdiff/in.numdiff | 1 + src/fix_numdiff.cpp | 3 +++ src/fix_numdiff.h | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/examples/numdiff/in.numdiff b/examples/numdiff/in.numdiff index ac6c34cd52..6c4f99a3be 100644 --- a/examples/numdiff/in.numdiff +++ b/examples/numdiff/in.numdiff @@ -3,6 +3,7 @@ units metal atom_style atomic +atom_modify map yes lattice fcc 5.358000 region box block 0 6 0 6 0 6 create_box 1 box diff --git a/src/fix_numdiff.cpp b/src/fix_numdiff.cpp index 06a8a65364..210d533afd 100644 --- a/src/fix_numdiff.cpp +++ b/src/fix_numdiff.cpp @@ -72,6 +72,9 @@ FixNumDiff::FixNumDiff(LAMMPS *lmp, int narg, char **arg) : temp_x = NULL; temp_f = NULL; + if (atom->map_style == 0) + error->all(FLERR,"Fix_numdiff requires an atom map, see atom_modify"); + // perform initial allocation of atom-based arrays // zero numdiff_forces since dump may access it on timestep 0 // zero numdiff_forces since a variable may access it before first run diff --git a/src/fix_numdiff.h b/src/fix_numdiff.h index 1d09de8e54..d339426289 100644 --- a/src/fix_numdiff.h +++ b/src/fix_numdiff.h @@ -73,6 +73,10 @@ Self-explanatory. Check the input script syntax and compare to the documentation for the command. You can use -echo screen as a command-line option when running LAMMPS to see the offending line. +E: Fix_numdiff requires an atom map, see atom_modify + +Self-explanatory. + E: Compute ID for fix numdiff does not exist Self-explanatory.