Seed(seed_geometry, phase=0, breakdown=None, position=None)¶
The Seed class contains the information about a single seed in the mesh. These seeds have a geometry (from
microstructpy.geometry), a phase number, a breakdown, and a position.
microstructpy.geometry) – The geometry of the seed.
phase (int) – (optional) The phase number of the seed. Defaults to 0.
(optional) The circle/sphere approximation of this grain. The format for this input is:
# x y r breakdown_2D = [( 2, 3, 1), ( 0, 0, 4), (-2, 4, 8)] # x y z r breakdown_3D = [( 3, -1, 2, 1), ( 0, 2, -1, 1)]
The default behavior is to call the
approximate()function of the geometry.
factory(seed_type, phase=0, breakdown=None, position=None, **kwargs)¶
Factory method for seeds
This function returns a seed based on the seed type and keyword arguments associated with that type. The currently supported types are:
If the seed_type is not on this list, an error is thrown.
seed_type (str) – type of seed, from list above.
phase (int) – (optional) Material phase number of seed. Defaults to 0.
(optional) List of circles or spheres that approximate the geometry. The list should be formatted as follows:
breakdown = [(x1, y1, z1, r1), (x2, y2, z2, r2), ...]
The breakdown will be automatically generated if not provided.
**kwargs – Keyword arguments that define the size, shape, etc of the seed geometry.
An instance of the class.
- Return type
Create seed from a string.
This method creates a seed particle from a string representation. This is used when reading in seeds from a file.
Plot the seed
This function plots the geometry of the seed. The keyword arguments are passed through to matplotlib. See the plot methods in
microstructpy.geometryfor more details.
**kwargs – Plotting keyword arguments.
Plot breakdown of seed
This function plots the circle/sphere breakdown of the seed. In 2D, this adds a
matplotlib.collections.PatchCollectionto the current axes.
**kwargs – Matplotlib keyword arguments.
Position of the seed
This is the location of the seed center.
If the breakdown of the seed has been populated, the setter function will update the position of the center and translate the breakdown circles/spheres.