1function plan = plate_fd_plan(params)
2% PLATE_FD_PLAN Grid, time step, cost and statics of the explicit scheme, before a run.
3%
4% plan = plate_fd_plan(params) assembles the model (plate_model) and reports
5% plan.nx, plan.ny, plan.dx, plan.dy grid (nodes include the edges of the box)
6% plan.dt_max largest stable time step [s]
7% plan.dt step actually used, params.fd.cfl * dt_max
8% plan.nsteps, plan.ncells, plan.cell_steps problem size (ncells counts every grid node)
9% plan.nunknowns nodes the scheme actually updates
10% plan.rigid_hz frequencies of the rigid-body modes the
11% mount leaves (sway, swing, spin or heave and
12% tilts), NaN for an unstable one
13% plan.rigid_names the rigid-body coordinates of the mount
14% plan.rigid_mode_names the coordinate that dominates each mode
15% plan.sag largest static deflection under gravity [m]
16% plan.gx, plan.gy, plan.gz direction of gravity in plate coordinates
17% plan.mass, plan.xc, plan.yc plate mass and centre of mass
18% plan.tension thread tensions [N] (empty otherwise)
19% plan.notes remarks about the mount and the statics
20%
21% Because the step scales with dx^2, halving the grid spacing costs eight
22% times as many cell updates for the same simulated time; and because the
23% pendulum motion of a hanging plate takes a second or so to show while the
24% step is a few microseconds, a run is hundreds of thousands of steps.
26mdl = plate_model(params);
27plan.nx = mdl.nx; plan.ny = mdl.ny; plan.dx = mdl.dx; plan.dy = mdl.dy;
28plan.dt_max = mdl.dt_max;
29plan.dt = mdl.dt;
30plan.nsteps = mdl.nsteps;
31plan.ncells = mdl.ncells;
32plan.nunknowns = mdl.nunknowns;
33plan.cell_steps = plan.ncells * plan.nsteps;
34plan.rigid_hz = mdl.rigid_hz(:)';
35plan.rigid_names = mdl.mnt.rigid_names;
36plan.rigid_mode_names = mdl.rigid_mode_names;
37plan.sag = mdl.st.sag;
38plan.gx = mdl.mnt.gx; plan.gy = mdl.mnt.gy; plan.gz = mdl.mnt.gz;
39plan.mass = mdl.mnt.mass; plan.xc = mdl.mnt.xc; plan.yc = mdl.mnt.yc;
40plan.tension = zeros(1, 0);
41if mdl.ps.solved && any(strcmp(mdl.mnt.type, {'thread', 'threads'}))
42 plan.tension = mdl.ps.up(mdl.ps.fixed_nodes)';
43end
44plan.Om2 = mdl.Om2;
45plan.notes = mdl.notes;
46end