include a new function epsilon_ijk, i.e., the permutation function (used to compute the cross product of two tensors)

This commit is contained in:
Denny Tjahjanto 2008-03-26 13:35:01 +00:00
parent 92ee2cbf7d
commit f3eda7cdaa
1 changed files with 25 additions and 0 deletions

View File

@ -167,6 +167,31 @@
END FUNCTION
!**************************************************************************
! permutation tensor e_ijk used for computing cross product of two tensors
! e_ijk = 1 if even permutation of ijk
! e_ijk = -1 if odd permutation of ijk
! e_ijk = 0 otherwise
!**************************************************************************
FUNCTION math_permut(i,j,k)
use prec, only: pReal, pInt
implicit none
integer(pInt) i,j,k
real(pReal) math_permut
math_permut = 0.0_pReal
if (((i == 1).and.(j == 2).and.(k == 3)) .or. &
((i == 2).and.(j == 3).and.(k == 1)) .or. &
((i == 3).and.(j == 1).and.(k == 2))) math_permut = 1.0_pReal
if (((i == 1).and.(j == 3).and.(k == 2)) .or. &
((i == 2).and.(j == 1).and.(k == 3)) .or. &
((i == 3).and.(j == 2).and.(k == 1))) math_permut = -1.0_pReal
math_permut
return
END FUNCTION
!**************************************************************************
! fourth rank identity tensor of specified dimension