adsorpy.molecule_lib module¶
Contains all the molecules that can be used in this simulation.
Also includes molecule loader scripts, for which the molecule data is not included in this lib. You need to supply your own .xyz files, or you can use preconfigured simple shapes.
- adsorpy.molecule_lib.discorectangle(params, offx=0.0, offy=0.0)[source]¶
Create a discorectangle using the union of two circles and a rectangle.
The circles are automatically approximated using linear segments (error of 1% or less).
- adsorpy.molecule_lib.circulium(radius, x_offset=0.0, y_offset=0.0, quad_segs=8)[source]¶
Create a simple circular polygon.
The circles are automatically approximated using linear segments (error of 1% or less).
- adsorpy.molecule_lib.dogbonium(scale=1)[source]¶
Make a molecule shaped like a bone. Used as a pathological case.
- Parameters:
scale (
float) – scale of the shape.- Return type:
Polygon- Returns:
The molecule shape as a polygon.
- adsorpy.molecule_lib.polygonium(verts=3, scale=1.0, roundedness=0.0)[source]¶
Create a simple regular polygon with optional rounding.
- adsorpy.molecule_lib.xyz_reader(file_name, ignore_atoms=None, x_offset=0.0, y_offset=0.0, roll=0.0, pitch=0.0, yaw=0.0, z_trim=None)[source]¶
Read files in the xyz format of VASP.
- Parameters:
file_name (
str|Path) – The name of the file, including the .xyz extension. Include the path.ignore_atoms (
str|list[str] |None) – Atoms to ignore when making the molecule. Useful if the slab is empty.x_offset (
float) – The offset in the x direction.y_offset (
float) – The offset in the x direction.yaw (
float) – Rotation along the x-axis.pitch (
float) – Rotation along the y-axis.roll (
float) – Rotation along the z-axis.z_trim (
float|None) – The z value below which all molecules are removed.
- Return type:
Polygon- Returns:
The molecule polygon read from the xyz file.
- adsorpy.molecule_lib.first_time_loader(file_name, ignore_atoms=None, x_offset=None, y_offset=None, roll=None, pitch=None, yaw=None, z_trim=None, reference_lattice_spacing=4.74)[source]¶
Script to run when you first load the molecule. Shows the molecule in xy, zy, and xz perspective, and vdwaals.
Can be used to rotate the molecule until satisfied, and will print a string that can be used for the xyz reader.
- Parameters:
- Return type:
- Returns:
The updated dict of parameters after rotation and translation.
- adsorpy.molecule_lib._update(val, ang_x, ang_y, ang_z, translate_x, translate_y, box_x, box_y, box_z, box_xoff, box_yoff, atompos, axs, fig, atomcolours, atomkeys, reference_lattice_spacing)[source]¶
- Return type:
- adsorpy.molecule_lib._initialise_reader(file_name, ignore_atoms=None, z_trim=None)[source]¶
Initialise the xyz_reader and first_time_loader.