Generate figures: Difference between revisions

From Wiki
Jump to navigation Jump to search
Rgarcia (talk | contribs)
mNo edit summary
Rgarcia (talk | contribs)
mNo edit summary
Line 13: Line 13:
  # Edited by Rodrigo García, July 10, 2012.#
  # Edited by Rodrigo García, July 10, 2012.#
  # This program requires v2kxsf conversor. # <--- Available on VASP webpage.
  # This program requires v2kxsf conversor. # <--- Available on VASP webpage.
  # Tested on vasp 5.x files                #
  # Tested on VASP 5.x files                #
  # Author: David Karhanek                  #
  # Author: David Karhanek                  #
  # # # # # # # # # # # # # # # # # # # # # #  
  # # # # # # # # # # # # # # # # # # # # # #  
 
  # Batch conversion .pos (POSCAR) to .xsf (XCRYSDEN)
  # Batch conversion .pos (POSCAR) to .xsf (XCRYSDEN)
   
   
Line 73: Line 73:


'''3. Printing'''
'''3. Printing'''
You can simply run XCrysDen by typing:
./xcrysden -s epsprinting.tcl
or with this script
  echo "The TCL script 'epsprinting.tcl' is now ready for use with XCrysDen... "
  echo "The TCL script 'epsprinting.tcl' is now ready for use with XCrysDen... "
  echo ""
  echo ""
Line 79: Line 83:
  xcrysden -s epsprinting.tcl
  xcrysden -s epsprinting.tcl
   
   
  echo "Finished! Good luck
  echo "Finished! Good luck"


--[[User:Rgarcia|Rgarcia]] 19:23, 12 December 2012 (CET)
--[[User:Rgarcia|Rgarcia]] 19:23, 12 December 2012 (CET)

Revision as of 19:29, 12 December 2012

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

To map several molecules at once, put together the CONTCAR files (CONT*). Then use the attached scrip with xcrysden. File:Xcrysden.tgz

The script has three parts

1. Convert POSCAR/CONTCAR to *.xsf

In order to use this tool, you will need the program v2kxsf. Find attached here File:Xcrysden.tgz or here [[1]]

# # # # # # # # # # # # # # # # # # # # # # 
# Edited by Rodrigo García, July 10, 2012.#
# This program requires v2kxsf conversor. # <--- Available on VASP webpage.
# Tested on VASP 5.x files                #
# Author: David Karhanek                  #
# # # # # # # # # # # # # # # # # # # # # # 

# Batch conversion .pos (POSCAR) to .xsf (XCRYSDEN)

echo "Converting POSCARs to XSF files..."
for j in `ls CONT*` ; do
  ./v2xsf $j           # You need the program v2kxsf
  uncompress $j.xsf.gz # The program automatically compress, so unzip
done

2. Script preparation

XCrysDen can work with a script as input file. You need to build that file automatically with:
# EPS Print Preparation
echo "Preparing TCL script for EPS export..."
for i in `ls *.xsf`
do                              # resize 640 480
 cat >>epsprinting.tcl<<!
scripting::open --xsf $i
scripting::displayWindow resize 800 1000
xc_newvalue .mesa 8  0 1.000000 1.000000 1.000000
xc_newvalue .mesa 8  1 1.000000 1.000000 1.000000
xc_newvalue .mesa 8  6 0.250000 0.250000 0.250000
xc_newvalue .mesa 8  8 1.000000 0.000000 0.000000
xc_newvalue .mesa 8 78 0.800000 1.000000 0.800000
scripting::displayMode3D BallStick
set myParam(COV_SCALE)        1.25
set myParam(FRAMECOL)         {10 10 0.50}
scripting::load_myParam
scripting::display on crystal-cells 
scripting::display as cell-unit asymm
scripting::buildCrystal 1 1 1
xc_translparam set 0 0 1 
scripting::rotate x 90
scripting::zoom 2
scripting::printToFile ${i%\.xsf}.eps

!
done

Explanation:

scripting::displayWindow resize 800 1000

will set the size of the window. A big size generate a larger and heavier image.

xc_newvalue .mesa 8  8 1.000000 0.000000 0.000000 

will set the color of Oxygen (Z=8) to red (1.00 0.00 0.00 RGB)

scripting::buildCrystal 1 1 1 

will build a 1×1×1 supercell

Play with these parameters in order to focus your cell at your wish:

scripting::rotate x 90
scripting::zoom 2

Do NOT put comments in the epsprinting.tcl file.

3. Printing

You can simply run XCrysDen by typing:

./xcrysden -s epsprinting.tcl

or with this script

echo "The TCL script 'epsprinting.tcl' is now ready for use with XCrysDen... "
echo ""
echo "Please wait while XCrysDen generate your figures"
sleep 1
xcrysden -s epsprinting.tcl

echo "Finished! Good luck" 

--Rgarcia 19:23, 12 December 2012 (CET)