LAMMPS Data Format

LAMMPS Data Format

Return to top-level of LAMMPS documentation

This file describes the format of the data file read into LAMMPS with the "read data" command. The data file contains basic information about the size of the problem to be run, the initial atomic coordinates, molecular topology, and (optionally) force-field coefficients. It will be easiest to understand this file if you read it while looking at a sample data file from the examples.

This page has 2 sections:


Rules for formatting the Data File:

Blank lines are important. After the header section, new entries are separated by blank lines.

Indentation and space between words/numbers on one line is not important except that keywords (e.g. Masses, Bond Coeffs) must be left-justified and capitalized as shown.

The header section (thru box bounds) must appear first in the file, the remaining entries (Masses, various Coeffs, Atoms, Bonds, etc) can come in any order.

These entries must be in the file: header section, Masses, Atoms.

These entries must be in the file if there are a non-zero number of them: Bonds, Angles, Dihedrals, Impropers. Force field coefficients can be specified in the input script, so do not have to appear in the data file. The one exception to this is class 2 force field coefficients which can only be specified in the data file.

The Nonbond Coeffs entry contains one line for each atom type. These are the coefficients for an interaction between 2 atoms of the same type. The cross-type coeffs are computed by the appropriate class I or class II mixing rules, or can be specified explicitly using the "nonbond coeff" command in the input command script. See the force_fields page for more information.

In the Atoms entry, the atoms can be in any order so long as there are N entries. The 1st number on the line is the atom-tag (number from 1 to N) which is used to identify the atom throughout the simulation. The molecule-tag is a second identifier which is attached to the atom; it can be 0, or a counter for the molecule the atom is part of, or any other number you wish. The q value is the charge of the atom in electron units (e.g. +1 for a proton). The xyz values are the initial position of the atom. For 2-d simulations specify z as 0.0.

The final 3 nx,ny,nz values on a line of the Atoms entry are optional. LAMMPS only reads them if the "true flag" command is specified in the input command script. Otherwise they are initialized to 0 by LAMMPS. Their meaning, for each dimension, is that "n" box-lengths are added to xyz to get the atom's "true" un-remapped position. This can be useful in pre- or post-processing to enable the unwrapping of long-chained molecules which wind thru the periodic box one or more times. The value of "n" can be positive, negative, or zero. For 2-d simulations specify nz as 0.

Atom velocities are initialized to 0.0 if there is no Velocities entry. In the Velocities entry, the atoms can be in any order so long as there are N entries. The 1st number on the line is the atom-tag (number from 1 to N) which is used to identify the atom which the given velocity will be assigned to.

Entries for Velocities, Bonds, Angles, Dihedrals, Impropers must appear in the file after an Atoms entry.

For simulations with periodic boundary conditions, xyz coords are remapped into the periodic box (from as far away as needed), so the initial coordinates need not be inside the box. The nx,ny,nz values (as read in or as set to zero by LAMMPS) are appropriately adjusted by this remapping.

The number of coefficients specified on each line of coefficient entries (Nonbond Coeffs, Bond Coeffs, etc) depends on the "style" of interaction. This must be specified in the input command script before the "read data" command is issued, unless the default is used. See the input_commands page for a description of the various style options. The input_commands and force_fields pages explain the meaning and valid values for each of the coefficients.


Sample file with Annotations

Here is a sample file with annotations in parenthesis and lengthy sections replaced by dots (...). Note that the blank lines are important in this example.

LAMMPS Description           (1st line of file)

100 atoms         (this must be the 3rd line, 1st 2 lines are ignored)
95 bonds                (# of bonds to be simulated)
50 angles               (include these lines even if number = 0)
30 dihedrals
20 impropers

5 atom types           (# of nonbond atom types)
10 bond types          (# of bond types = sets of bond coefficients)
18 angle types         
20 dihedral types      (do not include a bond,angle,dihedral,improper type
2 improper types             line if number of bonds,angles,etc is 0)

-0.5 0.5 xlo xhi       (for periodic systems this is box size,
-0.5 0.5 ylo yhi        for non-periodic it is min/max extent of atoms)
-0.5 0.5 zlo zhi       (do not include this line for 2-d simulations)

Masses

  1 mass
  ...
  N mass                           (N = # of atom types)

Nonbond Coeffs

  1 coeff1 coeff2 ...
  ...
  N coeff1 coeff2 ...              (N = # of atom types)

Bond Coeffs

  1 coeff1 coeff2 ...
  ...
  N coeff1 coeff2 ...              (N = # of bond types)

Angle Coeffs

  1 coeff1 coeff2 ...
  ...
  N coeff1 coeff2 ...              (N = # of angle types)

Dihedral Coeffs

  1 coeff1 coeff2 ...
  ...
  N coeff1 coeff2 ...              (N = # of dihedral types)

Improper Coeffs

  1 coeff1 coeff2 ...
  ...
  N coeff1 coeff2 ...              (N = # of improper types)

BondBond Coeffs

  1 coeff1 coeff2 ...
  ...
  N coeff1 coeff2 ...              (N = # of angle types)

BondAngle Coeffs

  1 coeff1 coeff2 ...
  ...
  N coeff1 coeff2 ...              (N = # of angle types)

MiddleBondTorsion Coeffs

  1 coeff1 coeff2 ...
  ...
  N coeff1 coeff2 ...              (N = # of dihedral types)

EndBondTorsion Coeffs

  1 coeff1 coeff2 ...
  ...
  N coeff1 coeff2 ...              (N = # of dihedral types)

AngleTorsion Coeffs

  1 coeff1 coeff2 ...
  ...
  N coeff1 coeff2 ...              (N = # of dihedral types)

AngleAngleTorsion Coeffs

  1 coeff1 coeff2 ...
  ...
  N coeff1 coeff2 ...              (N = # of dihedral types)

BondBond13 Coeffs

  1 coeff1 coeff2 ...
  ...
  N coeff1 coeff2 ...              (N = # of dihedral types)

AngleAngle Coeffs

  1 coeff1 coeff2 ...
  ...
  N coeff1 coeff2 ...              (N = # of improper types)

Atoms

  1 molecule-tag atom-type q x y z nx ny nz  (nx,ny,nz are optional -
  ...                                    see "true flag" input command)
  ...                
  N molecule-tag atom-type q x y z nx ny nz  (N = # of atoms)

Velocities

  1 vx vy vz
  ...
  ...                
  N vx vy vz                        (N = # of atoms)

Bonds

  1 bond-type atom-1 atom-2
  ...
  N bond-type atom-1 atom-2         (N = # of bonds)

Angles

  1 angle-type atom-1 atom-2 atom-3  (atom-2 is the center atom in angle)
  ...
  N angle-type atom-1 atom-2 atom-3  (N = # of angles)

Dihedrals

  1 dihedral-type atom-1 atom-2 atom-3 atom-4  (atoms 2-3 form central bond)
  ...
  N dihedral-type atom-1 atom-2 atom-3 atom-4  (N = # of dihedrals)

Impropers

  1 improper-type atom-1 atom-2 atom-3 atom-4  (atom-2 is central atom)
  ...
  N improper-type atom-1 atom-2 atom-3 atom-4  (N = # of impropers)

转载于:https://www.cnblogs.com/Simulation-Campus/p/8663445.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
LAMMPS(Large-scale Atomic/Molecular Massively Parallel Simulator)是一种常用的分子动力学模拟软件,可以模拟原子和分子在不同温度、压力和碰撞条件下的行为。LAMMPS data文件是LAMMPS软件所需的输入文件之一。 要读取LAMMPS data文件,首先需要了解文件的基本结构。data文件由四个部分组成:header、atoms、bonds和angles。header部分包括模拟的尺寸、原子和分子类型的数量、分子拓扑结构等信息;atoms、bonds和angles部分则分别列出原子、键和角的信息,包括原子或分子在模拟中的编号、坐标、类型等。 读取LAMMPS data文件时,可以使用常用的数据处理软件或编程语言来处理数据。具体步骤包括读取文件、分析文件结构、提取所需信息和执行模拟等。例如,可以使用Python编写程序来读取并处理LAMMPS data文件: 1. 读取文件 使用Python的open()函数打开data文件,并使用readlines()方法读取文件中的每一行数据,将其存储为一个列表。 2. 分析文件结构 使用Python的循环语句和字符串处理函数,分析data文件的结构,提取header、atoms、bonds和angles部分所包含的信息。 3. 提取所需信息 根据模拟需求,从header、atoms、bonds和angles部分中提取所需的信息,例如原子或分子的坐标、类型和速度等。 4. 执行模拟 将提取的信息输入到LAMMPS软件中,执行模拟并记录结果。 总之,读取LAMMPS data文件需要具备基本的文件处理和编程能力,可以借助现有的软件和工具,也可以编写自己的程序来实现。掌握数据处理和编程技能,可以更好地利用LAMMPS软件进行分子动力学模拟,并深入理解原子和分子的行为。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值