In [7]:
Copied!
# 加载模块
%load_ext lammpscn.lammps
# 加载模块
%load_ext lammpscn.lammps
LAMMPS (3 Aug 2023 - Development - patch_2Aug2023-747-ge655cda066) OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) using 1 OpenMP thread(s) per MPI task
In [25]:
Copied!
# 如果修改了代码,需要重新加载模块
%reload_ext lammpscn.lammps
# 如果修改了代码,需要重新加载模块
%reload_ext lammpscn.lammps
LAMMPS (3 Aug 2023 - Development - patch_2Aug2023-747-ge655cda066) OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) using 1 OpenMP thread(s) per MPI task
In [9]:
Copied!
# 执行单行命令, 单个%开头且不换行
%cmd variable a equal 1
# 执行单行命令, 单个%开头且不换行
%cmd variable a equal 1
Out[9]:
'variable a equal 1'
执行多行命令, 以%%开头且换行
In [13]:
Copied!
%%cmd
variable a equal 1
variable b equal 2
%%cmd
variable a equal 1
variable b equal 2
Out[13]:
'variable a equal 1\nvariable b equal 2\n'
针对内置的命令进行了封装
In [26]:
Copied!
%reset_box 0 0 0 10 10 10 0 0 0
%reset_box 0 0 0 10 10 10 0 0 0
WARNING: Ignoring call to lammps_reset_box without a box (src/library.cpp:1012)
最后更新:
November 10, 2023
Authors: