Skip to content

Output file

Colton Kawamura edited this page Aug 2, 2026 · 1 revision

Particle indicies

Packing files will have vecPosX and vecPoxY and are of size [N x 1] where N is the number of particles after cleanRats(). They are not sorted in any particular order.

To get the position of particle j, simple access

j = 2;
vecPosX(j)
vecPosY(j)

Additional variables with options.hertzian = true

When pack() is run with options.hertzian = true, the output .mat file contains three additional variables describing the linearized contact network at the jammed state.

So there be the particle index j and now a contact index k.

Addiitonal variables

Variable | Size | Description -- | -- | -- vecHertzNN | [numContacts x 1] | Index of particle i in each contact vecHertzMM | [numContacts x 1] | Index of particle j in each contact vecHertzKeff | [numContacts x 1] | Linearized stiffness \kappa_\text{eff} of each contact

Example

data = load('2D_N400_P0.0001_Width20_Seed1.mat');

k = 1; % pick contact k ii = data.vecHertzNN(k); % index of particle i jj = data.vecHertzMM(k); % index of particle j

x_i = data.vecPosX(ii); % position of particle i x_j = data.vecPosX(jj); % position of particle j d_i = data.vecDiameter(ii); % diameter of particle i keff = data.vecHertzKeff(k); % stiffness of this contact

Notes

  • vecHertzNN(k) < vecHertzMM(k) always — each pair is stored once
  • Indices refer to the post-cleanRats particle list — they index directly into vecPosX, vecPosY, vecDiameter (and vecPosZ for 3D)

Clone this wiki locally