Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
440d3d7
refactor: initial refactor to adopt pydantic
mhoeijm Oct 21, 2025
1120bcf
chore: adding changelog file 1259.miscellaneous.md [dependabot-skip]
pyansys-ci-bot Oct 21, 2025
8cba7d2
refactor: remove remove_units method and references
mhoeijm Oct 21, 2025
ec8f4b5
refactor: new way to set values
mhoeijm Oct 21, 2025
74b9368
Merge branch 'refactor/adopt-pydantic-for-settings' of https://github…
mhoeijm Oct 21, 2025
fc8688b
refactor: fix test
mhoeijm Oct 21, 2025
bd80e86
refactor: fix test
mhoeijm Oct 21, 2025
c74378e
refactor: fix post tests
mhoeijm Oct 21, 2025
258edf3
refactor: add tests
mhoeijm Oct 21, 2025
d6e4f76
refactor: try ureg for strings in field validation
mhoeijm Oct 22, 2025
821d729
refactor: apply logic only to quantity annotated fields
mhoeijm Oct 22, 2025
f35095d
Merge branch 'main' into refactor/adopt-pydantic-for-settings
mhoeijm Oct 28, 2025
2080026
refactor: remove deprecated deserialization
mhoeijm Oct 28, 2025
37a4653
refactor: use pydantic for serialization
mhoeijm Oct 28, 2025
a7feae4
refactor: remove unused serialization method
mhoeijm Oct 28, 2025
1df615a
refactor: cleanup
mhoeijm Oct 28, 2025
1e32491
refactor: cleanup
mhoeijm Oct 28, 2025
0a6b159
refactor: cleanup unused methods
mhoeijm Oct 28, 2025
fc798d7
refactor: update all docstrings
mhoeijm Oct 28, 2025
5bc42a5
refactor: improve handling of zeropressure settings
mhoeijm Oct 28, 2025
fdd11de
refactor: update test settings
mhoeijm Oct 28, 2025
9894620
fix: wrong values for base region
mhoeijm Oct 30, 2025
6b19f37
fix: create isolation layer for EP models
mhoeijm Oct 30, 2025
f61d58d
fix: define reaction eikonal just after initializing settings
mhoeijm Oct 30, 2025
d84b9d1
fix: conditional
mhoeijm Oct 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/source/changelog/1259.miscellaneous.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use pydantic for the settings module
6 changes: 3 additions & 3 deletions examples/simulator/ep-mechanics-simulator-fullheart.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@
# Load default simulation settings.
simulator.settings.load_defaults()

# Use the ReactionEikonal solver for the electrophysiology simulation.
simulator.settings.electrophysiology.analysis.solvertype = "ReactionEikonal"

###############################################################################
# Compute the fiber orientation
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -186,9 +189,6 @@
# A constant pressure is prescribed to the atria.
# No circulation system is coupled with the atria.

# Use the ReactionEikonal solver for the electrophysiology simulation.
simulator.settings.electrophysiology.analysis.solvertype = "ReactionEikonal"

# Start main simulation. The ``auto_post`` option is set to ``False`` to avoid
# automatic postprocessing.
simulator.simulate(auto_post=False)
Expand Down
4 changes: 2 additions & 2 deletions examples/simulator/ep-simulator-fullheart_rodero.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@
# Load the default settings.
simulator.settings.load_defaults()

simulator.settings.electrophysiology.analysis.solvertype = "ReactionEikonal"

###############################################################################
# Compute fiber orientation
# ~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -145,7 +147,5 @@
# Start the main electrophysiology simulation. This uses the previously computed fiber orientation
# and Purkinje network to set up and run the LS-DYNA model.


# Compute the Eikonal solution. This only computes the activation time.
simulator.settings.electrophysiology.analysis.solvertype = "ReactionEikonal"
simulator.simulate(folder_name="main-ep-ReactionEikonal")
6 changes: 4 additions & 2 deletions src/ansys/health/heart/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1696,8 +1696,10 @@ def create_stiff_ventricle_base(
part.fiber = False
part.active = False
part.meca_material = stiff_material
# assign default EP material as for ventricles
part.ep_material = ep_materials.Active()
# Assign Active EP material.
part.ep_material = ep_materials.Active(
sigma_fiber=0.5, sigma_sheet=0.1, sigma_sheet_normal=0.1, beta=140.0, cm=0.01
)

return part

Expand Down
12 changes: 6 additions & 6 deletions src/ansys/health/heart/post/system_model_post.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,15 +181,15 @@ def __init__(self, dir: str):
s = SimulationSettings()
s.load(os.path.join(self.dir, "simulation_settings.yml"))
l_ed_pressure = (
s.mechanics.boundary_conditions.end_diastolic_cavity_pressure.left_ventricle.to(
"kilopascal"
).m
s.mechanics.boundary_conditions.end_diastolic_cavity_pressure.get("left_ventricle")
.to("kilopascal")
.m
)
if self.model_type == "BV":
r_ed_pressure = (
s.mechanics.boundary_conditions.end_diastolic_cavity_pressure.right_ventricle.to(
"kilopascal"
).m
s.mechanics.boundary_conditions.end_diastolic_cavity_pressure.get("right_ventricle")
.to("kilopascal")
.m
)

# get EOD volume
Expand Down
Loading