Révision f16ebc80
b/modules/screening.py | ||
---|---|---|
199 | 199 |
# Check if ctr_coord are the coordinates of an atom and if not creates a |
200 | 200 |
# dummy one to extract the neighboring atoms. |
201 | 201 |
ctr_idx = None |
202 |
dummy_atom = False |
|
202 | 203 |
for atom in molec: |
203 | 204 |
if np.allclose(ctr_coord, atom.position, rtol=1e-2): |
204 | 205 |
ctr_idx = atom.index |
... | ... | |
207 | 208 |
molec.append(Atom('X', position=ctr_coord)) |
208 | 209 |
cutoffs.append(0.2) |
209 | 210 |
ctr_idx = len(molec) - 1 |
211 |
dummy_atom = True |
|
210 | 212 |
# Builds the neighbors and computes the average vector |
211 | 213 |
refs, vects = neighbor_list("iD", molec, cutoffs, self_interaction=False) |
212 | 214 |
neigh_vects = [vects[i] for i, atm in enumerate(refs) if atm == ctr_idx] |
... | ... | |
242 | 244 |
rot_vect = np.cross(ref_vect, axis) |
243 | 245 |
rot_angle = -get_vect_angle(ref_vect, target_vect, rot_vect) |
244 | 246 |
molec.rotate(rot_angle, rot_vect, ctr_coord) |
245 |
del molec[molec.symbols == 'X'] |
|
247 |
if dummy_atom: |
|
248 |
del molec[-1] |
|
246 | 249 |
return molec |
247 | 250 |
|
248 | 251 |
|
Formats disponibles : Unified diff