1/**
2 * Shared .m files every model compiles against: the operator library and the
3 * solvers. A model calls these by name (`richardson(...)`, `dlap(...)`) the
4 * way it calls `synth` — except these are ordinary MATLAB, compiled through
5 * the same pipeline and expanded into the caller at compile time
6 * (src/mgpu/inlineCalls.ts), so a call costs exactly what writing the body
7 * inline would.
8 *
9 * MATLAB file-visibility rules apply: only a file's namesake function is
10 * callable from other files, and a function defined in the model shadows a
11 * lib of the same name.
12 */
13import dlapSource from '../../lib/dlap.m?raw';
14import richardsonSource from '../../solvers/richardson.m?raw';
15import bicgstabSource from '../../solvers/bicgstab.m?raw';
16import gmresSource from '../../solvers/gmres.m?raw';
18export interface LibFile {
19 name: string;
20 source: string;
21}
23/** The operator: dlap = lap_g - lap_s applied to a spectral field. */
24export const operatorLibs: LibFile[] = [{ name: 'dlap.m', source: dlapSource }];
26/** The solvers for (I - dtD*lap_g) X = B. All share dlap's operator. */
27export const solverLibs: LibFile[] = [
28 { name: 'richardson.m', source: richardsonSource },
29 { name: 'bicgstab.m', source: bicgstabSource },
30 { name: 'gmres.m', source: gmresSource },
31];
33/** Everything a model may call. */
34export const modelLibs: LibFile[] = [...operatorLibs, ...solverLibs];