Lammps程序.ppt.ppt_第1页
Lammps程序.ppt.ppt_第2页
Lammps程序.ppt.ppt_第3页
Lammps程序.ppt.ppt_第4页
Lammps程序.ppt.ppt_第5页
已阅读5页,还剩44页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

lammps程序 关于lammps基础知识 lammps的输入文件一般分为4个部分initialization atomdefinition settings runasimulation 后面的两个部分可以按照需要多次重复 1 initialization 在你的模拟体系定义之前 一些参数必须要被设置 相关的命令有 units dimension newton processors boundary atom style atom modify 其中 units 选择单位系统 lammps提供了lj real metal三种单位系统 dimension 2d模拟还是3d模拟 默认是3d boundary 边界条件 周期性边界or自由边界 atom style 定义你的模拟体系中的原子属性 注意这个style要区分后面设置力场参数时命令里提到的atomtype 还有 这些命令告诉lammps在你的模拟中使用何种力场 pair style bond style angle style dihedral style improper style 在lj类型中 所有变量都是无单位的 实际量换算成简化单位量有系列公式缺省状态默认为lj类型 2 atomdefinition lammps提供3种方式定义原子 通过read data或read restart命令从data或restart文件读入 这些文件可以包含分子拓扑结构信息 按照晶格的方式创建原子 不包含分子拓扑信息 你会用到这几个命令 lattice region create box create atoms 已经设置好的原子可以用replicate命令复制以生成一个更大规模的模拟体系 3 settings 原子和分子的拓扑信息定义好后 你要制定一系列的设置 力场系数 模拟参数 输出选项等等 力场系数可以通过这些命令定义 pair coeff bond coeff angle coeff dihedral coeff improper coeff kspace style dielectric special bonds 注意 其实力场系数也可以在data文件中制定 各种模拟参数由这些命令设置 neighbor neigh modify group timestep reset timestep run style min style min modify suppliment fix命令是lammps中很重要的一个命令 它包括很多子命令 可以施加一系列的边界条件 时间积分 诊断选项等等 fix指令的用途是对一组原子进行定义 可以用于更新原子的位置 速度 控制温度 加常力 施加边界条件等 当两个或更多fix在同一过程中作用时 根据程序中的先后顺序执行fix指令 fix指令可通过unfix指令来消除 形式为unfixfix id 模拟过程中通过下面的命令制定lammps进行各种计算 compute compute modify variable 输出选项由thermo dump restart命令设置 fixidgroup idstyleargs id user assignednameforthefixid是用户自己定义的名字 便于通过fix定义 group id idofthegroupofatomstoapplythefixto style oneofalonglistofpossiblestylenames seebelow args argumentsusedbyaparticularstyleexamples fix1allnvefix3allnvttemp300 0300 00 01fixminetopsetforce0 0null0 0 对于run100start0stop1000这个语句来说 主要与fix语句配合使用 fix1allnvt200 0300 01 0这两个指令的功能是在接下来的1000步运行中 每run100步 温度都要从200度升到300度 fix1allnvt200 0300 01 0对于左侧的一组指令 温度随着从0到10000步的执行run1000start0stop10000逐渐升至300 0度 是一个发生在整个过程的渐变行为run1000start0stop10000 run1000start0stop10000 共10个 至于preandpost大概是这样的 preno的意思是跳过初始设定阶段 如果以下的计算是承接之前运行命令的话 意思是采用之前的参数 但是如果该run指令是第一个指令是 该设定会被忽略 若是postno 则跳过fulltimingsummary 输出one linesummarytiming every的作用是将一个run分成一系列较短的runsvariableqequalxrun6000every2000 printcoord q 每运行2000步输出一次某原子的x坐标值 要设定一组原子的温度 那么用group命令定义哪些原子属于这个组才行 每个命令的详细介绍中的restrictions部分会说明要使用该命令定义的时候哪些命令必须要被预先定义 如果你的输入文件书写的格式有问题 lammps在执行的时候会提示error或者warning 出现类似信息时 你可以到手册的第九章中查询原因 4 runasimulation 使用run命令开始一个分子动力学模拟 用minimize命令来实施能量最小化 molecularstatics 使用temper命令来进行paralleltempering replica exchange simulation commandslistedbycategory initialization atom modify atom style boundary dimension newton processors units atomdefinition create atoms create box lattice read data read restart region replicate forcefields angle coeff angle style bond coeff bond style dielectric dihedral coeff dihedral style improper coeff improper style kspace modify kspace style pair coeff pair modify pair style pair write special bonds settings communicate dipole group mass min modify min style neigh modify neighbor reset timestep run style set shape timestep velocity fixes fix fix modify unfix computes compute compute modify uncompute output dump dump modify restart thermo thermo modify thermo style undump write restart actions delete atoms delete bonds displace atoms displace box minimize run temper miscellaneous clear echo if include jump label log next print shell variable lammps中特殊符号含义 1 命令行后的 表示这一行跟下一行是同一条命令 2 命令行最开始的 表示这一行在执行过程中被忽略 你可以用它来写注释 3 是跟声明变量有关系的 4 命令行被tabs spaces间隔成各个 words 注意这里的 words 可以包含字母 数字 下划线 或标点符号 5 一行中第一个词是命令名 后续的词是相关的参数 6 双引号内的文字空格被整体地当作一个参数 其中的 或 就没有前面说的作用了 purecucrystal 1 initializationunitsmetal金属单位制 mass grams mole质量 g moldistance angstroms距离 埃time picoseconds时间 皮秒energy ev能量 velocity angstroms picosecond速度force ev angstrom力 temperature degreesk温度pressure bars压力dynamicviscosity poise动力学粘性系数 泊charge multipleofelectroncharge 1 0isaproton 电荷 电荷整数倍dipole charge angstroms偶极矩electricfield volts angstromdensity gram cm dimtorque ev力矩 atom stylecharge原子属性 带电粒子系统dimension3维数 3boundaryppp边界条件 pisperiodicp指周期性fisnon periodicandfixed 固定非周期sisnon periodicandshrink wrapped 收缩的非周期性的misnon periodicandshrink wrappedwithaminimumvalue有最小值的收缩的非周期 2 atomdefinitionlatticefcc3 615晶格点阵 latticesofstylesc fcc bcc anddiamondare3dlatticesthatdefineacubicunitcellwithedgelength 1 0 fcc类型的点阵是定义的一个边长为1 0埃的立方体三维晶格点阵specifyingscale 3 wouldcreateacubiclatticewithaspacingof angstroms 边长为3 埃 regionboxblock040404区域 以040404为立方箱 边界条件 create box1box在上述区域创建一个只有1个原子类型的模拟箱theargumentnisthenumberofatomtypesthatwillbeusedinthesimulationcreate atoms1box thiscommandcreatesatomsonalattice orasingleatom orarandomcollectionofatoms asanalternativetoreadingintheircoordinatesexplicitlyviaaread dataorread restartcommand asimulationboxmustalreadyexist whichistypicallycreatedviathecreate boxcommand beforeusingthiscommand alatticemustalsobedefinedusingthelatticecommand theonlyexceptionsareforthesinglestylewithunits boxortherandomstyle 这个命令用于在晶格点阵 单个原子和原子随机组合中创建原子 这样通过从文件中读数据命令读出原子在晶格中的相对位置来替代原子的位置坐标 fortheboxstyle thecreate atomscommandfillstheentiresimulationboxwithatomsonthelattice ifyoursimulationboxisperiodic youshouldinsureitssizeisamultipleofthelatticespacings toavoidunwantedatomoverlapsattheboxboundaries ifyourboxisperiodicandamultipleofthelatticespacinginaparticulardimension lammpsiscarefultoputexactlyoneatomattheboundary oneithersideofthebox notzeroortwo 对于箱类型 创建原子命令是针对整个模拟箱的 同时原子必须在格点上 若模拟箱是周期性的 你必须确保它的大小是一个晶格间距的整数倍以避免边界上不必要的原子重叠 若箱在特定的维度是周期性的 并且它的大小是一个晶格间距的整数倍 lammps就会在边界两侧各放一个原子 mass163 54只有一种原子类型 且该原子类型的质量为63 54g molpair stylecomb电荷之间作用力场类型为 晶格体系之间的作用势settheformula s lammpsusestocomputepairwiseinteractions inlammps pairpotentialsaredefinedbetweenpairsofatomsthatarewithinacutoffdistanceandthesetofactiveinteractionstypicallychangesovertime 确立lammps计算粒子之间相互作用的方程式 pair coeff bcuspecifythepairwiseforcefieldcoefficientsforoneormorepairsofatomtypes thenumberandmeaningofthecoefficientsdependsonthepairstyle 指定一种或多种粒子对之间势能的力场系数 其含义和数值由粒子对类型决定 系数由cu的作用力场决定 neighbor0 5bin邻位原子参数为0 5 以二机制算法thestylevalueselectswhatalgorithmisusedtobuildthelist thebinstylecreatesthelistbybinningwhichisanoperationthatscaleslinearlywithn p thenumberofatomsperprocessorwheren totalnumberofatomsandp numberofprocessors 类型选择决定建立列表时的算法 其中 bin类型表示通过分级建立列表该列表以n p的规模线性拓展 neigh modifyevery1delay1checkyes该命令用于设置影响粒子之间势能和列表的参数 theevery delay check andonceoptionsaffecthowoftenlistsarebuiltasasimulationruns thedelaysettingmeansneverbuildanewlistuntilatleastnstepsafterthepreviousbuild theeverysettingmeansbuildthelisteverymsteps afterthedelayhaspassed ifthechecksettingisno thelistisbuiltonthe1ststepthatsatisfiesthedelayandeverysettings ifthechecksettingisyes thenthelistisonlybuiltonaparticularstepifsomeatomhasmovedmorethanhalftheskindistance specifiedintheneighborcommand sincethelastbuild iftheoncesettingisyes thentheneighborlistisonlybuiltonceatthebeginningofeachrun andneverrebuilt thisshouldonlybedoneifyouarecertainatomswillnotmovefarenoughthatthelistshouldberebuilt e g runningasimulationofacoldcrystal theevery delay check andonce这些选项会影响随着模拟的进行 列表多久会更新一次 延迟设置意味着不建立一个新的列表 直到在以前的版本进行n个步骤后 every设置意味着每m步生成列表 延迟后已通过 如果ifthechecksettingisno 该列表是建立在第一步基础上 并满足every delay设置的 如果检查设置为yes 则该列表是建立在一个特定的步骤上 如果一些原子移动自上次构建一半以上的小距离 neighbor命令中指定 如果once设置yes的话 那么列表中只有在每次运行开始时创建 而从来没有重建 你必须确定原子不会运动的太远以至于你必须重建列表 例如运行模拟冷晶体 dump1allcustom10tmp dumpidtypexsyszsqvxvyvzfxfyfz输出单个原子的热力学信息 对于所有的原子体系以1为自定义名字 以常规文本类型输出 每10步输出一次结果到tmp dump文件 并且输出一下参数 自定义名字 类型 原子的分数坐标 象限 速度 dump modify1appendyeselementcu更改输出值及文本的格式 fix1allnve指定nve是微正则系综 宏观上的孤立系统 即n v e三个参数是不变的 setafixthatwillbeappliedtoagroupofatoms inlammps a fix isanyoperationthatisappliedtothesystemduringtimesteppingorminimization fixesperformtheiroperationsatdifferentstagesofthetimestep设定对于一组原子适用的常数 一个常数代表一个适用于在时间步和最小化过程的系统的操作 常数在特定时间步中实现其操作 timestep0 00020时间步长thermo stylecustomsteptempetotalpeevdwlecoulpressvollxlylzxz输出 系统常规属性 时间步长 温度 总能量 势能 范德瓦耳斯能量 库伦能 压力 体积 箱的边长 三斜晶系 非正交 的模拟箱的倾斜角 对比press stress thermo style 同样是计算力的 三者有什么主要区别呢 press是系统力 stress是原子应力 用thermo style输出的pxx是整个系统 包括边界 全部原子的势能应力在xx方向分力的平均值 为标量 thermo style输出的press是整个系统 包括边界 全部原子的势能应力6方向合力的平均值 为标量 computestress atom算出来的是每个原子的6个方向应力值 注意lammps算出来的这个值是没有除体积的 每个原子都有一个这样的vector 里面有6个量 thermo modifynormyessetoptionsforhowthermodynamicinformationiscomputedandprintedbylammps为热动力学信息的计算设置选项normkeyworddetermineswhethervariousthermodynamicoutputvaluesarenormalizedbythenumberofatomsornot dependingonwhetheritissettoyesorno differentunitstyleshavedifferentdefaultsforthissetting seebelow evenifnormissettoyes avalueisonlynormalizedifitisan extensive quantity meaningthatitscaleswiththenumberofatomsinthesystem norm关键词设置为是或者否 决定不同的热动力学结果的数值是否通过原子的数量进行归一化求解 不同的单位类型有对于设置具有不同的默认值 即使被设定为是 数值也只有在数值很大时才被归一化 即它可以和体系的原子数目相比时才要归一化 velocityallcreate10 12398378setorchangethevelocitiesofagroupofatomsinoneofseveralstyles foreachstyle therearerequiredargumentsandoptionalkeyword valueparameters thecreatestylegeneratesanensembleofvelocitiesusingarandomnumbergeneratorwiththespecifiedseedasthespecifiedtemperature 设置及改变一种或多种原子类型的原子的速度 对于每种类型的原子 有特定自变量和特定的关键词或参量 creat类型通过一个随机数生成设备 利用特定的初始温度创建一个整体速度 thermo1n outputthermodynamicseveryntimesteps每n步输出一次热动力学量的结果run10运行10次 theendofpurecu supliment ps的输出文件主要可以分为三种 一种是log lammps 这里面记录了整个计算过程屏幕上显示的所有信息 可由thermo thermo modify等命令控制 另一种是输出应力 能量 原子位置 速度等等信息 由dump命令控制输出文件 第三种是断点续算的restart文件输出信息 由write restart命令控制 dump dump命令主要是用来输出计算后单个原子的相关信息的 dumpidgroup idstylenfileargsid 自己给这个dump命令定义的一个代号 随便取 group id 那些信息需要被输出的原子群 预先定义好group style 类型n 没经过多少时间步输出信息file 输出名称args 相关参数 每个类型不同 注意 对于周期性边界条件而言 输出的原子坐标可能不在盒子定义的范围之中 因为becauseperiodicboundaryconditionsareenforcedonlyontimestepswhenneighborlistsarerebuilt 个人翻译 不很确定 只有当临位原子列表被更新的时候 周期性边界条件才执行 同时还需注意的是 当lammps并行运算的时候 输出的原子信息的秩序可能有点混乱 因为 同一个量的相关信息可能来自于不同的处理器 一般这种情况多出现在atom bond andcustomstyles 对于stylexyz 当group的值不是all的时候也会出现这种情况 而dcdandxtcstyles这两种类型输出的原子都是按顺序排列好的 当xyz的group是all的时候 原子也是按序排列的 style这个关键词定义了输出量以及相关的格式 通过dump modify

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论