add a "magic" file for use with the file(1) command to detect LAMMPS files

This commit is contained in:
Axel Kohlmeyer
2021-03-14 05:44:28 -04:00
parent 8c4918457f
commit 84b0da3054
3 changed files with 93 additions and 0 deletions

View File

@ -93,6 +93,7 @@ Miscellaneous tools
* :ref:`i-pi <ipi>`
* :ref:`kate <kate>`
* :ref:`LAMMPS shell <lammps_shell>`
* :ref:`LAMMPS magic patterns for file(1) <magic>`
* :ref:`singularity <singularity_tool>`
* :ref:`SWIG interface <swig>`
* :ref:`vim <vim>`
@ -641,6 +642,38 @@ This tool was written by Ara Kooser at Sandia (askoose at sandia.gov).
----------
.. _magic:
Magic patterns for the "file" command
-------------------------------------
.. versionadded:: 10Mar2021
The file ``magic`` contains pattern that are used by the ``file``
program available on most Unix-like operating systems which enable
it to detect various LAMMPS files and print some useful information
about them. To enable these patterns, append or copy them to either
the file ``.magic`` in your home directory or (as administrator) to
``/etc/magic`` (for a system-wide installation). Afterwards the
``file`` command should be able to detect LAMMPS binary
restarts and dump files and some data and log files. Examples:
.. code-block:: bash
$ file *.*
dihedral-quadratic.restart: LAMMPS binary restart file (rev 2), Version 10 Mar 2021, Little Endian
mol-pair-wf_cut.restart: LAMMPS binary restart file (rev 2), Version 24 Dec 2020, Little Endian
atom.bin: LAMMPS atom style binary dump (rev 2), Little Endian, First time step: 445570
custom.bin: LAMMPS custom style binary dump (rev 2), Little Endian, First time step: 100
bn1.lammpstrj: LAMMPS text mode dump, First time step: 5000
data.fourmol: LAMMPS data file written by LAMMPS
pnc.data: LAMMPS data file written by msi2lmp
data.spce: LAMMPS data file written by TopoTools
B.data: LAMMPS data file written by OVITO
log.lammps: LAMMPS log file written by version 10 Feb 2021
----------
.. _matlab:
matlab tool

View File

@ -32,6 +32,7 @@ kate add-ons to Kate editor for editing LAMMPS input scripts
lammps-shell LAMMPS executable enhanced for interactive use
lmp2arc convert LAMMPS output to Accelrys Insight format
lmp2cfg convert LAMMPS output to CFG files for AtomEye viz
magic patterns to detect LAMMPS files with the file(1) command
matlab MatLab scripts for post-processing LAMMPS output
mesont Tools for use with the USER-MESONT package
micelle2d create a data file of small lipid chains in solvent

59
tools/magic Normal file
View File

@ -0,0 +1,59 @@
# Add the contents of this file to either $HOME/.magic
# or /etc/magic so that the file(1) command can recognize
# your LAMMPS files and print some useful information.
# Last change: 2021-03-14 by akohlmey@gmail.com
# Binary restart file for the LAMMPS MD code, https://lammps.sandia.gov
0 string LammpS\ RestartT LAMMPS binary restart file
>0x14 long x (rev %d),
>>0x20 string x Version %s,
>>>0x10 lelong 0x0001 Little Endian
>>>0x10 lelong 0x1000 Big Endian
# Atom style binary dump file for the LAMMPS MD code, https://lammps.sandia.gov
# written on a little endian machine
0 lequad -8
>0x08 string DUMPATOM LAMMPS atom style binary dump
>>0x14 long x (rev %d),
>>>0x10 lelong 0x0001 Little Endian,
>>>>0x18 lequad x First time step: %lld
# written on a big endian machine
0 bequad -8
>0x08 string DUMPATOM LAMMPS atom style binary dump
>>0x14 belong x (rev %d),
>>>0x10 lelong 0x1000 Big Endian,
>>>>0x18 bequad x First time step: %lld
# Atom style binary dump file for the LAMMPS MD code, https://lammps.sandia.gov
# written on a little endian machine
0 lequad -10
>0x08 string DUMPCUSTOM LAMMPS custom style binary dump
>>0x16 lelong x (rev %d),
>>>0x12 lelong 0x0001 Little Endian,
>>>>0x1a lequad x First time step: %lld
# written on a big endian machine
0 bequad -10
>0x08 string DUMPCUSTOM LAMMPS custom style binary dump
>>0x16 belong x (rev %d),
>>>0x12 lelong 0x1000 Big Endian,
>>>>0x1a bequad x First time step: %lld
# LAMMPS log file
0 string LAMMPS\ ( LAMMPS log file
>8 regex/16 [0-9]+\ [A-Za-z]+\ [0-9]+ written by version %s
# Data file written either by LAMMPS, msi2lmp or VMD/TopoTools
0 string LAMMPS\ data\ file LAMMPS data file
>0x12 string CGCMM\ style written by TopoTools
>0x12 string msi2lmp written by msi2lmp
>0x11 string via\ write_data written by LAMMPS
# Data file written by OVITO
0 string #\ LAMMPS\ data\ file LAMMPS data file
>0x13 string written\ by\ OVITO written by OVITO
# LAMMPS text mode dump file
0 string ITEM:\ TIMESTEP LAMMPS text mode dump,
>15 regex/16 [0-9]+ First time step: %s