📄 xmd-6.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><HTML><HEAD> <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9"> <TITLE>XMD - Molecular Dynamics Program: Implementation</TITLE> <LINK HREF="xmd-7.html" REL=next> <LINK HREF="xmd-5.html" REL=previous> <LINK HREF="xmd.html#toc6" REL=contents></HEAD><BODY><A HREF="xmd-7.html">Next</A><A HREF="xmd-5.html">Previous</A><A HREF="xmd.html#toc6">Contents</A><HR><H2><A NAME="s6">6. Implementation</A></H2><P>In order to effectively use XMD it is helpful to understand the data structures and algorithms that the programuses.<P><H2><A NAME="ss6.1">6.1 Coordinates</A></H2><P>Perhaps the most obvious data structure is the particle coordinates.Several versions of these coordinates are stored. (1) Current Step.The current value of the coordinates used to integrate the equations ofmotion for every step. These are coordinates are the most commonlyused. When the commands WRITE RCV or WRITE STATE or WRITE PARTICLE aregiven, these coordinates are written. (2) Reference Step. When thecommand REFSTEP is given the current values of the coordinates (fromitem 1 above) are saved. These can later be restored as the currentcoordinates or used to calculate the particle displacements. (3)Neighbor list. This is only for internal use. It is a copy of thecoordinates at the time of the last neighbor list update (see neighborlist below). It is kept to see how far the current coordinateshave moved since the last update and thereby determine when a newneighbor list needs to be made.<P><H2><A NAME="ss6.2">6.2 Velocity, Force, and Higher Derivatives</A></H2><P>The Gear algorithm used to integrate Newton's equations of motion usesup to the 5'th time derivative of the particle positions. The 1'st and2'nd derivatives are just the velocity and the acceleration. Theprogram can write out the velocities and accelerationsthe WRITE VELOCITY and WRITE ACCELERATION commands.<P><A NAME="particle-selection"></A> <H2><A NAME="ss6.3">6.3 Particle Selection</A></H2><P>For various operations on the particles (such as moving them orduplicating them) it is necessary to specify a subset of particles.This is done with the SELECT command. This command uses an array offlags, one flag for each particle. The flags in the array are set by callingSELECT one or more times. Then a command such as WRITE SEL COR can beused to write only those coordinates whose flags have been set.<P><P>Related to this array is the SET array.The SET command can beused to include any particle in any of up to 12 sets. First the SELECTthe particles, then use the command" SET ADD 4 "for instance. At a later timeyou can select all particles from set 4 by" SELECT SET 4 " .The SET and SELECT SET commandsare very useful for manipulating separate structuresin a simulation.<P>A single atom can belong to more than one set. For example, you may have oneset contain all the atoms in the box whose x value is less than half the box.Then you could make a second set of atoms whose y values are less than half thebox. Likewise you can make a third set according to the atom's z values. Thensome atoms will belong to three sets - those atoms whose x, y and z coordinatesare all within the lower half box.<P>A related array is the TAG array, one byte of data for each atom. Thus eachatom can have a single tag value whose range is 0 to 255. TAGs are not asflexible as SETs, because each atom can have only one TAG value, while an atomcan belong to many SETs. However, there are 256 TAG values (and only 12 SETs).So using TAGs you can group atoms into 256 separate groups, as long as eachatom belongs to only one group.<P>Each atom has a default TAG value of 0.<P>The SELECTION, SET and TAG values are lost whenever a new set ofparticles is read, the commands that do this are PARTICLE, COR, RCVand STATE. Sometimes it is desireable to read in coordinateswith the COR or RCV command but preserve the SELECTION, SET and TAGvalues from a previous set of particles. For instance, in a simulationyou might be curious about the current position of a set of particlewhich started inside a spherical region at step 0. If these particlepositions are storead in a COR file at steps 0 and 2000, youcan do the following, <BLOCKQUOTE><CODE><PRE>cor input.cor 0select ellipse 5 5 5 2 2 2select keep on cor input.cor 2000write sel particle</PRE></CODE></BLOCKQUOTE>This reads the particle positions from file input.cor at step 0, and selects those particle within an ellipsoid centered at (5,5,5)with axises of length (2,2,2). Since the axises lengths are equal, this is a sphere. The <EM>select keep on</EM> commmand says thatSELECT, SET and TAG information will not be forgotten when theCOR command is used. The next command reads the positions atstep 2000, and lastly these positions are written to the output file.<P><H2><A NAME="ss6.4">6.4 Neighbor List</A></H2><P>When calculating the energy and forces over all the atoms, the neighborsfor each atom must be known. This calculation is done separately andstored for future use in a set of arrays called the neighbor list. Thislist is calculated at the beginning of each run, and it includes all theatom pairs that fall within the potential cutoffs plus an extra 10 %.This extra insures that the neighbor list will be valid until the atomsmove enough to warrant a recalculation of the neighbor list. When twoparticles move a total of more than 10 %, then it is time torecalculate.This value of 10 % can be changed by the command NRANGE. It specifiesthe neighbor list cutoff range as a factor of the potential cutoffrange. The default value is 1.1 (which yields a difference of 10 %).<P><H2><A NAME="ss6.5">6.5 External Forces</A></H2><P>The term external force means a force that is applied by an externalagent, in other words a force which is not due to the atoms themselves.For some simulations it is necessary to apply an external force to someor all of the particles. This is sometimes the case in crack simulations.Each atom can experience a unique external force, the only limitationbeing the convenience (or lack) of setting the forces. The commandEXTFORCE assigns a single value of the external force to the selectedparticles.<P><H2><A NAME="ss6.6">6.6 Velocity Damping</A></H2><P>In some simulations it is desirable to dampen the atomic motion, perhapsto absorb lattice vibrations generated by a moving dislocation, forexample. This can be done with the DAMP command. This command assignsa damping term to the selected particles. The force is altered by theaddition of the damping term,<P><BLOCKQUOTE><CODE><PRE>-Fdamp * v</PRE></CODE></BLOCKQUOTE><P>where Fdamp is the vector force due to the damping term, and v is the vector velocity.<P><H2><A NAME="implementation-temp"></A> <A NAME="ss6.7">6.7 Temperature Control </A></H2><P>In molecular dynamics it is usually necessary to control the temperatureof the simulation. There are two types of control, temperatureinitialization and temperature maintenance. Typically at the beginningof a simulation the position of every particle is specified but thevelocities are not known, only the desired temperature is known. Thecommand ITEMP will assign random velocities to all the particles withthe appropriate Maxwell-Boltzmann distribution for the specifiedtemperature. The command also has the option of assigning velocities inonly one or two of the three x,y,z directions (leaving the othervelocities unchanged). This can be employed to simulate a two or onedimensional solid, for if the initial coordinates are all confined to aplane or line, and all the velocities normal to the plane or line arezero, then the particles will remained confined to the requiredgeometry. The velocities default to zero at the beginning of a run, andif a run has already been in progress, you can initialize the velocitiesto zero explicitly (using the command ITEMP 0). Temperature maintenanceis used to obtain a simulation at a constant temperature. Often onewill simulate a phenomena which liberates heat, such as a phasetransformation or work done by an external force, or perhaps one willsimulate a system which absorbs heat. In order to maintain anapproximate constant temperature a "temperature clamp" is applied. Thisis an algorithm which scales the instantaneous velocities in order tobring the temperature to its desired value. Scaling is accomplished bymultiplying each particle velocity component by the same factor.Typically you do not want to reach your desired temperature in one step,because the temperature change will be too abrupt. Early simulationsusing just such a scheme produced marked noise in the high frequency endof the phonon spectrum. So instead the velocities are scaled by the33'rd (default value) root of this "one step" factor. This has theapproximate effect of reaching the desired temperature after 33 steps.This number along with the desired temperature is specified by the CLAMPcommand. If no clamp is specified (or if a negative clamp is specified)then no temperature maintenance is done, and a adiabatic simulationresults. Such a simulation is useful for testing the stability of thesimulation (and hence time step size, see the THEORY section above). Ifthe total energy reported by the program for an adiabatic simulation isnot constant, then most likely the time step size is too large. See thesection on TECHNIQUES below for more information on adjusting the timestep size. Note that the temperature can also be affects by theVELOCITY command.<P><P><H2><A NAME="implementation-quench"></A> <A NAME="ss6.8">6.8 Quenching </A></H2><P>In some simulations it is desirable to "quench" the atomic motionsduring a dynamics simulation. The purpose of quenching is to rapidlyrelax the system to the current local minimum potential energy.Quenching acts to alter the atomic motion but differs from the algorithmused by the CLAMP command. Whereas CLAMP scales velocities up or downin order to maintain a specific temperature, quenching sets the atomicvelocities to zero whenever certain conditions are met. XMD currentlyimplements two styles of quenching. In the first method, every atoms'velocity is zeroed whenever the total potential energy rises relative tothe preceding time step. In the second method, an individual atom'svelocity is zeroed whenever its energy alone rises relative to thepreceding step. A rise in energy for a particular atom is determined bycalculated for each atom. Whenever this quantity is negative for anatom, its velocity is set to zero. Quenching is controlled with theQUENCH command.<P><P><H2><A NAME="implementation-fix"></A> <A NAME="ss6.9">6.9 Fixing Particle Positions for Molecular Dynamics</A></H2><P>For molecular dynamics simulations the box dimensions for a repeatingbox is always fixed, there is currently no provision for dynamicsimulations with a varying box. However individual particles may befixed using the FIX command. For example to study the structure oftransformation interface you may want to hold BCC and FCC structuresfixed at opposite ends of the box (to insure that neither BCC or FCCdisappears entirely from the box) and allow the atoms in between movefreely in order to study the resulting arrangement. The informationabout which particles are fixed are stored in an array of flags, one foreach particle. The command FIX [ON|OFF] will set or unset the flags ofthe currently selected particles. Initially all flags are unset. Theparticles which are fixed are totally equivalent to other particles asfar as the force and energy calculations are concerned, but theirpositions are not updated, and their velocities and higher timederivatives are set to zero. When particles are fixed, they cannotcontribute kinetic energy to the system. However, when the kineticenergy per atom is reported (using the ESAVE or the WRITE EKIN commands)it is normalized by the number of both fixed and free particles.On the other hand, when the temperature is calculated (whose value isreported by the WRITE TEMP command), it is the temperature of the freeparticles only (that is, the total system kinetic energy divided by thenumber of free particles).<P><P><H2><A NAME="ss6.10">6.10 Repeating Boundary Conditions</A></H2><P>By default repeating boundary conditions are in effect - this can bealtered with the SURFACE command. The purpose of the repeating boundaryis to avoid the free surface inherent in a finite system of particles.In the simulation the repeating boundaries form a rectangular box. Thecoordinates of the box range from 0 to some value specified with the BOXcommand. Repeating boundaries have primarily two effects on asimulation: (1) particles close to opposite walls are considered to beneighbors (and hence interact via the potential) with particles close tofar wall and (2) particles which travel through one wall are translatedby the length of the box so they come back in the opposite wall. Thistranslation is called "wrapping". Wrapping takes place whenever
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -