DFTB+

Running a bunch of DFTB+ jobs (May-2015)

One can submit a bunch of DFTB+ jobs (on a PC). Here is a small script (write your own, according to your needs). Submit the job as shown in the bold line.

Running DFTB+

#!/bin/bash

# Current working directory

cwd=$(pwd)

# Get the directory names

#ls * > directory_names

# Enter each directory and find the file names

#for i in $(cat directory_names)

#do

# cd ${i}

ls *.xyz > file_names

# Create a separate directory for each of the file names

# and move them into the respective directories

for j in $(cat file_names)

do

var1=$(basename ${j} .xyz) # here var1 is the filename with coordinates

mkdir ${var1}

mv ${var1}".xyz" ${var1}

# Creating a separate directory for DFTB3 calculations and running them

mkdir ${var1}/opt_dftb3

cp ${var1}/${var1}".xyz" ${var1}/opt_dftb3/input.xyz

sed -i 's/C/1/g' ${var1}/opt_dftb3/input.xyz

sed -i 's/H/2/g' ${var1}/opt_dftb3/input.xyz

# Need to copy the skf and dftb_in file from the directory where the script is running

cp ${cwd}/C-C.skf ${cwd}/C-H.skf ${cwd}/H-H.skf ${cwd}/H-C.skf ${cwd}/dftb_in.hsd ${var1}/opt_dftb3/

cd ${var1}/opt_dftb3/

~/Softwares/DFTB_plus/source_code/dftb+_1.2.2_src/prg_dftb/_obj_x86_64-linux-gfortran/dftb+ < dftb_in.hsd > output.log

cd ../../

done

# cd ../

#done