-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. Update definition for input parameters
2. Update code to handle both single and multi-phase inputs 3. Add unit test for 2 phase example 4. Add example for 2 phase material
- Loading branch information
Showing
3 changed files
with
173 additions
and
14 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
docs/source/examples/example_polycrystal_from_odf_2phases.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import numpy as np | ||
from xrd_simulator.templates import polycrystal_from_odf | ||
|
||
|
||
# uniform orientation distribution function. | ||
def ODF(x, q): return 1. / (np.pi**2) | ||
|
||
|
||
number_of_crystals = 500 | ||
bounding_height = 50.0 | ||
bounding_radius = 25.0 | ||
unit_cell = [[3.579, 3.579, 3.579, 90., 90., 90.0], | ||
[5.46745, 5.46745, 5.46745, 90., 90., 90.0]] | ||
sgname = ['F432', 'F432'] | ||
max_bin = np.radians(10.0) | ||
path_to_cif_file = None | ||
|
||
def strain_tensor(x): return np.array([[0, 0, 0.02 * x[2] / bounding_height], | ||
[0, 0, 0], | ||
[0, 0, 0]]) # Linear strain gradient along rotation axis. | ||
|
||
|
||
polycrystal = polycrystal_from_odf(ODF, | ||
number_of_crystals, | ||
bounding_height, | ||
bounding_radius, | ||
unit_cell, | ||
sgname, | ||
path_to_cif_file, | ||
max_bin, | ||
strain_tensor) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters