A homebrew version based on CP2K v8.2 which with rotational/roto-translational constraint method implemented
The constraint method can be used as other official constraint methods in CP2K, here is a little example
...
&COORD !Cartesian coordinates of system
N -0.00000000 0.00000000 -0.09999998 M1
H 0.00000000 0.95223715 0.23666663 M1
H 0.82466156 -0.47611858 0.23666663 M1
H -0.82466156 -0.47611858 0.23666663 M1
N 1.61846237 3.12648673 1.12207349 M2
H 1.61846237 4.07872389 1.45874010 M2
H 2.44312393 2.65036816 1.45874010 M2
H 0.79380080 2.65036816 1.45874010 M2
N -0.94386640 -1.51381415 2.30701324 M3
H -0.94386640 -0.56157700 2.64367985 M3
H -0.11920484 -1.98993273 2.64367985 M3
H -1.76852797 -1.98993273 2.64367985 M3
&END
...
&CONSTRAINT !Constraint settings
CONSTRAINT_INIT T
&ROTC !Rotational/roto-translational constraint settings
MOLNAME M1
ATOMS 1 2 3 4
POSITIONS0 [ANGSTROM] -0.00000000 0.00000000 -0.09999998 0.00000000 0.95223715 0.23666663 0.82466156 -0.47611858 0.23666663 -0.82466156 -0.47611858 0.23666663
&END ROTC
&END CONSTRAINT
- The input format can be found in
MOLNAMEin the CP2K manual, this may not be necessary, we have not tested other ways of selecting atoms for constraints. - this template works for both rotation constraints and rotation/translation constraints, for a source code we have implemented only one constraint, the corresponding code is in
src_rtandsrc_roto.
It may also be important to note that:
- under periodic boundary conditions, the constrained molecule needs to be whole, even if it is partially outside the box boundary (i.e., it is guaranteed to be
unwrapped), in order to ensure that the correct center of rotation is computed - user may notice that the initial temperature is slightly different from the set temperature after applying the constraints. This is due to the fact that we do not want to change the complex structure inside CP2K, and this does not affect the subsequent temperature-related calculations such as NVT.
We put the roto-translational constraint version in src_rt and the rotational constraint version in src_roto. Users can replace the source code in the official version CP2K with the code and then install it as a normal version.
Thanks to @KeouLee for testing and advising on this project!
基于 CP2K v8.2 的自制版本,实现了旋动/平动-转动约束方法
该约束方法可与 CP2K 中的其他官方约束方法一样使用,下面是一个小例子
...
&COORD !Cartesian coordinates of system
N -0.00000000 0.00000000 -0.09999998 M1
H 0.00000000 0.95223715 0.23666663 M1
H 0.82466156 -0.47611858 0.23666663 M1
H -0.82466156 -0.47611858 0.23666663 M1
N 1.61846237 3.12648673 1.12207349 M2
H 1.61846237 4.07872389 1.45874010 M2
H 2.44312393 2.65036816 1.45874010 M2
H 0.79380080 2.65036816 1.45874010 M2
N -0.94386640 -1.51381415 2.30701324 M3
H -0.94386640 -0.56157700 2.64367985 M3
H -0.11920484 -1.98993273 2.64367985 M3
H -1.76852797 -1.98993273 2.64367985 M3
&END
...
&CONSTRAINT !Constraint settings
CONSTRAINT_INIT T
&ROTC !Rotational/roto-translational constraint settings
MOLNAME M1
ATOMS 1 2 3 4
POSITIONS0 [ANGSTROM] -0.00000000 0.00000000 -0.09999998 0.00000000 0.95223715 0.23666663 0.82466156 -0.47611858 0.23666663 -0.82466156 -0.47611858 0.23666663
&END ROTC
&END CONSTRAINT
- 输入格式可以参考 CP2K 手册 中的
MOLNAME,这也许不是必须的,我们没有测试其它选取原子进行约束的方式 - 此模板对于转动约束和转动/平动约束均适用,对于一个源代码我们仅实现了一种约束,相应的代码分别放在
src_rt和src_roto中
可能还需要注意的是:
- 在周期性边界条件下,被约束的分子需为一整体,即使部分超出盒子边界也无妨(即保证
unwrapped),这是为了确保计算出正确的旋转中心 - 用户可能会注意到施加约束后初始温度略不同于设定温度的问题,这是由于我们不想改动 CP2K 内部的复杂结构,这不会影响后续的 NVT 等温度相关的计算。
我们将 roto-translational 约束版本放在 src_rt 中,将 rotational 约束版本放在 src_roto 中。用户可以用这些代码替换原版 CP2K 中的源代码,然后将其作为普通版本安装。
感谢 @KeouLee 对该项目的测试和建议