├── OpenTerminalHere.app
├── .svn
│ ├── entries
│ └── format
└── Contents
│ ├── .svn
│ ├── entries
│ ├── format
│ └── text-base
│ │ ├── Info.plist.svn-base
│ │ └── PkgInfo.svn-base
│ ├── Info.plist
│ ├── MacOS
│ ├── .svn
│ │ ├── entries
│ │ ├── format
│ │ ├── prop-base
│ │ │ └── droplet.svn-base
│ │ └── text-base
│ │ │ └── droplet.svn-base
│ └── droplet
│ ├── PkgInfo
│ └── Resources
│ ├── .svn
│ ├── entries
│ ├── format
│ ├── prop-base
│ │ ├── droplet.icns.svn-base
│ │ └── droplet.rsrc.svn-base
│ └── text-base
│ │ ├── droplet.icns.svn-base
│ │ └── droplet.rsrc.svn-base
│ ├── Scripts
│ ├── .svn
│ │ ├── entries
│ │ ├── format
│ │ ├── prop-base
│ │ │ └── main.scpt.svn-base
│ │ └── text-base
│ │ │ └── main.scpt.svn-base
│ └── main.scpt
│ ├── description.rtfd
│ ├── .svn
│ │ ├── entries
│ │ ├── format
│ │ └── text-base
│ │ │ └── TXT.rtf.svn-base
│ └── TXT.rtf
│ ├── droplet.icns
│ └── droplet.rsrc
├── Parser.py
├── README.md
├── Structure.py
├── backup.sh
├── bonev
├── .DS_Store
├── plnd.pl
└── plp.pl
├── calculate
├── calculate_Teff_from_cm.py
├── calculate_box_from_rs.py
├── calculate_ideal_pressure.py
├── calculate_number_of_steps_from_time.py
├── calculate_rs_from_box.py
├── calculate_rs_from_vol.py
├── calculate_time_from_number_of_steps.py
└── get_molar_vol_from_ucvol.py
├── calculate_neaton_image.py
├── cat_XDATCAR
├── chg.in
├── clean.sh
├── clean_dftb.sh
├── cluster_state
├── converger.sh
├── convert.sh
├── convert_coor_TRAJEC.lithium-no_com.pwscf
├── coordinates.xyz
├── count_scc_steps.sh
├── dftb
├── .DS_Store
├── analyze_dftb.sh
├── clean_dftb.sh
├── dptools-0.1p2.tar.gz
├── dptools-0.1p2
│ ├── LICENSE
│ ├── PKG-INFO
│ ├── README
│ ├── bin
│ │ ├── dp_bands
│ │ ├── dp_dos
│ │ ├── gen2cif
│ │ ├── gen2xyz
│ │ └── xyz2gen
│ ├── build
│ │ ├── lib
│ │ │ └── dptools
│ │ │ │ ├── __init__.py
│ │ │ │ ├── bandout.py
│ │ │ │ ├── cif.py
│ │ │ │ ├── common.py
│ │ │ │ ├── gen.py
│ │ │ │ ├── geometry.py
│ │ │ │ └── xyz.py
│ │ └── scripts-2.6
│ │ │ ├── dp_bands
│ │ │ ├── dp_dos
│ │ │ ├── gen2cif
│ │ │ ├── gen2xyz
│ │ │ └── xyz2gen
│ ├── setup.py
│ └── src
│ │ └── dptools
│ │ ├── __init__.py
│ │ ├── bandout.py
│ │ ├── cif.py
│ │ ├── common.py
│ │ ├── gen.py
│ │ ├── geometry.py
│ │ └── xyz.py
├── dptools
│ ├── bin
│ │ ├── dp_bands
│ │ ├── dp_dos
│ │ ├── gen2cif
│ │ ├── gen2xyz
│ │ └── xyz2gen
│ └── lib
│ │ └── python2.6
│ │ └── site-packages
│ │ ├── dptools-0.1p2-py2.6.egg-info
│ │ └── dptools
│ │ ├── __init__.py
│ │ ├── __init__.pyc
│ │ ├── bandout.py
│ │ ├── bandout.pyc
│ │ ├── cif.py
│ │ ├── cif.pyc
│ │ ├── common.py
│ │ ├── common.pyc
│ │ ├── gen.py
│ │ ├── gen.pyc
│ │ ├── geometry.py
│ │ ├── geometry.pyc
│ │ ├── xyz.py
│ │ └── xyz.pyc
├── equil.xyz
├── gFollow
├── gen.example
├── input.gen
└── xyz_to_gen.py
├── diffbig
├── dncar.in
├── dx_fixer.sh
├── eigenvalue_read.py
├── extract.sh
├── extract_dipole.sh
├── extract_dipole_different.sh
├── extract_eig_from_total.sh
├── extract_info
├── gofr_v3.py
├── phys.py
├── qbox_PT.py
└── qboxhandler.py
├── follow_qbz.sh
├── form.ch
├── freenodes.pl
├── gPressure.cpmd
├── gentolammps.pl
├── getEnergy.py
├── get_binding.sh
├── get_ip.sh
├── get_mini_ip.sh
├── gnuplotter.py
├── gw_sigx.sh
├── h-s.ini
├── h.ini
├── histogram.py
├── ip
├── ipr.py
├── lammpstogen.OH.pl
├── lammpstogen.OHNC.pl
├── lammpstogen.pl
├── lammpstoxyz.CO.pl
├── lammpstoxyz.OHNC.pl
├── lammpstoxyz.pl
├── lmp_dftb_props.pl
├── loop.delta.sh
├── loop_parchg.sh
├── looper.sh
├── machinesfilescript
├── hostlist.out
├── hostlist.sh
└── startmpi.sh
├── monitor.sh
├── myrinet
├── neaton_image.py
├── neaton_image_manual.py
├── offdiag_writer.py
├── out
├── pdos.py
├── pdos_us.py
├── phys.py
├── planechg.f90
├── planechg.in
├── pot.in
├── ps_jeep_to_qbox.pl
├── ps_trans
├── qchem.sh
├── qdel_all
├── qhold_all
├── qinfo
├── qrls_all
├── read.py
├── running_average.py
├── sample_3D.py
├── sharcnet.csh
├── sharcnet.txt
├── shockwave
├── gentolammps.pl
├── lammpstogen.pl
├── lammpstoxyz.pl
└── lmp_dftb_props.pl
├── showq
├── status
├── subtract.sh
├── sync_research.sh
├── telemachos
├── template.py
├── terminal_trash.sh
├── test.dat
├── twitter.pl
├── utils
├── convert_coor_BOHR.awk
├── convert_coor_TRAJEC.awk
├── convert_coor_TRAJEC.py
├── convert_coor_TRAJEC_cell.awk
├── cube_to_array.py
├── diffusion.py
├── forces.py
├── gPlotAverage-Internal
├── gPlotAverage-Pressure
├── gPlotAverage-Temperature
├── gPlotDiffusion
├── gPlotDisplaced
├── gPlotForces
├── gPlotPressure
├── running-average.py
├── wrap_TRAJEC.awk
└── xyzReader.python
├── vasp
├── .DS_Store
├── cat_XDATCAR
├── monitor_efficiency.sh
├── nh3_vasp.sh
├── vasp_clean
└── vtstscripts
│ ├── Fortran
│ ├── CVS
│ │ ├── Entries
│ │ ├── Repository
│ │ └── Root
│ └── Format.pm
│ ├── Math
│ ├── Approx.pm
│ ├── Matrix.pm
│ └── MatrixReal.pm
│ ├── README
│ ├── Vasp.pm
│ ├── akmc.pl
│ ├── akmc_reset_bad.pl
│ ├── akmc_update.pl
│ ├── akmcmovie.pl
│ ├── boxset.pl
│ ├── chgavg.pl
│ ├── chgdelta.pl
│ ├── chgdiff.pl
│ ├── chgmultiply.pl
│ ├── chgnorm.pl
│ ├── chgparavg.pl
│ ├── chgsum.pl
│ ├── chgsumf.pl
│ ├── con2xyz.pl
│ ├── con2xyzmov.pl
│ ├── diffcon.pl
│ ├── dimclean.sh
│ ├── dimclean2.sh
│ ├── diminit.pl
│ ├── dimmins.pl
│ ├── dimplot.gnu
│ ├── dimplot.pl
│ ├── dist.pl
│ ├── distatom.pl
│ ├── dosanalyze.pl
│ ├── doslanalyze.pl
│ ├── doslanalyze_p.pl
│ ├── doslplot.pl
│ ├── doslplot_p.pl
│ ├── dosplot.pl
│ ├── dymanalyze.pl
│ ├── dymclean.sh
│ ├── dymcmpdisp.pl
│ ├── dymeffbar.pl
│ ├── dymextract.pl
│ ├── dymfit.pl
│ ├── dymmatrix.pl
│ ├── dymmodes2xyz.pl
│ ├── dymprefactor.pl
│ ├── dymrate.pl
│ ├── dymreorder.pl
│ ├── dymseldisp.pl
│ ├── dymseldsp.pl
│ ├── dymselsph.pl
│ ├── dymzpbar.pl
│ ├── forces.pl
│ ├── halfadd.pl
│ ├── halfcon.pl
│ ├── insaddimages.pl
│ ├── insclean.sh
│ ├── insenergy.pl
│ ├── insmake.pl
│ ├── insmovie.pl
│ ├── insplot.gnu
│ ├── insplot.pl
│ ├── intcon.pl
│ ├── interpolate.pl
│ ├── lanclean.sh
│ ├── modemake.pl
│ ├── neb2dim.pl
│ ├── neb2lan.pl
│ ├── nebavoid.pl
│ ├── nebbarrier.pl
│ ├── nebbarrierdist.pl
│ ├── nebclean.sh
│ ├── nebconverge.pl
│ ├── nebef.pl
│ ├── nebfreeze.pl
│ ├── nebmake.pl
│ ├── nebmovie.pl
│ ├── nebplot.gnu
│ ├── nebresults.pl
│ ├── nebspline.pl
│ ├── neighbors.pl
│ ├── out2jvasp.pl
│ ├── out2pos.pl
│ ├── outi.pl
│ ├── pos2pos.pl
│ ├── pos2vasp.pl
│ ├── quad.pl
│ ├── quad_con.pl
│ ├── rdf.pl
│ ├── scale
│ ├── split_dos
│ ├── splitmovie.pl
│ ├── sum_dos
│ ├── sum_dos_np
│ ├── tcon.pl
│ ├── typeset.pl
│ ├── vasp2con.pl
│ ├── vasp2jvasp.pl
│ ├── vasp2xyz.help
│ ├── vasp2xyz.pl
│ ├── vclean.sh
│ ├── vcunzip.pl
│ ├── vczip.pl
│ ├── vef.gnu
│ ├── vef.pl
│ ├── vfin.pl
│ ├── vp
│ ├── vspl.pl
│ ├── vtstscripts.tar.gz
│ ├── xdat2pos.pl
│ ├── xdat2xyz.pl
│ └── xyz2con.pl
├── vasp_cleanup
├── vasp_exit
├── vasp_mover.sh
├── vtstscripts
├── Fortran
│ ├── CVS
│ │ ├── Entries
│ │ ├── Repository
│ │ └── Root
│ └── Format.pm
├── Math
│ ├── Approx.pm
│ ├── Matrix.pm
│ └── MatrixReal.pm
├── README
├── Vasp.pm
├── akmc.pl
├── akmc_reset_bad.pl
├── akmc_update.pl
├── akmcmovie.pl
├── boxset.pl
├── chgdelta.pl
├── chgdiff.pl
├── chgmultiply.pl
├── chgnorm.pl
├── chgparavg.pl
├── chgsum.pl
├── chgsumf.pl
├── con2xyz.pl
├── con2xyzmov.pl
├── diffcon.pl
├── dimclean.sh
├── dimclean2.sh
├── diminit.pl
├── dimmins.pl
├── dimplot.gnu
├── dimplot.pl
├── dist.pl
├── distatom.pl
├── dosanalyze.pl
├── doslanalyze.pl
├── doslanalyze_p.pl
├── doslplot.pl
├── doslplot_p.pl
├── dosplot.pl
├── dymanalyze.pl
├── dymclean.sh
├── dymcmpdisp.pl
├── dymeffbar.pl
├── dymextract.pl
├── dymfit.pl
├── dymmatrix.pl
├── dymmodes2xyz.pl
├── dymprefactor.pl
├── dymrate.pl
├── dymreorder.pl
├── dymseldisp.pl
├── dymseldsp.pl
├── dymselsph.pl
├── dymzpbar.pl
├── forces.pl
├── halfadd.pl
├── halfcon.pl
├── insaddimages.pl
├── insclean.sh
├── insenergy.pl
├── insmake.pl
├── insmovie.pl
├── insplot.gnu
├── insplot.pl
├── intcon.pl
├── interpolate.pl
├── lanclean.sh
├── modemake.pl
├── neb2dim.pl
├── neb2lan.pl
├── nebavoid.pl
├── nebbarrier.pl
├── nebbarrierdist.pl
├── nebclean.sh
├── nebconverge.pl
├── nebef.pl
├── nebfreeze.pl
├── nebmake.pl
├── nebmovie.pl
├── nebplot.gnu
├── nebresults.pl
├── nebspline.pl
├── neighbors.pl
├── out2jvasp.pl
├── out2pos.pl
├── outi.pl
├── pos2pos.pl
├── pos2vasp.pl
├── quad.pl
├── quad_con.pl
├── rdf.pl
├── scale
├── split_dos
├── splitmovie.pl
├── sum_dos
├── sum_dos_np
├── tcon.pl
├── typeset.pl
├── vasp2con.pl
├── vasp2jvasp.pl
├── vasp2xyz.help
├── vasp2xyz.pl
├── vclean.sh
├── vcunzip.pl
├── vczip.pl
├── vef.gnu
├── vef.pl
├── vfin.pl
├── vp
├── vspl.pl
├── vtstscripts.tar.gz
├── xdat2pos.pl
├── xdat2xyz.pl
└── xyz2con.pl
├── wake_on_LAN.py
├── wfnbinasc.f90
├── wfntrim.f90
├── wifi_measure.sh
├── xdat2xyz.pl
└── xmls_style_io.pm
/OpenTerminalHere.app/.svn/entries:
--------------------------------------------------------------------------------
1 | 9
2 |
3 | dir
4 | 404
5 | svn+ssh://www.entropy.ch/Users/liyanage/documents/svnroot/trunk/open-terminal-here/OpenTerminalHere.app
6 | svn+ssh://www.entropy.ch/Users/liyanage/documents/svnroot
7 |
8 |
9 |
10 | 2008-08-06T17:41:06.034052Z
11 | 370
12 | liyanage
13 |
14 |
15 | svn:special svn:externals svn:needs-lock
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | 153f8dbc-cef0-0310-8e0e-ba1d6c9f8c6b
28 |
29 | Contents
30 | dir
31 |
32 |
--------------------------------------------------------------------------------
/OpenTerminalHere.app/.svn/format:
--------------------------------------------------------------------------------
1 | 9
2 |
--------------------------------------------------------------------------------
/OpenTerminalHere.app/Contents/.svn/entries:
--------------------------------------------------------------------------------
1 | 9
2 |
3 | dir
4 | 404
5 | svn+ssh://www.entropy.ch/Users/liyanage/documents/svnroot/trunk/open-terminal-here/OpenTerminalHere.app/Contents
6 | svn+ssh://www.entropy.ch/Users/liyanage/documents/svnroot
7 |
8 |
9 |
10 | 2008-08-06T17:41:06.034052Z
11 | 370
12 | liyanage
13 |
14 |
15 | svn:special svn:externals svn:needs-lock
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | 153f8dbc-cef0-0310-8e0e-ba1d6c9f8c6b
28 |
29 | MacOS
30 | dir
31 |
32 | Info.plist
33 | file
34 |
35 |
36 |
37 |
38 | 2008-08-06T17:39:54.000000Z
39 | 2ce51628110cc34b2d5647300d877895
40 | 2008-08-06T17:41:06.034052Z
41 | 370
42 | liyanage
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 | 1401
65 |
66 | Resources
67 | dir
68 |
69 | PkgInfo
70 | file
71 |
72 |
73 |
74 |
75 | 2007-01-24T08:44:44.000000Z
76 | 7307efe10fe1868b8b80e83cc283a192
77 | 2006-04-24T10:46:12.692800Z
78 | 208
79 | liyanage
80 |
81 |
--------------------------------------------------------------------------------
/OpenTerminalHere.app/Contents/.svn/format:
--------------------------------------------------------------------------------
1 | 9
2 |
--------------------------------------------------------------------------------
/OpenTerminalHere.app/Contents/.svn/text-base/Info.plist.svn-base:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleGetInfoString
6 | 2.2, © 2001-2008 Marc Liyanage
7 | CFBundleVersion
8 | 2.1
9 | CFBundleAllowMixedLocalizations
10 |
11 | CFBundleDevelopmentRegion
12 | English
13 | CFBundleDocumentTypes
14 |
15 |
16 | CFBundleTypeExtensions
17 |
18 | *
19 |
20 | CFBundleTypeOSTypes
21 |
22 | ****
23 |
24 | CFBundleTypeRole
25 | Viewer
26 |
27 |
28 | CFBundleExecutable
29 | droplet
30 | CFBundleIconFile
31 | droplet
32 | CFBundleInfoDictionaryVersion
33 | 6.0
34 | CFBundleName
35 | OpenTerminalHere
36 | CFBundlePackageType
37 | APPL
38 | CFBundleSignature
39 | dplt
40 | LSRequiresCarbon
41 |
42 | WindowState
43 |
44 | name
45 | ScriptWindowState
46 | positionOfDivider
47 | 416
48 | savedFrame
49 | 192 369 1217 479 0 0 1440 878
50 | selectedTabView
51 | result
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/OpenTerminalHere.app/Contents/.svn/text-base/PkgInfo.svn-base:
--------------------------------------------------------------------------------
1 | APPLdplt
--------------------------------------------------------------------------------
/OpenTerminalHere.app/Contents/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleGetInfoString
6 | 2.2, © 2001-2008 Marc Liyanage
7 | CFBundleVersion
8 | 2.1
9 | CFBundleAllowMixedLocalizations
10 |
11 | CFBundleDevelopmentRegion
12 | English
13 | CFBundleDocumentTypes
14 |
15 |
16 | CFBundleTypeExtensions
17 |
18 | *
19 |
20 | CFBundleTypeOSTypes
21 |
22 | ****
23 |
24 | CFBundleTypeRole
25 | Viewer
26 |
27 |
28 | CFBundleExecutable
29 | droplet
30 | CFBundleIconFile
31 | droplet
32 | CFBundleInfoDictionaryVersion
33 | 6.0
34 | CFBundleName
35 | OpenTerminalHere
36 | CFBundlePackageType
37 | APPL
38 | CFBundleSignature
39 | dplt
40 | LSRequiresCarbon
41 |
42 | WindowState
43 |
44 | name
45 | ScriptWindowState
46 | positionOfDivider
47 | 416
48 | savedFrame
49 | 192 369 1217 479 0 0 1440 878
50 | selectedTabView
51 | result
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/OpenTerminalHere.app/Contents/MacOS/.svn/entries:
--------------------------------------------------------------------------------
1 | 9
2 |
3 | dir
4 | 404
5 | svn+ssh://www.entropy.ch/Users/liyanage/documents/svnroot/trunk/open-terminal-here/OpenTerminalHere.app/Contents/MacOS
6 | svn+ssh://www.entropy.ch/Users/liyanage/documents/svnroot
7 |
8 |
9 |
10 | 2006-04-24T10:46:12.692800Z
11 | 208
12 | liyanage
13 |
14 |
15 | svn:special svn:externals svn:needs-lock
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | 153f8dbc-cef0-0310-8e0e-ba1d6c9f8c6b
28 |
29 | droplet
30 | file
31 |
32 |
33 |
34 |
35 | 2007-01-24T08:44:44.000000Z
36 | eb36400916a49aedc99d28fbe776c287
37 | 2006-04-24T10:46:12.692800Z
38 | 208
39 | liyanage
40 | has-props
41 |
42 |
--------------------------------------------------------------------------------
/OpenTerminalHere.app/Contents/MacOS/.svn/format:
--------------------------------------------------------------------------------
1 | 9
2 |
--------------------------------------------------------------------------------
/OpenTerminalHere.app/Contents/MacOS/.svn/prop-base/droplet.svn-base:
--------------------------------------------------------------------------------
1 | K 14
2 | svn:executable
3 | V 1
4 | *
5 | K 13
6 | svn:mime-type
7 | V 24
8 | application/octet-stream
9 | END
10 |
--------------------------------------------------------------------------------
/OpenTerminalHere.app/Contents/MacOS/.svn/text-base/droplet.svn-base:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itamblyn/scripts/bbf02f08bed4d6e8afedfbced53f721010b0fd4f/OpenTerminalHere.app/Contents/MacOS/.svn/text-base/droplet.svn-base
--------------------------------------------------------------------------------
/OpenTerminalHere.app/Contents/MacOS/droplet:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itamblyn/scripts/bbf02f08bed4d6e8afedfbced53f721010b0fd4f/OpenTerminalHere.app/Contents/MacOS/droplet
--------------------------------------------------------------------------------
/OpenTerminalHere.app/Contents/PkgInfo:
--------------------------------------------------------------------------------
1 | APPLdplt
--------------------------------------------------------------------------------
/OpenTerminalHere.app/Contents/Resources/.svn/entries:
--------------------------------------------------------------------------------
1 | 9
2 |
3 | dir
4 | 404
5 | svn+ssh://www.entropy.ch/Users/liyanage/documents/svnroot/trunk/open-terminal-here/OpenTerminalHere.app/Contents/Resources
6 | svn+ssh://www.entropy.ch/Users/liyanage/documents/svnroot
7 |
8 |
9 |
10 | 2008-08-06T17:41:06.034052Z
11 | 370
12 | liyanage
13 |
14 |
15 | svn:special svn:externals svn:needs-lock
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | 153f8dbc-cef0-0310-8e0e-ba1d6c9f8c6b
28 |
29 | description.rtfd
30 | dir
31 |
32 | droplet.rsrc
33 | file
34 |
35 |
36 |
37 |
38 | 2007-01-24T08:44:44.000000Z
39 | 9b23c4f9c26884fd1b8e6bca99043082
40 | 2007-01-24T09:21:47.873673Z
41 | 278
42 | liyanage
43 | has-props
44 |
45 | droplet.icns
46 | file
47 |
48 |
49 |
50 |
51 | 2007-01-24T08:44:45.000000Z
52 | 8887609d74a27b08ae489ea99f1b8af0
53 | 2006-04-24T10:46:12.692800Z
54 | 208
55 | liyanage
56 | has-props
57 |
58 | Scripts
59 | dir
60 |
61 |
--------------------------------------------------------------------------------
/OpenTerminalHere.app/Contents/Resources/.svn/format:
--------------------------------------------------------------------------------
1 | 9
2 |
--------------------------------------------------------------------------------
/OpenTerminalHere.app/Contents/Resources/.svn/prop-base/droplet.icns.svn-base:
--------------------------------------------------------------------------------
1 | K 13
2 | svn:mime-type
3 | V 24
4 | application/octet-stream
5 | END
6 |
--------------------------------------------------------------------------------
/OpenTerminalHere.app/Contents/Resources/.svn/prop-base/droplet.rsrc.svn-base:
--------------------------------------------------------------------------------
1 | K 13
2 | svn:mime-type
3 | V 24
4 | application/octet-stream
5 | END
6 |
--------------------------------------------------------------------------------
/OpenTerminalHere.app/Contents/Resources/.svn/text-base/droplet.icns.svn-base:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itamblyn/scripts/bbf02f08bed4d6e8afedfbced53f721010b0fd4f/OpenTerminalHere.app/Contents/Resources/.svn/text-base/droplet.icns.svn-base
--------------------------------------------------------------------------------
/OpenTerminalHere.app/Contents/Resources/.svn/text-base/droplet.rsrc.svn-base:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itamblyn/scripts/bbf02f08bed4d6e8afedfbced53f721010b0fd4f/OpenTerminalHere.app/Contents/Resources/.svn/text-base/droplet.rsrc.svn-base
--------------------------------------------------------------------------------
/OpenTerminalHere.app/Contents/Resources/Scripts/.svn/entries:
--------------------------------------------------------------------------------
1 | 9
2 |
3 | dir
4 | 404
5 | svn+ssh://www.entropy.ch/Users/liyanage/documents/svnroot/trunk/open-terminal-here/OpenTerminalHere.app/Contents/Resources/Scripts
6 | svn+ssh://www.entropy.ch/Users/liyanage/documents/svnroot
7 |
8 |
9 |
10 | 2008-08-06T17:41:06.034052Z
11 | 370
12 | liyanage
13 |
14 |
15 | svn:special svn:externals svn:needs-lock
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | 153f8dbc-cef0-0310-8e0e-ba1d6c9f8c6b
28 |
29 | main.scpt
30 | file
31 | 405
32 |
33 |
34 |
35 | 2008-10-26T13:49:39.000000Z
36 | 38c55cb77bff3e79d68f72c8b69eda78
37 | 2008-10-26T13:51:11.831262Z
38 | 405
39 | liyanage
40 | has-props
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 | 12470
62 |
63 |
--------------------------------------------------------------------------------
/OpenTerminalHere.app/Contents/Resources/Scripts/.svn/format:
--------------------------------------------------------------------------------
1 | 9
2 |
--------------------------------------------------------------------------------
/OpenTerminalHere.app/Contents/Resources/Scripts/.svn/prop-base/main.scpt.svn-base:
--------------------------------------------------------------------------------
1 | K 13
2 | svn:mime-type
3 | V 24
4 | application/octet-stream
5 | END
6 |
--------------------------------------------------------------------------------
/OpenTerminalHere.app/Contents/Resources/Scripts/.svn/text-base/main.scpt.svn-base:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itamblyn/scripts/bbf02f08bed4d6e8afedfbced53f721010b0fd4f/OpenTerminalHere.app/Contents/Resources/Scripts/.svn/text-base/main.scpt.svn-base
--------------------------------------------------------------------------------
/OpenTerminalHere.app/Contents/Resources/Scripts/main.scpt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itamblyn/scripts/bbf02f08bed4d6e8afedfbced53f721010b0fd4f/OpenTerminalHere.app/Contents/Resources/Scripts/main.scpt
--------------------------------------------------------------------------------
/OpenTerminalHere.app/Contents/Resources/description.rtfd/.svn/entries:
--------------------------------------------------------------------------------
1 | 9
2 |
3 | dir
4 | 404
5 | svn+ssh://www.entropy.ch/Users/liyanage/documents/svnroot/trunk/open-terminal-here/OpenTerminalHere.app/Contents/Resources/description.rtfd
6 | svn+ssh://www.entropy.ch/Users/liyanage/documents/svnroot
7 |
8 |
9 |
10 | 2007-01-24T09:21:47.873673Z
11 | 278
12 | liyanage
13 |
14 |
15 | svn:special svn:externals svn:needs-lock
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | 153f8dbc-cef0-0310-8e0e-ba1d6c9f8c6b
28 |
29 | TXT.rtf
30 | file
31 |
32 |
33 |
34 |
35 | 2007-01-24T08:44:44.000000Z
36 | 8513b99b80d8120514b762337a756c91
37 | 2007-01-24T09:21:47.873673Z
38 | 278
39 | liyanage
40 |
41 |
--------------------------------------------------------------------------------
/OpenTerminalHere.app/Contents/Resources/description.rtfd/.svn/format:
--------------------------------------------------------------------------------
1 | 9
2 |
--------------------------------------------------------------------------------
/OpenTerminalHere.app/Contents/Resources/description.rtfd/.svn/text-base/TXT.rtf.svn-base:
--------------------------------------------------------------------------------
1 | {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf420
2 | {\fonttbl\f0\fnil\fcharset77 LucidaGrande;}
3 | {\colortbl;\red255\green255\blue255;}
4 | \pard\tx480\tx960\tx1440\tx1920\tx2400\tx2880\tx3360\tx3840\tx4320\tx4800\tx5280\tx5760\tx6240\tx6720\tx7200\tx7680\tx8160\tx8640\tx9120\tx9600\tx10080\tx10560\tx11040\tx11520\tx12000\tx12480\tx12960\tx13440\tx13920\tx14400\tx14880\tx15360\tx15840\tx16320\tx16800\tx17280\tx17760\tx18240\tx18720\tx19200\tx19680\tx20160\tx20640\tx21120\tx21600\tx22080\tx22560\tx23040\tx23520\tx24000\tx24480\tx24960\tx25440\tx25920\tx26400\tx26880\tx27360\tx27840\tx28320\tx28800\tx29280\tx29760\tx30240\tx30720\tx31200\tx31680\tx32160\tx32640\tx33120\tx33600\tx34080\tx34560\tx35040\tx35520\tx36000\tx36480\tx36960\tx37440\tx37920\tx38400\tx38880\tx39360\tx39840\tx40320\tx40800\tx41280\tx41760\tx42240\tx42720\tx43200\tx43680\tx44160\tx44640\tx45120\tx45600\tx46080\tx46560\tx47040\tx47520\tx48000\ql\qnatural\pardirnatural
5 |
6 | \f0\fs24 \cf0 This is a Toolbar Script for Mac OS X 10.1 and later.\CocoaLigature0 \
7 | \CocoaLigature1 When its icon is being clicked on in the toolbar of a given directory window, it will open up a new Terminal window with the that directory as working directory, i.e. it will "cd" there.\CocoaLigature0 \
8 | \CocoaLigature1 It's also possible to drop one or more directories or other items onto the icon. The script will open up a Terminal session in each dropped directory, and for non-folder items a session in the items respective parent directory.\CocoaLigature0 \
9 | \
10 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
11 | \cf0 \CocoaLigature1 Written by Marc Liyanage, http://www.entropy.ch}
--------------------------------------------------------------------------------
/OpenTerminalHere.app/Contents/Resources/description.rtfd/TXT.rtf:
--------------------------------------------------------------------------------
1 | {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf420
2 | {\fonttbl\f0\fnil\fcharset77 LucidaGrande;}
3 | {\colortbl;\red255\green255\blue255;}
4 | \pard\tx480\tx960\tx1440\tx1920\tx2400\tx2880\tx3360\tx3840\tx4320\tx4800\tx5280\tx5760\tx6240\tx6720\tx7200\tx7680\tx8160\tx8640\tx9120\tx9600\tx10080\tx10560\tx11040\tx11520\tx12000\tx12480\tx12960\tx13440\tx13920\tx14400\tx14880\tx15360\tx15840\tx16320\tx16800\tx17280\tx17760\tx18240\tx18720\tx19200\tx19680\tx20160\tx20640\tx21120\tx21600\tx22080\tx22560\tx23040\tx23520\tx24000\tx24480\tx24960\tx25440\tx25920\tx26400\tx26880\tx27360\tx27840\tx28320\tx28800\tx29280\tx29760\tx30240\tx30720\tx31200\tx31680\tx32160\tx32640\tx33120\tx33600\tx34080\tx34560\tx35040\tx35520\tx36000\tx36480\tx36960\tx37440\tx37920\tx38400\tx38880\tx39360\tx39840\tx40320\tx40800\tx41280\tx41760\tx42240\tx42720\tx43200\tx43680\tx44160\tx44640\tx45120\tx45600\tx46080\tx46560\tx47040\tx47520\tx48000\ql\qnatural\pardirnatural
5 |
6 | \f0\fs24 \cf0 This is a Toolbar Script for Mac OS X 10.1 and later.\CocoaLigature0 \
7 | \CocoaLigature1 When its icon is being clicked on in the toolbar of a given directory window, it will open up a new Terminal window with the that directory as working directory, i.e. it will "cd" there.\CocoaLigature0 \
8 | \CocoaLigature1 It's also possible to drop one or more directories or other items onto the icon. The script will open up a Terminal session in each dropped directory, and for non-folder items a session in the items respective parent directory.\CocoaLigature0 \
9 | \
10 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
11 | \cf0 \CocoaLigature1 Written by Marc Liyanage, http://www.entropy.ch}
--------------------------------------------------------------------------------
/OpenTerminalHere.app/Contents/Resources/droplet.icns:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itamblyn/scripts/bbf02f08bed4d6e8afedfbced53f721010b0fd4f/OpenTerminalHere.app/Contents/Resources/droplet.icns
--------------------------------------------------------------------------------
/OpenTerminalHere.app/Contents/Resources/droplet.rsrc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itamblyn/scripts/bbf02f08bed4d6e8afedfbced53f721010b0fd4f/OpenTerminalHere.app/Contents/Resources/droplet.rsrc
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | scritps
2 | =======
--------------------------------------------------------------------------------
/Structure.py:
--------------------------------------------------------------------------------
1 | from phys import *
2 | def Distances_orig(cell,atoms,atoma,atomb):
3 | distances = []
4 | for atom1 in atoms:
5 | for atom2 in atoms:
6 | if atom1['name'] == atom2['name']:
7 | continue
8 | elif atom1['type'] == atoma and atom2['type'] == atomb:
9 | rr = atom2['position'] - atom1['position']
10 | rr2 = cell.PBC(rr)
11 | rv= abs(rr2)
12 | #if the distance is different from zero, add it to the distances list
13 | dname=atom1['name']+'-'+atom2['name']
14 | dtype=atoma+'-'+atomb
15 | distances += [{'dname':dname,'dtype':dtype,'dist':rv,'atoma':atoma,'atomb':atomb}]
16 | return distances
17 |
18 | def Distances(cell,atoms,atoma,atomb):
19 | distances = []
20 | for atom1 in atoms:
21 | for atom2 in atoms:
22 | if atom1['name'] == atom2['name']:
23 | break
24 | elif atom1['type'] == atoma and atom2['type'] == atomb:
25 | rr = atom2['position'] - atom1['position']
26 | rr2 = cell.PBC(rr)
27 | rv= abs(rr2)
28 | #if the distance is different from zero, add it to the distances list
29 | dname1=atom1['name']+'-'+atom2['name']
30 | dtype1=atoma+'-'+atomb
31 | distances += [{'dname':dname1,'dtype':dtype1,'dist':rv,'atoma':atoma,'atomb':atomb}]
32 | elif atom1['type'] == atomb and atom2['type'] == atoma:
33 | rr = atom2['position'] - atom1['position']
34 | rr2 = cell.PBC(rr)
35 | rv= abs(rr2)
36 | dname2=atom2['name']+'-'+atom1['name']
37 | dtype2=atomb+'-'+atoma
38 | distances += [{'dname':dname2,'dtype':dtype2,'dist':rv,'atoma':atomb,'atomb':atoma}]
39 | return distances
40 |
--------------------------------------------------------------------------------
/backup.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | cd /Volumes/Backup/Backups.backupdb
4 |
5 | rsync -av --delete telemachos itamblyn@chaffey.phys.dal.ca:backups/TELEMACHOS
6 |
--------------------------------------------------------------------------------
/bonev/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itamblyn/scripts/bbf02f08bed4d6e8afedfbced53f721010b0fd4f/bonev/.DS_Store
--------------------------------------------------------------------------------
/bonev/plp.pl:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl
2 |
3 | # S.A. Bonev, LLNL, 01/21/03
4 | #
5 | # usage plp.pl he i1 i2 ta
6 | #
7 | # plots a running average of pressure from jeep output files
8 | # ${he}${i1}${ta} to ${he}${i2}${ta};
9 | # plots it in P vs. t (time), where P is in GPa and t is in fs;
10 |
11 | push(@INC,"$ENV{'HOME'}/util");
12 | require 'stat_subs.pl';
13 | require 'gnuplot_subs.pl';
14 |
15 | $au2fs = 0.0249; # 1 a.u. time = 0.0249 fs
16 | $t_av = 40; # av_t in fs; P(t) is averaged from t-0.5*t_av to t+0.5*t_av
17 |
18 |
19 | $he = shift(@ARGV); if ($he eq 'def') { $he = 'D128_MD.out.'; }
20 | $i1 = shift(@ARGV);
21 | $i2 = shift(@ARGV);
22 | $ta = shift(@ARGV);
23 |
24 | $datafile = "P_ra_${t_av}.dat";
25 |
26 | $irec = 0; @P = (); @t = ();
27 |
28 | for ($i = $i1; $i<=$i2; $i++) {
29 | open(IN, "< $he$i$ta");
30 | while () {
31 | chomp;
32 | if (/iprint\s+=\s+(\S+)/){ $ip = $1; }
33 | if (/dt\s+=\s+(\S+)\s+/) { $dt = $1; }
34 | if (/Pressure\s+\(GPa\)\s+(\S+)/) {
35 | $pp = $1; $tt = $ip*$irec*$dt*$au2fs;
36 | $irec++;
37 | push @P, $pp; push @t, $tt;
38 | }
39 | }
40 | close(IN);
41 | }
42 |
43 | $i_av = int($t_av/(2*$dt*$ip*$au2fs));
44 |
45 | @P_ra = ();
46 | open(OUT,">$datafile");
47 | for ($i = $i_av; $i <= $irec-$i_av; $i++) {
48 | @P_seg = @P[$i-$i_av .. $i+$i_av];
49 | $pp = &average(@P_seg); push @P_ra, $pp;
50 | }
51 |
52 | $i_ra = $irec - 2*$i_av;
53 | open(OUT,">$datafile");
54 | for ($i=0; $i<$i_ra; $i++) {
55 | printf (OUT "%4.0f %6.3f\n", $t[$i]+$t[$i_av], $P_ra[$i]);
56 | }
57 | close(OUT);
58 |
59 | $P_ave = sprintf "%.2f", &average(@P_ra);
60 | $P_std = sprintf "%.2f", &stdev(@P_ra);
61 |
62 |
63 | &plot_simple_w_title($datafile,"P = ($P_ave +/- $P_std) GPa");
64 |
65 |
66 |
--------------------------------------------------------------------------------
/calculate/calculate_Teff_from_cm.py:
--------------------------------------------------------------------------------
1 | #!/usr/local/bin/python
2 |
3 | v = float(input('vibrational frequency, cm^-1\n'))
4 |
5 | Teff = v*1.43877506
6 |
7 | print 'Teff: ' + str(Teff) + 'K'
8 |
--------------------------------------------------------------------------------
/calculate/calculate_box_from_rs.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python
2 |
3 | import math
4 |
5 | # constants
6 |
7 | a0 = 5.291772106712E-09 # Bohr radius in cm
8 |
9 | pi = math.pi
10 |
11 |
12 | # inputs
13 |
14 | Rs = input('For what value of Rs would you like the box? ')
15 | N = input('How many particles are there in your box? ')
16 |
17 | volume = (1.0/3)*(4*N*pi)*(Rs*a0)**3
18 | length = volume**(1.0/3)
19 | density = N/volume
20 |
21 | print '\n For ' + repr(N) + ' particles and Rs of ' + str(Rs) + ','
22 | print 'cell must have a volume of ' + repr(volume) + ' cm^3 (' + repr(volume*(1/a0)**3) + ' A.U.)'
23 | print 'which cooresponds to a length of ' + repr(length/1E-8) + ' A (' + repr(length/a0) + ' A.U.),'
24 | print 'and a density of ' + repr(density) + ' cm^-3'
25 |
--------------------------------------------------------------------------------
/calculate/calculate_ideal_pressure.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python
2 |
3 | import math
4 |
5 | # constants
6 |
7 | a0 = 0.5291772108E-10 # Bohr radius in m
8 | pi = math.pi
9 | kB = 1.3806503E-23
10 |
11 |
12 | # inputs
13 |
14 | Rs = input('For what value of Rs would you like the box? ')
15 | T = input('Temperature in K? ')
16 |
17 | P = (3*kB*T)/(4*pi*(Rs*a0)**3)
18 |
19 | print 'Pressure is ' + repr(P/1E9) + ' GPa'
20 |
--------------------------------------------------------------------------------
/calculate/calculate_number_of_steps_from_time.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python
2 |
3 | # backlib.py
4 |
5 | import math
6 |
7 |
8 | # constants
9 |
10 | tAU = 2.4188E-17 # 1 A.U. in seconds
11 | tPS = 1E-12 # 1 picosecond in seconds
12 | # inputs
13 |
14 | runTimeInPS = input('Desired time (ps)? ')
15 | timeStep = input('Timestep in A.U.? ')
16 |
17 | maxStep= (tPS/tAU)*runTimeInPS/timeStep
18 |
19 | print '\n For ' + repr(runTimeInPS) + ' ps with a timestep of ' + repr(timeStep) + ',\n you will need ' + repr(int(maxStep)) + ' steps.'
20 |
21 |
--------------------------------------------------------------------------------
/calculate/calculate_rs_from_box.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python
2 |
3 | # backlib.py
4 |
5 | import math
6 |
7 | # constants
8 |
9 | a0 = 5.291772108E-11 # Bohr radius in meters
10 | pi = math.pi
11 |
12 |
13 | # inputs
14 |
15 | length = input('Lattice parameter [Angst]? ')
16 | length/= .529177
17 | N = input('Number of particles? ')
18 |
19 |
20 | Rs = (length)*(3/(4*N*pi))**(1.0/3.0)
21 |
22 | print '\n For ' + repr(N) + ' particles and lattice parameter of ' + repr(length) + ',\n Rs = ' + repr(Rs)
23 |
--------------------------------------------------------------------------------
/calculate/calculate_rs_from_vol.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python
2 |
3 | # backlib.py
4 |
5 | import math
6 |
7 | # constants
8 |
9 | a0 = 5.291772108E-11 # Bohr radius in meters
10 | pi = math.pi
11 |
12 |
13 | # inputs
14 |
15 | length = input('Volume [A.U.^3]? ')**(1.0/3.0)
16 | N = input('Number of electrons? ')
17 |
18 |
19 | Rs = (length)*(3/(4*N*pi))**(1.0/3.0)
20 |
21 | print '\n For ' + repr(N) + ' particles and lattice parameter of ' + repr(length) + ',\n Rs = ' + repr(Rs)
22 |
--------------------------------------------------------------------------------
/calculate/calculate_time_from_number_of_steps.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python
2 |
3 | # backlib.py
4 |
5 | import math
6 |
7 |
8 | # constants
9 |
10 | tAU = 2.4188E-17 # 1 A.U. in seconds
11 | tPS = 1E-12 # 1 picosecond in seconds
12 | # inputs
13 |
14 | maxStep = input('How many steps? ')
15 | timeStep = input('Timestep in A.U.? ')
16 |
17 | runTimeInPS = maxStep*timeStep*tAU/tPS
18 |
19 | print '\n For ' + repr(maxStep) + ' steps with a timestep of ' + repr(timeStep) + ',\n simluation time is ' + repr(runTimeInPS) + ' picoseconds.'
20 |
21 |
--------------------------------------------------------------------------------
/calculate/get_molar_vol_from_ucvol.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/python
2 |
3 | """ Calculate molar volume from abinit ucvol in cm^3 """
4 |
5 | import sys
6 |
7 | # Number of atoms in cell
8 | global NATOM
9 | NATOM = 2
10 |
11 | def main():
12 | try:
13 | ucvol = float(sys.argv[1])
14 | except IndexError:
15 | print '\nPlease provide ucvol in bohr^3\n'
16 | sys.exit(0)
17 |
18 | # Convert ucvol from bohr^3 to cm^3
19 | conversion = 1.4850979e-25
20 | ucvol *= conversion
21 |
22 | avagadro = 6.0221415E+23
23 | NMOL = NATOM / avagadro
24 |
25 | molar_volume = ucvol / NMOL
26 |
27 | print '\nFrom a value of ucvol = '+str(ucvol)+' cm^3'
28 | print '\n ---> Molar Volume = '+str(molar_volume)+' cm^3/mol\n'
29 |
30 | if __name__ == '__main__':
31 | main()
32 |
--------------------------------------------------------------------------------
/calculate_neaton_image.py:
--------------------------------------------------------------------------------
1 | #!/global/software/centos-5.x86_64/modules/Python/2.6.5/bin/python
2 |
3 | #QP = -7.430 - -5.839# BDA, HOMO-1, 829 bands
4 | #QP = -26.315 - -22.514 # BDA LOMO 750, SR
5 | #QP = -26.035 - -22.514 #, BDA, LOMO, 1024 bands
6 | QP = -26.079 - -22.514 # BDA, LOMO, 1424
7 | #QP = -26.005 - -22.514 # BDA, LOMO, 829 bands
8 |
9 |
10 |
11 | #QP = -2.7789 # BDA, HOMO, experiment
12 | #QP = -2.73 # BDA, NL
13 | #QP = -1.956 # BDA, HOMO, 3330 bands
14 | #QP = -1.433 # BDA, HOMO, 829 bands
15 | #QP = -5.568872 - -4.050642# BDA, HOMO, 1024 bands
16 | #QP = -5.699 - -4.050642 # BDA, HOMO, 1424
17 | #QP = -5.752 - -4.05064 # BDA, HOMO, 1630 bands
18 |
19 |
20 | image_plane = 1.#57
21 |
22 | surface_z = 22.8562
23 | carbon_z = 29.47029
24 |
25 | print "carbon_z: ", carbon_z
26 | print "surface_z: ", surface_z
27 | d = ((carbon_z - surface_z) - image_plane)
28 | W = -13.606/(2*d)
29 | print "d: ", d, "W: ", W, "QP: ", QP
30 | sigma = QP - W
31 |
32 | print "c6_z - surface_z: ", carbon_z - surface_z, "sigma: ", sigma
33 | print "image plane: ", image_plane
34 |
--------------------------------------------------------------------------------
/cat_XDATCAR:
--------------------------------------------------------------------------------
1 | #!/bin/tcsh
2 |
3 | rm -rf files
4 |
5 | mkdir files
6 |
7 | set num=`ls -l CONTCAR.10* | awk '{print $9}' | head -1 | sed s/"\."/" "/g | awk '{print $2}'`
8 |
9 | cp POSCAR."$num" files/POSCAR
10 | cp ../POTCAR files/POTCAR
11 | cp CONTCAR."$num" files/CONTCAR
12 |
13 | head -5 XDATCAR."$num" > files/XDATCAR
14 |
15 | foreach file ( XDATCAR.* )
16 |
17 | tail -n +6 $file >> files/XDATCAR
18 |
19 | end
20 |
--------------------------------------------------------------------------------
/chg.in:
--------------------------------------------------------------------------------
1 | CHGCAR
2 | 3 ! perpendicular to 1-x, 2-y, 3-z
3 | 1.0 ! scale by 1/vol or not, 1-yes, other-no
4 | 0.0 ! shift the data
5 | 1 ! ns, # of spins
6 | 0 ! lcutoff, provide a cutoff: 1-yes,other-no
7 |
8 | 0 ! calculate the average along z: 0-no, in angstrom
9 | 0
10 |
--------------------------------------------------------------------------------
/clean.sh:
--------------------------------------------------------------------------------
1 | #!/bin/tcsh
2 |
3 | foreach machine (cl001 cl002 cl003 cl004 cl005 cl006)
4 |
5 | echo $machine
6 | ssh $machine /usr/local/bin/qclean-mx.sh
7 |
8 | end
9 |
--------------------------------------------------------------------------------
/clean_dftb.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | rm slurm* autotest.tag band.out charges.bin detailed.out dftb_pin.hsd geo_end.xyz output.log md.out tmp-broyden*
4 |
--------------------------------------------------------------------------------
/cluster_state:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | n2=`wwnodes | grep nano2 | egrep -v 'offline|down|debug|0\/|1\/|2\/|3\/|4\/|5\/|6\/|7\/' | wc -l`
4 | n4=`wwnodes | grep nano4 | egrep -v 'offline|down|debug|0\/|1\/|2\/|3\/|4\/|5\/|6\/|7\/' | wc -l`
5 | n8=`wwnodes | grep nano8 | egrep -v 'offline|down|debug|0\/|1\/|2\/|3\/|4\/|5\/|6\/|7\/' | wc -l`
6 | lawrencium=`wwnodes | grep lawrencium | egrep -v 'offline|down|debug|0\/|1\/|2\/|3\/|4\/|5\/|6\/|7\/' | wc -l`
7 | lawrencium2=`wwnodes | grep lr2 | egrep -v 'offline|down|debug|0\/|1\/|2\/|3\/|4\/|5\/|6\/|7\/' | wc -l`
8 | vulcan=`wwnodes | grep vulcan | egrep -v 'SHUTDOWN|READY|offline|down|debug|0\/|1\/|2\/|3\/|4\/|5\/|6\/|7\/' | wc -l`
9 |
10 |
11 | echo -n "nano2: "
12 | echo -n $n2
13 | echo " nodes available"
14 |
15 | echo -n "nano4: "
16 | echo -n $n4
17 | echo " nodes available"
18 |
19 | echo -n "nano8: "
20 | echo -n $n8
21 | echo " nodes available"
22 |
23 | echo -n "vulcan: "
24 | echo -n $vulcan
25 | echo " nodes available"
26 |
27 | echo -n "lawrencium: "
28 | echo -n $lawrencium
29 | echo " nodes available"
30 |
31 | echo -n "lawrencium2: "
32 | echo -n $lawrencium2
33 | echo " nodes available"
34 |
35 |
--------------------------------------------------------------------------------
/converger.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | rm -f analysis.txt
4 |
5 | grep "dielectric constant" au*.out >> analysis.txt
6 | echo >> analysis.txt
7 | grep -A 9 "q-point number" au*.out >> analysis.txt
8 | grep -A 9 "Heads and wings" au*.out >> analysis.txt
9 |
--------------------------------------------------------------------------------
/convert.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | echo "18839" > coor.xyz
4 | echo "110., 110., 1000.0" >> coor.xyz
5 |
6 | awk '/O/{print "O ", $2, $3, $4}' $1 >> coor.xyz
7 | awk '/SI/{print "Si ", $2, $3, $4}' $1 >> coor.xyz
8 | awk '/H/{print "H ", $2, $3, $4}' $1 >> coor.xyz
9 |
10 | echo "coor.xyz" > RDF.in
11 | echo "RDF.O-Si.dat" >> RDF.in
12 | echo "O" >> RDF.in
13 | echo "Si" >> RDF.in
14 | echo "10.0" >> RDF.in
15 | echo "0.025" >> RDF.in
16 | echo "1" >> RDF.in
17 |
18 | ./RDF < RDF.in
19 |
20 | echo "coor.xyz" > RDF.in
21 | echo "RDF.O-O.dat" >> RDF.in
22 | echo "O" >> RDF.in
23 | echo "O" >> RDF.in
24 | echo "10.0" >> RDF.in
25 | echo "0.025" >> RDF.in
26 | echo "1" >> RDF.in
27 |
28 | ./RDF < RDF.in
29 |
30 |
31 | echo "coor.xyz" > RDF.in
32 | echo "RDF.Si-Si.dat" >> RDF.in
33 | echo "Si" >> RDF.in
34 | echo "Si" >> RDF.in
35 | echo "10.0" >> RDF.in
36 | echo "0.025" >> RDF.in
37 | echo "1" >> RDF.in
38 |
39 | ./RDF < RDF.in
40 |
41 | echo "coor.xyz" > RDF.in
42 | echo "RDF.O-H.dat" >> RDF.in
43 | echo "O" >> RDF.in
44 | echo "H" >> RDF.in
45 | echo "10.0" >> RDF.in
46 | echo "0.025" >> RDF.in
47 | echo "1" >> RDF.in
48 |
49 | ./RDF < RDF.in
50 |
51 |
--------------------------------------------------------------------------------
/convert_coor_TRAJEC.lithium-no_com.pwscf:
--------------------------------------------------------------------------------
1 | #!/bin/csh
2 |
3 | set acell=`grep celldm lithium.pw.inp | awk '{print $3}' | sed s/,//g`
4 | set natoms=`grep nat lithium.pw.inp | tail -1 | awk '{print $3}' | sed s/,//g`
5 |
6 | touch output/fake.out
7 |
8 | grep -A $natoms ATOMIC_POSITIONS output/*.out | awk '/Li/{print $2," ",$3," ",$4}' | sed s/"\-"/" \-"/g | awk -f ~/scripts/utils/convert_coor_TRAJEC.awk acell=$acell natoms=$natoms > TRAJEC.xyz
9 |
--------------------------------------------------------------------------------
/coordinates.xyz:
--------------------------------------------------------------------------------
1 | 32
2 | 20.0, 20.0, 10.0
3 | H 0.0 0.0 0.0
4 | H 0.0 0.0 0.73999999999999999
5 | H 0.0 0.0 5.0
6 | H 0.0 0.0 5.7400000000000002
7 | H 0.0 10.0 0.0
8 | H 0.0 10.0 0.73999999999999999
9 | H 0.0 10.0 5.0
10 | H 0.0 10.0 5.7400000000000002
11 | H 5.0 0.0 0.0
12 | H 5.0 0.0 0.73999999999999999
13 | H 5.0 0.0 5.0
14 | H 5.0 0.0 5.7400000000000002
15 | H 5.0 10.0 0.0
16 | H 5.0 10.0 0.73999999999999999
17 | H 5.0 10.0 5.0
18 | H 5.0 10.0 5.7400000000000002
19 | H 10.0 0.0 0.0
20 | H 10.0 0.0 0.73999999999999999
21 | H 10.0 0.0 5.0
22 | H 10.0 0.0 5.7400000000000002
23 | H 10.0 10.0 0.0
24 | H 10.0 10.0 0.73999999999999999
25 | H 10.0 10.0 5.0
26 | H 10.0 10.0 5.7400000000000002
27 | H 15.0 0.0 0.0
28 | H 15.0 0.0 0.73999999999999999
29 | H 15.0 0.0 5.0
30 | H 15.0 0.0 5.7400000000000002
31 | H 15.0 10.0 0.0
32 | H 15.0 10.0 0.73999999999999999
33 | H 15.0 10.0 5.0
34 | H 15.0 10.0 5.7400000000000002
35 |
--------------------------------------------------------------------------------
/count_scc_steps.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | grep -B 2 "Total Energy" output.log | grep -v Total | grep -v "\-\-" | awk '{n+=1; print n, $1; getline}' > scc_steps.dat
4 |
--------------------------------------------------------------------------------
/dftb/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itamblyn/scripts/bbf02f08bed4d6e8afedfbced53f721010b0fd4f/dftb/.DS_Store
--------------------------------------------------------------------------------
/dftb/analyze_dftb.sh:
--------------------------------------------------------------------------------
1 | #!/bin/tcsh
2 |
3 | RDF < RDF.in > /dev/null &
4 |
5 | rm -f msd.in
6 | echo "geo_CONTCAR.xyz" > msd.in
7 | msd.x < msd.in > /dev/null &
8 |
9 | rm -f pressure.dat
10 | grep Pa output.log | grep -v Pars | grep -v Path | awk '{n+=1; print n, $4/1e9}' > pressure.dat &
11 |
12 | rm -f temperature.dat
13 | grep "MD Temperature" output.log | awk '{n+=1; print n, $5}' > temperature.dat &
14 |
15 | rm -f tail.xyz
16 | tail -516000 geo_CONTCAR.xyz > tail.xyz
17 |
18 | RDF < RDF.tail.in > /dev/null &
19 |
--------------------------------------------------------------------------------
/dftb/clean_dftb.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | rm slurm* autotest.tag band.out charges.bin detailed.out dftb_pin.hsd geo_end.xyz output.log md.out tmp-broyden*
4 |
--------------------------------------------------------------------------------
/dftb/dptools-0.1p2.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itamblyn/scripts/bbf02f08bed4d6e8afedfbced53f721010b0fd4f/dftb/dptools-0.1p2.tar.gz
--------------------------------------------------------------------------------
/dftb/dptools-0.1p2/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2011 Bálint Aradi, B. Hourahine, A. Pecchia
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy of
4 | this software and associated documentation files (the "Software"), to deal in
5 | the Software without restriction, including without limitation the rights to
6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
7 | the Software, and to permit persons to whom the Software is furnished to do so,
8 | subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in all
11 | copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
15 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
16 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 |
--------------------------------------------------------------------------------
/dftb/dptools-0.1p2/PKG-INFO:
--------------------------------------------------------------------------------
1 | Metadata-Version: 1.0
2 | Name: dptools
3 | Version: 0.1p2
4 | Summary: Tools to process DFTB+ related data
5 | Home-page: http://www.dftb-plus.info
6 | Author: B. Aradi, B. Hourahine, A. Pecchia
7 | Author-email: UNKNOWN
8 | License: UNKNOWN
9 | Description:
10 | Processing and converting data related to the DFTB+ package
11 | -----------------------------------------------------------
12 | A few scripts which should make the life of DFTB+ users easier, by providing
13 | functions to process and convert various DFTB+ data formats.
14 |
15 | Platform: platform independent
16 | Classifier: Programming Language :: Python
17 | Classifier: Environment :: Console
18 | Classifier: Intended Audience :: Science/Research
19 | Classifier: License :: OSI Approved :: MIT License
20 | Classifier: Operating System :: OS Independent
21 | Classifier: Topic :: Scientific/Engineering
22 |
--------------------------------------------------------------------------------
/dftb/dptools-0.1p2/build/lib/dptools/__init__.py:
--------------------------------------------------------------------------------
1 | from dptools.bandout import *
2 | from dptools.gen import *
3 | from dptools.xyz import *
4 |
5 |
--------------------------------------------------------------------------------
/dftb/dptools-0.1p2/build/lib/dptools/common.py:
--------------------------------------------------------------------------------
1 | ############################################################################
2 | # Various commonly used routines.
3 | ############################################################################
4 | import gzip
5 |
6 | def openfile(fobj, mode=None):
7 | """Opens a file or a file like object.
8 |
9 | Args:
10 | fobj: File name or file like object.
11 | mode: File access mode (default: 'r')
12 |
13 | Returns:
14 | If a string (file name) was provided for fobj, a pointer to the
15 | opened file. Otherwise the original file like object.
16 | """
17 | if mode is None:
18 | mode = "r"
19 | if isinstance(fobj, str):
20 | if fobj.endswith(".gz"):
21 | fp = gzip.open(fobj, mode)
22 | else:
23 | fp = open(fobj, mode)
24 | else:
25 | fp = fobj
26 | return fp
27 |
--------------------------------------------------------------------------------
/dftb/dptools-0.1p2/setup.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | from distutils.core import setup
3 |
4 | setup(name="dptools",
5 | version="0.1p2",
6 | description="Tools to process DFTB+ related data",
7 | author="B. Aradi, B. Hourahine, A. Pecchia",
8 | url="http://www.dftb-plus.info",
9 | platforms="platform independent",
10 | package_dir={"": "src"},
11 | packages=["dptools", ],
12 | scripts=[ "bin/dp_bands",
13 | "bin/dp_dos",
14 | "bin/gen2xyz",
15 | "bin/gen2cif",
16 | "bin/xyz2gen",
17 | ],
18 | classifiers=[
19 | "Programming Language :: Python",
20 | "Environment :: Console",
21 | "Intended Audience :: Science/Research",
22 | "License :: OSI Approved :: MIT License",
23 | "Operating System :: OS Independent",
24 | "Topic :: Scientific/Engineering",
25 | ],
26 | long_description="""
27 | Processing and converting data related to the DFTB+ package
28 | -----------------------------------------------------------
29 | A few scripts which should make the life of DFTB+ users easier, by providing
30 | functions to process and convert various DFTB+ data formats.
31 | """
32 | )
33 |
--------------------------------------------------------------------------------
/dftb/dptools-0.1p2/src/dptools/__init__.py:
--------------------------------------------------------------------------------
1 | from dptools.bandout import *
2 | from dptools.gen import *
3 | from dptools.xyz import *
4 |
5 |
--------------------------------------------------------------------------------
/dftb/dptools-0.1p2/src/dptools/common.py:
--------------------------------------------------------------------------------
1 | ############################################################################
2 | # Various commonly used routines.
3 | ############################################################################
4 | import gzip
5 |
6 | def openfile(fobj, mode=None):
7 | """Opens a file or a file like object.
8 |
9 | Args:
10 | fobj: File name or file like object.
11 | mode: File access mode (default: 'r')
12 |
13 | Returns:
14 | If a string (file name) was provided for fobj, a pointer to the
15 | opened file. Otherwise the original file like object.
16 | """
17 | if mode is None:
18 | mode = "r"
19 | if isinstance(fobj, str):
20 | if fobj.endswith(".gz"):
21 | fp = gzip.open(fobj, mode)
22 | else:
23 | fp = open(fobj, mode)
24 | else:
25 | fp = fobj
26 | return fp
27 |
--------------------------------------------------------------------------------
/dftb/dptools/lib/python2.6/site-packages/dptools-0.1p2-py2.6.egg-info:
--------------------------------------------------------------------------------
1 | Metadata-Version: 1.0
2 | Name: dptools
3 | Version: 0.1p2
4 | Summary: Tools to process DFTB+ related data
5 | Home-page: http://www.dftb-plus.info
6 | Author: B. Aradi, B. Hourahine, A. Pecchia
7 | Author-email: UNKNOWN
8 | License: UNKNOWN
9 | Description:
10 | Processing and converting data related to the DFTB+ package
11 | -----------------------------------------------------------
12 | A few scripts which should make the life of DFTB+ users easier, by providing
13 | functions to process and convert various DFTB+ data formats.
14 |
15 | Platform: platform independent
16 | Classifier: Programming Language :: Python
17 | Classifier: Environment :: Console
18 | Classifier: Intended Audience :: Science/Research
19 | Classifier: License :: OSI Approved :: MIT License
20 | Classifier: Operating System :: OS Independent
21 | Classifier: Topic :: Scientific/Engineering
22 |
--------------------------------------------------------------------------------
/dftb/dptools/lib/python2.6/site-packages/dptools/__init__.py:
--------------------------------------------------------------------------------
1 | from dptools.bandout import *
2 | from dptools.gen import *
3 | from dptools.xyz import *
4 |
5 |
--------------------------------------------------------------------------------
/dftb/dptools/lib/python2.6/site-packages/dptools/__init__.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itamblyn/scripts/bbf02f08bed4d6e8afedfbced53f721010b0fd4f/dftb/dptools/lib/python2.6/site-packages/dptools/__init__.pyc
--------------------------------------------------------------------------------
/dftb/dptools/lib/python2.6/site-packages/dptools/bandout.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itamblyn/scripts/bbf02f08bed4d6e8afedfbced53f721010b0fd4f/dftb/dptools/lib/python2.6/site-packages/dptools/bandout.pyc
--------------------------------------------------------------------------------
/dftb/dptools/lib/python2.6/site-packages/dptools/cif.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itamblyn/scripts/bbf02f08bed4d6e8afedfbced53f721010b0fd4f/dftb/dptools/lib/python2.6/site-packages/dptools/cif.pyc
--------------------------------------------------------------------------------
/dftb/dptools/lib/python2.6/site-packages/dptools/common.py:
--------------------------------------------------------------------------------
1 | ############################################################################
2 | # Various commonly used routines.
3 | ############################################################################
4 | import gzip
5 |
6 | def openfile(fobj, mode=None):
7 | """Opens a file or a file like object.
8 |
9 | Args:
10 | fobj: File name or file like object.
11 | mode: File access mode (default: 'r')
12 |
13 | Returns:
14 | If a string (file name) was provided for fobj, a pointer to the
15 | opened file. Otherwise the original file like object.
16 | """
17 | if mode is None:
18 | mode = "r"
19 | if isinstance(fobj, str):
20 | if fobj.endswith(".gz"):
21 | fp = gzip.open(fobj, mode)
22 | else:
23 | fp = open(fobj, mode)
24 | else:
25 | fp = fobj
26 | return fp
27 |
--------------------------------------------------------------------------------
/dftb/dptools/lib/python2.6/site-packages/dptools/common.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itamblyn/scripts/bbf02f08bed4d6e8afedfbced53f721010b0fd4f/dftb/dptools/lib/python2.6/site-packages/dptools/common.pyc
--------------------------------------------------------------------------------
/dftb/dptools/lib/python2.6/site-packages/dptools/gen.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itamblyn/scripts/bbf02f08bed4d6e8afedfbced53f721010b0fd4f/dftb/dptools/lib/python2.6/site-packages/dptools/gen.pyc
--------------------------------------------------------------------------------
/dftb/dptools/lib/python2.6/site-packages/dptools/geometry.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itamblyn/scripts/bbf02f08bed4d6e8afedfbced53f721010b0fd4f/dftb/dptools/lib/python2.6/site-packages/dptools/geometry.pyc
--------------------------------------------------------------------------------
/dftb/dptools/lib/python2.6/site-packages/dptools/xyz.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itamblyn/scripts/bbf02f08bed4d6e8afedfbced53f721010b0fd4f/dftb/dptools/lib/python2.6/site-packages/dptools/xyz.pyc
--------------------------------------------------------------------------------
/dftb/gFollow:
--------------------------------------------------------------------------------
1 | #!/bin/tcsh
2 |
3 | rm -f gnuplot.scr
4 |
5 | #rm -f tail.xyz
6 | #tail -258000 geo_CONTCAR.xyz > tail.xyz
7 |
8 | #RDF < RDF.tail.in > /dev/null #&
9 | #echo "RDF"
10 |
11 | #rm -f msd.in
12 | #echo "geo_CONTCAR.xyz" > msd.in
13 | #msd.x < msd.in > /dev/null &
14 | #echo "msd"
15 | rm -f pressure.dat
16 | grep -a Pa output.log | grep -v Pars | grep -v Path | awk '{n+=1; print n, $4/1e9}' > pressure.dat &
17 | rm -f volume.dat
18 | grep Volume output.log | awk '{n+=1; print n, $2}' > volume.dat &
19 | grep Temperature output.log | awk '{n+=1; print n, $5}' > temperature.dat
20 |
21 |
22 | wait
23 |
24 | set cmd="gnuplot.scr"
25 | cat > $cmd << END
26 | #set style data linespoints
27 | #set xlabel "Distance [AA]"
28 | #set yrange [0:*]
29 | #set ylabel "g(r)"
30 | #plot "RDF.dat" u 1:2
31 | #pause -1 "Showing RDF.\nPress enter to quit"
32 |
33 | #set ylabel "msd"
34 | #set xlabel "Timestep [ps]"
35 | #plot "msd.dat" u (\$1*0.000774016):2 every 10
36 | #pause -1 "Showing MSD.\nPress enter to quit"
37 |
38 | set ylabel "pressure [GPa]"
39 | set yrange [*:*]
40 | set y2range [*:*]
41 | plot "pressure.dat" u (\$1*0.000774016):(\$2) every 10, "volume.dat" u (\$1*0.000774016):(\$2/1E5) every 10 axes x1y2
42 | pause -1 "Showing pressure.\nPress enter to quit"
43 |
44 | set ylabel "temperature [K]"
45 | set yrange [0:*]
46 | plot "temperature.dat" u (\$1*0.000774016):(\$2) every 10
47 | pause -1 "Showing temperature.\nPress enter to quit"
48 |
49 | quit
50 | END
51 |
52 | gnuplot $cmd
53 |
54 | \rm $cmd
55 |
56 | rm -f msd.dat
57 |
--------------------------------------------------------------------------------
/dftb/xyz_to_gen.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python2.7
2 | # this is a bit of a hack code to make gen files from a single xyz
3 |
4 |
5 | import numpy
6 | import sys
7 |
8 | inputFile = open(sys.argv[1],'r')
9 | alat = float(sys.argv[2])
10 |
11 | outputFile = open('input.gen','w')
12 |
13 | natom = int(inputFile.readline().split()[0])
14 |
15 | atom_name = {'C':0, 'O':1, 'H':2}
16 | atom_array = []
17 |
18 | for i in range(len(atom_name)):
19 |
20 | atom_array.append([])
21 |
22 | inputFile.readline() # skips blank line
23 |
24 | for line in inputFile.readlines():
25 | name = line.split()[0]
26 | x,y,z = float(line.split()[1]), float(line.split()[2]), float(line.split()[3])
27 | atom_array[atom_name[name]].append([x,y,z])
28 |
29 | type_counter = 1
30 | atom_counter = 1
31 |
32 | outputFile.write(str(natom) + ' S\n')
33 |
34 | for name in atom_name:
35 | outputFile.write(name + ' ')
36 |
37 | outputFile.write('\n')
38 |
39 | for i in range(len(atom_name)):
40 |
41 | for triple in atom_array[i]:
42 | outputFile.write(str(atom_counter) + ' ' + str(type_counter) + ' ' + str(float(triple[0])) \
43 | + ' ' + str(float(triple[1])) + ' ' + str(float(triple[2])) + '\n')
44 | atom_counter += 1
45 |
46 | type_counter += 1
47 |
48 | outputFile.write('0.000E+00 0.000E+00 0.000E+00 \n')
49 | outputFile.write(str(alat) + ' 0.000E+00 0.000E+00 \n')
50 | outputFile.write('0.000E+00 ' + str(alat)+ ' 0.000E+00 \n')
51 | outputFile.write('0.000E+00 0.000E+00 ' +str(alat)+ ' \n')
52 |
--------------------------------------------------------------------------------
/diffbig:
--------------------------------------------------------------------------------
1 | #!/bin/tcsh
2 |
3 | set file1=$1
4 | set file2=$2
5 |
6 | md5sum $file1 > .file1.out &
7 | md5sum $file2 > .file2.out &
8 |
9 | wait
10 |
11 | cat .file1.out .file2.out
12 |
13 | rm .file1.out .file2.out
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/dncar.in:
--------------------------------------------------------------------------------
1 | dNCAR
2 | 3 ! perpendicular to 1-x, 2-y, 3-z
3 | 0.0 ! scale by 1/vol or not, 1-yes, other-no
4 | 0.0 ! shift the data
5 | 1 ! ns, # of spins
6 | 0 ! lcutoff, provide a cutoff: 1-yes,other-no
7 |
8 | 0 ! calculate the average along z: 0-no, in angstrom
9 | 0
10 |
--------------------------------------------------------------------------------
/dx_fixer.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | grep -B 10000000 "grid connections" $1 > dx_voxels.dat &
4 |
5 | grep -A 100000 "grid connections" $1 > dx_parameters.dat
6 |
7 | awk '/gridpositions/{print $1, "1", $3, $4, $5, $6, $7, $8}' dx_parameters.dat > output.dx
8 |
9 | grep origin dx_parameters.dat >> output.dx
10 | grep delta dx_parameters.dat >> output.dx
11 | awk '/gridconnections/{print $1, "2", $3, $4, $5, $6, $7, $8}' dx_parameters.dat >> output.dx
12 |
13 | wait
14 |
15 | awk '/array/{print $1, "3", $3, $4, $5, $6, $7, $8, $9, $10, $11, $12} ! /array/{print $0} ' dx_voxels.dat | grep -v "#" | grep -v "^$" >> output.dx
16 |
17 |
--------------------------------------------------------------------------------
/extract.sh:
--------------------------------------------------------------------------------
1 | #!/bin/csh
2 |
3 | grep -A 28 Summary output.log | grep "\." | awk '{print $2,$3 }' > energy.dat
4 |
--------------------------------------------------------------------------------
/extract_dipole.sh:
--------------------------------------------------------------------------------
1 | #!/bin/tcsh
2 |
3 | # 1 D = 0.393430307 e*a_0
4 | # 2.5417462310548435
5 |
6 | rm -f planechg.in
7 | ln -s ~/scripts/chg.in planechg.in
8 | /global/home/users/itamblyn/bin/planechg.x
9 | rm planechg.in planechg.out
10 | mv planechg.dat chg.dat
11 |
12 | rm -f planechg.in
13 | ln -s ~/scripts/pot.in planechg.in
14 | /global/home/users/itamblyn/bin/planechg.x
15 | rm planechg.in planechg.out
16 | mv planechg.dat pot.dat
17 |
18 | module unload gnuplot
19 | module load gnuplot/4.2.5-gcc-gd
20 |
21 | set cmd="gnuplot.scr"
22 | cat > $cmd << END
23 | set style data lines
24 | set xlabel "Position [A]"
25 | set yrange [*:*]
26 | set terminal png
27 | set output 'density_and_potential.png'
28 | plot "chg.dat" t "Charge density", "pot.dat" u 1:(\$2*100) t "Potential"
29 | quit
30 | END
31 |
32 | gnuplot $cmd
33 |
34 | \rm $cmd
35 |
36 | if ( -d chg ) then
37 |
38 | if( ! -e trimmed.dat ) then
39 |
40 | set parent=`pwd`
41 | set chgdiff=~/scripts/vtstscripts/chgdiff.pl
42 | $chgdiff CHGCAR chg/sur/CHGCAR
43 | mv CHGCAR_diff CHGCAR.noslab
44 | $chgdiff CHGCAR.noslab chg/mol/CHGCAR
45 | mv CHGCAR_diff dNCAR
46 | rm CHGCAR.noslab
47 | rm -f planechg.in
48 | ln -s ~/scripts/dncar.in planechg.in
49 | /global/home/users/itamblyn/nano1/butanediamine_junction/chgplane.x
50 | rm -f planechg.in
51 | echo
52 | echo "Okay, now you have to trim the file planechg.dat, and call it trimmed.dat"
53 | endif
54 |
55 | if( -e trimmed.dat ) then
56 |
57 | echo "Did you remember to trim both ends of the file??"
58 |
59 | set origin=`head -1 trimmed.dat | awk '{print $2}'`
60 |
61 | awk '\!/#/{i+=((($2 - '$origin')/0.529177)*$3*2.5417462310548435); print $2, i}' trimmed.dat | tail -1
62 |
63 | endif
64 |
65 | endif
66 |
--------------------------------------------------------------------------------
/extract_dipole_different.sh:
--------------------------------------------------------------------------------
1 | #!/bin/tcsh
2 |
3 | # 1 D = 0.393430307 e*a_0
4 | # 2.5417462310548435
5 |
6 | rm -f planechg.in
7 | ln -s ~/scripts/chg.in planechg.in
8 | /global/home/users/itamblyn/bin/planechg.x
9 | rm planechg.in planechg.out
10 | mv planechg.dat chg.dat
11 |
12 | rm -f planechg.in
13 | ln -s ~/scripts/pot.in planechg.in
14 | /global/home/users/itamblyn/bin/planechg.x
15 | rm planechg.in planechg.out
16 | mv planechg.dat pot.dat
17 |
18 | module unload gnuplot
19 | module load gnuplot/4.2.5-gcc-gd
20 |
21 | set cmd="gnuplot.scr"
22 | cat > $cmd << END
23 | set style data lines
24 | set xlabel "Position [A]"
25 | set yrange [*:*]
26 | set terminal png
27 | set output 'chg.png'
28 | plot "chg.dat" t "Charge density", "pot.dat" u 1:(\$2*100) t "Potential"
29 | quit
30 | END
31 |
32 | gnuplot $cmd
33 |
34 | \rm $cmd
35 |
36 | if( ! -e trimmed.dat ) then
37 |
38 | set parent=`pwd`
39 | set chgdiff=~/scripts/vtstscripts/chgdiff.pl
40 | $chgdiff CHGCAR chg/sur/CHGCAR
41 | mv CHGCAR_diff CHGCAR.noslab
42 | $chgdiff CHGCAR.noslab chg/mol/CHGCAR
43 | mv CHGCAR_diff dNCAR
44 | rm CHGCAR.noslab
45 | rm -f planechg.in
46 | ln -s ../dncar.in planechg.in
47 | /global/home/users/itamblyn/nano1/butanediamine_junction/chgplane.x
48 | rm -f planechg.in
49 | echo
50 | echo "Okay, now you have to trim the file planechg.dat, and call it trimmed.dat"
51 | endif
52 |
53 | if( -e trimmed.dat ) then
54 |
55 | echo "Did you remember to trim both ends of the file??"
56 |
57 | set origin=`head -1 trimmed.dat | awk '{print $2}'`
58 |
59 | awk '\!/#/{i+=((($2 - '$origin')/0.529177)*$3*2.5417462310548435); print $2, i}' trimmed.dat | tail -1
60 |
61 | endif
62 |
--------------------------------------------------------------------------------
/extract_eig_from_total.sh:
--------------------------------------------------------------------------------
1 | #!/bin/tcsh
2 |
3 | foreach kpoint ( 04*k? )
4 |
5 | cd $kpoint
6 |
7 | echo $kpoint
8 |
9 | awk '{print $2, $10}' total >> ../eig.dat
10 |
11 | cd ..
12 |
13 | end
14 |
--------------------------------------------------------------------------------
/follow_qbz.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | etot=`grep Conv output.out | head -1 | awk '{print $2}'`
4 |
5 | awk -v e=$etot '/Conv/{print ($2 - e)*27.2}' output.out
6 |
--------------------------------------------------------------------------------
/form.ch:
--------------------------------------------------------------------------------
1 | #!/bin/tcsh
2 |
3 | set file=$1
4 |
5 | setenv g09root /usr/local/gaussian
6 | setenv GAUSS_SCRDIR /globalscratch/$USER/
7 | source /usr/local/gaussian/g09/bsd/g09.login
8 | formchk $file
9 |
--------------------------------------------------------------------------------
/getEnergy.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python
2 |
3 | import sys, commands
4 |
5 | combined_energy = float(commands.getoutput('grep "Convergence criterion met" ../output.out | tail -1 ').split()[1])
6 | iso_counter = int(commands.getoutput('grep "Convergence criterion met" output.out | wc -l '))
7 |
8 | iso_energy_line = commands.getoutput('grep "Convergence criterion met" output.out').split()
9 |
10 | total = combined_energy
11 |
12 |
13 |
14 | iso_energy = []
15 |
16 | for i in range(iso_counter):
17 |
18 | iso_energy.append(float(iso_energy_line[1 + i*6]))
19 | total -= iso_energy[-1]
20 |
21 | print combined_energy, iso_energy
22 | print -total*627.509469
23 |
24 |
25 |
--------------------------------------------------------------------------------
/get_binding.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | combined=`grep TOTEN OUTCAR | tail -1 | awk '{print $5}'`
4 | molecule=`grep TOTEN chg/mol/OUTCAR | tail -1 | awk '{print $5}'`
5 | surface=`grep TOTEN chg/sur/OUTCAR | tail -1 | awk '{print $5}'`
6 |
7 | echo "combined: $combined"
8 | echo "molecule: $molecule"
9 | echo "surface: $surface"
10 | echo "----------------"
11 |
12 | binding=`echo "$combined - $molecule - $surface" | bc`
13 |
14 | echo "binding: $binding"
15 |
16 | grep IDIPOL INCAR chg/mol/INCAR chg/sur/INCAR
17 | grep LDIPOL INCAR chg/mol/INCAR chg/sur/INCAR
18 | grep NGXF OUTCAR | head -1
19 | grep NGXF chg/mol/OUTCAR | head -1
20 | grep NGXF chg/sur/OUTCAR | head -1
21 | tail -3 KPOINTS | head -1
22 | tail -3 chg/mol/KPOINTS | head -1
23 | tail -3 chg/sur/KPOINTS | head -1
24 |
--------------------------------------------------------------------------------
/get_ip.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | wget -U Mozilla http://automation.whatismyip.com/n09230945.asp
4 | echo -n "mini: " > $HOME/dropbox/ip.txt
5 | cat n09230945.asp >> $HOME/dropbox/ip.txt
6 | rm -f n09230945.asp
7 | scp $HOME/dropbox/ip.txt solidpress@solidstatepress.com:html/ip.html
8 |
--------------------------------------------------------------------------------
/get_mini_ip.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | /sw/bin/wget http://www.solidstatepress.com/ip.html
4 | mv ip.html $HOME/ip.dat
5 |
--------------------------------------------------------------------------------
/gw_sigx.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | touch tmp.out
4 |
5 | neig=`awk '/bdgw/{print $3}' *.out | head -1`
6 | nkptgw=`grep nkptgw *.out | head -1 | awk '/nkptgw/{print $3}'`
7 |
8 | echo "# nkptgw: $nkptgw neig: $neig" > sigx.dat
9 | echo "# E0 SigX SigC(E0) Z dSigC/dE Sig(E) E-E0 E" >> sigx.dat
10 |
11 | #grep -A $neig "Band E0" *.out | grep -v "Band" | grep -v "\-\-" | awk '{print $3, $4, $5}'>> sigx.dat
12 | grep -A $neig "Band E0" *.out | grep -v "Band" | grep -v "\-\-" | awk '{print $3, $4, $5, $6, $7, $8, $9, $10, $11}'>> sigx.dat
13 |
14 | head sigx.dat
15 |
16 | rm tmp.out
17 |
--------------------------------------------------------------------------------
/h-s.ini:
--------------------------------------------------------------------------------
1 | 1.00 0 1 6 0.00 : z nc nv iexc rnlc
2 | 1 0 1.00 : n l f
3 | 0 t : lmax s_pp_def
4 |
--------------------------------------------------------------------------------
/h.ini:
--------------------------------------------------------------------------------
1 | 1.00 0 1 6 0.00 : z nc nv iexc rnlc
2 | 1 0 1.00 : n l f
3 | 1 t : lmax s_pp_def
4 |
--------------------------------------------------------------------------------
/histogram.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | import numpy, matplotlib, pylab, sys
4 |
5 | inputFile = open ('data.dat','r')
6 |
7 | index = 0
8 |
9 | data_array = []
10 | for line in inputFile.readlines():
11 | # for i in line.split():
12 | # BAND_array.append(float(i))
13 | data_array.append(float(line.split()[index]))
14 |
15 | inputFile.close()
16 |
17 | print 'input read complete'
18 |
19 | #pylab.hist(BAND_array, 250, 1)
20 | pylab.hist(data_array)
21 | #pylab.axis([-4,2.0,0,1.6])
22 |
23 | #pylab.savefig(sys.argv[1])
24 | pylab.show()
25 |
--------------------------------------------------------------------------------
/lammpstogen.OH.pl:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl
2 |
3 | $atom_types = "O H";
4 | print "WARNING!! check atom types: $atom_types\n";
5 | open (INF, "<$ARGV[0]") || die "Can't open input dump file\n";
6 | open (OUT, ">lmp_traj.gen") || die "Can't open lmp_traj.gen\n";
7 | while () {
8 | $time_step = ;
9 | chomp($time_step);
10 | $line = ;
11 | $natom = ;
12 | chomp($natom);
13 | print (OUT " $natom S # time step $time_step\n");
14 | print (OUT "$atom_types\n");
15 | $line = ;
16 | # assumes orthorhombic box
17 | @line = split " ", ;
18 | $lx = $line[1] - $line[0];
19 | @line = split " ", ;
20 | $ly = $line[1] - $line[0];
21 | @line = split " ", ;
22 | $lz = $line[1] - $line[0];
23 | @line = split " ", ;
24 | for ($i = 0; $i < @line; $i++) {
25 | if ($line[$i] =~ /id/) {
26 | $id_ind = $i-2;
27 | } elsif ($line[$i] =~ /type/) {
28 | $type_ind = $i - 2;
29 | } elsif ($line[$i] =~ /x/) {
30 | $x_ind = $i - 2;
31 | } elsif ($line[$i] =~ /y/) {
32 | $y_ind = $i - 2;
33 | } elsif ($line[$i] =~ /z/) {
34 | $z_ind = $i - 2;
35 | }
36 | }
37 | for ($i = 0; $i < $natom; $i++) {
38 | @line = split " ", ;
39 | print (OUT " $line[$id_ind] $line[$type_ind] $line[$x_ind] $line[$y_ind] $line[$z_ind]\n");
40 | }
41 | print (OUT " 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00\n");
42 | print (OUT " $lx 0.0000000000E+00 0.0000000000E+00\n");
43 | print (OUT " 0.0000000000E+00 $ly 0.0000000000E+00\n");
44 | print (OUT " 0.0000000000E+00 0.0000000000E+00 $lz\n");
45 | }
46 | close (INF);
47 | close (OUT);
48 |
--------------------------------------------------------------------------------
/lammpstogen.OHNC.pl:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl
2 |
3 | $atom_types = "O H N C";
4 | print "WARNING!! check atom types: $atom_types\n";
5 | open (INF, "<$ARGV[0]") || die "Can't open input dump file\n";
6 | open (OUT, ">lmp_traj.gen") || die "Can't open lmp_traj.gen\n";
7 | while () {
8 | $time_step = ;
9 | chomp($time_step);
10 | $line = ;
11 | $natom = ;
12 | chomp($natom);
13 | print (OUT " $natom S # time step $time_step\n");
14 | print (OUT "$atom_types\n");
15 | $line = ;
16 | # assumes orthorhombic box
17 | @line = split " ", ;
18 | $lx = $line[1] - $line[0];
19 | @line = split " ", ;
20 | $ly = $line[1] - $line[0];
21 | @line = split " ", ;
22 | $lz = $line[1] - $line[0];
23 | @line = split " ", ;
24 | for ($i = 0; $i < @line; $i++) {
25 | if ($line[$i] =~ /id/) {
26 | $id_ind = $i-2;
27 | } elsif ($line[$i] =~ /type/) {
28 | $type_ind = $i - 2;
29 | } elsif ($line[$i] =~ /x/) {
30 | $x_ind = $i - 2;
31 | } elsif ($line[$i] =~ /y/) {
32 | $y_ind = $i - 2;
33 | } elsif ($line[$i] =~ /z/) {
34 | $z_ind = $i - 2;
35 | }
36 | }
37 | for ($i = 0; $i < $natom; $i++) {
38 | @line = split " ", ;
39 | print (OUT " $line[$id_ind] $line[$type_ind] $line[$x_ind] $line[$y_ind] $line[$z_ind]\n");
40 | }
41 | print (OUT " 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00\n");
42 | print (OUT " $lx 0.0000000000E+00 0.0000000000E+00\n");
43 | print (OUT " 0.0000000000E+00 $ly 0.0000000000E+00\n");
44 | print (OUT " 0.0000000000E+00 0.0000000000E+00 $lz\n");
45 | }
46 | close (INF);
47 | close (OUT);
48 |
--------------------------------------------------------------------------------
/lammpstogen.pl:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl
2 |
3 | $atom_types = "O H";
4 | print "WARNING!! check atom types: $atom_types\n";
5 | open (INF, "<$ARGV[0]") || die "Can't open input dump file\n";
6 | open (OUT, ">lmp_traj.gen") || die "Can't open lmp_traj.gen\n";
7 | while () {
8 | $time_step = ;
9 | chomp($time_step);
10 | $line = ;
11 | $natom = ;
12 | chomp($natom);
13 | print (OUT " $natom S # time step $time_step\n");
14 | print (OUT "$atom_types\n");
15 | $line = ;
16 | # assumes orthorhombic box
17 | @line = split " ", ;
18 | $lx = $line[1] - $line[0];
19 | @line = split " ", ;
20 | $ly = $line[1] - $line[0];
21 | @line = split " ", ;
22 | $lz = $line[1] - $line[0];
23 | @line = split " ", ;
24 | for ($i = 0; $i < @line; $i++) {
25 | if ($line[$i] =~ /id/) {
26 | $id_ind = $i-2;
27 | } elsif ($line[$i] =~ /type/) {
28 | $type_ind = $i - 2;
29 | } elsif ($line[$i] =~ /x/) {
30 | $x_ind = $i - 2;
31 | } elsif ($line[$i] =~ /y/) {
32 | $y_ind = $i - 2;
33 | } elsif ($line[$i] =~ /z/) {
34 | $z_ind = $i - 2;
35 | }
36 | }
37 | for ($i = 0; $i < $natom; $i++) {
38 | @line = split " ", ;
39 | print (OUT " $line[$id_ind] $line[$type_ind] $line[$x_ind] $line[$y_ind] $line[$z_ind]\n");
40 | }
41 | print (OUT " 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00\n");
42 | print (OUT " $lx 0.0000000000E+00 0.0000000000E+00\n");
43 | print (OUT " 0.0000000000E+00 $ly 0.0000000000E+00\n");
44 | print (OUT " 0.0000000000E+00 0.0000000000E+00 $lz\n");
45 | }
46 | close (INF);
47 | close (OUT);
48 |
--------------------------------------------------------------------------------
/loop.delta.sh:
--------------------------------------------------------------------------------
1 | #!/bin/tcsh
2 |
3 | # 1 D = 0.393430307 e*a_0
4 | # 2.5417462310548435
5 |
6 |
7 | set parent=`pwd`
8 | set chgdiff=~/scripts/vtstscripts/chgdiff.pl
9 |
10 | foreach r ( ???_DOS )
11 |
12 | echo $r
13 | cd $r
14 |
15 | cd z
16 |
17 | pwd
18 |
19 | # $chgdiff CHGCAR chg/sur/CHGCAR
20 | # mv CHGCAR_diff CHGCAR.noslab
21 | # $chgdiff CHGCAR.noslab chg/mol/CHGCAR
22 | # mv CHGCAR_diff dNCAR
23 | # rm CHGCAR.noslab
24 |
25 | rm -f planechg.in
26 | ln -s ../../dncar.in planechg.in
27 | /global/home/users/itamblyn/nano1/butanediamine_junction/chgplane.x
28 | rm -f planechg.in
29 |
30 | # echo "READ NOTE THIS FILE ABOUT DELETING PART OF planechg.dat"
31 |
32 | awk '\!/#/{i+=((($2 - 14.840528)/0.529177)*$3*2.5417462310548435); print $2, i}' trimmed.dat # i deleted the parts of the file that were not the molecule!!!!!!
33 |
34 | cd ../..
35 |
36 | end
37 |
38 |
--------------------------------------------------------------------------------
/loop_parchg.sh:
--------------------------------------------------------------------------------
1 | #!/bin/tcsh
2 |
3 |
4 | echo "VOLUME" > planechg.in
5 | echo "3" >> planechg.in
6 | echo "0" >> planechg.in
7 | echo "0.0" >> planechg.in
8 | echo "1" >> planechg.in
9 | echo "0" >> planechg.in
10 | echo " " >> planechg.in
11 | echo "0" >> planechg.in
12 | echo "0">> planechg.in
13 |
14 |
15 | foreach r ( PARCHG* )
16 |
17 | rm VOLUME
18 | ln -s $r VOLUME
19 | set band=`echo $r | sed s/"\."/" "/g | awk '{print $2}'`
20 | ~/bin/planechg.x
21 | mv planechg.dat "$band".dat
22 |
23 | end
24 |
--------------------------------------------------------------------------------
/looper.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | rm -f eqp0_k0.dat eqp1_k0.dat eqp0.dat eqp1.dat
4 |
5 | for directory in n?_NN
6 |
7 | do
8 |
9 | cd $directory
10 | echo $directory
11 | ~/bin/eqp_dft.py eqp0 frq0 sig.log eqp0.dat
12 | rm -f x??
13 | head -36 eqp0.dat > k0.dat
14 | cat eqp0.dat >> ../eqp0.dat
15 | rm eqp0.dat
16 | cat k0.dat >> ../eqp0_k0.dat
17 |
18 | ~/bin/eqp_dft.py eqp1 frq0 sig.log eqp1.dat
19 | rm -f x??
20 | head -36 eqp1.dat > k1.dat
21 | cat eqp1.dat >> ../eqp1.dat
22 | rm eqp1.dat
23 | cat k1.dat >> ../eqp1_k0.dat
24 |
25 | cd ..
26 |
27 | done
28 |
29 |
30 | echo "# nkptgw: 1 neig: 2880" > eig0.dat
31 | echo "# E(DFT) E(GW)" >> eig0.dat
32 | awk '{print $4, $5}' eqp0.dat >> eig0.dat
33 |
34 |
35 | echo "# nkptgw: 1 neig: 2880" > eig1.dat
36 | echo "# E(DFT) E(GW)" >> eig1.dat
37 | awk '{print $4, $5}' eqp1.dat >> eig1.dat
38 |
39 | echo "1.0" > wtk.tmp
40 |
41 | echo "eig0.dat" > dos.in
42 | echo "wtk.tmp" >> dos.in
43 |
44 | ~/bin/dos_kpt.x < dos.in
45 |
46 | mv gw_dos.dat gw_eqp0_dos.dat
47 |
48 | echo "eig1.dat" > dos.in
49 | echo "wtk.tmp" >> dos.in
50 |
51 | ~/bin/dos_kpt.x < dos.in
52 |
53 | mv gw_dos.dat gw_eqp1_dos.dat
54 |
--------------------------------------------------------------------------------
/machinesfilescript/hostlist.out:
--------------------------------------------------------------------------------
1 | Warning: no access to tty; thus no job control in this shell...
2 | Sun Microsystems Inc. SunOS 5.10 Generic January 2005
3 | Thu Aug 9 20:49:27 NDT 2007
4 | PE_HOSTFILE is /var/spool/sge/cl012/active_jobs/88217.1/pe_hostfile and contains:
5 | -----------------------------
6 | cl012 16 all.q@cl012
7 | -----------------------------
8 | HOSTNAME is cl012
9 | NHOSTS is 1
10 | NSLOTS is 16
11 | TMPDIR is /tmp/88217.1.all.q
12 | JOB_ID is 88217
13 | SGE_O_WORKDIR is /home/itamblyn/machinesfilescript
14 | /tmp/88217.1.all.q/machines contains:
15 | -----------------------------
16 | cl012
17 | cl012
18 | cl012
19 | cl012
20 | cl012
21 | cl012
22 | cl012
23 | cl012
24 | cl012
25 | cl012
26 | cl012
27 | cl012
28 | cl012
29 | cl012
30 | cl012
31 | cl012
32 | -----------------------------
33 | logout
34 |
--------------------------------------------------------------------------------
/machinesfilescript/hostlist.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | #$ -S /bin/csh
3 | #$ -cwd
4 | #$ -N hostlist
5 | #$ -j y
6 | #$ -o hostlist.out
7 | #$ -pe openmp 16
8 | #$ -l h_vmem=250M,h_rt=00:01:00
9 | date
10 | echo PE_HOSTFILE is $PE_HOSTFILE and contains:
11 | echo -----------------------------
12 | cat $PE_HOSTFILE
13 | echo -----------------------------
14 | echo HOSTNAME is $HOSTNAME
15 | echo NHOSTS is $NHOSTS
16 | echo NSLOTS is $NSLOTS
17 | echo TMPDIR is $TMPDIR
18 | echo JOB_ID is $JOB_ID
19 | echo SGE_O_WORKDIR is $SGE_O_WORKDIR
20 | # You might want to adjust this next path to your liking...
21 | $SGE_O_WORKDIR/startmpi.sh $PE_HOSTFILE
22 | echo $TMPDIR/machines contains:
23 | echo -----------------------------
24 | cat $TMPDIR/machines
25 | echo -----------------------------
26 |
--------------------------------------------------------------------------------
/machinesfilescript/startmpi.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | #
3 | # preparation of the mpi machine file
4 | #
5 | # usage: startmpi.sh
6 | #
7 |
8 | PeHostfile2MachineFile()
9 | {
10 | cat $1 | while read line; do
11 | host=`echo $line|cut -f1 -d" "|cut -f1 -d"."`
12 | nslots=`echo $line|cut -f2 -d" "`
13 | i=1
14 | while [ $i -le $nslots ]; do
15 | echo $host
16 | i=`expr $i + 1`
17 | done
18 | done
19 | }
20 |
21 | #
22 | # on success the job will find a machine-file in $TMPDIR/machines
23 | #
24 |
25 | me=`basename $0`
26 |
27 | # test number of args
28 | if [ $# -ne 1 ]; then
29 | echo "$me: got wrong number of arguments" >&2
30 | exit 1
31 | fi
32 |
33 | # get arguments
34 | pe_hostfile=$1
35 |
36 | # ensure pe_hostfile is readable
37 | if [ ! -r $pe_hostfile ]; then
38 | echo "$me: can't read $pe_hostfile" >&2
39 | exit 1
40 | fi
41 |
42 | machines="$TMPDIR/machines"
43 | PeHostfile2MachineFile $pe_hostfile >> $machines
44 |
45 | # signal success to caller
46 | exit 0
47 |
--------------------------------------------------------------------------------
/monitor.sh:
--------------------------------------------------------------------------------
1 | #!/bin/tcsh
2 |
3 | foreach machine (cl001 cl002 cl003 cl004 cl005 cl006)
4 |
5 | echo $machine
6 | ssh $machine /usr/local/bin/qclean-mx.sh
7 |
8 | end
9 |
--------------------------------------------------------------------------------
/myrinet:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | qstat -u \* -f | awk '/cl00/{print $0} /cl010/{print $0} /cl011/{print $0} /cl012/{print $0}' | awk '/short/{print $1, $3, $4}' > out.tmp
4 | cat out.tmp
5 | echo
6 | echo -n "Total slots in use: "
7 | sed s/@/" "/g out.tmp | sed s/"\/"/" "/g | awk '{nslots+=$3; print nslots}' | tail -1
8 | echo -n "Open slots: "
9 | sed s/@/" "/g out.tmp | sed s/"\/"/" "/g | awk '{nslots+=$3; print 192 - nslots}' | tail -1
10 | rm out.tmp
11 |
--------------------------------------------------------------------------------
/neaton_image.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python
2 |
3 | #QP = -7.430 - -5.839# BDA, HOMO-1, 829 bands
4 |
5 | #QP = -26.005 - -22.514 # BDA, LOMO, 829 bands
6 |
7 | #QP = -2.7789 # BDA, HOMO, experiment
8 | #QP = -1.956 # BDA, HOMO, 3330 bands
9 | QP = -1.433 # BDA, HOMO, 829 bands
10 |
11 | print 'REMEMBER TO SEE IF ITS IN DIRECT COORINDATES OR NOT'
12 |
13 | image_plane = 1.47
14 |
15 | surface_z = 12.094969999999968
16 |
17 | import numpy
18 |
19 | inputFile = open('CONTCAR', 'r') # this makes sure it's direct coordinates
20 |
21 | for i in range(2):
22 |
23 | inputFile.readline()
24 |
25 | a = []
26 |
27 | for i in range(3):
28 |
29 | a.append(float(inputFile.readline().split()[i]))
30 |
31 | for i in range(3):
32 |
33 | inputFile.readline()
34 |
35 |
36 | z_coor = []
37 |
38 | for i in range(6):
39 |
40 | z_coor.append(a[2]*float(inputFile.readline().split()[2]))
41 |
42 | carbon_z = numpy.average(z_coor)
43 | print "carbon_z: ", carbon_z
44 | print "surface_z: ", surface_z
45 | d = ((carbon_z - surface_z) - image_plane)/0.529177
46 | W = -13.605692/(2*d)
47 | print "d: ", d, "W: ", W, "QP: ", QP
48 | sigma = QP - W
49 |
50 | print "c6_z - surface_z: ", carbon_z - surface_z, "sigma: ", sigma
51 |
52 |
--------------------------------------------------------------------------------
/neaton_image_manual.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | import sys
3 | import numpy
4 |
5 | QP = -3.1
6 |
7 | #image_plane = 1.47
8 | #image_plane =
9 | image_plane = .75
10 |
11 | surface_z = 0.0
12 | carbon_z = surface_z + 3.5 # flat111
13 |
14 | #carbon_z = surface_z + 5.4
15 |
16 | print "carbon_z: ", carbon_z
17 | print "surface_z: ", surface_z
18 | print "image_plane: ", image_plane
19 | d = ((carbon_z - surface_z) - image_plane)/0.529177
20 | W = -13.605692/(2*d)
21 | print "d: ", d, "W: ", W, "QP: ", QP
22 | sigma = QP - W
23 |
24 | print "c6_z - surface_z: ", carbon_z - surface_z, "sigma: ", sigma
25 |
26 |
--------------------------------------------------------------------------------
/offdiag_writer.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | import numpy
4 |
5 | band_index_min = 16
6 | band_index_max = 22
7 |
8 | #j = 21
9 |
10 | sigma_matrix = 21
11 |
12 |
13 | noffdiag = int((((band_index_max+1) - band_index_min)**2 - ((band_index_max+1) - band_index_min))/2.)
14 |
15 | print "number_offdiag", noffdiag
16 | print "begin offdiag"
17 |
18 | for i in numpy.arange(band_index_min,band_index_max+1):
19 |
20 | for j in numpy.arange(i, band_index_max+1):
21 | if (i != j):
22 |
23 | # sigma_matrix = j
24 | print " ",i,j,sigma_matrix
25 |
26 |
27 | print "end"
28 | #number_offdiag noffdiag
29 | #begin offdiag
30 | # n_1 m_1 l_1
31 | # n_2 m_2 l_2
32 | # ...
33 | # n_noffdiag m_noffdiag l_noffdiag
34 | #end
35 |
36 |
--------------------------------------------------------------------------------
/planechg.in:
--------------------------------------------------------------------------------
1 | LOCPOT
2 | 3 ! perpendicular to 1-x, 2-y, 3-z
3 | 1 ! scale by 1/vol or not, 1-yes, other-no
4 | 0.0 ! shift the data
5 | 1 ! ns, # of spins
6 | 0 ! lcutoff, provide a cutoff: 1-yes,other-no
7 |
8 | 0 ! calculate the average along z: 0-no, in angstrom
9 | 0
10 |
--------------------------------------------------------------------------------
/pot.in:
--------------------------------------------------------------------------------
1 | LOCPOT
2 | 3 ! perpendicular to 1-x, 2-y, 3-z
3 | 0.0 ! scale by 1/vol or not, 1-yes, other-no
4 | 0.0 ! shift the data
5 | 1 ! ns, # of spins
6 | 0 ! lcutoff, provide a cutoff: 1-yes,other-no
7 |
8 | 0 ! calculate the average along z: 0-no, in angstrom
9 | 0
10 |
--------------------------------------------------------------------------------
/ps_trans:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itamblyn/scripts/bbf02f08bed4d6e8afedfbced53f721010b0fd4f/ps_trans
--------------------------------------------------------------------------------
/qchem.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | rm -f machinefile
4 |
5 | for i in {1..8}
6 |
7 | do
8 |
9 | hostname >> machinefile
10 |
11 | done
12 |
13 |
14 | module load QChem/3202
15 | export QCSCRATCH=`pwd`
16 | export PBS_NODEFILE=./machinefile
17 |
18 | NP=8
19 |
20 | $QC/bin/qchem -pbs -save -np $NP input.in qchem.out scratch
21 |
--------------------------------------------------------------------------------
/qdel_all:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | status | tail -n +6 | sed s/"\."/" "/g | awk '{printf " "$1" "}' > $HOME/.hold_list
4 | echo >> $HOME/.hold_list
5 | cat $HOME/.hold_list | xargs qdel
6 | rm $HOME/.hold_list
7 |
--------------------------------------------------------------------------------
/qhold_all:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | status | tail -n +6 | sed s/"\."/" "/g | awk '{printf " "$1" "}' > $HOME/.hold_list
4 | echo >> $HOME/.hold_list
5 | cat $HOME/.hold_list | xargs qhold
6 | rm $HOME/.hold_list
7 |
--------------------------------------------------------------------------------
/qinfo:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | export directory=`qstat -j $1 | grep sge_o_workdir | awk '{print $2}'`
4 | echo $directory
5 |
--------------------------------------------------------------------------------
/qrls_all:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | status | tail -n +6 | sed s/"\."/" "/g | awk '{printf " "$1" "}' > $HOME/.hold_list
4 | echo >> $HOME/.hold_list
5 | cat $HOME/.hold_list | xargs qrls
6 | rm $HOME/.hold_list
7 |
--------------------------------------------------------------------------------
/read.py:
--------------------------------------------------------------------------------
1 | #!/usr/local/bin/python
2 |
3 |
4 | import sys, os
5 | sys.path += ["/g/g91/ogitsu/bin"]
6 | from phys import *
7 |
8 | confs = []
9 | atoms = []
10 | for file in sys.arg[1:]:
11 | for line in open(file):
12 | tmp = line.split()
13 | if len(tmp) == 1:
14 | numatom = int(tmp[0])
15 | if len(atoms) > 0:
16 | confs += [cell,atoms]
17 | atoms = []
18 | elif len(tmp) == 9:
19 | (ax,ay,az,bx,by,bz,cx,cy,cz) = tmp
20 | aa = D3v(float(ax),float(ay),float(az))
21 | bb = D3v(float(bx),float(by),float(bz))
22 | cc = D3v(float(cy),float(cy),float(cz))
23 | cell = PeriodicCell(aa,bb,cc)
24 | elif len(tmp) == 4:
25 | (name,x,y,z) = tmp
26 | r = D3v(float(x),float(y),float(z))
27 | atoms += [{'element':name,'pos':r}]
28 |
29 |
30 | for conf in confs:
31 | cell = conf.pop(0)
32 | for atoms in conf:
33 | for atom in atoms:
34 | print atom['element'],atom['pos']
35 |
--------------------------------------------------------------------------------
/running_average.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python
2 |
3 | import os, sys
4 | import numpy as np
5 |
6 | def example_function(a,b,c=17.5,d=True):
7 | """
8 | variables that do not
9 | """
10 | # Now just code in the function
11 | sum = a+b+c
12 | if d:
13 | print 'd = True'
14 | else:
15 | print 'd != True'
16 |
17 | return sum
18 |
19 |
20 | def main():
21 | """
22 | read an array from file, compute the running average, write to disk
23 | """
24 | # A clean way to ask for user input
25 | try:
26 | # Attempt to retrieve required input from user
27 | prog = sys.argv[0]
28 | inputFilename = sys.argv[1]
29 | stride = int(sys.argv[2])
30 | except IndexError:
31 | print '\nusage: '+prog+' inputFilename\n'
32 | sys.exit(0)
33 |
34 | # Execute the function defined above
35 |
36 | inputFile = open(inputFilename,'r')
37 |
38 | x = []
39 | y = []
40 |
41 | for line in inputFile.readlines():
42 |
43 | if line.split() != '#': # looks for header
44 |
45 | x.append(float(line.split()[0]))
46 | y.append(float(line.split()[1]))
47 |
48 |
49 | outputFile = open('raverage.dat','w')
50 |
51 | # for i in np.arange(stride, len(y) - stride):
52 | for i in np.arange(0, len(y)):
53 | if i > stride or i > len(y) - stride:
54 | outputFile.write(str(x[i]) +' '+str(np.average(y[(i-stride):(i+stride+1)]))+'\n')
55 | else:
56 | outputFile.write(str(x[i]) +' '+str(y[i])+'\n')
57 | outputFile.close()
58 |
59 | # This executes main() only if executed from shell
60 | if __name__ == '__main__':
61 | main()
62 |
--------------------------------------------------------------------------------
/sharcnet.csh:
--------------------------------------------------------------------------------
1 | #!/bin/csh
2 |
3 | foreach n (`awk '{print $1}' ~/scripts/sharcnet.txt`)
4 | echo -n $n
5 | grep $n ~/scripts/sharcnet.txt | awk '{print " (" $3 " processors)"}'
6 | set processors=`grep $n ~/scripts/sharcnet.txt | awk '{print $3}'`
7 | ssh itamblyn@$n qstat | grep run > status.$n
8 | awk '{r+=$1;w+=$3; print r" running (" '$processors' - r " free), " w " waiting"}' status.$n | tail -1
9 | rm status.$n
10 | echo
11 | end
12 |
13 |
--------------------------------------------------------------------------------
/sharcnet.txt:
--------------------------------------------------------------------------------
1 | goblin.sharcnet.ca opteron 122
2 | narwhal.sharcnet.ca opteron 1068
3 | dolphin.sharcnet.ca opteron 128
4 | bala.sharcnet.ca opteron 128
5 | bruce.sharcnet.ca opteron 128
6 | megaladon.sharcnet.ca opteron 128
7 | tiger.sharcnet.ca opteron 128
8 | zebra.sharcnet.ca opteron 128
9 | greatwhite.sharcnet.ca alpha 456
10 |
--------------------------------------------------------------------------------
/shockwave/lammpstogen.pl:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl
2 |
3 | $atom_types = "O H";
4 | print "WARNING!! check atom types: $atom_types\n";
5 | open (INF, "<$ARGV[0]") || die "Can't open input dump file\n";
6 | open (OUT, ">lmp_traj.gen") || die "Can't open lmp_traj.gen\n";
7 | while () {
8 | $time_step = ;
9 | chomp($time_step);
10 | $line = ;
11 | $natom = ;
12 | chomp($natom);
13 | print (OUT " $natom S # time step $time_step\n");
14 | print (OUT "$atom_types\n");
15 | $line = ;
16 | # assumes orthorhombic box
17 | @line = split " ", ;
18 | $lx = $line[1] - $line[0];
19 | @line = split " ", ;
20 | $ly = $line[1] - $line[0];
21 | @line = split " ", ;
22 | $lz = $line[1] - $line[0];
23 | @line = split " ", ;
24 | for ($i = 0; $i < @line; $i++) {
25 | if ($line[$i] =~ /id/) {
26 | $id_ind = $i-2;
27 | } elsif ($line[$i] =~ /type/) {
28 | $type_ind = $i - 2;
29 | } elsif ($line[$i] =~ /x/) {
30 | $x_ind = $i - 2;
31 | } elsif ($line[$i] =~ /y/) {
32 | $y_ind = $i - 2;
33 | } elsif ($line[$i] =~ /z/) {
34 | $z_ind = $i - 2;
35 | }
36 | }
37 | for ($i = 0; $i < $natom; $i++) {
38 | @line = split " ", ;
39 | print (OUT " $line[$id_ind] $line[$type_ind] $line[$x_ind] $line[$y_ind] $line[$z_ind]\n");
40 | }
41 | print (OUT " 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00\n");
42 | print (OUT " $lx 0.0000000000E+00 0.0000000000E+00\n");
43 | print (OUT " 0.0000000000E+00 $ly 0.0000000000E+00\n");
44 | print (OUT " 0.0000000000E+00 0.0000000000E+00 $lz\n");
45 | }
46 | close (INF);
47 | close (OUT);
48 |
--------------------------------------------------------------------------------
/showq:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | wwnodes | grep free | grep nano | grep -v debug
4 |
5 | echo "_____________________________________________________________________"
6 | echo -n " "
7 |
8 | #wwnodes | grep free | grep nano | grep -v debug | awk '{n+=$4 + $5; print n}' | tail -1
9 | wwnodes | grep free | grep nano | grep -v debug | awk '{n+=1; print n}' | tail -1
10 | echo
11 |
12 | qstat -u $USER | grep $USER
13 |
--------------------------------------------------------------------------------
/subtract.sh:
--------------------------------------------------------------------------------
1 | #!/bin/csh
2 |
3 |
4 | # subtract off energy of first configuration
5 |
6 | set first=`head -1 energy.dat | awk '{print $2}'`
7 | echo "# dist energy ab_energy" > energy_sub.dat
8 | awk '{print $1, $2 - '$first', $2}' energy.dat >> energy_sub.dat
9 |
10 | # calculate slope with numerical derivative
11 |
12 | awk '{print $1, -($2 - n);n=$2}' energy.dat | tail +2 > difference.dat
13 |
--------------------------------------------------------------------------------
/sync_research.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | rsync -av --delete -e ssh ~/desktop/research/* itamblyn@192.168.1.5:~/research/
3 | rsync -av --delete -e ssh ~/desktop/research/* itamblyn@chaffey.phys.dal.ca:~/research/
4 |
--------------------------------------------------------------------------------
/telemachos:
--------------------------------------------------------------------------------
1 | 98.248.194.223
--------------------------------------------------------------------------------
/template.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | <<<<<<< HEAD
3 | =======
4 |
5 | # Template for Isaac
6 | >>>>>>> 26723bb9b43ae9671fb3fdacd4c5c1eb367a3cb3
7 |
8 | import os, sys
9 |
10 | def example_function(a,b,c=17.5,d=True):
11 | """
12 | This is an example function
13 | a: A number that must be handed to the function
14 | b: A number that must be handed to the function
15 | c: A value that can be handed to the function but if not
16 | has a default value of 17.5
17 | d: A value that can be handed to the function but if not
18 | has a default value of True
19 | NOTE: Variables with default values must be given after
20 | variables that do not
21 | """
22 | # Now just code in the function
23 | sum = a+b+c
24 | if d:
25 | print 'd = True'
26 | else:
27 | print 'd != True'
28 |
29 | return sum
30 |
31 |
32 | def main():
33 | """
34 | This is the main function.
35 | """
36 | # A clean way to ask for user input
37 | try:
38 | # Attempt to retrieve required input from user
39 | prog = sys.argv[0]
40 | a = float(sys.argv[1])
41 | b = float(sys.argv[1])
42 | except IndexError:
43 | # Tell the user what they need to give
44 | print '\nusage: '+prog+' a b (where a & b are numbers)\n'
45 | # Exit the program cleanly
46 | sys.exit(0)
47 |
48 | # Execute the function defined above
49 | sum = example_function(a,b)
50 |
51 | print 'sum =',sum
52 |
53 |
54 | # This executes main() only if executed from shell
55 | if __name__ == '__main__':
56 | main()
57 |
--------------------------------------------------------------------------------
/test.dat:
--------------------------------------------------------------------------------
1 | 1 6
2 | 2 7
3 | 3 8
4 | 4 9
5 | 5 10
6 |
--------------------------------------------------------------------------------
/utils/convert_coor_BOHR.awk:
--------------------------------------------------------------------------------
1 | {
2 |
3 | print $1*acell, $2*acell, $3*acell
4 |
5 | }
6 |
--------------------------------------------------------------------------------
/utils/convert_coor_TRAJEC.awk:
--------------------------------------------------------------------------------
1 | {
2 |
3 | if (step%natoms == 0)
4 |
5 | {
6 |
7 | print natoms
8 | print int(step/natoms) + 1
9 | print "H", $1*acell*0.529177, $2*acell*0.529177, $3*acell*0.529177
10 |
11 | }
12 |
13 | else print "H", $1*acell*0.529177, $2*acell*0.529177, $3*acell*0.529177
14 | step+=1
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/utils/convert_coor_TRAJEC_cell.awk:
--------------------------------------------------------------------------------
1 | {
2 |
3 | if (step%natoms == 0)
4 |
5 | {
6 |
7 | print natoms
8 | print acell*0.529177, acell*0.529177, acell*0.529177
9 | print "H", $1*acell*0.529177, $2*acell*0.529177, $3*acell*0.529177
10 |
11 | }
12 |
13 | else print "H", $1*acell*0.529177, $2*acell*0.529177, $3*acell*0.529177
14 | step+=1
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/utils/forces.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | import sys
4 |
5 | filename = sys.argv[1]
6 | number_of_particles = int(sys.argv[2])
7 |
8 | inputFile = open (filename,'r')
9 |
10 | forces_array = []
11 |
12 | #read line into array
13 | for line in inputFile.readlines():
14 |
15 | # add a new sublist
16 | forces_array.append([])
17 |
18 | # loop over the elemets, split by whitespace
19 | for i in line.split():
20 |
21 | # convert to integer and append to the last
22 | # element of the list
23 | forces_array[-1].append(float(i))
24 |
25 | inputFile.close()
26 |
27 | number_of_snapshots = len(forces_array)/float(number_of_particles)
28 |
29 | outputFile = open ('forces.dat', 'w')
30 |
31 | s = 0 # counts over snapshots
32 |
33 | while s < number_of_snapshots:
34 |
35 | p = 0 # counts over particles
36 |
37 | fx = 0.0
38 | fy = 0.0
39 | fz = 0.0
40 |
41 | while p < number_of_particles:
42 |
43 | fx += forces_array[int(p + s*number_of_particles)][0]**2
44 | fy += forces_array[int(p + s*number_of_particles)][1]**2
45 | fz += forces_array[int(p + s*number_of_particles)][2]**2
46 |
47 | p +=1
48 |
49 | average_net_force = (fx + fy + fz)/float(number_of_particles)
50 |
51 | outputFile.write(repr(s) + ' ' + repr(average_net_force) + '\n')
52 |
53 | s += 1
54 |
55 | outputFile.close()
56 |
--------------------------------------------------------------------------------
/utils/gPlotAverage-Internal:
--------------------------------------------------------------------------------
1 | #!/bin/csh
2 | #-------------------------------------------------------------------------------
3 | # plot the average displacement as a function of time
4 | # I. Tamblyn C.I.W. 06-09-05
5 | #
6 | # based on a script by:
7 | # B. Militzer Livermore 04-23-01
8 | #-------------------------------------------------------------------------------
9 | set file=$1
10 | set timeStep=$2
11 |
12 | if (!(-e $1)) then
13 | echo "Could not find file '" $1 "'"
14 | exit(-1)
15 | endif
16 |
17 | set cmd="gnuplot.scr"
18 | cat > $cmd << END
19 | set xrange [0:*]
20 | set yrange [0:*]
21 | set xlabel "time (ps)"
22 | set ylabel "temperature (K)"
23 | plot "$file" u (\$1*$2*2.4188E-17/1.0E-12):2 t "running average of pressure (GPa)"
24 | pause -1 "Showing temperature-moving average.\nPress enter to quit"
25 | quit
26 | END
27 |
28 | gnuplot $cmd
29 |
30 | \rm $cmd
31 |
--------------------------------------------------------------------------------
/utils/gPlotAverage-Pressure:
--------------------------------------------------------------------------------
1 | #!/bin/csh
2 | #-------------------------------------------------------------------------------
3 | # plot the average displacement as a function of time
4 | # I. Tamblyn C.I.W. 06-09-05
5 | #
6 | # based on a script by:
7 | # B. Militzer Livermore 04-23-01
8 | #-------------------------------------------------------------------------------
9 | set file=$1
10 | set timeStep=$2
11 |
12 | if (!(-e $1)) then
13 | echo "Could not find file '" $1 "'"
14 | exit(-1)
15 | endif
16 |
17 | set cmd="gnuplot.scr"
18 | cat > $cmd << END
19 | set xrange [0:*]
20 | set yrange [0:*]
21 | set xlabel "time (ps)"
22 | set ylabel "pressure (GPa)"
23 | plot "$file" u (\$1*$2*2.4188E-17/1.0E-12):(\$2/10) t "running average of pressure (GPa)"
24 | pause -1 "Showing pressure-moving average.\nPress enter to quit"
25 | quit
26 | END
27 |
28 | gnuplot $cmd
29 |
30 | \rm $cmd
31 |
--------------------------------------------------------------------------------
/utils/gPlotAverage-Temperature:
--------------------------------------------------------------------------------
1 | #!/bin/csh
2 | #-------------------------------------------------------------------------------
3 | # plot the average displacement as a function of time
4 | # I. Tamblyn C.I.W. 06-09-05
5 | #
6 | # based on a script by:
7 | # B. Militzer Livermore 04-23-01
8 | #-------------------------------------------------------------------------------
9 | set file=$1
10 | set timeStep=$2
11 |
12 | if (!(-e $1)) then
13 | echo "Could not find file '" $1 "'"
14 | exit(-1)
15 | endif
16 |
17 | set cmd="gnuplot.scr"
18 | cat > $cmd << END
19 | set xrange [0:*]
20 | set yrange [0:*]
21 | set xlabel "time (ps)"
22 | set ylabel "temperature (K)"
23 | plot "$file" u (\$1*$2*2.4188E-17/1.0E-12):2 t "running average of pressure (GPa)"
24 | pause -1 "Showing temperature-moving average.\nPress enter to quit"
25 | quit
26 | END
27 |
28 | gnuplot $cmd
29 |
30 | \rm $cmd
31 |
--------------------------------------------------------------------------------
/utils/gPlotDiffusion:
--------------------------------------------------------------------------------
1 | #!/bin/csh
2 | #-------------------------------------------------------------------------------
3 | # plot the average displacement as a function of time
4 | # I. Tamblyn C.I.W. 06-09-05
5 | #
6 | # based on a script by:
7 | # B. Militzer Livermore 04-23-01
8 | #-------------------------------------------------------------------------------
9 | set file=$1
10 | set timeStep=$2
11 |
12 | if (!(-e $1)) then
13 | echo "Could not find file '" $1 "'"
14 | exit(-1)
15 | endif
16 |
17 | set cmd="gnuplot.scr"
18 | cat > $cmd << END
19 | set xlabel "time (ps)"
20 | set ylabel "average displacement"
21 | plot "$file" u (\$1*$2*2.4188E-17/1.0E-12):2 t "average displacement (A.U.)", "$file" u (\$1*$2*2.4188E-17/1.0E-12):3 t "nn_distance"
22 | pause -1 "Showing displacements.\nPress enter to quit"
23 | quit
24 | END
25 |
26 |
27 | gnuplot $cmd
28 |
29 | \rm $cmd
30 |
--------------------------------------------------------------------------------
/utils/gPlotDisplaced:
--------------------------------------------------------------------------------
1 | #!/bin/csh
2 | #-------------------------------------------------------------------------------
3 | # plot the average displacement as a function of time
4 | # I. Tamblyn C.I.W. 06-09-05
5 | #
6 | # based on a script by:
7 | # B. Militzer Livermore 04-23-01
8 | #-------------------------------------------------------------------------------
9 | set file=$1
10 | set timeStep=$2
11 |
12 | if (!(-e $1)) then
13 | echo "Could not find file '" $1 "'"
14 | exit(-1)
15 | endif
16 |
17 | set cmd="gnuplot.scr"
18 | cat > $cmd << END
19 | set yrange [0:100]
20 | set xlabel "time (ps)"
21 | set ylabel "percentage displacement"
22 | plot "$file" u (\$1*$2*2.4188E-17/1.0E-12):(\$4*100) t "% displacement"
23 | pause -1 "Showing % of displaced particles.\nPress enter to quit"
24 | quit
25 | END
26 |
27 |
28 | gnuplot $cmd
29 |
30 | \rm $cmd
31 |
--------------------------------------------------------------------------------
/utils/gPlotForces:
--------------------------------------------------------------------------------
1 | #!/bin/csh
2 | #-------------------------------------------------------------------------------
3 | # plot the average displacement as a function of time
4 | # I. Tamblyn C.I.W. 06-09-05
5 | #
6 | # based on a script by:
7 | # B. Militzer Livermore 04-23-01
8 | #-------------------------------------------------------------------------------
9 | set file=$1
10 | set timeStep=$2
11 |
12 | if (!(-e $1)) then
13 | echo "Could not find file '" $1 "'"
14 | exit(-1)
15 | endif
16 |
17 | set cmd="gnuplot.scr"
18 | cat > $cmd << END
19 | set xlabel "time (ps)"
20 | set ylabel "forces"
21 | plot "$file" u (\$1*$2*2.4188E-17/1.0E-12):2 t "forces (A.U.)"
22 | pause -1 "Showing forces.\nPress enter to quit"
23 | quit
24 | END
25 |
26 |
27 | gnuplot $cmd
28 |
29 | \rm $cmd
30 |
--------------------------------------------------------------------------------
/utils/gPlotPressure:
--------------------------------------------------------------------------------
1 | #!/bin/csh
2 | #-------------------------------------------------------------------------------
3 | # plot the pressure as a function of time
4 | # I. Tamblyn C.I.W. 06-09-05
5 | #
6 | # based on a script by:
7 | # B. Militzer Livermore 04-23-01
8 | #-------------------------------------------------------------------------------
9 | set file=$1
10 | set timeStep=$2
11 |
12 | if (!(-e $1)) then
13 | echo "Could not find file '" $1 "'"
14 | exit(-1)
15 | endif
16 |
17 | set cmd="gnuplot.scr"
18 | cat > $cmd << END
19 | set xlabel "Time (ps)"
20 | set ylabel "Pressure (GPa)"
21 | set yrange [*:*]
22 | plot "$file" u (\$1*$2*2.4188E-17/1.0E-12):(\$2)/10 t "pressure (GPa)"
23 | pause -1 "Showing pressure.\nPress enter to quit"
24 | quit
25 | END
26 |
27 |
28 | gnuplot $cmd
29 |
30 | \rm $cmd
31 |
32 |
33 | # "$file" u 1:3 t "ion temp"
34 | #
35 |
--------------------------------------------------------------------------------
/utils/running-average.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python
2 |
3 | import sys
4 |
5 | # usage: running-average.py filename column average_over
6 |
7 | filename = sys.argv[1]
8 | column = int(sys.argv[2]) - 1
9 | n = int(sys.argv[3])
10 |
11 | inputFile = open (sys.argv[1],'r')
12 |
13 | data_array = []
14 |
15 | #read line into array
16 | for line in inputFile.readlines():
17 |
18 | # add a new sublist
19 | data_array.append([])
20 |
21 | # loop over the elemets, split by whitespace
22 | for i in line.split():
23 |
24 | # convert to integer and append to the last
25 | # element of the list
26 | data_array[-1].append(float(i))
27 |
28 | inputFile.close()
29 |
30 | outputFile = open(filename + '.running', 'w')
31 |
32 | t = n - 1
33 |
34 | while t < len(data_array):
35 |
36 | i = t - (n - 1)
37 |
38 | average_count = float(0)
39 |
40 | while i <= t:
41 |
42 | average_count += data_array[i][column]
43 | i += 1
44 |
45 | outputFile.write(repr(t) + ' ' + repr(average_count/float(n)) + '\n')
46 |
47 | t += 1
48 |
49 | outputFile.close()
50 |
--------------------------------------------------------------------------------
/utils/wrap_TRAJEC.awk:
--------------------------------------------------------------------------------
1 | awk '! /H/{print $0} /H/{L=15.031741;N=1000000;x=$2-(int($2/L+N+0.5)-N)*L;y=$3-(int($3/L+N+0.5)-N)*L;z=$4-(int($4/L+N+0.5)-N)*L;print "C",x,y,z;}' TRAJEC.xyz > TRAJEC_C_pbc.xyz
2 |
--------------------------------------------------------------------------------
/utils/xyzReader.python:
--------------------------------------------------------------------------------
1 | number_of_particles = int(xyzFile.readline())
2 |
3 | atom_mass_list = {'H': 1.0, 'He': 4.0, 'Li' : 7.0, 'K' : 39.09830}
4 |
5 | CELL_array = []
6 | POSITION_array = []
7 |
8 | for line in xyzFile:
9 | if len(line.split()) == 4:
10 |
11 | POSITION_array.append([])
12 | atom_mass = atom_mass_list[line.split()[0]]
13 | POSITION_array[-1].append(atom_mass)
14 | position_vector = [float(line.split()[1])/(0.529177), float(line.split()[2])/(0.529177),float(line.split()[3])/(0.529177)]
15 | POSITION_array[-1].append(position_vector)
16 |
17 | elif len(line.split()) == 3:
18 | CELL_array.append([])
19 | for i in line.split():
20 | CELL_array[-1].append(float(i)/(0.529177*scale))
21 | xyzFile.close()
22 |
--------------------------------------------------------------------------------
/vasp/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itamblyn/scripts/bbf02f08bed4d6e8afedfbced53f721010b0fd4f/vasp/.DS_Store
--------------------------------------------------------------------------------
/vasp/cat_XDATCAR:
--------------------------------------------------------------------------------
1 | #!/bin/tcsh
2 |
3 | rm -rf files
4 |
5 | mkdir files
6 |
7 | set num=`ls -l CONTCAR.???? | awk '{print $9}' | head -2 | tail -1 | sed s/"\."/" "/g | awk '{print $2}'`
8 |
9 | cp POSCAR."$num" files/POSCAR
10 | cp ../POTCAR files/POTCAR
11 | cp CONTCAR."$num" files/CONTCAR
12 |
13 | head -5 XDATCAR."$num" > files/XDATCAR
14 |
15 | foreach file ( XDATCAR.* )
16 |
17 | tail -n +6 $file >> files/XDATCAR
18 |
19 | end
20 |
21 | cat vasprun.*.xml > files/vasprun.xml
22 |
--------------------------------------------------------------------------------
/vasp/monitor_efficiency.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | for OUTCAR in OUTCAR.1*
4 | do
5 | nsw=`grep NSW $OUTCAR | awk '{print $3}'`
6 | timesteps=`grep pressure $OUTCAR | wc -l`
7 | elapsed=`grep Elapsed $OUTCAR | awk '{print $4}'`
8 | nproc=`grep "running on" $OUTCAR | awk '{print $3}'`
9 | per_hour=`echo $elapsed | awk '{printf "%4.2f", $1/3600}'`
10 |
11 | echo -n "NSW=" $nsw ", "
12 | echo -n "Actual=" $timesteps ", "
13 | echo -n "Nproc=" $nproc ", "
14 | echo -n "Runtime= "$elapsed
15 | echo " " $per_hour
16 |
17 | done
18 |
--------------------------------------------------------------------------------
/vasp/nh3_vasp.sh:
--------------------------------------------------------------------------------
1 | #!/bin/csh
2 |
3 | ~/scripts/vasp/cat_XDATCAR
4 |
5 | cd files
6 |
7 | ~/scripts/xdat2xyz.pl
8 |
9 | ~/bin/RDF < ../../../analysis/RDF.NN.in &
10 | ~/bin/RDF < ../../../analysis/RDF.NH.in &
11 | ~/bin/RDF < ../../../analysis/RDF.HH.in &
12 |
13 | ~/bin/fortran/unwrap_PBC.x < ../../../analysis/unwrap.in
14 | ~/bin/fortran/msd.x < ../../../analysis/msd.in
15 |
16 | wait
17 |
18 |
--------------------------------------------------------------------------------
/vasp/vasp_clean:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | rm CHG EIGENVAL DOSCAR IBZKPT OSZICAR OUTCAR PCDAT XDATCAR
4 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/Fortran/CVS/Entries:
--------------------------------------------------------------------------------
1 | /Format.pm/1.1/Fri Feb 16 06:40:42 2007//
2 | D
3 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/Fortran/CVS/Repository:
--------------------------------------------------------------------------------
1 | vtstscripts/Fortran
2 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/Fortran/CVS/Root:
--------------------------------------------------------------------------------
1 | :ext:graeme@theory.cm.utexas.edu:/Groups/cvs
2 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/Math/Matrix.pm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itamblyn/scripts/bbf02f08bed4d6e8afedfbced53f721010b0fd4f/vasp/vtstscripts/Math/Matrix.pm
--------------------------------------------------------------------------------
/vasp/vtstscripts/README:
--------------------------------------------------------------------------------
1 | http://theory.cm.utexas.edu/vtsttools/scripts/
2 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/boxset.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | use FindBin qw($Bin);
5 | use lib "$Bin";
6 | use Vasp;
7 |
8 | @args=@ARGV;
9 | (@args==2) || die "usage: boxset.pl \n";
10 |
11 | $poscarfile1=$args[0];
12 | ($coordinates,$basis,$lattice,$num_atoms,$total_atoms,$selectiveflag,$selective,$description)
13 | =read_poscar($poscarfile1);
14 |
15 | $karcoords=dirkar($coordinates,$basis,$lattice,$total_atoms);
16 | $lattice_old=$lattice;
17 | $lattice=$args[1];
18 | for ($i=0;$i<3;$i++) {
19 | for ($j=0;$j<3;$j++) {
20 | $basis->[$i][$j]*=$lattice/$lattice_old;
21 | }
22 | }
23 | $coordsnew=kardir($karcoords,$basis,$lattice,$total_atoms);
24 |
25 | print "Total atoms: $total_atoms...\n";
26 | print "Lattice: $lattice...\n";
27 | print "Shift: ".$shift[0]." ".$shift[1]." ".$shift[2]."\n";
28 |
29 | write_poscar($coordsnew,$basis,$lattice,$num_atoms,$total_atoms,$selectiveflag,$selective,$description,"POSCAR.out");
30 |
31 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/chgavg.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | @args=@ARGV;
5 | @args==2 || die "usage: chgavg.pl \n";
6 |
7 |
8 | open (IN1,$args[0]) || die ("Can't open file $!");
9 | open (IN2,$args[1]) || die ("Can't open file $!");
10 | open (OUT,">CHGCAR_avg");
11 |
12 | for ($i=0;$i<5;$i++) {
13 | $line1=;
14 | $line2=;
15 | $header1.=$line1;
16 | }
17 |
18 | $atoms1=;
19 | $header1.=$atoms1;
20 | $atoms2=;
21 |
22 | @atoms1=split(/\s+/,$atoms1);
23 | @atoms2=split(/\s+/,$atoms2);
24 |
25 | $sum1 += $_ for @atoms1;
26 | $sum2 += $_ for @atoms2;
27 |
28 | print "Atoms in file1: ".$sum1.", Atoms in file2: ".$sum2."\n";
29 |
30 | for ($i=0;$i<$sum1+2;$i++) {
31 | $header1.=;
32 | }
33 | for ($i=0;$i<$sum2+2;$i++) {
34 | $dummy=;
35 | }
36 |
37 | $points1=;
38 | $header1.=$points1;
39 | $points2=;
40 |
41 | @points1=split(/\s+/,$points1);
42 | @points2=split(/\s+/,$points2);
43 |
44 | $psum1=1;
45 | $psum2=1;
46 |
47 | for ($i=1;$i<@points1;$i++) {
48 | $psum1*=$points1[$i];
49 | $psum2*=$points2[$i];
50 | }
51 |
52 | print "Points in file1: ".$psum1.", Points in file2: ".$psum2."\n";
53 |
54 | if ($psum1 != $psum2) {die ("Number of points not same in two files!");}
55 |
56 | print OUT $header1;
57 |
58 | for ($i=0;$i<$psum1/5;$i++) {
59 | $line1=;
60 | $line2=;
61 | @line1=split(/\s+/,$line1);
62 | @line2=split(/\s+/,$line2);
63 | for ($j=1;$j<@line1;$j++) {
64 | $line1[$j]=($line2[$j]+$line1[$j])/2;
65 | }
66 | printf OUT "%20.10e %20.10e %20.10e %20.10e %20.10e\n",$line1[1],$line1[2],$line1[3],$line1[4],$line1[5];
67 |
68 | }
69 |
70 | close(OUT);
71 | close(IN2);
72 | close(IN1);
73 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/chgdiff.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | @args=@ARGV;
5 | @args==2 || die "usage: chgdiff.pl - \n";
6 |
7 |
8 | open (IN1,$args[0]) || die ("Can't open file $!");
9 | open (IN2,$args[1]) || die ("Can't open file $!");
10 | open (OUT,">CHGCAR_diff");
11 |
12 | for ($i=0;$i<5;$i++) {
13 | $line1=;
14 | $line2=;
15 | $header1.=$line1;
16 | }
17 |
18 | $atoms1=;
19 | $header1.=$atoms1;
20 | $atoms2=;
21 |
22 | @atoms1=split(/\s+/,$atoms1);
23 | @atoms2=split(/\s+/,$atoms2);
24 |
25 | $sum1 += $_ for @atoms1;
26 | $sum2 += $_ for @atoms2;
27 |
28 | print "Atoms in file1: ".$sum1.", Atoms in file2: ".$sum2."\n";
29 |
30 | for ($i=0;$i<$sum1+2;$i++) {
31 | $header1.=;
32 | }
33 | for ($i=0;$i<$sum2+2;$i++) {
34 | $dummy=;
35 | }
36 |
37 | $points1=;
38 | $header1.=$points1;
39 | $points2=;
40 |
41 | @points1=split(/\s+/,$points1);
42 | @points2=split(/\s+/,$points2);
43 |
44 | $psum1=1;
45 | $psum2=1;
46 |
47 | for ($i=1;$i<@points1;$i++) {
48 | $psum1*=$points1[$i];
49 | $psum2*=$points2[$i];
50 | }
51 |
52 | print "Points in file1: ".$psum1.", Points in file2: ".$psum2."\n";
53 |
54 | if ($psum1 != $psum2) {die ("Number of points not same in two files!");}
55 |
56 | print OUT $header1;
57 |
58 | for ($i=0;$i<$psum1/5;$i++) {
59 | $line1=;
60 | $line2=;
61 | @line1=split(/\s+/,$line1);
62 | @line2=split(/\s+/,$line2);
63 | for ($j=1;$j<@line1;$j++) {
64 | $line1[$j]=$line1[$j]-$line2[$j];
65 | }
66 | printf OUT "%20.10e %20.10e %20.10e %20.10e %20.10e\n",$line1[1],$line1[2],$line1[3],$line1[4],$line1[5];
67 |
68 | }
69 |
70 | close(OUT);
71 | close(IN2);
72 | close(IN1);
73 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/chgnorm.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | @args=@ARGV;
5 | @args==1 || die "usage: chgnorm.pl \n";
6 |
7 |
8 | open (IN1,$args[0]) || die ("Can't open file $!");
9 |
10 | for ($i=0;$i<5;$i++) {
11 | $line1=;
12 | $header1.=$line1;
13 | }
14 |
15 | $atoms1=;
16 | $header1.=$atoms1;
17 |
18 | @atoms1=split(/\s+/,$atoms1);
19 |
20 | $sum1 += $_ for @atoms1;
21 |
22 | print "Atoms in file1: ".$sum1."\n";
23 |
24 | for ($i=0;$i<$sum1+2;$i++) {
25 | $header1.=;
26 | }
27 |
28 | $points1=;
29 | $header1.=$points1;
30 |
31 | @points1=split(/\s+/,$points1);
32 |
33 | $psum1=1;
34 |
35 | for ($i=1;$i<@points1;$i++) {
36 | $psum1*=$points1[$i];
37 | }
38 |
39 | $total = 0.0;
40 | $counter = 0;
41 |
42 | for ($i=0;$i<$psum1/5;$i++) {
43 | $line1=;
44 | @line1=split(/\s+/,$line1);
45 | for ($j=1;$j<@line1;$j++) {
46 | $total = $total + $line1[$j];
47 | $counter = $counter + 1;
48 | }
49 | }
50 |
51 | print "\n TOTAL voxel value = ".($total)."\n";
52 | print "\n AVERAGE voxel value = ".($total/$counter)."\n";
53 | print "\n Number of voxels = ".($counter)."\n";
54 |
55 | close(IN1);
56 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/chgsum.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | @ARGV>=2 || die "usage: chgsum.pl \n";
5 |
6 | open (IN1,$ARGV[0]) || die ("Can't open file $!");
7 | open (IN2,$ARGV[1]) || die ("Can't open file $!");
8 | open (OUT,">CHGCAR_sum");
9 |
10 | $fact1=$fact2=1.0;
11 | if (@ARGV>2){$fact1=$ARGV[2];}
12 | if (@ARGV>3){$fact2=$ARGV[3];}
13 |
14 | for ($i=0;$i<5;$i++) {
15 | $line1=;
16 | $line2=;
17 | $header1.=$line1;
18 | }
19 |
20 | $atoms1=;
21 | $header1.=$atoms1;
22 | $atoms2=;
23 |
24 | @atoms1=split(/\s+/,$atoms1);
25 | @atoms2=split(/\s+/,$atoms2);
26 |
27 | $sum1 += $_ for @atoms1;
28 | $sum2 += $_ for @atoms2;
29 |
30 | print "Atoms in file1: ".$sum1.", Atoms in file2: ".$sum2."\n";
31 |
32 | for ($i=0;$i<$sum1+2;$i++) {
33 | $header1.=;
34 | }
35 | for ($i=0;$i<$sum2+2;$i++) {
36 | $dummy=;
37 | }
38 |
39 | $points1=;
40 | $header1.=$points1;
41 | $points2=;
42 |
43 | @points1=split(/\s+/,$points1);
44 | @points2=split(/\s+/,$points2);
45 |
46 | $psum1=1;
47 | $psum2=1;
48 |
49 | for ($i=1;$i<@points1;$i++) {
50 | $psum1*=$points1[$i];
51 | $psum2*=$points2[$i];
52 | }
53 |
54 | print "Points in file1: ".$psum1.", Points in file2: ".$psum2."\n";
55 |
56 | if ($psum1 != $psum2) {die ("Number of points not same in two files!");}
57 |
58 | print OUT $header1;
59 |
60 | for ($i=0;$i<$psum1/5;$i++) {
61 | $line1=;
62 | $line2=;
63 | @line1=split(/\s+/,$line1);
64 | @line2=split(/\s+/,$line2);
65 | for ($j=1;$j<@line1;$j++) {
66 | $line1[$j]=$fact1*$line1[$j]+$fact2*$line2[$j];
67 | }
68 | printf OUT "%18.11E %18.11E %18.11E %18.11E %18.11E\n",$line1[1],$line1[2],$line1[3],$line1[4],$line1[5];
69 |
70 | }
71 |
72 | close(OUT);
73 | close(IN2);
74 | close(IN1);
75 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/con2xyz.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | @ARGV==1 || die "usage: con2xyz.pl \n";
5 | $inputfilename=$ARGV[0];
6 | $outputfilename=$inputfilename;
7 | $outputfilename=~s/con/xyz/;
8 |
9 | print "writing to $outputfilename\n";
10 |
11 | $inputfile="";
12 | open(IN,$inputfilename);
13 | while(){$_=~s/^\s+//g;$inputfile.=$_;}
14 | close(IN);
15 | @inputfile=split(/\n/,$inputfile);
16 | $descript=$inputfile[9];
17 | $ntypes=$inputfile[6];
18 | $ntypes=~s/\s+.*//g;
19 | $natoms=$inputfile[7];
20 | @natoms=split(/\s+/,$natoms);
21 | $totatoms=0;
22 | for($i=0;$i<$ntypes;$i++) {$totatoms+=$natoms[$i];}
23 |
24 | print "Total: $totatoms\n";
25 |
26 | $outfile=$totatoms."\n";
27 | $outfile.="Generated with con2xyz\n";
28 |
29 | $ln=9;
30 | for($type=0; $type<$ntypes; $type++){
31 | @line=split(/\s+/,$inputfile[$ln]);
32 | if(scalar(@line)>0){$atype=@line[0];}
33 | else{$atype="Type"."$type+1";}
34 | $ln+=2;
35 | for($i=0; $i<$natoms[$type]; $i++){
36 | @line=split(/\s+/,$inputfile[$ln]);
37 | $outfile.=$atype." ".join(" ",@line[0..2])."\n";
38 | $ln++;}
39 | }
40 | open (OUT,">$outputfilename");
41 | print OUT $outfile;
42 | close (OUT);
43 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/con2xyzmov.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | foreach $a (@ARGV) {
5 | $command="~/bin/con2xyz.pl $a;";
6 | system("$command");
7 | }
8 | $command="cat i*.xyz > mov.xyz;";
9 | #$command.="mv mov.xyz ..; cd ..; rm -r mov;";
10 | system("$command");
11 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/dimclean.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | echo " **** "
4 | echo " Cleaning up after a dimer run "
5 | echo " **** "
6 |
7 | Bin=`dirname "$0"`
8 | ZIP=${VTST_ZIP-gzip}
9 |
10 | cp INCAR KPOINTS POSCAR CONTCAR $1
11 | rm -f vasprun.xml
12 | if [ ${VTST_STDOUT} ]
13 | then
14 | if [ -s ${VTST_STDOUT} ]
15 | then
16 | mv ${VTST_STDOUT} $1
17 | fi
18 | fi
19 | if [ ${VTST_STDERR} ]
20 | then
21 | rm -f ${VTST_STDERR}
22 | fi
23 |
24 | echo -e " In directory: `pwd`"
25 | rm -f DOSCAR EIGENVAL IBZKPT OSZICAR PCDAT CHG
26 |
27 | if [ -s WAVECAR ]
28 | then
29 | mv WAVECAR $1 ; "$ZIP" $1/WAVECAR &
30 | else
31 | rm -f WAVECAR
32 | fi
33 | if [ -s CHGCAR ]
34 | then
35 | mv CHGCAR $1; "$ZIP" $1/CHGCAR &
36 | else
37 | rm -f CHGCAR
38 | fi
39 |
40 | mv DIMCAR $1
41 |
42 | if [ -s XDATCAR ]
43 | then
44 | "$Bin/xdat2xyz.pl" > /dev/null;
45 | mv XDATCAR $1 ; "$ZIP" $1/XDATCAR &
46 | fi
47 |
48 | if [ -s movie.xyz ]
49 | then
50 | mv movie.xyz $1
51 | fi
52 | if [ -s OUTCAR ]
53 | then
54 | mv OUTCAR $1 ; "$ZIP" $1/OUTCAR &
55 | fi
56 | if [ -s MODECAR ]
57 | then
58 | cp MODECAR $1
59 | fi
60 | if [ -s NEWMODECAR ]
61 | then
62 | cp NEWMODECAR MODECAR; mv NEWMODECAR $1;
63 | fi
64 |
65 | "$Bin/vasp2con.pl" POSCAR > /dev/null
66 | "$Bin/con2xyz.pl" POSCAR.con > /dev/null
67 | mv POSCAR.con POSCAR.xyz $1 ;
68 |
69 | "$Bin/vasp2con.pl" CONTCAR > /dev/null
70 | "$Bin/con2xyz.pl" CONTCAR.con > /dev/null
71 | mv CONTCAR.con CONTCAR.xyz $1 ;
72 |
73 | if [ -s CENTCAR ]
74 | then
75 | cp CENTCAR $1
76 | mv CENTCAR POSCAR
77 | rm -f CONTCAR
78 | else
79 | mv CONTCAR POSCAR
80 | fi
81 |
82 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/dimplot.gnu:
--------------------------------------------------------------------------------
1 | set grid
2 | #set nokey
3 | set pointsize 1.2
4 | #set xlabel "Step"
5 |
6 | set terminal postscript eps color
7 |
8 | set pointsize 0.8
9 | set ytics nomirror
10 | set y2tics
11 | set xlabel "Number of Ionic Step"
12 | set ylabel "Force [eV/A]"
13 | set y2label "Energy [eV]"
14 | set terminal postscript eps color
15 | set output "dimer.eps"
16 | plot "dimer.dat" u 1:3 axis x1y1 t "Max force" w lp lt 1 lw 2.4 pt 7 ps 0.9, \
17 | "dimer.dat" u 1:4 axis x1y2 t "Energy" w lp lt 3 lw 2.4 pt 7 ps 0.9
18 |
19 |
20 | #set output "force.eps"
21 | #set ylabel "Max ( Abs ( Force ) ) [eV/Ang]"
22 | #plot "outtmp.dat" u 2 w lp lt 1 lw 3 pt 7
23 |
24 | #set output "energy.eps"
25 | #set ylabel "Energy [eV]"
26 | #plot "outtmp.dat" u 4 w lp lt 1 lw 3 pt 7
27 |
28 | #set output "curvature.eps"
29 | #set ylabel "Curvature"
30 | #plot "outtmp.dat" u 5 w lp lt 1 lw 3 pt 7
31 |
32 | #set terminal postscript eps color enhanced
33 | #replot
34 | #set output
35 | #set terminal aqua
36 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/dimplot.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | use FindBin qw($Bin);
5 |
6 | # Get a single data point per step
7 |
8 | open DIM,"DIMCAR"
9 | or die "No DIMCAR to open\n";
10 |
11 | # Strip first line, and read the second, which is the first data point
12 | ;
13 | $oldline=;
14 | $line=$oldline;
15 | $line=~s/^\s+//g;
16 | @line=split(/\s+/,$line);
17 | $line[0]==1 || die "First data line in DIMCAR is not step 1\n";
18 | $step=1;
19 |
20 | open(OUT,">dimer.dat");
21 | while($newline=){
22 | $line=$newline;
23 | $line=~s/^\s+//g;
24 | @line=split(/\s+/,$line);
25 | if($line[0]!=$step){
26 | print OUT $oldline;
27 | $step++;
28 | $step==$line[0] || die "Error: non-sequential steps in the DIMCAR\n";
29 | }
30 | $oldline=$newline;
31 | }
32 | print OUT $oldline;
33 |
34 | system "gnuplot $Bin/dimplot.gnu" ;
35 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/dist.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | use FindBin qw($Bin);
5 | use lib "$Bin";
6 | use Vasp;
7 |
8 | # This program prints the difference in each coordinate for two POSCAR files.
9 |
10 | # variables needed by the script
11 |
12 | @args=@ARGV;
13 | @args==2 || die "usage: dist.pl ";
14 |
15 | $poscarfile1=$args[0];
16 | $poscarfile2=$args[1];
17 |
18 | ($coordinates1,$basis,$lattice,$num_atoms,$total_atoms,$selectiveflag,$selective)
19 | =read_poscar($poscarfile1);
20 |
21 | ($coordinates2,$basis,$lattice,$num_atoms,$total_atoms,$selectiveflag,$selective)
22 | =read_poscar($poscarfile2);
23 |
24 | $difference=pbc_difference($coordinates1,$coordinates2,$total_atoms);
25 | $cartesian=dirkar($difference,$basis,$lattice,$total_atoms);
26 | $distance=magnitude($cartesian,$total_atoms);
27 |
28 | print $distance,"\n";
29 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/dosanalyze.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | @ARGV==0 || die "usage: dosanalyze.pl\n";
5 |
6 | $j=0;
7 | open (DOS,"DOS0");
8 | while ($in=) {
9 | $in=~s/^\s+//g;
10 | @line=split(/\s+/,$in);
11 | $Ene[$j]=$line[0];
12 | $ene=$line[0];
13 | $Dos[$j]=$line[1];
14 | $dos=$line[1];
15 | $j++;
16 | }
17 | $numene=$j;
18 | close(DOS);
19 |
20 | # Calculate the average energy state
21 | $dossum=$dstsum=$dsqsum=0;
22 | for($i=0; $i<$numene; $i++){
23 | $dossum+=$Dos[$i];
24 | $dstsum+=$Ene[$i]*$Dos[$i];
25 | $dsqsum+=$Ene[$i]*$Ene[$i]*$Dos[$i]*$Dos[$i];
26 | }
27 | $dossum || die "Total DOS is zero.\n";
28 | $eneavg=$dstsum/$dossum;
29 | $enevar=($dstsum*$dstsum-$dsqsum)/($numene*$dossum*$dossum);
30 | $enestd=sqrt($enevar);
31 |
32 | print "Total States: $dossum\n";
33 | print "Average Energy: $eneavg\n";
34 | print "Standard Deviation: $enestd\n";
35 |
36 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/dosplot.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | @ARGV>0 || die "usage: dosplot.pl \n";
5 |
6 | $gnufile="dosplot.gnu";
7 | foreach $DOSFILE (@ARGV){
8 | open GNUPLOT, ">$gnufile";
9 | print GNUPLOT "set grid\n";
10 | print GNUPLOT "set pointsize 2\n";
11 | print GNUPLOT "set xlabel \"Energy [eV]\"\n";
12 | print GNUPLOT "set ylabel \"DOS\"\n";
13 | print GNUPLOT "set nokey\n";
14 | print GNUPLOT "set terminal postscript eps color\n";
15 | print GNUPLOT "set output \"dosplot.eps\"\n";
16 | print GNUPLOT "plot \"$DOSFILE\" u 1:2 w lp lt 1 lw 2.0 pt 7 ps 0.6";
17 | close GNUPLOT;
18 | system("gnuplot < $gnufile");
19 | # system("ggv -scale 2 dosplot.eps \&");
20 | system("rm $gnufile");
21 | }
22 |
23 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/dymclean.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | echo " **** "
4 | echo " Cleaning up after a dynmat run "
5 | echo " **** "
6 |
7 | Bin=`dirname "$0"`
8 | ZIP=${VTST_ZIP-gzip}
9 |
10 | rm -f DOSCAR EIGENVAL IBZKPT OSZICAR PCDAT vasprun.xml CHG
11 |
12 | if [ -s WAVECAR ]
13 | then
14 | mv WAVECAR $1 ; "$ZIP" $1/WAVECAR &
15 | else
16 | rm -f WAVECAR
17 | fi
18 | if [ -s CHGCAR ]
19 | then
20 | mv CHGCAR $1 ; "$ZIP" $1/CHGCAR &
21 | else
22 | rm -f CHGCAR
23 | fi
24 |
25 | if [ -s XDATCAR ]
26 | then
27 | mv XDATCAR $1 ; "$ZIP" $1/XDATCAR &
28 | fi
29 | if [ -s OUTCAR ]
30 | then
31 | mv OUTCAR $1 ; "$ZIP" $1/OUTCAR &
32 | fi
33 |
34 | "$Bin/vasp2con.pl" POSCAR > /dev/null
35 | "$Bin/con2xyz.pl" POSCAR.con > /dev/null
36 | mv POSCAR.con POSCAR.xyz $1 ;
37 | cp POSCAR INCAR KPOINTS $1
38 | if [ -s CONTCAR ]
39 | then
40 | mv CONTCAR $1 ;
41 | fi
42 | if [ -s DISPLACECAR ]
43 | then
44 | cp DISPLACECAR $1 ;
45 | fi
46 | if [ -s eigs.dat ]
47 | then
48 | mv eigs.dat $1 ;
49 | fi
50 | if [ -s modes.dat ]
51 | then
52 | mv modes.dat $1 ;
53 | fi
54 | if [ -s freq.mat ]
55 | then
56 | mv freq.mat $1 ;
57 | fi
58 | if [ -s freq.dat ]
59 | then
60 | mv freq.dat $1 ;
61 | fi
62 |
63 | if [ ${VTST_STDOUT} ]
64 | then
65 | if [ -s ${VTST_STDOUT} ]
66 | then
67 | mv ${VTST_STDOUT} $1
68 | fi
69 | fi
70 | if [ ${VTST_STDERR} ]
71 | then
72 | rm -f ${VTST_STDERR}
73 | fi
74 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/dymcmpdisp.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | # This program takes two DISPLACECAR files and creates a third which contains the
5 | # degrees of freedom that aren't common to both.
6 |
7 | use FindBin qw($Bin);
8 | use lib "$Bin";
9 | use Vasp;
10 |
11 | # variables needed by the script
12 |
13 | @args=@ARGV;
14 | @args==2 || die "usage: dymcmpdisp.pl ";
15 |
16 | $displacefile1=$args[0];
17 | $displacefile2=$args[1];
18 |
19 | ($coordinates1,$total_atoms)
20 | =read_othercar($displacefile1);
21 |
22 | ($coordinates2,$total_atoms)
23 | =read_othercar($displacefile2);
24 |
25 | for ($i=0;$i<$total_atoms;$i++) {
26 | for ($j=0;$j<3;$j++) {
27 | if ($coordinates1->[$i][$j] != $coordinates2->[$i][$j]) {
28 | $new_displace = $coordinates1->[$i][$j];
29 | if ($new_displace == 0) {
30 | $new_displace = $coordinates2->[$i][$j];
31 | }
32 | } else {
33 | $new_displace=0;
34 | }
35 | print $new_displace." ";
36 | }
37 | print ($i+1);
38 | print "\n";
39 | }
40 |
41 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/dymfit.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | # This program fits two or matrices together using a linear least squares fit.
5 | # The order of the fit is the first argument to the program.
6 |
7 | use FindBin qw($Bin);
8 | use lib "$Bin";
9 | use Vasp;
10 | use Math::Approx;
11 |
12 | sub poly {
13 | my($n,$x) = @_;
14 | return $x ** $n;
15 | }
16 |
17 |
18 | @args=@ARGV;
19 | (@args>=5) || die "usage: fit_matrices_over.pl ...\n";
20 |
21 | $order=$args[0];
22 | @args=@args[1..@args-1];
23 |
24 | for ($i=0;$i<@args;$i=$i+2) {
25 | $j=0;
26 |
27 | open (IN,$args[$i+1]) || die ("Can't open file $!");
28 | while () {
29 | $_=~s/^\s+//;
30 | @temp=split(/\s+/,$_);
31 | $kk=@temp;
32 | for ($k=0;$k<@temp;$k++) {
33 | $matrix->[$i/2][$j][$k]=$temp[$k]*$args[$i];
34 | }
35 | $j++;
36 | }
37 | close(IN);
38 | }
39 | $jj=$j;
40 |
41 | #print "Dimensions: $jj $kk\n";
42 |
43 | for ($j=0;$j<$jj;$j++) {
44 | for ($k=0;$k<$kk;$k++) {
45 | for ($i=0;$i<@args;$i=$i+2) {
46 | $x{$args[$i]}=$matrix->[$i/2][$j][$k];
47 | }
48 | $x{0}=0;
49 | $fit = new Math::Approx (\&poly, $order, %x);
50 | # $fit->print;
51 |
52 | printf "%18.10f", ${$fit->{'A'}}[1]." ";
53 | }
54 | print "\n";
55 | }
56 |
57 |
58 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/dymprefactor.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | # This program takes two different eigenvalue files, which have column labelling
5 | # which eigenvalues are imaginary (1 = imaginary, 0 = real). It calculates the prefactor
6 | # from them according to Vineyard's formula.
7 |
8 | @args=@ARGV;
9 | @args==2 || die "usage: dymprefactor.pl \n";
10 | $eigenfile1=$args[0];
11 | $eigenfile2=$args[1];
12 |
13 | open (IN,$eigenfile1);
14 | while () {$_=~s/^\s+//g;$file1.=$_;}
15 | close (IN);
16 | @eigenfile1=split(/\n/,$file1);
17 |
18 | open (IN,$eigenfile2);
19 | while () {$_=~s/^\s+//g;$file2.=$_;}
20 | close (IN);
21 | @eigenfile2=split(/\n/,$file2);
22 |
23 | @eigenfile1==@eigenfile2 || die "Files do not have the same number of eigenvalues!\n";
24 |
25 | $numimg1=0;
26 | $numimg2=0;
27 | $imgigen=0;
28 | $prodeigen1=1;
29 | $prodeigen2=1;
30 | $RatioEig=1;
31 |
32 | for ($i=0;$i<@eigenfile1;$i++) {
33 | @line1=split(/\s+/,$eigenfile1[$i]);
34 | @line2=split(/\s+/,$eigenfile2[$i]);
35 |
36 | if ($line1[3]==1) {$numimg1++;}
37 | if ($line2[3]==1) {$numimg2++;$imgigen=$line2[0];}
38 | $val1=$line1[0];
39 | $val2=$line2[0];
40 |
41 | $prodeigen1*=$line1[0];
42 | $prodeigen2*=$line2[0];
43 | $RatioEig*=($line1[0]/$line2[0]);
44 | }
45 |
46 | $numimg1==0 || die "Initial state freq.dat has imaginary frequencies.\n";
47 | $numimg2==1 || die "Transition state freq.dat does not have only 1 imaginary frequency.\n";
48 |
49 | $prefactor=$RatioEig*$imgigen;
50 |
51 | print "The prefactor for this system (in units of inverse cm) is $prefactor\n";
52 |
53 | $c=2.99792458e10;
54 | $prehertz=$prefactor*$c/1e12;
55 | print " (in units of TerraHertz) is $prehertz\n";
56 |
57 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/dymzpbar.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | # 20-09-2005
5 | # Calculates the zero-point energy contribution from the positive curvature modes
6 |
7 | $hbar = 6.46538e-2 ;
8 |
9 | die "INPUT THE OMEGA^{2} FILE \n" , if @ARGV != 1 ;
10 | open OMG , $ARGV[0] ;
11 | while() {$file .= $_ ;}
12 | close OMG ;
13 | @file = split /\n/ , $file ;
14 | $n = @file ;
15 |
16 | $c = 0 ;
17 | $sw = 0 ;
18 | for($i=0 ; $i<$n ; $i++) {
19 | $w[$i] = $file[$i] ;
20 | if($w[$i] < 0) {$c++ ;}
21 | else {$sw += sqrt($w[$i]) ;}
22 | }
23 | print $c," NEGATIVE EIGENVALUE FOUND ! \n" ;
24 | print " ZERO-POINT ENERGY CONTRIBUTION FROM THE POSITIVE CURVATURE MODES = \n" ;
25 | print 0.5 * $hbar * $sw," eV \n" ;
26 |
27 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/halfadd.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | $confile=@ARGV[0];
5 | open IN, "$confile";
6 | open OUT,">out.con";
7 | $i=0;
8 | $j = -1 ;
9 | while($line=){
10 | $i++;
11 | chomp($line) ; $line=~s/^\s+//g ; @line=split /\s+/,$line ;
12 | if($i==3){
13 | $ax=@line[0];
14 | $ay=@line[1];
15 | $az=@line[2];
16 | $ax_2=$ax/2;
17 | $ay_2=$ay/2;
18 | $az_2=$az/2;
19 | }
20 | if($i == 7){$ntypes = @line[0] ;}
21 | if($i == 8){@ntot[0..$ntypes-1] = @line[0..$ntypes-1] ;}
22 |
23 | if(index($line,"Coordinates")+1){
24 | $change = 1 ; $k = 0 ; $j++ ;
25 | print OUT $line,"\n" ;
26 | }
27 | if($change){
28 | $line[0]+=$ax_2;
29 | @line[1]+=$ay_2;
30 | @line[2]+=$az_2;
31 | if($k > 0){
32 | printf OUT "%13.10f %17.10f %17.10f %5d %5d \n",@line;
33 | }
34 | if($k++ == $ntot[$j]){$change = 0 ; }
35 | }else{print OUT $line,"\n" ;}
36 |
37 | }
38 |
39 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/halfcon.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | $confile=@ARGV[0];
5 | open IN, "$confile";
6 | open OUT,">out.con";
7 | $i=0;
8 | while($line=){
9 | $i++;
10 | chomp($line);
11 | $line=~s/^\s+//g;
12 | if($i<=11) {print OUT $line,"\n";}
13 | @line=split /\s+/,$line;
14 | if($i==3){
15 | $ax=@line[0];
16 | $ay=@line[1];
17 | $az=@line[2];
18 | $ax_2=$ax/2;
19 | $ay_2=$ay/2;
20 | $az_2=$az/2;
21 | }
22 | if($i>11){
23 | $line[0]-=$ax_2;
24 | @line[1]-=$ay_2;
25 | @line[2]-=$az_2;
26 | printf OUT "%13.10f %17.10f %17.10f %5d %5d \n",@line;
27 | }
28 | }
29 |
30 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/insclean.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # Cleaning up after an Instanton VASP run
4 |
5 | DIRS=$(ls -d [0-9][0-9])
6 |
7 | for i in $DIRS
8 | do
9 | cd $i
10 | pwd
11 | rm CHG* D* E* IB* OS* PC*
12 | if [ -e stdout ]
13 | then
14 | rm stdout
15 | fi
16 | gzip OUTCAR XDATCAR
17 | if [ -s WAVECAR ]
18 | then
19 | gzip WAVECAR
20 | else
21 | rm -f WAVECAR
22 | fi
23 | cd ..
24 | done
25 |
26 |
27 | cp -r ${DIRS} INCAR KPOINTS $1
28 | mv ll_out vasprun.xml $1
29 | rm PI*
30 |
31 | for i in $DIRS
32 | do
33 | cd $i
34 | mv CONTCAR POSCAR
35 | mv NEWMODECAR MODECAR
36 | rm OUT* XDAT* WAVE* ins*
37 | cd ..
38 | done
39 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/insplot.gnu:
--------------------------------------------------------------------------------
1 | set terminal postscript enhanced "Helvetica" 18
2 | set output "res_ins.eps"
3 | set xlabel "Force calls"
4 | set nokey
5 | set grid
6 | # set style line 1 lt 2 lw 1.5 pt 7 ps 0.8
7 |
8 | set ylabel "Potential energy [eV]"
9 | plot "o.u.t.t.e.m.p" u 2:3 w lp lt 3 lw 1.5 pt 6 ps 0.8
10 |
11 | set ylabel "Spring energy [eV]"
12 | plot "o.u.t.t.e.m.p" u 2:4 w lp lt 2 lw 1.5 pt 6 ps 0.8
13 |
14 | set ylabel "|F_{max}| [eV/A]"
15 | plot "o.u.t.t.e.m.p" u 2:5 w lp lt 2 lw 1.5 pt 6 ps 0.8
16 |
17 | set ylabel "Imaginary mode [eV/A^{2}]"
18 | plot "o.u.t.t.e.m.p" u 2:6 w lp lt 2 lw 1.5 pt 6 ps 0.8
19 |
20 | set ylabel "S_{o} [eV{/Symbol t}]"
21 | plot "o.u.t.t.e.m.p" u 2:7 w lp lt 2 lw 1.5 pt 6 ps 0.8
22 |
23 | exit
24 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/insplot.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | use FindBin qw($Bin);
5 |
6 | system "grep ut insout.dat | grep -v itr | cut -c 5-100 > o.u.t.t.e.m.p";
7 | system "gnuplot $Bin/insplot.gnu";
8 | system "rm o.u.t.t.e.m.p";
9 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/intcon.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | # This program interpolates between two con files by the given fraction.
5 |
6 | @args=@ARGV;
7 | @args==3 || die "usage: intcon.pl \n";
8 |
9 | $confile1=$args[0];
10 | $confile2=$args[1];
11 | $fraction=$args[2];
12 |
13 | $command="vasp2con.pl $confile1 ciPOSCAR;";
14 | $command.="mv ciPOSCAR p1;";
15 | $command.="vasp2con.pl $confile2 ciPOSCAR;";
16 | $command.="mv ciPOSCAR p2;";
17 | $command.="interpolate.pl p1 p2 $fraction;";
18 | $command.="rm p1;";
19 | $command.="rm p2;";
20 | $command.="vasp2con.pl POSCAR.out POSCAR.con;";
21 | $command.="rm POSCAR.out;";
22 | system("$command");
23 |
24 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/interpolate.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | # This program interpolates between two POSCAR files by the given fraction.
5 |
6 | use FindBin qw($Bin);
7 | use lib "$Bin";
8 | use Vasp;
9 |
10 | @args=@ARGV;
11 | @args==3 || die "usage: interpolate.pl \n";
12 |
13 | $poscarfile1=$args[0];
14 | $poscarfile2=$args[1];
15 | $fraction=$args[2];
16 |
17 | ($coordinates1,$basis,$lattice,$num_atoms,$total_atoms,$selectiveflag,$selective)
18 | =read_poscar($poscarfile1);
19 |
20 | print "Read $poscarfile1...\n";
21 |
22 | ($coordinates2,$basis,$lattice,$num_atoms,$total_atoms,$selectiveflag,$selective)
23 | =read_poscar($poscarfile2);
24 |
25 | $description=`head -n 1 $poscarfile1`;
26 | chop($description);
27 |
28 | print "Read $poscarfile2...\n";
29 | print "Total atoms: $total_atoms...\n";
30 | print "Lattice: $lattice...\n";
31 |
32 | for ($i=0;$i<$total_atoms;$i++) {
33 | for ($j=0;$j<3;$j++) {
34 | $interpolated->[$i][$j]=pbc($coordinates1->[$i][$j]+$fraction*
35 | pbc($coordinates2->[$i][$j]-$coordinates1->[$i][$j]));
36 | }
37 | }
38 |
39 | write_poscar($interpolated,$basis,$lattice,$num_atoms,$total_atoms,$selectiveflag,$selective,$description,"POSCAR.out");
40 |
41 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/nebbarrierdist.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | use FindBin qw($Bin) ;
5 | use lib "$Bin";
6 | use Vasp;
7 |
8 | @args=@ARGV;
9 | if (@args==0) {
10 | opendir(DIR,".") or die "couldn't open . ($!)\n";
11 | @list=readdir(DIR);
12 | closedir(DIR);
13 |
14 | @directories = grep {-d && /^[0-9][0-9]$/i} @list;
15 | @directories = sort {$a<=>$b} @directories;
16 | } else {
17 | @directories=@args;
18 | }
19 |
20 | $numdir=@directories;
21 | #print "#Directories found: ".join(" ",@directories)."\n";
22 |
23 | $dist_cum=0;
24 | for ($i=0;$i<@directories;$i++) {
25 | (-e "$directories[$i]/OUTCAR") || die "No OUTCAR in $directories[$i]!\n";
26 |
27 | $energy=`grep 'energy w' $directories[$i]/OUTCAR|tail -1`;
28 | $energy=~s/\s+$//g;
29 | @energy=split(/\s+/,$energy);
30 | $energy=$energy[@energy-1];
31 | if ($i==0) {$energy0=$energy;}
32 | $energy-=$energy0;
33 |
34 | if($i<($numdir-1)){
35 | $dist=`grep 'NEB: distance' $directories[$i]/OUTCAR|tail -1`;
36 | $dist=~s/\s+$//g;
37 | @dist=split(/\s+/,$dist);
38 | $dist=$dist[@dist-3];
39 | }else{
40 | $dist=$dist[@dist-2];}
41 |
42 | $dist_cum+=$dist;
43 |
44 | $force=`grep 'NEB: projections' $directories[$i]/OUTCAR|tail -1`;
45 | @force=split(/\s+/,$force);
46 | $force=$force[@force-1];
47 |
48 | printf "%3i %12.6f %12.6f %12.6f %3i\n",$i,$dist_cum,$energy,$force,$directories[$i];
49 | }
50 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/nebclean.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | echo " **** "
4 | echo " Cleaning up after a neb run "
5 | echo " **** "
6 |
7 | # DIRS=$(ls -d ??)
8 | DIRS=$(ls -d [0-9][0-9])
9 | ZIP=${VTST_ZIP-gzip}
10 |
11 | c=0
12 | for i in $DIRS
13 | do
14 | c=$((c+1))
15 | mkdir $1/$i
16 | done
17 |
18 | cp INCAR KPOINTS $1
19 | rm -f vasprun.xml
20 |
21 | if [ ${VTST_STDOUT} ]
22 | then
23 | if [ -s ${VTST_STDOUT} ]
24 | then
25 | mv ${VTST_STDOUT} $1
26 | fi
27 | fi
28 | if [ ${VTST_STDERR} ]
29 | then
30 | rm -f ${VTST_STDERR}
31 | fi
32 |
33 | j=0
34 | for i in $DIRS
35 | do
36 | j=$((j+1))
37 | cd $i
38 | echo -e " In directory: `pwd`"
39 |
40 | rm -f *.xyz > /dev/null
41 | rm -f *.dat *.eps > /dev/null
42 | cp POSCAR OUTCAR ../$1/$i
43 | "$ZIP" ../$1/$i/OUTCAR &
44 |
45 | case $j in
46 | 1)
47 | ;;
48 | $c)
49 | ;;
50 | # [2-$((c-1))])
51 | *)
52 | rm -f DOSCAR EIGENVAL IBZKPT OSZICAR PCDAT CHG OUTCAR
53 | if [ -f stdout ]
54 | then
55 | rm -f stdout
56 | fi
57 | mv XDATCAR ../$1/$i ; "$ZIP" ../$1/$i/XDATCAR &
58 | cp POSCAR CONTCAR ../$1/$i
59 | mv CONTCAR POSCAR
60 |
61 | if [ -s WAVECAR ]
62 | then
63 | mv WAVECAR ../$1/$i ; "$ZIP" ../$1/$i/WAVECAR &
64 | else
65 | rm -f WAVECAR
66 | fi
67 | if [ -s CHGCAR ]
68 | then
69 | mv CHGCAR ../$1/$i ; "$ZIP" ../$1/$i/CHGCAR &
70 | else
71 | rm -f CHGCAR
72 | fi
73 | ;;
74 | esac
75 | cd ../
76 | done
77 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/nebef.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | # Script prints the force, energy etc of OUTCAR's in immediate subdir
5 | # of present working directory. Older versions of this script had specific
6 | # paths hardcoded.
7 |
8 | use Cwd ;
9 | $dir = cwd ;
10 | @l1=`ls -la $dir/[0-9][0-9]/OUTCAR`; #specifies location of outcars
11 | $i = 0 ;
12 | foreach $_ (@l1) {
13 | chop() ;
14 | @t1=split() ;
15 | $t2=$t1[@t1-1] ;
16 | # $steps = `grep 'energy without' $t2 | wc |cut -c 0-8` ;
17 | $energy = `grep 'energy without' $t2 | tail -n 1 |cut -c 68-78` ;
18 | $force = `grep 'max\ at' $t2 | tail -n 1 |cut -c 27-38` ;
19 | # chop($steps) ;
20 | chop($energy) ;
21 | chop($force) ;
22 | if(!$i) {$e0 = $energy ;}
23 | $rel = $energy - $e0 ;
24 | @f4 = ($i,$force,$energy,$rel) ;
25 | printf "%4i %16.8f %16.8f %16.8f \n",@f4 ;
26 |
27 | $i++ ;
28 |
29 | };
30 |
31 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/nebfreeze.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | use FindBin qw($Bin);
5 | use lib "$Bin";
6 | use Vasp;
7 |
8 | @args=@ARGV;
9 | @args=>1 || die "usage: nebfreeze.pl ";
10 |
11 | $whichatom=$args[0];
12 |
13 | # AA -> 27-06-2007
14 | # Need the header from the POSCAR files to properly write out the new files
15 | $header = `head -1 $args[1]` ;
16 | chop($header) ;
17 | # AA -> end
18 |
19 | ($coordinates,$basis,$lattice,$num_atoms,$total_atoms,$selectiveflag,$selective)
20 | =read_poscar($args[1]);
21 |
22 | print "----------------------------------------------------------------------\n";
23 | print "Reference: ".$coordinates->[$whichatom-1][0]." ".$coordinates->[$whichatom-1][1]." ".$coordinates->[$whichatom-1][2]."\n";
24 |
25 | for ($i=1;$i<@args;$i++) {
26 |
27 | print $args[$i].":\n";
28 |
29 | ($coordinates2,$basis,$lattice,$num_atoms,$total_atoms,$selectiveflag,$selective)
30 | =read_poscar($args[$i]);
31 |
32 | print " Difference: ";
33 | for ($j=0;$j<3;$j++) {
34 | $difference->[$j]=pbc($coordinates2->[$whichatom-1][$j]-$coordinates->[$whichatom-1][$j]);
35 | print $difference->[$j]." ";
36 | }
37 | print "\n";
38 |
39 | for ($k=0;$k<$total_atoms;$k++) {
40 | for ($j=0;$j<3;$j++) {
41 | $coordinates2->[$k][$j]=pbc($coordinates2->[$k][$j]-$difference->[$j]);
42 | }
43 | }
44 |
45 | $selective->[$whichatom-1]=" F F F";
46 | # AA -> 27-06-2007
47 | write_poscar($coordinates2,$basis,$lattice,$num_atoms,$total_atoms,$selectiveflag,$selective,$header,$args[$i]);
48 | # AA -> end
49 | }
50 |
51 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/nebplot.gnu:
--------------------------------------------------------------------------------
1 | set grid
2 | set pointsize 2
3 | set xlabel "Reaction Coordinate [A]"
4 | set ylabel "Energy [eV]"
5 | set nokey
6 | set terminal postscript eps color
7 | set output "mep.eps"
8 | plot "spline.dat" u 2:3 w l lt 1 lw 2.4 , \
9 | "neb.dat" u 2:3 w p lt 3 lw 3.0 pt 7 ps 1.3
10 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/outi.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 | ################################################################################
4 | # get iteration information from OUTCAR file (or OUTCAR type file)
5 | ################################################################################
6 | if (@ARGV==0) {
7 | $file='OUTCAR';
8 | } else {
9 | $file=$ARGV[0];
10 | };
11 |
12 | while (!-e $file) {
13 | print "\n\nfilename =? "; chop($file = );
14 | };
15 |
16 | open(FILE, "grep Iteration $file |");
17 | @lines=;
18 | close(FILE);
19 |
20 | $count=0;
21 | foreach $line (@lines) {
22 | $line=~m/(Iteration\s*([0-9]+)\s*\(\s*([0-9]+)\))/;
23 | $iterations[$count]=$1;
24 | $nuclear[$count]=$2;
25 | $electronic[$count]=$3;
26 | if ($count==$#lines) {
27 | print "$iterations[$count]\n";
28 | } elsif ($nuclear[$count] > $nuclear[$count-1]) {
29 | print "$iterations[$count-1]\n";
30 | };
31 | $count++;
32 | };
33 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/pos2vasp.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | die "input a POSCAR or a CONTCAR \n" if @ARGV > 1 ;
5 | $pos = $ARGV[0] ;
6 | open IN , $pos ;
7 | open OUT , ">$pos.vasp" ;
8 |
9 | # Read in the input file
10 | while (){$file .= $_ ;}
11 | close IN ;
12 | @file = split /\n/ , $file ;
13 |
14 | # Get the number of names of atomi types
15 | $line = $file[0] ;
16 | chomp($line) ; $line=~s/^\s+//g ; @line=split /\s+/,$line ;
17 | $types = join " " , @line ;
18 | $nel = @line ;
19 | $line = $file[5] ;
20 | chomp($line) ; $line=~s/^\s+//g ; @line=split /\s+/,$line ;
21 | $numbers = join " " , @line ;
22 | # Calculate the total number of atoms
23 | while($line[$k] != undef){$natoms+=$line[$k++] ;}
24 |
25 | # Write out the .vasp file
26 | print OUT "SOME CRAP WITH DONT CARE ABOUT ","NCLASS=",$nel," ATOM=",$types,"\n" ;
27 | print OUT " ",$numbers,"\n" ;
28 | print OUT "Direct","\n" ;
29 | print OUT " ","\n" ;
30 | for ($i=1; $i<5; $i++){print OUT $file[$i],"\n" ;}
31 | print OUT " ","\n" ;
32 | $sh = 7 ;
33 | for ($i=1;$i<=$natoms; $i++){
34 | $line = $file[$sh+$i] ; chomp($line) ; $line=~s/^\s+//g ; @line=split /\s+/,$line ;
35 | printf OUT "%13.8f %11.8f %11.8f %5s\n",@line[0..2],"#$i" ;
36 | }
37 |
38 | close OUT ;
39 |
40 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/quad.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | @args=@ARGV;
5 | (@args==1||@args==2) || die "usage: quad.pl \n";
6 | $inputfile=@args[0];
7 | if(@args==2){$outputfile=@args[1];}
8 | else{$outputfile="ciPOSCAR";}
9 |
10 | open (IN,"<$inputfile");
11 | open (OUT,">$outputfile");
12 |
13 | for($line=0; $line<5; $line++){$out=; print OUT "$out";}
14 |
15 | $natoms=;
16 | $natoms=~s/^\s+//g;
17 | @natoms=split(/\s+/,$natoms);
18 | $totatoms=0;
19 | for($i=0; $i<@natoms; $i++){
20 | $totatoms+=$natoms[$i];
21 | @natoms[$i]*=4;}
22 | $natoms=join(" ",@natoms);
23 | print OUT "$natoms\n";
24 |
25 | for($line=6; $line<8; $line++){$out=; print OUT "$out";}
26 |
27 | for($i=0; $i<$totatoms; $i++){
28 | $_=;
29 | $_=~s/^\s+//g;
30 |
31 | @out=split(/\s+/,$_);
32 | $out=join(" ",@out);
33 | print OUT "$out\n";
34 |
35 | @out=split(/\s+/,$_);
36 | @out[0]-=1;
37 | $out=join(" ",@out);
38 | print OUT "$out\n";
39 |
40 | @out=split(/\s+/,$_);
41 | @out[1]-=1;
42 | $out=join(" ",@out);
43 | print OUT "$out\n";
44 |
45 | @out=split(/\s+/,$_);
46 | @out[0]-=1; @out[1]-=1;
47 | $out=join(" ",@out);
48 | print OUT "$out\n";
49 | }
50 |
51 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/quad_con.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | #-------------
5 | # This script double the x and y box dimensions of the con file created by quad.pl.
6 | # so that PBC can be applied to the created quadruple images.
7 | #-------------
8 | @args=@ARGV;
9 | (@args==1||@args==2) || die "usage: quad_con.pl \n";
10 | $inputfile=@args[0];
11 | if(@args==2){$outputfile=@args[1];}
12 | else{$outputfile="ciPOSCAR.con";}
13 |
14 | open (IN,"<$inputfile");
15 | open (OUT,">$outputfile");
16 |
17 | for($line=0; $line<2; $line++){$out=; print OUT "$out";}
18 |
19 | $box=;
20 | $box=~s/^\s+//g;
21 | @box=split(/\s+/,$box);
22 | for($i=0; $i<2; $i++){
23 | @box[$i]*=2.0;}
24 | $box=join(" ",@box);
25 | print OUT "$box\n";
26 |
27 | for($line=3; $line<6; $line++){$out=; print OUT "$out";}
28 | $ntype=;
29 | $ntype=~s/^\s+//g;
30 | @ntype=split(/\s+/,$ntype);
31 | $ntype=$ntype[0];
32 | print OUT "$ntype\n";
33 |
34 | $natoms=;
35 | $natoms=~s/^\s+//g;
36 | @natoms=split(/\s+/,$natoms);
37 | $totatoms=0;
38 | for($i=0; $i<@natoms; $i++){
39 | $totatoms+=$natoms[$i];
40 | }
41 | $natoms=join(" ",@natoms);
42 | print OUT "$natoms\n";
43 |
44 | $rest=8+$totatoms+2*$ntype+1;
45 | for($line=8; $line<$rest; $line++){$out=; print OUT "$out";}
46 | close(IN);
47 | close(OUT);
48 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/rdf.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | # This program calculates the radial distribution function of an atom in
5 | # a POSCAR file. The bin size is an argument.
6 |
7 | use FindBin qw($Bin);
8 | use lib "$Bin";
9 | use Vasp;
10 |
11 | # variables needed by the script
12 |
13 | @args=@ARGV;
14 | @args==3 || die "usage: rdf.pl ";
15 |
16 | $poscarfile=$args[0];
17 | $central_atom=$args[1];
18 | $bin_size=$args[2];
19 |
20 | ($coordinates,$basis,$lattice,$num_atoms,$total_atoms,$selectiveflag,$selective)
21 | =read_poscar($poscarfile);
22 |
23 | for ($i=0;$i<$total_atoms;$i++) {
24 | if ($i+1!=$central_atom) {
25 | for ($j=0;$j<3;$j++) {
26 | $difference->[0][$j]=pbc($coordinates->[$central_atom-1][$j]-$coordinates->[$i][$j]);
27 | }
28 | $difference=dirkar($difference,$basis,$lattice,"1");
29 | $mag_difference=magnitude($difference,"1");
30 | $index=int($mag_difference/$bin_size);
31 | $bin->{$index}[@{$bin->{$index}}]=$i;
32 | }
33 | }
34 |
35 | print "----------------------------------------------------------------------\n";
36 | print "RDF of atom ".$central_atom." with bin size of ".$bin_size.".\n";
37 | print "Distance: Neighbors\n";
38 | print "----------------------------------------------------------------------\n";
39 |
40 | foreach $index (sort {$a<=>$b} keys %$bin) {
41 | $number=@{$bin->{$index}};
42 | printf "%5.3f (%3i) : ", $index*$bin_size,$number;
43 | for ($i=0;$i<@{$bin->{$index}};$i++) {
44 | printf "%4i ",($bin->{$index}[$i]+1);
45 | }
46 | print "\n";
47 | }
48 |
49 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/splitmovie.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | # 07-05-2004
5 |
6 | # Because Jmol is so stupid it is necessary to brake the movie.xyz file
7 | # down to smallar pieces sometimes.
8 |
9 | # Check if there is a movie file there, and if so if it is old
10 | if(-e "movie.xyz"){
11 | if((-M "XDATCAR") < (-M "movie.xyz")){
12 | # It is time to generate a new movie file
13 | system "xdat2xyz.pl" ;
14 | }
15 | }else{
16 | # There is NO movie file
17 | system "xdat2xyz.pl" ;
18 | }
19 |
20 | # Get the number of atoms and the length of the xyz file
21 | $natoms = `head -1 movie.xyz` ;
22 | chomp($natoms) ;
23 | $nl = `wc -l movie.xyz` ;
24 | $nl=~s/^\s+//g ; @nl=split /\s+/,$nl ;
25 | $nl = @nl[0] ;
26 | $nsteps = $nl/($natoms+2) ;
27 |
28 | print "\n" ;
29 | print " The number of atoms is : ",$natoms,"\n" ;
30 | print " The number of steps is : ",$nsteps,"\n" ;
31 | print "\n" ;
32 | print " Into how many pieces should the movie file been split upto? ... " ;
33 | $np = ;
34 | $base = int($nsteps/$np) ;
35 | print " The last file will have ",$base+($nsteps-$base*$np)," steps","\n" ;
36 | print " All other files will have ",$base," steps","\n" ;
37 | for($i=0; $i<$np-1; $i++){
38 | $spl .= $base*($i+1)*($natoms+2)+1 ;
39 | $spl .= " " ;
40 | }
41 | system "csplit movie.xyz $spl >& /dev/null" ;
42 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/sum_dos_np:
--------------------------------------------------------------------------------
1 | #!/bin/ksh
2 |
3 |
4 |
5 | # Script to sum up DOS files from VASP for non-polarized calculations.
6 | if [ $# -lt 3 ]; then
7 | echo "Usage: sum_dos [0] [start] [end]"
8 | echo "Or: sum_dos [1] [i] [j] [k] [l] ..."
9 | exit 1
10 | fi
11 |
12 |
13 | type=$1
14 | shift 1
15 |
16 | # Contiguous
17 | if [ $type -eq 0 ]; then
18 |
19 | start=$1
20 | end=$2
21 | shift 2
22 |
23 | string=$start.to.$end
24 | echo $start
25 | echo $end
26 |
27 |
28 | # First file
29 | i=$start
30 | nl=$(wc -l DOS$i | sed 's/://g' | awk '{print $1}')
31 | echo $nl
32 |
33 | sed -n '2,'$nl' p' DOS$i | awk '{printf "%12.8f %12.8f %12.8f %12.8f %12.8f \n", $1, $2, $3, $4, $2+$3+$4}' >| DOS.tmp
34 |
35 | i=$((i+1))
36 |
37 | while [ $i -le $end ]; do
38 |
39 | sed -n '2,'$nl' p' DOS$i | awk '{printf "%12.8f %12.8f %12.8f %12.8f %12.8f \n", $1, $2, $3, $4, $2+$3+$4 }' >| DOS.tmp2
40 |
41 | paste DOS.tmp DOS.tmp2 | awk '{printf "%15.8f %15.8f %15.8f %15.8f %15.8f \n", $1, $2+$7, $3+$8, $4+$9, $5+$10 }' >| DOS.tmp3
42 |
43 | mv -f DOS.tmp3 DOS.tmp
44 |
45 | i=$((i+1))
46 |
47 | done
48 |
49 |
50 | else
51 |
52 | start=$1
53 | shift 1
54 |
55 | # First file
56 | i=$start
57 | nl=$(wc -l DOS$i | sed 's/://g' | awk '{print $1}')
58 | echo $nl
59 | string=$start
60 | sed -n '2,'$nl' p' DOS$i | awk '{printf "%12.8f %12.8f %12.8f %12.8f %12.8f \n", $1, $2, $3, $4, $2+$3+$4 }' >| DOS.tmp
61 | for i in "$@"; do
62 | string=$(echo $string.$i)
63 | echo $i
64 | sed -n '2,'$nl' p' DOS$i | awk '{printf "%12.8f %12.8f %12.8f %12.8f %12.8f \n", $1, $2, $3, $4, $2+$3+$4 }' >| DOS.tmp2
65 |
66 | paste DOS.tmp DOS.tmp2 | awk '{printf "%15.8f %15.8f %15.8f %15.8f %15.8f \n", $1, $2+$7, $3+$8, $4+$9, $5+$10 }' >| DOS.tmp3
67 |
68 | mv -f DOS.tmp3 DOS.tmp
69 | done
70 |
71 |
72 | fi
73 |
74 |
75 | mv DOS.tmp DOS.SUM.$string
76 | rm -f DOS.tmp2
77 |
78 |
79 | exit 0
80 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/typeset.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | # 23-01-2003
5 |
6 | # Change the first line in POSCAR so the element symbols
7 | # are there in the same order as in POTCAR.
8 |
9 | open POS, "POSCAR"
10 | or die "No POSCAR to open\n" ;
11 | $inline = join " ", @ARGV ;
12 | while () {$file.=$_;}
13 | close POS ;
14 | @file = split /\n/ , $file ;
15 | @file[0] = $inline,"\n" ;
16 | $file = join "\n" , @file ;
17 | open POS , ">POSCAR" ;
18 | print POS $file,"\n" ;
19 |
20 | # Check to see if there is a CONTCAR there. If one is found
21 | # change it ads well.
22 |
23 | if (-e "CONTCAR"){
24 | open POS, "CONTCAR" ;
25 | while () {$file.=$_;}
26 | close POS ;
27 | @file = split /\n/ , $file ;
28 | @file[0] = $inline,"\n" ;
29 | $file = join "\n" , @file ;
30 | open POS , ">CONTCAR" ;
31 | print POS $file,"\n" ;
32 | }
33 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/vasp2jvasp.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | die "input a POSCAR or a CONTCAR \n" if @ARGV > 1 ;
5 | $pos = $ARGV[0] ;
6 | open IN , $pos ;
7 | open OUT , ">$pos.vasp" ;
8 |
9 | # Read in the input file
10 | while (){$file .= $_ ;}
11 | close IN ;
12 | @file = split /\n/ , $file ;
13 |
14 | # Get the number of names of atomi types
15 | $line = $file[0] ;
16 | chomp($line) ; $line=~s/^\s+//g ; @line=split /\s+/,$line ;
17 | $types = join " " , @line ;
18 | $nel = @line ;
19 | $line = $file[5] ;
20 | chomp($line) ; $line=~s/^\s+//g ; @line=split /\s+/,$line ;
21 | $numbers = join " " , @line ;
22 | # Calculate the total number of atoms
23 | while($line[$k] != undef){$natoms+=$line[$k++] ;}
24 |
25 | # Write out the .vasp file
26 | print OUT "SOME INFORMATION WE DONT CARE ABOUT ","NCLASS=",$nel," ATOM=",$types,"\n" ;
27 | print OUT " ",$numbers,"\n" ;
28 | print OUT "Direct","\n" ;
29 | print OUT " ","\n" ;
30 | for ($i=1; $i<5; $i++){print OUT $file[$i],"\n" ;}
31 | print OUT " ","\n" ;
32 | $sh = 7 ;
33 | for ($i=1;$i<=$natoms; $i++){
34 | $line = $file[$sh+$i] ; chomp($line) ; $line=~s/^\s+//g ; @line=split /\s+/,$line ;
35 | printf OUT "%13.8f %11.8f %11.8f %5s\n",@line[0..2],"#$i" ;
36 | }
37 |
38 | close OUT ;
39 |
40 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/vasp2xyz.help:
--------------------------------------------------------------------------------
1 |
2 | #-----------------------------------------------------------------------------------------#
3 | # vasp2xyz: version 1.1 (c) April 2001 by MD #
4 | # #
5 | # Program to convert POSCAR and CONTCAR files into xyz format to view it with RasMol #
6 | # #
7 | # Syntax: vasp2xyz [-h] [-c] [-n] [-nos] [dl=smearedbox] [i=inputfile] [o=xyzfile] #
8 | # #
9 | # Options: #
10 | # -h shows help file #
11 | # -v shows vasp2xyz version #
12 | # -c automatically complete cell (e.g. Si 8 atoms -> 18 atoms) #
13 | # -nos no scaling with box dimension; default is false #
14 | # -n special naming convention; POSCAR.name -> name.xyz #
15 | # #
16 | # Parameters: #
17 | # inputfile POSCAR/CONTCAR file to convert to xyz format #
18 | # xyzfile output filename in xyz format; default is inputfile.xyz #
19 | # softbox assumes a smeared box edge to define inside and outside (complete cell) #
20 | # default is 0.03 of box size #
21 | # #
22 | # IMPORTANT: #
23 | # The first line in the POSCAR/CONTCAR file need to have the format #
24 | # #
25 | # "name specy1 specy2 ..." #
26 | # #
27 | # The specy list need to be consistent with line 6 (no. of species of each kind) #
28 | # #
29 | # Example: 7 silicon, 1 arsenic atom, and 2 boron atoms #
30 | # line1: Si7AsB2 As B Si #
31 | # line6: 1 2 7 #
32 | #-----------------------------------------------------------------------------------------#
33 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/vclean.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | echo " **** "
4 | echo " Cleaning up after a normal vasp run "
5 | echo " **** "
6 |
7 | Bin=`dirname "$0"`
8 | ZIP=${VTST_ZIP-gzip}
9 |
10 | rm -f EIGENVAL IBZKPT OSZICAR PCDAT vasprun.xml CHG
11 |
12 | if [ -s WAVECAR ]
13 | then
14 | mv WAVECAR $1 ; "$ZIP" $1/WAVECAR &
15 | else
16 | rm -f WAVECAR
17 | fi
18 | if [ -s CHGCAR ]
19 | then
20 | mv CHGCAR $1 ; "$ZIP" $1/CHGCAR &
21 | else
22 | rm -f CHGCAR
23 | fi
24 | if [ -s PROCAR ]
25 | then
26 | mv PROCAR $1 ; "$ZIP" $1/PROCAR &
27 | else
28 | rm -f PROCAR
29 | fi
30 | if [ -s DOSCAR ]
31 | then
32 | mv DOSCAR $1 ; "$ZIP" $1/DOSCAR &
33 | else
34 | rm -f DOSCAR
35 | fi
36 |
37 | "$Bin/xdat2xyz.pl" > /dev/null ;
38 | if [ -s movie.xyz ]
39 | then
40 | mv movie.xyz $1
41 | fi
42 | "$Bin/vef.pl" > /dev/null ;
43 | if [ -s vaspout.eps ]
44 | then
45 | mv fe.dat vaspout.eps $1
46 | fi
47 | if [ -s XDATCAR ]
48 | then
49 | mv XDATCAR $1 ; "$ZIP" $1/XDATCAR &
50 | fi
51 | if [ -s OUTCAR ]
52 | then
53 | mv OUTCAR $1 ; "$ZIP" $1/OUTCAR &
54 | fi
55 |
56 | "$Bin/vasp2con.pl" POSCAR > /dev/null
57 | "$Bin/con2xyz.pl" POSCAR.con > /dev/null
58 | mv POSCAR.con POSCAR.xyz $1 ;
59 | "$Bin/vasp2con.pl" CONTCAR > /dev/null
60 | "$Bin/con2xyz.pl" CONTCAR.con > /dev/null
61 | mv CONTCAR.con CONTCAR.xyz $1 ;
62 | cp POSCAR CONTCAR INCAR KPOINTS $1
63 |
64 | if [ ${VTST_STDOUT} ]
65 | then
66 | if [ -s ${VTST_STDOUT} ]
67 | then
68 | mv ${VTST_STDOUT} $1
69 | fi
70 | fi
71 | if [ ${VTST_STDERR} ]
72 | then
73 | rm -f ${VTST_STDERR}
74 | fi
75 |
76 | mv CONTCAR POSCAR
77 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/vcunzip.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | foreach $a (@ARGV){
5 | if(-e "$a/OUTCAR.gz"){ system " gunzip $a/OUTCAR.gz;" ; }
6 | elsif("$a/OUTCAR.bz2"){ system " bunzip2 $a/OUTCAR.bz2 ;" ; }
7 | }
8 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/vczip.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | $path=`pwd`;
5 | chop($path);
6 |
7 | $zip = $ENV{'VTST_ZIP'} ;
8 | if($zip eq ''){ $zip = 'gzip' ; }
9 |
10 | foreach $a (@ARGV){
11 | if(-e "$a/OUTCAR") { system "$zip -9 $a/OUTCAR &" ; }
12 | if(-e "$a/stdout") { system "$zip -9 $a/stdout &" ; }
13 | }
14 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/vef.gnu:
--------------------------------------------------------------------------------
1 | set grid
2 | set pointsize 0.8
3 | set ytics nomirror
4 | set y2tics
5 | set xlabel "Number of Ionic Step"
6 | set ylabel "Force [eV/A]"
7 | set y2label "Energy [eV]"
8 | set terminal postscript eps color
9 | set output "vaspout.eps"
10 | plot "fe.dat" u 1:2 axis x1y1 t "Max force" w lp lt 1 lw 2.4 pt 7 ps 0.9, \
11 | "fe.dat" u 1:3 axis x1y2 t "Energy" w lp lt 3 lw 2.4 pt 7 ps 0.9
12 |
13 | #set output
14 | #set terminal x11
15 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/vef.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | use FindBin qw($Bin);
5 |
6 | $plotflag=1;
7 | if(@ARGV>0){ $plotflag=$ARGV[0] ; }
8 |
9 | $zip = $ENV{'VTST_ZIP'} ;
10 | if($zip eq ''){ $zip = 'gzip' ; }
11 |
12 | $outzipped=0;
13 | if(-e "OUTCAR.gz"){ $outzipped=1; system "gunzip OUTCAR.gz" ; }
14 | if(-e "OUTCAR.bz2"){ $outzipped=1; system "bunzip2 OUTCAR.bz2" ; }
15 |
16 | $forces = `grep 'FORCES: max atom, RMS' OUTCAR` ;
17 | $energy = `grep 'energy without entropy' OUTCAR` ;
18 |
19 | @forces = split /\n/ , $forces ;
20 | @energy = split /\n/ , $energy ;
21 |
22 | $num = @forces;
23 |
24 | open OUT , ">fe.dat" ;
25 |
26 | for($i=0; $i<$num; $i++){
27 | $line = $forces[$i] ;
28 | chomp($line) ;
29 | $line=~s/^\s+//g;
30 | @line=split /\s+/,$line;
31 | $f = $line[4],"\n" ;
32 |
33 | $line = $energy[$i] ;
34 | chomp($line) ;
35 | $line=~s/^\s+//g;
36 | @line=split /\s+/,$line;
37 | $e = $line[6],"\n" ;
38 | if(!$i) {$e0 = $e ;}
39 | printf OUT "%5i %20.8f %20.6f %20.6g \n",$i,$f,$e,$e-$e0 ;
40 | printf "%5i %20.8f %20.6f %20.6g \n",$i,$f,$e,$e-$e0 ;
41 | }
42 |
43 | close OUT ;
44 |
45 | if($num>1 and $plotflag){
46 | system "gnuplot $Bin/vef.gnu" ;
47 | }
48 |
49 | # if($outzipped){system "$zip -9 OUTCAR \&" ; }
50 | if($outzipped){system "$zip -9 OUTCAR" ; }
51 |
52 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/vfin.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | use FindBin qw($Bin);
5 | use lib "$Bin";
6 |
7 | # Check to see if there is an OUTCAR and read the ICHAIN variable from it
8 | if (-e "OUTCAR"){
9 | $_ = `head -1000 OUTCAR | grep -i ICHAIN ` ;
10 | }elsif (-e "01/OUTCAR"){
11 | $_ = `head -1000 01/OUTCAR | grep -i ICHAIN ` ;
12 | }else{
13 | die "No OUTCAR found !!! \n"
14 | }
15 | @s = split /\s+/ , $_ ;
16 | $ichain = $s[4] ;
17 |
18 | die "No result directory name given! \n" if @ARGV < 1 ;
19 | $dir = $ARGV[0] ;
20 | mkdir $dir, 0755 ;
21 |
22 | # Clean up the run
23 | if ($ichain == 0){
24 | # If there is a 00 directory then this is a NEB run
25 | if (-e "00") {
26 | system "$Bin/nebclean.sh $dir" ;
27 | }else{
28 | system "$Bin/vclean.sh $dir" ;
29 | }
30 | }elsif ($ichain == 1){
31 | system "$Bin/dymclean.sh $dir"
32 | }elsif ($ichain == 2){
33 | if((-e "MODECAR") && !(-e "01") && !(-e "02")){
34 | system "$Bin/dimclean.sh $dir" ;
35 | }elsif((-e "01") && (-e "02")){
36 | system "$Bin/dimclean2.sh $dir" ;
37 | }
38 | }elsif ($ichain == 3){
39 | system "$Bin/lanclean.sh $dir" ;
40 | }elsif ($ichain == 4){
41 | system "$Bin/insclean.sh $dir" ;
42 | }
43 |
44 |
--------------------------------------------------------------------------------
/vasp/vtstscripts/vtstscripts.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itamblyn/scripts/bbf02f08bed4d6e8afedfbced53f721010b0fd4f/vasp/vtstscripts/vtstscripts.tar.gz
--------------------------------------------------------------------------------
/vasp_cleanup:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | rm CHG* DOSCAR EIGENVAL IBZKPT OSZICAR OUTCAR PCDAT TMPCAR vasprun.xml WAVECAR XDATCAR* STOPCAR log *.dat *.xyz
4 |
--------------------------------------------------------------------------------
/vasp_exit:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | echo "LSTOP = .TRUE." > STOPCAR
4 |
--------------------------------------------------------------------------------
/vasp_mover.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | a=`cat counter`
4 |
5 | mv -f OUTCAR output/OUTCAR.$a
6 | mv -f POSCAR output/POSCAR.$a
7 | mv -f CONTCAR output/CONTCAR.$a
8 | mv -f DOSCAR output/DOSCAR.$a
9 | mv -f vasprun.xml output/vasprun.$a.xml
10 | mv -f XDATCAR output/XDATCAR.$a
11 |
12 | cp output/CONTCAR.$a POSCAR
13 |
14 | mkdir job_files/$a
15 | mv *.o* *.po* *.e* *.pe* job_files/$a
16 | mv machines job_files/$a
17 | mv log job_files/$a
18 |
19 | a=`expr $a + 1`
20 | rm -f counter
21 | echo $a > counter
22 |
23 |
--------------------------------------------------------------------------------
/vtstscripts/Fortran/CVS/Entries:
--------------------------------------------------------------------------------
1 | /Format.pm/1.1/Fri Feb 16 06:40:42 2007//
2 | D
3 |
--------------------------------------------------------------------------------
/vtstscripts/Fortran/CVS/Repository:
--------------------------------------------------------------------------------
1 | vtstscripts/Fortran
2 |
--------------------------------------------------------------------------------
/vtstscripts/Fortran/CVS/Root:
--------------------------------------------------------------------------------
1 | :ext:graeme@theory.cm.utexas.edu:/Groups/cvs
2 |
--------------------------------------------------------------------------------
/vtstscripts/Math/Matrix.pm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itamblyn/scripts/bbf02f08bed4d6e8afedfbced53f721010b0fd4f/vtstscripts/Math/Matrix.pm
--------------------------------------------------------------------------------
/vtstscripts/README:
--------------------------------------------------------------------------------
1 | http://theory.cm.utexas.edu/vtsttools/scripts/
2 |
--------------------------------------------------------------------------------
/vtstscripts/boxset.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | use FindBin qw($Bin);
5 | use lib "$Bin";
6 | use Vasp;
7 |
8 | @args=@ARGV;
9 | (@args==2) || die "usage: boxset.pl \n";
10 |
11 | $poscarfile1=$args[0];
12 | ($coordinates,$basis,$lattice,$num_atoms,$total_atoms,$selectiveflag,$selective,$description)
13 | =read_poscar($poscarfile1);
14 |
15 | $karcoords=dirkar($coordinates,$basis,$lattice,$total_atoms);
16 | $lattice_old=$lattice;
17 | $lattice=$args[1];
18 | for ($i=0;$i<3;$i++) {
19 | for ($j=0;$j<3;$j++) {
20 | $basis->[$i][$j]*=$lattice/$lattice_old;
21 | }
22 | }
23 | $coordsnew=kardir($karcoords,$basis,$lattice,$total_atoms);
24 |
25 | print "Total atoms: $total_atoms...\n";
26 | print "Lattice: $lattice...\n";
27 | print "Shift: ".$shift[0]." ".$shift[1]." ".$shift[2]."\n";
28 |
29 | write_poscar($coordsnew,$basis,$lattice,$num_atoms,$total_atoms,$selectiveflag,$selective,$description,"POSCAR.out");
30 |
31 |
--------------------------------------------------------------------------------
/vtstscripts/chgdiff.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | @args=@ARGV;
5 | @args==2 || die "usage: chgdiff.pl - \n";
6 |
7 |
8 | open (IN1,$args[0]) || die ("Can't open file $!");
9 | open (IN2,$args[1]) || die ("Can't open file $!");
10 | open (OUT,">CHGCAR_diff");
11 |
12 | for ($i=0;$i<5;$i++) {
13 | $line1=;
14 | $line2=;
15 | $header1.=$line1;
16 | }
17 |
18 | $atoms1=;
19 | $header1.=$atoms1;
20 | $atoms2=;
21 |
22 | @atoms1=split(/\s+/,$atoms1);
23 | @atoms2=split(/\s+/,$atoms2);
24 |
25 | $sum1 += $_ for @atoms1;
26 | $sum2 += $_ for @atoms2;
27 |
28 | print "Atoms in file1: ".$sum1.", Atoms in file2: ".$sum2."\n";
29 |
30 | for ($i=0;$i<$sum1+2;$i++) {
31 | $header1.=;
32 | }
33 | for ($i=0;$i<$sum2+2;$i++) {
34 | $dummy=;
35 | }
36 |
37 | $points1=;
38 | $header1.=$points1;
39 | $points2=;
40 |
41 | @points1=split(/\s+/,$points1);
42 | @points2=split(/\s+/,$points2);
43 |
44 | $psum1=1;
45 | $psum2=1;
46 |
47 | for ($i=1;$i<@points1;$i++) {
48 | $psum1*=$points1[$i];
49 | $psum2*=$points2[$i];
50 | }
51 |
52 | print "Points in file1: ".$psum1.", Points in file2: ".$psum2."\n";
53 |
54 | if ($psum1 != $psum2) {die ("Number of points not same in two files!");}
55 |
56 | print OUT $header1;
57 |
58 | for ($i=0;$i<$psum1/5;$i++) {
59 | $line1=;
60 | $line2=;
61 | @line1=split(/\s+/,$line1);
62 | @line2=split(/\s+/,$line2);
63 | for ($j=1;$j<@line1;$j++) {
64 | $line1[$j]=$line1[$j]-$line2[$j];
65 | }
66 | printf OUT "%20.10e %20.10e %20.10e %20.10e %20.10e\n",$line1[1],$line1[2],$line1[3],$line1[4],$line1[5];
67 |
68 | }
69 |
70 | close(OUT);
71 | close(IN2);
72 | close(IN1);
73 |
--------------------------------------------------------------------------------
/vtstscripts/chgnorm.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | @args=@ARGV;
5 | @args==1 || die "usage: chgnorm.pl \n";
6 |
7 |
8 | open (IN1,$args[0]) || die ("Can't open file $!");
9 |
10 | for ($i=0;$i<5;$i++) {
11 | $line1=;
12 | $header1.=$line1;
13 | }
14 |
15 | $atoms1=;
16 | $header1.=$atoms1;
17 |
18 | @atoms1=split(/\s+/,$atoms1);
19 |
20 | $sum1 += $_ for @atoms1;
21 |
22 | print "Atoms in file1: ".$sum1."\n";
23 |
24 | for ($i=0;$i<$sum1+2;$i++) {
25 | $header1.=;
26 | }
27 |
28 | $points1=;
29 | $header1.=$points1;
30 |
31 | @points1=split(/\s+/,$points1);
32 |
33 | $psum1=1;
34 |
35 | for ($i=1;$i<@points1;$i++) {
36 | $psum1*=$points1[$i];
37 | }
38 |
39 | $total = 0.0;
40 | $counter = 0;
41 |
42 | for ($i=0;$i<$psum1/5;$i++) {
43 | $line1=;
44 | @line1=split(/\s+/,$line1);
45 | for ($j=1;$j<@line1;$j++) {
46 | $total = $total + $line1[$j];
47 | $counter = $counter + 1;
48 | }
49 | }
50 |
51 | print "\n TOTAL voxel value = ".($total)."\n";
52 | print "\n AVERAGE voxel value = ".($total/$counter)."\n";
53 | print "\n Number of voxels = ".($counter)."\n";
54 |
55 | close(IN1);
56 |
--------------------------------------------------------------------------------
/vtstscripts/chgsum.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | @ARGV>=2 || die "usage: chgsum.pl \n";
5 |
6 | open (IN1,$ARGV[0]) || die ("Can't open file $!");
7 | open (IN2,$ARGV[1]) || die ("Can't open file $!");
8 | open (OUT,">CHGCAR_sum");
9 |
10 | $fact1=$fact2=1.0;
11 | if (@ARGV>2){$fact1=$ARGV[2];}
12 | if (@ARGV>3){$fact2=$ARGV[3];}
13 |
14 | for ($i=0;$i<5;$i++) {
15 | $line1=;
16 | $line2=;
17 | $header1.=$line1;
18 | }
19 |
20 | $atoms1=;
21 | $header1.=$atoms1;
22 | $atoms2=;
23 |
24 | @atoms1=split(/\s+/,$atoms1);
25 | @atoms2=split(/\s+/,$atoms2);
26 |
27 | $sum1 += $_ for @atoms1;
28 | $sum2 += $_ for @atoms2;
29 |
30 | print "Atoms in file1: ".$sum1.", Atoms in file2: ".$sum2."\n";
31 |
32 | for ($i=0;$i<$sum1+2;$i++) {
33 | $header1.=;
34 | }
35 | for ($i=0;$i<$sum2+2;$i++) {
36 | $dummy=;
37 | }
38 |
39 | $points1=;
40 | $header1.=$points1;
41 | $points2=;
42 |
43 | @points1=split(/\s+/,$points1);
44 | @points2=split(/\s+/,$points2);
45 |
46 | $psum1=1;
47 | $psum2=1;
48 |
49 | for ($i=1;$i<@points1;$i++) {
50 | $psum1*=$points1[$i];
51 | $psum2*=$points2[$i];
52 | }
53 |
54 | print "Points in file1: ".$psum1.", Points in file2: ".$psum2."\n";
55 |
56 | if ($psum1 != $psum2) {die ("Number of points not same in two files!");}
57 |
58 | print OUT $header1;
59 |
60 | for ($i=0;$i<$psum1/5;$i++) {
61 | $line1=;
62 | $line2=;
63 | @line1=split(/\s+/,$line1);
64 | @line2=split(/\s+/,$line2);
65 | for ($j=1;$j<@line1;$j++) {
66 | $line1[$j]=$fact1*$line1[$j]+$fact2*$line2[$j];
67 | }
68 | printf OUT "%18.11E %18.11E %18.11E %18.11E %18.11E\n",$line1[1],$line1[2],$line1[3],$line1[4],$line1[5];
69 |
70 | }
71 |
72 | close(OUT);
73 | close(IN2);
74 | close(IN1);
75 |
--------------------------------------------------------------------------------
/vtstscripts/con2xyz.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | @ARGV==1 || die "usage: con2xyz.pl \n";
5 | $inputfilename=$ARGV[0];
6 | $outputfilename=$inputfilename;
7 | $outputfilename=~s/con/xyz/;
8 |
9 | print "writing to $outputfilename\n";
10 |
11 | $inputfile="";
12 | open(IN,$inputfilename);
13 | while(){$_=~s/^\s+//g;$inputfile.=$_;}
14 | close(IN);
15 | @inputfile=split(/\n/,$inputfile);
16 | $descript=$inputfile[9];
17 | $ntypes=$inputfile[6];
18 | $ntypes=~s/\s+.*//g;
19 | $natoms=$inputfile[7];
20 | @natoms=split(/\s+/,$natoms);
21 | $totatoms=0;
22 | for($i=0;$i<$ntypes;$i++) {$totatoms+=$natoms[$i];}
23 |
24 | print "Total: $totatoms\n";
25 |
26 | $outfile=$totatoms."\n";
27 | $outfile.="Generated with con2xyz\n";
28 |
29 | $ln=9;
30 | for($type=0; $type<$ntypes; $type++){
31 | @line=split(/\s+/,$inputfile[$ln]);
32 | if(scalar(@line)>0){$atype=@line[0];}
33 | else{$atype="Type"."$type+1";}
34 | $ln+=2;
35 | for($i=0; $i<$natoms[$type]; $i++){
36 | @line=split(/\s+/,$inputfile[$ln]);
37 | $outfile.=$atype." ".join(" ",@line[0..2])."\n";
38 | $ln++;}
39 | }
40 | open (OUT,">$outputfilename");
41 | print OUT $outfile;
42 | close (OUT);
43 |
--------------------------------------------------------------------------------
/vtstscripts/con2xyzmov.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | foreach $a (@ARGV) {
5 | $command="~/bin/con2xyz.pl $a;";
6 | system("$command");
7 | }
8 | $command="cat i*.xyz > mov.xyz;";
9 | #$command.="mv mov.xyz ..; cd ..; rm -r mov;";
10 | system("$command");
11 |
--------------------------------------------------------------------------------
/vtstscripts/dimclean.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | echo " **** "
4 | echo " Cleaning up after a dimer run "
5 | echo " **** "
6 |
7 | Bin=`dirname "$0"`
8 | ZIP=${VTST_ZIP-gzip}
9 |
10 | cp INCAR KPOINTS POSCAR CONTCAR $1
11 | rm -f vasprun.xml
12 | if [ ${VTST_STDOUT} ]
13 | then
14 | if [ -s ${VTST_STDOUT} ]
15 | then
16 | mv ${VTST_STDOUT} $1
17 | fi
18 | fi
19 | if [ ${VTST_STDERR} ]
20 | then
21 | rm -f ${VTST_STDERR}
22 | fi
23 |
24 | echo -e " In directory: `pwd`"
25 | rm -f DOSCAR EIGENVAL IBZKPT OSZICAR PCDAT CHG
26 |
27 | if [ -s WAVECAR ]
28 | then
29 | mv WAVECAR $1 ; "$ZIP" $1/WAVECAR &
30 | else
31 | rm -f WAVECAR
32 | fi
33 | if [ -s CHGCAR ]
34 | then
35 | mv CHGCAR $1; "$ZIP" $1/CHGCAR &
36 | else
37 | rm -f CHGCAR
38 | fi
39 |
40 | mv DIMCAR $1
41 |
42 | if [ -s XDATCAR ]
43 | then
44 | "$Bin/xdat2xyz.pl" > /dev/null;
45 | mv XDATCAR $1 ; "$ZIP" $1/XDATCAR &
46 | fi
47 |
48 | if [ -s movie.xyz ]
49 | then
50 | mv movie.xyz $1
51 | fi
52 | if [ -s OUTCAR ]
53 | then
54 | mv OUTCAR $1 ; "$ZIP" $1/OUTCAR &
55 | fi
56 | if [ -s MODECAR ]
57 | then
58 | cp MODECAR $1
59 | fi
60 | if [ -s NEWMODECAR ]
61 | then
62 | cp NEWMODECAR MODECAR; mv NEWMODECAR $1;
63 | fi
64 |
65 | "$Bin/vasp2con.pl" POSCAR > /dev/null
66 | "$Bin/con2xyz.pl" POSCAR.con > /dev/null
67 | mv POSCAR.con POSCAR.xyz $1 ;
68 |
69 | "$Bin/vasp2con.pl" CONTCAR > /dev/null
70 | "$Bin/con2xyz.pl" CONTCAR.con > /dev/null
71 | mv CONTCAR.con CONTCAR.xyz $1 ;
72 |
73 | if [ -s CENTCAR ]
74 | then
75 | cp CENTCAR $1
76 | mv CENTCAR POSCAR
77 | rm -f CONTCAR
78 | else
79 | mv CONTCAR POSCAR
80 | fi
81 |
82 |
--------------------------------------------------------------------------------
/vtstscripts/dimplot.gnu:
--------------------------------------------------------------------------------
1 | set grid
2 | #set nokey
3 | set pointsize 1.2
4 | #set xlabel "Step"
5 |
6 | set terminal postscript eps color
7 |
8 | set pointsize 0.8
9 | set ytics nomirror
10 | set y2tics
11 | set xlabel "Number of Ionic Step"
12 | set ylabel "Force [eV/A]"
13 | set y2label "Energy [eV]"
14 | set terminal postscript eps color
15 | set output "dimer.eps"
16 | plot "dimer.dat" u 1:3 axis x1y1 t "Max force" w lp lt 1 lw 2.4 pt 7 ps 0.9, \
17 | "dimer.dat" u 1:4 axis x1y2 t "Energy" w lp lt 3 lw 2.4 pt 7 ps 0.9
18 |
19 |
20 | #set output "force.eps"
21 | #set ylabel "Max ( Abs ( Force ) ) [eV/Ang]"
22 | #plot "outtmp.dat" u 2 w lp lt 1 lw 3 pt 7
23 |
24 | #set output "energy.eps"
25 | #set ylabel "Energy [eV]"
26 | #plot "outtmp.dat" u 4 w lp lt 1 lw 3 pt 7
27 |
28 | #set output "curvature.eps"
29 | #set ylabel "Curvature"
30 | #plot "outtmp.dat" u 5 w lp lt 1 lw 3 pt 7
31 |
32 | #set terminal postscript eps color enhanced
33 | #replot
34 | #set output
35 | #set terminal aqua
36 |
--------------------------------------------------------------------------------
/vtstscripts/dimplot.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | use FindBin qw($Bin);
5 |
6 | # Get a single data point per step
7 |
8 | open DIM,"DIMCAR"
9 | or die "No DIMCAR to open\n";
10 |
11 | # Strip first line, and read the second, which is the first data point
12 | ;
13 | $oldline=;
14 | $line=$oldline;
15 | $line=~s/^\s+//g;
16 | @line=split(/\s+/,$line);
17 | $line[0]==1 || die "First data line in DIMCAR is not step 1\n";
18 | $step=1;
19 |
20 | open(OUT,">dimer.dat");
21 | while($newline=){
22 | $line=$newline;
23 | $line=~s/^\s+//g;
24 | @line=split(/\s+/,$line);
25 | if($line[0]!=$step){
26 | print OUT $oldline;
27 | $step++;
28 | $step==$line[0] || die "Error: non-sequential steps in the DIMCAR\n";
29 | }
30 | $oldline=$newline;
31 | }
32 | print OUT $oldline;
33 |
34 | system "gnuplot $Bin/dimplot.gnu" ;
35 |
--------------------------------------------------------------------------------
/vtstscripts/dist.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | use FindBin qw($Bin);
5 | use lib "$Bin";
6 | use Vasp;
7 |
8 | # This program prints the difference in each coordinate for two POSCAR files.
9 |
10 | # variables needed by the script
11 |
12 | @args=@ARGV;
13 | @args==2 || die "usage: dist.pl ";
14 |
15 | $poscarfile1=$args[0];
16 | $poscarfile2=$args[1];
17 |
18 | ($coordinates1,$basis,$lattice,$num_atoms,$total_atoms,$selectiveflag,$selective)
19 | =read_poscar($poscarfile1);
20 |
21 | ($coordinates2,$basis,$lattice,$num_atoms,$total_atoms,$selectiveflag,$selective)
22 | =read_poscar($poscarfile2);
23 |
24 | $difference=pbc_difference($coordinates1,$coordinates2,$total_atoms);
25 | $cartesian=dirkar($difference,$basis,$lattice,$total_atoms);
26 | $distance=magnitude($cartesian,$total_atoms);
27 |
28 | print $distance,"\n";
29 |
--------------------------------------------------------------------------------
/vtstscripts/dosanalyze.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | @ARGV==0 || die "usage: dosanalyze.pl\n";
5 |
6 | $j=0;
7 | open (DOS,"DOS0");
8 | while ($in=) {
9 | $in=~s/^\s+//g;
10 | @line=split(/\s+/,$in);
11 | $Ene[$j]=$line[0];
12 | $ene=$line[0];
13 | $Dos[$j]=$line[1];
14 | $dos=$line[1];
15 | $j++;
16 | }
17 | $numene=$j;
18 | close(DOS);
19 |
20 | # Calculate the average energy state
21 | $dossum=$dstsum=$dsqsum=0;
22 | for($i=0; $i<$numene; $i++){
23 | $dossum+=$Dos[$i];
24 | $dstsum+=$Ene[$i]*$Dos[$i];
25 | $dsqsum+=$Ene[$i]*$Ene[$i]*$Dos[$i]*$Dos[$i];
26 | }
27 | $dossum || die "Total DOS is zero.\n";
28 | $eneavg=$dstsum/$dossum;
29 | $enevar=($dstsum*$dstsum-$dsqsum)/($numene*$dossum*$dossum);
30 | $enestd=sqrt($enevar);
31 |
32 | print "Total States: $dossum\n";
33 | print "Average Energy: $eneavg\n";
34 | print "Standard Deviation: $enestd\n";
35 |
36 |
--------------------------------------------------------------------------------
/vtstscripts/dosplot.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | @ARGV>0 || die "usage: dosplot.pl \n";
5 |
6 | $gnufile="dosplot.gnu";
7 | foreach $DOSFILE (@ARGV){
8 | open GNUPLOT, ">$gnufile";
9 | print GNUPLOT "set grid\n";
10 | print GNUPLOT "set pointsize 2\n";
11 | print GNUPLOT "set xlabel \"Energy [eV]\"\n";
12 | print GNUPLOT "set ylabel \"DOS\"\n";
13 | print GNUPLOT "set nokey\n";
14 | print GNUPLOT "set terminal postscript eps color\n";
15 | print GNUPLOT "set output \"dosplot.eps\"\n";
16 | print GNUPLOT "plot \"$DOSFILE\" u 1:2 w lp lt 1 lw 2.0 pt 7 ps 0.6";
17 | close GNUPLOT;
18 | system("gnuplot < $gnufile");
19 | # system("ggv -scale 2 dosplot.eps \&");
20 | system("rm $gnufile");
21 | }
22 |
23 |
--------------------------------------------------------------------------------
/vtstscripts/dymclean.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | echo " **** "
4 | echo " Cleaning up after a dynmat run "
5 | echo " **** "
6 |
7 | Bin=`dirname "$0"`
8 | ZIP=${VTST_ZIP-gzip}
9 |
10 | rm -f DOSCAR EIGENVAL IBZKPT OSZICAR PCDAT vasprun.xml CHG
11 |
12 | if [ -s WAVECAR ]
13 | then
14 | mv WAVECAR $1 ; "$ZIP" $1/WAVECAR &
15 | else
16 | rm -f WAVECAR
17 | fi
18 | if [ -s CHGCAR ]
19 | then
20 | mv CHGCAR $1 ; "$ZIP" $1/CHGCAR &
21 | else
22 | rm -f CHGCAR
23 | fi
24 |
25 | if [ -s XDATCAR ]
26 | then
27 | mv XDATCAR $1 ; "$ZIP" $1/XDATCAR &
28 | fi
29 | if [ -s OUTCAR ]
30 | then
31 | mv OUTCAR $1 ; "$ZIP" $1/OUTCAR &
32 | fi
33 |
34 | "$Bin/vasp2con.pl" POSCAR > /dev/null
35 | "$Bin/con2xyz.pl" POSCAR.con > /dev/null
36 | mv POSCAR.con POSCAR.xyz $1 ;
37 | cp POSCAR INCAR KPOINTS $1
38 | if [ -s CONTCAR ]
39 | then
40 | mv CONTCAR $1 ;
41 | fi
42 | if [ -s DISPLACECAR ]
43 | then
44 | cp DISPLACECAR $1 ;
45 | fi
46 | if [ -s eigs.dat ]
47 | then
48 | mv eigs.dat $1 ;
49 | fi
50 | if [ -s modes.dat ]
51 | then
52 | mv modes.dat $1 ;
53 | fi
54 | if [ -s freq.mat ]
55 | then
56 | mv freq.mat $1 ;
57 | fi
58 | if [ -s freq.dat ]
59 | then
60 | mv freq.dat $1 ;
61 | fi
62 |
63 | if [ ${VTST_STDOUT} ]
64 | then
65 | if [ -s ${VTST_STDOUT} ]
66 | then
67 | mv ${VTST_STDOUT} $1
68 | fi
69 | fi
70 | if [ ${VTST_STDERR} ]
71 | then
72 | rm -f ${VTST_STDERR}
73 | fi
74 |
--------------------------------------------------------------------------------
/vtstscripts/dymcmpdisp.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | # This program takes two DISPLACECAR files and creates a third which contains the
5 | # degrees of freedom that aren't common to both.
6 |
7 | use FindBin qw($Bin);
8 | use lib "$Bin";
9 | use Vasp;
10 |
11 | # variables needed by the script
12 |
13 | @args=@ARGV;
14 | @args==2 || die "usage: dymcmpdisp.pl ";
15 |
16 | $displacefile1=$args[0];
17 | $displacefile2=$args[1];
18 |
19 | ($coordinates1,$total_atoms)
20 | =read_othercar($displacefile1);
21 |
22 | ($coordinates2,$total_atoms)
23 | =read_othercar($displacefile2);
24 |
25 | for ($i=0;$i<$total_atoms;$i++) {
26 | for ($j=0;$j<3;$j++) {
27 | if ($coordinates1->[$i][$j] != $coordinates2->[$i][$j]) {
28 | $new_displace = $coordinates1->[$i][$j];
29 | if ($new_displace == 0) {
30 | $new_displace = $coordinates2->[$i][$j];
31 | }
32 | } else {
33 | $new_displace=0;
34 | }
35 | print $new_displace." ";
36 | }
37 | print ($i+1);
38 | print "\n";
39 | }
40 |
41 |
--------------------------------------------------------------------------------
/vtstscripts/dymfit.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | # This program fits two or matrices together using a linear least squares fit.
5 | # The order of the fit is the first argument to the program.
6 |
7 | use FindBin qw($Bin);
8 | use lib "$Bin";
9 | use Vasp;
10 | use Math::Approx;
11 |
12 | sub poly {
13 | my($n,$x) = @_;
14 | return $x ** $n;
15 | }
16 |
17 |
18 | @args=@ARGV;
19 | (@args>=5) || die "usage: fit_matrices_over.pl ...\n";
20 |
21 | $order=$args[0];
22 | @args=@args[1..@args-1];
23 |
24 | for ($i=0;$i<@args;$i=$i+2) {
25 | $j=0;
26 |
27 | open (IN,$args[$i+1]) || die ("Can't open file $!");
28 | while () {
29 | $_=~s/^\s+//;
30 | @temp=split(/\s+/,$_);
31 | $kk=@temp;
32 | for ($k=0;$k<@temp;$k++) {
33 | $matrix->[$i/2][$j][$k]=$temp[$k]*$args[$i];
34 | }
35 | $j++;
36 | }
37 | close(IN);
38 | }
39 | $jj=$j;
40 |
41 | #print "Dimensions: $jj $kk\n";
42 |
43 | for ($j=0;$j<$jj;$j++) {
44 | for ($k=0;$k<$kk;$k++) {
45 | for ($i=0;$i<@args;$i=$i+2) {
46 | $x{$args[$i]}=$matrix->[$i/2][$j][$k];
47 | }
48 | $x{0}=0;
49 | $fit = new Math::Approx (\&poly, $order, %x);
50 | # $fit->print;
51 |
52 | printf "%18.10f", ${$fit->{'A'}}[1]." ";
53 | }
54 | print "\n";
55 | }
56 |
57 |
58 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/vtstscripts/dymprefactor.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | # This program takes two different eigenvalue files, which have column labelling
5 | # which eigenvalues are imaginary (1 = imaginary, 0 = real). It calculates the prefactor
6 | # from them according to Vineyard's formula.
7 |
8 | @args=@ARGV;
9 | @args==2 || die "usage: dymprefactor.pl \n";
10 | $eigenfile1=$args[0];
11 | $eigenfile2=$args[1];
12 |
13 | open (IN,$eigenfile1);
14 | while () {$_=~s/^\s+//g;$file1.=$_;}
15 | close (IN);
16 | @eigenfile1=split(/\n/,$file1);
17 |
18 | open (IN,$eigenfile2);
19 | while () {$_=~s/^\s+//g;$file2.=$_;}
20 | close (IN);
21 | @eigenfile2=split(/\n/,$file2);
22 |
23 | @eigenfile1==@eigenfile2 || die "Files do not have the same number of eigenvalues!\n";
24 |
25 | $numimg1=0;
26 | $numimg2=0;
27 | $imgigen=0;
28 | $prodeigen1=1;
29 | $prodeigen2=1;
30 | $RatioEig=1;
31 |
32 | for ($i=0;$i<@eigenfile1;$i++) {
33 | @line1=split(/\s+/,$eigenfile1[$i]);
34 | @line2=split(/\s+/,$eigenfile2[$i]);
35 |
36 | if ($line1[3]==1) {$numimg1++;}
37 | if ($line2[3]==1) {$numimg2++;$imgigen=$line2[0];}
38 | $val1=$line1[0];
39 | $val2=$line2[0];
40 |
41 | $prodeigen1*=$line1[0];
42 | $prodeigen2*=$line2[0];
43 | $RatioEig*=($line1[0]/$line2[0]);
44 | }
45 |
46 | $numimg1==0 || die "Initial state freq.dat has imaginary frequencies.\n";
47 | $numimg2==1 || die "Transition state freq.dat does not have only 1 imaginary frequency.\n";
48 |
49 | $prefactor=$RatioEig*$imgigen;
50 |
51 | print "The prefactor for this system (in units of inverse cm) is $prefactor\n";
52 |
53 | $c=2.99792458e10;
54 | $prehertz=$prefactor*$c/1e12;
55 | print " (in units of TerraHertz) is $prehertz\n";
56 |
57 |
--------------------------------------------------------------------------------
/vtstscripts/dymzpbar.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | # 20-09-2005
5 | # Calculates the zero-point energy contribution from the positive curvature modes
6 |
7 | $hbar = 6.46538e-2 ;
8 |
9 | die "INPUT THE OMEGA^{2} FILE \n" , if @ARGV != 1 ;
10 | open OMG , $ARGV[0] ;
11 | while() {$file .= $_ ;}
12 | close OMG ;
13 | @file = split /\n/ , $file ;
14 | $n = @file ;
15 |
16 | $c = 0 ;
17 | $sw = 0 ;
18 | for($i=0 ; $i<$n ; $i++) {
19 | $w[$i] = $file[$i] ;
20 | if($w[$i] < 0) {$c++ ;}
21 | else {$sw += sqrt($w[$i]) ;}
22 | }
23 | print $c," NEGATIVE EIGENVALUE FOUND ! \n" ;
24 | print " ZERO-POINT ENERGY CONTRIBUTION FROM THE POSITIVE CURVATURE MODES = \n" ;
25 | print 0.5 * $hbar * $sw," eV \n" ;
26 |
27 |
--------------------------------------------------------------------------------
/vtstscripts/halfadd.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | $confile=@ARGV[0];
5 | open IN, "$confile";
6 | open OUT,">out.con";
7 | $i=0;
8 | $j = -1 ;
9 | while($line=){
10 | $i++;
11 | chomp($line) ; $line=~s/^\s+//g ; @line=split /\s+/,$line ;
12 | if($i==3){
13 | $ax=@line[0];
14 | $ay=@line[1];
15 | $az=@line[2];
16 | $ax_2=$ax/2;
17 | $ay_2=$ay/2;
18 | $az_2=$az/2;
19 | }
20 | if($i == 7){$ntypes = @line[0] ;}
21 | if($i == 8){@ntot[0..$ntypes-1] = @line[0..$ntypes-1] ;}
22 |
23 | if(index($line,"Coordinates")+1){
24 | $change = 1 ; $k = 0 ; $j++ ;
25 | print OUT $line,"\n" ;
26 | }
27 | if($change){
28 | $line[0]+=$ax_2;
29 | @line[1]+=$ay_2;
30 | @line[2]+=$az_2;
31 | if($k > 0){
32 | printf OUT "%13.10f %17.10f %17.10f %5d %5d \n",@line;
33 | }
34 | if($k++ == $ntot[$j]){$change = 0 ; }
35 | }else{print OUT $line,"\n" ;}
36 |
37 | }
38 |
39 |
--------------------------------------------------------------------------------
/vtstscripts/halfcon.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | $confile=@ARGV[0];
5 | open IN, "$confile";
6 | open OUT,">out.con";
7 | $i=0;
8 | while($line=){
9 | $i++;
10 | chomp($line);
11 | $line=~s/^\s+//g;
12 | if($i<=11) {print OUT $line,"\n";}
13 | @line=split /\s+/,$line;
14 | if($i==3){
15 | $ax=@line[0];
16 | $ay=@line[1];
17 | $az=@line[2];
18 | $ax_2=$ax/2;
19 | $ay_2=$ay/2;
20 | $az_2=$az/2;
21 | }
22 | if($i>11){
23 | $line[0]-=$ax_2;
24 | @line[1]-=$ay_2;
25 | @line[2]-=$az_2;
26 | printf OUT "%13.10f %17.10f %17.10f %5d %5d \n",@line;
27 | }
28 | }
29 |
30 |
--------------------------------------------------------------------------------
/vtstscripts/insclean.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # Cleaning up after an Instanton VASP run
4 |
5 | DIRS=$(ls -d [0-9][0-9])
6 |
7 | for i in $DIRS
8 | do
9 | cd $i
10 | pwd
11 | rm CHG* D* E* IB* OS* PC*
12 | if [ -e stdout ]
13 | then
14 | rm stdout
15 | fi
16 | gzip OUTCAR XDATCAR
17 | if [ -s WAVECAR ]
18 | then
19 | gzip WAVECAR
20 | else
21 | rm -f WAVECAR
22 | fi
23 | cd ..
24 | done
25 |
26 |
27 | cp -r ${DIRS} INCAR KPOINTS $1
28 | mv ll_out vasprun.xml $1
29 | rm PI*
30 |
31 | for i in $DIRS
32 | do
33 | cd $i
34 | mv CONTCAR POSCAR
35 | mv NEWMODECAR MODECAR
36 | rm OUT* XDAT* WAVE* ins*
37 | cd ..
38 | done
39 |
--------------------------------------------------------------------------------
/vtstscripts/insplot.gnu:
--------------------------------------------------------------------------------
1 | set terminal postscript enhanced "Helvetica" 18
2 | set output "res_ins.eps"
3 | set xlabel "Force calls"
4 | set nokey
5 | set grid
6 | # set style line 1 lt 2 lw 1.5 pt 7 ps 0.8
7 |
8 | set ylabel "Potential energy [eV]"
9 | plot "o.u.t.t.e.m.p" u 2:3 w lp lt 3 lw 1.5 pt 6 ps 0.8
10 |
11 | set ylabel "Spring energy [eV]"
12 | plot "o.u.t.t.e.m.p" u 2:4 w lp lt 2 lw 1.5 pt 6 ps 0.8
13 |
14 | set ylabel "|F_{max}| [eV/A]"
15 | plot "o.u.t.t.e.m.p" u 2:5 w lp lt 2 lw 1.5 pt 6 ps 0.8
16 |
17 | set ylabel "Imaginary mode [eV/A^{2}]"
18 | plot "o.u.t.t.e.m.p" u 2:6 w lp lt 2 lw 1.5 pt 6 ps 0.8
19 |
20 | set ylabel "S_{o} [eV{/Symbol t}]"
21 | plot "o.u.t.t.e.m.p" u 2:7 w lp lt 2 lw 1.5 pt 6 ps 0.8
22 |
23 | exit
24 |
--------------------------------------------------------------------------------
/vtstscripts/insplot.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | use FindBin qw($Bin);
5 |
6 | system "grep ut insout.dat | grep -v itr | cut -c 5-100 > o.u.t.t.e.m.p";
7 | system "gnuplot $Bin/insplot.gnu";
8 | system "rm o.u.t.t.e.m.p";
9 |
--------------------------------------------------------------------------------
/vtstscripts/intcon.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | # This program interpolates between two con files by the given fraction.
5 |
6 | @args=@ARGV;
7 | @args==3 || die "usage: intcon.pl \n";
8 |
9 | $confile1=$args[0];
10 | $confile2=$args[1];
11 | $fraction=$args[2];
12 |
13 | $command="vasp2con.pl $confile1 ciPOSCAR;";
14 | $command.="mv ciPOSCAR p1;";
15 | $command.="vasp2con.pl $confile2 ciPOSCAR;";
16 | $command.="mv ciPOSCAR p2;";
17 | $command.="interpolate.pl p1 p2 $fraction;";
18 | $command.="rm p1;";
19 | $command.="rm p2;";
20 | $command.="vasp2con.pl POSCAR.out POSCAR.con;";
21 | $command.="rm POSCAR.out;";
22 | system("$command");
23 |
24 |
--------------------------------------------------------------------------------
/vtstscripts/interpolate.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | # This program interpolates between two POSCAR files by the given fraction.
5 |
6 | use FindBin qw($Bin);
7 | use lib "$Bin";
8 | use Vasp;
9 |
10 | @args=@ARGV;
11 | @args==3 || die "usage: interpolate.pl \n";
12 |
13 | $poscarfile1=$args[0];
14 | $poscarfile2=$args[1];
15 | $fraction=$args[2];
16 |
17 | ($coordinates1,$basis,$lattice,$num_atoms,$total_atoms,$selectiveflag,$selective)
18 | =read_poscar($poscarfile1);
19 |
20 | print "Read $poscarfile1...\n";
21 |
22 | ($coordinates2,$basis,$lattice,$num_atoms,$total_atoms,$selectiveflag,$selective)
23 | =read_poscar($poscarfile2);
24 |
25 | $description=`head -n 1 $poscarfile1`;
26 | chop($description);
27 |
28 | print "Read $poscarfile2...\n";
29 | print "Total atoms: $total_atoms...\n";
30 | print "Lattice: $lattice...\n";
31 |
32 | for ($i=0;$i<$total_atoms;$i++) {
33 | for ($j=0;$j<3;$j++) {
34 | $interpolated->[$i][$j]=pbc($coordinates1->[$i][$j]+$fraction*
35 | pbc($coordinates2->[$i][$j]-$coordinates1->[$i][$j]));
36 | }
37 | }
38 |
39 | write_poscar($interpolated,$basis,$lattice,$num_atoms,$total_atoms,$selectiveflag,$selective,$description,"POSCAR.out");
40 |
41 |
--------------------------------------------------------------------------------
/vtstscripts/nebbarrierdist.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | use FindBin qw($Bin) ;
5 | use lib "$Bin";
6 | use Vasp;
7 |
8 | @args=@ARGV;
9 | if (@args==0) {
10 | opendir(DIR,".") or die "couldn't open . ($!)\n";
11 | @list=readdir(DIR);
12 | closedir(DIR);
13 |
14 | @directories = grep {-d && /^[0-9][0-9]$/i} @list;
15 | @directories = sort {$a<=>$b} @directories;
16 | } else {
17 | @directories=@args;
18 | }
19 |
20 | $numdir=@directories;
21 | #print "#Directories found: ".join(" ",@directories)."\n";
22 |
23 | $dist_cum=0;
24 | for ($i=0;$i<@directories;$i++) {
25 | (-e "$directories[$i]/OUTCAR") || die "No OUTCAR in $directories[$i]!\n";
26 |
27 | $energy=`grep 'energy w' $directories[$i]/OUTCAR|tail -1`;
28 | $energy=~s/\s+$//g;
29 | @energy=split(/\s+/,$energy);
30 | $energy=$energy[@energy-1];
31 | if ($i==0) {$energy0=$energy;}
32 | $energy-=$energy0;
33 |
34 | if($i<($numdir-1)){
35 | $dist=`grep 'NEB: distance' $directories[$i]/OUTCAR|tail -1`;
36 | $dist=~s/\s+$//g;
37 | @dist=split(/\s+/,$dist);
38 | $dist=$dist[@dist-3];
39 | }else{
40 | $dist=$dist[@dist-2];}
41 |
42 | $dist_cum+=$dist;
43 |
44 | $force=`grep 'NEB: projections' $directories[$i]/OUTCAR|tail -1`;
45 | @force=split(/\s+/,$force);
46 | $force=$force[@force-1];
47 |
48 | printf "%3i %12.6f %12.6f %12.6f %3i\n",$i,$dist_cum,$energy,$force,$directories[$i];
49 | }
50 |
--------------------------------------------------------------------------------
/vtstscripts/nebclean.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | echo " **** "
4 | echo " Cleaning up after a neb run "
5 | echo " **** "
6 |
7 | # DIRS=$(ls -d ??)
8 | DIRS=$(ls -d [0-9][0-9])
9 | ZIP=${VTST_ZIP-gzip}
10 |
11 | c=0
12 | for i in $DIRS
13 | do
14 | c=$((c+1))
15 | mkdir $1/$i
16 | done
17 |
18 | cp INCAR KPOINTS $1
19 | rm -f vasprun.xml
20 |
21 | if [ ${VTST_STDOUT} ]
22 | then
23 | if [ -s ${VTST_STDOUT} ]
24 | then
25 | mv ${VTST_STDOUT} $1
26 | fi
27 | fi
28 | if [ ${VTST_STDERR} ]
29 | then
30 | rm -f ${VTST_STDERR}
31 | fi
32 |
33 | j=0
34 | for i in $DIRS
35 | do
36 | j=$((j+1))
37 | cd $i
38 | echo -e " In directory: `pwd`"
39 |
40 | rm -f *.xyz > /dev/null
41 | rm -f *.dat *.eps > /dev/null
42 | cp POSCAR OUTCAR ../$1/$i
43 | "$ZIP" ../$1/$i/OUTCAR &
44 |
45 | case $j in
46 | 1)
47 | ;;
48 | $c)
49 | ;;
50 | # [2-$((c-1))])
51 | *)
52 | rm -f DOSCAR EIGENVAL IBZKPT OSZICAR PCDAT CHG OUTCAR
53 | if [ -f stdout ]
54 | then
55 | rm -f stdout
56 | fi
57 | mv XDATCAR ../$1/$i ; "$ZIP" ../$1/$i/XDATCAR &
58 | cp POSCAR CONTCAR ../$1/$i
59 | mv CONTCAR POSCAR
60 |
61 | if [ -s WAVECAR ]
62 | then
63 | mv WAVECAR ../$1/$i ; "$ZIP" ../$1/$i/WAVECAR &
64 | else
65 | rm -f WAVECAR
66 | fi
67 | if [ -s CHGCAR ]
68 | then
69 | mv CHGCAR ../$1/$i ; "$ZIP" ../$1/$i/CHGCAR &
70 | else
71 | rm -f CHGCAR
72 | fi
73 | ;;
74 | esac
75 | cd ../
76 | done
77 |
--------------------------------------------------------------------------------
/vtstscripts/nebef.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | # Script prints the force, energy etc of OUTCAR's in immediate subdir
5 | # of present working directory. Older versions of this script had specific
6 | # paths hardcoded.
7 |
8 | use Cwd ;
9 | $dir = cwd ;
10 | @l1=`ls -la $dir/[0-9][0-9]/OUTCAR`; #specifies location of outcars
11 | $i = 0 ;
12 | foreach $_ (@l1) {
13 | chop() ;
14 | @t1=split() ;
15 | $t2=$t1[@t1-1] ;
16 | # $steps = `grep 'energy without' $t2 | wc |cut -c 0-8` ;
17 | $energy = `grep 'energy without' $t2 | tail -n 1 |cut -c 68-78` ;
18 | $force = `grep 'max\ at' $t2 | tail -n 1 |cut -c 27-38` ;
19 | # chop($steps) ;
20 | chop($energy) ;
21 | chop($force) ;
22 | if(!$i) {$e0 = $energy ;}
23 | $rel = $energy - $e0 ;
24 | @f4 = ($i,$force,$energy,$rel) ;
25 | printf "%4i %16.8f %16.8f %16.8f \n",@f4 ;
26 |
27 | $i++ ;
28 |
29 | };
30 |
31 |
--------------------------------------------------------------------------------
/vtstscripts/nebfreeze.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | use FindBin qw($Bin);
5 | use lib "$Bin";
6 | use Vasp;
7 |
8 | @args=@ARGV;
9 | @args=>1 || die "usage: nebfreeze.pl ";
10 |
11 | $whichatom=$args[0];
12 |
13 | # AA -> 27-06-2007
14 | # Need the header from the POSCAR files to properly write out the new files
15 | $header = `head -1 $args[1]` ;
16 | chop($header) ;
17 | # AA -> end
18 |
19 | ($coordinates,$basis,$lattice,$num_atoms,$total_atoms,$selectiveflag,$selective)
20 | =read_poscar($args[1]);
21 |
22 | print "----------------------------------------------------------------------\n";
23 | print "Reference: ".$coordinates->[$whichatom-1][0]." ".$coordinates->[$whichatom-1][1]." ".$coordinates->[$whichatom-1][2]."\n";
24 |
25 | for ($i=1;$i<@args;$i++) {
26 |
27 | print $args[$i].":\n";
28 |
29 | ($coordinates2,$basis,$lattice,$num_atoms,$total_atoms,$selectiveflag,$selective)
30 | =read_poscar($args[$i]);
31 |
32 | print " Difference: ";
33 | for ($j=0;$j<3;$j++) {
34 | $difference->[$j]=pbc($coordinates2->[$whichatom-1][$j]-$coordinates->[$whichatom-1][$j]);
35 | print $difference->[$j]." ";
36 | }
37 | print "\n";
38 |
39 | for ($k=0;$k<$total_atoms;$k++) {
40 | for ($j=0;$j<3;$j++) {
41 | $coordinates2->[$k][$j]=pbc($coordinates2->[$k][$j]-$difference->[$j]);
42 | }
43 | }
44 |
45 | $selective->[$whichatom-1]=" F F F";
46 | # AA -> 27-06-2007
47 | write_poscar($coordinates2,$basis,$lattice,$num_atoms,$total_atoms,$selectiveflag,$selective,$header,$args[$i]);
48 | # AA -> end
49 | }
50 |
51 |
--------------------------------------------------------------------------------
/vtstscripts/nebplot.gnu:
--------------------------------------------------------------------------------
1 | set grid
2 | set pointsize 2
3 | set xlabel "Reaction Coordinate [A]"
4 | set ylabel "Energy [eV]"
5 | set nokey
6 | set terminal postscript eps color
7 | set output "mep.eps"
8 | plot "spline.dat" u 2:3 w l lt 1 lw 2.4 , \
9 | "neb.dat" u 2:3 w p lt 3 lw 3.0 pt 7 ps 1.3
10 |
--------------------------------------------------------------------------------
/vtstscripts/outi.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 | ################################################################################
4 | # get iteration information from OUTCAR file (or OUTCAR type file)
5 | ################################################################################
6 | if (@ARGV==0) {
7 | $file='OUTCAR';
8 | } else {
9 | $file=$ARGV[0];
10 | };
11 |
12 | while (!-e $file) {
13 | print "\n\nfilename =? "; chop($file = );
14 | };
15 |
16 | open(FILE, "grep Iteration $file |");
17 | @lines=;
18 | close(FILE);
19 |
20 | $count=0;
21 | foreach $line (@lines) {
22 | $line=~m/(Iteration\s*([0-9]+)\s*\(\s*([0-9]+)\))/;
23 | $iterations[$count]=$1;
24 | $nuclear[$count]=$2;
25 | $electronic[$count]=$3;
26 | if ($count==$#lines) {
27 | print "$iterations[$count]\n";
28 | } elsif ($nuclear[$count] > $nuclear[$count-1]) {
29 | print "$iterations[$count-1]\n";
30 | };
31 | $count++;
32 | };
33 |
--------------------------------------------------------------------------------
/vtstscripts/pos2vasp.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | die "input a POSCAR or a CONTCAR \n" if @ARGV > 1 ;
5 | $pos = $ARGV[0] ;
6 | open IN , $pos ;
7 | open OUT , ">$pos.vasp" ;
8 |
9 | # Read in the input file
10 | while (){$file .= $_ ;}
11 | close IN ;
12 | @file = split /\n/ , $file ;
13 |
14 | # Get the number of names of atomi types
15 | $line = $file[0] ;
16 | chomp($line) ; $line=~s/^\s+//g ; @line=split /\s+/,$line ;
17 | $types = join " " , @line ;
18 | $nel = @line ;
19 | $line = $file[5] ;
20 | chomp($line) ; $line=~s/^\s+//g ; @line=split /\s+/,$line ;
21 | $numbers = join " " , @line ;
22 | # Calculate the total number of atoms
23 | while($line[$k] != undef){$natoms+=$line[$k++] ;}
24 |
25 | # Write out the .vasp file
26 | print OUT "SOME CRAP WITH DONT CARE ABOUT ","NCLASS=",$nel," ATOM=",$types,"\n" ;
27 | print OUT " ",$numbers,"\n" ;
28 | print OUT "Direct","\n" ;
29 | print OUT " ","\n" ;
30 | for ($i=1; $i<5; $i++){print OUT $file[$i],"\n" ;}
31 | print OUT " ","\n" ;
32 | $sh = 7 ;
33 | for ($i=1;$i<=$natoms; $i++){
34 | $line = $file[$sh+$i] ; chomp($line) ; $line=~s/^\s+//g ; @line=split /\s+/,$line ;
35 | printf OUT "%13.8f %11.8f %11.8f %5s\n",@line[0..2],"#$i" ;
36 | }
37 |
38 | close OUT ;
39 |
40 |
--------------------------------------------------------------------------------
/vtstscripts/quad.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | @args=@ARGV;
5 | (@args==1||@args==2) || die "usage: quad.pl \n";
6 | $inputfile=@args[0];
7 | if(@args==2){$outputfile=@args[1];}
8 | else{$outputfile="ciPOSCAR";}
9 |
10 | open (IN,"<$inputfile");
11 | open (OUT,">$outputfile");
12 |
13 | for($line=0; $line<5; $line++){$out=; print OUT "$out";}
14 |
15 | $natoms=;
16 | $natoms=~s/^\s+//g;
17 | @natoms=split(/\s+/,$natoms);
18 | $totatoms=0;
19 | for($i=0; $i<@natoms; $i++){
20 | $totatoms+=$natoms[$i];
21 | @natoms[$i]*=4;}
22 | $natoms=join(" ",@natoms);
23 | print OUT "$natoms\n";
24 |
25 | for($line=6; $line<8; $line++){$out=; print OUT "$out";}
26 |
27 | for($i=0; $i<$totatoms; $i++){
28 | $_=;
29 | $_=~s/^\s+//g;
30 |
31 | @out=split(/\s+/,$_);
32 | $out=join(" ",@out);
33 | print OUT "$out\n";
34 |
35 | @out=split(/\s+/,$_);
36 | @out[0]-=1;
37 | $out=join(" ",@out);
38 | print OUT "$out\n";
39 |
40 | @out=split(/\s+/,$_);
41 | @out[1]-=1;
42 | $out=join(" ",@out);
43 | print OUT "$out\n";
44 |
45 | @out=split(/\s+/,$_);
46 | @out[0]-=1; @out[1]-=1;
47 | $out=join(" ",@out);
48 | print OUT "$out\n";
49 | }
50 |
51 |
--------------------------------------------------------------------------------
/vtstscripts/quad_con.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | #-------------
5 | # This script double the x and y box dimensions of the con file created by quad.pl.
6 | # so that PBC can be applied to the created quadruple images.
7 | #-------------
8 | @args=@ARGV;
9 | (@args==1||@args==2) || die "usage: quad_con.pl \n";
10 | $inputfile=@args[0];
11 | if(@args==2){$outputfile=@args[1];}
12 | else{$outputfile="ciPOSCAR.con";}
13 |
14 | open (IN,"<$inputfile");
15 | open (OUT,">$outputfile");
16 |
17 | for($line=0; $line<2; $line++){$out=; print OUT "$out";}
18 |
19 | $box=;
20 | $box=~s/^\s+//g;
21 | @box=split(/\s+/,$box);
22 | for($i=0; $i<2; $i++){
23 | @box[$i]*=2.0;}
24 | $box=join(" ",@box);
25 | print OUT "$box\n";
26 |
27 | for($line=3; $line<6; $line++){$out=; print OUT "$out";}
28 | $ntype=;
29 | $ntype=~s/^\s+//g;
30 | @ntype=split(/\s+/,$ntype);
31 | $ntype=$ntype[0];
32 | print OUT "$ntype\n";
33 |
34 | $natoms=;
35 | $natoms=~s/^\s+//g;
36 | @natoms=split(/\s+/,$natoms);
37 | $totatoms=0;
38 | for($i=0; $i<@natoms; $i++){
39 | $totatoms+=$natoms[$i];
40 | }
41 | $natoms=join(" ",@natoms);
42 | print OUT "$natoms\n";
43 |
44 | $rest=8+$totatoms+2*$ntype+1;
45 | for($line=8; $line<$rest; $line++){$out=; print OUT "$out";}
46 | close(IN);
47 | close(OUT);
48 |
--------------------------------------------------------------------------------
/vtstscripts/rdf.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | # This program calculates the radial distribution function of an atom in
5 | # a POSCAR file. The bin size is an argument.
6 |
7 | use FindBin qw($Bin);
8 | use lib "$Bin";
9 | use Vasp;
10 |
11 | # variables needed by the script
12 |
13 | @args=@ARGV;
14 | @args==3 || die "usage: rdf.pl ";
15 |
16 | $poscarfile=$args[0];
17 | $central_atom=$args[1];
18 | $bin_size=$args[2];
19 |
20 | ($coordinates,$basis,$lattice,$num_atoms,$total_atoms,$selectiveflag,$selective)
21 | =read_poscar($poscarfile);
22 |
23 | for ($i=0;$i<$total_atoms;$i++) {
24 | if ($i+1!=$central_atom) {
25 | for ($j=0;$j<3;$j++) {
26 | $difference->[0][$j]=pbc($coordinates->[$central_atom-1][$j]-$coordinates->[$i][$j]);
27 | }
28 | $difference=dirkar($difference,$basis,$lattice,"1");
29 | $mag_difference=magnitude($difference,"1");
30 | $index=int($mag_difference/$bin_size);
31 | $bin->{$index}[@{$bin->{$index}}]=$i;
32 | }
33 | }
34 |
35 | print "----------------------------------------------------------------------\n";
36 | print "RDF of atom ".$central_atom." with bin size of ".$bin_size.".\n";
37 | print "Distance: Neighbors\n";
38 | print "----------------------------------------------------------------------\n";
39 |
40 | foreach $index (sort {$a<=>$b} keys %$bin) {
41 | $number=@{$bin->{$index}};
42 | printf "%5.3f (%3i) : ", $index*$bin_size,$number;
43 | for ($i=0;$i<@{$bin->{$index}};$i++) {
44 | printf "%4i ",($bin->{$index}[$i]+1);
45 | }
46 | print "\n";
47 | }
48 |
49 |
--------------------------------------------------------------------------------
/vtstscripts/splitmovie.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | # 07-05-2004
5 |
6 | # Because Jmol is so stupid it is necessary to brake the movie.xyz file
7 | # down to smallar pieces sometimes.
8 |
9 | # Check if there is a movie file there, and if so if it is old
10 | if(-e "movie.xyz"){
11 | if((-M "XDATCAR") < (-M "movie.xyz")){
12 | # It is time to generate a new movie file
13 | system "xdat2xyz.pl" ;
14 | }
15 | }else{
16 | # There is NO movie file
17 | system "xdat2xyz.pl" ;
18 | }
19 |
20 | # Get the number of atoms and the length of the xyz file
21 | $natoms = `head -1 movie.xyz` ;
22 | chomp($natoms) ;
23 | $nl = `wc -l movie.xyz` ;
24 | $nl=~s/^\s+//g ; @nl=split /\s+/,$nl ;
25 | $nl = @nl[0] ;
26 | $nsteps = $nl/($natoms+2) ;
27 |
28 | print "\n" ;
29 | print " The number of atoms is : ",$natoms,"\n" ;
30 | print " The number of steps is : ",$nsteps,"\n" ;
31 | print "\n" ;
32 | print " Into how many pieces should the movie file been split upto? ... " ;
33 | $np = ;
34 | $base = int($nsteps/$np) ;
35 | print " The last file will have ",$base+($nsteps-$base*$np)," steps","\n" ;
36 | print " All other files will have ",$base," steps","\n" ;
37 | for($i=0; $i<$np-1; $i++){
38 | $spl .= $base*($i+1)*($natoms+2)+1 ;
39 | $spl .= " " ;
40 | }
41 | system "csplit movie.xyz $spl >& /dev/null" ;
42 |
--------------------------------------------------------------------------------
/vtstscripts/sum_dos_np:
--------------------------------------------------------------------------------
1 | #!/bin/ksh
2 |
3 |
4 |
5 | # Script to sum up DOS files from VASP for non-polarized calculations.
6 | if [ $# -lt 3 ]; then
7 | echo "Usage: sum_dos [0] [start] [end]"
8 | echo "Or: sum_dos [1] [i] [j] [k] [l] ..."
9 | exit 1
10 | fi
11 |
12 |
13 | type=$1
14 | shift 1
15 |
16 | # Contiguous
17 | if [ $type -eq 0 ]; then
18 |
19 | start=$1
20 | end=$2
21 | shift 2
22 |
23 | string=$start.to.$end
24 | echo $start
25 | echo $end
26 |
27 |
28 | # First file
29 | i=$start
30 | nl=$(wc -l DOS$i | sed 's/://g' | awk '{print $1}')
31 | echo $nl
32 |
33 | sed -n '2,'$nl' p' DOS$i | awk '{printf "%12.8f %12.8f %12.8f %12.8f %12.8f \n", $1, $2, $3, $4, $2+$3+$4}' >| DOS.tmp
34 |
35 | i=$((i+1))
36 |
37 | while [ $i -le $end ]; do
38 |
39 | sed -n '2,'$nl' p' DOS$i | awk '{printf "%12.8f %12.8f %12.8f %12.8f %12.8f \n", $1, $2, $3, $4, $2+$3+$4 }' >| DOS.tmp2
40 |
41 | paste DOS.tmp DOS.tmp2 | awk '{printf "%15.8f %15.8f %15.8f %15.8f %15.8f \n", $1, $2+$7, $3+$8, $4+$9, $5+$10 }' >| DOS.tmp3
42 |
43 | mv -f DOS.tmp3 DOS.tmp
44 |
45 | i=$((i+1))
46 |
47 | done
48 |
49 |
50 | else
51 |
52 | start=$1
53 | shift 1
54 |
55 | # First file
56 | i=$start
57 | nl=$(wc -l DOS$i | sed 's/://g' | awk '{print $1}')
58 | echo $nl
59 | string=$start
60 | sed -n '2,'$nl' p' DOS$i | awk '{printf "%12.8f %12.8f %12.8f %12.8f %12.8f \n", $1, $2, $3, $4, $2+$3+$4 }' >| DOS.tmp
61 | for i in "$@"; do
62 | string=$(echo $string.$i)
63 | echo $i
64 | sed -n '2,'$nl' p' DOS$i | awk '{printf "%12.8f %12.8f %12.8f %12.8f %12.8f \n", $1, $2, $3, $4, $2+$3+$4 }' >| DOS.tmp2
65 |
66 | paste DOS.tmp DOS.tmp2 | awk '{printf "%15.8f %15.8f %15.8f %15.8f %15.8f \n", $1, $2+$7, $3+$8, $4+$9, $5+$10 }' >| DOS.tmp3
67 |
68 | mv -f DOS.tmp3 DOS.tmp
69 | done
70 |
71 |
72 | fi
73 |
74 |
75 | mv DOS.tmp DOS.SUM.$string
76 | rm -f DOS.tmp2
77 |
78 |
79 | exit 0
80 |
--------------------------------------------------------------------------------
/vtstscripts/typeset.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | # 23-01-2003
5 |
6 | # Change the first line in POSCAR so the element symbols
7 | # are there in the same order as in POTCAR.
8 |
9 | open POS, "POSCAR"
10 | or die "No POSCAR to open\n" ;
11 | $inline = join " ", @ARGV ;
12 | while () {$file.=$_;}
13 | close POS ;
14 | @file = split /\n/ , $file ;
15 | @file[0] = $inline,"\n" ;
16 | $file = join "\n" , @file ;
17 | open POS , ">POSCAR" ;
18 | print POS $file,"\n" ;
19 |
20 | # Check to see if there is a CONTCAR there. If one is found
21 | # change it ads well.
22 |
23 | if (-e "CONTCAR"){
24 | open POS, "CONTCAR" ;
25 | while () {$file.=$_;}
26 | close POS ;
27 | @file = split /\n/ , $file ;
28 | @file[0] = $inline,"\n" ;
29 | $file = join "\n" , @file ;
30 | open POS , ">CONTCAR" ;
31 | print POS $file,"\n" ;
32 | }
33 |
--------------------------------------------------------------------------------
/vtstscripts/vasp2jvasp.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | die "input a POSCAR or a CONTCAR \n" if @ARGV > 1 ;
5 | $pos = $ARGV[0] ;
6 | open IN , $pos ;
7 | open OUT , ">$pos.vasp" ;
8 |
9 | # Read in the input file
10 | while (){$file .= $_ ;}
11 | close IN ;
12 | @file = split /\n/ , $file ;
13 |
14 | # Get the number of names of atomi types
15 | $line = $file[0] ;
16 | chomp($line) ; $line=~s/^\s+//g ; @line=split /\s+/,$line ;
17 | $types = join " " , @line ;
18 | $nel = @line ;
19 | $line = $file[5] ;
20 | chomp($line) ; $line=~s/^\s+//g ; @line=split /\s+/,$line ;
21 | $numbers = join " " , @line ;
22 | # Calculate the total number of atoms
23 | while($line[$k] != undef){$natoms+=$line[$k++] ;}
24 |
25 | # Write out the .vasp file
26 | print OUT "SOME INFORMATION WE DONT CARE ABOUT ","NCLASS=",$nel," ATOM=",$types,"\n" ;
27 | print OUT " ",$numbers,"\n" ;
28 | print OUT "Direct","\n" ;
29 | print OUT " ","\n" ;
30 | for ($i=1; $i<5; $i++){print OUT $file[$i],"\n" ;}
31 | print OUT " ","\n" ;
32 | $sh = 7 ;
33 | for ($i=1;$i<=$natoms; $i++){
34 | $line = $file[$sh+$i] ; chomp($line) ; $line=~s/^\s+//g ; @line=split /\s+/,$line ;
35 | printf OUT "%13.8f %11.8f %11.8f %5s\n",@line[0..2],"#$i" ;
36 | }
37 |
38 | close OUT ;
39 |
40 |
--------------------------------------------------------------------------------
/vtstscripts/vasp2xyz.help:
--------------------------------------------------------------------------------
1 |
2 | #-----------------------------------------------------------------------------------------#
3 | # vasp2xyz: version 1.1 (c) April 2001 by MD #
4 | # #
5 | # Program to convert POSCAR and CONTCAR files into xyz format to view it with RasMol #
6 | # #
7 | # Syntax: vasp2xyz [-h] [-c] [-n] [-nos] [dl=smearedbox] [i=inputfile] [o=xyzfile] #
8 | # #
9 | # Options: #
10 | # -h shows help file #
11 | # -v shows vasp2xyz version #
12 | # -c automatically complete cell (e.g. Si 8 atoms -> 18 atoms) #
13 | # -nos no scaling with box dimension; default is false #
14 | # -n special naming convention; POSCAR.name -> name.xyz #
15 | # #
16 | # Parameters: #
17 | # inputfile POSCAR/CONTCAR file to convert to xyz format #
18 | # xyzfile output filename in xyz format; default is inputfile.xyz #
19 | # softbox assumes a smeared box edge to define inside and outside (complete cell) #
20 | # default is 0.03 of box size #
21 | # #
22 | # IMPORTANT: #
23 | # The first line in the POSCAR/CONTCAR file need to have the format #
24 | # #
25 | # "name specy1 specy2 ..." #
26 | # #
27 | # The specy list need to be consistent with line 6 (no. of species of each kind) #
28 | # #
29 | # Example: 7 silicon, 1 arsenic atom, and 2 boron atoms #
30 | # line1: Si7AsB2 As B Si #
31 | # line6: 1 2 7 #
32 | #-----------------------------------------------------------------------------------------#
33 |
--------------------------------------------------------------------------------
/vtstscripts/vclean.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | echo " **** "
4 | echo " Cleaning up after a normal vasp run "
5 | echo " **** "
6 |
7 | Bin=`dirname "$0"`
8 | ZIP=${VTST_ZIP-gzip}
9 |
10 | rm -f EIGENVAL IBZKPT OSZICAR PCDAT vasprun.xml CHG
11 |
12 | if [ -s WAVECAR ]
13 | then
14 | mv WAVECAR $1 ; "$ZIP" $1/WAVECAR &
15 | else
16 | rm -f WAVECAR
17 | fi
18 | if [ -s CHGCAR ]
19 | then
20 | mv CHGCAR $1 ; "$ZIP" $1/CHGCAR &
21 | else
22 | rm -f CHGCAR
23 | fi
24 | if [ -s PROCAR ]
25 | then
26 | mv PROCAR $1 ; "$ZIP" $1/PROCAR &
27 | else
28 | rm -f PROCAR
29 | fi
30 | if [ -s DOSCAR ]
31 | then
32 | mv DOSCAR $1 ; "$ZIP" $1/DOSCAR &
33 | else
34 | rm -f DOSCAR
35 | fi
36 |
37 | "$Bin/xdat2xyz.pl" > /dev/null ;
38 | if [ -s movie.xyz ]
39 | then
40 | mv movie.xyz $1
41 | fi
42 | "$Bin/vef.pl" > /dev/null ;
43 | if [ -s vaspout.eps ]
44 | then
45 | mv fe.dat vaspout.eps $1
46 | fi
47 | if [ -s XDATCAR ]
48 | then
49 | mv XDATCAR $1 ; "$ZIP" $1/XDATCAR &
50 | fi
51 | if [ -s OUTCAR ]
52 | then
53 | mv OUTCAR $1 ; "$ZIP" $1/OUTCAR &
54 | fi
55 |
56 | "$Bin/vasp2con.pl" POSCAR > /dev/null
57 | "$Bin/con2xyz.pl" POSCAR.con > /dev/null
58 | mv POSCAR.con POSCAR.xyz $1 ;
59 | "$Bin/vasp2con.pl" CONTCAR > /dev/null
60 | "$Bin/con2xyz.pl" CONTCAR.con > /dev/null
61 | mv CONTCAR.con CONTCAR.xyz $1 ;
62 | cp POSCAR CONTCAR INCAR KPOINTS $1
63 |
64 | if [ ${VTST_STDOUT} ]
65 | then
66 | if [ -s ${VTST_STDOUT} ]
67 | then
68 | mv ${VTST_STDOUT} $1
69 | fi
70 | fi
71 | if [ ${VTST_STDERR} ]
72 | then
73 | rm -f ${VTST_STDERR}
74 | fi
75 |
76 | mv CONTCAR POSCAR
77 |
--------------------------------------------------------------------------------
/vtstscripts/vcunzip.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | foreach $a (@ARGV){
5 | if(-e "$a/OUTCAR.gz"){ system " gunzip $a/OUTCAR.gz;" ; }
6 | elsif("$a/OUTCAR.bz2"){ system " bunzip2 $a/OUTCAR.bz2 ;" ; }
7 | }
8 |
--------------------------------------------------------------------------------
/vtstscripts/vczip.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | $path=`pwd`;
5 | chop($path);
6 |
7 | $zip = $ENV{'VTST_ZIP'} ;
8 | if($zip eq ''){ $zip = 'gzip' ; }
9 |
10 | foreach $a (@ARGV){
11 | if(-e "$a/OUTCAR") { system "$zip -9 $a/OUTCAR &" ; }
12 | if(-e "$a/stdout") { system "$zip -9 $a/stdout &" ; }
13 | }
14 |
--------------------------------------------------------------------------------
/vtstscripts/vef.gnu:
--------------------------------------------------------------------------------
1 | set grid
2 | set pointsize 0.8
3 | set ytics nomirror
4 | set y2tics
5 | set xlabel "Number of Ionic Step"
6 | set ylabel "Force [eV/A]"
7 | set y2label "Energy [eV]"
8 | set terminal postscript eps color
9 | set output "vaspout.eps"
10 | plot "fe.dat" u 1:2 axis x1y1 t "Max force" w lp lt 1 lw 2.4 pt 7 ps 0.9, \
11 | "fe.dat" u 1:3 axis x1y2 t "Energy" w lp lt 3 lw 2.4 pt 7 ps 0.9
12 |
13 | #set output
14 | #set terminal x11
15 |
--------------------------------------------------------------------------------
/vtstscripts/vef.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | use FindBin qw($Bin);
5 |
6 | $plotflag=1;
7 | if(@ARGV>0){ $plotflag=$ARGV[0] ; }
8 |
9 | $zip = $ENV{'VTST_ZIP'} ;
10 | if($zip eq ''){ $zip = 'gzip' ; }
11 |
12 | $outzipped=0;
13 | if(-e "OUTCAR.gz"){ $outzipped=1; system "gunzip OUTCAR.gz" ; }
14 | if(-e "OUTCAR.bz2"){ $outzipped=1; system "bunzip2 OUTCAR.bz2" ; }
15 |
16 | $forces = `grep 'FORCES: max atom, RMS' OUTCAR` ;
17 | $energy = `grep 'energy without entropy' OUTCAR` ;
18 |
19 | @forces = split /\n/ , $forces ;
20 | @energy = split /\n/ , $energy ;
21 |
22 | $num = @forces;
23 |
24 | open OUT , ">fe.dat" ;
25 |
26 | for($i=0; $i<$num; $i++){
27 | $line = $forces[$i] ;
28 | chomp($line) ;
29 | $line=~s/^\s+//g;
30 | @line=split /\s+/,$line;
31 | $f = $line[4],"\n" ;
32 |
33 | $line = $energy[$i] ;
34 | chomp($line) ;
35 | $line=~s/^\s+//g;
36 | @line=split /\s+/,$line;
37 | $e = $line[6],"\n" ;
38 | if(!$i) {$e0 = $e ;}
39 | printf OUT "%5i %20.8f %20.6f %20.6g \n",$i,$f,$e,$e-$e0 ;
40 | printf "%5i %20.8f %20.6f %20.6g \n",$i,$f,$e,$e-$e0 ;
41 | }
42 |
43 | close OUT ;
44 |
45 | if($num>1 and $plotflag){
46 | system "gnuplot $Bin/vef.gnu" ;
47 | }
48 |
49 | # if($outzipped){system "$zip -9 OUTCAR \&" ; }
50 | if($outzipped){system "$zip -9 OUTCAR" ; }
51 |
52 |
--------------------------------------------------------------------------------
/vtstscripts/vfin.pl:
--------------------------------------------------------------------------------
1 | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
2 | #;-*- Perl -*-
3 |
4 | use FindBin qw($Bin);
5 | use lib "$Bin";
6 |
7 | # Check to see if there is an OUTCAR and read the ICHAIN variable from it
8 | if (-e "OUTCAR"){
9 | $_ = `head -1000 OUTCAR | grep -i ICHAIN ` ;
10 | }elsif (-e "01/OUTCAR"){
11 | $_ = `head -1000 01/OUTCAR | grep -i ICHAIN ` ;
12 | }else{
13 | die "No OUTCAR found !!! \n"
14 | }
15 | @s = split /\s+/ , $_ ;
16 | $ichain = $s[4] ;
17 |
18 | die "No result directory name given! \n" if @ARGV < 1 ;
19 | $dir = $ARGV[0] ;
20 | mkdir $dir, 0755 ;
21 |
22 | # Clean up the run
23 | if ($ichain == 0){
24 | # If there is a 00 directory then this is a NEB run
25 | if (-e "00") {
26 | system "$Bin/nebclean.sh $dir" ;
27 | }else{
28 | system "$Bin/vclean.sh $dir" ;
29 | }
30 | }elsif ($ichain == 1){
31 | system "$Bin/dymclean.sh $dir"
32 | }elsif ($ichain == 2){
33 | if((-e "MODECAR") && !(-e "01") && !(-e "02")){
34 | system "$Bin/dimclean.sh $dir" ;
35 | }elsif((-e "01") && (-e "02")){
36 | system "$Bin/dimclean2.sh $dir" ;
37 | }
38 | }elsif ($ichain == 3){
39 | system "$Bin/lanclean.sh $dir" ;
40 | }elsif ($ichain == 4){
41 | system "$Bin/insclean.sh $dir" ;
42 | }
43 |
44 |
--------------------------------------------------------------------------------
/vtstscripts/vtstscripts.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itamblyn/scripts/bbf02f08bed4d6e8afedfbced53f721010b0fd4f/vtstscripts/vtstscripts.tar.gz
--------------------------------------------------------------------------------
/wake_on_LAN.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # wol.py
3 |
4 | import socket
5 | import struct
6 |
7 | def wake_on_lan(macaddress):
8 | """ Switches on remote computers using WOL. """
9 |
10 | # Check macaddress format and try to compensate.
11 | if len(macaddress) == 12:
12 | pass
13 | elif len(macaddress) == 12 + 5:
14 | sep = macaddress[2]
15 | macaddress = macaddress.replace(sep, '')
16 | else:
17 | raise ValueError('Incorrect MAC address format')
18 |
19 | # Pad the synchronization stream.
20 | data = ''.join(['FFFFFFFFFFFF', macaddress * 20])
21 | send_data = ''
22 |
23 | # Split up the hex values and pack.
24 | for i in range(0, len(data), 2):
25 | send_data = ''.join([send_data,
26 | struct.pack('B', int(data[i: i + 2], 16))])
27 |
28 | # Broadcast it to the LAN.
29 | sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
30 | sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
31 | sock.sendto(send_data, ('', 7))
32 |
33 |
34 | if __name__ == '__main__':
35 | # Use macaddresses with any seperators.
36 | wake_on_lan('00:1b:63:96:7f:31')
37 | # wake_on_lan('0F-0F-DF-0F-BF-EF')
38 | # or without any seperators.
39 | # wake_on_lan('0F0FDF0FBFEF')
40 |
--------------------------------------------------------------------------------
/wifi_measure.sh:
--------------------------------------------------------------------------------
1 | while x=1; do /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | grep CtlRSSI; sleep 0.5; done
2 |
--------------------------------------------------------------------------------
/xmls_style_io.pm:
--------------------------------------------------------------------------------
1 | package xmls_style_io;
2 | #use strict;
3 | #use warnings;
4 | use IO::File;
5 |
6 | sub new{
7 | my $class = shift;
8 | $self = {};
9 |
10 | $self->{fh} = shift;
11 |
12 | bless $self, $class;
13 | }
14 |
15 | sub print_head{
16 | my $self = shift;
17 | my $fh = $self->{fh};
18 | $fh->print("
19 | \n");
23 | }
24 |
25 | sub xmlprint{
26 | my $self = shift;
27 | my $type = shift;
28 | my @content = @_;
29 | my $fh = $self->{fh};
30 | $fh->print("<${type}>\n");
31 | foreach $content (@content){
32 | $fh->print(" $content\n");
33 | }
34 | $fh->print("${type}>\n");
35 | }
36 |
37 | sub xmlprintf{
38 | my $self = shift;
39 | my $type = shift;
40 | my @content = @_;
41 | my $fh = $self->{fh};
42 | $fh->print("<${type}>\n");
43 | foreach $content (@content){
44 | $fh->printf(" %.8f\n",$content);
45 | }
46 | $fh->print("${type}>\n");
47 | }
48 |
49 | sub open_brace{
50 | my $self = shift;
51 | my $type = shift;
52 | my $fh = $self->{fh};
53 | $fh->print("<${type}>\n");
54 | }
55 |
56 | sub close_brace{
57 | my $self = shift;
58 | my $type = shift;
59 | my $fh = $self->{fh};
60 | $fh->print("${type}>\n");
61 | }
62 |
63 | 1;
64 |
--------------------------------------------------------------------------------