elasticipy 4.1.0__tar.gz → 4.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. elasticipy-4.2.0/Elasticipy_for_the_Impatient.ipynb +998 -0
  2. {elasticipy-4.1.0 → elasticipy-4.2.0}/Examples/Example_Stiffness_tensor.py +1 -1
  3. {elasticipy-4.1.0 → elasticipy-4.2.0}/Examples/Example_StressStrain_arrays.py +13 -19
  4. {elasticipy-4.1.0 → elasticipy-4.2.0}/Examples/Example_WaveVelocity.py +3 -3
  5. {elasticipy-4.1.0 → elasticipy-4.2.0}/Examples/example_readwrite.py +4 -2
  6. {elasticipy-4.1.0 → elasticipy-4.2.0}/JOSS/paper.md +1 -1
  7. {elasticipy-4.1.0 → elasticipy-4.2.0}/PKG-INFO +3 -2
  8. {elasticipy-4.1.0 → elasticipy-4.2.0}/README.md +1 -0
  9. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/Tutorials/Tutorial_MultiplePhases.rst +2 -2
  10. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/Tutorials/Tutorial_StiffnessTensor.rst +3 -3
  11. elasticipy-4.2.0/postBuild +1 -0
  12. {elasticipy-4.1.0 → elasticipy-4.2.0}/pyproject.toml +9 -2
  13. elasticipy-4.2.0/runtime.txt +1 -0
  14. {elasticipy-4.1.0 → elasticipy-4.2.0}/src/Elasticipy/tensors/elasticity.py +380 -77
  15. {elasticipy-4.1.0 → elasticipy-4.2.0}/src/elasticipy.egg-info/PKG-INFO +3 -2
  16. {elasticipy-4.1.0 → elasticipy-4.2.0}/src/elasticipy.egg-info/SOURCES.txt +3 -0
  17. {elasticipy-4.1.0 → elasticipy-4.2.0}/src/elasticipy.egg-info/requires.txt +1 -0
  18. {elasticipy-4.1.0 → elasticipy-4.2.0}/tests/test_StiffnessTensor.py +25 -21
  19. {elasticipy-4.1.0 → elasticipy-4.2.0}/.github/workflows/Codecov.yml +0 -0
  20. {elasticipy-4.1.0 → elasticipy-4.2.0}/.github/workflows/JOSS build.yml +0 -0
  21. {elasticipy-4.1.0 → elasticipy-4.2.0}/.github/workflows/cloc.yml +0 -0
  22. {elasticipy-4.1.0 → elasticipy-4.2.0}/.github/workflows/python-publish.yml +0 -0
  23. {elasticipy-4.1.0 → elasticipy-4.2.0}/.readthedocs.yaml +0 -0
  24. {elasticipy-4.1.0 → elasticipy-4.2.0}/CITATION.bib +0 -0
  25. {elasticipy-4.1.0 → elasticipy-4.2.0}/CITATION.cff +0 -0
  26. {elasticipy-4.1.0 → elasticipy-4.2.0}/CODE_OF_CONDUCT.md +0 -0
  27. {elasticipy-4.1.0 → elasticipy-4.2.0}/CONTRIBUTING.md +0 -0
  28. {elasticipy-4.1.0 → elasticipy-4.2.0}/Examples/Elasticipy_vs_pymatgen.py +0 -0
  29. {elasticipy-4.1.0 → elasticipy-4.2.0}/Examples/Elate_vs_Elasticipy.py +0 -0
  30. {elasticipy-4.1.0 → elasticipy-4.2.0}/Examples/MaterialsProject.json +0 -0
  31. {elasticipy-4.1.0 → elasticipy-4.2.0}/Examples/Multiple_phases.py +0 -0
  32. {elasticipy-4.1.0 → elasticipy-4.2.0}/Examples/SelfConsistent.py +0 -0
  33. {elasticipy-4.1.0 → elasticipy-4.2.0}/Examples/essai_plasticity.py +0 -0
  34. {elasticipy-4.1.0 → elasticipy-4.2.0}/JOSS/ElasticipyVSpymatgen.png +0 -0
  35. {elasticipy-4.1.0 → elasticipy-4.2.0}/JOSS/Nye.png +0 -0
  36. {elasticipy-4.1.0 → elasticipy-4.2.0}/JOSS/Plot_E.png +0 -0
  37. {elasticipy-4.1.0 → elasticipy-4.2.0}/JOSS/YoungModulus.png +0 -0
  38. {elasticipy-4.1.0 → elasticipy-4.2.0}/JOSS/paper.bib +0 -0
  39. {elasticipy-4.1.0 → elasticipy-4.2.0}/LICENSE +0 -0
  40. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/_static/images/HyperSphericalCoordinates.png +0 -0
  41. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/index.rst +0 -0
  42. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/Elasticipy.interfaces.FEPX.rst +0 -0
  43. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/Elasticipy.interfaces.PRISMS.rst +0 -0
  44. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/Elasticipy.plasticity.rst +0 -0
  45. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/Elasticipy.rst +0 -0
  46. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/Elasticipy.spherical_function.rst +0 -0
  47. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/Elasticipy.tensors.elasticity.rst +0 -0
  48. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/Elasticipy.tensors.fourth_order.rst +0 -0
  49. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/Elasticipy.tensors.second_order.rst +0 -0
  50. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/Elasticipy.tensors.stress_strain.rst +0 -0
  51. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/Tutorials/GUI.rst +0 -0
  52. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/Tutorials/Plasticity.rst +0 -0
  53. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/Tutorials/Tutorial_AveragingMethods.rst +0 -0
  54. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/Tutorials/Tutorial_ReadWriteFiles.rst +0 -0
  55. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/Tutorials/Tutorial_StressStrain.rst +0 -0
  56. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/Tutorials/Tutorial_ThermalExpansion.rst +0 -0
  57. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/Tutorials/Tutorial_wave-velocities.rst +0 -0
  58. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/Tutorials/images/Cyclic.png +0 -0
  59. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/Tutorials/images/E_PF.png +0 -0
  60. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/Tutorials/images/E_VRH_sections.png +0 -0
  61. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/Tutorials/images/E_hill_fiber.png +0 -0
  62. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/Tutorials/images/E_plot3D.png +0 -0
  63. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/Tutorials/images/E_xyz_sections.png +0 -0
  64. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/Tutorials/images/GUI.png +0 -0
  65. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/Tutorials/images/G_plot3D.png +0 -0
  66. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/Tutorials/images/G_plot3D_min.png +0 -0
  67. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/Tutorials/images/G_xyz_sections.png +0 -0
  68. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/Tutorials/images/Incremental.png +0 -0
  69. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/Tutorials/images/Mohr.png +0 -0
  70. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/Tutorials/images/Shear.png +0 -0
  71. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/Tutorials/images/Stress-controlled.png +0 -0
  72. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/Tutorials/images/StressStrain-controlled.png +0 -0
  73. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/Tutorials/images/WaveVelocities.png +0 -0
  74. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/Tutorials/images/plot_volumeFraction.png +0 -0
  75. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/Tutorials.rst +0 -0
  76. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/conf.py +0 -0
  77. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/index.rst +0 -0
  78. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/logo/favicon.png +0 -0
  79. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/logo/logo.png +0 -0
  80. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/logo/logo.svg +0 -0
  81. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/logo/logo_text.png +0 -0
  82. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/logo/logo_text.svg +0 -0
  83. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/logo/logo_text_whitebg.png +0 -0
  84. {elasticipy-4.1.0 → elasticipy-4.2.0}/docs/source/modules.rst +0 -0
  85. {elasticipy-4.1.0 → elasticipy-4.2.0}/requirements.txt +0 -0
  86. {elasticipy-4.1.0 → elasticipy-4.2.0}/setup.cfg +0 -0
  87. {elasticipy-4.1.0 → elasticipy-4.2.0}/src/Elasticipy/FourthOrderTensor.py +0 -0
  88. {elasticipy-4.1.0 → elasticipy-4.2.0}/src/Elasticipy/StressStrainTensors.py +0 -0
  89. {elasticipy-4.1.0 → elasticipy-4.2.0}/src/Elasticipy/ThermalExpansion.py +0 -0
  90. {elasticipy-4.1.0 → elasticipy-4.2.0}/src/Elasticipy/__init__.py +0 -0
  91. {elasticipy-4.1.0 → elasticipy-4.2.0}/src/Elasticipy/crystal_symmetries.py +0 -0
  92. {elasticipy-4.1.0 → elasticipy-4.2.0}/src/Elasticipy/gui.py +0 -0
  93. {elasticipy-4.1.0 → elasticipy-4.2.0}/src/Elasticipy/interfaces/FEPX.py +0 -0
  94. {elasticipy-4.1.0 → elasticipy-4.2.0}/src/Elasticipy/interfaces/PRISMS.py +0 -0
  95. {elasticipy-4.1.0 → elasticipy-4.2.0}/src/Elasticipy/plasticity.py +0 -0
  96. {elasticipy-4.1.0 → elasticipy-4.2.0}/src/Elasticipy/polefigure.py +0 -0
  97. {elasticipy-4.1.0 → elasticipy-4.2.0}/src/Elasticipy/spherical_function.py +0 -0
  98. {elasticipy-4.1.0 → elasticipy-4.2.0}/src/Elasticipy/tensors/__init__.py +0 -0
  99. {elasticipy-4.1.0 → elasticipy-4.2.0}/src/Elasticipy/tensors/fourth_order.py +0 -0
  100. {elasticipy-4.1.0 → elasticipy-4.2.0}/src/Elasticipy/tensors/mapping.py +0 -0
  101. {elasticipy-4.1.0 → elasticipy-4.2.0}/src/Elasticipy/tensors/second_order.py +0 -0
  102. {elasticipy-4.1.0 → elasticipy-4.2.0}/src/Elasticipy/tensors/stress_strain.py +0 -0
  103. {elasticipy-4.1.0 → elasticipy-4.2.0}/src/Elasticipy/tensors/thermal_expansion.py +0 -0
  104. {elasticipy-4.1.0 → elasticipy-4.2.0}/src/elasticipy.egg-info/dependency_links.txt +0 -0
  105. {elasticipy-4.1.0 → elasticipy-4.2.0}/src/elasticipy.egg-info/top_level.txt +0 -0
  106. {elasticipy-4.1.0 → elasticipy-4.2.0}/tests/MaterialsProject.json +0 -0
  107. {elasticipy-4.1.0 → elasticipy-4.2.0}/tests/__init__.py +0 -0
  108. {elasticipy-4.1.0 → elasticipy-4.2.0}/tests/interfaces/FEPX/simulation.sim/.sim +0 -0
  109. {elasticipy-4.1.0 → elasticipy-4.2.0}/tests/interfaces/FEPX/simulation.sim/results/elts/defrate/defrate.step0 +0 -0
  110. {elasticipy-4.1.0 → elasticipy-4.2.0}/tests/interfaces/FEPX/simulation.sim/results/elts/defrate/defrate.step1 +0 -0
  111. {elasticipy-4.1.0 → elasticipy-4.2.0}/tests/interfaces/FEPX/simulation.sim/results/elts/defrate/defrate.step2 +0 -0
  112. {elasticipy-4.1.0 → elasticipy-4.2.0}/tests/interfaces/FEPX/simulation.sim/results/elts/ori/ori.step0 +0 -0
  113. {elasticipy-4.1.0 → elasticipy-4.2.0}/tests/interfaces/FEPX/simulation.sim/results/elts/ori/ori.step1 +0 -0
  114. {elasticipy-4.1.0 → elasticipy-4.2.0}/tests/interfaces/FEPX/simulation.sim/results/elts/ori/ori.step2 +0 -0
  115. {elasticipy-4.1.0 → elasticipy-4.2.0}/tests/interfaces/FEPX/simulation.sim/results/elts/spinrate/spinrate.step0 +0 -0
  116. {elasticipy-4.1.0 → elasticipy-4.2.0}/tests/interfaces/FEPX/simulation.sim/results/elts/spinrate/spinrate.step1 +0 -0
  117. {elasticipy-4.1.0 → elasticipy-4.2.0}/tests/interfaces/FEPX/simulation.sim/results/elts/spinrate/spinrate.step2 +0 -0
  118. {elasticipy-4.1.0 → elasticipy-4.2.0}/tests/interfaces/FEPX/simulation.sim/results/elts/strain/strain.step0 +0 -0
  119. {elasticipy-4.1.0 → elasticipy-4.2.0}/tests/interfaces/FEPX/simulation.sim/results/elts/strain/strain.step1 +0 -0
  120. {elasticipy-4.1.0 → elasticipy-4.2.0}/tests/interfaces/FEPX/simulation.sim/results/elts/strain/strain.step2 +0 -0
  121. {elasticipy-4.1.0 → elasticipy-4.2.0}/tests/interfaces/FEPX/simulation.sim/results/elts/stress/stress.step0 +0 -0
  122. {elasticipy-4.1.0 → elasticipy-4.2.0}/tests/interfaces/FEPX/simulation.sim/results/elts/stress/stress.step1 +0 -0
  123. {elasticipy-4.1.0 → elasticipy-4.2.0}/tests/interfaces/FEPX/simulation.sim/results/elts/stress/stress.step2 +0 -0
  124. {elasticipy-4.1.0 → elasticipy-4.2.0}/tests/interfaces/FEPX/simulation.sim/results/elts/velgrad/velgrad.step0 +0 -0
  125. {elasticipy-4.1.0 → elasticipy-4.2.0}/tests/interfaces/FEPX/simulation.sim/results/elts/velgrad/velgrad.step1 +0 -0
  126. {elasticipy-4.1.0 → elasticipy-4.2.0}/tests/interfaces/FEPX/simulation.sim/results/elts/velgrad/velgrad.step2 +0 -0
  127. {elasticipy-4.1.0 → elasticipy-4.2.0}/tests/interfaces/PRISMS/QuadratureOutputs.csv +0 -0
  128. {elasticipy-4.1.0 → elasticipy-4.2.0}/tests/interfaces/PRISMS/stressstrain.txt +0 -0
  129. {elasticipy-4.1.0 → elasticipy-4.2.0}/tests/test_FourthOrderTensors.py +0 -0
  130. {elasticipy-4.1.0 → elasticipy-4.2.0}/tests/test_SphericalFunction.py +0 -0
  131. {elasticipy-4.1.0 → elasticipy-4.2.0}/tests/test_StressStrainTensors.py +0 -0
  132. {elasticipy-4.1.0 → elasticipy-4.2.0}/tests/test_ThermalExpansion.py +0 -0
  133. {elasticipy-4.1.0 → elasticipy-4.2.0}/tests/test_interfaces_FEPX.py +0 -0
  134. {elasticipy-4.1.0 → elasticipy-4.2.0}/tests/test_interfaces_prisms.py +0 -0
  135. {elasticipy-4.1.0 → elasticipy-4.2.0}/tests/test_plasticity.py +0 -0
@@ -0,0 +1,998 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "markdown",
5
+ "id": "0eb02acc-35d4-41f4-b6ea-d1159f1a2c08",
6
+ "metadata": {},
7
+ "source": [
8
+ "# Elasticipy for the impatient"
9
+ ]
10
+ },
11
+ {
12
+ "cell_type": "markdown",
13
+ "id": "aa35037f-7acf-4e09-8906-29d71801bb8f",
14
+ "metadata": {},
15
+ "source": [
16
+ "This notebook is designed to give a quick overview of the features of Elasticipy, and illustrate basic syntaxes."
17
+ ]
18
+ },
19
+ {
20
+ "cell_type": "markdown",
21
+ "id": "68f5cece-4b40-4145-bbaa-e74fbaad6248",
22
+ "metadata": {},
23
+ "source": [
24
+ "## Very simple example: isotropic case"
25
+ ]
26
+ },
27
+ {
28
+ "cell_type": "markdown",
29
+ "id": "a86eb24f-8425-4e7d-a0f3-ce3cd8ce52b1",
30
+ "metadata": {},
31
+ "source": [
32
+ "### Stiffness tensor and derived properties"
33
+ ]
34
+ },
35
+ {
36
+ "cell_type": "markdown",
37
+ "id": "6ef6122f-f5a8-432e-81f2-6937d7892b5d",
38
+ "metadata": {},
39
+ "source": [
40
+ "Let's start by creating a simple isotropic stiffness tensor:"
41
+ ]
42
+ },
43
+ {
44
+ "cell_type": "code",
45
+ "execution_count": null,
46
+ "id": "95129202",
47
+ "metadata": {},
48
+ "outputs": [],
49
+ "source": [
50
+ "from Elasticipy.tensors.elasticity import StiffnessTensor"
51
+ ]
52
+ },
53
+ {
54
+ "cell_type": "code",
55
+ "execution_count": null,
56
+ "id": "304246a5",
57
+ "metadata": {},
58
+ "outputs": [],
59
+ "source": [
60
+ "C=StiffnessTensor.isotropic(E=210e3, nu=0.25)\n",
61
+ "print(C)"
62
+ ]
63
+ },
64
+ {
65
+ "cell_type": "markdown",
66
+ "id": "71e92be8-d88d-4e42-a483-167f96b2c729",
67
+ "metadata": {},
68
+ "source": [
69
+ "Some engineering constants can be directly derived from it:"
70
+ ]
71
+ },
72
+ {
73
+ "cell_type": "code",
74
+ "execution_count": null,
75
+ "id": "c73ab097",
76
+ "metadata": {},
77
+ "outputs": [],
78
+ "source": [
79
+ "G=C.shear_modulus.mean()\n",
80
+ "K=C.bulk_modulus\n",
81
+ "print('G={}, K={}'.format(G,K))"
82
+ ]
83
+ },
84
+ {
85
+ "cell_type": "markdown",
86
+ "id": "7217e941-95ce-4424-abd8-9dc55c138a9d",
87
+ "metadata": {},
88
+ "source": [
89
+ "The stiffness tensor can actually be constructed from any combinations of $E$, $\\nu$, $K$, $\\lambda$ or G (or equivalently $\\mu$), e.g.:"
90
+ ]
91
+ },
92
+ {
93
+ "cell_type": "code",
94
+ "execution_count": null,
95
+ "id": "eba09c27-cde2-4d0e-8fd7-abbf19c0adbb",
96
+ "metadata": {},
97
+ "outputs": [],
98
+ "source": [
99
+ "print(StiffnessTensor.isotropic(E=210e3,lame2=G))"
100
+ ]
101
+ },
102
+ {
103
+ "cell_type": "markdown",
104
+ "id": "b7df0bbc-2cb0-4b82-9a7a-708f169389ec",
105
+ "metadata": {},
106
+ "source": [
107
+ "### Compute stress/strain relationship"
108
+ ]
109
+ },
110
+ {
111
+ "cell_type": "markdown",
112
+ "id": "7a59dba2-b5a3-47f0-bc4d-85963ee95d08",
113
+ "metadata": {},
114
+ "source": [
115
+ "Once constructed, the stiffness tensor can be used to establish the stress-strain relationship."
116
+ ]
117
+ },
118
+ {
119
+ "cell_type": "markdown",
120
+ "id": "e78db645-0e43-48c3-b2b0-9c3dea702993",
121
+ "metadata": {},
122
+ "source": [
123
+ "#### Simple tensile strain"
124
+ ]
125
+ },
126
+ {
127
+ "cell_type": "markdown",
128
+ "id": "596238e5-cc09-4a81-90cd-eb7fccefb888",
129
+ "metadata": {},
130
+ "source": [
131
+ "Let's start by creating a strain tensor:"
132
+ ]
133
+ },
134
+ {
135
+ "cell_type": "code",
136
+ "execution_count": null,
137
+ "id": "1db9d682-11c6-4ccc-bff2-c3ea24358a36",
138
+ "metadata": {},
139
+ "outputs": [],
140
+ "source": [
141
+ "from Elasticipy.tensors.stress_strain import StrainTensor\n",
142
+ "eps = StrainTensor.tensile([1,0,0],1e-3)\n",
143
+ "print(eps)"
144
+ ]
145
+ },
146
+ {
147
+ "cell_type": "markdown",
148
+ "id": "5df0bc8e-c5d0-49dc-a530-0a0680e196d5",
149
+ "metadata": {},
150
+ "source": [
151
+ "Then apply the generalized Hooke's law:"
152
+ ]
153
+ },
154
+ {
155
+ "cell_type": "code",
156
+ "execution_count": null,
157
+ "id": "82ffd503-4049-4833-a6b3-698aa487b4eb",
158
+ "metadata": {},
159
+ "outputs": [],
160
+ "source": [
161
+ "sigma = C * eps\n",
162
+ "print(sigma)"
163
+ ]
164
+ },
165
+ {
166
+ "cell_type": "markdown",
167
+ "id": "87c55fd5-8c82-48b4-8bf2-32a7027f70c0",
168
+ "metadata": {},
169
+ "source": [
170
+ "One can compute the equivalent stresses:"
171
+ ]
172
+ },
173
+ {
174
+ "cell_type": "code",
175
+ "execution_count": null,
176
+ "id": "8b9208d2-230d-4066-9583-01405f367bae",
177
+ "metadata": {},
178
+ "outputs": [],
179
+ "source": [
180
+ "print(sigma.vonMises())\n",
181
+ "print(sigma.Tresca())"
182
+ ]
183
+ },
184
+ {
185
+ "cell_type": "markdown",
186
+ "id": "9398ca9f-5f11-4976-bce4-268110c2b3f8",
187
+ "metadata": {},
188
+ "source": [
189
+ "#### Simple tensile stress"
190
+ ]
191
+ },
192
+ {
193
+ "cell_type": "markdown",
194
+ "id": "e95eabf9-f143-423e-935b-290b6b899b76",
195
+ "metadata": {},
196
+ "source": [
197
+ "Now, we want to define the stress, and compute the relating strain."
198
+ ]
199
+ },
200
+ {
201
+ "cell_type": "code",
202
+ "execution_count": null,
203
+ "id": "7c662db3-6eb7-477f-832d-9f84fdf2ad98",
204
+ "metadata": {},
205
+ "outputs": [],
206
+ "source": [
207
+ "from Elasticipy.tensors.stress_strain import StressTensor\n",
208
+ "sigma = StressTensor.tensile([1,0,0],100)"
209
+ ]
210
+ },
211
+ {
212
+ "cell_type": "markdown",
213
+ "id": "e8c9566b-dd50-4fcb-8d15-e60c92061af6",
214
+ "metadata": {},
215
+ "source": [
216
+ "We need the compliance tensor first:"
217
+ ]
218
+ },
219
+ {
220
+ "cell_type": "code",
221
+ "execution_count": null,
222
+ "id": "3b20c426-5c80-497b-acad-fda2053967ab",
223
+ "metadata": {},
224
+ "outputs": [],
225
+ "source": [
226
+ "S = C.inv()\n",
227
+ "print(S)"
228
+ ]
229
+ },
230
+ {
231
+ "cell_type": "markdown",
232
+ "id": "011483a0-5e1c-49c9-84ea-bc5eb2ee56bc",
233
+ "metadata": {},
234
+ "source": [
235
+ "Then, the generalized Hooke's law gives:"
236
+ ]
237
+ },
238
+ {
239
+ "cell_type": "code",
240
+ "execution_count": null,
241
+ "id": "8ea0aba6-7e4c-4500-a6ac-cf9642ea2e74",
242
+ "metadata": {},
243
+ "outputs": [],
244
+ "source": [
245
+ "eps = S * sigma\n",
246
+ "print(eps)"
247
+ ]
248
+ },
249
+ {
250
+ "cell_type": "markdown",
251
+ "id": "ed96f826-4cdf-4e10-86fa-f9c766be133d",
252
+ "metadata": {},
253
+ "source": [
254
+ "One can estimate the corresponding volumetric elastic energy density:"
255
+ ]
256
+ },
257
+ {
258
+ "cell_type": "code",
259
+ "execution_count": null,
260
+ "id": "3c1f6268-8943-458b-b657-99f8c641f3cc",
261
+ "metadata": {},
262
+ "outputs": [],
263
+ "source": [
264
+ "print(eps.elastic_energy(sigma))"
265
+ ]
266
+ },
267
+ {
268
+ "cell_type": "markdown",
269
+ "id": "fbc7da89-349e-48e9-9845-6635f26daa86",
270
+ "metadata": {},
271
+ "source": [
272
+ "## Array of strains/stresses"
273
+ ]
274
+ },
275
+ {
276
+ "cell_type": "markdown",
277
+ "id": "8fc4a8a7-7d0e-4dac-af9b-03798a9063cd",
278
+ "metadata": {},
279
+ "source": [
280
+ "In order to simplify the syntax and speed up calculations, Elasticipy introduces the concept of *tensor array*. As an example, we create a combination of constant tensile strain (along $Z$) and a shear stress in $(X-Y)$ plane with increasing magnitude:"
281
+ ]
282
+ },
283
+ {
284
+ "cell_type": "code",
285
+ "execution_count": null,
286
+ "id": "02577cf3-492e-4a7b-b9c2-a3d7669aa536",
287
+ "metadata": {},
288
+ "outputs": [],
289
+ "source": [
290
+ "tau = range(100)\n",
291
+ "sigma = StressTensor.shear([1,0,0],[0,1,0],tau) + StressTensor.tensile([1,0,0],100)\n",
292
+ "print(sigma)"
293
+ ]
294
+ },
295
+ {
296
+ "cell_type": "markdown",
297
+ "id": "42f0a3cc-92c7-4766-8b66-48bde399cc46",
298
+ "metadata": {},
299
+ "source": [
300
+ "We can see the the resulting array is of shape (100,). Let's have a look of its end values:"
301
+ ]
302
+ },
303
+ {
304
+ "cell_type": "code",
305
+ "execution_count": null,
306
+ "id": "b656551c-051d-4250-bee0-a58645ca891e",
307
+ "metadata": {},
308
+ "outputs": [],
309
+ "source": [
310
+ "print(sigma[0]) # Chek out the usual syntax when dealing with array!\n",
311
+ "print(sigma[-1])"
312
+ ]
313
+ },
314
+ {
315
+ "cell_type": "markdown",
316
+ "id": "c47c6e4f-48f1-4dc1-9a2b-520b2ebfa00e",
317
+ "metadata": {},
318
+ "source": [
319
+ "Most Elasticipy's commands can be broadcasted. E.g.:"
320
+ ]
321
+ },
322
+ {
323
+ "cell_type": "code",
324
+ "execution_count": null,
325
+ "id": "2dfc031b-468b-4ecd-8731-26df6081251b",
326
+ "metadata": {},
327
+ "outputs": [],
328
+ "source": [
329
+ "print(sigma.vonMises())"
330
+ ]
331
+ },
332
+ {
333
+ "cell_type": "markdown",
334
+ "id": "518dfdfa-cba5-47bc-bf66-e5a412ddca64",
335
+ "metadata": {},
336
+ "source": [
337
+ "Conversely, the corresponding *strain array* can be computed at once:"
338
+ ]
339
+ },
340
+ {
341
+ "cell_type": "code",
342
+ "execution_count": null,
343
+ "id": "20693b88-d2ee-4c76-bdfe-4a49c925c64a",
344
+ "metadata": {},
345
+ "outputs": [],
346
+ "source": [
347
+ "eps = S * sigma\n",
348
+ "print(eps)"
349
+ ]
350
+ },
351
+ {
352
+ "cell_type": "markdown",
353
+ "id": "b6986051-2891-41d6-b1dd-0d6cbc108c23",
354
+ "metadata": {},
355
+ "source": [
356
+ "As ``sigma`` is an array of shape (100,), so is ``eps``."
357
+ ]
358
+ },
359
+ {
360
+ "cell_type": "code",
361
+ "execution_count": null,
362
+ "id": "59d18b21-a06e-4895-bebd-89552ecc9d7c",
363
+ "metadata": {},
364
+ "outputs": [],
365
+ "source": [
366
+ "print(eps[0])\n",
367
+ "print(eps[-1])"
368
+ ]
369
+ },
370
+ {
371
+ "cell_type": "markdown",
372
+ "id": "b74c682a-b4c5-46f6-8c87-78e2f82eec67",
373
+ "metadata": {},
374
+ "source": [
375
+ "## Mohr circles"
376
+ ]
377
+ },
378
+ {
379
+ "cell_type": "markdown",
380
+ "id": "632b2e81-cb5d-4845-ad15-1019097b6976",
381
+ "metadata": {},
382
+ "source": [
383
+ "Given a stress tensor, one can easily plot it through the well-known Mohr circles. E.g.:"
384
+ ]
385
+ },
386
+ {
387
+ "cell_type": "code",
388
+ "execution_count": null,
389
+ "id": "db04cad4-56ee-4857-8c74-44b5b26fc350",
390
+ "metadata": {},
391
+ "outputs": [],
392
+ "source": [
393
+ "fig,_= sigma[-1].draw_Mohr_circles() # Mohr circles drawn from the last stress value"
394
+ ]
395
+ },
396
+ {
397
+ "cell_type": "markdown",
398
+ "id": "b453d7d9-7b00-416e-98ef-b93497a03e9f",
399
+ "metadata": {},
400
+ "source": [
401
+ "## Anisotropic elasticity"
402
+ ]
403
+ },
404
+ {
405
+ "cell_type": "markdown",
406
+ "id": "8382b964-4b91-4d96-882b-0d8ee5a3882f",
407
+ "metadata": {},
408
+ "source": [
409
+ "We now consider the (slightly) more complex case of anisotropic elasticity. We use monoclinic TiNi as an example:"
410
+ ]
411
+ },
412
+ {
413
+ "cell_type": "code",
414
+ "execution_count": 41,
415
+ "id": "45ccb9b1-d114-49b9-81f7-8e07d213c365",
416
+ "metadata": {},
417
+ "outputs": [
418
+ {
419
+ "name": "stdout",
420
+ "output_type": "stream",
421
+ "text": [
422
+ "Stiffness tensor (in Voigt mapping):\n",
423
+ "[[231. 127. 104. 0. -18. 0.]\n",
424
+ " [127. 240. 131. 0. 1. 0.]\n",
425
+ " [104. 131. 175. 0. -3. 0.]\n",
426
+ " [ 0. 0. 0. 81. 0. 3.]\n",
427
+ " [-18. 1. -3. 0. 11. 0.]\n",
428
+ " [ 0. 0. 0. 3. 0. 85.]]\n",
429
+ "Phase: TiNi\n",
430
+ "Symmetry: monoclinic\n"
431
+ ]
432
+ }
433
+ ],
434
+ "source": [
435
+ "C = StiffnessTensor.monoclinic(phase_name='TiNi',\n",
436
+ " C11=231, C12=127, C13=104,\n",
437
+ " C22=240, C23=131, C33=175,\n",
438
+ " C44=81, C55=11, C66=85,\n",
439
+ " C15=-18, C25=1, C35=-3, C46=3)\n",
440
+ "print(C)"
441
+ ]
442
+ },
443
+ {
444
+ "cell_type": "markdown",
445
+ "id": "17ba0db9-7698-4109-b43f-9b0d027335ae",
446
+ "metadata": {},
447
+ "source": [
448
+ "One can check *how much* this material is anisotropic by checking out its Universal Anisotropy index:"
449
+ ]
450
+ },
451
+ {
452
+ "cell_type": "code",
453
+ "execution_count": 43,
454
+ "id": "716808b9-0ee7-41d9-88be-9540366013c3",
455
+ "metadata": {},
456
+ "outputs": [
457
+ {
458
+ "name": "stdout",
459
+ "output_type": "stream",
460
+ "text": [
461
+ "5.141009551641412\n"
462
+ ]
463
+ }
464
+ ],
465
+ "source": [
466
+ "print(C.universal_anisotropy)"
467
+ ]
468
+ },
469
+ {
470
+ "cell_type": "markdown",
471
+ "id": "5a68e42f-75a3-4163-80e6-c833a67244bc",
472
+ "metadata": {},
473
+ "source": [
474
+ "Because of this anisotropy, the Young modulus is not constant over every direction:"
475
+ ]
476
+ },
477
+ {
478
+ "cell_type": "code",
479
+ "execution_count": 44,
480
+ "id": "96bdf775-d86e-41fa-be32-c5da9dffde82",
481
+ "metadata": {},
482
+ "outputs": [
483
+ {
484
+ "name": "stdout",
485
+ "output_type": "stream",
486
+ "text": [
487
+ "Spherical function\n",
488
+ "Min=26.283577707639257, Max=191.39659146987594\n"
489
+ ]
490
+ }
491
+ ],
492
+ "source": [
493
+ "E = C.Young_modulus\n",
494
+ "print(E)"
495
+ ]
496
+ },
497
+ {
498
+ "cell_type": "markdown",
499
+ "id": "32e3771d-084b-4585-9663-9316e1a3ad56",
500
+ "metadata": {},
501
+ "source": [
502
+ "This means that E ranges in 26 to 191 GPa, depending on the tensile direction. For instance, its value measured along $X$, $Y$ and $Z$ are:"
503
+ ]
504
+ },
505
+ {
506
+ "cell_type": "code",
507
+ "execution_count": 45,
508
+ "id": "eec5eaa4-75e5-45bc-8328-1e5967f06375",
509
+ "metadata": {},
510
+ "outputs": [
511
+ {
512
+ "name": "stdout",
513
+ "output_type": "stream",
514
+ "text": [
515
+ "[124.5223244 120.92120855 96.13750722]\n"
516
+ ]
517
+ }
518
+ ],
519
+ "source": [
520
+ "print(E.eval([[1,0,0],[0,1,0],[0,0,1]]))"
521
+ ]
522
+ },
523
+ {
524
+ "cell_type": "markdown",
525
+ "id": "8592ea43-9939-4605-b5ef-10c2e2a8e68f",
526
+ "metadata": {},
527
+ "source": [
528
+ "### Plotting engineering elastic constants"
529
+ ]
530
+ },
531
+ {
532
+ "cell_type": "markdown",
533
+ "id": "1bdf1a27-0885-4b21-8abf-80810f8daa2a",
534
+ "metadata": {},
535
+ "source": [
536
+ "The spatial dependence of the Young modulus can illustrated by different ways:"
537
+ ]
538
+ },
539
+ {
540
+ "cell_type": "markdown",
541
+ "id": "00194008-ebf0-4781-bffe-7b2131eacf09",
542
+ "metadata": {},
543
+ "source": [
544
+ "#### As a 3D surface"
545
+ ]
546
+ },
547
+ {
548
+ "cell_type": "code",
549
+ "execution_count": 46,
550
+ "id": "f4c7c9de-de55-40c1-8c05-18ee124cbf0e",
551
+ "metadata": {},
552
+ "outputs": [
553
+ {
554
+ "data": {
555
+ "text/plain": [
556
+ "(<Figure size 640x480 with 2 Axes>,\n",
557
+ " <Axes3D: xlabel='X', ylabel='Y', zlabel='Z'>)"
558
+ ]
559
+ },
560
+ "execution_count": 46,
561
+ "metadata": {},
562
+ "output_type": "execute_result"
563
+ }
564
+ ],
565
+ "source": [
566
+ "E.plot3D()"
567
+ ]
568
+ },
569
+ {
570
+ "cell_type": "markdown",
571
+ "id": "88b0c672-4ef4-407c-a1ae-c22a262fa365",
572
+ "metadata": {},
573
+ "source": [
574
+ "#### As planar sections"
575
+ ]
576
+ },
577
+ {
578
+ "cell_type": "code",
579
+ "execution_count": 47,
580
+ "id": "2a483e1c-b144-4860-a395-edd5b5b40609",
581
+ "metadata": {},
582
+ "outputs": [
583
+ {
584
+ "data": {
585
+ "text/plain": [
586
+ "(<Figure size 640x480 with 3 Axes>,\n",
587
+ " [<PolarAxes: title={'center': 'X-Y plane'}>,\n",
588
+ " <PolarAxes: title={'center': 'X-Z plane'}>,\n",
589
+ " <PolarAxes: title={'center': 'Y-Z plane'}>])"
590
+ ]
591
+ },
592
+ "execution_count": 47,
593
+ "metadata": {},
594
+ "output_type": "execute_result"
595
+ }
596
+ ],
597
+ "source": [
598
+ "E.plot_xyz_sections()"
599
+ ]
600
+ },
601
+ {
602
+ "cell_type": "markdown",
603
+ "id": "56469662-df6b-4485-988c-91d595196a4d",
604
+ "metadata": {},
605
+ "source": [
606
+ "#### As a a pole figure"
607
+ ]
608
+ },
609
+ {
610
+ "cell_type": "code",
611
+ "execution_count": 51,
612
+ "id": "877bb12a-1b6a-4ebb-beab-35d2786c584d",
613
+ "metadata": {},
614
+ "outputs": [
615
+ {
616
+ "data": {
617
+ "text/plain": [
618
+ "(<Figure size 640x480 with 2 Axes>, <PolarAxes: >)"
619
+ ]
620
+ },
621
+ "execution_count": 51,
622
+ "metadata": {},
623
+ "output_type": "execute_result"
624
+ }
625
+ ],
626
+ "source": [
627
+ "E.plot_as_pole_figure() # Lambert projection (by default)"
628
+ ]
629
+ },
630
+ {
631
+ "cell_type": "markdown",
632
+ "id": "b43d6159-79ae-4091-ad89-ed0b50a5974d",
633
+ "metadata": {},
634
+ "source": [
635
+ "#### Hyperspherical functions"
636
+ ]
637
+ },
638
+ {
639
+ "cell_type": "markdown",
640
+ "id": "44a06116-ce51-4cf8-8ccd-8e6d0d2a642e",
641
+ "metadata": {},
642
+ "source": [
643
+ "This spatial dependence applies for other engineering moduli, like the Poisson ratio ($\\nu$), except that $\\nu$ depends on 2 orthogonal directions; hence the concept of *hyperspherical functions*:"
644
+ ]
645
+ },
646
+ {
647
+ "cell_type": "code",
648
+ "execution_count": null,
649
+ "id": "35d645d2-4854-4fb1-ad2a-0264171e943b",
650
+ "metadata": {},
651
+ "outputs": [],
652
+ "source": [
653
+ "nu=C.Poisson_ratio\n",
654
+ "print(nu)"
655
+ ]
656
+ },
657
+ {
658
+ "cell_type": "markdown",
659
+ "id": "0a7113cd-968c-42a5-9f52-6ffbce4b9921",
660
+ "metadata": {},
661
+ "source": [
662
+ "In this case, for a given direction, one can plot the mean value for every other orthogonal directions:"
663
+ ]
664
+ },
665
+ {
666
+ "cell_type": "code",
667
+ "execution_count": null,
668
+ "id": "6cd190bc-9edd-41df-ba89-ffa2618fd275",
669
+ "metadata": {},
670
+ "outputs": [],
671
+ "source": [
672
+ "nu.plot_xyz_sections()"
673
+ ]
674
+ },
675
+ {
676
+ "cell_type": "markdown",
677
+ "id": "008f15e2-e688-4765-825d-aa480322ccea",
678
+ "metadata": {},
679
+ "source": [
680
+ "Similarly, for a given direction, one can check out the min/max values for every orthogonal directions:"
681
+ ]
682
+ },
683
+ {
684
+ "cell_type": "code",
685
+ "execution_count": null,
686
+ "id": "bac514c9-a338-47a4-bdeb-48d5b7a9978a",
687
+ "metadata": {},
688
+ "outputs": [],
689
+ "source": [
690
+ "nu.plot_as_pole_figure(which='min')\n",
691
+ "nu.plot_as_pole_figure(which='max')"
692
+ ]
693
+ },
694
+ {
695
+ "cell_type": "markdown",
696
+ "id": "4811c4fb-592a-4e97-a956-386962517cc8",
697
+ "metadata": {},
698
+ "source": [
699
+ "## Rotations of tensors"
700
+ ]
701
+ },
702
+ {
703
+ "cell_type": "markdown",
704
+ "id": "32bc38a8-e2b8-485c-9e89-3451e8230413",
705
+ "metadata": {},
706
+ "source": [
707
+ "Any stiffness or compliance tensor can be rotated by taking advantage of ``scipy.spatial.transform``:"
708
+ ]
709
+ },
710
+ {
711
+ "cell_type": "markdown",
712
+ "id": "53ae6af9-24f4-4861-88db-62fe35b95622",
713
+ "metadata": {},
714
+ "source": [
715
+ "### Apply a single rotation"
716
+ ]
717
+ },
718
+ {
719
+ "cell_type": "markdown",
720
+ "id": "e938b627-bf1b-4dc5-aaf2-c8d321a64797",
721
+ "metadata": {},
722
+ "source": [
723
+ "Let's assume that we want to rotate the stiffness tensor by 45° aroung the $X$ direction:"
724
+ ]
725
+ },
726
+ {
727
+ "cell_type": "code",
728
+ "execution_count": null,
729
+ "id": "8647e572-7974-4d36-be15-e849e30e653a",
730
+ "metadata": {},
731
+ "outputs": [],
732
+ "source": [
733
+ "from scipy.spatial.transform import Rotation\n",
734
+ "rotation = Rotation.from_euler('X', 45, degrees=True)"
735
+ ]
736
+ },
737
+ {
738
+ "cell_type": "markdown",
739
+ "id": "bf98e161-9fa2-4af7-a548-8810cc0362fc",
740
+ "metadata": {},
741
+ "source": [
742
+ "The rotation of $C$ is simply made by multiplying it by the ``rotation`` object:"
743
+ ]
744
+ },
745
+ {
746
+ "cell_type": "code",
747
+ "execution_count": null,
748
+ "id": "b4fcb3d5",
749
+ "metadata": {},
750
+ "outputs": [],
751
+ "source": [
752
+ "C_rotated = C * rotation\n",
753
+ "print(C_rotated)"
754
+ ]
755
+ },
756
+ {
757
+ "cell_type": "markdown",
758
+ "id": "8bd1dff5-d802-43d7-b8c0-a05b7aaa0385",
759
+ "metadata": {},
760
+ "source": [
761
+ "One can check that the engineering properties have been rotated accordingly:"
762
+ ]
763
+ },
764
+ {
765
+ "cell_type": "code",
766
+ "execution_count": null,
767
+ "id": "426b9203-e368-4d9b-a602-c4c355ed3c47",
768
+ "metadata": {},
769
+ "outputs": [],
770
+ "source": [
771
+ "C_rotated.Young_modulus.plot3D()"
772
+ ]
773
+ },
774
+ {
775
+ "cell_type": "markdown",
776
+ "id": "46cd4969-75b0-4e75-9da4-30286e094221",
777
+ "metadata": {},
778
+ "source": [
779
+ "### Apply multiple rotations"
780
+ ]
781
+ },
782
+ {
783
+ "cell_type": "markdown",
784
+ "id": "809963dd-c8a2-4de4-8352-afc7e0ee612f",
785
+ "metadata": {},
786
+ "source": [
787
+ "As for stress and strain, one can perform multiple rotations at once, leading to an *array of stiffnesses*:"
788
+ ]
789
+ },
790
+ {
791
+ "cell_type": "code",
792
+ "execution_count": null,
793
+ "id": "9e9b9642-7d7f-4957-adbe-f6edbb9d1c53",
794
+ "metadata": {},
795
+ "outputs": [],
796
+ "source": [
797
+ "rotations = Rotation.random(100)\n",
798
+ "C_rotated = C * rotations\n",
799
+ "print(C_rotated)"
800
+ ]
801
+ },
802
+ {
803
+ "cell_type": "markdown",
804
+ "id": "8ea8c2ca-cc1c-4dac-98fb-c5e6d7d78b00",
805
+ "metadata": {},
806
+ "source": [
807
+ "This array can be used to compute the averages, such as the Hill average:"
808
+ ]
809
+ },
810
+ {
811
+ "cell_type": "code",
812
+ "execution_count": null,
813
+ "id": "400f155a-8efd-43ed-9f3a-d86720843209",
814
+ "metadata": {},
815
+ "outputs": [],
816
+ "source": [
817
+ "C_hill = C_rotated.Hill_average()\n",
818
+ "print(C_hill)"
819
+ ]
820
+ },
821
+ {
822
+ "cell_type": "markdown",
823
+ "id": "4bbaf4c2-6892-4e7e-ab4f-d778a9e88782",
824
+ "metadata": {},
825
+ "source": [
826
+ "One can check that such aggregate is almost isotropic:"
827
+ ]
828
+ },
829
+ {
830
+ "cell_type": "code",
831
+ "execution_count": null,
832
+ "id": "82bceb3b-537b-43d2-88e2-5d975bd358ff",
833
+ "metadata": {},
834
+ "outputs": [],
835
+ "source": [
836
+ "print(C_hill.universal_anisotropy)"
837
+ ]
838
+ },
839
+ {
840
+ "cell_type": "markdown",
841
+ "id": "da6a85e5-6fcf-40a8-a349-a4b1e5ee7115",
842
+ "metadata": {},
843
+ "source": [
844
+ "If one wants to consider an infinite set of rotations, he/she can compute the corresponding average from the single stiffness tensor. In this case, the analytic solution lead to:"
845
+ ]
846
+ },
847
+ {
848
+ "cell_type": "code",
849
+ "execution_count": null,
850
+ "id": "9a3ecd85-7c4b-476a-a095-296705cdd49d",
851
+ "metadata": {},
852
+ "outputs": [],
853
+ "source": [
854
+ "print(C.Hill_average())"
855
+ ]
856
+ },
857
+ {
858
+ "cell_type": "markdown",
859
+ "id": "03af1a3d-296a-4c2f-a046-62cdd90e56d9",
860
+ "metadata": {},
861
+ "source": [
862
+ "which is obviously strictly isotropic:"
863
+ ]
864
+ },
865
+ {
866
+ "cell_type": "code",
867
+ "execution_count": null,
868
+ "id": "d7fcab56-a227-4dbb-8d57-a2c054065131",
869
+ "metadata": {},
870
+ "outputs": [],
871
+ "source": [
872
+ "print(C.Hill_average().universal_anisotropy)\n",
873
+ "print(C.Hill_average().is_isotropic())"
874
+ ]
875
+ },
876
+ {
877
+ "cell_type": "markdown",
878
+ "id": "e82ebed1-7e52-4bfe-bce2-97d639735cae",
879
+ "metadata": {},
880
+ "source": [
881
+ "## Wave velocities"
882
+ ]
883
+ },
884
+ {
885
+ "cell_type": "markdown",
886
+ "id": "59e37776-6027-4b59-82ed-51b51badb589",
887
+ "metadata": {},
888
+ "source": [
889
+ "The stiffness tensor of a material is highly related to the wave propagation velocities. From a given material and a given direction, one can define three different wave velocities (namely the primary wave, fast secondary and slow secondary wave velocities). They can be computed as follows:"
890
+ ]
891
+ },
892
+ {
893
+ "cell_type": "code",
894
+ "execution_count": null,
895
+ "id": "e201c84f-c997-40cf-bab7-ef188def206c",
896
+ "metadata": {},
897
+ "outputs": [],
898
+ "source": [
899
+ "rho = 6.5 # kg/dm^3 !\n",
900
+ "v1, v2, v3 = C.wave_velocity(rho)\n",
901
+ "print(v1)"
902
+ ]
903
+ },
904
+ {
905
+ "cell_type": "markdown",
906
+ "id": "7bd48a08-864c-4e89-b57f-50103fce28f6",
907
+ "metadata": {},
908
+ "source": [
909
+ "Note that, in order to keep unit consistency, the mass density is provided in $\\text{kg}.\\text{dm}^{-3}$, whereas the stiffness tensor is given in GPa. Therefore, the wave velocities are returned in $\\text{km}.\\text{s}^{-1}$ here.\n",
910
+ "Let's plot the primary wave velocity as a 3D surface:"
911
+ ]
912
+ },
913
+ {
914
+ "cell_type": "code",
915
+ "execution_count": null,
916
+ "id": "e08789e0-b144-4dc8-8b82-a3b6f17fa302",
917
+ "metadata": {},
918
+ "outputs": [],
919
+ "source": [
920
+ "v1.plot3D()"
921
+ ]
922
+ },
923
+ {
924
+ "cell_type": "markdown",
925
+ "id": "63ceba08-acdf-4ab2-8edd-7a42fc57a6da",
926
+ "metadata": {},
927
+ "source": [
928
+ "## Graphical User Interface"
929
+ ]
930
+ },
931
+ {
932
+ "cell_type": "markdown",
933
+ "id": "cc3d9355-c56d-48ec-bc22-bd91553e8b45",
934
+ "metadata": {},
935
+ "source": [
936
+ "One convenient way to investigate the influence of symmetries on the engineering constants is to use the GUI:"
937
+ ]
938
+ },
939
+ {
940
+ "cell_type": "code",
941
+ "execution_count": 52,
942
+ "id": "e9d5e3d8-980a-4da5-a43a-f367356c33c0",
943
+ "metadata": {},
944
+ "outputs": [
945
+ {
946
+ "ename": "SystemExit",
947
+ "evalue": "0",
948
+ "output_type": "error",
949
+ "traceback": [
950
+ "An exception has occurred, use %tb to see the full traceback.\n",
951
+ "\u001b[1;31mSystemExit\u001b[0m\u001b[1;31m:\u001b[0m 0\n"
952
+ ]
953
+ },
954
+ {
955
+ "name": "stderr",
956
+ "output_type": "stream",
957
+ "text": [
958
+ "C:\\Users\\depriester\\AppData\\Local\\anaconda3\\Lib\\site-packages\\IPython\\core\\interactiveshell.py:3585: UserWarning: To exit: use 'exit', 'quit', or Ctrl-D.\n",
959
+ " warn(\"To exit: use 'exit', 'quit', or Ctrl-D.\", stacklevel=1)\n"
960
+ ]
961
+ }
962
+ ],
963
+ "source": [
964
+ "from Elasticipy.gui import crystal_elastic_plotter\n",
965
+ "crystal_elastic_plotter()"
966
+ ]
967
+ },
968
+ {
969
+ "cell_type": "code",
970
+ "execution_count": null,
971
+ "id": "43865853-6a97-43cc-8506-2b20e5fc5a75",
972
+ "metadata": {},
973
+ "outputs": [],
974
+ "source": []
975
+ }
976
+ ],
977
+ "metadata": {
978
+ "kernelspec": {
979
+ "display_name": "Python 3 (ipykernel)",
980
+ "language": "python",
981
+ "name": "python3"
982
+ },
983
+ "language_info": {
984
+ "codemirror_mode": {
985
+ "name": "ipython",
986
+ "version": 3
987
+ },
988
+ "file_extension": ".py",
989
+ "mimetype": "text/x-python",
990
+ "name": "python",
991
+ "nbconvert_exporter": "python",
992
+ "pygments_lexer": "ipython3",
993
+ "version": "3.13.5"
994
+ }
995
+ },
996
+ "nbformat": 4,
997
+ "nbformat_minor": 5
998
+ }