GrowthSetup
GrowthSetup
A class for generating simulation starting states by a growth + impingement algorithm. This algorithm can be summarized as follows:
- Random sites are selected in the strucure and assigned phases in the ratios specified.
- A simulation is run in which unassigned cells adopt the phase of their occupied neighbors, allowing particles to "grow" outward into unoccupied space until they impinge on one another.
Source code in pylattica/structures/square_grid/growth_setup.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
|
__init__(phase_set, dim=2)
Instantiates the GrowthSetup object.
Parameters
PhaseSet
The phases to be used in the growth process.
int, optional
The dimension of the desired simulation., by default 2
Source code in pylattica/structures/square_grid/growth_setup.py
21 22 23 24 25 26 27 28 29 30 31 32 |
|
grow(size, num_sites_desired, background_spec, nuc_amts, nb_builder, buffer=2)
Runs the growth simulation and produces a starting state.
Parameters
int
The size of the desired simulation.
int
The number of nucleation sites for growing particles.
str
The background species.
Dict[str, float]
A mapping of phase names to their relative desired amounts.
NeighborhoodBuilder
The NeighborhoodBuilder to use to identify the growth environment for each particle.
int, optional
The minimum distance between seed sites, by default 2
Returns
Simulation The resulting Simulation.
Source code in pylattica/structures/square_grid/growth_setup.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
|