physioblocks 1.0.1__py3-none-any.whl → 1.0.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.
- physioblocks/__init__.py +1 -1
- physioblocks/library/aliases/simulations/circulation_alone_forward_simulation.jsonc +1 -3
- physioblocks/simulation/solvers.py +30 -0
- {physioblocks-1.0.1.dist-info → physioblocks-1.0.2.dist-info}/METADATA +5 -2
- {physioblocks-1.0.1.dist-info → physioblocks-1.0.2.dist-info}/RECORD +8 -8
- {physioblocks-1.0.1.dist-info → physioblocks-1.0.2.dist-info}/WHEEL +0 -0
- {physioblocks-1.0.1.dist-info → physioblocks-1.0.2.dist-info}/licenses/licenses/GPL-3.0-only.txt +0 -0
- {physioblocks-1.0.1.dist-info → physioblocks-1.0.2.dist-info}/licenses/licenses/LGPL-3.0-only.txt +0 -0
physioblocks/__init__.py
CHANGED
|
@@ -114,6 +114,36 @@ class AbstractSolver(ABC):
|
|
|
114
114
|
"""
|
|
115
115
|
|
|
116
116
|
|
|
117
|
+
LINEAR_SOLVER = "linear_solver"
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
@register_type(LINEAR_SOLVER)
|
|
121
|
+
class LinearSolver(AbstractSolver):
|
|
122
|
+
"""
|
|
123
|
+
Implementation of the :class:`~.AbstractSolver` class for linear problems.
|
|
124
|
+
"""
|
|
125
|
+
|
|
126
|
+
def solve(
|
|
127
|
+
self,
|
|
128
|
+
state: State,
|
|
129
|
+
system: EqSystem,
|
|
130
|
+
magnitudes: dict[str, float] | None = None,
|
|
131
|
+
) -> Solution:
|
|
132
|
+
"""
|
|
133
|
+
Solve the equation system directly
|
|
134
|
+
|
|
135
|
+
:return: the solution
|
|
136
|
+
:rtype: Solution
|
|
137
|
+
"""
|
|
138
|
+
res = system.compute_residual()
|
|
139
|
+
grad = system.compute_gradient()
|
|
140
|
+
|
|
141
|
+
xn = np.linalg.solve(grad, res)
|
|
142
|
+
x = state.state_vector - xn
|
|
143
|
+
|
|
144
|
+
return Solution(x, True)
|
|
145
|
+
|
|
146
|
+
|
|
117
147
|
# Type id for the Newton Solver
|
|
118
148
|
NEWTON_SOLVER_TYPE_ID = "newton_solver"
|
|
119
149
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: physioblocks
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.2
|
|
4
4
|
Dynamic: Author
|
|
5
5
|
Dynamic: Author-email
|
|
6
6
|
Dynamic: License
|
|
@@ -124,4 +124,7 @@ python -m physioblocks.launcher references/spherical_heart_sim.jsonc -v -t -s Qu
|
|
|
124
124
|
```
|
|
125
125
|
|
|
126
126
|
|
|
127
|
-
Results will be available in the `$LAUNCHER_FOLDER_PATH$/simulations/QuickStart` series folder
|
|
127
|
+
Results will be available in the `$LAUNCHER_FOLDER_PATH$/simulations/QuickStart` series folder:
|
|
128
|
+
* the csv file contains the simulation results.
|
|
129
|
+
* the html allows you to visualize the results.
|
|
130
|
+
* the log and json files are here for debug purposes.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
physioblocks/__init__.py,sha256=
|
|
1
|
+
physioblocks/__init__.py,sha256=k1DWuRN43XnMTR_V8Z40ibaOqwYQsFj3GfqGm8lreEU,1169
|
|
2
2
|
physioblocks/base/__init__.py,sha256=2h6bk0fe8pwQvJ15Buytg4SZzYOH-Ep7WqoD6pd1eOQ,986
|
|
3
3
|
physioblocks/base/operators.py,sha256=uUfswQZsaMNd2bd7wsaxSGFIYLAr1hQCQ6SQfYawdBc,5689
|
|
4
4
|
physioblocks/base/registers.py,sha256=Cd0hmy1XqojjPQgb_jn4mGeAMTyWWgDkl3qJHCVjCRU,3119
|
|
@@ -44,7 +44,7 @@ physioblocks/library/aliases/model_components/spherical_dynamics.json,sha256=Tcd
|
|
|
44
44
|
physioblocks/library/aliases/model_components/velocity_law_hht.json,sha256=HKbc5_2hGuOiQKUvLGto6tBQI_Z5AbbhXp8Itwmo2ag,93
|
|
45
45
|
physioblocks/library/aliases/nets/circulation_alone_net.json,sha256=M3TiXIXgaXCsdwfyA5cm3fqspViiIl0Kyb6NKMiFsQ8,874
|
|
46
46
|
physioblocks/library/aliases/nets/spherical_heart_net.json,sha256=UnOSQslMJuvbT6dXXPWj-HEvqe6U4fG1CK17_sKTxM8,3057
|
|
47
|
-
physioblocks/library/aliases/simulations/circulation_alone_forward_simulation.jsonc,sha256=
|
|
47
|
+
physioblocks/library/aliases/simulations/circulation_alone_forward_simulation.jsonc,sha256=F5MIEC-OI-VUcAhYU8SLesbZPAiy3Us1f4VuDd0TEiI,1948
|
|
48
48
|
physioblocks/library/aliases/simulations/default_forward_simulation.jsonc,sha256=TE_82KWUYAQdMX4MpDGY-Hi_djpwYAhSB5uzYtzYqcA,136
|
|
49
49
|
physioblocks/library/aliases/simulations/default_time.jsonc,sha256=LM2_EU-GvOeGXJMvXXyJeWEOv-cfy25luhcaSMj5hkw,165
|
|
50
50
|
physioblocks/library/aliases/simulations/newton_method_solver.json,sha256=p0jgVCpySTR0Npo5iFZrUUys3SRcy4j_EesQw9SvoyA,79
|
|
@@ -75,7 +75,7 @@ physioblocks/simulation/functions.py,sha256=c6HFwXK8IAzH7gSkz9aMiXLqnWXn_4_9WsX4
|
|
|
75
75
|
physioblocks/simulation/runtime.py,sha256=xMtUL07SSQYpskK_EnNi-qz2D1d4wlDAESWHPqMUHn8,16762
|
|
76
76
|
physioblocks/simulation/saved_quantities.py,sha256=fKWr1wScqxHPhuCE7aDNs8lpm9oWfyLN8NZDus2knPM,4111
|
|
77
77
|
physioblocks/simulation/setup.py,sha256=UmIklaHmfkxi_BIdYKOhorLoC9QT9D4oEXwC-Xfd6v0,18109
|
|
78
|
-
physioblocks/simulation/solvers.py,sha256=
|
|
78
|
+
physioblocks/simulation/solvers.py,sha256=h99-25G4f6Hd3Fa0yoRLTIvrih5035ldVQi8MuSsvrw,8014
|
|
79
79
|
physioblocks/simulation/state.py,sha256=jE6fTxzsnGKch1H6mErunpi7lwTb_9fvs2Hx77LIaMA,10310
|
|
80
80
|
physioblocks/simulation/time_manager.py,sha256=AbP_Y8mcG7-6x-3rGY5CHFQwKMqksO4HvdCJ-mU03d4,9381
|
|
81
81
|
physioblocks/utils/__init__.py,sha256=EMwPHVznBryA1uOEFfY_11L9Sd9bdCU_x_huNgIaZtQ,988
|
|
@@ -86,8 +86,8 @@ physioblocks/utils/math_utils.py,sha256=w5MDs4cP5WiTPHe8WofFuNZZ20WDNLT0XmFGlbis
|
|
|
86
86
|
physioblocks/references/circulation_alone_sim.jsonc,sha256=qv27nzmK7jennhtCJ7wQ_f83mt9_YJSOTABjGCYMcZw,736
|
|
87
87
|
physioblocks/references/spherical_heart_respiration_sim.jsonc,sha256=kKq5xf94r90O1KpkCHk1qwgy6DJ37ePo3-8buEtcu5Y,1397
|
|
88
88
|
physioblocks/references/spherical_heart_sim.jsonc,sha256=kGGBqxY8dnmGKmpMv216kbneyJRGz_3VkcYn1OWavIA,1151
|
|
89
|
-
physioblocks-1.0.
|
|
90
|
-
physioblocks-1.0.
|
|
91
|
-
physioblocks-1.0.
|
|
92
|
-
physioblocks-1.0.
|
|
93
|
-
physioblocks-1.0.
|
|
89
|
+
physioblocks-1.0.2.dist-info/METADATA,sha256=RSHib_291NvBs_EkprhxTCpvqwhELKRQmmUPtRAuxe4,4708
|
|
90
|
+
physioblocks-1.0.2.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
91
|
+
physioblocks-1.0.2.dist-info/licenses/licenses/GPL-3.0-only.txt,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
92
|
+
physioblocks-1.0.2.dist-info/licenses/licenses/LGPL-3.0-only.txt,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
|
|
93
|
+
physioblocks-1.0.2.dist-info/RECORD,,
|
|
File without changes
|
{physioblocks-1.0.1.dist-info → physioblocks-1.0.2.dist-info}/licenses/licenses/GPL-3.0-only.txt
RENAMED
|
File without changes
|
{physioblocks-1.0.1.dist-info → physioblocks-1.0.2.dist-info}/licenses/licenses/LGPL-3.0-only.txt
RENAMED
|
File without changes
|