Skip to content

Commit

Permalink
use new constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
antoine-levitt committed Jul 16, 2021
1 parent 66fdd7b commit c23b200
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions src/postprocess/stresses.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,16 @@ Compute the stresses (= 1/Vol dE/d(M*lattice), taken at M=I) of an obtained SCF
model.smearing,
model.spin_polarization,
model.symmetries)
# XXX find a way to make this work
new_basis = PlaneWaveBasis(new_model,
0, # Ecut
basis.kcoords,
basis.ksymops,
basis.symmetries;
basis.fft_size,
basis.kgrid,
basis.kshift,
basis.comm_kpts)
new_basis = PlaneWaveBasis(new_model, basis.Ecut,
basis.kcoords_global, basis.ksymops_global,
basis.fft_size, basis.variational, basis.symmetries,
basis.kgrid, basis.kshift, basis.comm_kpts)
ρ = DFTK.compute_density(new_basis, ψ, occ)
energies, _ = energy_hamiltonian(new_basis, ψ, occupation; ρ=ρ)
energies, _ = energy_hamiltonian(new_basis, ψ, occ; ρ=ρ)
energies.total
end
ForwardDiff.gradient(M -> HF_energy((I+M) * basis.lattice),
zeros(eltype(basis), 3, 3)) / det(basis.lattice)
ForwardDiff.gradient(M -> HF_energy((I+M) * basis.model.lattice),
zeros(eltype(basis), 3, 3)) / det(basis.model.lattice)
end
function compute_stresses(scfres)
compute_stresses(scfres.basis, scfres.ψ, scfres.occupation)
Expand Down

0 comments on commit c23b200

Please sign in to comment.