Elasticipy.crystal_texture
- class elasticipy.crystal_texture.CompositeTexture(texture_list)[source]
Bases:
objectCreate a mix of crystal textures
- Parameters:
texture_list (list of CrystalTexture) – List of crystal textures to mix
- mean_tensor(tensor)[source]
Compute the weighted average of a tensor, considering each texture component separately.
- Parameters:
tensor (FourthOrderTensor) – Reference tensor (unrotated)
- Return type:
Examples
Let consider a mixture of Goss and fibre tensor (with phi1=0 and phi2=0):
>>> from elasticipy.crystal_texture import DiscreteTexture, FibreTexture >>> from elasticipy.tensors.elasticity import StiffnessTensor >>> t = DiscreteTexture.Goss() + FibreTexture.from_Euler(phi1=0.0, phi2=0.0) >>> t Mixture of crystallographic textures Wgt. Type Component ------------------------------------------------------------ 1.00 discrete φ1=0.00°, ϕ=45.00°, φ2=0.00° 1.00 fibre φ1= 0.0°, φ2= 0.0°
Then, assume that the stiffness tensor is defined as follows:
>>> C = StiffnessTensor.cubic(C11=186, C12=134, C44=77) # mp-30
The ODF-weighted Voigt average can be computed as follows:
>>> Cvoigt = t.mean_tensor(C) >>> Cvoigt Stiffness tensor (in Voigt mapping): [[ 1.86000000e+02 1.34000000e+02 1.34000000e+02 0.00000000e+00 0.00000000e+00 0.00000000e+00] [ 1.34000000e+02 2.24250000e+02 9.57500000e+01 6.96664948e-15 0.00000000e+00 0.00000000e+00] [ 1.34000000e+02 9.57500000e+01 2.24250000e+02 -2.83236976e-15 0.00000000e+00 0.00000000e+00] [ 0.00000000e+00 2.85362012e-16 8.15320034e-17 2.58750000e+01 0.00000000e+00 0.00000000e+00] [ 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 5.77500000e+01 -5.48414542e-17] [ 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 5.48414542e-17 5.77500000e+01]]
Alternatively, on can directly use the following syntax:
>>> Cvoigt = C * t
- plot_as_pole_figure(miller, fig=None, ax=None, projection='lambert')[source]
Plot the pole figure of the composite texture, given a set of Miller indices
- Parameters:
miller (orix.vector.miller.Miller) – Miller indices of directions/planes to plot
projection (str, optional) – Type of projection to use, it can be either stereographic or Lambert
fig (matplotlib.figure.Figure, optional) – Handle to existing figure, if needed
ax (matplotlib.projections.polar.PolarAxes, optional) – Axes to plot on
kwargs – Keyword arguments to pass to matplotlib’s scatter/plot functions
- Returns:
matplotlib.figure.Figure – Handle to figure
matplotlib.projections.polar.PolarAxes – Axes where the pole figure is plotted
Examples
Create a mixture of uniform of gamma and alpha fibre texture, and plot the corresponding [1,0,0] pole figure:
from elasticipy.crystal_texture import FibreTexture from orix.vector import Miller from orix.crystal_map import Phase texture = FibreTexture.alpha() + FibreTexture.gamma() phase = Phase(point_group='m3m') miller = Miller([1,1,0], phase=phase) texture.plot_as_pole_figure(miller)
- sample(num=50, seed=None)[source]
Generate a random sample of orientations from the composite texture.
- Parameters:
num (int, optional) – Number of orientations to generate
seed (int, optional) – Seed for random number generator
- Returns:
Random orientations from the given texture
- Return type:
orix.quaternion.Orientation
Examples
Create a balanced mixture of Goss and Brass texture:
>>> from elasticipy.crystal_texture import DiscreteTexture >>> goss = DiscreteTexture.Goss() >>> brass = DiscreteTexture.brass() >>> texture = goss + brass >>> print(texture) Mixture of crystallographic textures Wgt. Type Component ------------------------------------------------------------ 1.00 discrete φ1=0.00°, ϕ=45.00°, φ2=0.00° 1.00 discrete φ1=35.26°, ϕ=45.00°, φ2=0.00°
Now generate a set of 1000 orientations from this texture:
>>> o = texture.sample(num=1000, seed=123) # Use seed to ensure reproducibility
One can check that around 50% of these orientations correspond to that of Goss:
>>> np.count_nonzero((o * ~goss.orientation).angle == 0.) 530
whereas all the other orientations correspond to brass:
>>> np.count_nonzero((o * ~brass.orientation).angle == 0.) 470
- class elasticipy.crystal_texture.CrystalTexture[source]
Bases:
ABC- mean_tensor(tensor)[source]
Perform the texture-weighted mean of a 4th-order tensor.
- Parameters:
tensor (SymmetricFourthOrderTensor) – Reference tensor (unrotated)
- Returns:
mean value of the rotated tensor
- Return type:
- plot_as_pole_figure(miller, projection='lambert', fig=None, ax=None, **kwargs)[source]
Plot the pole figure of the crystallographic texture
- Parameters:
miller (orix.vector.miller.Miller) – Miller indices of directions/planes to plot
projection (str, optional) – Type of projection to use, it can be either stereographic or Lambert
fig (matplotlib.figure.Figure, optional) – Handle to existing figure, if needed
ax (matplotlib.projections.polar.PolarAxes, optional) – Axes to plot on
kwargs – Keyword arguments to pass to matplotlib’s scatter/plot functions
- Returns:
matplotlib.figure.Figure – Handle to figure
matplotlib.projections.polar.PolarAxes – Axes where the pole figure is plotted
Examples
Plot the [100] pole figure of Goss texture:
from elasticipy.crystal_texture import DiscreteTexture from orix.vector import Miller from orix.crystal_map import Phase goss = DiscreteTexture.Goss() phase = Phase(point_group='m3m') # BCC symmetry miller = Miller([1,0,0], phase=phase) goss.plot_as_pole_figure(miller.symmetrise(unique=True))
Plot the [110] pole figure of the gamma fibre texture:
from elasticipy.crystal_texture import FibreTexture from orix.vector import Miller from orix.crystal_map import Phase gamma = FibreTexture.gamma() phase = Phase(point_group='m3m') # BCC symmetry miller = Miller([1,1,0], phase=phase) gamma.plot_as_pole_figure(miller.symmetrise(unique=True))
- sample(num=50, seed=None)[source]
Generate a random sample from the texture component
- Parameters:
num (int, optional) – Number of random orientations to generate. Default is 50.
seed (int, optional) – Seed to use for generating random numbers. Default is None.
- Returns:
Random orientations from the given texture
- Return type:
orix.quaternion.Orientation
Examples
Generate 50 orientations from uniform distribution:
>>> from elasticipy.crystal_texture import UniformTexture >>> o = UniformTexture().sample()
Generate 10 orientations from gamma-fibre
>>> from elasticipy.crystal_texture import FibreTexture >>> o = FibreTexture.gamma().sample(num=10)
- class elasticipy.crystal_texture.DiscreteTexture(orientation)[source]
Bases:
CrystalTextureClass to handle classical crystallographic texture.
Notes
This class implements the crystallographic textures listed by [Lohmuller]
References
[Lohmuller]Lohmuller, P.; Peltier, L.; Hazotte, A.; Zollinger, J.; Laheurte, P.; Fleury, E. Variations of the Elastic Properties of the CoCrFeMnNi High Entropy Alloy Deformed by Groove Cold Rolling. Materials 2018, 11, 1337. https://doi.org/10.3390/ma11081337
Create a single-orientation crystallographic texture.
- Parameters:
orientation (orix.quaternion.orientation.Orientation) – Orientation of the crystals
- classmethod Goss()[source]
Create a Goss crystallographic texture: {110}<100>
- Return type:
See also
ACreate an A single-orientation crystallographic texture
brassCreate a Brass single-orientation crystallographic texture
copperCreate a Copper single-orientation crystallographic texture
cubeCreate a Cube single-orientation crystallographic texture
CuTCreate a CuT single-orientation crystallographic texture
GossBrassCreate a Goss-Brass single-orientation crystallographic texture
PCreate a P single-orientation crystallographic texture
SCreate an S single-orientation crystallographic texture
- classmethod GossBrass()[source]
Create a Goss/Brass crystallographic texture: {110}<115>
- Return type:
- classmethod cube()[source]
Create a Cube crystallographic texture: {100}<100>
- Return type:
See also
ACreate a A single-orientation crystallographic texture
brassCreate a Brass single-orientation crystallographic texture
copperCreate a Copper single-orientation crystallographic texture
CuTCreate a CuT single-orientation crystallographic texture
GossCreate a Goss single-orientation crystallographic texture
GossBrassCreate a Goss-Brass single-orientation crystallographic texture
PCreate a P single-orientation crystallographic texture
SCreate an S single-orientation crystallographic texture
- mean_tensor(tensor)[source]
Perform the texture-weighted mean of a 4th-order tensor.
- Parameters:
tensor (SymmetricFourthOrderTensor) – Reference tensor (unrotated)
- Returns:
mean value of the rotated tensor
- Return type:
- plot_as_pole_figure(miller, projection='lambert', fig=None, ax=None, **kwargs)[source]
Plot the pole figure of the crystallographic texture
- Parameters:
miller (orix.vector.miller.Miller) – Miller indices of directions/planes to plot
projection (str, optional) – Type of projection to use, it can be either stereographic or Lambert
fig (matplotlib.figure.Figure, optional) – Handle to existing figure, if needed
ax (matplotlib.projections.polar.PolarAxes, optional) – Axes to plot on
kwargs – Keyword arguments to pass to matplotlib’s scatter/plot functions
- Returns:
matplotlib.figure.Figure – Handle to figure
matplotlib.projections.polar.PolarAxes – Axes where the pole figure is plotted
Examples
Plot the [100] pole figure of Goss texture:
from elasticipy.crystal_texture import DiscreteTexture from orix.vector import Miller from orix.crystal_map import Phase goss = DiscreteTexture.Goss() phase = Phase(point_group='m3m') # BCC symmetry miller = Miller([1,0,0], phase=phase) goss.plot_as_pole_figure(miller.symmetrise(unique=True))
Plot the [110] pole figure of the gamma fibre texture:
from elasticipy.crystal_texture import FibreTexture from orix.vector import Miller from orix.crystal_map import Phase gamma = FibreTexture.gamma() phase = Phase(point_group='m3m') # BCC symmetry miller = Miller([1,1,0], phase=phase) gamma.plot_as_pole_figure(miller.symmetrise(unique=True))
- sample(num=50, seed=None)[source]
Generate a random sample from the texture component
- Parameters:
num (int, optional) – Number of random orientations to generate. Default is 50.
seed (int, optional) – Seed to use for generating random numbers. Default is None.
- Returns:
Random orientations from the given texture
- Return type:
orix.quaternion.Orientation
Examples
Generate 50 orientations from uniform distribution:
>>> from elasticipy.crystal_texture import UniformTexture >>> o = UniformTexture().sample()
Generate 10 orientations from gamma-fibre
>>> from elasticipy.crystal_texture import FibreTexture >>> o = FibreTexture.gamma().sample(num=10)
- class elasticipy.crystal_texture.FibreTexture(orientation, axis, point_group=None)[source]
Bases:
CrystalTextureCreate a fibre-type crystallographic texture
- Parameters:
orientation (orix.quaternion.orientation.Orientation) – Reference orientation
axis (list or tuple or numpy.ndarray or orix.vector.Vector3D) – Axis of rotation (in sample CS)
point_group (orix.phase.point_group.PointGroup, optional) – Point group to use
- classmethod from_Euler(phi1=None, Phi=None, phi2=None, degrees=True)[source]
Create a fibre texture by providing two fixed Bunge-Euler values
- Parameters:
phi1 (float) – First Euler angle
Phi (float) – Second Euler angle
phi2 (float) – Third Euler angle
degrees (boolean, optional) – If true (default), the angles must be passed in degrees (in radians otherwise)
- Return type:
See also
from_Miller_axisDefine a fibre texture by aligning a miller direction with a given axis
Examples
A fibre texture corresponding to constant (e.g. zero) values for phi1 and phi2, and uniform distribution of Phi on [0,2π[, can be defined as follows:
>>> from elasticipy.crystal_texture import FibreTexture >>> t1 = FibreTexture.from_Euler(phi1=0., phi2=0.) >>> t1 Fibre texture φ1= 0.0°, φ2= 0.0°
Similarly, the following returns a fibre texture for phi1=0 and Phi=0, and uniform distribution of phi2 on [0,2π[:
>>> t2 = FibreTexture.from_Euler(phi1=0., Phi=0.) >>> t2 Fibre texture φ1= 0.0°, ϕ= 0.0°
- classmethod from_Miller_axis(miller, axis)[source]
Create a perfect fibre crystallographic texture
- Parameters:
miller (orix.vector.miller.Miller) – Crystal plane or direction to align with the axis
axis (tuple or list) – Axis (in sample CS) to align with
- Return type:
See also
from_Eulerdefine a fibre texture from two Euler angles
Examples
Let’s consider a cubic poly-crystal (point group: m-3m), whose orientations are defined by a perfect alignment of direction <100> with the Z axis of a sample (therefore a uniform distribution around the Z axis). This texture can be defined as:
>>> from orix.crystal_map import Phase >>> from orix.vector.miller import Miller >>> from elasticipy.crystal_texture import FibreTexture >>> phase = Phase(point_group='m-3m') >>> m = Miller(uvw=[1,0,0], phase=phase) >>> t = FibreTexture.from_Miller_axis(m, [0,0,1]) >>> t Fibre texture <1. 0. 0.> || [0, 0, 1]
- mean_tensor(tensor)[source]
Perform the texture-weighted mean of a 4th-order tensor.
- Parameters:
tensor (SymmetricFourthOrderTensor) – Reference tensor (unrotated)
- Returns:
mean value of the rotated tensor
- Return type:
- plot_as_pole_figure(miller, n_orientations=100, fig=None, ax=None, projection='lambert', **kwargs)[source]
Plot the pole figure of the crystallographic texture
- Parameters:
miller (orix.vector.miller.Miller) – Miller indices of directions/planes to plot
projection (str, optional) – Type of projection to use, it can be either stereographic or Lambert
fig (matplotlib.figure.Figure, optional) – Handle to existing figure, if needed
ax (matplotlib.projections.polar.PolarAxes, optional) – Axes to plot on
kwargs – Keyword arguments to pass to matplotlib’s scatter/plot functions
- Returns:
matplotlib.figure.Figure – Handle to figure
matplotlib.projections.polar.PolarAxes – Axes where the pole figure is plotted
Examples
Plot the [100] pole figure of Goss texture:
from elasticipy.crystal_texture import DiscreteTexture from orix.vector import Miller from orix.crystal_map import Phase goss = DiscreteTexture.Goss() phase = Phase(point_group='m3m') # BCC symmetry miller = Miller([1,0,0], phase=phase) goss.plot_as_pole_figure(miller.symmetrise(unique=True))
Plot the [110] pole figure of the gamma fibre texture:
from elasticipy.crystal_texture import FibreTexture from orix.vector import Miller from orix.crystal_map import Phase gamma = FibreTexture.gamma() phase = Phase(point_group='m3m') # BCC symmetry miller = Miller([1,1,0], phase=phase) gamma.plot_as_pole_figure(miller.symmetrise(unique=True))
- sample(num=50, seed=None)[source]
Generate a random sample from the texture component
- Parameters:
num (int, optional) – Number of random orientations to generate. Default is 50.
seed (int, optional) – Seed to use for generating random numbers. Default is None.
- Returns:
Random orientations from the given texture
- Return type:
orix.quaternion.Orientation
Examples
Generate 50 orientations from uniform distribution:
>>> from elasticipy.crystal_texture import UniformTexture >>> o = UniformTexture().sample()
Generate 10 orientations from gamma-fibre
>>> from elasticipy.crystal_texture import FibreTexture >>> o = FibreTexture.gamma().sample(num=10)
- class elasticipy.crystal_texture.UniformTexture[source]
Bases:
CrystalTextureSimple class to define the uniform texture over SO(3)
Create a uniform texture over SO(3)
- mean_tensor(tensor)[source]
Perform the texture-weighted mean of a 4th-order tensor.
- Parameters:
tensor (SymmetricFourthOrderTensor) – Reference tensor (unrotated)
- Returns:
mean value of the rotated tensor
- Return type:
- plot_as_pole_figure(miller, projection='lambert', fig=None, ax=None, **kwargs)[source]
Plot the pole figure of the crystallographic texture
- Parameters:
miller (orix.vector.miller.Miller) – Miller indices of directions/planes to plot
projection (str, optional) – Type of projection to use, it can be either stereographic or Lambert
fig (matplotlib.figure.Figure, optional) – Handle to existing figure, if needed
ax (matplotlib.projections.polar.PolarAxes, optional) – Axes to plot on
kwargs – Keyword arguments to pass to matplotlib’s scatter/plot functions
- Returns:
matplotlib.figure.Figure – Handle to figure
matplotlib.projections.polar.PolarAxes – Axes where the pole figure is plotted
Examples
Plot the [100] pole figure of Goss texture:
from elasticipy.crystal_texture import DiscreteTexture from orix.vector import Miller from orix.crystal_map import Phase goss = DiscreteTexture.Goss() phase = Phase(point_group='m3m') # BCC symmetry miller = Miller([1,0,0], phase=phase) goss.plot_as_pole_figure(miller.symmetrise(unique=True))
Plot the [110] pole figure of the gamma fibre texture:
from elasticipy.crystal_texture import FibreTexture from orix.vector import Miller from orix.crystal_map import Phase gamma = FibreTexture.gamma() phase = Phase(point_group='m3m') # BCC symmetry miller = Miller([1,1,0], phase=phase) gamma.plot_as_pole_figure(miller.symmetrise(unique=True))
- sample(num=50, seed=None)[source]
Generate a random sample from the texture component
- Parameters:
num (int, optional) – Number of random orientations to generate. Default is 50.
seed (int, optional) – Seed to use for generating random numbers. Default is None.
- Returns:
Random orientations from the given texture
- Return type:
orix.quaternion.Orientation
Examples
Generate 50 orientations from uniform distribution:
>>> from elasticipy.crystal_texture import UniformTexture >>> o = UniformTexture().sample()
Generate 10 orientations from gamma-fibre
>>> from elasticipy.crystal_texture import FibreTexture >>> o = FibreTexture.gamma().sample(num=10)