您好,欢迎访问三七文档
当前位置:首页 > 机械/制造/汽车 > 综合/其它 > lammps常用命令(合集)
LAMMPSname=nameofvariabletodefinestyle=deleteorindexorlooporworldoruniverseorulooporstringorformatorgetenvorfileoratomfileorequaloratomdelete=noargsindexargs=oneormorestringsloopargs=NN=integersizeofloop,loopfrom1toNinclusiveloopargs=NpadN=integersizeofloop,loopfrom1toNinclusivepad=allvalueswillbesamelength,e.g.001,002,...,100loopargs=N1N2N1,N2=loopfromN1toN2inclusiveloopargs=N1N2padN1,N2=loopfromN1toN2inclusivepad=allvalueswillbesamelength,e.g.050,051,...,100worldargs=onestringforeachpartitionofprocessorsuniverseargs=oneormorestringsuloopargs=NN=integersizeofloopuloopargs=NpadN=integersizeoflooppad=allvalueswillbesamelength,e.g.001,002,...,100stringarg=onestringformatargs=vnamefstrvname=nameofequal-stylevariabletoevaluatefstr=C-styleformatstringgetenvarg=onestringfilearg=filenameatomfilearg=filenameequaloratomargs=oneformulacontainingnumbers,thermokeywords,mathoperations,groupfunctions,atomvaluesandvectors,compute/fix/variablereferencesnumbers=0.0,100,-5.4,2.8e-4,etcconstants=PIthermokeywords=vol,ke,press,etcfromthermo_stylemathoperators=(),-x,x+y,x-y,x*y,x/y,x^y,x==y,x!=y,x=y,x=y,x=y,x&&y,x||y,!xmathfunctions=sqrt(x),exp(x),ln(x),log(x),abs(x),sin(x),cos(x),tan(x),asin(x),acos(x),atan(x),atan2(y,x),random(x,y,z),normal(x,y,z),ceil(x),floor(x),round(x)ramp(x,y),stagger(x,y),logfreq(x,y,z),stride(x,y,z),vdisplace(x,y),swiggle(x,y,z),cwiggle(x,y,z)groupfunctions=count(group),mass(group),charge(group),xcm(group,dim),vcm(group,dim),fcm(group,dim),bound(group,xmin),gyration(group),ke(group),angmom(group,dim),torque(group,dim),inertia(group,dimdim),omega(group,dim)regionfunctions=count(group,region),mass(group,region),charge(group,region),xcm(group,dim,region),vcm(group,dim,region),fcm(group,dim,region),bound(group,xmin,region),gyration(group,region),ke(group,reigon),angmom(group,dim,region),torque(group,dim,region),inertia(group,dimdim,region),omega(group,dim,region)specialfunctions=sum(x),min(x),max(x),ave(x),trap(x),slope(x),gmask(x),rmask(x),grmask(x,y),next(x)atomvalue=id[i],mass[i],type[i],mol[i],x[i],y[i],z[i],vx[i],vy[i],vz[i],fx[i],fy[i],fz[i]atomvector=id,mass,type,mol,x,y,z,vx,vy,vz,fx,fy,fzcomputereferences=c_ID,c_ID[i],c_ID[i][j]fixreferences=f_ID,f_ID[i],f_ID[i][j]variablereferences=v_name,v_name[i]Examples:variablexindexrun1run2run3run4run5run6run7run8variableLoopVarloop$nvariablebetaequaltemp/3.0variableb1equalx[234]+0.5*volvariableb1equalx[234]+0.5*volvariablebequalxcm(mol1,x)/2.0variablebequalc_myTempvariablebatomx*y/volvariablefoostringmyfilevariableffilevalues.txtvariabletempworld300.0310.0320.0${Tfinal}variablexuniverse123456789101112131415variablexuloop15padvariablestrformatx%.6gvariablexdeleteDescription:Thiscommandassignsoneormorestringstoavariablenameforevaluationlaterintheinputscriptorduringasimulation.Variablescanthusbeusefulinseveralcontexts.Avariablecanbedefinedandthenreferencedelsewhereinaninputscripttobecomepartofanewinputcommand.Forvariablestylesthatstoremultiplestrings,thenextcommandcanbeusedtoincrementwhichstringisassignedtothevariable.Variablesofstyleequalstoreaformulawhichwhenevaluatedproducesasinglenumericvaluewhichcanbeoutputeitherdirectly(seetheprint,fixprint,andruneverycommands)oraspartofthermodynamicoutput(seethethermo_stylecommand),orusedasinputtoanaveragingfix(seethefixave/timecommand).Variablesofstyleatomstoreaformulawhichwhenevaluatedproducesonenumericvalueperatomwhichcanbeoutputtoadumpfile(seethedumpcustomcommand)orusedasinputtoanaveragingfix(seethefixave/spatialandfixave/atomcommands).Variablesofstyleatomfilecanbeusedanywhereinaninputscriptthatatom-stylevariablesareused;theygettheirper-atomvaluesfromafileratherthanfromaformula.Inthediscussionthatfollows,thenameofthevariableisthearbitrarystringthatisthe1stargumentinthevariablecommand.Thisnamecanonlycontainalphanumericcharactersandunderscores.Thestringisoneormoreofthesubsequentarguments.Thestringcanbesimpletextasinthe1stexampleabove,itcancontainothervariablesasinthe2ndexample,oritcanbeaformulaasinthe3rdexample.Thevalueisthenumericquantityresultingfromevaluationofthestring.Notethatthesamestringcangeneratedifferentvalueswhenitisevaluatedatdifferenttimesduringasimulation.IMPORTANTNOTE:Whentheinputscriptlineisencounteredthatdefinesavariableofstyleequaloratomthatcontainsaformula,theformulaisNOTimmediatelyevaluatedandtheresultstored.SeethediscussionbelowaboutImmediateEvaluationofVariablesifyouwanttodothis.Thisisalsotrueoftheformatstylevariablesinceitevaluatesanothervariablewhenitisinvoked.IMPORTANTNOTE:Whenavariablecommandisencounteredintheinputscriptandthevariablenamehasalreadybeenspecified,thecommandisignored.ThismeansvariablescanNOTbere-definedinaninputscript(with2exceptions,readfurther).Thisistoallowaninputscripttobeprocessedmultipletimeswithoutresettingthevariables;seethejumporincludecommands.Italsomeansthatusingthecommand-lineswitch-varwilloverrideacorrespondingindexvariables
本文标题:lammps常用命令(合集)
链接地址:https://www.777doc.com/doc-5099022 .html