在进行lammps模拟时,我们往往想实时的获取模拟的结果。

特别是对于一些比较大的体系,模拟时间长达几天甚至几十天,实时监控模拟运行结果就更重要了。

模拟信息的显示主要用到thermo、thermo_style、thermo_modify三个命令。

1 thermo命令

lammps提供了thermo命令实时把模拟结果信息输出到屏幕上,同时也会把信息存入到log文件,便于后期数据处理。

thermo命令语法格式:

thermo N

N表示每隔N步在屏幕上输出默认信息。

lammps教程:模拟量实时显示thermo命令详解(1)_自定义

2.thermo_style命令

通常,thermo命令配合thermo_style使用。

thermo_style可以设置哪些信息会被显示到屏幕上,命令格式为:

thermo_style style args
one args = none
multi args = none
custom args = list of keywords

thermo_style有三种主要的显示方式:one、multi、custom。

thermo_style one命令是把信息都输出在一行中,这也是thermo_style默认的方式,如果不写thermo_style命令,系统默认的就是thermo_style one。

因此,下面2个命令是等价的:

#输出设置1
thermo 100
#输出设置2
thermo 100
thermo_style one

thermo_style multi命令使用多行显示信息,如下图所示:

thermo_style one和thermo_style multi使用比较简单,但是有个缺点,只能显示默认的几个信息量,无法自定义显示的内容。

下一篇文章将介绍thermo_style custom命令,实现自定义模拟量的输出。

更多lammps案例,关注公众号:lammps加油站

lammps教程:模拟量实时显示thermo命令详解(1)_显示方式_02