Set of Rules for formatting .data?

Submitted by E-ray on Wed, 11/20/2024 - 16:43

Hello everyone,

I am fairly new to LIGGGHTS and have started by creating a simplified case. I exported a .csv file from Paraview containing the x, y and z positions of particles (spheres): I wrote a small Python script to grab these coordinates and some other necessary information and create a .data file with the minimum amount of necessary information (sections --> head and body). I know that I need to use the read_data function in my initialiser file, which I have called in.liggghts_run.

My spheres_positions.data currently looks like this (Now I know, it is incorrectly formatted - Minimal example):

# LIGGGHTS data file generated from CSV

3 atoms # Total number of atoms (number of rows in the CSV file)
1 atom types # Assuming all spheres are of a single type

-0.9 0.9 xlo xhi # x-dimension bounds
-0.9 0.9 ylo yhi # y-dimension bounds
-0.5 0.5 zlo zhi # z-dimension bounds

Atoms
1 1 0.0002 2700 -0.0115666 -6.86967e-05 0.000770419
2 1 0.0002 2700 -0.005047 -0.0110507 0.0069504
3 1 0.0002 2700 -0.0134573 -0.00143924 0.00695453

With this .data version, I get always the same error:

thermo_log ../DEM/post/thermo.txt

atom_style sphere
atom_modify map array
communicate single vel yes

boundary m m m
newton off

units si
processors 2 2 1

# read the particle_positios.csv --> converted into liggghts-data
read_data ../DEM/spheres_positions.data
orthogonal box = (-0.9 -0.9 -0.5) to (0.9 0.9 0.5)
2 by 2 by 1 MPI processor grid
ERROR: Incorrect atom format in data file (../atom.cpp:745)

I found out that the values in the ‘Atoms’ section must be separated by tabs and not by single spaces. See the following corrected example.

# LIGGGHTS data file generated from CSV

3 atoms # Total number of atoms (number of rows in the CSV file)
1 atom types # Assuming all spheres are of a single type

-0.9 0.9 xlo xhi # x-dimension bounds
-0.9 0.9 ylo yhi # y-dimension bounds
-0.5 0.5 zlo zhi # z-dimension bounds

Atoms
1 1 0.0002 2700 -0.0115666 -6.86967e-05 0.000770419
2 1 0.0002 2700 -0.005047 -0.0110507 0.0069504
3 1 0.0002 2700 -0.0134573 -0.00143924 0.00695453

Could you tell me why this version (with the tabs) is working correctly and the first one is not?
I know that you should avoid unnecessary spaces etc. Are there rules that say which values must be separated with tabs and which not? For example, I only used a single space for ‘1 atom types’.

Many thanks in advance :))