base

The base module for the pCubit package.

class EllipsoidBase(radii=None, **kwargs)

Bases: OrientationBase

The base class for an ellipsoid.

Attributes:
adopted (bool): Whether or not the ellipsoid has been adopted

by an instance of EllipsoidsBase.

property data

The full data of the ellipsoid (location, radii, angles).

Returns:

numpy.ndarray: The ellipsoid data.

get_id()

Get the unique id (the Python object id).

Returns:

int: The unique id.

property name

The name of the ellipsoid, based on the id.

Returns:

str: The name of the ellipsoid.

property radii

The radii of the ellipsoid.

Returns:

numpy.ndarray: The three radii.

property volume

The volume of the ellipsoid.

Returns:

float: The volume.

class EllipsoidsBase

Bases: object

The base class for a set of ellipsoids.

adopt(orphans)

Adopt orphan ellipsoids.

Args:

orphans (EllipsoidBase): A tuple of orphan ellipsoids.

property child_class

The EllipsoidBase class considered to be the child class.

Returns:

EllipsoidBase: The child class.

property children

The adopted instances of EllipsoidBase.

Returns:

tuple: The children.

disown(children)

Disown children ellipsoids.

Args:

children (EllipsoidBase): A tuple of children ellipsoids.

get_data()

Get the data of all children.

Returns:

numpy.ndarray: The data.

get_id()

Get the unique id (the Python object id).

Returns:

int: The unique id.

get_ids()

Get the unique ids (the Python object ids) of all children.

Returns:

list: The unique ids.

property name

The name of the set of ellipsoids, based on the id.

Returns:

str: The name of the set of ellipsoids.

spawn(data=None, **kwargs)

Spawn and automatically adopt ellipsoids.

Args:
  • data (numpy.ndarray): The data for a set of ellipsoids.

  • kwargs (foo): Arbitrary keyword arguments.

    Passed to the constructor for the child class if no data.

class OrientationBase(location=None, angles=None)

Bases: object

The base class for object orientation.

property angles

The Euler angles of the object.

Returns:

numpy.ndarray: The three Euler angles.

property axis_angle

The rotation axis and angle of the object.

Returns:

tuple:

  • (numpy.ndarray) - The three-dimensional rotation axis.

  • (numpy.ndarray) - The angle of rotation about the axis.

property location

The location of the object.

Returns:

numpy.ndarray: The three-dimensional coordinates.

property rotation

The rotation matrix of the object.

Returns:

numpy.ndarray: The three-dimensional rotation matrix.

property vector

The rotation vector of the object.

Returns:

numpy.ndarray: The three-dimensional rotation vector.

class ParticleBase(**kwargs)

Bases: EllipsoidBase

The base class for a particle.

class ParticlesBase(**kwargs)

Bases: EllipsoidsBase

The base class for a set of particles.

property child_class

The ParticleBase class considered to be the child class.

Returns:

ParticleBase: The child class.

class PoreBase(**kwargs)

Bases: EllipsoidBase

The base class for a pore.

class PoresBase(**kwargs)

Bases: EllipsoidsBase

The base class for a set of pores.

property child_class

The PoreBase class considered to be the child class.

Returns:

PoreBase: The child class.