用于lamps的aiida插件

aiida-lammps的Python项目详细描述


Build Status

aiida lammps插件

这是用于AiiDA的lammps插件。 此插件包含4种代码类型:

  • lammps.forces:原子单点力计算
  • lammps.optimize:晶体结构优化
  • lammps.md:分子动力学计算
  • lammps.combinate:使用lammps md轨迹的dynaphopy计算(当前未测试)

注:lammps.combinate需要aiida-phonopyhttps://github.com/abelcarreras/aiida-phonopy) 插件工作,dynaphopy可以在:https://github.com/abelcarreras/aiida-phonopy

内置潜在支持

  • EAM
  • 伦纳德·琼斯
  • 特索夫
  • reaxff

示例

更多示例计算可在文件夹/examples中找到, 在/aiida lammps/tests/test_calculations中有许多测试示例。

代码设置

fromaiida_lammps.tests.utilsimport(get_or_create_local_computer,get_or_create_code)fromaiida_lammps.tests.utilsimportlammps_versioncomputer_local=get_or_create_local_computer('work_directory','localhost')code_lammps_force=get_or_create_code('lammps.force',computer_local,'lammps')code_lammps_opt=get_or_create_code('lammps.optimize',computer_local,'lammps')code_lammps_md=get_or_create_code('lammps.md',computer_local,'lammps')meta_options={"resources":{"num_machines":1,"num_mpiprocs_per_machine":1}}

结构设置

fromaiida.pluginsimportDataFactoryimportnumpyasnpcell=[[3.1900000572,0,0],[-1.5950000286,2.762621076,0],[0.0,0,5.1890001297]]positions=[(0.6666669,0.3333334,0.0000000),(0.3333331,0.6666663,0.5000000),(0.6666669,0.3333334,0.3750000),(0.3333331,0.6666663,0.8750000)]symbols=names=['Ga','Ga','N','N']structure=DataFactory('structure')(cell=cell)forposition,symbol,nameinzip(positions,symbols,names):position=np.dot(position,cell).tolist()structure.append_atom(position=position,symbols=symbol,name=name)structure
<StructureData: uuid: 96f9c02b-77c7-4889-9de2-dbda27bb03fa (unstored)>

电位设置

pair_style='tersoff'potential_dict={'Ga Ga Ga':'1.0 0.007874 1.846 1.918000 0.75000 -0.301300 1.0 1.0 1.44970 410.132 2.87 0.15 1.60916 535.199','N  N  N':'1.0 0.766120 0.000 0.178493 0.20172 -0.045238 1.0 1.0 2.38426 423.769 2.20 0.20 3.55779 1044.77','Ga Ga N':'1.0 0.001632 0.000 65.20700 2.82100 -0.518000 1.0 0.0 0.00000 0.00000 2.90 0.20 0.00000 0.00000','Ga N  N':'1.0 0.001632 0.000 65.20700 2.82100 -0.518000 1.0 1.0 2.63906 3864.27 2.90 0.20 2.93516 6136.44','N  Ga Ga':'1.0 0.001632 0.000 65.20700 2.82100 -0.518000 1.0 1.0 2.63906 3864.27 2.90 0.20 2.93516 6136.44','N  Ga N ':'1.0 0.766120 0.000 0.178493 0.20172 -0.045238 1.0 0.0 0.00000 0.00000 2.20 0.20 0.00000 0.00000','N  N  Ga':'1.0 0.001632 0.000 65.20700 2.82100 -0.518000 1.0 0.0 0.00000 0.00000 2.90 0.20 0.00000 0.00000','Ga N  Ga':'1.0 0.007874 1.846 1.918000 0.75000 -0.301300 1.0 0.0 0.00000 0.00000 2.87 0.15 0.00000 0.00000'}potential=DataFactory("lammps.potential")(structure=structure,type=pair_style,data=potential_dict)potential.attributes
{'kind_elements':['Ga','N'],'potential_type':'tersoff','atom_style':'atomic','default_units':'metal','potential_md5':'b3b7d45ae7b92eba05ed99ffe69810d0','input_lines_md5':'3145644a408a6d464e80866b833115a2'}

力计算

fromaiida.engineimportrun_get_nodeparameters=DataFactory('dict')(dict={'lammps_version':lammps_version(),'output_variables':["temp","etotal","pe","ke"],'thermo_keywords':[]})builder=code_lammps_force.get_builder()builder.metadata.options=meta_optionsbuilder.structure=structurebuilder.potential=potentialbuilder.parameters=parametersresult,calc_node=run_get_node(builder)
$ verdi process list -D desc -a -l 1  PK  Created    Process label     Process State    Process status----  ---------  ----------------  ---------------  ----------------2480  32s ago    ForceCalculation  Finished [0]Total results: 1Info: last time an entry changed state: 28s ago (at 02:02:36 on 2019-06-21)$ verdi process show 2480Property       Value-------------  ------------------------------------type           CalcJobNodepk             2480uuid           c754f044-b190-4505-b121-776b79d2d1c8labeldescriptionctime          2019-06-21 02:02:32.894858+00:00mtime          2019-06-21 02:02:33.297377+00:00process state  Finishedexit status    0computer       [2] localhostInputs        PK  Type----------  ----  ------------------code        1351  Codeparameters  2479  Dictpotential   2478  EmpiricalPotentialstructure   2477  StructureDataOutputs          PK  Type-------------  ----  ----------arrays         2483  ArrayDataremote_folder  2481  RemoteDataresults        2484  Dictretrieved      2482  FolderData
calc_node.outputs.results.attributes
{'parser_version':'0.4.0b3','parser_class':'ForceParser','errors':[],'warnings':'','distance_units':'Angstroms','force_units':'eV/Angstrom','energy_units':'eV','energy':-18.1098859130104,'final_variables':{'ke':0.0,'pe':-18.1098859130104,'etotal':-18.1098859130104,'temp':0.0},'units_style':'metal'}
calc_node.outputs.arrays.attributes
{'array|forces':[1,4,3]}

优化计算

fromaiida.engineimportrun_get_nodeparameters=DataFactory('dict')(dict={'lammps_version':lammps_version(),'output_variables':["temp","etotal","pe","ke"],'thermo_keywords':[],'units':'metal','relax':{'type':'iso','pressure':0.0,'vmax':0.001,},"minimize":{'style':'cg','energy_tolerance':1.0e-25,'force_tolerance':1.0e-25,'max_evaluations':100000,'max_iterations':50000}})builder=code_lammps_opt.get_builder()builder.metadata.options=meta_optionsbuilder.structure=structurebuilder.potential=potentialbuilder.parameters=parametersresult,calc_node=run_get_node(builder)
$ verdi process list -D desc -a -l 1  PK  Created    Process label        Process State    Process status----  ---------  -------------------  ---------------  ----------------2486  1m ago     OptimizeCalculation  ⏹ Finished [0]Total results: 1Info: last time an entry changed state: 1m ago (at 02:09:54 on 2019-06-21)$ verdi process show 2486Property       Value-------------  ------------------------------------type           CalcJobNodepk             2486uuid           5c64433d-6337-4352-a0a8-0acb4083a0c3labeldescriptionctime          2019-06-21 02:09:50.872336+00:00mtime          2019-06-21 02:09:51.128639+00:00process state  Finishedexit status    0computer       [2] localhostInputs        PK  Type----------  ----  ------------------code        1344  Codeparameters  2485  Dictpotential   2478  EmpiricalPotentialstructure   2477  StructureDataOutputs          PK  Type-------------  ----  -------------arrays         2490  ArrayDataremote_folder  2487  RemoteDataresults        2491  Dictretrieved      2488  FolderDatastructure      2489  StructureData
calc_node.outputs.results.attributes
{'parser_version':'0.4.0b3','parser_class':'OptimizeParser','errors':[],'warnings':'','stress_units':'bars','distance_units':'Angstroms','force_units':'eV/Angstrom','energy_units':'eV','energy':-18.1108516231423,'final_variables':{'ke':0.0,'pe':-18.1108516231423,'etotal':-18.1108516231423,'temp':0.0},'units_style':'metal'}
calc_node.outputs.arrays.attributes
{'array|positions':[56,4,3],'array|stress':[3,3],'array|forces':[56,4,3]}

md计算

fromaiida.engineimportsubmitparameters=DataFactory('dict')(dict={'lammps_version':lammps_version(),'output_variables':["temp","etotal","pe","ke"],'thermo_keywords':[],'units':'metal','timestep':0.001,'integration':{'style':'nvt','constraints':{'temp':[300,300,0.5]}},"neighbor":[0.3,"bin"],"neigh_modify":{"every":1,"delay":0,"check":False},'equilibrium_steps':100,'total_steps':1000,'dump_rate':10,'restart':100})builder=code_lammps_md.get_builder()builder.metadata.options=meta_optionsbuilder.structure=structurebuilder.potential=potentialbuilder.parameters=parametersresult,calc_node=run_get_node(builder)
$ verdi process list -D desc -a -l 1  PK  Created    Process label    Process State    Process status----  ---------  ---------------  ---------------  ----------------2493  12s ago    MdCalculation    ⏹ Finished [0]Total results: 1Info: last time an entry changed state: 4s ago (at 02:15:02 on 2019-06-21)$ verdi process show 2493Property       Value-------------  ------------------------------------type           CalcJobNodepk             2493uuid           351b4721-10ff-406c-8f1c-951317091524labeldescriptionctime          2019-06-21 02:14:54.986384+00:00mtime          2019-06-21 02:14:55.282272+00:00process state  Finishedexit status    0computer       [2] localhostInputs        PK  Type----------  ----  ------------------code        1540  Codeparameters  2492  Dictpotential   2478  EmpiricalPotentialstructure   2477  StructureDataOutputs            PK  Type---------------  ----  --------------remote_folder    2494  RemoteDataresults          2496  Dictretrieved        2495  FolderDatasystem_data      2498  ArrayDatatrajectory_data  2497  TrajectoryData
calc_node.outputs.results.attributes
{'parser_version':'0.4.0b3','parser_class':'MdParser','errors':[],'warnings':'','time_units':'picoseconds','distance_units':'Angstroms','energy':-17.8464193488116,'units_style':'metal'}
calc_node.outputs.system_data.attributes
{'units_style':'metal','array|step':[100],'array|ke':[100],'array|pe':[100],'array|etotal':[100],'array|temp':[100]}
calc_node.outputs.trajectory_data.attributes
{'array|times':[101],'array|cells':[101,3,3],'array|steps':[101],'array|positions':[101,4,3],'symbols':['Ga','Ga','N','N']}

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java中的正则表达式使用什么正则表达式将掩码添加到带有certian模式的字符串中   java我无法使用myfaces 2.0.13和richfaces 4.0 final在Tomcat7中运行我的应用程序   java应用程序在POJO之间不能有重复的代码块   javamysql在Tomcat中创建内存泄漏   java将两种FragmentManager类型导入到同一个类中   需要java代码设计反馈:检查文件中的字符是否为允许的字符   为Java项目记录一个日志文件   java编译时,我收到错误:“unreachable statement”。我如何解决这个问题?   在java中启动运行带空格的外部exe   java如何设置展开/折叠文本视图的动画   java如何从2个整数中获得下一个最接近的整数?   JavaGooglePlaceAPI密钥   java在底部的导航栏中,即使我选择了那个图标,图标也不会突出显示。如何改变它?   java数据类型Double正在显示值0.0   java在不使用数组或任何使用数组或任何其他集合的函数的情况下查找用户给定的n个值的中值   java将dao实体类与mvc表单相链接是件好事吗   如果传递的是最终对象,是否仍应检查null?   java哈希代码出现而不是int,对象名称出现不正确?   针对Android的java Google游戏服务顽固错误