-
Notifications
You must be signed in to change notification settings - Fork 0
packRepeatTile
ColtonKawamura edited this page Sep 16, 2026
·
1 revision
Loads a saved 2D packing and tiles it scalXMult times in x and scalYMult
times in y, producing a larger periodic packing. If calc_eig is set it
removes rattlers, builds the 2D Hessian, and saves the eigenvectors/eigenvalues
of the tiled packing. Called automatically at the end of pack when
x_mult or y_mult are not 1.
N = 400; K = 100; P_target = 0.05; widthFactor = 22; seed = 1;
scalXMult = 2; scalYMult = 2; calc_eig = false;
strInPath = "data/packings/2d/hooke/"; % directory of the base tile .mat
strSavePath = "data/packings/2d/hooke/"; % directory for the tiled output .mat
packRepeatTile(N, K, P_target, widthFactor, seed, scalXMult, scalYMult, calc_eig, strInPath, strSavePath)The base tile file is located by name:
2D_N<N>_P<P_target>_Width<widthFactor>_Seed<seed>.mat — so the first five
arguments must match the pack call that generated it (Width = round(sqrt(N))).
Output is saved as 2D_N<N*xMult*yMult>_P<P_target>_Width<widthFactor*yMult>_Seed<seed>.mat.
| Arg | Type | Meaning |
|---|---|---|
N |
double | Particles in the base tile |
K |
double | Spring constant (loaded from the base file, passed through) |
P_target |
double | Target pressure (must match base filename) |
widthFactor |
double | Width factor in the base filename (round(sqrt(N)) for 2D) |
seed |
double | Seed in the base filename |
scalXMult |
double | Number of tile copies in x |
scalYMult |
double | Number of tile copies in y |
calc_eig |
logical | Remove rattlers + compute and save the tiled Hessian's eigenvectors/eigenvalues |
strInPath |
string | Directory containing the base tile |
strSavePath |
string | Directory to save the tiled packing |
% Tile a 400-particle packing 2x2 -> 1600 particles
packRepeatTile(400, 100, 0.05, 20, 1, 2, 2, false, ...
'data/packings/2d/hooke/', 'data/packings/2d/hooke/');
% Tile 3x1 in x only and compute the tiled eigenmodes
packRepeatTile(100, 100, 0.1, 10, 1, 3, 1, true, ...
'data/packings/2d/hooke/', 'data/junkyard/');
% Usually you don't call this directly — pack() does it for you:
pack(100, 100, 1, 1.4, 1, 0.1, 1, false, 2, 2, 0, false, 'data/packings/2d/hooke/');