diff --git a/src/postprocess/stresses.jl b/src/postprocess/stresses.jl index 1e348ac96e..aeab04faeb 100644 --- a/src/postprocess/stresses.jl +++ b/src/postprocess/stresses.jl @@ -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)