Révision d8d92cfb
b/modules/screening.py | ||
---|---|---|
176 | 176 |
return norm_vec |
177 | 177 |
|
178 | 178 |
|
179 |
def align_molec(molec, ctr_coord, ref_vect): |
|
179 |
def align_molec(orig_molec, ctr_coord, ref_vect):
|
|
180 | 180 |
"""Align a molecule to a vector by a center. |
181 | 181 |
|
182 | 182 |
Given a reference vector to be aligned to and some coordinates acting as |
... | ... | |
188 | 188 |
@param ref_vect: The vector to be aligned with. |
189 | 189 |
@return: ase.Atoms of the aligned molecule |
190 | 190 |
""" |
191 |
from copy import deepcopy |
|
191 | 192 |
from ase import Atom |
192 | 193 |
from ase.neighborlist import natural_cutoffs, neighbor_list |
193 | 194 |
|
195 |
molec = deepcopy(orig_molec) |
|
194 | 196 |
if len(molec) == 1: |
195 | 197 |
err_msg = "Cannot align a single atom" |
196 | 198 |
logger.error(err_msg) |
... | ... | |
532 | 534 |
""" |
533 | 535 |
from copy import deepcopy |
534 | 536 |
slab_ads_list = [] |
535 |
orig_molec = align_molec(orig_molec, ctr_coord, norm_vect)
|
|
537 |
prealigned_molec = align_molec(orig_molec, ctr_coord, norm_vect)
|
|
536 | 538 |
# rotation around z |
537 | 539 |
for alpha in np.arange(0, 360, 360 / num_pts): |
538 | 540 |
# rotation around x' |
539 | 541 |
for beta in np.arange(0, 180, 180 / num_pts): |
540 | 542 |
# rotation around z' |
541 | 543 |
for gamma in np.arange(0, 360, 360 / num_pts): |
542 |
molec = deepcopy(orig_molec)
|
|
544 |
molec = deepcopy(prealigned_molec)
|
|
543 | 545 |
molec.euler_rotate(alpha, beta, gamma, center=ctr_coord) |
544 | 546 |
slab_molec, collision = correct_coll(molec, slab, |
545 | 547 |
ctr_coord, site_coord, |
Formats disponibles : Unified diff