Skip to content

Commit e1edeb7

Browse files
committed
Trying to see if we fix the stress issue
1 parent 8bcb779 commit e1edeb7

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

Modules/aiida_ensemble.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
try:
2727
from flare.atoms import FLARE_Atoms
28+
from flare.io.output import compute_mae
2829
from flare.learners.utils import get_env_indices, is_std_in_bound
2930
except ImportError:
3031
pass
@@ -317,6 +318,19 @@ def _update_gp(
317318

318319
self.output.write_wall_time(tic, task='Env Selection')
319320

321+
# compute mae and write to output
322+
e_mae, e_mav, f_mae, f_mav, s_mae, s_mav = compute_mae(
323+
atoms,
324+
self.output.basename,
325+
atoms.potential_energy,
326+
atoms.forces,
327+
atoms.stress,
328+
dft_energy,
329+
dft_frcs,
330+
dft_stress,
331+
self.force_only,
332+
)
333+
320334
if not std_in_bound:
321335
if not is_empty_model:
322336
stds = self.flare_calc.results.get('stds', np.zeros_like(dft_frcs))
@@ -339,7 +353,7 @@ def _update_gp(
339353
'forces': dft_frcs,
340354
'energy': dft_energy,
341355
'free_energy': dft_energy,
342-
'stress': flare_stress,
356+
'stress': dft_stress,
343357
}
344358

345359
atoms.calc = SinglePointCalculator(atoms, **results)

0 commit comments

Comments
 (0)