解读命令系列【1】【fix nve/limit command】

78 views
Skip to first unread message

lammp...@gmail.com

unread,
Dec 3, 2008, 7:00:32 AM12/3/08
to LAMMPS2forum
解读命令系列【1】【fix nve/limit command】
这个命令是设置初始状态常用命令,经典命令格式【fix 1 all nve/limit 0.1】,我们一般直接用即可【LJ单位下】,注意此命令只
能模拟开始使用,真正需要记录模拟信息时不能用。

命令语法
[b]Syntax:[/b]
fix ID group-ID nve/limit xmax [list][*]ID, group-ID are documented in
[color=#0000ff]fix[/color] command[*]nve = style name of this fix
command[*]xmax = maximum distance an atom can move in one timestep
(distance units)[/list]
[b]Description:[/b]

Perform constant NVE updates of position and velocity for atoms in the
group each timestep. A limit is imposed on the maximum distance an
atom can move in one timestep. [color=red]This is useful when starting
a simulation with a configuration containing highly overlapped atoms.[/
color] Normally this would generate huge forces which would blow atoms
out of the simulation box, causing LAMMPS to stop with an error. 【这段话
告诉我们这个命令是干什么的】

Using this fix can overcome that problem. Forces on atoms must still
be computable (which typically means 2 atoms must have a separation
distance > 0.0). But large velocities generated by large forces are
reset to a value that corresponds to a displacement of length [i]xmax[/
i] in a single timestep.【通过你设定的距离计算速度,并用来标度】

[i]Xmax[/i] is specified in distance units; see the [color=#0000ff]
units[/color] command for details. [color=red]The value of [i]xmax[/i]
should be consistent with the neighbor skin distance and the frequency
of neighbor list re-building, so that pairwise interactions are not
missed on successive timesteps as atoms move.[/color] See the
[color=#800080]neighbor[/color] and [color=#800080]neigh_modify[/
color] commands for details.
【如何设定最大限定的距离呢,这句话告诉我们,设置距离要和你的neighbor list的设置有可比性,不能比bin大太多了,个人认为小没有关
系,LJ单位下我们设bin一般是0.3】

Note that if a velocity reset occurs the integrator will not conserve
energy. On steps where no velocity resets occur, this integrator is
exactly like the [color=#0000ff]fix nve[/color] command. Since forces
are unaltered, pressures computed by thermodynamic output will still
be very large for overlapped configurations. 【这句告诉我们不要担心出现的异常现象,也警告我们真正
模拟时最好不要用】


系统是通过设定的xlimit和时间步长先计算速度的做大限制【限制速度】,然后计算体系原子的速度,如果这个速度大于【限制速度】,那么就对速度进行
标度,最后再计算移动位移。主要代码如下
===========================================
[color=blue]vlimitsq = (xlimit/dtv) * (xlimit/
dtv); 【计算速度限制】[/color]
----------------------------
vsq = v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2];【实际速度】
----------------------------
if (vsq > vlimitsq) { 【比较,满
足条件就标度】
ncount++;
[color=blue]scale = sqrt(vlimitsq/vsq);[/color]
v[i][0] *= scale;
v[i][1] *= scale;
v[i][2] *= scale;
}
----------------------------
x[i][0] += dtv * v[i][0]; 【计算位
移】
x[i][1] += dtv * v[i][1];
x[i][2] += dtv * v[i][2];
===========================================

gemin 发表于 2008-7-12 21:39
good things
thanks

Reply all
Reply to author
Forward
0 new messages