【LAMMPS翻译系列】thermo_modify命令

thermo_modify命令用来设置LAMMPS如何计算和输出热力学信息。

使用语法

thermo_modify keyword value ...
  • one or more keyword/value pairs may be listed
  • keyword = lost or norm or flush or line or format or temp or press:l
    • lost value = error or warn or ignore
    • norm value = yes or no
    • flush value = yes or no
    • line value = one or multi
    • format values = int string or float string or M string
    • M = integer from 1 to N, where N = # of quantities being printed
    • string = C-style format string
    • temp value = compute ID that calculates a temperature
    • press value = compute ID that calculates a pressure

使用举例

thermo_modify lost ignore flush yes
thermo_modify temp myTemp format 3 %15.8g
thermo_modify line multi format float %g

使用介绍

该命令用来设置LAMMPS如何计算和输出热力学信息。

注意:这些选项应用于当前定义的thermo类型。当你使用命令thermo_style时,所有热力学相关的设置都会保存为他们的默认值,包括在这之前使用thermo_modify命令设置的值。因此,如果你在输入脚本中使用了thermo_style命令,你就需要在它之后使用thermo_modify 命令。

关键字lost决定LAMMPS在每次计算热力学信息的时候,是否检查原子丢失,以及如果原子丢失了将要如何处理。当原子移动出模拟盒子的非周期性边界,或在重新更新领域前,原子移动出模拟区域超过1倍的盒子长度(或处理器子区域长度),原子就被认为是丢失了。后一种情况通常是由于错误的动力学过程导致的,比如时间步长过大,或者受力、速度过大。如果lost的值是

ignore

,那么LAMMPS就不会检查原子是否丢失。如果lost的值是

error

warn

,那么LAMMPS会检查原子是否丢失,并给出错误信息或警告信息。如果是错误信息,程序就会退出;如果是警告信息,程序仍然会继续。并且,警告信息只会出现一次,就是在原子第一次丢失的时候。这是个非常有用的调试选项。

关键字norm决定是否对不同的热力学输出对原子数量进行归一化,这依赖于将其设置为

yes

还是

no

。对于不同类型的单位,这些设置会有不同的默认值。即使将norm设置为yes,但对于“extensive”的量,其值仅仅进行归一化,就是说它会根据体系的原子数而被scale。

Different unit styles have different defaults for this setting (see below). Even if norm is set to yes, a value is only normalized if it is an "extensive" quantity, meaning that it scales with the number of atoms in the system. For the thermo keywords described by the doc page for the thermo_style command, all energy-related keywords are extensive, such as pe or ebond or enthalpy. Other keywords such as temp or pressare "intensive" meaning their value is independent (in a statistical sense) of the number of atoms in the system and thus are never normalized. For thermodynamic output values extracted from fixes and computes in a thermo_style custom command, the doc page for the individual fix or compute lists whether the value is "extensive" or "intensive" and thus whether it is normalized. Thermodynamic output values calculated by a variable formula are assumed to be "intensive" and thus are never normalized. You can always include a divide by the number of atoms in the variable formula if this is not the case.

关键字flush会在热力学信息写入到日志文件后激活flush操作。这样做可以不在操作系统中保留缓冲数据,从而使得输出到文件中的数据就是当前的状态。即便是在模拟结束前LAMMPS挂掉了,也不会有计算过程数据的丢失。

关键字line决定热力学信息是以单行的格式输出还是多行格式输出。多行格式:每行是3个量的字符串,并以时间步和CPU时间为开始。该设置会重写thermo_style命令中的one和multi设置。

关键字format设置每个输出量的数值格式。取int可以设置为整形格式,设置为float设置为浮点型。值M用来设置第M个量的输出格式,如format 5 %10.4g就是对输出数据中的第5列进行设置。如果对指定的列进行了设置,那么这种设置会优先于int/float类型的设置。

注意:热力学量step和atoms在LAMMPS内是存为8位有符号整形,而不是通常的4为有符号整形。

When specifying the "format int" keyword you can use a "%d"-style format identifier in the format string and LAMMPS will convert this to the corresponding "%lu" form when it is applied to those keywords. However, when specifying the "format M string" keyword for step and natoms, you should specify a string appropriate for an 8-byte signed integer, e.g. one with "%ld".

The temp keyword is used to determine how thermodynamic temperature is calculated, which is used by all thermo quantities that require a temperature ("temp", "press", "ke", "etotal", "enthalpy", "pxx", etc). The specified compute ID must have been previously defined by the user via the compute command and it must be a style of compute that calculates a temperature. As described in thethermo_style command, thermo output uses a default compute for temperature with ID = thermo_temp. This option allows the user to override the default.

The press keyword is used to determine how thermodynamic pressure is calculated, which is used by all thermo quantities that require a pressure ("press", "enthalpy", "pxx", etc). The specified compute ID must have been previously defined by the user via the compute command and it must be a style of compute that calculates a pressure. As described in the thermo_style command, thermo output uses a default compute for pressure with ID = thermo_press. This option allows the user to override the default.

IMPORTANT NOTE: If both the temp and press keywords are used in a single thermo_modify command (or in two separate commands), then the order in which the keywords are specified is important. Note that a pressure compute defines its own temperature compute as an argument when it is specified. The temp keyword will override this (for the pressure compute being used by thermodynamics), but only if the temp keyword comes after the press keyword. If the temp keyword comes before the press keyword, then the new pressure compute specified by the presskeyword will be unaffected by the temp setting.

使用限制

相关命令

thermothermo_style

默认设置

The option defaults are lost = error, norm = yes for unit style of lj, norm = no for unit style of real and metal, flush = no, and temp/press = compute IDs defined by thermo_style.

The defaults for the line and format options depend on the thermo style. For styles "one" and "custom", the line and format defaults are "one", "%8d", and "%12.8g". For style "multi", the line and format defaults are "multi", "%8d", and "%14.4f".

标签: lammps, lammps翻译

相关文章推荐

添加新评论 (无需注册,可直接评论)