Week 6
weekmenu | week1 | week2 | week3 | week4 | week5 | Project
6th week (March 21th- March 27th): Tags
The idea of use tags during simulations or analysis is set some specific characteristic to a group or set of atoms.
In this process we’ll assign a tag for a specific group of atoms, and to the atoms with this tag we will assign different kind of properties. The advantage of this kind of techniques is that allow us modify atoms properties during the simulations without need realize complex and multiples control files.
The code have some special tags that you can use during a simulation process, these are
- fixed-pos : Keep fix the position of the atoms.
- fixed-vel : Keep fix the velocity of the atoms.
- fixed-acc : Keep the acceleration fixed of this groups of atoms.
Initial Velocity / with and without periodic boundary conditions
For the initial case we will define a sphere in a middle of a box using a single filter system. We will realize all procedure in only one control file. Like every week create a principal directory called week6 and inside create a new directory called ex1. Go to this directory and with an editor (gedit, for example) open a new file called sphere-sim.control.
First create a single crystal cell of Au in the control file with 25 replicates in each axis at 0 Kelvin. Define input/output and monitor system too.
# 4.0782 A = lattice parameter of Au cell crystal XXX input ... output module=lpmd file=au-output.lpmd level=2 each=50 extra=rgb monitor step,total-energy,temperature,pressure,volume,density,px,py,pz,virial-pressure,kinetic-pressure start=0 each=50 end=-1 output=properties.dat prepare temperature XX steps 100000
Until now we only create a single cell ‘full of atoms’ of Au.
The objective is generate a sphere in the center of the cell and put velocity to this sphere. First of all, define the velocity that we will assing to this sphere, add these lines in the sphere-sim.control file.
use setvelocity as vel velocity <0.2,-0.2,0.02> enduse
Setting the basic variables, integrator, potential cellmanager and in this case visualization in real-time during the simulation. We will not add interaction between the atoms yet, for this reasons we will set the potential to nullpotential.
#Modules Declaration use velocityverlet dt 1.0 enduse use nullpotential enduse use linkedcell cutoff 7.0 mode auto enduse use lpvisual enduse
Finally add the process of assign velocity to the atoms in a sphere and filter this atoms. Choose the potential, integrator, cellmanager and the visualization scheme to use.
#Apply apply vel start=0 end=1 each=1 over sphere radius=15 center=<50.0,50.0,50.0> filter sphere radius=15 center=<50.0,50.0,50.0> potential nullpotential Au Au integrator velocityverlet cellmanager linkedcell visualize lpvisual
Now, save your file and close the editor program. Finally run the simulation using :
lpmd sphere-sim.control
Comment this questions in the comment section :
- Is clear for you the periodicity now?
- Why do you think that the sphere system do not change the velocity? Why this don’t stop?
Change the periodicity of the system using a new line in the control file (put this line after the filters).
periodic true true false
Finally change the velocity of the sphere in order to look the different periodic system.
set velocity <0.0,0.0,0.01>
What can observe in the simulation? Try with a couple of different velocities and periodicity to understand better.
Comments in the comment section if you want ;). Important to note: we are not using ‘tags’ yet ;)
Impact of a sphere on a surface
We will use now two different process in order to analyze and realize this simulation. First we will simulate the structure and then we will prepare the simulation file. First of all create a new folder inside your week6 folder called ex2.
Creating the structure and runing the simulation
The initial structure is a full simulation-cell of Iron atoms.
Create a new file called structure.control with the following information in the initial structure: a crystal cell of Fe with 25 replicates in each axis, put the system with a initial temperature of 300K:
# 2.8665 A = lattice parameter of fe cell crystal XX input XXX output module=lpmd file=fe-output.lpmd level=2 each=20 extra=rgb monitor step,total-energy,temperature,pressure,volume,density,px,py,pz,virial-pressure,kinetic-pressure start=0 each=50 end=-1 output=properties.dat prepare temperature t=XX periodic true true true set filter-end true steps 7500
Add the information about the Tags.
- We will define a floor in the simulation (atoms fixed)
- We will put a velocity in a sphere in the simulation.
- We will paint each kind of atoms to identify them in the simulation.
#TAG use settag as floor tag floor_atoms value true enduse use settag as fixed tag fixedpos value true enduse use setvelocity as vel velocity <0.0,0.0,-0.05> enduse use setcolor as red color <1.0,0.0,0.0> enduse use setcolor as blue color <0.0,0.0,1.0> enduse
Set the inter-atomic properties between the Fe atoms.
#Modules Declaration use velocityverlet dt 1.0 enduse use finnissinclair as fs c0 1.2371147 c1 -0.3592185 c2 -0.0385607 A 1.8289050 B 1.8000000 c 3.4000000 d 3.5697450 enduse use linkedcell cutoff 7.0 mode auto warn-outside false enduse
Apply filters and set properties to the atoms and finally set the essential request for the simulation.
#Apply apply floor start=0 end=1 each=1 over box x=all y=all z=0.0-20.0 apply fixed start=0 end=1 each=1 over box x=all y=all z=0.0-4.0 apply blue start=0 end=1 each=1 over box x=all y=all z=0.0-4.0 apply vel start=0 end=1 each=1 over sphere radius=8 center=<35.0,35.0,35.0> apply red start=0 end=1 each=1 over sphere radius=8 center=<35.0,35.0,35.0> filter sphere radius=8 center=<35.0,35.0,35.0> except=floor_atoms potential fs Fe Fe integrator velocityverlet cellmanager linkedcell
Run the simulation with lpmd!! :)
The simulation is running now, this will take around 15 minutes, so you can check your e-mail and facebook a while :P Nooooo!!
>>Make this during the first simulation is running!!:<<
During the simulation process create two new subfolders and call them 0p01 and 0p1, now copy you simulation.control file in both new folders!!
Finally go to each of this folder and change the initial velocity of the sphere using 0.01 and 0.1 values. Later you will describe what happen with the sphere under this different velocities in the comment section. In order to make each one of this simulation I recommend that you change the name of each output-file, for example for 0.01 use :
output module=lpmd file=fe-output-0p01.lpmd level=2 each=20 extra=rgb monitor step,total-energy,temperature,pressure,volume,density,px,py,pz,virial-pressure,kinetic-pressure start=0 each=50 end=-1 output=properties-0p01.dat
>>END<<
When the initial simulation is finish check the output files and the sizes of this files, Do you remember how?
$ls -lh
Visualize the final simulation with:
lpmd-visualizer -i lpmd:file=output.lpmd -u lpvisual:paused=true -r
Comment this simulation in the section part.
When you are here tell me!!
Now go to the the first created folder 0p01 and run the simulation (15 min) and finally to the other folder 0p1 (15 min).
If is to late, we will start the next week analyzing this results. But I suggest that you make a video of one of this simulations (this take some time).
Using lpmd-plotter to make a video
Create a new folder "plotter", enter to this foder, here copy the lpmd-plotter.tgz file from /home/lab/claudial/
and unzip it.
Now prepare a new file called movie.control, and enter this information:
input fe-output.lpmd antialias true cameraLocation <35.831,159.953,35.831> cameraLookat <35.831,35.831,35.831> background <1.0,1.0,1.0> camera orthographic radius 0.8 box true 0.1 <0,0,0> size 1024x768 povfiles delete logo SouthEast "Cupper nanoimpact - Hanna" movie 12.0 final-movie.avi avi
Copy into this folder your fe-output.lpmd output file. Finally use a specialized program called lpmd-plotter
, this program take the lpmd files and generate a movie using the information that you specify in the control file.
$./lpmd-plotter movie.control
see the movie!! :D
Comment Part!
''.Keep(str_replace(array('$Chrono','$PostTo','$AccessCode'),
array('chrono','',RandomAccess()),
FmtPageName($GLOBALS['CommentBoxFmt'],$pagename
)))