elasticipy 4.0.0__tar.gz → 4.1.1__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.
- {elasticipy-4.0.0 → elasticipy-4.1.1}/.github/workflows/Codecov.yml +1 -1
- {elasticipy-4.0.0 → elasticipy-4.1.1}/.readthedocs.yaml +1 -1
- elasticipy-4.1.1/CITATION.bib +17 -0
- elasticipy-4.1.1/CITATION.cff +11 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/CONTRIBUTING.md +1 -1
- {elasticipy-4.0.0 → elasticipy-4.1.1}/Examples/Elate_vs_Elasticipy.py +1 -1
- {elasticipy-4.0.0 → elasticipy-4.1.1}/Examples/Example_Stiffness_tensor.py +32 -10
- {elasticipy-4.0.0 → elasticipy-4.1.1}/Examples/Example_StressStrain_arrays.py +14 -19
- {elasticipy-4.0.0 → elasticipy-4.1.1}/Examples/Example_WaveVelocity.py +7 -8
- {elasticipy-4.0.0 → elasticipy-4.1.1}/Examples/SelfConsistent.py +7 -10
- {elasticipy-4.0.0 → elasticipy-4.1.1}/Examples/essai_plasticity.py +2 -3
- {elasticipy-4.0.0 → elasticipy-4.1.1}/Examples/example_readwrite.py +4 -2
- elasticipy-4.1.1/JOSS/YoungModulus.png +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/JOSS/paper.md +10 -9
- {elasticipy-4.0.0 → elasticipy-4.1.1}/PKG-INFO +23 -4
- {elasticipy-4.0.0 → elasticipy-4.1.1}/README.md +18 -2
- elasticipy-4.1.1/docs/source/Elasticipy.interfaces.FEPX.rst +7 -0
- elasticipy-4.1.1/docs/source/Elasticipy.interfaces.PRISMS.rst +7 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/docs/source/Elasticipy.rst +2 -1
- {elasticipy-4.0.0 → elasticipy-4.1.1}/docs/source/Tutorials/Plasticity.rst +7 -35
- {elasticipy-4.0.0 → elasticipy-4.1.1}/docs/source/Tutorials/Tutorial_StiffnessTensor.rst +12 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/docs/source/Tutorials/Tutorial_StressStrain.rst +42 -5
- {elasticipy-4.0.0 → elasticipy-4.1.1}/docs/source/Tutorials/Tutorial_wave-velocities.rst +8 -10
- elasticipy-4.1.1/docs/source/Tutorials/images/Mohr.png +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/docs/source/conf.py +5 -1
- {elasticipy-4.0.0 → elasticipy-4.1.1}/pyproject.toml +6 -3
- {elasticipy-4.0.0 → elasticipy-4.1.1}/requirements.txt +2 -1
- {elasticipy-4.0.0 → elasticipy-4.1.1}/src/Elasticipy/gui.py +1 -1
- elasticipy-4.1.1/src/Elasticipy/interfaces/FEPX.py +119 -0
- elasticipy-4.1.1/src/Elasticipy/interfaces/PRISMS.py +103 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/src/Elasticipy/plasticity.py +34 -1
- {elasticipy-4.0.0 → elasticipy-4.1.1}/src/Elasticipy/polefigure.py +21 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/src/Elasticipy/spherical_function.py +2 -14
- {elasticipy-4.0.0 → elasticipy-4.1.1}/src/Elasticipy/tensors/elasticity.py +171 -79
- {elasticipy-4.0.0 → elasticipy-4.1.1}/src/Elasticipy/tensors/fourth_order.py +126 -55
- elasticipy-4.1.1/src/Elasticipy/tensors/mapping.py +44 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/src/Elasticipy/tensors/second_order.py +107 -3
- {elasticipy-4.0.0 → elasticipy-4.1.1}/src/Elasticipy/tensors/stress_strain.py +20 -4
- {elasticipy-4.0.0 → elasticipy-4.1.1}/src/elasticipy.egg-info/PKG-INFO +23 -4
- {elasticipy-4.0.0 → elasticipy-4.1.1}/src/elasticipy.egg-info/SOURCES.txt +32 -1
- {elasticipy-4.0.0 → elasticipy-4.1.1}/src/elasticipy.egg-info/requires.txt +4 -1
- elasticipy-4.1.1/tests/interfaces/FEPX/simulation.sim/.sim +23 -0
- elasticipy-4.1.1/tests/interfaces/FEPX/simulation.sim/results/elts/defrate/defrate.step0 +2453 -0
- elasticipy-4.1.1/tests/interfaces/FEPX/simulation.sim/results/elts/defrate/defrate.step1 +2453 -0
- elasticipy-4.1.1/tests/interfaces/FEPX/simulation.sim/results/elts/defrate/defrate.step2 +2453 -0
- elasticipy-4.1.1/tests/interfaces/FEPX/simulation.sim/results/elts/ori/ori.step0 +2453 -0
- elasticipy-4.1.1/tests/interfaces/FEPX/simulation.sim/results/elts/ori/ori.step1 +2453 -0
- elasticipy-4.1.1/tests/interfaces/FEPX/simulation.sim/results/elts/ori/ori.step2 +2453 -0
- elasticipy-4.1.1/tests/interfaces/FEPX/simulation.sim/results/elts/spinrate/spinrate.step0 +2453 -0
- elasticipy-4.1.1/tests/interfaces/FEPX/simulation.sim/results/elts/spinrate/spinrate.step1 +2453 -0
- elasticipy-4.1.1/tests/interfaces/FEPX/simulation.sim/results/elts/spinrate/spinrate.step2 +2453 -0
- elasticipy-4.1.1/tests/interfaces/FEPX/simulation.sim/results/elts/strain/strain.step0 +2453 -0
- elasticipy-4.1.1/tests/interfaces/FEPX/simulation.sim/results/elts/strain/strain.step1 +2453 -0
- elasticipy-4.1.1/tests/interfaces/FEPX/simulation.sim/results/elts/strain/strain.step2 +2453 -0
- elasticipy-4.1.1/tests/interfaces/FEPX/simulation.sim/results/elts/stress/stress.step0 +2453 -0
- elasticipy-4.1.1/tests/interfaces/FEPX/simulation.sim/results/elts/stress/stress.step1 +2453 -0
- elasticipy-4.1.1/tests/interfaces/FEPX/simulation.sim/results/elts/stress/stress.step2 +2453 -0
- elasticipy-4.1.1/tests/interfaces/FEPX/simulation.sim/results/elts/velgrad/velgrad.step0 +2453 -0
- elasticipy-4.1.1/tests/interfaces/FEPX/simulation.sim/results/elts/velgrad/velgrad.step1 +2453 -0
- elasticipy-4.1.1/tests/interfaces/FEPX/simulation.sim/results/elts/velgrad/velgrad.step2 +2453 -0
- elasticipy-4.1.1/tests/interfaces/PRISMS/QuadratureOutputs.csv +64 -0
- elasticipy-4.1.1/tests/interfaces/PRISMS/stressstrain.txt +101 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/tests/test_FourthOrderTensors.py +4 -4
- {elasticipy-4.0.0 → elasticipy-4.1.1}/tests/test_SphericalFunction.py +1 -1
- {elasticipy-4.0.0 → elasticipy-4.1.1}/tests/test_StiffnessTensor.py +64 -29
- {elasticipy-4.0.0 → elasticipy-4.1.1}/tests/test_StressStrainTensors.py +36 -6
- {elasticipy-4.0.0 → elasticipy-4.1.1}/tests/test_ThermalExpansion.py +2 -2
- elasticipy-4.1.1/tests/test_interfaces_FEPX.py +51 -0
- elasticipy-4.1.1/tests/test_interfaces_prisms.py +66 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/tests/test_plasticity.py +22 -1
- elasticipy-4.0.0/JOSS/YoungModulus.png +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/.github/workflows/JOSS build.yml +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/.github/workflows/cloc.yml +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/.github/workflows/python-publish.yml +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/CODE_OF_CONDUCT.md +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/Examples/Elasticipy_vs_pymatgen.py +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/Examples/MaterialsProject.json +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/Examples/Multiple_phases.py +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/JOSS/ElasticipyVSpymatgen.png +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/JOSS/Nye.png +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/JOSS/Plot_E.png +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/JOSS/paper.bib +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/LICENSE +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/docs/_static/images/HyperSphericalCoordinates.png +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/docs/index.rst +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/docs/source/Elasticipy.plasticity.rst +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/docs/source/Elasticipy.spherical_function.rst +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/docs/source/Elasticipy.tensors.elasticity.rst +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/docs/source/Elasticipy.tensors.fourth_order.rst +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/docs/source/Elasticipy.tensors.second_order.rst +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/docs/source/Elasticipy.tensors.stress_strain.rst +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/docs/source/Tutorials/GUI.rst +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/docs/source/Tutorials/Tutorial_AveragingMethods.rst +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/docs/source/Tutorials/Tutorial_MultiplePhases.rst +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/docs/source/Tutorials/Tutorial_ReadWriteFiles.rst +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/docs/source/Tutorials/Tutorial_ThermalExpansion.rst +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/docs/source/Tutorials/images/Cyclic.png +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/docs/source/Tutorials/images/E_PF.png +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/docs/source/Tutorials/images/E_VRH_sections.png +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/docs/source/Tutorials/images/E_hill_fiber.png +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/docs/source/Tutorials/images/E_plot3D.png +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/docs/source/Tutorials/images/E_xyz_sections.png +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/docs/source/Tutorials/images/GUI.png +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/docs/source/Tutorials/images/G_plot3D.png +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/docs/source/Tutorials/images/G_plot3D_min.png +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/docs/source/Tutorials/images/G_xyz_sections.png +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/docs/source/Tutorials/images/Incremental.png +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/docs/source/Tutorials/images/Shear.png +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/docs/source/Tutorials/images/Stress-controlled.png +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/docs/source/Tutorials/images/StressStrain-controlled.png +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/docs/source/Tutorials/images/WaveVelocities.png +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/docs/source/Tutorials/images/plot_volumeFraction.png +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/docs/source/Tutorials.rst +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/docs/source/index.rst +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/docs/source/logo/favicon.png +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/docs/source/logo/logo.png +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/docs/source/logo/logo.svg +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/docs/source/logo/logo_text.png +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/docs/source/logo/logo_text.svg +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/docs/source/logo/logo_text_whitebg.png +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/docs/source/modules.rst +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/setup.cfg +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/src/Elasticipy/FourthOrderTensor.py +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/src/Elasticipy/StressStrainTensors.py +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/src/Elasticipy/ThermalExpansion.py +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/src/Elasticipy/__init__.py +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/src/Elasticipy/crystal_symmetries.py +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/src/Elasticipy/tensors/__init__.py +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/src/Elasticipy/tensors/thermal_expansion.py +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/src/elasticipy.egg-info/dependency_links.txt +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/src/elasticipy.egg-info/top_level.txt +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/tests/MaterialsProject.json +0 -0
- {elasticipy-4.0.0 → elasticipy-4.1.1}/tests/__init__.py +0 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
@software{dorian_depriester_2025_15188346,
|
|
2
|
+
author = {Dorian Depriester},
|
|
3
|
+
title = {DorianDepriester/Elasticipy: v4.0.0},
|
|
4
|
+
month = apr,
|
|
5
|
+
year = 2025,
|
|
6
|
+
publisher = {Zenodo},
|
|
7
|
+
version = {v4.0.0},
|
|
8
|
+
doi = {10.5281/zenodo.15188346},
|
|
9
|
+
url = {https://doi.org/10.5281/zenodo.15188346},
|
|
10
|
+
swhid = {swh:1:dir:f9538575fb87ee10510bd51906012987986fc36a
|
|
11
|
+
;origin=https://doi.org/10.5281/zenodo.14501849;vi
|
|
12
|
+
sit=swh:1:snp:20bf603cb1ae305b4d37a4567557ac860e09
|
|
13
|
+
d3e5;anchor=swh:1:rel:6dad2d91dcebe09e35d44f82a0c8
|
|
14
|
+
a46c77f0d057;path=DorianDepriester-
|
|
15
|
+
Elasticipy-c8bfc05
|
|
16
|
+
},
|
|
17
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
cff-version: 1.2.0
|
|
2
|
+
message: "If you use this software, please cite it as below."
|
|
3
|
+
authors:
|
|
4
|
+
- family-names: "Depriester"
|
|
5
|
+
given-names: "Dorian"
|
|
6
|
+
orcid: "https://orcid.org/0000-0002-2881-8942"
|
|
7
|
+
title: "Elasticipy"
|
|
8
|
+
version: 4.0.0
|
|
9
|
+
doi: 10.5281/zenodo.15188346
|
|
10
|
+
date-released: 2025-04-10
|
|
11
|
+
url: "https://github.com/DorianDepriester/Elasticipy"
|
|
@@ -25,7 +25,7 @@ All types of contributions are encouraged and valued. See the [Table of Contents
|
|
|
25
25
|
## Code of Conduct
|
|
26
26
|
|
|
27
27
|
This project and everyone participating in it is governed by the
|
|
28
|
-
[Elasticipy Code of Conduct](https://github.com/DorianDepriester/Elasticipy/blob
|
|
28
|
+
[Elasticipy Code of Conduct](https://github.com/DorianDepriester/Elasticipy/blob/main/CODE_OF_CONDUCT.md).
|
|
29
29
|
By participating, you are expected to uphold this code. Please report unacceptable behavior
|
|
30
30
|
to <dorian.dep@gmail.com>.
|
|
31
31
|
|
|
@@ -13,7 +13,7 @@ C = StiffnessTensor.monoclinic(phase_name='TiNi',
|
|
|
13
13
|
C22=240, C23=131, C33=175,
|
|
14
14
|
C44=81, C55=11, C66=85,
|
|
15
15
|
C15=-18, C25=1, C35=-3, C46=3)
|
|
16
|
-
Celate = Elastic(list(C.
|
|
16
|
+
Celate = Elastic(list(C._matrix))
|
|
17
17
|
|
|
18
18
|
# Plotting with Elate
|
|
19
19
|
start_time=time.perf_counter()
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
from Elasticipy.tensors.elasticity import StiffnessTensor
|
|
2
2
|
from scipy.spatial.transform import Rotation
|
|
3
|
+
|
|
4
|
+
################################################
|
|
5
|
+
# The lines below are only required in PyCharm
|
|
6
|
+
################################################
|
|
3
7
|
import matplotlib as mpl
|
|
4
|
-
mpl.use('Qt5Agg')
|
|
8
|
+
mpl.use('Qt5Agg')
|
|
9
|
+
from qtpy import QtWidgets
|
|
10
|
+
app = QtWidgets.QApplication.instance() or QtWidgets.QApplication([])
|
|
11
|
+
################################################
|
|
5
12
|
|
|
6
13
|
# First, let consider the NiTi material:
|
|
7
14
|
C = StiffnessTensor.fromCrystalSymmetry(symmetry='monoclinic', diad='y', phase_name='TiNi',
|
|
@@ -15,29 +22,43 @@ print(C)
|
|
|
15
22
|
E = C.Young_modulus
|
|
16
23
|
# See min/max values
|
|
17
24
|
print(E)
|
|
25
|
+
|
|
18
26
|
# Now illustrate the spatial dependence
|
|
19
|
-
E.plot_xyz_sections() # As 2D sections...
|
|
20
|
-
|
|
21
|
-
E.
|
|
27
|
+
fig,_ = E.plot_xyz_sections() # As 2D sections...
|
|
28
|
+
fig.show()
|
|
29
|
+
fig,_ = E.plot3D() # ...or in 3D
|
|
30
|
+
fig.show()
|
|
31
|
+
fig,_ =E.plot_as_pole_figure() # or even with PF
|
|
32
|
+
fig.show()
|
|
33
|
+
|
|
34
|
+
# Print out the maximum value for the Young modulus
|
|
22
35
|
print(E.max())
|
|
23
36
|
|
|
24
37
|
# Apply a random rotation on stiffness tensor
|
|
25
38
|
rotation = Rotation.from_euler('ZXZ', [90, 45, 0], degrees=True)
|
|
26
39
|
Crot = C*rotation
|
|
27
40
|
# Check that the Young modulus has changed as well
|
|
28
|
-
Crot.Young_modulus.plot3D()
|
|
41
|
+
fig, _ = Crot.Young_modulus.plot3D()
|
|
42
|
+
fig.show()
|
|
29
43
|
|
|
30
44
|
# Now let's consider the shear modulus
|
|
31
45
|
G = C.shear_modulus
|
|
32
|
-
G.plot_xyz_sections() # Plot sections with min, max and mean
|
|
33
|
-
|
|
46
|
+
fig,_ = G.plot_xyz_sections() # Plot sections with min, max and mean
|
|
47
|
+
fig.show()
|
|
48
|
+
|
|
49
|
+
fig,_ = G.plot3D() # And plot it in 3D
|
|
50
|
+
fig.show()
|
|
34
51
|
print(G.min())
|
|
35
52
|
print(G.max())
|
|
36
53
|
|
|
37
54
|
# Finally, let's have a look on the Poisson ratio
|
|
38
55
|
nu = C.Poisson_ratio
|
|
39
|
-
nu.plot_xyz_sections()
|
|
40
|
-
|
|
56
|
+
fig,_ = nu.plot_xyz_sections()
|
|
57
|
+
fig.show()
|
|
58
|
+
fig,_ = nu.plot3D(which='max')
|
|
59
|
+
fig.show()
|
|
60
|
+
|
|
61
|
+
# Check out the maximum and minimum values
|
|
41
62
|
print(nu.min())
|
|
42
63
|
print(nu.max())
|
|
43
64
|
|
|
@@ -45,7 +66,8 @@ print(nu.max())
|
|
|
45
66
|
oris = Rotation.random(1000)
|
|
46
67
|
Crotated = C*oris # Compute the Voigt average
|
|
47
68
|
Cvoigt = Crotated.Voigt_average()
|
|
48
|
-
print(Cvoigt.Young_modulus) # Look at the corresponding Young
|
|
69
|
+
print(Cvoigt.Young_modulus) # Look at the corresponding Young moduli
|
|
49
70
|
print(C.Voigt_average().Young_modulus) # Compare with infinite number of orientations
|
|
50
71
|
|
|
51
72
|
|
|
73
|
+
app.exec() # Only required in PyCharm (see lines 7-10)
|
|
@@ -1,30 +1,25 @@
|
|
|
1
|
-
# ======================================================
|
|
2
|
-
# Imports and simple example of stress
|
|
3
|
-
# ======================================================
|
|
4
1
|
import numpy as np
|
|
5
2
|
from Elasticipy.tensors.stress_strain import StressTensor, StrainTensor
|
|
3
|
+
from Elasticipy.tensors.elasticity import StiffnessTensor
|
|
4
|
+
from scipy.spatial.transform import Rotation
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
# ======================================================
|
|
7
|
+
# Simple example of stress
|
|
8
|
+
# ======================================================
|
|
9
|
+
stress = StressTensor.shear([1,0,0],[0,1,0],1)
|
|
11
10
|
print(stress.vonMises())
|
|
12
11
|
print(stress.Tresca())
|
|
13
12
|
|
|
14
13
|
# ======================================================
|
|
15
14
|
# Simple example of strain
|
|
16
15
|
# ======================================================
|
|
17
|
-
strain = StrainTensor([[0,
|
|
18
|
-
[1e-3, 0, 0],
|
|
19
|
-
[0, 0, 0]])
|
|
16
|
+
strain = StrainTensor.shear([1,0,0],[0,1,0],1e-3)
|
|
20
17
|
print(strain.principal_strains())
|
|
21
18
|
print(strain.volumetric_strain())
|
|
22
19
|
|
|
23
20
|
# ======================================================
|
|
24
21
|
# Linear elasticity
|
|
25
22
|
# ======================================================
|
|
26
|
-
from Elasticipy.tensors.elasticity import StiffnessTensor
|
|
27
|
-
|
|
28
23
|
C = StiffnessTensor.fromCrystalSymmetry(symmetry='cubic', phase_name='ferrite',
|
|
29
24
|
C11=274, C12=175, C44=89)
|
|
30
25
|
print(C)
|
|
@@ -34,15 +29,14 @@ print(sigma)
|
|
|
34
29
|
|
|
35
30
|
S = C.inv()
|
|
36
31
|
print(S)
|
|
37
|
-
|
|
38
32
|
print(S * sigma)
|
|
39
33
|
|
|
40
34
|
# ======================================================
|
|
41
35
|
# Multidimensional tensor arrays
|
|
42
36
|
# ======================================================
|
|
43
37
|
n_array = 10
|
|
44
|
-
|
|
45
|
-
sigma
|
|
38
|
+
sigma_xy = np.linspace(0, 100, n_array)
|
|
39
|
+
sigma = StressTensor.shear([1,0,0], [0,1,0],sigma_xy)
|
|
46
40
|
print(sigma[0]) # Check the initial value of the stress...
|
|
47
41
|
print(sigma[-1]) # ...and the final value.
|
|
48
42
|
|
|
@@ -56,12 +50,10 @@ print(energy) # print the elastic energy
|
|
|
56
50
|
# ======================================================
|
|
57
51
|
# Apply random rotations
|
|
58
52
|
# ======================================================
|
|
59
|
-
from scipy.spatial.transform import Rotation
|
|
60
|
-
|
|
61
53
|
n_ori = 1000
|
|
62
54
|
rotations = Rotation.random(n_ori)
|
|
63
55
|
|
|
64
|
-
eps_rotated = eps.
|
|
56
|
+
eps_rotated = eps.rotate(rotations, mode='cross')
|
|
65
57
|
print(eps_rotated.shape) # Just to check how it looks like
|
|
66
58
|
|
|
67
59
|
sigma_rotated = C * eps_rotated
|
|
@@ -72,7 +64,10 @@ sigma_mean = sigma.mean(axis=1) # Compute the mean over all orientations
|
|
|
72
64
|
print(sigma_mean[-1])
|
|
73
65
|
|
|
74
66
|
C_rotated = C * rotations
|
|
75
|
-
C_Voigt = C_rotated.Voigt_average()
|
|
67
|
+
C_Voigt = C_rotated.Voigt_average() # Now check that the previous result is consistent with Voigt average
|
|
76
68
|
sigma_Voigt = C_Voigt * eps
|
|
77
69
|
print(sigma_Voigt[-1])
|
|
78
70
|
|
|
71
|
+
fig, ax = sigma_Voigt[-1].draw_Mohr_circles()
|
|
72
|
+
fig.show()
|
|
73
|
+
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
from Elasticipy.tensors.elasticity import StiffnessTensor
|
|
2
|
-
|
|
3
|
-
mpl.use('Qt5Agg') # Ensure interactive plot
|
|
2
|
+
from matplotlib import pyplot as plt
|
|
4
3
|
|
|
5
|
-
C = StiffnessTensor.fromCrystalSymmetry(symmetry='
|
|
4
|
+
C = StiffnessTensor.fromCrystalSymmetry(symmetry='orthorhombic', phase_name='forsterite',
|
|
6
5
|
C11=320, C12=68.2, C13=71.6,
|
|
7
6
|
C22=196.5, C23=76.8, C33=233.5, C44=64, C55=77, C66=78.7)
|
|
8
7
|
rho = 3.355
|
|
9
8
|
|
|
10
9
|
cp, cs_fast, cs_slow = C.wave_velocity(rho)
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
fig = plt.figure(figsize=(12,4))
|
|
11
|
+
cp.plot_as_pole_figure(subplot_args=(131,), title='p wave', fig=fig)
|
|
12
|
+
cs_fast.plot_as_pole_figure(subplot_args=(132,), title='s wave (fast)', fig=fig)
|
|
13
|
+
cs_slow.plot_as_pole_figure(subplot_args=(133,), title='s wave (slow)', fig=fig)
|
|
14
|
+
fig.show()
|
|
@@ -27,7 +27,7 @@ def polarization_tensor(C_macro_local, a1, a2, a3, n_phi, n_theta):
|
|
|
27
27
|
|
|
28
28
|
def localization_tensor(C_macro_local, C_incl, n_phi, n_theta, a1, a2, a3):
|
|
29
29
|
E = polarization_tensor(C_macro_local, a1, a2, a3, n_phi, n_theta)
|
|
30
|
-
delta = FourthOrderTensor(C_incl.
|
|
30
|
+
delta = FourthOrderTensor(C_incl._matrix - C_macro_local._matrix)
|
|
31
31
|
Ainv = E.ddot(delta) + I
|
|
32
32
|
return Ainv.inv()
|
|
33
33
|
|
|
@@ -53,13 +53,13 @@ def Kroner_Eshelby(Ci, g, method='strain', max_iter=5, atol=1e-3, rtol=1e-3, dis
|
|
|
53
53
|
Q = Ci_rotated.ddot(A)
|
|
54
54
|
if method=='stress':
|
|
55
55
|
CiAi_mean = Q.mean()
|
|
56
|
-
C_macro = StiffnessTensor.from_Kelvin(CiAi_mean.
|
|
56
|
+
C_macro = StiffnessTensor.from_Kelvin(CiAi_mean._matrix, force_symmetries=True)
|
|
57
57
|
err = A.mean() - FourthOrderTensor.identity()
|
|
58
58
|
else:
|
|
59
59
|
B = Q.ddot(C_macro.inv())
|
|
60
60
|
R = Ci_rotated.inv().ddot(B)
|
|
61
61
|
R_mean = R.mean()
|
|
62
|
-
C_macro = StiffnessTensor.from_Kelvin(R_mean.inv().
|
|
62
|
+
C_macro = StiffnessTensor.from_Kelvin(R_mean.inv()._matrix, force_symmetries=True)
|
|
63
63
|
err = B.mean() - FourthOrderTensor.identity()
|
|
64
64
|
|
|
65
65
|
# Stopping criteria
|
|
@@ -77,13 +77,10 @@ def Kroner_Eshelby(Ci, g, method='strain', max_iter=5, atol=1e-3, rtol=1e-3, dis
|
|
|
77
77
|
if k == max_iter:
|
|
78
78
|
keep_on = False
|
|
79
79
|
if display:
|
|
80
|
-
err = np.max(np.abs(err.
|
|
80
|
+
err = np.max(np.abs(err._matrix))
|
|
81
81
|
print('Iter #{}: abs. change={:0.5f}; rel. change={:0.5f}; error={:0.5f}'.format(k, max_abs_change, rel_change,err))
|
|
82
82
|
return C_macro, message
|
|
83
83
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
orientations = Rotation.random(100, random_state=1234)
|
|
88
|
-
Cstrip = StiffnessTensor.cubic(C11=186, C12=134, C44=77)
|
|
89
|
-
C_stress, reason = Kroner_Eshelby(Cstrip, orientations, display=True, method='strain')
|
|
84
|
+
C=StiffnessTensor.cubic(C11=108, C44=28.3, C12=62)
|
|
85
|
+
orientations = Rotation.random(1000)
|
|
86
|
+
Cmacro, msg = Kroner_Eshelby(C, orientations, method='stress', display=True)
|
|
@@ -3,8 +3,6 @@ from Elasticipy.tensors.stress_strain import StressTensor, StrainTensor
|
|
|
3
3
|
from Elasticipy.tensors.elasticity import StiffnessTensor
|
|
4
4
|
import numpy as np
|
|
5
5
|
from matplotlib import pyplot as plt
|
|
6
|
-
import matplotlib as mpl
|
|
7
|
-
mpl.use('Qt5Agg') # Ensure interactive plot
|
|
8
6
|
|
|
9
7
|
|
|
10
8
|
JC = JohnsonCook(A=363, B=792.7122, n=0.5756) # https://doi.org/10.1016/j.matpr.2020.05.213
|
|
@@ -70,4 +68,5 @@ for j, model in enumerate(models):
|
|
|
70
68
|
ax.plot(eps_xy, stress_mag, label=labels[j])
|
|
71
69
|
ax.set_xlabel(r'$\varepsilon_{xy}$')
|
|
72
70
|
ax.set_ylabel('Shear stress (MPa)')
|
|
73
|
-
ax.legend()
|
|
71
|
+
ax.legend()
|
|
72
|
+
fig.show()
|
|
@@ -2,9 +2,11 @@ from Elasticipy.tensors.elasticity import StiffnessTensor
|
|
|
2
2
|
|
|
3
3
|
C = StiffnessTensor.from_MP("mp-1048")
|
|
4
4
|
C.save_to_txt("TiNi.txt")
|
|
5
|
-
C.save_to_txt("TiNi.txt", matrix_only=True)
|
|
5
|
+
C.save_to_txt("TiNi-matrix.txt", matrix_only=True)
|
|
6
6
|
|
|
7
7
|
C2 = StiffnessTensor.from_txt_file("TiNi.txt")
|
|
8
|
-
|
|
8
|
+
C3 = StiffnessTensor.from_txt_file("TiNi-matrix.txt")
|
|
9
|
+
print(C==C2)
|
|
10
|
+
print(C==C3)
|
|
9
11
|
|
|
10
12
|
|
|
Binary file
|
|
@@ -112,7 +112,7 @@ orthogonal sections.
|
|
|
112
112
|
|
|
113
113
|
![Young modulus (GPa) of Cu single crystal as a 3D surface (a) or a pole figure (b);
|
|
114
114
|
Young modulus of Cu polycrystal with $[001]$ fiber texture, plotted in three orthogonal sections, depending on the
|
|
115
|
-
averaging method. \label{fig:Young}](YoungModulus.png)
|
|
115
|
+
averaging method (c). \label{fig:Young}](YoungModulus.png)
|
|
116
116
|
|
|
117
117
|
Elasticipy also introduces the concept of *tensor arrays*, in a similar way as in MTEX [@MTEX], allowing to
|
|
118
118
|
process several tensors at once with simple and highly efficient commands. In order to highlight the performances
|
|
@@ -136,19 +136,20 @@ to other averaging methods (e.g. self-consistent models), possibly beyond linear
|
|
|
136
136
|
with ease. It already implements thermal expansion.
|
|
137
137
|
|
|
138
138
|
# Usage
|
|
139
|
+
This section presents the syntaxes of few basic operations performed with Elasticipy v4.0.0.
|
|
139
140
|
|
|
140
141
|
## Plot directional engineering constants
|
|
141
142
|
|
|
142
143
|
\autoref{fig:Young}.a) and b) were rendered with the following syntax:
|
|
143
144
|
|
|
144
145
|
````python
|
|
145
|
-
|
|
146
146
|
from Elasticipy.tensors.elasticity import StiffnessTensor
|
|
147
|
-
|
|
148
147
|
C = StiffnessTensor.cubic(C11=186, C12=134, C44=77)
|
|
149
148
|
E = C.Young_modulus
|
|
150
|
-
E.plot3D(n_phi=500, n_theta=500)
|
|
151
|
-
|
|
149
|
+
fig, _ = E.plot3D(n_phi=500, n_theta=500)
|
|
150
|
+
fig.show()
|
|
151
|
+
fig, _ = E.plot_as_pole_figure()
|
|
152
|
+
fig.show()
|
|
152
153
|
````
|
|
153
154
|
|
|
154
155
|
## Create an array of rotated stiffness tensors and compute average
|
|
@@ -162,7 +163,7 @@ n = 10000
|
|
|
162
163
|
phi1 = np.random.random(n)*2*np.pi # Random sampling from 0 to 2pi
|
|
163
164
|
Euler_angles = np.array([phi1, np.zeros(n), np.zeros(n)]).T # Fibre texture
|
|
164
165
|
rotations = Rotation.from_euler('ZXZ', Euler_angles) # Bunge-Euler angles
|
|
165
|
-
C_rotated = C * rotations # n-
|
|
166
|
+
C_rotated = C * rotations # n-length tensor array
|
|
166
167
|
````
|
|
167
168
|
|
|
168
169
|
Then, the Voigt--Reuss--Hill average [@hill] can be computed from the tensor array:
|
|
@@ -174,7 +175,8 @@ C_VRH = C_rotated.Hill_average()
|
|
|
174
175
|
Finally, the corresponding Young moduli can be plotted in orthogonal sections, as shown in \autoref{fig:Young}.c), with:
|
|
175
176
|
|
|
176
177
|
````python
|
|
177
|
-
C_VRH.Young_modulus.plot_xyz_sections()
|
|
178
|
+
fig, ax = C_VRH.Young_modulus.plot_xyz_sections()
|
|
179
|
+
fig.show()
|
|
178
180
|
````
|
|
179
181
|
|
|
180
182
|
## Arrays of stress/strain tensor
|
|
@@ -184,7 +186,6 @@ will create a tensor array corresponding to evenly-spaced strain along $[1,0,0]$
|
|
|
184
186
|
|
|
185
187
|
````python
|
|
186
188
|
from Elasticipy.tensors.stress_strain import StrainTensor
|
|
187
|
-
|
|
188
189
|
m = 1000 # length of tensor array
|
|
189
190
|
mag = np.linspace(0, 0.1, m) # Strain magnitude
|
|
190
191
|
strain = StrainTensor.tensile([1, 0, 0], mag)
|
|
@@ -194,7 +195,7 @@ Given the stiffness tensor ``C`` (see above), one can compute the corresponding
|
|
|
194
195
|
````python
|
|
195
196
|
stress = C * strain
|
|
196
197
|
````
|
|
197
|
-
Finally, ``stress.
|
|
198
|
+
Finally, ``stress.vonMises()`` returns an array of length ``n`` and data type ``float64``, providing all the
|
|
198
199
|
corresponding von Mises equivalent stresses.
|
|
199
200
|
|
|
200
201
|
# References
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: elasticipy
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.1.1
|
|
4
4
|
Summary: A Python library for elasticity tensor computations
|
|
5
5
|
Author-email: Dorian Depriester <dorian.dep@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -15,18 +15,21 @@ Classifier: Programming Language :: Python
|
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.10
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.11
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
-
Requires-Python: >=3.
|
|
18
|
+
Requires-Python: >=3.11
|
|
19
19
|
Description-Content-Type: text/markdown
|
|
20
20
|
License-File: LICENSE
|
|
21
21
|
Requires-Dist: numpy
|
|
22
22
|
Requires-Dist: scipy
|
|
23
23
|
Requires-Dist: matplotlib
|
|
24
|
+
Requires-Dist: qtpy
|
|
25
|
+
Requires-Dist: pyqt5
|
|
26
|
+
Requires-Dist: pandas
|
|
24
27
|
Provides-Extra: dev
|
|
25
28
|
Requires-Dist: pytest; extra == "dev"
|
|
26
29
|
Requires-Dist: pytest-cov; extra == "dev"
|
|
27
30
|
Requires-Dist: pymatgen; extra == "dev"
|
|
28
31
|
Requires-Dist: orix; extra == "dev"
|
|
29
|
-
Requires-Dist: mp_api; extra == "dev"
|
|
32
|
+
Requires-Dist: mp_api==0.45.9; extra == "dev"
|
|
30
33
|
Dynamic: license-file
|
|
31
34
|
|
|
32
35
|
[](https://pypi.org/project/elasticipy/)
|
|
@@ -48,7 +51,7 @@ Among other features, this package implements:
|
|
|
48
51
|
|
|
49
52
|
- Computation of elasticity tensors,
|
|
50
53
|
- Analysis of elastic anisotropy and wave propagation,
|
|
51
|
-
- Working with multidimensional arrays of
|
|
54
|
+
- Working with multidimensional arrays of tensors,
|
|
52
55
|
- Thermal expansion tensors,
|
|
53
56
|
- Rotation of tensors,
|
|
54
57
|
- Integration with crystal symmetry groups,
|
|
@@ -79,3 +82,19 @@ Certain parts of the code, particularly those related to graphical user interfac
|
|
|
79
82
|
**excluded from code coverage analysis**. This includes the following file:
|
|
80
83
|
|
|
81
84
|
- **`src/Elasticipy/gui.py`**
|
|
85
|
+
|
|
86
|
+
## Cite this package
|
|
87
|
+
If you use Elasticipy, please cite [](https://doi.org/10.5281/zenodo.14501849)
|
|
88
|
+
|
|
89
|
+
You can use the following BibTeX entry:
|
|
90
|
+
````bibtex
|
|
91
|
+
@software{Elasticipy,
|
|
92
|
+
author = {Depriester, Dorian},
|
|
93
|
+
doi = {10.5281/zenodo.15188346},
|
|
94
|
+
month = apr,
|
|
95
|
+
title = {{Elasticipy}},
|
|
96
|
+
url = {https://github.com/DorianDepriester/Elasticipy},
|
|
97
|
+
version = {4.0.0},
|
|
98
|
+
year = {2025}
|
|
99
|
+
}
|
|
100
|
+
````
|
|
@@ -17,7 +17,7 @@ Among other features, this package implements:
|
|
|
17
17
|
|
|
18
18
|
- Computation of elasticity tensors,
|
|
19
19
|
- Analysis of elastic anisotropy and wave propagation,
|
|
20
|
-
- Working with multidimensional arrays of
|
|
20
|
+
- Working with multidimensional arrays of tensors,
|
|
21
21
|
- Thermal expansion tensors,
|
|
22
22
|
- Rotation of tensors,
|
|
23
23
|
- Integration with crystal symmetry groups,
|
|
@@ -47,4 +47,20 @@ The project uses unit tests with `pytest` and coverage reports generated using `
|
|
|
47
47
|
Certain parts of the code, particularly those related to graphical user interfaces (GUIs) or visual plotting, are
|
|
48
48
|
**excluded from code coverage analysis**. This includes the following file:
|
|
49
49
|
|
|
50
|
-
- **`src/Elasticipy/gui.py`**
|
|
50
|
+
- **`src/Elasticipy/gui.py`**
|
|
51
|
+
|
|
52
|
+
## Cite this package
|
|
53
|
+
If you use Elasticipy, please cite [](https://doi.org/10.5281/zenodo.14501849)
|
|
54
|
+
|
|
55
|
+
You can use the following BibTeX entry:
|
|
56
|
+
````bibtex
|
|
57
|
+
@software{Elasticipy,
|
|
58
|
+
author = {Depriester, Dorian},
|
|
59
|
+
doi = {10.5281/zenodo.15188346},
|
|
60
|
+
month = apr,
|
|
61
|
+
title = {{Elasticipy}},
|
|
62
|
+
url = {https://github.com/DorianDepriester/Elasticipy},
|
|
63
|
+
version = {4.0.0},
|
|
64
|
+
year = {2025}
|
|
65
|
+
}
|
|
66
|
+
````
|
|
@@ -75,33 +75,6 @@ That's all. Finally, let us plot the applied stress as a function of the overall
|
|
|
75
75
|
>>> ax.set_xlabel(r'$\varepsilon_{xx}$') # doctest: +SKIP
|
|
76
76
|
>>> ax.set_ylabel('Tensile stress (MPa)') # doctest: +SKIP
|
|
77
77
|
|
|
78
|
-
Now, let say that we want to investigate the material's response for the tensile stress ranging from 0 to 725 MPa:
|
|
79
|
-
|
|
80
|
-
>>> import numpy as np
|
|
81
|
-
>>> n_step = 100
|
|
82
|
-
>>> stress_mag = np.linspace(0, 725, n_step)
|
|
83
|
-
>>> stress = StressTensor.tensile([1,0,0], stress_mag)
|
|
84
|
-
|
|
85
|
-
At least, we can directly compute the elastic strain for each step:
|
|
86
|
-
|
|
87
|
-
>>> elastic_strain = C.inv() * stress
|
|
88
|
-
|
|
89
|
-
So now, the plastic strain can be computed using an iterative approach:
|
|
90
|
-
|
|
91
|
-
>>> plastic_strain = StrainTensor.zeros(n_step)
|
|
92
|
-
>>> for i in range(1, n_step):
|
|
93
|
-
... strain_increment = JC.compute_strain_increment(stress[i])
|
|
94
|
-
... plastic_strain[i] = plastic_strain[i-1] + strain_increment
|
|
95
|
-
|
|
96
|
-
That's all. Finally, let us plot the applied stress as a function of the overall elongation:
|
|
97
|
-
|
|
98
|
-
>>> from matplotlib import pyplot as plt
|
|
99
|
-
>>> elong = elastic_strain.C[0,0]+plastic_strain.C[0,0]
|
|
100
|
-
>>> fig, ax = plt.subplots()
|
|
101
|
-
>>> ax.plot(elong, stress_mag, label='Stress-controlled') # doctest: +SKIP
|
|
102
|
-
>>> ax.set_xlabel(r'$\varepsilon_{xx}$') # doctest: +SKIP
|
|
103
|
-
>>> ax.set_ylabel('Tensile stress (MPa)') # doctest: +SKIP
|
|
104
|
-
|
|
105
78
|
.. image:: images/Stress-controlled.png
|
|
106
79
|
|
|
107
80
|
|
|
@@ -179,12 +152,11 @@ Tresca's plasticity criterion
|
|
|
179
152
|
Above, we have used the von Mises plasticity criterion (a.k.a J2 criterion). This can be switched to Tresca by passing
|
|
180
153
|
the plasticity criterion to the model constructor:
|
|
181
154
|
|
|
182
|
-
>>>
|
|
155
|
+
>>> JC_tresca = JohnsonCook(A=363, B=792.7122, n=0.5756, criterion='Tresca')
|
|
183
156
|
|
|
184
157
|
For instance, one can highlight the difference between the J2 and Tresca plasticity in shear:
|
|
185
158
|
|
|
186
159
|
>>> JC.reset_strain()
|
|
187
|
-
>>> JC_tresca = JohnsonCook(A=363, B=792.7122, n=0.5756, criterion='Tresca')
|
|
188
160
|
>>> stress_mag = np.linspace(0, 500, n_step)
|
|
189
161
|
>>> stress = StressTensor.shear([1,0,0], [0,1,0],stress_mag)
|
|
190
162
|
>>> models = (JC, JC_tresca)
|
|
@@ -193,12 +165,12 @@ For instance, one can highlight the difference between the J2 and Tresca plastic
|
|
|
193
165
|
>>> elastic_strain = C.inv() * stress
|
|
194
166
|
>>> fig, ax = plt.subplots()
|
|
195
167
|
>>> for j, model in enumerate(models):
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
168
|
+
... plastic_strain = StrainTensor.zeros(n_step)
|
|
169
|
+
... for i in range(1, n_step):
|
|
170
|
+
... strain_increment = model.compute_strain_increment(stress[i])
|
|
171
|
+
... plastic_strain[i] = plastic_strain[i-1] + strain_increment
|
|
172
|
+
... eps_xy = elastic_strain.C[0,1]+plastic_strain.C[0,1]
|
|
173
|
+
... ax.plot(eps_xy, stress_mag, label=labels[j]) # doctest: +SKIP
|
|
202
174
|
>>> ax.set_xlabel(r'$\varepsilon_{xy}$') # doctest: +SKIP
|
|
203
175
|
>>> ax.set_ylabel('Shear stress (MPa)') # doctest: +SKIP
|
|
204
176
|
>>> ax.legend() # doctest: +SKIP
|
|
@@ -32,6 +32,11 @@ let's see its value along the x, y and z directions:
|
|
|
32
32
|
>>> print((Ex, Ey, Ez))
|
|
33
33
|
(124.52232440357189, 120.92120854784433, 96.13750721721384)
|
|
34
34
|
|
|
35
|
+
.. note::
|
|
36
|
+
|
|
37
|
+
As the components for the stiffness tensor were provided in GPa, the values for the Young modulus are given in GPa
|
|
38
|
+
as well.
|
|
39
|
+
|
|
35
40
|
Actually, a more compact syntax, and a faster way to do that, is to use:
|
|
36
41
|
|
|
37
42
|
>>> import numpy as np
|
|
@@ -87,7 +92,9 @@ Spherical functions
|
|
|
87
92
|
~~~~~~~~~~~~~~~~~~~
|
|
88
93
|
In order to fully evidence the directional dependence of the Young moduli, we can plot them as 3D surface:
|
|
89
94
|
|
|
95
|
+
>>> from matplotlib import pyplot as plt
|
|
90
96
|
>>> E.plot3D() # doctest: +SKIP
|
|
97
|
+
>>> plt.show()
|
|
91
98
|
|
|
92
99
|
.. image:: images/E_plot3D.png
|
|
93
100
|
:width: 400
|
|
@@ -96,6 +103,7 @@ It is advised to use interactive plot to be able to zoom/rotate the surface. For
|
|
|
96
103
|
document/articles), we can plot the values as a Pole Figure (PF):
|
|
97
104
|
|
|
98
105
|
>>> E.plot_as_pole_figure() # doctest: +SKIP
|
|
106
|
+
>>> plt.show()
|
|
99
107
|
|
|
100
108
|
.. image:: images/E_PF.png
|
|
101
109
|
:width: 400
|
|
@@ -103,6 +111,7 @@ document/articles), we can plot the values as a Pole Figure (PF):
|
|
|
103
111
|
Alternatively, we can plot the Young moduli on X-Y, X-Z and Y-Z sections only:
|
|
104
112
|
|
|
105
113
|
>>> E.plot_xyz_sections() # doctest: +SKIP
|
|
114
|
+
>>> plt.show()
|
|
106
115
|
|
|
107
116
|
.. image:: images/E_xyz_sections.png
|
|
108
117
|
:width: 600
|
|
@@ -114,6 +123,7 @@ But at least, for a each direction **u**, we can consider the mean value for all
|
|
|
114
123
|
plotting:
|
|
115
124
|
|
|
116
125
|
>>> G.plot3D() # doctest: +SKIP
|
|
126
|
+
>>> plt.show()
|
|
117
127
|
|
|
118
128
|
.. image:: images/G_plot3D.png
|
|
119
129
|
:width: 400
|
|
@@ -121,6 +131,7 @@ plotting:
|
|
|
121
131
|
Instead of the mean value, we can consider other statistics, e.g.:
|
|
122
132
|
|
|
123
133
|
>>> G.plot3D(which='min') # doctest: +SKIP
|
|
134
|
+
>>> plt.show()
|
|
124
135
|
|
|
125
136
|
.. image:: images/G_plot3D_min.png
|
|
126
137
|
:width: 400
|
|
@@ -130,6 +141,7 @@ This also works for ``max`` and ``std``. These parameters also apply for pole fi
|
|
|
130
141
|
When plotting the X-Y, X-Z and Y-Z sections, the min, max and mean values are plotted at once:
|
|
131
142
|
|
|
132
143
|
>>> G.plot_xyz_sections() # doctest: +SKIP
|
|
144
|
+
>>> plt.show()
|
|
133
145
|
|
|
134
146
|
.. image:: images/G_xyz_sections.png
|
|
135
147
|
:width: 600
|