@@ -23,22 +23,23 @@ def _setup(self, *args, **kwargs):
2323 self ._scale = 1.
2424
2525 @sile_fh_open ()
26- def write_geometry (self , geometry , fixed = False ):
26+ def write_geometry (self , geometry , dynamic = True ):
2727 r""" Writes the geometry to the contained file
2828
2929 Parameters
3030 ----------
3131 geometry : Geometry
3232 geometry to be written to the file
33- fixed : bool or list, optional
34- define which atoms to be fixed in the VASP run
33+ dynamic : bool or list, optional
34+ define which atoms are dynamic in the VASP run (default is True,
35+ which means all atoms are dynamic)
3536
3637 Examples
3738 --------
3839 >>> car = carSileVASP('POSCAR', 'w')
3940 >>> geom = geom.graphene()
40- >>> geom.write(car, fixed =False) # fix none
41- >>> geom.write(car, fixed=[True, ( False, True, False)]) # fix 1st and y coordinate of 2nd
41+ >>> geom.write(car, dynamic =False) # fix all atoms
42+ >>> geom.write(car, dynamic=[ False, ( True, False, True )]) # fix 1st and y coordinate of 2nd
4243 """
4344 # Check that we can write to the file
4445 sile_raise_write (self )
@@ -80,8 +81,8 @@ def write_geometry(self, geometry, fixed=False):
8081 self ._write ('Selective dynamics\n ' )
8182 self ._write ('Cartesian\n ' )
8283
83- if isinstance (fixed , bool ):
84- fixed = [fixed ] * len (geometry )
84+ if isinstance (dynamic , bool ):
85+ dynamic = [dynamic ] * len (geometry )
8586
8687 b2s = {True : 'T' , False : 'F' }
8788 def todyn (fix ):
@@ -91,7 +92,7 @@ def todyn(fix):
9192
9293 fmt = '{:18.9f} ' * 3
9394 for ia in geometry :
94- self ._write (fmt .format (* geometry .xyz [ia , :]) + todyn (fixed [ia ]))
95+ self ._write (fmt .format (* geometry .xyz [ia , :]) + todyn (dynamic [ia ]))
9596
9697 @sile_fh_open (True )
9798 def read_supercell (self ):
@@ -111,15 +112,15 @@ def read_supercell(self):
111112 return SuperCell (cell )
112113
113114 @sile_fh_open ()
114- def read_geometry (self , ret_fixed = False ):
115+ def read_geometry (self , ret_dynamic = False ):
115116 r""" Returns Geometry object from the CONTCAR/POSCAR file
116117
117118 Possibly also return the dynamics (if present)
118119
119120 Parameters
120121 ----------
121- ret_fixed : bool, optional
122- also read selective dynamics (if present), if not, a list of False will be returned
122+ ret_dynamic : bool, optional
123+ also read selective dynamics (if present), if not, a list of True will be returned
123124 """
124125 sc = self .read_supercell ()
125126
@@ -163,15 +164,15 @@ def read_geometry(self, ret_fixed=False):
163164
164165 # Number of atoms
165166 na = len (atom )
166- # pre-create the fixed list
167- fixed = [[False ] * 3 ] * na
167+ # pre-create the dynamic list
168+ dynamic = [[False ] * 3 ] * na
168169
169170 xyz = _a .emptyd ([na , 3 ])
170171 for ia in range (na ):
171172 line = self .readline ().split ()
172173 xyz [ia , :] = list (map (float , line [:3 ]))
173174 if dynamics :
174- fixed [ia ] = list (map (lambda x : x .lower () == 't' , line [3 :6 ]))
175+ dynamic [ia ] = list (map (lambda x : x .lower () == 't' , line [3 :6 ]))
175176
176177 if cart :
177178 # The unit of the coordinates are cartesian
@@ -181,8 +182,8 @@ def read_geometry(self, ret_fixed=False):
181182
182183 # The POT/CONT-CAR does not contain information on the atomic species
183184 geom = Geometry (xyz = xyz , atom = atom , sc = sc )
184- if ret_fixed :
185- return geom , np .array (fixed , dtype = np .bool_ )
185+ if ret_dynamic :
186+ return geom , np .array (dynamic , dtype = np .bool_ )
186187 return geom
187188
188189 def ArgumentParser (self , p = None , * args , ** kwargs ):
0 commit comments