@@ -35,15 +35,15 @@ def expandStructureConstraints(S, clists):
3535
3636
3737
38- Snew = expandStructure (S )
3938 # Get the exact operations applied to get Snew
4039 symoplists = getEssentialOperations (S )
40+ Snew = expandStructure (S , symoplists )
4141
4242 # Create the new constraints list.
4343 cnew = []
44- # In order to update the space group equations, we have to apply the
45- # rotation and translation operators of the essential symmetry operations to
46- # the constraint equations. The u values and occ values don't change.
44+ # In order to update the constraint equations, apply the rotation and
45+ # translation operators of the essential symmetry operations. The u values
46+ # and occ values don't change.
4747 anum = 0 # keep track of which of the new atoms we're dealing with
4848 for i in range (len (S )):
4949 symops = symoplists [i ]
@@ -120,14 +120,18 @@ def getEssentialOperations(S):
120120
121121 return symoplists
122122
123- def expandStructure (S ):
123+ def expandStructure (S , symoplists = None ):
124124 """Expand the structure based upon its space group.
125125
126- S -- A structure to expand
126+ S -- A structure to expand
127+ symopilsts -- A list of symmetry operations to be applied by each atom. If
128+ symoplist is None (default), this is generated from the
129+ space group.
127130
128131 Returns a new Structure object.
129132 """
130- symoplists = getEssentialOperations (S )
133+ if symoplists is None :
134+ symoplists = getEssentialOperations (S )
131135 # Want a new instance of whatever 'S' is. It may be a PDFStructure
132136 # object.
133137 Snew = copy .deepcopy (S )
0 commit comments