core
The core module for the pCubit package.
- class Ellipsoid(**kwargs)
Bases:
EllipsoidBaseThe core class for an ellipsoid.
- Attributes:
placed (bool): Whether or not the ellipsoid has placed in the geometry.
- place(block_id=None)
Places the ellipsoid in an existing geometry.
The ellipsoid is placed by subtracting the portion of any volumes that overlap with the ellipsoid volume. If the ellipsoid is a pore, the ellipsoid volume is then deleted. Otherwise, the ellipsoid volume is added to a new element block.
- Args:
- block_id (int, optional, default=None):
The id for the element block that the ellipsoid will be added to, if not a pore. If an id is not specified, the ellipsoid will be added to a new element block.
- Example:
Place an single particle in a unit cube:
>>> from pcubit import cubit_cmd, cubit_init, Particle >>> cubit_init() >>> cubit_cmd('brick x 1') >>> cubit_cmd('block 1 volume 1') >>> particle = Particle( ... location=[0, 0, 0], ... radii=[0.23, 0.55, 0.3], ... angles=[0, 1, 2] ... ) >>> particle.place()
- class Ellipsoids(**kwargs)
Bases:
EllipsoidsBaseThe core class for a set of ellipsoids.
- class Particles(**kwargs)
Bases:
EllipsoidsThe core class for a set of particles.
- class Pores(**kwargs)
Bases:
EllipsoidsThe core class for a set of pores.
- cubit_cmd(string, silent=True)
Sends arbitrary commands to Cubit, asserting their success.
- Args:
string (str): The command string. silent (bool, optional, default=True): Whether to silence Cubit.
- cubit_init(offscreen_graphics=False)
Starts a instance of Cubit, quietly, with developer settings on.
- Args:
- offscreen_graphics (bool, optional, default=False):
Whether to enable graphics (offscreen) for things like screenshots.