Example of elastic tensor calculation using VASP calculator and elastic module. ''' from ase.lattice.spacegroup import crystal from parcalc import ClusterVasp, ParCalculate from elastic import Crystal import ase.units as units from numpy import array, linspace import matplotlib.pyplot as plt import numpy # Create the MgO crystal a = 4.194 cryst = Crystal( crystal(['Mg', 'O'], [(0, 0, 0), (0.5, 0.5, 0.5)], spacegroup=225, cellpar=[a, a, a, 90, 90, 90])) # Create the calculator running on one, eight-core node. # This is specific to the setup on my cluster. # You have to adapt this part to your environment calc = ClusterVasp(nodes=1, ppn=8) # Assign the calculator to the crystal cryst.set_calculator(calc) # Set the calculation parameters calc.set(prec='Accurate', xc='PBE', lreal=False, nsw=30,
# Cubic a = 4.194 crystals.append( crystal(['Mg', 'O'], [(0, 0, 0), (0.5, 0.5, 0.5)], spacegroup=225, cellpar=[a, a, a, 90, 90, 90])) # a = 4.194 # crystals.append(Crystal(crystal(['Ti', 'C'], [(0, 0, 0), (0.5, 0.5, 0.5)], # spacegroup=225, cellpar=[a, a, a, 90, 90, 90]))) # Tetragonal a = 4.60 c = 2.96 crystals.append( Crystal( crystal(['Ti', 'O'], [(0, 0, 0), (0.302, 0.302, 0)], spacegroup=136, cellpar=[a, a, c, 90, 90, 90]))) # Trigonal (this is metal - for sure the k spacing will be too small) a = 4.48 c = 11.04 crystals.append( Crystal( crystal(['Sb'], [(0, 0, 0.24098)], spacegroup=166, cellpar=[a, a, c, 90, 90, 120]))) print("Running tests") # Iterate over all crystals. # We do not paralelize over test cases for clarity. for cryst in crystals[:]: