Skip to content

Instantly share code, notes, and snippets.

View Asif-Iqbal-Bhatti's full-sized avatar
☢️
Manufacturing consent Noam Chomsky

Asif_em2r Asif-Iqbal-Bhatti

☢️
Manufacturing consent Noam Chomsky
  • Belgium
View GitHub Profile
@Asif-Iqbal-Bhatti
Asif-Iqbal-Bhatti / xml2vasp.py
Last active December 13, 2019 15:45
exciting input file to VASP poscar file
#!/usr/bin/env python
from lxml import etree
import xml.etree.ElementTree as xml
from math import *
import sys, getopt, os
from sys import stdout
from array import *
import numpy as np
@Asif-Iqbal-Bhatti
Asif-Iqbal-Bhatti / crystal_deformation.cpp
Last active October 24, 2015 22:35
C++ code for reading POSCAR file and deforming crystal
#include <iostream>
#include <fstream>
#include <sstream>
#include <stdlib.h>
#include <iomanip>
#include <stdio.h>
#include <string>
#include <cmath>
#include <vector>
#include <algorithm>
@Asif-Iqbal-Bhatti
Asif-Iqbal-Bhatti / POSCAR_read.cpp
Created October 25, 2015 11:04
C++ code for reading VASP file.
#include <iostream>
#include <fstream>
#include <string>
#include <iomanip>
#include <stdlib.h>
#include <sstream>
#include <vector>
#include <algorithm>
#include <iterator>
@Asif-Iqbal-Bhatti
Asif-Iqbal-Bhatti / Hirshfeld_extract
Last active April 17, 2016 10:15
Extract Hirshfels volume from FHI-aim output file to append in the last column of inputfile for Many body theory implemented in FHI-aim
import sys
import subprocess
import os
##usage: python Hirshfeld_extract.py FHI-aim_outputfile
print "Writing to a file..."
f = open('hir.dat', 'w')
print "Name of the file: ", f.name
@Asif-Iqbal-Bhatti
Asif-Iqbal-Bhatti / Bader_analysis
Created April 17, 2016 10:17
Script for BigDFT code for extract data generated by Bader analysis
#!/bin/bash -e
echo " ------------------------"
echo " Bader analysis "
echo " ------------------------"
echo " Reading "free-Atoms/Bonds.csv/txt" from Mercury software file !!!"
echo " Reading "dipole.yaml" from bader output file"
if [[ -e charges.dat ]] ; then
rm -r charges.dat
@Asif-Iqbal-Bhatti
Asif-Iqbal-Bhatti / extract_procar.sh
Created May 6, 2016 20:17
Extract orbitals from VASP: PROCAR file
#!/bin/bash
#**************************************************************************************************#
# #
# Created on 06/05/2016 at 02:00 PM #
# Author: Asif Iqbal Bhatti #
# Extracting site projected orbitals for a selected atom #
# Usage: Run the file in the directory where VASP files are located !!! #
# #
#**************************************************************************************************#
@Asif-Iqbal-Bhatti
Asif-Iqbal-Bhatti / mol2_file_conversion.py
Last active July 8, 2018 11:36
Conversion file from mol2 atom types (generated from Chimera software) to Amber atom types
#!/usr/bin/env python
#
#
#### DATE : 08/July/2018
#### Author : Asif Iqbal
#### Script : For changing mol2 variables
#### USE : ./script.py filename.mol2
#### Edit mol2 file to remove empty line generated from chimera
# coordinate counting should start form the 7th ROW!!!!!
#
@Asif-Iqbal-Bhatti
Asif-Iqbal-Bhatti / Elastic_properties_extraction.py
Last active July 6, 2022 03:21
CODE to extract various properties from VASP output files
#!/usr/bin/env python3
'''
#####---------------------------------------------------------
#####---------------------------------------------------------
# Credit : Asif Iqbal BHATTI
# CODE to: OBTAIN Elastic properties form OUTCAR files,
# compare POSCAR and CONTCAR volume deformation
# upon minimization, and extract energy from a number
# of directories.
@Asif-Iqbal-Bhatti
Asif-Iqbal-Bhatti / extract_energy_VASP.sh
Last active April 18, 2022 17:48
Script to extract energy from each directory for VASP calculation
#!/bin/bash
#
# USAGE: script to extract energy from each folder. This script output energy-vs-volume
# and energy-vs-strain output files. The units are converted from eV to Ha
# and A3 to Bohr3.
#
echo -e "************************************************************************* \e[92m"
echo "*************************************************************************"
echo -e "*************************************************************************\e[0m"
@Asif-Iqbal-Bhatti
Asif-Iqbal-Bhatti / Extract_Elastic_properties.py
Last active March 9, 2020 07:44
Mechanical properties from Energy vs Strain curve
#!/usr/bin/env python3
'''
# | Elastic Properties
# | Code for calculating mechanical properties
# from Energy vs Strain relationship
#
# Equations can be found at Golesorkhtabar, R., Pavone, P., Spitaler, J.,
# Puschnig, P. & Draxl, C. ElaStic: A tool for calculating second-order elastic
# constants from first principles. Comput. Phys. Commun. 184, 1861–1873 (2013).