Initializing 3D Phases with 2 or 3 species
Functions to help set the value of fields
- fieldkit.initialize.initialize_phase(phase, npw, h)[source]
Creates a list of Field objects for 3D phases with 2 or 3 species.
Adapted from FTS-tools/field/init_fields_3d_2spec.py and from FTS-tools/fields/ini_fields_3d_3spec.py. 2 species 3D phases implemented in this function: A15. C15, double-gyroid, single-diamond 3 species 3D phases implemented in this function: alt- diamond, alt-C15.
- Parameters:
phase – name of the phase (see description above for phases implemented in this function)
npw – number of grid points for each dimension
h – a cell tensor, in which the columns are box vectors that describe the coordinate system
- Returns:
list of Field objects, each object for each species.
- Return type:
field_list
- Raises:
NotImplementedError – if phase is not a phases implemented in this function (see description above), the function will exit.
Example
The following example outputs vtk files for Field objects created by the initialize_phase function.:
import numpy as np
#parameters
npw = (32,32,32)
h = np.eye(3) * 2
field = fk.initialize_phase("A15", npw, h)
fk.write_to_VTK("A15.vtk", field)
new_field = fk.initialize_phase("alt-C15", npw, h)
fk.write_to_VTK("alt-C15.vtk", new_field)
Output
Data from A15.vtk plotted in Paraview
Data from alt-C15.vtk plotted in Paraview