Esempio n. 1
0
# Set the calculation parameters
calc.set(prec='Accurate',
         xc='PBE',
         lreal=False,
         nsw=30,
         ediff=1e-8,
         ibrion=2,
         kpts=[3, 3, 3])

# Set the calculation mode first.
# Full structure optimization in this case.
# Not all calculators have this type of internal minimizer!
calc.set(isif=3)
print "Running initial optimization ... ",
print "Residual pressure: %.3f bar" % (cryst.get_isotropic_pressure(
    cryst.get_stress()))

# Lets extract optimized lattice constant.
# MgO is cubic so a is a first diagonal element of lattice matrix
a = cryst.get_cell()[0, 0]

# Clean up the directory
calc.clean()

# Switch to cell shape+IDOF optimizer
calc.set(isif=4)

# Calculate few volumes and fit B-M EOS to the result
# Use +/-3% volume deformation and 5 data points
fit = cryst.get_BM_EOS(n=5, lo=0.97, hi=1.03)
Esempio n. 2
0
calc.set(prec='Accurate',
         xc='PBE',
         lreal=False,
         nsw=30,
         ediff=1e-8,
         ibrion=2,
         kpts=[3, 3, 3])

# Set the calculation mode first.
# Full structure optimization in this case.
# Not all calculators have this type of internal minimizer!
calc.set(isif=3)

print("Running initial optimization ... ", end=' ')
print("Residual pressure: %.3f bar" %
      (cryst.get_isotropic_pressure(cryst.get_stress())))

# Clean up the directory
calc.clean()

# Switch to cell IDOF optimizer
calc.set(isif=2)

# Elastic tensor by internal routine
Cij, Bij = cryst.get_elastic_tensor(n=5, d=0.2)
print("Cij (GPa):", Cij / units.GPa)

# Now let us do it (only c11 and c12) by hand
# with 3rd order polynomial fitting the points.
sys = []
for d in linspace(-0.2, 0.2, 10):
Esempio n. 3
0
calc.set(prec = 'Accurate', 
            xc = 'PBE', 
            lreal = False, 
            nsw=30,
            ediff=1e-8, 
            ibrion=2,
            kpts=[3,3,3])

# Set the calculation mode first.
# Full structure optimization in this case.
# Not all calculators have this type of internal minimizer!
calc.set(isif=3)

print "Running initial optimization ... ",
print "Residual pressure: %.3f bar" % (
            cryst.get_isotropic_pressure(cryst.get_stress()))

# Clean up the directory
calc.clean()

# Switch to cell IDOF optimizer
calc.set(isif=2)

# Elastic tensor by internal routine
Cij, Bij=cryst.get_elastic_tensor(n=5,d=0.2)
print "Cij (GPa):", Cij/units.GPa


# Now let us do it (only c11 and c12) by hand 
# with 3rd order polynomial fitting the points.
sys=[]