data.oc.utils.geometry#

Classes#

Geometry

Base class for geometries

PlaneBoundTriclinicGeometry

Triclinic crystal geometry based on ase.Atom cell

BoxGeometry

Box geometry for orthorhombic cells.

Module Contents#

class data.oc.utils.geometry.Geometry#

Bases: abc.ABC

Base class for geometries

static distance_point_plane(vec: numpy.array, point_plane: numpy.array, point_ext: numpy.array)#

Returns the (shortest) distance between a plane with normal vector ‘vec’ through point ‘point_plane’ and a point ‘point_ext’.

Parameters:
  • vec (np.array) – normal vector of plane

  • point_plane (np.array) – point on line

  • point_ext (np.array) – external point(s)

Returns:

(np.array) Distance between plane and external point(s)

static vec_and_point_to_plane(vec: numpy.array, point: numpy.array)#

Returns the (unique) plane, given a normal vector ‘vec’ and a point ‘point’ in the plane. ax + by + cz - d = 0

Parameters:
  • vec (np.array) – normal vector of plane

  • point (np.array) – point in plane

Returns:

(np.array) Paramterization of plane

static cell2planes(cell: ase.cell.Cell, pbc: float)#

Get the parameterization of the sizes of a ase.Atom cell

cell: ase.cell.Cell pbc (float): shift of boundaries to be used with periodic boundary condition

Return

(List[np.array]) Parameterization of cell plane sides

3 planes intersect the origin by ase design.

static extract_box_properties(center: numpy.array, length: numpy.array, lo_corner: numpy.array, hi_corner: numpy.array)#

Given two of the properties ‘center’, ‘length’, ‘lo_corner’, ‘hi_corner’, return all the properties. The properties that are not given are expected to be ‘None’.

abstract packmol_structure(filename: str, number: int, side: str)#

How to write packmol input file. To be defined by inherited class.

class data.oc.utils.geometry.PlaneBoundTriclinicGeometry(cell: ase.cell.Cell, pbc: float = 0.0)#

Bases: Geometry

Triclinic crystal geometry based on ase.Atom cell

planes#
cell#
ll_corner = [0, 0, 0]#
ur_corner#
packmol_structure(filename: str, number: int, side: str)#

Make file structure to be used in packmol input script

Parameters:
  • filename (str) – output filename to save structure

  • number (int) – number of solvent molecules

  • side (str) – pack solvent inside/outside of geometry

Returns:

String with information about the structure

class data.oc.utils.geometry.BoxGeometry(center=None, length=None, lo_corner=None, hi_corner=None, **kwargs)#

Bases: Geometry

Box geometry for orthorhombic cells.

params#
length#
__repr__()#
packmol_structure(filename: str, number: int, side: str)#

Make file structure to be used in packmol input script

Parameters:
  • filename (str) – output filename to save structure

  • number (int) – number of solvent molecules

  • side (str) – pack solvent inside/outside of geometry

Returns:

String with information about the structure