cardiac-geometriesx 0.4.1__py3-none-any.whl → 0.4.2__py3-none-any.whl
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.
Potentially problematic release.
This version of cardiac-geometriesx might be problematic. Click here for more details.
- cardiac_geometries/fibers/lv_ellipsoid.py +17 -8
- cardiac_geometries/fibers/utils.py +3 -2
- {cardiac_geometriesx-0.4.1.dist-info → cardiac_geometriesx-0.4.2.dist-info}/METADATA +1 -1
- {cardiac_geometriesx-0.4.1.dist-info → cardiac_geometriesx-0.4.2.dist-info}/RECORD +8 -8
- {cardiac_geometriesx-0.4.1.dist-info → cardiac_geometriesx-0.4.2.dist-info}/WHEEL +1 -1
- {cardiac_geometriesx-0.4.1.dist-info → cardiac_geometriesx-0.4.2.dist-info}/LICENSE +0 -0
- {cardiac_geometriesx-0.4.1.dist-info → cardiac_geometriesx-0.4.2.dist-info}/entry_points.txt +0 -0
- {cardiac_geometriesx-0.4.1.dist-info → cardiac_geometriesx-0.4.2.dist-info}/top_level.txt +0 -0
|
@@ -8,7 +8,12 @@ from . import utils
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
def mu_theta(
|
|
11
|
-
x: np.ndarray,
|
|
11
|
+
x: np.ndarray,
|
|
12
|
+
y: np.ndarray,
|
|
13
|
+
z: np.ndarray,
|
|
14
|
+
rs: np.ndarray,
|
|
15
|
+
rl: np.ndarray,
|
|
16
|
+
long_axis: int = 0,
|
|
12
17
|
) -> tuple[np.ndarray, np.ndarray, list[int]]:
|
|
13
18
|
"""Get the angles mu and theta from the coordinates x, y, z
|
|
14
19
|
given the long axis.
|
|
@@ -21,6 +26,10 @@ def mu_theta(
|
|
|
21
26
|
The y-coordinates
|
|
22
27
|
z : np.ndarray
|
|
23
28
|
The z-coordinates
|
|
29
|
+
rs : np.ndarray
|
|
30
|
+
The short radius
|
|
31
|
+
rl : np.ndarray
|
|
32
|
+
The long radius
|
|
24
33
|
long_axis : int, optional
|
|
25
34
|
The long axis, by default 0 (x-axis)
|
|
26
35
|
|
|
@@ -35,18 +44,18 @@ def mu_theta(
|
|
|
35
44
|
If the long axis is not 0, 1 or 2
|
|
36
45
|
"""
|
|
37
46
|
if long_axis == 0:
|
|
38
|
-
a = np.sqrt(y**2 + z**2)
|
|
39
|
-
b = x
|
|
47
|
+
a = np.sqrt(y**2 + z**2) / rs
|
|
48
|
+
b = x / rl
|
|
40
49
|
theta = np.pi - np.arctan2(z, -y)
|
|
41
50
|
perm = [0, 1, 2]
|
|
42
51
|
elif long_axis == 1:
|
|
43
|
-
a = np.sqrt(x**2 + z**2)
|
|
44
|
-
b = y
|
|
52
|
+
a = np.sqrt(x**2 + z**2) / rs
|
|
53
|
+
b = y / rl
|
|
45
54
|
theta = np.pi - np.arctan2(z, -x)
|
|
46
55
|
perm = [1, 0, 2]
|
|
47
56
|
elif long_axis == 2:
|
|
48
|
-
a = np.sqrt(x**2 + y**2)
|
|
49
|
-
b = z
|
|
57
|
+
a = np.sqrt(x**2 + y**2) / rs
|
|
58
|
+
b = z / rl
|
|
50
59
|
theta = np.pi - np.arctan2(x, -y)
|
|
51
60
|
perm = [2, 1, 0]
|
|
52
61
|
else:
|
|
@@ -120,7 +129,7 @@ def compute_system(
|
|
|
120
129
|
y = dof_coordinates[:, 1]
|
|
121
130
|
z = dof_coordinates[:, 2]
|
|
122
131
|
|
|
123
|
-
mu, theta, perm = mu_theta(x, y, z, long_axis=long_axis)
|
|
132
|
+
mu, theta, perm = mu_theta(x, y, z, rs, rl, long_axis=long_axis)
|
|
124
133
|
|
|
125
134
|
e_t = np.array(
|
|
126
135
|
[
|
|
@@ -25,6 +25,7 @@ def save_microstructure(
|
|
|
25
25
|
if len(functions) == 0:
|
|
26
26
|
return
|
|
27
27
|
# Save for paraview visualization
|
|
28
|
+
|
|
28
29
|
if functions[0].function_space.ufl_element().family_name == "quadrature":
|
|
29
30
|
from scifem.xdmf import create_pointcloud
|
|
30
31
|
|
|
@@ -35,8 +36,8 @@ def save_microstructure(
|
|
|
35
36
|
mesh.comm, Path(outdir) / "microstructure-viz.bp", functions, engine="BP4"
|
|
36
37
|
) as file:
|
|
37
38
|
file.write(0.0)
|
|
38
|
-
except RuntimeError:
|
|
39
|
-
|
|
39
|
+
except RuntimeError as ex:
|
|
40
|
+
print(f"Failed to write microstructure: {ex}")
|
|
40
41
|
|
|
41
42
|
# Save with proper function space
|
|
42
43
|
filename = Path(outdir) / "microstructure.bp"
|
|
@@ -5,12 +5,12 @@ cardiac_geometries/gui.py,sha256=9WYR850wLrqsUrVUC37E2SaO0OWA_oagSe-YNrsxz3k,837
|
|
|
5
5
|
cardiac_geometries/mesh.py,sha256=Ejciny48mnKKN20RrY9DwLY7_Lh1jb6Kldj4CW1wr1o,26909
|
|
6
6
|
cardiac_geometries/utils.py,sha256=8QKkdK3JFZMH3qF4PzvEVfk7vMB5Ciui-KFIct2Kd2g,20560
|
|
7
7
|
cardiac_geometries/fibers/__init__.py,sha256=WpRrn9Iakl-3m8IGtFkqP0LXGjw5EZHZ8Eg9JCnCdrg,137
|
|
8
|
-
cardiac_geometries/fibers/lv_ellipsoid.py,sha256=
|
|
8
|
+
cardiac_geometries/fibers/lv_ellipsoid.py,sha256=LZNhxzTsn-h88xXGP5bNfnWKhdvBROUjWjt8yrQFW48,6010
|
|
9
9
|
cardiac_geometries/fibers/slab.py,sha256=TYQhckJ8mwXz_08Cx3QsPQMtemkaxZ955SnSMrDfBPE,3898
|
|
10
|
-
cardiac_geometries/fibers/utils.py,sha256=
|
|
11
|
-
cardiac_geometriesx-0.4.
|
|
12
|
-
cardiac_geometriesx-0.4.
|
|
13
|
-
cardiac_geometriesx-0.4.
|
|
14
|
-
cardiac_geometriesx-0.4.
|
|
15
|
-
cardiac_geometriesx-0.4.
|
|
16
|
-
cardiac_geometriesx-0.4.
|
|
10
|
+
cardiac_geometries/fibers/utils.py,sha256=bEz2MMSRhzYhiRSFahdqQRsOWzCCauERKU2V6tdgSkQ,3239
|
|
11
|
+
cardiac_geometriesx-0.4.2.dist-info/LICENSE,sha256=lo5K2rJPZOSv6luutGHbzzi3IpXNaB9E2UWq60qvNx0,1111
|
|
12
|
+
cardiac_geometriesx-0.4.2.dist-info/METADATA,sha256=fqUPjT7n9MozCMmH5YhOYPT8BbPOzqtJIkIt8KMpt2M,4185
|
|
13
|
+
cardiac_geometriesx-0.4.2.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
|
14
|
+
cardiac_geometriesx-0.4.2.dist-info/entry_points.txt,sha256=xOBnlc6W-H9oCDYLNz3kpki26OmpfYSoFSrmi_4V-Ec,52
|
|
15
|
+
cardiac_geometriesx-0.4.2.dist-info/top_level.txt,sha256=J0gQxkWR2my5Vf7Qt8buDY8ZOjYdVfIweVunCGXWKNE,19
|
|
16
|
+
cardiac_geometriesx-0.4.2.dist-info/RECORD,,
|
|
File without changes
|
{cardiac_geometriesx-0.4.1.dist-info → cardiac_geometriesx-0.4.2.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|