File: drop_jax_from_examples.diff

package info (click to toggle)
sfepy 2025.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 27,280 kB
  • sloc: python: 75,301; ansic: 13,267; makefile: 131; sh: 30
file content (17 lines) | stat: -rw-r--r-- 689 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Index: sfepy-release_2025.2/sfepy/examples/linear_elasticity/elastodynamic_identification.py
===================================================================
--- sfepy-release_2025.2.orig/sfepy/examples/linear_elasticity/elastodynamic_identification.py
+++ sfepy-release_2025.2/sfepy/examples/linear_elasticity/elastodynamic_identification.py
@@ -66,6 +66,12 @@ from sfepy.solvers import register_solve
 from sfepy.base.timing import Timer
 import sfepy.mechanics.matcoefs as mc
 
+try:
+    import jax
+except ModuleNotFoundError:
+    print("jax is required for this example")
+    exit(0)
+
 def define(
         young=200e9, poisson=0.3, density=7800,
         alpha=0.0, beta=0.0,