af2a046Von Karman modal solver on a Cartesian grid masked to the disk, site, and workflowJeremy Magland 1# Solutions to the cymbal challenges
3This repository holds solutions to the challenges defined in [challenges/cymbal](https://vault1.magland.org/challenges/cymbal). It is one of possibly several solution repositories registered with that challenge repository, which clones each of them, compares every solution against a common reference, and publishes the comparison at [challenges/cymbal/site](https://vault1.magland.org/challenges/cymbal/site/). This repository's own site, at [challenges/cymbal-solutions/site](https://vault1.magland.org/challenges/cymbal-solutions/site/), lists its submissions with audio players and animates the exported displacement fields as a 3D surface.
5## Layout
7```
8solutions/<challenge-id>/<submission-id>.json one submission: metadata and one or more solutions
9solutions/<challenge-id>/<submission-id>/*.wav the scored output files, referenced from the JSON
10solutions/<challenge-id>/<submission-id>/*.h5 optional displacement fields for visualization (git LFS)
11solvers/ source code of the submissions
12web/ this repository's site (built by web/build.py)
13```
15Field exports are about 40 MB each and are stored with git LFS (`.gitattributes` routes `*.h5` there). Cloning without git-lfs leaves pointer files in their place; the validator tolerates that and the site marks such fields as unavailable.
17## The example submission
19`vonkarman-modal` solves the von Kármán thin-plate reduction of the challenge model (Airy stress function, in-plane inertia neglected, damping on bending only) by a modal method on a Cartesian grid. The disk is approximated by the square cells of a uniform grid whose centers lie inside it, a staircase boundary, with grid spacings of 8 mm and 4 mm. The linear free-plate modes of that domain and the clamped Airy modes come from Bogner-Fox-Schmit C1 finite elements on the cells and a sparse shift-invert eigensolver; the cubic coupling tensor is integrated on the same cells; the time stepping is a two-step scheme exact in the linear part; and the retarded Rayleigh integral is evaluated with cubic fractional delays. The chain is ordered by grid spacing, number of modes, and time step. It is a thin-plate approximation on an approximate domain, so its converged limit differs from the three-dimensional model that defines the challenge.
21```
30c7997README: the chain runs on the GPUJeremy Magland 22bash solvers/vonkarman-modal-disk/run_chain.sh <cymbal-repo>/challenges/cymbal-flat-disk-v1/challenge.json gpu # needs a CUDA GPU and PyTorch; 'cpu' works but takes hours
af2a046Von Karman modal solver on a Cartesian grid masked to the disk, site, and workflowJeremy Magland 23```
30c7997README: the chain runs on the GPUJeremy Magland 25The chain is `g8-w100-a100-m1`, `g8-w200-a200-m1`, `g4-w200-a200-m2`, `g4-w300-a300-m2`, `g4-w450-a450-m2`, `g4-w600-a600-m4` (grid spacing in mm, transverse modes, Airy modes, time steps per output sample). Because the strike is centered on the x axis the solution is even in y, and the modal bases are restricted to that symmetric subspace, which is exact and halves the number of modes needed for a given frequency reach: 200 symmetric modes reach about 6 kHz, 300 about 9 kHz, 450 about 13.5 kHz and 600 about 18 kHz. The cost of a time step is the memory bandwidth of the cubic coupling tensor (8 bytes times the cube of the mode count, 1.7 GB at 600 modes), so the chain was run on a workstation GPU with `--device cuda`, where a step takes a fraction of a millisecond; the CPU path is the reference implementation, the two agree to round-off, and the hardware is recorded per solution. The 8 mm grid has 2024 cells and 8500 degrees of freedom, the 4 mm grid 8112 cells and 33268. On the 8 mm grid the lowest elastic frequencies are 21.76 and 21.88 Hz for the two-nodal-diameter pair (21.87 Hz analytically), 38.01 Hz for the first axisymmetric mode (38.03) and 87.6 and 90.2 Hz for the four-nodal-diameter pair (89.61); on the 4 mm grid the last pair is 89.03 and 89.19 Hz. The staircase splits degenerate pairs by about a percent at 8 mm and a few tenths of a percent at 4 mm. The linear limit of the nonlinear solver agrees with the closed-form linear modal solution on the same mesh to 5e-4 at one step per sample and 1.3e-4 at two. A caution: the free disk's low modes radiate to the listener as a near-cancelling sum, and the staircase edge breaks the cancellation. In the linear closed-form solution the ring level after the strike falls from 0.040 Pa rms at 8 mm to 0.016 at 6 mm, 0.012 at 4 mm and 0.0096 at 3 mm, while the mode frequencies agree to within a percent, so the radiated pressure converges only at first order in the grid spacing and the 8 mm members ring several times too loud. This is the main reason the errors between the 8 mm and 4 mm members are large, and it is why a boundary-conforming (polar or mapped) grid is the natural next solver for this challenge.
af2a046Von Karman modal solver on a Cartesian grid masked to the disk, site, and workflowJeremy Magland 26
27## Adding a submission
29Follow the same steps as in [challenges/string-solutions](https://vault1.magland.org/challenges/string-solutions#adding-a-submission-to-this-repository): produce the output exactly as the [specification](https://vault1.magland.org/challenges/cymbal/blob/main/challenges/cymbal-flat-disk-v1/README.md) says, write `solutions/<challenge-id>/<submission-id>.json` following the [schema](https://vault1.magland.org/challenges/challenge-tools/blob/main/schema.json), record known accuracy orderings in `more_accurate_than`, and open a pull request.
31## Validating locally
33```
34pip install git+https://vault1.magland.org/challenges/challenge-tools
35challenge-tools validate --challenges <path-to-cymbal-repo>/challenges --solutions solutions
36python web/build.py --out site
37```