In [1]:
import numpy as np
from math import sin, cos, pi
In this example we construct a rotation matrix that rotates counter-clockwise around the z-axis by $45^o$.
In [2]:
a = 45.0*pi/180.0
In [3]:
Rz = [[cos(a),-sin(a),0],
[sin(a),cos(a),0],
[0,0,0]]
M = [[1, 0 ,0],
[0,.01,0],
[0, 0 ,0]]
Compute the rotated tensor $(R_z\cdot M)\cdot R_z^T$
In [4]:
Mrot = np.dot(np.dot(Rz,M),np.transpose(Rz))
The rotated tensor is then used as the tensor
argument in the ConstantAnisotropicMobility
material.
In [5]:
for l in [' '.join(map(str,a)) for a in Mrot]:
print l