####################################################################### # 17 Jul 96 # # Example: Setting linear and angular velocities with # # the VELOCITY command # # # ####################################################################### # # # The VELOCITY command sets the linear or angular velocity # # of the center of mass of a group of selected particles. # # # # In this example, we create two Ni FCC cubes, each 3.5x3.5x3.5 # # cell lengths and separated by 2 unit cell lengths. Each # # cube is given a velocity toward the other, and each is rotated in # # opposite directions about an axis that runs through their center # # of masses and points in the Z direction. # # # ####################################################################### # The format of the VELOCITY command is # # # # VELOCITY LINEAR dx dy dz magnitude # # or # # VELOCITY ANGULAR dx dy dz magnitude # # # # where dx dy dz are the components of the axis direction # # (only the direction of the vector d is used) # # magnitude is either the linear velocity in (cm/sec) # # or the angular velocity (in radians/sec) # # # ####################################################################### # # Allocate space for particles # allocate 10000 100000 # # Read Nickel-Aluminum potential # read /cmd/nial.pot # # Set large box (most of box will be empty) # box 13 13 13 # # Create a 3.5x3.5x3.5 FCC cube with one corner at the origin # particle 4 1 0.25 0.25 0.25 1 0.25 0.75 0.75 1 0.75 0.25 0.75 1 0.75 0.75 0.25 dup 3 1 0 0 dup 3 0 1 0 dup 3 0 0 1 # # Trim off extra 0.5 unit cells # # NOTE: This leaves 'extra' layer on trailing surfaces, # so that every surface atom is one of the fcc unit cell # 'corners'. The result is the cube looks more symetrical. # select not box 0 0 0 3.5 3.5 3.5 remove # # Store first cube in set 1 # select all set add 1 # # Move cube toward center of box # select all move 2 4.75 4.75 # # Make second cube displaced 5.5 unit cells # Now the midpoint of the two cubes is centered in the box. # dup 1 5.5 0.0 0.0 # # Store second cube as set 2 # select not set 1 set add 2 # # Scale up to Ni unit cell length # scale 3.52 # # Set masses # select all # MASS1 is set in nial.pot file mass MASS1 # # Set linear velocities for first and second cube separately # select set 1 velocity linear 1 0 0 2e4 select set 2 velocity linear 1 0 0 -2e4 # # Set angular velocities for first and second cube separately # select set 1 velocity angular 0 0 1 2e11 select set 2 velocity angular 0 0 1 -2e11 # # Set adiabatic simulation (total energy conserved) # clamp -1 # # Save energy every 10 time steps (to insure conservation of energy) # esave 10 velocity.e # # Write initial coordinates (for making movie after) # write cor velocity.cor # # Perform 1000 simulations steps (50*20) # Save coordinates after every 20 steps # repeat 50 cmd 20 write cor +velocity.cor end