Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 0 additions & 68 deletions hexrd/matrixutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,74 +200,6 @@ def vecMVToSymm(A, scale=True):
return symm_mat


def vecMVCOBMatrix(R):
"""
GenerateS array of 6 x 6 basis transformation matrices for the
Mandel-Voigt tensor representation in 3-D given by:

[A] = [[A_11, A_12, A_13],
[A_12, A_22, A_23],
[A_13, A_23, A_33]]

{A} = [A_11, A_22, A_33, sqrt(2)*A_23, sqrt(2)*A_13, sqrt(2)*A_12]

where the operation :math:`R*A*R.T` (in tensor notation) is obtained by
the matrix-vector product [T]*{A}.

USAGE

T = vecMVCOBMatrix(R)

INPUTS

1) R is (3, 3) an ndarray representing a change of basis matrix

OUTPUTS

1) T is (6, 6), an ndarray of transformation matrices as
described above

NOTES

1) Compoments of symmetric 4th-rank tensors transform in a
manner analogous to symmetric 2nd-rank tensors in full
matrix notation.

SEE ALSO

symmToVecMV, vecMVToSymm, quatToMat
"""
rdim = len(R.shape)
if rdim == 2:
nrot = 1
R = np.tile(R, (1, 1, 1))
elif rdim == 3:
nrot = R.shape[0]
else:
raise RuntimeError(
"R array must be (3, 3) or (n, 3, 3); input has dimension %d"
% (rdim)
)

T = np.zeros((nrot, 6, 6), dtype='float64')

for i in range(3):
# Other two i values
i1, i2 = [k for k in range(3) if k != i]
for j in range(3):
# Other two j values
j1, j2 = [k for k in range(3) if k != j]

T[:, i, j] = R[:, i, j] ** 2
T[:, i, j + 3] = sqr2 * R[:, i, j1] * R[:, i, j2]
T[:, i + 3, j] = sqr2 * R[:, i1, j] * R[:, i2, j]
T[:, i + 3, j + 3] = (
R[:, i1, j1] * R[:, i2, j2] + R[:, i1, j2] * R[:, i2, j1]
)

return T.squeeze()


def nrmlProjOfVecMV(vec):
"""
Gives vstacked p x 6 array to To perform n' * A * n as [N]*{A} for
Expand Down
53 changes: 0 additions & 53 deletions tests/test_matrix_utils.py

This file was deleted.

Loading