.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/discrete_texture.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_discrete_texture.py: ===================================== Average stiffness of discrete texture ===================================== This example shows how to compute the Voigt average of crystals with a mixture of discrete textures. .. GENERATED FROM PYTHON SOURCE LINES 9-14 Define fibre texture ------------------------------------- We define the stiffness tensor for BCC austenite using its elastic constants. They are taken from the `Materials Project (mp-13) `_. .. GENERATED FROM PYTHON SOURCE LINES 14-17 .. code-block:: Python from elasticipy.tensors.elasticity import StiffnessTensor C = StiffnessTensor.cubic(C11=274, C12=175, C44=89) .. GENERATED FROM PYTHON SOURCE LINES 18-21 Create two discrete textures ------------------------------------------------- The Brass texture corresponds to {110}<112>, whereas the copper texture corresponds to {112}<111>: .. GENERATED FROM PYTHON SOURCE LINES 21-27 .. code-block:: Python from elasticipy.crystal_texture import DiscreteTexture brass = DiscreteTexture.brass() copper = DiscreteTexture.copper() print(brass) print(copper) .. rst-class:: sphx-glr-script-out .. code-block:: none Crystallographic texture φ1=35.26°, ϕ=45.00°, φ2=0.00° Crystallographic texture φ1=90.00°, ϕ=35.26°, φ2=45.00° .. GENERATED FROM PYTHON SOURCE LINES 28-31 Create a composite texture ------------------------------------ We assume that the overall texture consists in 60% brass and 40% copper: .. GENERATED FROM PYTHON SOURCE LINES 31-34 .. code-block:: Python texture = 0.6 * brass + 0.4 * copper print(texture) .. rst-class:: sphx-glr-script-out .. code-block:: none Mixture of crystallographic textures Wgt. Type Component ------------------------------------------------------------ 0.60 discrete φ1=35.26°, ϕ=45.00°, φ2=0.00° 0.40 discrete φ1=90.00°, ϕ=35.26°, φ2=45.00° .. GENERATED FROM PYTHON SOURCE LINES 35-37 Plot the pole figures -------------------------- .. GENERATED FROM PYTHON SOURCE LINES 37-40 .. code-block:: Python fig, ax = texture.plot_as_pole_figure([1,0,0], symmetrise=True, labels=['brass', 'copper']) ax.legend() .. image-sg:: /auto_examples/images/sphx_glr_discrete_texture_001.png :alt: discrete texture :srcset: /auto_examples/images/sphx_glr_discrete_texture_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 41-44 Compute the Voigt average -------------------------- The Voigt average of the polycrystal is: .. GENERATED FROM PYTHON SOURCE LINES 44-47 .. code-block:: Python Cvoigt = C.Voigt_average(orientations=texture) print(Cvoigt) .. rst-class:: sphx-glr-script-out .. code-block:: none Stiffness tensor (in Voigt mapping): [[318.77 148.67 156.57 -0. 0. -11.17] [148.67 321.4 153.93 -0. 7.45 0. ] [156.57 153.93 313.5 -0. -7.45 11.17] [ 0. -0. -0. 67.93 11.17 7.45] [ 0. 7.45 -7.45 11.17 70.57 -0. ] [-11.17 0. 11.17 7.45 0. 62.67]] .. GENERATED FROM PYTHON SOURCE LINES 48-50 Plot the Young modulus ------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 50-53 .. code-block:: Python Cvoigt.Young_modulus.plot3D() .. raw:: html


.. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.197 seconds) .. _sphx_glr_download_auto_examples_discrete_texture.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: discrete_texture.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: discrete_texture.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: discrete_texture.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_