Coverage for gpaw/test/generic/test_al_chain.py: 100%

13 statements  

« prev     ^ index     » next       coverage.py v7.7.1, created at 2025-07-12 00:18 +0000

1from ase import Atoms 

2from gpaw import GPAW 

3from gpaw.mpi import size 

4 

5 

6def test_generic_al_chain(in_tmp_dir): 

7 d = 4.0 / 2**0.5 

8 ndomains = size // 8 + 1 

9 calc = GPAW(mode='fd', 

10 h=d / 16, 

11 kpts=(17, 1, 1), 

12 parallel={'domain': ndomains, 'band': 1}) 

13 chain = Atoms('Al', cell=(d, 5, 5), pbc=True, calculator=calc) 

14 e = chain.get_potential_energy() 

15 print(e) 

16 assert abs(e - -1.8182) < 0.0005 

17 assert calc.wfs.kd.comm.size * ndomains == size 

18 calc.write('al_chain', 'all')