pysimm.calc

Module Contents

Functions

intersection(line1, line2)

pysimm.calc.intersection

find_rotation(a, b)

pysimm.calc.find_rotation

rotate_vector(x, y, z, theta_x=None, theta_y=None, theta_z=None)

pysimm.calc.rotate_vector

distance(p1, p2)

pysimm.calc.distance

angle(p1, p2, p3, radians=False)

pysimm.calc.angle

dihedral(p1, p2, p3, p4, radians=False)

chiral_angle(a, b, c, d)

pysimm.calc.chiral_angle

tacticity(s, a_tag=None, b_tag=None, c_tag=None, d_tag=None, offset=None, return_angles=True, unwrap=True, rewrap=True, skip_first=False)

pysimm.calc.tacticity

frac_free_volume(v_sp, v_void)

pysimm.calc.frac_free_volume

pbc_distance(s, p1, p2)

pysimm.calc.pbc_distance

LJ_12_6(pt, d)

LJ_9_6(pt, d)

buckingham(pt, d)

harmonic_bond(bt, d)

class2_bond(bt, d)

harmonic_angle(at, d)

class2_angle(at, d)

harmonic_dihedral(dt, d)

class2_dihedral(dt, d)

opls_dihedral(dt, d)

fourier_dihedral(dt, d)

harmonic_improper(it, d)

cvff_improper(it, d)

umbrella_improper(it, d)

Attributes

np

pysimm.calc.np[source]
pysimm.calc.intersection(line1, line2)[source]

pysimm.calc.intersection

Finds intersection between two 2D lines given by two sets of points

Parameters
  • line1 – [[x1,y1], [x2,y2]] for line 1

  • line2 – [[x1,y1], [x2,y2]] for line 2

Returns

x,y intersection point

pysimm.calc.find_rotation(a, b)[source]

pysimm.calc.find_rotation

Finds rotation vector required to align vector a and vector b

Parameters
  • a – 3D vector [x,y,z]

  • b – 3D vector [x,y,z]

Returns

rotation matrix

pysimm.calc.rotate_vector(x, y, z, theta_x=None, theta_y=None, theta_z=None)[source]

pysimm.calc.rotate_vector

Rotates 3d vector around x-axis, y-axis and z-axis given by user defined angles

Parameters
  • x – x vector component

  • y – y vector component

  • z – z vector component

  • theta_x – angle to rotate vector around x axis

  • theta_y – angle to rotate vector around y axis

  • theta_z – angle to rotate vector around z axis

Returns

new vector [x,y,z]

pysimm.calc.distance(p1, p2)[source]

pysimm.calc.distance

Finds distance between two Particle objects. Simply calculates length of vector between particle coordinates and does not consider periodic boundary conditions.

Parameters
Returns

distance between particles

pysimm.calc.angle(p1, p2, p3, radians=False)[source]

pysimm.calc.angle

Finds angle between three Particle objects. Does not consider periodic boundary conditions.

Parameters
  • p1 – pysimm.system.Particle

  • p2 – pysimm.system.Particle

  • p3 – pysimm.system.Particle

  • radians – returns value in radians if True (False)

Returns

angle between particles

pysimm.calc.dihedral(p1, p2, p3, p4, radians=False)[source]
pysimm.calc.chiral_angle(a, b, c, d)[source]

pysimm.calc.chiral_angle

Finds chiral angle between four Particle objects. Chiral angle is defined as the angle between the vector resulting from vec(a->c) X vec(a->d) and vec(a->b). Used to help define tacticity where backbone follow b’–a–b and c and d are side groups.

b’–a–b

/ c d

Parameters
  • a – pysimm.system.Particle

  • b – pysimm.system.Particle

  • c – pysimm.system.Particle

  • d – pysimm.system.Particle

Returns

chiral angle

pysimm.calc.tacticity(s, a_tag=None, b_tag=None, c_tag=None, d_tag=None, offset=None, return_angles=True, unwrap=True, rewrap=True, skip_first=False)[source]

pysimm.calc.tacticity

Determines tacticity for polymer chain. Iterates through groups of four patricles given by X_tags, using offset. This assumes equivalent atoms in each group of four are perfectly offset.

Parameters
  • sSystem

  • a_tag – tag of first a particle

  • b_tag – tag of first b particle

  • c_tag – tag of first c particle

  • d_tag – tag of first d particle

  • offset – offset of particle tags (monomer repeat atomic count)

  • return_angles – if True return chiral angles of all monomers

  • unwrap – True to perform unwrap before calculation (REQUIRED before calculation, but not required in this

  • function)

  • rewrap – True to rewrap system after calculation

  • skip_first – True to skip first monomer (sometime chirality is poorly defined for thsi monomer)

Returns

tacticity or tacticity, [chiral_angles]

pysimm.calc.frac_free_volume(v_sp, v_void)[source]

pysimm.calc.frac_free_volume

Determines fractional free volume for a poroous system.

Parameters
  • v_sp – specific volume

  • v_void – void volume

Returns

fractional free volume

pysimm.calc.pbc_distance(s, p1, p2)[source]

pysimm.calc.pbc_distance

Calculates distance between particles using PBC

Parameters
Returns

distance between particles

pysimm.calc.LJ_12_6(pt, d)[source]
pysimm.calc.LJ_9_6(pt, d)[source]
pysimm.calc.buckingham(pt, d)[source]
pysimm.calc.harmonic_bond(bt, d)[source]
pysimm.calc.class2_bond(bt, d)[source]
pysimm.calc.harmonic_angle(at, d)[source]
pysimm.calc.class2_angle(at, d)[source]
pysimm.calc.harmonic_dihedral(dt, d)[source]
pysimm.calc.class2_dihedral(dt, d)[source]
pysimm.calc.opls_dihedral(dt, d)[source]
pysimm.calc.fourier_dihedral(dt, d)[source]
pysimm.calc.harmonic_improper(it, d)[source]
pysimm.calc.cvff_improper(it, d)[source]
pysimm.calc.umbrella_improper(it, d)[source]