Rotation matrix applied to a function

Hi, i have a trial function u wich is 2-dimensional. I’d like to apply a rotation to u in the sense of: for example if u=(u_1,u_2), i want Ru=(-u_2,u_1). How do i code this in my variational formulation? How can i define R so i can write something like



something like

R = as_matrix([[0, -1],[1, 0]])
1 Like