Jmol.sh: Difference between revisions

From Wiki
Jump to navigation Jump to search
No edit summary
Qli (talk | contribs)
No edit summary
 
(7 intermediate revisions by 2 users not shown)
Line 8: Line 8:


2) Download the Jmol package:  https://sourceforge.net/projects/jmol/files/Jmol/
2) Download the Jmol package:  https://sourceforge.net/projects/jmol/files/Jmol/
[[Image:Jmol1.png]]


3) Extract the file and you will get a folder named jmol-14.29.14(the numbers are depend on the versions your download), get into this folder's path in the terminal and run:
3) Extract the file and you will get a folder named jmol-14.29.14(the numbers are depend on the versions your download), get into this folder's path in the terminal and run:


''chmod u+x jmol.sh''
'''chmod u+x jmol.sh'''


4)  In my case, I extract the file to the ~/Documents folder:
4)  In my case, I extract the file to the ~/Documents folder:


''cd  ~/Documents/jmol-14.29.14 ''
'''cd  ~/Documents/jmol-14.29.14 '''


''chmod u+x jmol.sh ''  
'''chmod u+x jmol.sh '''  


5) Edit your ~/.bashrc file:
5) Edit your ~/.bashrc file:


''export PATH=$PATH:~/Documents/jmol-14.29.14''
'''export PATH=$PATH:~/Documents/jmol-14.29.14'''


6) Source your ~/.bashrc file:    ''source  ~/.bashrc''
6) Source your ~/.bashrc file:    '''source  ~/.bashrc''' or '''.  ~/.bashrc'''
  or   ''.  ~/.bashrc''




== Visualization Steps ==
== Visualization Steps ==


7 Go to your frequency calculation path and run the steps as shown in the figure:
[[Image:Jmolrun.jpg]]


In terminal, go to your frequency calculation path and run the steps as shown in the figure:
Step1: grep f/i OUTCAR 
To get the wave number of imaginary frequencies
Step2: jmol.sh OUTCAR   
Open OUTCAR with Jmol package. (for OUTCAR_jmol file,  see Note 2)


Step1: grep f/i OUTCAR  To get the wave number of imaginary frequencies
Step2: jmol.sh OUTCAR    Open OUTCAR with Jmol package
Step3: Click Tools and click AtomSetChooser
Step3: Click Tools and click AtomSetChooser
Step4: Select the modes
Step4: Select the modes
Step5: Click the Arrow button in the bottom to start visualizing.
Step5: Click the Arrow button in the bottom to start visualizing.




Note1:
For the imaginary frequencies.  In the interface of Jmol, the minus symbol is not displayed. So you need to check them firstly with the command:  grep f/i OUTCAR
Then, you will get the wave number of imaginary frequencies and visualize the vibration modes by comparing the wave numbers.


'''Note1:'''


Note2:
For the imaginary frequencies. In the interface of Jmol, the minus symbol is not displayed. So you need to check them firstly with the command:  ''' grep f/i OUTCAR'''
In the  step2 in the figure, I used the command:  jmol.sh OUTCAR_jmol
This is because of the bug of Jmol when it reads OUTCAR in frequency calculations with  NWRITE = 0.
When we use NWRITE = 0, the important tags for jmol to read the element information from OUTCAR is not written.
So, if you use NWRITE = 0 and run jmol.sh OUTCAR directly, you will find that all your atoms are in the same color.


To solve this bug, there are two options:
Then, you will get the wave number of imaginary frequencies and visualize the vibration modes by comparing the wave numbers.
Method-1) Use NWRITE = 2 and run jmol.sh OUTCAR
Method-2) Add more information to the OUTCAR  by hand.


i) grep TIT POTCAR  > title 
ii) copy the outputs of above commands and paste them to the OUTCAR:
cat title OUTCAR >> OUTCAR_jmol
iii) jmol.sh OUTCAR_jmol


If you have any problems in visualizing the frequencies, do not hesitate to tell me.
'''Note2:'''


Enjoy.
In the  step2 in the figure, I used the command:  '''jmol.sh OUTCAR_jmol '''
This is because of the bug of Jmol when it reads OUTCAR in frequency calculations with  NWRITE = 0.


Qiang
When we use NWRITE = 0, the important tags for jmol to read the element information from OUTCAR is not written.


So, if you use NWRITE = 0 and run jmol.sh OUTCAR directly, you will find that all your atoms are in the same color.


1)


To solve this bug, there are two options:


'''Method-1)''' Use NWRITE = 2 and  run jmol.sh OUTCAR




'''Method-2)''' Add more information to the OUTCAR  by hand.


i) '''grep TIT POTCAR  > title''' 


uncompress it and compile it: ''f77 Cell.f -o x.Cell'' or ''ifort Cell.f -o x.Cell'' or ''gfortran Cell.f -o x.Cell''. Place it in your ~/bin folder.
ii) copy the outputs of above commands and paste them to the OUTCAR:


2) Download the script and uncompress it. Make it executable with the command: ''chmod ug+x nfreq.sh'':
'''cat title OUTCAR >> OUTCAR_jmol'''
[[Image:nfreq.tgz]]


iii) jmol.sh OUTCAR_jmol




3) Change in line of''nfreq.sh'': ''path=/home/lbellarosa/bin/exe/Cell'' with the path of the directory where you put the executable (i.e. ''path=/home/yourusername/bin'').
If you have any problems in visualizing the frequencies, do not hesitate to tell me. Enjoy!


4) Now you can run the script typing:
nfreq.sh OUTCAR


Be sure you are using standard pseudopotentials (not soft nor hard). Otherwise change the name of the pseudopotentials in OUTCAR (i.e O_h ==> O)
Qiang

Latest revision as of 11:27, 16 May 2018

go back to Main Page, Computational Resources, Scripts, Scripts for VASP

This is a brief tutorial to use Jmol to visualize the vibration modes.

Installation steps[edit]

1) Install Java Runtime Environment: sudo apt-get install default-jre

2) Download the Jmol package: https://sourceforge.net/projects/jmol/files/Jmol/



3) Extract the file and you will get a folder named jmol-14.29.14(the numbers are depend on the versions your download), get into this folder's path in the terminal and run:

chmod u+x jmol.sh

4) In my case, I extract the file to the ~/Documents folder:

cd ~/Documents/jmol-14.29.14

chmod u+x jmol.sh

5) Edit your ~/.bashrc file:

export PATH=$PATH:~/Documents/jmol-14.29.14

6) Source your ~/.bashrc file: source ~/.bashrc or . ~/.bashrc


Visualization Steps[edit]

In terminal, go to your frequency calculation path and run the steps as shown in the figure:


Step1: grep f/i OUTCAR

To get the wave number of imaginary frequencies

Step2: jmol.sh OUTCAR

Open OUTCAR with Jmol package. (for OUTCAR_jmol file, see Note 2)

Step3: Click Tools and click AtomSetChooser

Step4: Select the modes

Step5: Click the Arrow button in the bottom to start visualizing.


Note1:

For the imaginary frequencies. In the interface of Jmol, the minus symbol is not displayed. So you need to check them firstly with the command: grep f/i OUTCAR

Then, you will get the wave number of imaginary frequencies and visualize the vibration modes by comparing the wave numbers.


Note2:

In the step2 in the figure, I used the command: jmol.sh OUTCAR_jmol This is because of the bug of Jmol when it reads OUTCAR in frequency calculations with NWRITE = 0.

When we use NWRITE = 0, the important tags for jmol to read the element information from OUTCAR is not written.

So, if you use NWRITE = 0 and run jmol.sh OUTCAR directly, you will find that all your atoms are in the same color.


To solve this bug, there are two options:

Method-1) Use NWRITE = 2 and run jmol.sh OUTCAR


Method-2) Add more information to the OUTCAR by hand.

i) grep TIT POTCAR > title

ii) copy the outputs of above commands and paste them to the OUTCAR:

cat title OUTCAR >> OUTCAR_jmol

iii) jmol.sh OUTCAR_jmol


If you have any problems in visualizing the frequencies, do not hesitate to tell me. Enjoy!


Qiang