Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Rotation matrix was flipped. Inverse was being used
Browse files Browse the repository at this point in the history
  • Loading branch information
anand43 committed Jan 25, 2024
1 parent 592f1e5 commit 30eedc4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/swiftest/swiftest_obl.f90
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ module subroutine swiftest_obl_rot_matrix(n, rot, rot_matrix, rot_matrix_inv)

if (rot(1) == 0 .and. rot(2) == 0) then
do i = 1, NDIM
rot_matrix(i, i) = 1.0
rot_matrix_inv(i, i) = 1.0
rot_matrix(i, i) = 1.0
end do

return ! rotation axis is about the z-axis, no need to change
Expand All @@ -90,16 +90,16 @@ module subroutine swiftest_obl_rot_matrix(n, rot, rot_matrix, rot_matrix_inv)
do i = 1, NDIM
do j = 1, NDIM
if (i == j) then
rot_matrix(i, j) = rot_matrix(i, j) + cos(theta) ! identity matrix
rot_matrix_inv(i, j) = rot_matrix_inv(i, j) + cos(theta) ! identity matrix
continue
end if

rot_matrix(i, j) = rot_matrix(i, j) + u(i) * u(j) * (1 - cos(theta)) + S_matrix(i, j) * sin(theta) ! Skew-symmetric matrix + Tensor product matrix
rot_matrix_inv(i, j) = rot_matrix_inv(i, j) + u(i) * u(j) * (1 - cos(theta)) + S_matrix(i, j) * sin(theta) ! Skew-symmetric matrix + Tensor product matrix

end do
end do

rot_matrix_inv = matinv3(rot_matrix)
rot_matrix = matinv3(rot_matrix_inv)

return
end subroutine swiftest_obl_rot_matrix
Expand Down

0 comments on commit 30eedc4

Please sign in to comment.