Skip to content

Commit

Permalink
update: add shadowing parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
VsevolodX committed Aug 24, 2024
1 parent 356bad8 commit 88e6ace
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/py/mat3ra/made/tools/modify.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,21 +470,22 @@ def rotate_material(material: Material, axis: List[int], angle: float) -> Materi
return Material(from_ase(atoms))


def passivate_top(material: Material, passivant: str = "H", bond_length=1.0, depth=10):
def passivate_top(material: Material, passivant: str = "H", bond_length=1.0, shadowing_radius: float = 2.5, depth=10):
"""
Passivate the top surface of the material with the specified element.
Args:
material (Material): Material object to passivate.
passivant (str): Element to use for passivation.
bond_length (float): Bond length to use for the passivation in Angstroms.
shadowing_radius (float): Radius for atoms shadowing underlying from passivation in Angstroms.
depth (float): Depth from the top surface to passivate in Angstroms.
Returns:
Material: Material object with the top surface passivated.
"""
new_material = material.clone()
top_atom_indices = get_surface_atoms_indices(material, distance_threshold=2.5, depth=depth)
top_atom_indices = get_surface_atoms_indices(material, distance_threshold=shadowing_radius, depth=depth)
top_atoms = filter_material_by_ids(material, top_atom_indices)
new_material.to_cartesian()
top_atoms.to_cartesian()
Expand Down

0 comments on commit 88e6ace

Please sign in to comment.