|
9 | 9 | },
|
10 | 10 | {
|
11 | 11 | "cell_type": "code",
|
12 |
| - "execution_count": 1, |
| 12 | + "execution_count": null, |
13 | 13 | "metadata": {},
|
14 | 14 | "outputs": [],
|
15 | 15 | "source": [
|
|
18 | 18 | "import numpy as np\n",
|
19 | 19 | "from mpl_toolkits.mplot3d import Axes3D\n",
|
20 | 20 | "\n",
|
21 |
| - "from fiberoripy.closures import (\n", |
22 |
| - " IBOF_closure,\n", |
23 |
| - " compute_closure,\n", |
24 |
| - " hybrid_closure,\n", |
25 |
| - " linear_closure,\n", |
26 |
| - " quadratic_closure,\n", |
27 |
| - ")\n", |
28 |
| - "from fiberoripy.tensorplot import (\n", |
29 |
| - " plot_orbit2,\n", |
30 |
| - " plot_orbit4,\n", |
31 |
| - " plot_projection2,\n", |
32 |
| - " plot_projection4,\n", |
33 |
| - ")" |
| 21 | + "from fiberoripy.closures import get_random_tensor_pair\n", |
| 22 | + "\n", |
| 23 | + "from fiberoripy.tensorplot import plot_orbit2, plot_orbit4\n" |
34 | 24 | ]
|
35 | 25 | },
|
36 | 26 | {
|
37 | 27 | "cell_type": "code",
|
38 |
| - "execution_count": 2, |
| 28 | + "execution_count": null, |
39 | 29 | "metadata": {},
|
40 | 30 | "outputs": [],
|
41 | 31 | "source": [
|
42 | 32 | "# define second order fiber orientation tensor\n",
|
43 | 33 | "a_iso = 1.0 / 3.0 * np.eye(3)\n",
|
44 |
| - "a_uni = np.array([[0.9,0,0],[0,0.05, 0],[0,0,0.05]])\n", |
45 |
| - "a_pln = np.array([[0.4,0,0],[0,0.4, 0],[0,0,0.1]])\n", |
| 34 | + "a_uni = np.array([[0.9, 0, 0], [0, 0.05, 0], [0, 0, 0.05]])\n", |
| 35 | + "a_pln = np.array([[0.4, 0, 0], [0, 0.4, 0], [0, 0, 0.1]])\n", |
46 | 36 | "\n",
|
47 | 37 | "# create a fourth order fiber orientation tensor\n",
|
48 |
| - "A_iso = compute_closure(a_iso, \"RANDOM\", N=1000)\n", |
49 |
| - "A_uni = compute_closure(a_uni, \"RANDOM\", N=1000)\n", |
50 |
| - "A_pln = compute_closure(a_pln, \"RANDOM\", N=1000)" |
| 38 | + "_, A_iso = get_random_tensor_pair(seed=a_iso, N=5000)\n", |
| 39 | + "_, A_uni = get_random_tensor_pair(seed=a_uni, N=5000)\n", |
| 40 | + "_, A_pln = get_random_tensor_pair(seed=a_pln, N=5000)" |
51 | 41 | ]
|
52 | 42 | },
|
53 | 43 | {
|
54 | 44 | "cell_type": "code",
|
55 |
| - "execution_count": 3, |
| 45 | + "execution_count": null, |
56 | 46 | "metadata": {},
|
57 |
| - "outputs": [ |
58 |
| - { |
59 |
| - "data": { |
60 |
| - "application/vnd.jupyter.widget-view+json": { |
61 |
| - "model_id": "e710d3dd22534b28937261bf1db80c28", |
62 |
| - "version_major": 2, |
63 |
| - "version_minor": 0 |
64 |
| - }, |
65 |
| - "text/plain": [ |
66 |
| - "Canvas(toolbar=Toolbar(toolitems=[('Home', 'Reset original view', 'home', 'home'), ('Back', 'Back to previous …" |
67 |
| - ] |
68 |
| - }, |
69 |
| - "metadata": {}, |
70 |
| - "output_type": "display_data" |
71 |
| - } |
72 |
| - ], |
| 47 | + "outputs": [], |
73 | 48 | "source": [
|
74 | 49 | "# Second order tensor plot (isotropic)\n",
|
75 | 50 | "fig = plt.figure(figsize=(12, 8))\n",
|
76 | 51 | "\n",
|
77 | 52 | "ax = fig.add_subplot(111, projection=Axes3D.name)\n",
|
78 | 53 | "ax._axis3don = False\n",
|
79 |
| - "plotargs = {\"color\":[0,0.588,0.510], \"rstride\":1, \"cstride\":1}\n", |
| 54 | + "plotargs = {\"color\": [0, 0.588, 0.510], \"rstride\": 1, \"cstride\": 1}\n", |
80 | 55 | "plot_orbit2(ax, plotargs, a_iso)\n",
|
81 | 56 | "\n",
|
82 | 57 | "plt.show()"
|
83 | 58 | ]
|
84 | 59 | },
|
85 | 60 | {
|
86 | 61 | "cell_type": "code",
|
87 |
| - "execution_count": 4, |
| 62 | + "execution_count": null, |
88 | 63 | "metadata": {},
|
89 |
| - "outputs": [ |
90 |
| - { |
91 |
| - "data": { |
92 |
| - "application/vnd.jupyter.widget-view+json": { |
93 |
| - "model_id": "c259da2fd6e64d34b59acf3d98a17feb", |
94 |
| - "version_major": 2, |
95 |
| - "version_minor": 0 |
96 |
| - }, |
97 |
| - "text/plain": [ |
98 |
| - "Canvas(toolbar=Toolbar(toolitems=[('Home', 'Reset original view', 'home', 'home'), ('Back', 'Back to previous …" |
99 |
| - ] |
100 |
| - }, |
101 |
| - "metadata": {}, |
102 |
| - "output_type": "display_data" |
103 |
| - } |
104 |
| - ], |
| 64 | + "outputs": [], |
105 | 65 | "source": [
|
106 | 66 | "# Second order tensor plot (unidirectional)\n",
|
107 | 67 | "fig = plt.figure(figsize=(12, 8))\n",
|
108 | 68 | "\n",
|
109 | 69 | "ax = fig.add_subplot(111, projection=Axes3D.name)\n",
|
110 | 70 | "ax._axis3don = False\n",
|
111 |
| - "plotargs = {\"color\":[0,0.588,0.510], \"rstride\":1, \"cstride\":1}\n", |
| 71 | + "plotargs = {\"color\": [0, 0.588, 0.510], \"rstride\": 1, \"cstride\": 1}\n", |
112 | 72 | "plot_orbit2(ax, plotargs, a_uni)\n",
|
113 | 73 | "\n",
|
114 | 74 | "plt.show()"
|
115 | 75 | ]
|
116 | 76 | },
|
117 | 77 | {
|
118 | 78 | "cell_type": "code",
|
119 |
| - "execution_count": 5, |
| 79 | + "execution_count": null, |
120 | 80 | "metadata": {},
|
121 |
| - "outputs": [ |
122 |
| - { |
123 |
| - "data": { |
124 |
| - "application/vnd.jupyter.widget-view+json": { |
125 |
| - "model_id": "63d737f971c54dfc9f5d77ccd1cca695", |
126 |
| - "version_major": 2, |
127 |
| - "version_minor": 0 |
128 |
| - }, |
129 |
| - "text/plain": [ |
130 |
| - "Canvas(toolbar=Toolbar(toolitems=[('Home', 'Reset original view', 'home', 'home'), ('Back', 'Back to previous …" |
131 |
| - ] |
132 |
| - }, |
133 |
| - "metadata": {}, |
134 |
| - "output_type": "display_data" |
135 |
| - } |
136 |
| - ], |
| 81 | + "outputs": [], |
137 | 82 | "source": [
|
138 | 83 | "# Second order tensor plot (planar)\n",
|
139 | 84 | "fig = plt.figure(figsize=(12, 8))\n",
|
140 | 85 | "\n",
|
141 | 86 | "ax = fig.add_subplot(111, projection=Axes3D.name)\n",
|
142 | 87 | "ax._axis3don = False\n",
|
143 |
| - "plotargs = {\"color\":[0,0.588,0.510], \"rstride\":4, \"cstride\":4}\n", |
| 88 | + "plotargs = {\"color\": [0, 0.588, 0.510], \"rstride\": 4, \"cstride\": 4}\n", |
144 | 89 | "plot_orbit2(ax, plotargs, a_pln)\n",
|
145 | 90 | "\n",
|
146 | 91 | "plt.show()"
|
147 | 92 | ]
|
148 | 93 | },
|
149 | 94 | {
|
150 | 95 | "cell_type": "code",
|
151 |
| - "execution_count": 10, |
| 96 | + "execution_count": null, |
152 | 97 | "metadata": {},
|
153 |
| - "outputs": [ |
154 |
| - { |
155 |
| - "data": { |
156 |
| - "application/vnd.jupyter.widget-view+json": { |
157 |
| - "model_id": "9fca6f4e29b545feaab4909884f70fae", |
158 |
| - "version_major": 2, |
159 |
| - "version_minor": 0 |
160 |
| - }, |
161 |
| - "text/plain": [ |
162 |
| - "Canvas(toolbar=Toolbar(toolitems=[('Home', 'Reset original view', 'home', 'home'), ('Back', 'Back to previous …" |
163 |
| - ] |
164 |
| - }, |
165 |
| - "metadata": {}, |
166 |
| - "output_type": "display_data" |
167 |
| - } |
168 |
| - ], |
| 98 | + "outputs": [], |
169 | 99 | "source": [
|
170 | 100 | "# Fourth order tensor plot\n",
|
171 | 101 | "fig = plt.figure(figsize=(12, 8))\n",
|
172 | 102 | "\n",
|
173 | 103 | "ax = fig.add_subplot(111, projection=Axes3D.name)\n",
|
174 |
| - "plotargs = {\"color\":[0,0.588,0.510], \"rstride\":1, \"cstride\":1}\n", |
| 104 | + "plotargs = {\"color\": [0, 0.588, 0.510], \"rstride\": 1, \"cstride\": 1}\n", |
175 | 105 | "plot_orbit4(ax, plotargs, A_iso)\n",
|
176 | 106 | "\n",
|
177 | 107 | "plt.show()"
|
178 | 108 | ]
|
179 |
| - }, |
180 |
| - { |
181 |
| - "cell_type": "code", |
182 |
| - "execution_count": null, |
183 |
| - "metadata": {}, |
184 |
| - "outputs": [], |
185 |
| - "source": [] |
186 | 109 | }
|
187 | 110 | ],
|
188 | 111 | "metadata": {
|
189 | 112 | "kernelspec": {
|
190 |
| - "display_name": "Python 3", |
| 113 | + "display_name": "base", |
191 | 114 | "language": "python",
|
192 | 115 | "name": "python3"
|
193 | 116 | },
|
|
201 | 124 | "name": "python",
|
202 | 125 | "nbconvert_exporter": "python",
|
203 | 126 | "pygments_lexer": "ipython3",
|
204 |
| - "version": "3.9.0" |
| 127 | + "version": "3.10.6" |
205 | 128 | }
|
206 | 129 | },
|
207 | 130 | "nbformat": 4,
|
|
0 commit comments