Commit 7bbb6bca authored by Mikkel Strange's avatar Mikkel Strange
Browse files

Merge branch 'gpaw-add-3d-arrays' into 'master'

add code to read pseudo density and effective potential from gpw file.  Add two tests in ulm format

See merge request !1
parents dabe80e1 85ff1ea7
......@@ -136,6 +136,33 @@ def parse(filename):
c(r.occupations.fermilevel, 'eV'))
c(r.occupations.fermilevel, 'eV'))
# Load 3D arrays ("volumetric data")
origin = -0.5 * r.atoms.cell
npoints = np.array(r.density.density.shape[1:])
npoints[~r.atoms.pbc] += 1
displacements = r.atoms.cell / npoints
def add_3d_array(values, kind, unit):
with o(p, 'section_volumetric_data'):
origin, 'angstrom')
displacements, 'angstrom')
cu(values, unit))
p.addValue('volumetric_data_kind', kind)
# H.atom.ulm.gpw test can be used to verify that pseudodensity
# integrates to 0.98, corresponding closely to the norm of the
# H 1s pseudowavefunction (see output of "gpaw-setup H").
# It has mixed BCs so this should show that npoints is taken
# care of correctly, hopefully.
add_3d_array(r.density.density, kind='density',
add_3d_array(r.hamiltonian.potential, kind='potential_effective',
if 'forces' in r.results:
c(r.results.forces, 'eV/angstrom'))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment