lammpsio.Angles

class lammpsio.Angles(N, num_types=None)

Angle connections between particles.

All values of indexes follow the LAMMPS 1-indexed convention, but the arrays themselves are 0-indexed.

Parameters:
  • N (int) – Number of angles.

  • num_types (int) – Number of angle types. Default of None means the number of types is determined from the unique typeids.

Example

Create angles:

angles = lammpsio.topology.Angles(N=3, num_types=1)
angles.id = [1, 2, 3]
angles.typeid = [1, 1, 1]
angles.members = [[1, 2, 3], [2, 3, 1], [3, 1, 2]]

This creates a molecule with three angles of the same type. The angles are defined between particles IDs 1-2-3, 2-3-1, and 3-1-2 to form a triangle structure.

Methods:

has_id()

Check if configuration has connection IDs.

has_members()

Check if configuration has connection members.

has_typeid()

Check if configuration has connection typeids.

reorder(order[, check_order])

Reorder the connections in place.

Attributes:

N

Number of connections.

id

Unique identifiers (IDs).

members

Connection members.

num_types

Number of connection types.

type_label

Labels of connection type IDs.

typeid

Connection type IDs.

property N

Number of connections.

Type:

int

has_id()

Check if configuration has connection IDs.

Returns:

True if connection IDs have been initialized.

Return type:

bool

has_members()

Check if configuration has connection members.

Returns:

True if particle members have been initialized.

Return type:

bool

has_typeid()

Check if configuration has connection typeids.

Returns:

True if connection typeids have been initialized.

Return type:

bool

property id

Unique identifiers (IDs).

The default value on initialization runs from 1 to N.

Type:

(N,) numpy.ndarray of int

property members

Connection members.

The default value on initialization is 1 for all entries. M is the number of members in the connection.

Type:

(N, M) numpy.ndarray of int

property num_types

Number of connection types.

Type:

int

reorder(order, check_order=True)

Reorder the connections in place.

Parameters:
  • order (list) – New order of indexes.

  • check_order (bool) – If True, validate the new order before applying it.

property type_label

Labels of connection type IDs.

Type:

LabelMap

property typeid

Connection type IDs.

The default value on initialization is 1 for all entries.

Type:

(N,) numpy.ndarray of int