Skip to content

Commit

Permalink
Merge devel into master (#395)
Browse files Browse the repository at this point in the history
  • Loading branch information
amcadmus committed Dec 15, 2022
2 parents 22b3533 + 6b1bb7e commit 2e148f2
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 15 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ The `System` or `LabeledSystem` can be constructed from the following file forma
| Amber | multi | True | True | LabeledSystem | 'amber/md' |
| Amber/sqm | sqm.out | False | False | System | 'sqm/out' |
| Gromacs | gro | True | False | System | 'gromacs/gro' |
| ABACUS | STRU | False | False | System | 'abacus/stru' |
| ABACUS | STRU | False | True | LabeledSystem | 'abacus/scf' |
| ABACUS | cif | True | True | LabeledSystem | 'abacus/md' |
| ABACUS | STRU | True | True | LabeledSystem | 'abacus/relax' |
Expand Down
10 changes: 2 additions & 8 deletions dpdata/abacus/scf.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,15 @@ def get_cell(geometry_inlines):
cell = celldm*np.array(cell)
return celldm, cell

def get_coords(celldm, cell, geometry_inlines, inlines):
def get_coords(celldm, cell, geometry_inlines, inlines=None):
coords_lines = get_block(geometry_inlines, "ATOMIC_POSITIONS", skip=0)
# assuming that ATOMIC_POSITIONS is at the bottom of the STRU file
coord_type = coords_lines[0].split()[0].lower() # cartisan or direct
atom_names = [] # element abbr in periodic table
atom_types = [] # index of atom_names of each atom in the geometry
atom_numbs = [] # of atoms for each element
coords = [] # coordinations of atoms
ntype = 0
for line in inlines:
if "ntype" in line and "ntype"==line.split()[0]:
ntype = int(line.split()[1])
break
if ntype <= 0:
raise RuntimeError('ntype cannot be found in INPUT file.')
ntype = get_nele_from_stru(geometry_inlines)
line_idx = 1 # starting line of first element
for it in range(ntype):
atom_names.append(coords_lines[line_idx].split()[0])
Expand Down
3 changes: 1 addition & 2 deletions tests/abacus.md.nostress/INPUT
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
INPUT_PARAMETERS
#Parameters (General)
suffix autotest
pseudo_dir ./
ntype 1
pseudo_dir ./
nbands 8
calculation md

Expand Down
1 change: 0 additions & 1 deletion tests/abacus.md.unconv/INPUT
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
INPUT_PARAMETERS
calculation md
ntype 2
nbands 8

ecutwfc 50.000000
Expand Down
1 change: 0 additions & 1 deletion tests/abacus.md/INPUT
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ INPUT_PARAMETERS
#Parameters (1.General)
suffix abacus
calculation md
ntype 2
nbands 6
symmetry 0

Expand Down
1 change: 0 additions & 1 deletion tests/abacus.relax/INPUT
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ INPUT_PARAMETERS
#Parameters (1.General)
suffix abacus
calculation cell-relax
ntype 2
nbands 6
symmetry 1

Expand Down
1 change: 0 additions & 1 deletion tests/abacus.scf/INPUT.fail
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ suffix ch4fail
stru_file STRU.ch4 #the filename of file containing atom positions
kpoint_file KPT.ch4 #the name of file containing k points
pseudo_dir ./
ntype 2
nbands 8
#Parameters (Accuracy)
ecutwfc 100
Expand Down
1 change: 0 additions & 1 deletion tests/abacus.scf/INPUT.ok
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ suffix ch4
stru_file STRU.ch4 #the filename of file containing atom positions
kpoint_file KPT.ch4 #the name of file containing k points
pseudo_dir ./
ntype 2
nbands 8
#Parameters (Accuracy)
ecutwfc 100
Expand Down

0 comments on commit 2e148f2

Please sign in to comment.