Problem with encoding of data files? - Non-numeric atom coords

relax.in (852 Bytes)
test.data (739 Bytes)
test_working.data (742 Bytes)

There seems to be a problem with the data- file “test.data”. It is a pretty easy example file:

LAMMPS data L

12 atoms
11 bonds
10 angles

1 atom types
1 bond types
1 angle types

0.0000000000000000e+00 1e+02 xlo xhi
0.0000000000000000e+00 1e+02 ylo yhi
0.0000000000000000e+00 1e+02 zlo zhi

Masses

**1 1 **

**Atoms # angle **

1 1 1 50 50 50 0 0 0
2 1 1 50 60 50 0 0 0
3 1 1 50 59 50 0 0 0
4 1 1 50 58 50 0 0 0
5 1 1 50 57 50 0 0 0
6 1 1 50 56 50 0 0 0
7 1 1 50 55 50 0 0 0
8 1 1 50 54 50 0 0 0
9 1 1 50 53 50 0 0 0
10 1 1 50 52 50 0 0 0
11 1 1 50 51 50 0 0 0
12 1 1 50 50 50 0 0 0

Bonds

1 1 2 3
2 1 3 4
3 1 4 5
4 1 5 6
5 1 6 7
6 1 7 8
7 1 8 9
8 1 9 10
9 1 10 11
10 1 11 12
11 1 12 1

Angles

1 1 2 3 4
2 1 3 4 5
3 1 4 5 6
4 1 5 6 7
5 1 6 7 8
6 1 7 8 9
7 1 8 9 10
8 1 9 10 11
9 1 10 11 12
10 1 11 12 1

used in a simple input script with a soft potential for relaxation.

units lj
atom_style angle

boundary p p p

read_data test.data

group net type 1
dump dum2 net custom 10 relax.lammpstrj id type xs ys zs ix iy iz

pair_style soft 1.5
pair_coeff * * 100.0

angle_style cosine
angle_coeff 1 10.0

bond_style harmonic
bond_coeff 1 10.0 0.6

comm_modify cutoff 2.0

fix 1 all nve
fix 2 all langevin 1.0 1.0 1.0 12345

thermo 10
thermo_style custom step temp epair emol press vol density
############################################################################

timestep 0.01

run 1000

write_data relaxed.dat

LAMMPS prduces the following output:
LAMMPS (29 Oct 2020)
Reading data file …
orthogonal box = (0.0000000 0.0000000 0.0000000) to (100.00000 100.00000 100.00000)
1 by 1 by 1 MPI processor grid
reading atoms …
12 atoms
scanning bonds …
1 = max bonds/atom
scanning angles …
1 = max angles/atom
reading bonds …
11 bonds
reading angles …
10 angles
Finding 1-2 1-3 1-4 neighbors …
special bond factors lj: 0.0 0.0 0.0
special bond factors coul: 0.0 0.0 0.0
2 = max # of 1-2 neighbors
2 = max # of 1-3 neighbors
4 = max # of 1-4 neighbors
6 = max # of special neighbors
special bonds CPU = 0.000 seconds
read_data CPU = 0.006 seconds
12 atoms in group net
Neighbor list info …
update every 1 steps, delay 10 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 1.8
ghost atom cutoff = 2
binsize = 0.9, bins = 112 112 112
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair soft, perpetual
attributes: half, newton on
pair build: half/bin/newton
stencil: half/bin/3d/newton
bin: standard
Setting up Verlet run …
Unit style : lj
Current step : 0
Time step : 0.01
Per MPI rank memory allocation (min/avg/max) = 12.86 | 12.86 | 12.86 Mbytes
Step Temp E_pair E_mol Press Volume Density
0 0 0 -nan -nan 1000000 1.2e-05
10 -nan 0 -nan -nan 1000000 1.2e-05
20 -nan 0 -nan -nan 1000000 1.2e-05

1000 -nan 0 -nan -nan 1000000 1.2e-05
Loop time of 0.00827503 on 1 procs for 1000 steps with 12 atoms

Performance: 104410471.822 tau/day, 120845.453 timesteps/s
97.4% CPU use with 1 MPI tasks x no OpenMP threads

MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total

Pair | 0.00025392 | 0.00025392 | 0.00025392 | 0.0 | 3.07
Bond | 0.0012391 | 0.0012391 | 0.0012391 | 0.0 | 14.97
Neigh | 0 | 0 | 0 | 0.0 | 0.00
Comm | 0.00021052 | 0.00021052 | 0.00021052 | 0.0 | 2.54
Output | 0.0042238 | 0.0042238 | 0.0042238 | 0.0 | 51.04
Modify | 0.0019336 | 0.0019336 | 0.0019336 | 0.0 | 23.37
Other | | 0.0004141 | | | 5.00

Nlocal: 12.0000 ave 12 max 12 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Nghost: 0.00000 ave 0 max 0 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Neighs: 0.00000 ave 0 max 0 min
Histogram: 1 0 0 0 0 0 0 0 0 0

Total # of neighbors = 0
Ave neighs/atom = 0.0000000
Ave special neighs/atom = 5.0000000
Neighbor list builds = 0
Dangerous builds = 0
System init for write_data …
ERROR on proc 0: Non-numeric atom coords - simulation unstable (…/domain.cpp:548)

After deleting the last line of test.data and type it back in in the gedit editor the Error vanished (see attachment test_working.data). After that i checked the encoding, wich is both supposed to be utf 8 and I also checked the header of the two data files in a hex editor -without finding anything. Any ideas?

That has nothing to do with encoding. You have bad geometry/topology data.
Atoms 1 and 12 have the exact same coordinates, thus the angle 11 12 1 is ill defined and thus the computation of forces and energy yields a NaN.

Just add the following lines to your input and observe the per-angle values.

compute 0 all property/local aatom1 aatom2 aatom3 atype
compute 1 all angle/local theta eng
dump 0 all local 10 angle.dump c_0[*] c_1[*]
1 Like