Exemple #1
0
 def update_pressure(line):
     if line.startswith("     Computing"):
         try:
             pressure = float(lines[i + 2].split()[5])
         except:
             pressure = float(lines[i + 4].split()[5])
         cuds_entity = sim.get(oclass=QE.Pressure)
         if cuds_entity:
             cuds_entity[0].value = pressure
             cuds_entity[0].unit = "kbar"
         else:
             sim.add(QE.Pressure(value=pressure, unit="kbar"))
Si.add(QE.Mass(value = 28.085, unit = "amu"))
SiParams = QE.CellParams(tensor2 = [[0.5, 0.5, 0.],
                                      [0.5, 0., 0.5],
                                      [0., 0.5, 0.5]], unit = "")
SiCell.add(Si1, SiParams)
Si1.add(QE.Position(vector = (0, 0, 0), unit = ""))
SiCell.add(celldm1)

# Specifies the values of the cell parameters


# Adds cell and element to simulation
sim.add(SiCell)
sim.add(Si)
sim.add(k)
sim.add(QE.Pressure(value = 100, unit = "kbar"))
sim.add(QE.StressTensor(tensor2 = np.zeros((3, 3)), unit = "kbar"))
root = ""
SiCell.add(QE.Volume(value = 22, unit = "au^3"))
sim.add(QE.TotalEnergy(value = -434, unit = "Ry"))
q = QE.QPoint(vector = (0, 0, 0), unit = "", calculate = True)
sim.add(q)
q.add(QE.Mode(number = 3))
q.add(QE.Mode(number = 2))
q.add(QE.Mode(number = 1))

sim2 = QE.Simulation()
fd = QE.Cell()
sim2.add(fd)

fd.add(QE.Volume(value = 33, unit = "au^3"))