biomechpy 1.1.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.
- biomechpy-1.1.0/CITATION.cff +9 -0
- biomechpy-1.1.0/LICENSE +7 -0
- biomechpy-1.1.0/MANIFEST.in +13 -0
- biomechpy-1.1.0/PKG-INFO +472 -0
- biomechpy-1.1.0/README.md +443 -0
- biomechpy-1.1.0/docs/api_stability.md +45 -0
- biomechpy-1.1.0/docs/architecture.md +104 -0
- biomechpy-1.1.0/docs/assets/backend_matched_reference.png +0 -0
- biomechpy-1.1.0/docs/assets/cohort_age_distribution.png +0 -0
- biomechpy-1.1.0/docs/assets/constituent_density_history.png +0 -0
- biomechpy-1.1.0/docs/assets/mixture_stress_history.png +0 -0
- biomechpy-1.1.0/docs/assets/multi_tissue_turnover.png +0 -0
- biomechpy-1.1.0/docs/assets/scalable_cohort_count_history.png +0 -0
- biomechpy-1.1.0/docs/assets/scalable_compression_error_history.png +0 -0
- biomechpy-1.1.0/docs/assets/spatial_mixture_density_history.png +0 -0
- biomechpy-1.1.0/docs/assets/spatial_mixture_final_cohort_count.png +0 -0
- biomechpy-1.1.0/docs/assets/spatial_mixture_final_collagen_density.png +0 -0
- biomechpy-1.1.0/docs/assets/spatial_mixture_final_sigma_xx.png +0 -0
- biomechpy-1.1.0/docs/assets/spatial_mixture_final_total_density.png +0 -0
- biomechpy-1.1.0/docs/assets/spatial_mixture_reaction_history.png +0 -0
- biomechpy-1.1.0/docs/assets/survival_laws.png +0 -0
- biomechpy-1.1.0/docs/assets/universal_constituent_architecture.png +0 -0
- biomechpy-1.1.0/docs/assets/unstructured_3d_density_history.png +0 -0
- biomechpy-1.1.0/docs/assets/unstructured_3d_partition_map.png +0 -0
- biomechpy-1.1.0/docs/assets/unstructured_3d_reference_mesh.png +0 -0
- biomechpy-1.1.0/docs/assets/unstructured_3d_stress_history.png +0 -0
- biomechpy-1.1.0/docs/assets/v1_custom_tissue_material_point_density.png +0 -0
- biomechpy-1.1.0/docs/assets/v1_custom_tissue_spatial_reactions.png +0 -0
- biomechpy-1.1.0/docs/backend_verification_1_1.md +146 -0
- biomechpy-1.1.0/docs/benchmark_contracts.md +76 -0
- biomechpy-1.1.0/docs/constrained_mixture.md +18 -0
- biomechpy-1.1.0/docs/custom_tissue.md +92 -0
- biomechpy-1.1.0/docs/distributed_unstructured_mixtures.md +109 -0
- biomechpy-1.1.0/docs/fenicsx_verification_environment.md +49 -0
- biomechpy-1.1.0/docs/migration_0_9_to_1_0.md +58 -0
- biomechpy-1.1.0/docs/modeling_scope.md +54 -0
- biomechpy-1.1.0/docs/presets.md +10 -0
- biomechpy-1.1.0/docs/quickstart.md +128 -0
- biomechpy-1.1.0/docs/rc3_hardening_report.md +37 -0
- biomechpy-1.1.0/docs/rc4_release_engineering_report.md +63 -0
- biomechpy-1.1.0/docs/release_checklist.md +56 -0
- biomechpy-1.1.0/docs/release_notes_v1.0.md +97 -0
- biomechpy-1.1.0/docs/release_notes_v1.1.md +36 -0
- biomechpy-1.1.0/docs/roadmap.md +58 -0
- biomechpy-1.1.0/docs/scalable_spatial_mixtures.md +131 -0
- biomechpy-1.1.0/docs/scientific_audit_resolution_v1.0.md +123 -0
- biomechpy-1.1.0/docs/scientific_contracts.md +102 -0
- biomechpy-1.1.0/docs/spatial_constrained_mixtures.md +105 -0
- biomechpy-1.1.0/docs/stable_api_v1.md +135 -0
- biomechpy-1.1.0/docs/units_and_dimensions.md +85 -0
- biomechpy-1.1.0/environment-fenicsx.yml +25 -0
- biomechpy-1.1.0/environment.yml +14 -0
- biomechpy-1.1.0/examples/constrained_mixture.py +6 -0
- biomechpy-1.1.0/examples/custom_tissue_definition.py +54 -0
- biomechpy-1.1.0/examples/spatial_constrained_mixture.py +29 -0
- biomechpy-1.1.0/examples/unstructured_3d_mixture.py +21 -0
- biomechpy-1.1.0/notebooks/00_START_HERE.ipynb +76 -0
- biomechpy-1.1.0/notebooks/06_constituent_turnover_and_constrained_mixture.ipynb +378 -0
- biomechpy-1.1.0/notebooks/07_spatial_constrained_mixtures.ipynb +632 -0
- biomechpy-1.1.0/notebooks/08_scalable_spatial_mixtures.ipynb +533 -0
- biomechpy-1.1.0/notebooks/09_distributed_unstructured_mixtures.ipynb +697 -0
- biomechpy-1.1.0/notebooks/10_build_your_own_tissue_model.ipynb +588 -0
- biomechpy-1.1.0/notebooks/11_matched_backend_verification.ipynb +397 -0
- biomechpy-1.1.0/pyproject.toml +50 -0
- biomechpy-1.1.0/scripts/compare_fenicsx_mpi_results.py +40 -0
- biomechpy-1.1.0/scripts/run_backend_verification.py +38 -0
- biomechpy-1.1.0/scripts/run_fenicsx_mpi_matrix.bat +16 -0
- biomechpy-1.1.0/scripts/run_fenicsx_mpi_matrix.sh +17 -0
- biomechpy-1.1.0/scripts/run_fenicsx_mpi_probe.py +44 -0
- biomechpy-1.1.0/scripts/setup_anaconda_macos_linux.sh +9 -0
- biomechpy-1.1.0/scripts/setup_anaconda_windows.bat +8 -0
- biomechpy-1.1.0/scripts/static_hygiene_audit.py +89 -0
- biomechpy-1.1.0/scripts/verify_environment.py +18 -0
- biomechpy-1.1.0/setup.cfg +4 -0
- biomechpy-1.1.0/src/biomechpy/__init__.py +198 -0
- biomechpy-1.1.0/src/biomechpy/__main__.py +5 -0
- biomechpy-1.1.0/src/biomechpy/_metadata.py +12 -0
- biomechpy-1.1.0/src/biomechpy/_version.py +1 -0
- biomechpy-1.1.0/src/biomechpy/api.py +122 -0
- biomechpy-1.1.0/src/biomechpy/architecture.py +163 -0
- biomechpy-1.1.0/src/biomechpy/backends/__init__.py +25 -0
- biomechpy-1.1.0/src/biomechpy/backends/contract.py +173 -0
- biomechpy-1.1.0/src/biomechpy/backends/fenicsx.py +217 -0
- biomechpy-1.1.0/src/biomechpy/backends/numpy_reference.py +64 -0
- biomechpy-1.1.0/src/biomechpy/backends/status.py +76 -0
- biomechpy-1.1.0/src/biomechpy/backends/verification.py +136 -0
- biomechpy-1.1.0/src/biomechpy/benchmarks/__init__.py +9 -0
- biomechpy-1.1.0/src/biomechpy/benchmarks/scalable.py +140 -0
- biomechpy-1.1.0/src/biomechpy/benchmarks/spatial.py +108 -0
- biomechpy-1.1.0/src/biomechpy/benchmarks/turnover.py +84 -0
- biomechpy-1.1.0/src/biomechpy/benchmarks/unstructured3d.py +185 -0
- biomechpy-1.1.0/src/biomechpy/cli.py +138 -0
- biomechpy-1.1.0/src/biomechpy/compat.py +24 -0
- biomechpy-1.1.0/src/biomechpy/constituents/__init__.py +17 -0
- biomechpy-1.1.0/src/biomechpy/constituents/base.py +134 -0
- biomechpy-1.1.0/src/biomechpy/constituents/cohorts.py +67 -0
- biomechpy-1.1.0/src/biomechpy/data/__init__.py +1 -0
- biomechpy-1.1.0/src/biomechpy/data/backend_verification_contract_v1.json +16 -0
- biomechpy-1.1.0/src/biomechpy/data/benchmark_contracts_v1.json +142 -0
- biomechpy-1.1.0/src/biomechpy/definition.py +263 -0
- biomechpy-1.1.0/src/biomechpy/experiments/__init__.py +19 -0
- biomechpy-1.1.0/src/biomechpy/experiments/protocols.py +83 -0
- biomechpy-1.1.0/src/biomechpy/fem/__init__.py +31 -0
- biomechpy-1.1.0/src/biomechpy/fem/assembly.py +66 -0
- biomechpy-1.1.0/src/biomechpy/fem/mesh.py +180 -0
- biomechpy-1.1.0/src/biomechpy/fem/solver.py +235 -0
- biomechpy-1.1.0/src/biomechpy/fem/spatial_mixture.py +704 -0
- biomechpy-1.1.0/src/biomechpy/fem/state.py +100 -0
- biomechpy-1.1.0/src/biomechpy/growth/__init__.py +15 -0
- biomechpy-1.1.0/src/biomechpy/growth/kinematics.py +47 -0
- biomechpy-1.1.0/src/biomechpy/kinematics.py +50 -0
- biomechpy-1.1.0/src/biomechpy/materials/__init__.py +12 -0
- biomechpy-1.1.0/src/biomechpy/materials/base.py +102 -0
- biomechpy-1.1.0/src/biomechpy/materials/fiber.py +103 -0
- biomechpy-1.1.0/src/biomechpy/materials/fiber_reinforced.py +106 -0
- biomechpy-1.1.0/src/biomechpy/materials/neo_hookean.py +101 -0
- biomechpy-1.1.0/src/biomechpy/mixture/__init__.py +29 -0
- biomechpy-1.1.0/src/biomechpy/mixture/model.py +99 -0
- biomechpy-1.1.0/src/biomechpy/mixture/simulation.py +104 -0
- biomechpy-1.1.0/src/biomechpy/mixture/spatial_state.py +305 -0
- biomechpy-1.1.0/src/biomechpy/mixture/spatial_turnover.py +136 -0
- biomechpy-1.1.0/src/biomechpy/mixture/state.py +98 -0
- biomechpy-1.1.0/src/biomechpy/mixture/turnover.py +504 -0
- biomechpy-1.1.0/src/biomechpy/presets/__init__.py +16 -0
- biomechpy-1.1.0/src/biomechpy/presets/tissues.py +369 -0
- biomechpy-1.1.0/src/biomechpy/py.typed +0 -0
- biomechpy-1.1.0/src/biomechpy/remodeling/__init__.py +16 -0
- biomechpy-1.1.0/src/biomechpy/remodeling/laws.py +243 -0
- biomechpy-1.1.0/src/biomechpy/remodeling/stimuli.py +56 -0
- biomechpy-1.1.0/src/biomechpy/scalable/__init__.py +33 -0
- biomechpy-1.1.0/src/biomechpy/scalable/checkpoint.py +183 -0
- biomechpy-1.1.0/src/biomechpy/scalable/compression.py +404 -0
- biomechpy-1.1.0/src/biomechpy/scalable/distributed_checkpoint.py +178 -0
- biomechpy-1.1.0/src/biomechpy/scalable/fenicsx.py +109 -0
- biomechpy-1.1.0/src/biomechpy/scalable/packing.py +284 -0
- biomechpy-1.1.0/src/biomechpy/state.py +57 -0
- biomechpy-1.1.0/src/biomechpy/turnover/__init__.py +11 -0
- biomechpy-1.1.0/src/biomechpy/turnover/production.py +99 -0
- biomechpy-1.1.0/src/biomechpy/turnover/survival.py +145 -0
- biomechpy-1.1.0/src/biomechpy/typing.py +6 -0
- biomechpy-1.1.0/src/biomechpy/unstructured/__init__.py +24 -0
- biomechpy-1.1.0/src/biomechpy/unstructured/mesh.py +241 -0
- biomechpy-1.1.0/src/biomechpy/unstructured/mixture.py +187 -0
- biomechpy-1.1.0/src/biomechpy/unstructured/partition.py +204 -0
- biomechpy-1.1.0/src/biomechpy/validation.py +351 -0
- biomechpy-1.1.0/src/biomechpy/verification.py +414 -0
- biomechpy-1.1.0/src/biomechpy.egg-info/PKG-INFO +472 -0
- biomechpy-1.1.0/src/biomechpy.egg-info/SOURCES.txt +189 -0
- biomechpy-1.1.0/src/biomechpy.egg-info/dependency_links.txt +1 -0
- biomechpy-1.1.0/src/biomechpy.egg-info/entry_points.txt +2 -0
- biomechpy-1.1.0/src/biomechpy.egg-info/requires.txt +16 -0
- biomechpy-1.1.0/src/biomechpy.egg-info/top_level.txt +1 -0
- biomechpy-1.1.0/tests/test_backend_cli_v1_1.py +23 -0
- biomechpy-1.1.0/tests/test_backend_contract_metadata_v1_1.py +18 -0
- biomechpy-1.1.0/tests/test_backend_verification_v1_1.py +64 -0
- biomechpy-1.1.0/tests/test_benchmark_contracts_v1.py +22 -0
- biomechpy-1.1.0/tests/test_checkpoint_restart.py +79 -0
- biomechpy-1.1.0/tests/test_cli_v1.py +23 -0
- biomechpy-1.1.0/tests/test_cohort_compression.py +64 -0
- biomechpy-1.1.0/tests/test_compressed_simulation.py +30 -0
- biomechpy-1.1.0/tests/test_compression_safety_v1_1.py +93 -0
- biomechpy-1.1.0/tests/test_constituents.py +29 -0
- biomechpy-1.1.0/tests/test_core.py +33 -0
- biomechpy-1.1.0/tests/test_current_deformation_roundtrip_v1_1.py +134 -0
- biomechpy-1.1.0/tests/test_distributed_checkpoint.py +27 -0
- biomechpy-1.1.0/tests/test_fem.py +31 -0
- biomechpy-1.1.0/tests/test_fenicsx_source_contract_v1_1.py +31 -0
- biomechpy-1.1.0/tests/test_independent_audit_regressions_v1_1.py +263 -0
- biomechpy-1.1.0/tests/test_mixture_mechanics.py +33 -0
- biomechpy-1.1.0/tests/test_mixture_state.py +39 -0
- biomechpy-1.1.0/tests/test_parameter_validation_v1.py +38 -0
- biomechpy-1.1.0/tests/test_partitioning.py +42 -0
- biomechpy-1.1.0/tests/test_presets.py +19 -0
- biomechpy-1.1.0/tests/test_production.py +13 -0
- biomechpy-1.1.0/tests/test_public_api_v1.py +97 -0
- biomechpy-1.1.0/tests/test_rc3_checkpoint_partition_hardening.py +162 -0
- biomechpy-1.1.0/tests/test_rc3_geometry_hardening.py +107 -0
- biomechpy-1.1.0/tests/test_rc3_protocol_hardening.py +110 -0
- biomechpy-1.1.0/tests/test_scalable_benchmark.py +14 -0
- biomechpy-1.1.0/tests/test_scalable_fenicsx_bridge.py +14 -0
- biomechpy-1.1.0/tests/test_scalable_packing.py +35 -0
- biomechpy-1.1.0/tests/test_scientific_invariants_v1.py +259 -0
- biomechpy-1.1.0/tests/test_simulation.py +17 -0
- biomechpy-1.1.0/tests/test_spatial_benchmark.py +23 -0
- biomechpy-1.1.0/tests/test_spatial_mixture_coupling.py +44 -0
- biomechpy-1.1.0/tests/test_spatial_mixture_fem.py +93 -0
- biomechpy-1.1.0/tests/test_spatial_mixture_state.py +44 -0
- biomechpy-1.1.0/tests/test_spatial_turnover.py +31 -0
- biomechpy-1.1.0/tests/test_survival.py +22 -0
- biomechpy-1.1.0/tests/test_unstructured_3d_mixture.py +41 -0
- biomechpy-1.1.0/tests/test_unstructured_mesh.py +28 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
cff-version: 1.2.0
|
|
2
|
+
message: "If you use BiomechPy, please cite the software release metadata."
|
|
3
|
+
title: "BiomechPy: Universal Growth and Remodeling of Biological Tissues"
|
|
4
|
+
type: software
|
|
5
|
+
authors:
|
|
6
|
+
- name: "BiomechPy contributors"
|
|
7
|
+
version: "1.1.0"
|
|
8
|
+
date-released: "2026-09-09"
|
|
9
|
+
license: MIT
|
biomechpy-1.1.0/LICENSE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 BiomechPy contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, subject to inclusion of this notice.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
include README.md
|
|
2
|
+
include LICENSE
|
|
3
|
+
include CITATION.cff
|
|
4
|
+
include environment.yml
|
|
5
|
+
include environment-fenicsx.yml
|
|
6
|
+
recursive-include docs *.md *.png
|
|
7
|
+
recursive-include notebooks *.ipynb
|
|
8
|
+
recursive-include examples *.py
|
|
9
|
+
recursive-include scripts *.py *.sh *.bat
|
|
10
|
+
recursive-include src/biomechpy *.py py.typed
|
|
11
|
+
|
|
12
|
+
recursive-include src/biomechpy/data *.json
|
|
13
|
+
recursive-include tests *.py
|
biomechpy-1.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,472 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: biomechpy
|
|
3
|
+
Version: 1.1.0
|
|
4
|
+
Summary: Universal Python framework for growth and remodeling of biological tissues.
|
|
5
|
+
Author: BiomechPy contributors
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/Data-Driven-Biomedicine-Lab/BiomechPy
|
|
8
|
+
Project-URL: Repository, https://github.com/Data-Driven-Biomedicine-Lab/BiomechPy
|
|
9
|
+
Project-URL: Issues, https://github.com/Data-Driven-Biomedicine-Lab/BiomechPy/issues
|
|
10
|
+
Keywords: biomechanics,growth,remodeling,constrained mixture,soft tissue,mechanobiology
|
|
11
|
+
Requires-Python: >=3.10
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Requires-Dist: numpy>=1.24
|
|
15
|
+
Requires-Dist: scipy>=1.10
|
|
16
|
+
Provides-Extra: notebook
|
|
17
|
+
Requires-Dist: matplotlib>=3.7; extra == "notebook"
|
|
18
|
+
Requires-Dist: pandas>=2.0; extra == "notebook"
|
|
19
|
+
Requires-Dist: jupyterlab>=4.0; extra == "notebook"
|
|
20
|
+
Requires-Dist: ipykernel>=6.0; extra == "notebook"
|
|
21
|
+
Requires-Dist: nbformat>=5.9; extra == "notebook"
|
|
22
|
+
Requires-Dist: nbclient>=0.10; extra == "notebook"
|
|
23
|
+
Requires-Dist: nbconvert>=7.0; extra == "notebook"
|
|
24
|
+
Provides-Extra: dev
|
|
25
|
+
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
26
|
+
Requires-Dist: ruff>=0.6; extra == "dev"
|
|
27
|
+
Requires-Dist: build>=1.2; extra == "dev"
|
|
28
|
+
Dynamic: license-file
|
|
29
|
+
|
|
30
|
+
# BiomechPy
|
|
31
|
+
|
|
32
|
+
**Universal Growth and Remodeling of Biological Tissues**
|
|
33
|
+
Version `1.1.0`
|
|
34
|
+
|
|
35
|
+
BiomechPy is a Python research framework for finite-strain mechanics, growth,
|
|
36
|
+
remodeling, constituent turnover, and constrained-mixture modeling of
|
|
37
|
+
biological tissues.
|
|
38
|
+
|
|
39
|
+
Version 1.0 froze the first stable user-facing architecture:
|
|
40
|
+
|
|
41
|
+
\[
|
|
42
|
+
\text{constituents}
|
|
43
|
+
\rightarrow
|
|
44
|
+
\text{mechanics}
|
|
45
|
+
\rightarrow
|
|
46
|
+
\text{stimuli}
|
|
47
|
+
\rightarrow
|
|
48
|
+
\text{production/removal}
|
|
49
|
+
\rightarrow
|
|
50
|
+
\text{deposition}
|
|
51
|
+
\rightarrow
|
|
52
|
+
\text{growth/remodeling}.
|
|
53
|
+
\]
|
|
54
|
+
|
|
55
|
+
The package is **universal by composition**. A new tissue model is built by
|
|
56
|
+
combining reusable scientific components; adding a new organ does not require
|
|
57
|
+
creating a new solver class.
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
## 1.1 final release status
|
|
61
|
+
|
|
62
|
+
BiomechPy **1.1.0** is the promoted stable release from the independently
|
|
63
|
+
audited `1.1.0rc4` candidate. The numerical/scientific source used for the
|
|
64
|
+
release gate is unchanged by the promotion; only release metadata and final
|
|
65
|
+
release documentation were updated.
|
|
66
|
+
|
|
67
|
+
The matched backend contract was executed with DOLFINx 0.11.0, PETSc 3.25.5,
|
|
68
|
+
and real MPICH runs on 1, 2, and 4 ranks. NumPy/FEniCSx energy and reactions
|
|
69
|
+
agree to relative errors below `1.4e-15` for this contract. All 104 tests, all
|
|
70
|
+
four scientific/regression contracts, all seven notebooks, all four examples,
|
|
71
|
+
Ruff check/format, wheel/sdist isolated installs, and the full release manifest
|
|
72
|
+
passed in the independently audited release candidate.
|
|
73
|
+
|
|
74
|
+
This verifies the stated synthetic matched-backend boundary. It is not
|
|
75
|
+
experimental, clinical, patient-specific, or tissue-wide validation.
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
## What is new in 1.1
|
|
79
|
+
|
|
80
|
+
BiomechPy 1.1 does not introduce a new tissue law. It verifies the numerical
|
|
81
|
+
backend boundary established by the stable 1.0 scientific core.
|
|
82
|
+
|
|
83
|
+
The first matched contract solves the same homogeneous fiber-reinforced
|
|
84
|
+
biaxial patch with
|
|
85
|
+
|
|
86
|
+
```text
|
|
87
|
+
BiomechPy NumPy Q4 reference
|
|
88
|
+
vs
|
|
89
|
+
DOLFINx 0.11 / PETSc SNES
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
The frozen reference values are
|
|
93
|
+
|
|
94
|
+
```text
|
|
95
|
+
total energy 1.4271533287877007
|
|
96
|
+
reaction x 15.55219526522195
|
|
97
|
+
reaction y 30.83467144077694
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Run the strict gate with
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
biomechpy verify-backends
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
The command intentionally returns exit code `2` when the FEniCSx candidate was
|
|
107
|
+
not executed. Missing DOLFINx is **not** interpreted as a successful backend
|
|
108
|
+
verification.
|
|
109
|
+
|
|
110
|
+
For NumPy-only environment diagnostics:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
biomechpy verify-backends --allow-missing
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
For the real MPI matrix in the dedicated FEniCSx environment:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
bash scripts/run_fenicsx_mpi_matrix.sh
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
which executes the same problem on 1, 2, and 4 MPI ranks.
|
|
123
|
+
|
|
124
|
+
The audited RC4 run completed all three ranks and the comparer returned exit
|
|
125
|
+
code `0`; machine-readable results are archived under `results/data/`.
|
|
126
|
+
|
|
127
|
+
See:
|
|
128
|
+
|
|
129
|
+
- [`docs/backend_verification_1_1.md`](docs/backend_verification_1_1.md)
|
|
130
|
+
- [`docs/fenicsx_verification_environment.md`](docs/fenicsx_verification_environment.md)
|
|
131
|
+
- [`notebooks/11_matched_backend_verification.ipynb`](notebooks/11_matched_backend_verification.ipynb)
|
|
132
|
+
|
|
133
|
+
## Stable API
|
|
134
|
+
|
|
135
|
+
For long-lived research code:
|
|
136
|
+
|
|
137
|
+
```python
|
|
138
|
+
import biomechpy.api as bmp
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
For notebooks and interactive work:
|
|
142
|
+
|
|
143
|
+
```python
|
|
144
|
+
import biomechpy as bmp
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
The names documented in `biomechpy.api` are covered by the BiomechPy 1.x
|
|
148
|
+
compatibility/deprecation policy.
|
|
149
|
+
|
|
150
|
+
## Build your own tissue
|
|
151
|
+
|
|
152
|
+
```python
|
|
153
|
+
import numpy as np
|
|
154
|
+
import biomechpy.api as bmp
|
|
155
|
+
|
|
156
|
+
matrix = bmp.ConstituentDefinition(
|
|
157
|
+
name="matrix",
|
|
158
|
+
material=bmp.NeoHookean(2.0, 180.0),
|
|
159
|
+
survival_law=bmp.PermanentSurvival(),
|
|
160
|
+
production_law=bmp.ConstantProduction(0.0),
|
|
161
|
+
initial_density=0.4,
|
|
162
|
+
)
|
|
163
|
+
|
|
164
|
+
architecture = bmp.FiberArchitecture.from_angles(
|
|
165
|
+
np.deg2rad([25.0]),
|
|
166
|
+
structural_order=[0.8],
|
|
167
|
+
weights=[1.0],
|
|
168
|
+
names=["fiber"],
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
fiber = bmp.ConstituentDefinition(
|
|
172
|
+
name="fiber",
|
|
173
|
+
material=bmp.ExponentialFiber(5.0, 5.0),
|
|
174
|
+
survival_law=bmp.ExponentialSurvival(12.0),
|
|
175
|
+
production_law=bmp.HomeostaticProduction(
|
|
176
|
+
0.6 / 12.0,
|
|
177
|
+
gain=2.0,
|
|
178
|
+
density_feedback=0.25,
|
|
179
|
+
),
|
|
180
|
+
initial_density=0.6,
|
|
181
|
+
architecture=architecture,
|
|
182
|
+
deposition_rule=bmp.DirectionalDepositionStretch(1.04, 1.0),
|
|
183
|
+
)
|
|
184
|
+
|
|
185
|
+
tissue = (
|
|
186
|
+
bmp.TissueBuilder("custom_tissue", dimension=2)
|
|
187
|
+
.add_constituents((matrix, fiber))
|
|
188
|
+
.describe("Synthetic custom tissue model.")
|
|
189
|
+
.with_metadata(data="synthetic")
|
|
190
|
+
.build()
|
|
191
|
+
)
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
No preset is required.
|
|
195
|
+
|
|
196
|
+
## Validate before simulation
|
|
197
|
+
|
|
198
|
+
```python
|
|
199
|
+
report = bmp.validate_tissue_definition(tissue)
|
|
200
|
+
print(report.summary())
|
|
201
|
+
report.raise_for_errors()
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
Validation checks software/scientific invariants such as deposition
|
|
205
|
+
Jacobians, survival-law ranges, production-law outputs, and dimensional
|
|
206
|
+
compatibility. It does **not** claim physiological or experimental validation.
|
|
207
|
+
|
|
208
|
+
## Constitutive parameter and units contract
|
|
209
|
+
|
|
210
|
+
`NeoHookean(mu, lame_lambda)` uses the first Lamé parameter `lambda` in the
|
|
211
|
+
logarithmic volumetric term; the second argument is **not** a physical bulk
|
|
212
|
+
modulus. To construct from a requested small-strain bulk modulus `K`, use
|
|
213
|
+
`NeoHookean.from_shear_bulk(mu, K, dimension=...)`.
|
|
214
|
+
|
|
215
|
+
Constituent `initial_density` / `deposited_density` are dimensionless normalized
|
|
216
|
+
reference-content weights in the 1.0 mixture model. Two-dimensional material
|
|
217
|
+
calculations are intrinsic 2D formulations and are not silently interpreted as
|
|
218
|
+
plane stress or plane strain. See `docs/units_and_dimensions.md`.
|
|
219
|
+
|
|
220
|
+
## Material-point constrained mixture
|
|
221
|
+
|
|
222
|
+
```python
|
|
223
|
+
state = tissue.initial_mixture()
|
|
224
|
+
|
|
225
|
+
step = bmp.advance_turnover(
|
|
226
|
+
state,
|
|
227
|
+
np.diag([1.08, 1.02]),
|
|
228
|
+
time_step=1.0,
|
|
229
|
+
stimuli={"fiber": 0.05},
|
|
230
|
+
)
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
For a cohort deposited at biological time \(\tau\),
|
|
234
|
+
|
|
235
|
+
\[
|
|
236
|
+
\mathbf F_e^{\alpha,\tau}(t)
|
|
237
|
+
=
|
|
238
|
+
\mathbf F(t)
|
|
239
|
+
\mathbf F^{-1}(\tau)
|
|
240
|
+
\mathbf G_h^\alpha(\tau).
|
|
241
|
+
\]
|
|
242
|
+
|
|
243
|
+
The constrained-mixture energy is accumulated over surviving constituent
|
|
244
|
+
cohorts.
|
|
245
|
+
|
|
246
|
+
## Spatial growth and remodeling
|
|
247
|
+
|
|
248
|
+
```python
|
|
249
|
+
mesh = bmp.rectangular_quad_mesh(8, 4)
|
|
250
|
+
spatial_state = tissue.initial_spatial_mixture(mesh)
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
Every integration location stores its own constituent/cohort history.
|
|
254
|
+
|
|
255
|
+
BiomechPy supports:
|
|
256
|
+
|
|
257
|
+
- local production and removal;
|
|
258
|
+
- spatially heterogeneous initial constituent densities;
|
|
259
|
+
- cohort deposition histories;
|
|
260
|
+
- exact local mass-balance audits;
|
|
261
|
+
- structured reference Q4 equilibrium;
|
|
262
|
+
- optional cohort compression;
|
|
263
|
+
- checkpoint/restart;
|
|
264
|
+
- packed ragged cohort storage.
|
|
265
|
+
|
|
266
|
+
## Unstructured and 3D state workflows
|
|
267
|
+
|
|
268
|
+
```python
|
|
269
|
+
mesh3d = bmp.unit_cube_tet_mesh(2, 2, 2)
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
The unstructured layer provides:
|
|
273
|
+
|
|
274
|
+
- triangles and tetrahedra;
|
|
275
|
+
- stable global cell IDs;
|
|
276
|
+
- stable global quadrature-location IDs;
|
|
277
|
+
- deterministic partition plans;
|
|
278
|
+
- exact partition/reconstruction of biological histories;
|
|
279
|
+
- partition-aware checkpoints;
|
|
280
|
+
- 3D constrained-mixture affine reference benchmarks.
|
|
281
|
+
|
|
282
|
+
The current tetrahedral reference benchmark uses **prescribed affine
|
|
283
|
+
kinematics**; it is not presented as a nonlinear 3D FE equilibrium solve.
|
|
284
|
+
|
|
285
|
+
## Scalable history storage
|
|
286
|
+
|
|
287
|
+
```python
|
|
288
|
+
packed = bmp.pack_spatial_mixture_state(spatial_state)
|
|
289
|
+
restored = packed.to_state()
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
For long simulations:
|
|
293
|
+
|
|
294
|
+
```python
|
|
295
|
+
policy = bmp.CohortCompressionPolicy(
|
|
296
|
+
maximum_cohorts=12,
|
|
297
|
+
protected_recent_cohorts=2,
|
|
298
|
+
old_age_bins=9,
|
|
299
|
+
)
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
Compression preserves current surviving density at the compression instant but
|
|
303
|
+
approximates history-dependent mechanics. BiomechPy reports this approximation
|
|
304
|
+
error explicitly.
|
|
305
|
+
|
|
306
|
+
## Versioned benchmark contracts
|
|
307
|
+
|
|
308
|
+
BiomechPy 1.0 freezes synthetic numerical reference contracts:
|
|
309
|
+
|
|
310
|
+
```bash
|
|
311
|
+
biomechpy verify
|
|
312
|
+
biomechpy verify-backends
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
or:
|
|
316
|
+
|
|
317
|
+
```python
|
|
318
|
+
for result in bmp.run_all_benchmark_contracts():
|
|
319
|
+
print(result.summary())
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
Current contracts:
|
|
323
|
+
|
|
324
|
+
```text
|
|
325
|
+
material_point_turnover_v1
|
|
326
|
+
spatial_q4_turnover_v1
|
|
327
|
+
unstructured_3d_turnover_v1
|
|
328
|
+
scientific_invariants_v1
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
The first three contracts reproduce corrected synthetic numerical behavior.
|
|
332
|
+
`scientific_invariants_v1` instead targets analytical/invariance properties such
|
|
333
|
+
as homeostatic mass preservation, frame indifference, constitutive
|
|
334
|
+
differentiation, homeostatic growth, and affine FE mesh invariance. Passing any
|
|
335
|
+
contract is computational verification, not experimental validation.
|
|
336
|
+
|
|
337
|
+
## Command line
|
|
338
|
+
|
|
339
|
+
```bash
|
|
340
|
+
biomechpy info
|
|
341
|
+
biomechpy presets
|
|
342
|
+
biomechpy preset tendon --json
|
|
343
|
+
biomechpy verify
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
## Optional tissue presets
|
|
347
|
+
|
|
348
|
+
Presets are examples, not the architecture:
|
|
349
|
+
|
|
350
|
+
```python
|
|
351
|
+
bmp.available_tissue_presets()
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
currently includes examples for arterial wall, tendon, skin, myocardium,
|
|
355
|
+
uterus, intestine, and cartilage. All return the same `TissueDefinition` type.
|
|
356
|
+
Parameters are synthetic software defaults.
|
|
357
|
+
|
|
358
|
+
## FEniCSx
|
|
359
|
+
|
|
360
|
+
FEniCSx is optional. The 1.1 verification backend targets the stable DOLFINx `0.11.x`
|
|
361
|
+
release series.
|
|
362
|
+
|
|
363
|
+
```bash
|
|
364
|
+
conda env create -f environment-fenicsx.yml
|
|
365
|
+
conda activate biomechpy-fenicsx
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
Ragged constituent histories remain in packed sidecar storage while fixed-size
|
|
369
|
+
summaries can be mapped to DG0 fields.
|
|
370
|
+
|
|
371
|
+
The verified FEniCSx scope is the matched homogeneous patch. It does not imply
|
|
372
|
+
that an arbitrary distributed nonlinear constrained-mixture model has been
|
|
373
|
+
experimentally validated.
|
|
374
|
+
|
|
375
|
+
## Notebooks
|
|
376
|
+
|
|
377
|
+
Recommended sequence:
|
|
378
|
+
|
|
379
|
+
```text
|
|
380
|
+
00_START_HERE.ipynb
|
|
381
|
+
06_constituent_turnover_and_constrained_mixture.ipynb
|
|
382
|
+
07_spatial_constrained_mixtures.ipynb
|
|
383
|
+
08_scalable_spatial_mixtures.ipynb
|
|
384
|
+
09_distributed_unstructured_mixtures.ipynb
|
|
385
|
+
10_build_your_own_tissue_model.ipynb
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
Notebook 10 is the main 1.0 user tutorial: it builds a model without using a
|
|
389
|
+
preset.
|
|
390
|
+
|
|
391
|
+
## Documentation
|
|
392
|
+
|
|
393
|
+
- [`docs/quickstart.md`](docs/quickstart.md)
|
|
394
|
+
- [`docs/custom_tissue.md`](docs/custom_tissue.md)
|
|
395
|
+
- [`docs/api_stability.md`](docs/api_stability.md)
|
|
396
|
+
- [`docs/stable_api_v1.md`](docs/stable_api_v1.md)
|
|
397
|
+
- [`docs/benchmark_contracts.md`](docs/benchmark_contracts.md)
|
|
398
|
+
- [`docs/modeling_scope.md`](docs/modeling_scope.md)
|
|
399
|
+
- [`docs/units_and_dimensions.md`](docs/units_and_dimensions.md)
|
|
400
|
+
- [`docs/scientific_audit_resolution_v1.0.md`](docs/scientific_audit_resolution_v1.0.md)
|
|
401
|
+
- [`docs/migration_0_9_to_1_0.md`](docs/migration_0_9_to_1_0.md)
|
|
402
|
+
- [`docs/scientific_contracts.md`](docs/scientific_contracts.md)
|
|
403
|
+
- [`docs/architecture.md`](docs/architecture.md)
|
|
404
|
+
|
|
405
|
+
## Installation
|
|
406
|
+
|
|
407
|
+
From the repository:
|
|
408
|
+
|
|
409
|
+
```bash
|
|
410
|
+
python -m pip install -e .
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
For notebooks:
|
|
414
|
+
|
|
415
|
+
```bash
|
|
416
|
+
python -m pip install -e ".[notebook]"
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
or:
|
|
420
|
+
|
|
421
|
+
```bash
|
|
422
|
+
conda env create -f environment.yml
|
|
423
|
+
conda activate biomechpy
|
|
424
|
+
jupyter lab
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
## Scientific scope
|
|
428
|
+
|
|
429
|
+
BiomechPy provides a common architecture for G&R models; it does not assert
|
|
430
|
+
that one material law or one mechanobiological hypothesis applies to all
|
|
431
|
+
biological tissues.
|
|
432
|
+
|
|
433
|
+
Separate extensions are still required for physics such as:
|
|
434
|
+
|
|
435
|
+
- biphasic/poroelastic transport;
|
|
436
|
+
- electrophysiology;
|
|
437
|
+
- fluid–structure interaction;
|
|
438
|
+
- reaction–diffusion;
|
|
439
|
+
- contact;
|
|
440
|
+
- mineralized-tissue remodeling;
|
|
441
|
+
- detailed cell-population dynamics.
|
|
442
|
+
|
|
443
|
+
## Scientific status
|
|
444
|
+
|
|
445
|
+
All distributed benchmark and preset parameters are synthetic unless a user
|
|
446
|
+
explicitly supplies calibrated data. BiomechPy 1.1 is a computational research
|
|
447
|
+
framework and numerically verified software release for the stated contracts; it does not claim clinical
|
|
448
|
+
or tissue-specific experimental validation.
|
|
449
|
+
|
|
450
|
+
|
|
451
|
+
### Scope of `remodeling_law`
|
|
452
|
+
|
|
453
|
+
`TissueDefinition.remodeling_law` is currently a reusable standalone
|
|
454
|
+
remodeling primitive. The constrained-mixture simulation loops update
|
|
455
|
+
production, survival, deposition, cohorts and mechanics; they do **not**
|
|
456
|
+
automatically advance that remodeling law. A model that couples both mechanisms
|
|
457
|
+
must call the remodeling state transition explicitly.
|
|
458
|
+
|
|
459
|
+
This distinction is intentional in the 1.1 release and prevents the
|
|
460
|
+
high-level architecture diagram from being read as a claim of an already
|
|
461
|
+
fully coupled arbitrary G&R solver.
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
## Verified release boundary
|
|
466
|
+
|
|
467
|
+
The independent RC4 release-gate audit approved promotion to `1.1.0 FINAL`.
|
|
468
|
+
Allowed claims are limited to the stated numerical/software contracts: NumPy
|
|
469
|
+
reference verification, DOLFINx 0.11 matched-backend verification, real MPI
|
|
470
|
+
rank invariance, scientific invariants, and checkpoint/restart reproducibility.
|
|
471
|
+
BiomechPy 1.1.0 does **not** claim experimental validation for all tissues,
|
|
472
|
+
clinical validation, or patient-specific predictive validity.
|