1// Controls and resolution ladders reused across chapters, so that "the smooth
2// case" means the same thing everywhere and two chapters can be compared.
3import type { Control } from '../ui/types.ts'
5export const KIND_CONTROL: Control = {
6 kind: 'select',
7 key: 'kind',
8 label: 'manufactured solution',
9 options: [
10 { value: 'smooth', label: 'smooth: exp(sin 3πx)' },
11 { value: 'oscil', label: 'oscillatory: sin 8πx + x' },
12 { value: 'peak', label: 'narrow peak at x = 0.4' },
13 { value: 'layer', label: 'boundary layer, width 1/50' },
14 { value: 'lowreg', label: 'low regularity: |x − ½|^{5/2}' },
15 ],
16}
18export const EXACT2D_CONTROL: Control = {
19 kind: 'select',
20 key: 'kind',
21 label: 'harmonic solution',
22 options: [
23 { value: 'expsin', label: 'exp(x) sin(y)' },
24 { value: 'poly', label: 'Re (x + iy)^5' },
25 { value: 'wave', label: 'exp(ky) sin(kx), k = 8' },
26 { value: 'log', label: 'log|z − z₀|, z₀ just outside' },
27 ],
28}
30export const NS_1D = [8, 16, 32, 64, 128, 256, 512, 1024]
31export const NS_1D_LONG = [16, 64, 256, 1024, 4096, 16384, 65536, 262144, 1048576]
32export const NS_2D = [8, 16, 32, 64, 128, 256]