返回列表 回复 发帖 点我体验网上斗地主的乐趣

[讨论交流] 我想在lammps里添加新的势能函数,是把所有的都要重写吗?

相关搜索: 求助
比如说我要加一个新的势能函数,那些如何计算力的方法,计算位移的方法我都要重写吗?还是说我只要改一部分就行了。
问题是我不知道内部是如何算得啊,大家有做过这个的吗?
当然不用!
percysong同学我不知道你有没有用过ABAQUS的用户子程序(UMAT,UEL),是不是就像ABAQUS那样只把几个指定的需要更新的变量在子程序里计算一下,然后返回给主程序就可以了,至于用什么样的算法求解方程组的根我们根本不需要知道,LAMMPS是这样工作的吗?

回复 板凳 sunysb 的帖子

in case of EAM
The EAM potentials LAMMPS uses are tabulated in files,
so in principal you can use any functional form for any
material, tabulate it, and read it in from a file.  The
pair_style eam doc page lists some WWW sites that
have EAM files for different materials in the right
format, or you could convert them.

It you want an analytic EAM form (e.g. Sutton/Chen),
you could implement it, e.g. as pair_style eam/suttonchen
and hard code the formulas.  This is not hard to do;
most pair potentials in LAMMPS are in that mode.

Start with a doc page thta defines the needed inputs
and code up the formulas and send it to me.  It would
then be easy to make a new pair style file.

You'll need to write a doc page similar to doc/pair_eam.txt,
call it pair_eam_spline.txt.  This will force you to define
exactly what parameters you want to input, so it's
helpful in defining what needs to be coded.

potential itself, yes code the energy and force in C
or C++ for the  equations.

steve
1

评分次数

  • fatcharm

回复 板凳 sunysb 的帖子

lammps只能运用表列好了的势能函数计算,而势能函数的参数,是第一性原理计算拟合出来的,你先要有第一性计算的拟合结果然后按要求写好适合lammps的文件,如果势能函数有解析形式,那就更方便一些,直接编程自己算结果然后加上去就好了。lammps只提供高效的MD算法框架,并不计算生成势能函数。
1

评分次数

  • fatcharm

比如说我在SRC目录下发现了pair_tersoff.cpp文件和pair_tersoff.h文件,如果我想用一个是能函数比如说叫做bang势能函数,那我就要写两个文件一个是pair_bang.cpp另一个是pair_bang.h对吗?
其中对照pair_tersoff.cpp来改写pair_bang.cpp, 对照pair_tersoff.h来改写pair_bang.h对吗?
只要写完了这两个文件就可以了对吗?其他的任何东西都不要动对吗?

[ 本帖最后由 sunysb 于 2008-8-4 10:09 编辑 ]

回复 6楼 sunysb 的帖子

YES, although you do not change algorithm and structure in force. h, comm.h, memory.h etc. ,you still need to read them though to ensure  the potential you generate correct.
1

评分次数

  • fatcharm

percysong能否写点修改code的经验啊,很希望你能写点
【生活就要耐住寂寞,面对现实微笑,越过障碍注视未来】
============================================
My website: http://groups.google.com/group/tianwd?hl=zh-CN

回复 8楼 redream 的帖子

记得我以前问过sutton chen的问题,目前结果不好,skin部分的位势截断和源代码不太一样,等有了好结果希望能写点对大家有用的东西。
我看了类似的程序,就是不知道要更新哪些变量,要保留哪些变量。
返回列表

本站属于学术,非经营性网站
本站所有资源均来自于互联网,所有个人文章和言论并不代表本站立场,如发现有侵权行为,请与我们联系,我们将在3个工作日内做出相应处理并给予答复