import logging import os import pytest # The tests run on the CPU, where runs are reproducible bit for bit (on a GPU, scatter-adds by # atomics make two identical runs differ slightly). JAX_PLATFORMS=cuda runs them on a GPU, where # the tests comparing separate runs exactly are expected to fail. os.environ.setdefault("JAX_PLATFORMS", "cpu") from cymsim.config import SimulationConfig, default_config logging.getLogger("cymsim").setLevel(logging.WARNING) @pytest.fixture(scope="session") def coarse_config() -> SimulationConfig: """A 20 mm mesh with few dents: fast enough for CPU tests, still the full model.""" cfg = default_config("mallet") cfg.mesh.element_size = 0.02 cfg.imperfections.n_dents = 50 cfg.numerics.duration = 0.02 cfg.numerics.steps_per_block = 500 cfg.numerics.n_progress = 2 return cfg