1"""cymsim: explicit nonlinear finite-element simulation of struck cymbals.
3The model is a Marguerre-von Karman shallow shell on a triangulated disk, discretized with
4constant-strain membrane triangles and Discrete Kirchhoff bending triangles, integrated in time
5with an explicit leapfrog scheme, struck by one or more rigid exciters through power-law contact
6springs, and heard through a Rayleigh-integral radiation model. The equations, the
7discretization and the time-stepping method are written out in docs/model.md; each module's
8docstring points to the relevant section.
10Typical use::
12 from cymsim import SimulationConfig, simulate
13 cfg = SimulationConfig.from_yaml("examples/crash_mallet.yaml")
14 result = simulate(cfg)
15 result.write_wav("crash")
16 result.save("crash.cymsim") # HDF5 file, see docs/format.md; load_cymsim reads it back
17"""
18import jax
20# Set-up quantities (element stiffness, eigenvalue bounds, rigid modes) are computed in float64;
21# the time loop casts everything to the precision chosen in Numerics.dtype.
22jax.config.update("jax_enable_x64", True)
23# Never let a matmul silently drop to TF32 inside the stiffness evaluation.
24jax.config.update("jax_default_matmul_precision", "highest")
26from .config import ( # noqa: E402
27 Hit,
28 Imperfections,
29 Listener,
30 MalletExciter,
31 Material,
32 MeshConfig,
33 Numerics,
34 Output,
35 Profile,
36 SimulationConfig,
37 StickExciter,
38)
39from .cache import MODEL_VERSION, cache_key # noqa: E402
40from .cymsim_file import describe, load_cymsim, save_cymsim # noqa: E402
41from .simulate import ( # noqa: E402
42 AccelerationRecord,
43 DisplacementRecord,
44 SimulationResult,
45 Simulator,
46 simulate,
47)
49__version__ = "0.1.0"
51__all__ = [
52 "Hit", "Imperfections", "Listener", "MalletExciter", "Material", "MeshConfig", "Numerics",
53 "Output", "Profile", "SimulationConfig", "StickExciter",
54 "AccelerationRecord", "DisplacementRecord", "SimulationResult", "Simulator", "simulate",
55 "describe", "load_cymsim", "save_cymsim", "MODEL_VERSION", "cache_key",
56]