Compute the spatial squared norm of a vector, using the spatial metric given as an array of 6 components
FT 14.02.2022
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
double precision, | intent(in) | :: | g3(jxx:jzz) |
The spacetime metric, given as a 6-vector. |
||
double precision, | intent(in) | :: | v(jx:jz) |
The -vector whose norm has to be computed. |
||
double precision, | intent(out) | :: | norm |
Spatial norm of the vector v. |
SUBROUTINE spatial_vector_norm_sym3x3( g3, v, norm )
!****************************************************************
!
!# Compute the spatial squared norm of a vector, using the
! spatial metric given as an array of 6 components
!
! FT 14.02.2022
!
!****************************************************************
USE tensor, ONLY: jxx, jxy, jxz, jyy, jyz, jzz, jx, jy, jz, n_sym3x3
IMPLICIT NONE
DOUBLE PRECISION, INTENT(IN):: g3(jxx:jzz)
!# The \(3\times 3\) spacetime metric, given as a 6-vector.
DOUBLE PRECISION, INTENT(IN):: v(jx:jz)
!# The \(3\)-vector whose norm has to be computed.
DOUBLE PRECISION, INTENT(OUT):: norm
!! Spatial norm of the vector v.
IF( SIZE(g3) /= n_sym3x3 )THEN
PRINT *, "** ERROR in spatial_vector_norm_sym3x3 in MODULE utility.", &
" This subroutine needs a symmetric matrix with 6 components,",&
" and a ", SIZE(g3), "component matrix was given instead."
STOP
ENDIF
norm= g3(jxx)*v(jx)*v(jx) + two*g3(jxy)*v(jx)*v(jy) &
+ two*g3(jxz)*v(jx)*v(jz) + g3(jyy)*v(jy)*v(jy) &
+ two*g3(jyz)*v(jy)*v(jz) + g3(jzz)*v(jz)*v(jz)
END SUBROUTINE spatial_vector_norm_sym3x3