You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Heyhey,
I don't know, if this function is still in use, but:
The helperfunction rascal.neighbourlist.structure_manager.sanitize_non_periodic_structure is intended to wrap nonperiodic structures and calculate lattice cell vectors for a unit cell that wraps up the whole molecule, but then does not update the cell parameters.
defsanitize_non_periodic_structure(structure):
""" Rascal expects a unit cell that contains all the atoms even if the structure is not periodic. If the cell is set to 0 and the structure is not periodic then it is adapted to contain the atoms and the atoms are shifted inside the unit cell. Parameters ---------- structure : a valid structure as per is_valid_structure Returns ------- a valid structure as per is_valid_structure cell and positions have been modified if structure is not periodic """ifnp.all(structure["pbc"] ==0):
cell=structure["cell"]
ifnp.allclose(cell, np.zeros((3, 3))):
pos=structure["positions"]
bounds=np.array([pos.min(axis=1), pos.max(axis=1)])
bounding_box_lengths= (bounds[1] -bounds[0]) *1.05print(bounding_box_lengths)
new_cell=np.diag(bounding_box_lengths)
CoM=pos.mean(axis=1)
disp=0.5*bounding_box_lengths-CoMnew_pos=pos+disp[:, None]
structure["positions"] =new_pos#update cell parameters herereturnstructure
The text was updated successfully, but these errors were encountered:
Heyhey,
I don't know, if this function is still in use, but:
The helperfunction rascal.neighbourlist.structure_manager.sanitize_non_periodic_structure is intended to wrap nonperiodic structures and calculate lattice cell vectors for a unit cell that wraps up the whole molecule, but then does not update the cell parameters.
The text was updated successfully, but these errors were encountered: