/ proof-of-concept / plate-mechanics-sim
Sign in
proof-of-concept / plate-mechanics-sim
plate-mechanics-sim / packages / core / src / generate / library.ts
56 lines · 3.5 KBCodeBlameHistory
2546961Plate mechanics lab: Kirchhoff-Love plates solved by numbl in the browserJeremy Magland 1import plate_modal from "../m/plate_modal.m?raw";
2import plate_fd from "../m/plate_fd.m?raw";
3import plate_fd_plan from "../m/plate_fd_plan.m?raw";
4import plate_setup from "../m/plate_setup.m?raw";
5import plate_force_time from "../m/plate_force_time.m?raw";
6import plate_force_footprint from "../m/plate_force_footprint.m?raw";
7import plate_stress from "../m/plate_stress.m?raw";
8import plate_sdof from "../m/plate_sdof.m?raw";
9import plate_listener from "../m/plate_listener.m?raw";
10import plate_spectrum from "../m/plate_spectrum.m?raw";
11import plate_pad from "../m/plate_pad.m?raw";
12import plate_laplacian from "../m/plate_laplacian.m?raw";
13import plate_curvature from "../m/plate_curvature.m?raw";
14import plate_compare from "../m/plate_compare.m?raw";
15import plate_implicit from "../m/plate_implicit.m?raw";
16import plate_implicit_plan from "../m/plate_implicit_plan.m?raw";
17import plate_matrices from "../m/plate_matrices.m?raw";
18import plate_result_schema from "../m/plate_result_schema.m?raw";
20export interface SourceFile {
21 name: string;
22 source: string;
25export interface LibraryFile extends SourceFile {
26 /** One line for the code view's file list */
27 summary: string;
30/** Every `.m` file the solvers can call. The runner ships all of them with each run. */
31export const LIBRARY_FILES: LibraryFile[] = [
32 { name: "plate_modal.m", source: plate_modal, summary: "Modal superposition on a simply supported rectangle" },
33 { name: "plate_fd.m", source: plate_fd, summary: "Explicit finite-difference time stepping" },
34 { name: "plate_fd_plan.m", source: plate_fd_plan, summary: "Grid, stable time step and cost of the FD scheme" },
35 { name: "plate_implicit.m", source: plate_implicit, summary: "Implicit theta-scheme: sparse Cholesky once, two triangular solves per step" },
36 { name: "plate_implicit_plan.m", source: plate_implicit_plan, summary: "Grid, accuracy-chosen time step and size of the implicit scheme" },
37 { name: "plate_matrices.m", source: plate_matrices, summary: "Sparse Laplacian and biharmonic matrices on the interior nodes" },
38 { name: "plate_setup.m", source: plate_setup, summary: "Bending stiffness and other derived constants" },
39 { name: "plate_force_time.m", source: plate_force_time, summary: "Force history F(t): hammer pulse or harmonic drive" },
40 { name: "plate_force_footprint.m", source: plate_force_footprint, summary: "Raised-cosine spatial footprint of the load" },
41 { name: "plate_stress.m", source: plate_stress, summary: "Surface stresses, von Mises and principal stress from curvatures" },
42 { name: "plate_sdof.m", source: plate_sdof, summary: "Exact step response of one damped oscillator" },
43 { name: "plate_listener.m", source: plate_listener, summary: "Rayleigh-integral weights and delays to the listener" },
44 { name: "plate_spectrum.m", source: plate_spectrum, summary: "Windowed amplitude spectrum" },
45 { name: "plate_pad.m", source: plate_pad, summary: "Ghost layer implementing the edge conditions" },
46 { name: "plate_laplacian.m", source: plate_laplacian, summary: "Five-point Laplacian" },
47 { name: "plate_curvature.m", source: plate_curvature, summary: "Second derivatives by central differences" },
48 { name: "plate_compare.m", source: plate_compare, summary: "Error norms between two solutions" },
49 { name: "plate_result_schema.m", source: plate_result_schema, summary: "Documentation of the result struct" },
50];
52export function libraryFile(name: string): LibraryFile {
53 const f = LIBRARY_FILES.find((x) => x.name === name);
54 if (!f) throw new Error(`unknown library file ${name}`);
55 return f;
↑↓ move↵openescclose