Skip to content

Commit cf13a5e

Browse files
committed
Corrected order of strain reading from npy file
1 parent 9ede6c1 commit cf13a5e

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

FF_HEDM/src/ForwardSimulationCompressed.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -835,9 +835,14 @@ static long ReadNpyInputData(const char *InFileName, double **InputInfo,
835835
InputInfo[nrPoints][10] = (iy - halfN[1]) * gridSize;
836836
InputInfo[nrPoints][11] = (iz - halfN[2]) * gridSize;
837837

838-
// Elastic strain tensor (6 components)
839-
for (int c = 0; c < 6; c++)
840-
InputInfo[nrPoints][c + 12] = vd[3 + c];
838+
// Elastic strain tensor: remap from .npy order (E11,E22,E33,E23,E13,E12)
839+
// to MIDAS order (E11,E12,E13,E22,E23,E33)
840+
InputInfo[nrPoints][12] = vd[3]; // E11
841+
InputInfo[nrPoints][13] = vd[8]; // E12
842+
InputInfo[nrPoints][14] = vd[7]; // E13
843+
InputInfo[nrPoints][15] = vd[4]; // E22
844+
InputInfo[nrPoints][16] = vd[6]; // E23
845+
InputInfo[nrPoints][17] = vd[5]; // E33
841846

842847
nrPoints++;
843848
}

0 commit comments

Comments
 (0)