Skip to content

Commit

Permalink
Merge pull request #2577 from jtkrogel/nx_fhi_read
Browse files Browse the repository at this point in the history
Nexus: improve FHI-aims geometry read
  • Loading branch information
ye-luo committed Jul 8, 2020
2 parents 4d8fc0a + 4b60e7b commit 63d0e14
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions nexus/lib/structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -4748,6 +4748,7 @@ def read_fhi_aims(self,filepath):
axes = []
pos = []
elem = []
constrain_relax = []
unit_pos = False
for line in lines:
ls = line.strip()
Expand All @@ -4763,6 +4764,8 @@ def read_fhi_aims(self,filepath):
elif t0=='atom':
pos.append(tokens[1:4])
elem.append(tokens[4])
elif t0=='constrain_relaxation':
constrain_relax.append(tokens[1])
elif t0.startswith('initial'):
None
else:
Expand All @@ -4774,13 +4777,19 @@ def read_fhi_aims(self,filepath):
axes = array(axes,dtype=float)
pos = array(pos,dtype=float)
if unit_pos:
pos = dot(pos,axes)
pos = dot(pos,axes)
#end if
self.dim = 3
self.set_axes(axes)
if len(axes)>0:
self.set_axes(axes)
#end if
self.set_elem(elem)
self.pos = pos
self.units = 'A'
if len(constrain_relax)>0:
constrain_relax = array(constrain_relax)
self.freeze(list(range(self.size())),directions=constrain_relax=='.true.')
#end if
#end def read_fhi_aims


Expand Down

0 comments on commit 63d0e14

Please sign in to comment.