Skip to content

Commit

Permalink
Now actually fixed the interface
Browse files Browse the repository at this point in the history
  • Loading branch information
RandomDefaultUser committed Oct 24, 2024
1 parent d9eb104 commit e5a51fa
Showing 1 changed file with 12 additions and 20 deletions.
32 changes: 12 additions & 20 deletions mala/targets/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -1536,26 +1536,18 @@ def _process_openpmd_attributes(self, series, iteration, mesh):
)

# Forces may not necessarily have been read (and therefore written)
atomic_forces_dft = iteration.particles["atomic_forces_dft"]
nr_atoms = len(atomic_forces_dft["force_compopnents"])
self.atomic_forces_dft = np.zeros((nr_atoms, 3))
for i in range(0, nr_atoms):
atomic_forces_dft["force_compopnents"][str(i)].load_chunk(
self.atomic_forces_dft[i, :]
)
series.flush()

# try:
# atomic_forces_dft = iteration.particles["atomic_forces_dft"]
# nr_atoms = len(atomic_forces_dft["atomic_forces_dft"])
# self.atomic_forces_dft = np.zeros((nr_atoms, 3))
# for i in range(0, nr_atoms):
# self.atomic_forces_dft["atomic_forces_dft"][str(i)].load_chunk(
# self.atomic_forces_dft[i, :]
# )
# series.flush()
# except IndexError:
# pass

try:
atomic_forces_dft = iteration.particles["atomic_forces_dft"]
nr_atoms = len(atomic_forces_dft["force_compopnents"])
self.atomic_forces_dft = np.zeros((nr_atoms, 3))
for i in range(0, nr_atoms):
atomic_forces_dft["force_compopnents"][str(i)].load_chunk(
self.atomic_forces_dft[i, :]
)
series.flush()
except IndexError:
pass

# Process all the regular meta info.
self.fermi_energy_dft = self._get_attribute_if_attribute_exists(
Expand Down

0 comments on commit e5a51fa

Please sign in to comment.