Skip to content

Commit 2e148f2

Browse files
authored
Merge devel into master (#395)
2 parents 22b3533 + 6b1bb7e commit 2e148f2

File tree

8 files changed

+4
-15
lines changed

8 files changed

+4
-15
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ The `System` or `LabeledSystem` can be constructed from the following file forma
8080
| Amber | multi | True | True | LabeledSystem | 'amber/md' |
8181
| Amber/sqm | sqm.out | False | False | System | 'sqm/out' |
8282
| Gromacs | gro | True | False | System | 'gromacs/gro' |
83+
| ABACUS | STRU | False | False | System | 'abacus/stru' |
8384
| ABACUS | STRU | False | True | LabeledSystem | 'abacus/scf' |
8485
| ABACUS | cif | True | True | LabeledSystem | 'abacus/md' |
8586
| ABACUS | STRU | True | True | LabeledSystem | 'abacus/relax' |

dpdata/abacus/scf.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,21 +59,15 @@ def get_cell(geometry_inlines):
5959
cell = celldm*np.array(cell)
6060
return celldm, cell
6161

62-
def get_coords(celldm, cell, geometry_inlines, inlines):
62+
def get_coords(celldm, cell, geometry_inlines, inlines=None):
6363
coords_lines = get_block(geometry_inlines, "ATOMIC_POSITIONS", skip=0)
6464
# assuming that ATOMIC_POSITIONS is at the bottom of the STRU file
6565
coord_type = coords_lines[0].split()[0].lower() # cartisan or direct
6666
atom_names = [] # element abbr in periodic table
6767
atom_types = [] # index of atom_names of each atom in the geometry
6868
atom_numbs = [] # of atoms for each element
6969
coords = [] # coordinations of atoms
70-
ntype = 0
71-
for line in inlines:
72-
if "ntype" in line and "ntype"==line.split()[0]:
73-
ntype = int(line.split()[1])
74-
break
75-
if ntype <= 0:
76-
raise RuntimeError('ntype cannot be found in INPUT file.')
70+
ntype = get_nele_from_stru(geometry_inlines)
7771
line_idx = 1 # starting line of first element
7872
for it in range(ntype):
7973
atom_names.append(coords_lines[line_idx].split()[0])

tests/abacus.md.nostress/INPUT

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
INPUT_PARAMETERS
22
#Parameters (General)
33
suffix autotest
4-
pseudo_dir ./
5-
ntype 1
4+
pseudo_dir ./
65
nbands 8
76
calculation md
87

tests/abacus.md.unconv/INPUT

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
INPUT_PARAMETERS
22
calculation md
3-
ntype 2
43
nbands 8
54

65
ecutwfc 50.000000

tests/abacus.md/INPUT

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ INPUT_PARAMETERS
22
#Parameters (1.General)
33
suffix abacus
44
calculation md
5-
ntype 2
65
nbands 6
76
symmetry 0
87

tests/abacus.relax/INPUT

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ INPUT_PARAMETERS
22
#Parameters (1.General)
33
suffix abacus
44
calculation cell-relax
5-
ntype 2
65
nbands 6
76
symmetry 1
87

tests/abacus.scf/INPUT.fail

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ suffix ch4fail
44
stru_file STRU.ch4 #the filename of file containing atom positions
55
kpoint_file KPT.ch4 #the name of file containing k points
66
pseudo_dir ./
7-
ntype 2
87
nbands 8
98
#Parameters (Accuracy)
109
ecutwfc 100

tests/abacus.scf/INPUT.ok

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ suffix ch4
44
stru_file STRU.ch4 #the filename of file containing atom positions
55
kpoint_file KPT.ch4 #the name of file containing k points
66
pseudo_dir ./
7-
ntype 2
87
nbands 8
98
#Parameters (Accuracy)
109
ecutwfc 100

0 commit comments

Comments
 (0)