lammps常用命令(合集)(8)

2019-08-31 15:09

The units keyword determines the meaning of the distance units used to define the region for any argument above listed as having distance units. It also affects the scaling of the velocity vector specfied with the vel keyword, the amplitude vector specified with the wiggle keyword, and the rotation point specified with the rotate keyword, since they each involve a distance metric.

A box value selects standard distance units as defined by the units command, e.g. Angstroms for units = real or metal. A lattice value means the distance units are in lattice spacings. The latticecommand must have been previously used to define the lattice spacings which are used as follows:

? ?

?

? ? ?

For style block, the lattice spacing in dimension x is applied to xlo and xhi, similarly the spacings in dimensions y,z are applied to ylo/yhi and zlo/zhi.

For style cone, the lattice spacing in argument dim is applied to lo and hi. The spacings in the two radial dimensions are applied to c1 and c2. The two cone radii are scaled by the lattice spacing in the dimension corresponding to c1.

For style cylinder, the lattice spacing in argument dim is applied to lo and hi. The spacings in the two radial dimensions are applied to c1 and c2. The cylinder radius is scaled by the lattice spacing in the dimension corresponding to c1.

For style plane, the lattice spacing in dimension x is applied to px and nx, similarly the spacings in dimensions y,z are applied to py/ny and pz/nz.

For style prism, the lattice spacing in dimension x is applied to xlo and xhi, similarly for ylo/yhi and zlo/zhi. The lattice spacing in dimension x is applied to xy and xz, and the spacing in dimension y to yz. For style sphere, the lattice spacing in dimensions x,y,z are applied to the sphere center x,y,z. The spacing in dimension x is applied to the sphere radius.

If the move or rotate keywords are used, the region is \These keywords cannot be used with a union or intersect style region. Instead, the keywords should be used to make the individual sub-regions of the union or intersect region dynamic. Normally, each sub-region should be \same manner (e.g. rotate around the same point), though this is not a requirement.

The move keyword allows one or more equal-style variables to be used to specify the x,y,z displacement of the region, typically as a function of time. A variable is specified as v_name, where name is the variable name. Any of the three variables can be specified as NULL, in which case no displacement is calculated in that dimension.

Note that equal-style variables can specify formulas with various mathematical functions, and

include thermo_style command keywords for the simulation box parameters and timestep and elapsed time. Thus it is easy to specify a region displacement that change as a function of time or spans consecutive runs in a continuous fashion. For the latter, see the start and stop keywords of the runcommand and the elaplong keyword of thermo_style custom for details.

For example, these commands would displace a region from its initial position, in the positive x direction, effectively at a constant velocity:

variable dx equal ramp(0,10)

region 2 sphere 10.0 10.0 0.0 5 move v_dx NULL NULL

Note that the initial displacemet is 0.0, though that is not required.

Either of these varaibles would \variable dy equal swiggle(0,5,100)

variable dysame equal 5*sin(2*PI*elaplong*dt/100) region 2 sphere 10.0 10.0 0.0 5 move NULL v_dy NULL

The rotate keyword rotates the region around a rotation axis R = (Rx,Ry,Rz) that goes thru a point P = (Px,Py,Pz). The rotation angle is calculated, presumably as a function of time, by a variable specified as v_theta, where theta is the variable name. The variable should generate its result in radians. The direction of rotation for the region around the rotation axis is consistent with the right-hand rule: if your right-hand thumb points along R, then your fingers wrap around the axis in the direction of rotation.

The move and rotate keywords can be used together. In this case, the displacement specified by the move keyword is applied to the P point of the rotate keyword. Restrictions:

A prism cannot be of 0.0 thickness in any dimension; use a small z thickness for 2d simulations. For 2d simulations, the xz and yz parameters must be 0.0. Related commands:

lattice, create_atoms, delete_atoms, group Default:

The option defaults are side = in, units = lattice, and no move or rotation.

LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Commands

create_box command Syntax:

create_box N region-ID keyword value ...

? ? ? ?

? ? ? ? ? ? ? ? ?

N = # of atom types to use in this simulation

region-ID = ID of region to use as simulation domain zero or more keyword/value pairs may be appended keyword

= bond/types or angle/types or dihedral/types or improper/types or extra/bond/per/atom or extra/angle/per/atom or extra/dihedral/per/atom or extra/improper/per/atom bond/types value = # of bond types angle/types value = # of angle types

dihedral/types value = # of dihedral types improper/types value = # of improper types

extra/bond/per/atom value = # of bonds per atom extra/angle/per/atom value = # of angles per atom

extra/dihedral/per/atom value = # of dihedrals per atom extra/improper/per/atom value = # of impropers per atom

extra/special/per/atom value = # of special neighbors per atom

Examples:

create_box 2 mybox

create_box 2 mybox bond/types 2 extra/bond/per/atom 1 Description:

This command creates a simulation box based on the specified region. Thus a region command must first be used to define a geometric domain.

The argument N is the number of atom types that will be used in the simulation.

If the region is not of style prism, then LAMMPS encloses the region (block, sphere, etc) with an axis-aligned orthogonal bounding box which becomes the simulation domain.

If the region is of style prism, LAMMPS creates a non-orthogonal simulation domain shaped as a parallelepiped with triclinic symmetry. As defined by the region prism command, the parallelepiped has its \defined by 3 edge vectors starting from the origin given by A = (xhi-xlo,0,0); B = (xy,yhi-ylo,0); C = (xz,yz,zhi-

zlo). Xy,xz,yz can be 0.0 or positive or negative values and are called \displacement applied to faces of an originally orthogonal box to transform it into the parallelipiped.

A prism region used with the create_box command must have tilt factors (xy,xz,yz) that do not skew the box more than half the distance of the parallel box length. For example, if xlo = 2 and xhi = 12, then the x box length is 10 and the xy tilt factor must be between -5 and 5. Similarly, both xz and yz must be between -(xhi-xlo)/2 and +(yhi-ylo)/2. Note that this is not a limitation, since if the maximum tilt factor is 5 (as in this example), then configurations with tilt = ..., -15, -5, 5, 15, 25, ... are all geometrically equivalent.

See Section_howto 12 of the doc pages for a geometric description of triclinic boxes, as defined by LAMMPS, and how to transform these parameters to and from other commonly used triclinic representations.

When a prism region is used, the simulation domain must be periodic in any dimensions with a non-zero tilt factor, as

defined by the boundary command. I.e. if the xy tilt factor is non-zero, then both the x and y dimensions must be periodic. Similarly, x and z must be periodic if xz is non-zero and y and z must be periodic if yz is non-zero. Also note that if your simulation will tilt the box, e.g. via the fix deform command, the simulation box must be defined as triclinic, even if the tilt factors are initially 0.0.

IMPORTANT NOTE: If the system is non-periodic (in a dimension), then you should not make the lo/hi box dimensions (as defined in your region command) radically smaller/larger than the extent of the atoms you eventually plan to create, e.g. via the create_atoms command. For example, if your atoms extend from 0 to 50, you should not specify the box bounds as -10000 and 10000. This is because LAMMPS uses the specified box size to layout the 3d grid of processors. A huge (mostly empty) box will be sub-optimal for performance when using \

the boundarycommand). When using \boundary command), a huge (mostly empty) box may cause a parallel simulation to lose atoms the first time that LAMMPS shrink-wraps the box around the atoms.

The optional keywords can be used to create a system that allows for bond (angle, dihedral, improper) interactions, or for molecules with special 1-2,1-3,1-4 neighbors to be added later. These optional keywords serve the same purpose as the analagous keywords that can be used in a data file which are recognized by the read_data command when it sets up a system.

Note that if these keywords are not used, then the create_box command creates an atomic (non-molecular) simulation that does not allow bonds between pairs of atoms to be defined, or a bond potential to be specified, or for molecules with special neighbors to be added to the system by commands such as create_atoms mol, fix deposit or fix pour. As an example, see the examples/deposit/in.deposit.molecule script, which deposits molecules onto a substrate. Initially there are no molecules in the system, but they are added later by the fix deposit command. The create_box command in the script uses the bond/types and extra/bond/per/atom keywords to allow this. If the added molecule contained more than 1 special bond (allowed by default), an extra/special/per/atom keyword would also need to be specified.

Restrictions:

An atom_style and region must have been previously defined to use this command. Related commands:

read_data, create_atoms, region Default: none

LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Commands

create_atoms command Syntax:

create_atoms type style args keyword values ...

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?

type = atom type (1-Ntypes) of atoms to create (offset for molecule creation) style = box or region or single or random box args = none

region args = region-ID

region-ID = particles will only be created if contained in the region single args = x y z

x,y,z = coordinates of a single particle (distance units) random args = N seed region-ID N = number of particles to create

seed = random # seed (positive integer)

region-ID = create atoms within this region, use NULL for entire simulation box zero or more keyword/value pairs may be appended keyword = mol or basis or remap or units mol value = template-ID seed

template-ID = ID of molecule template specified in a separate molecule command seed = random # seed (positive integer) basis values = M itype M = which basis atom

itype = atom type (1-N) to assign to this basis atom remap value = yes or no units value = lattice or box

lattice = the geometry is defined in lattice units

box = the geometry is defined in simulation box units

Examples:

create_atoms 1 box

create_atoms 3 region regsphere basis 2 3 create_atoms 3 single 0 0 5 Description:

This command creates atoms (or molecules) on a lattice, or a single atom (or molecule), or a random collection of atoms (or molecules), as an alternative to reading in their coordinates explicitly via a read_data or read_restart command. A simulation box must already exist, which is typically created via the create_box command. Before using this command, a lattice must also be defined using the lattice command, unless you specify the single style with units = box or the random style. For the remainder of this doc page, a created atom or molecule is referred to as a \If created particles are individual atoms, they are assigned the specified atom type, though this can be altered via

the basis keyword as discussed below. If molecules are being created, the type of each atom in the created molecule is specified in the file read by the molecule command, and those values are added to the specified atom type. E.g. if type = 2, and the file specifies atom types 1,2,3, then each created molecule will have atom types 3,4,5.

For the box style, the create_atoms command fills the entire simulation box with particles on the lattice. If your

simulation box is periodic, you should insure its size is a multiple of the lattice spacings, to avoid unwanted atom overlaps at the box boundaries. If your box is periodic and a multiple of the lattice spacing in a particular dimension, LAMMPS is careful to put exactly one particle at the boundary (on either side of the box), not zero or two.

For the region style, a geometric volume is filled with particles on the lattice. This volume what is inside the simulation box and is also consistent with the region volume. See the region command for details. Note that a region can be

specified so that its \size as a periodic simulation box (in some dimension), LAMMPS does not implement the same logic described above as

for the box style, to insure exactly one particle at periodic boundaries. if this is what you desire, you should either use the box style, or tweak the region size to get precisely the particles you want.

For the single style, a single particle is added to the system at the specified coordinates. This can be useful for debugging purposes or to create a tiny system with a handful of particles at specified positions.

For the random style, N particles are added to the system at randomly generated coordinates, which can be useful for generating an amorphous system. The particles are created one by one using the speficied random number seed,

resulting in the same set of particles coordinates, independent of how many processors are being used in the simulation. If the region-ID argument is specified as NULL, then the created particles will be anywhere in the simulation box. If

a region-ID is specified, a geometric volume is filled which is both inside the simulation box and is also consistent with the region volume. See the region command for details. Note that a region can be specified so that its \inside or outside a geometric boundary.

IMPORTANT NOTE: Particles generated by the random style will typically be highly overlapped which will cause many interatomic potentials to compute large energies and forces. Thus you should either perform an energy minimization or run dynamics with fix nve/limit to equilibrate such a system, before running normal dynamics.

Note that this command adds particles to those that already exist. This means it can be used to add particles to a system previously read in from a data or restart file. Or the create_atoms command can be used multiple times, to add multiple sets of particles to the simulation. For example, grain boundaries can be created, by interleaving create_atoms with lattice commands specifying different orientations. By using the create_atoms command in conjunction with the delete_atoms command, reasonably complex geometries can be created, or a protein can be solvated with a surrounding box of water molecules.

In all these cases, care should be taken to insure that new atoms do not overlap existing atoms inappropriately, especially if molecules are being added. The delete_atoms command can be used to remove overlapping atoms or molecules.

Individual atoms are inserted by this command, unless the mol keyword is used. It specifies a template-ID previously

defined using the molecule command, which reads a file that defines the molecule. The coordinates, atom types, charges, etc, as well as any bond/angle/etc and special neighbor information for the molecule can be specified in the molecule file. See the molecule command for details. The only settings required to be in this file are the coordinates and types of atoms in the molecule.

Using a lattice to add molecules, e.g. via the box or region or single styles, is exactly the same as adding atoms on lattice points, except that entire molecules are added at each point, i.e. on the point defined by each basis atom in the unit cell as it tiles the simulation box or region. This is done by placing the geometric center of the molecule at the lattice point, and giving the molecule a random orientation about the point. The random seed specified with the mol keyword is used for this operation, and the random numbers generated by each processor are different. This means the coordinates of individual atoms (in the molecules) will be different when running on different numbers of processors, unlike when atoms are being created in parallel.

Also note that because of the random rotations, it may be important to use a lattice with a large enough spacing that adjacent molecules will not overlap, regardless of their relative orientations.

IMPORTANT NOTE: If the create_box command is used to create the simulation box, followed by the create_atoms command with its mol option for adding molecules, then you typically need to use the optional keywords allowed by the create_box command for extra bonds (angles,etc) or extra special neighbors. This is because by default, the create_box command sets up a non-molecular system which doesn't allow molecules to be added.

This is the meaning of the other allowed keywords.

The basis keyword is only used when atoms (not molecules) are being created. It specifies an atom type that will be assigned to specific basis atoms as they are created. See the lattice command for specifics on how basis atoms are defined for the unit cell of the lattice. By default, all created atoms are assigned the argument type as their atom type.


lammps常用命令(合集)(8).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:人教部编版三年级上册语文 口语交际:身边的“小事”

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: