Exemple #1
0
class Hartree:
    def __init__(self, grid, atoms):
        self.grid = grid
        self.psolver = Psolver(grid)
        self.rho_bg, self.v_bg = calculate_background(grid, atoms)

    def update(self, density):
        b = -4*np.pi * (density.rho - self.rho_bg)
        self.v = e2*self.psolver.solve(b)
        self.e = -0.5*(density.rho * (self.v + self.v_bg)).sum()*self.grid.vol
Exemple #2
0
class Hartree:
    def __init__(self, grid, atoms):
        self.grid = grid
        self.psolver = Psolver(grid)
        self.rho_bg, self.v_bg = calculate_background(grid, atoms)

    def update(self, density):
        b = -4 * np.pi * (density.rho - self.rho_bg)
        self.v = e2 * self.psolver.solve(b)
        self.e = -0.5 * (density.rho *
                         (self.v + self.v_bg)).sum() * self.grid.vol
Exemple #3
0
 def __init__(self, grid, atoms):
     self.grid = grid
     self.psolver = Psolver(grid)
     self.rho_bg, self.v_bg = calculate_background(grid, atoms)
Exemple #4
0
 def __init__(self, grid, atoms):
     self.grid = grid
     self.psolver = Psolver(grid)
     self.rho_bg, self.v_bg = calculate_background(grid, atoms)