determinant_sym4x4 Subroutine

public subroutine determinant_sym4x4(A, det)

Uses

    • tensor
  • proc~~determinant_sym4x4~~UsesGraph proc~determinant_sym4x4 determinant_sym4x4 tensor tensor proc~determinant_sym4x4->tensor

Compute the determinant of a symmetric matrix field, given as a 10-vector

FT 26.01.2022

Generalized to not be bound to the mesh

FT 07.02.2022


Arguments

Type IntentOptional Attributes Name
double precision, intent(in) :: A(:)

The symmetric matrix, given as a 10-vector. The first 3 components run over the numbers of grid points along each axis. The fourth index runs over the number of independent components of the symmetric matrix.

double precision, intent(out) :: det

Determinant of the symmetric matrix


Called by

proc~~determinant_sym4x4~~CalledByGraph proc~determinant_sym4x4 determinant_sym4x4 none~compute_4velocity_eul compute_4velocity_eul none~compute_4velocity_eul->proc~determinant_sym4x4 proc~compute_and_print_sph_variables compute_and_print_sph_variables proc~compute_and_print_sph_variables->proc~determinant_sym4x4 proc~construct_particles_bin construct_particles_bin proc~construct_particles_bin->proc~determinant_sym4x4 proc~correct_adm_linear_momentum correct_adm_linear_momentum proc~correct_adm_linear_momentum->proc~determinant_sym4x4 proc~read_fuka_id_spacetime read_fuka_id_spacetime proc~read_fuka_id_spacetime->proc~determinant_sym4x4 proc~read_id_spacetime read_id_spacetime proc~read_id_spacetime->proc~determinant_sym4x4 proc~read_id_spacetime~2 read_id_spacetime proc~read_id_spacetime~2->proc~determinant_sym4x4 proc~test_recovery test_recovery proc~test_recovery->proc~determinant_sym4x4 interface~compute_and_print_sph_variables compute_and_print_sph_variables interface~compute_and_print_sph_variables->proc~compute_and_print_sph_variables interface~construct_particles_bin construct_particles_bin interface~construct_particles_bin->proc~construct_particles_bin interface~correct_adm_linear_momentum correct_adm_linear_momentum interface~correct_adm_linear_momentum->proc~correct_adm_linear_momentum interface~read_fuka_id_spacetime read_fuka_id_spacetime interface~read_fuka_id_spacetime->proc~read_fuka_id_spacetime interface~read_id_spacetime read_id_spacetime interface~read_id_spacetime->proc~read_id_spacetime interface~read_id_spacetime~2 read_id_spacetime interface~read_id_spacetime~2->proc~read_id_spacetime~2 interface~test_recovery test_recovery interface~test_recovery->proc~test_recovery proc~compute_and_print_bssn_constraints_grid compute_and_print_bssn_constraints_grid proc~compute_and_print_bssn_constraints_grid->none~compute_4velocity_eul interface~compute_and_print_bssn_constraints_grid compute_and_print_bssn_constraints_grid interface~compute_and_print_bssn_constraints_grid->proc~compute_and_print_bssn_constraints_grid interface~particles particles interface~particles->interface~construct_particles_bin program~convergence_test convergence_test program~convergence_test->interface~particles program~sphincs_id sphincs_id program~sphincs_id->interface~particles

Contents

Source Code


Source Code

  SUBROUTINE determinant_sym4x4( A, det )

    !****************************************************************
    !
    !# Compute the determinant of a \(4\times 4\) symmetric matrix
    !  field, given as a 10-vector
    !
    !  FT 26.01.2022
    !
    !  Generalized to not be bound to the mesh
    !
    !  FT 07.02.2022
    !
    !****************************************************************

    USE tensor, ONLY: itt, itx, ity, itz, ixx, ixy, ixz, iyy, iyz, izz, n_sym4x4

    IMPLICIT NONE

    DOUBLE PRECISION, INTENT(IN):: A(:)
    !# The \(4\times 4\) symmetric matrix, given as a 10-vector.
    !  The first 3 components run over the numbers of grid points
    !  along each axis. The fourth index runs over the number of
    !  independent components of the \(4\times 4\) symmetric matrix.
    DOUBLE PRECISION, INTENT(OUT):: det
    !! Determinant of the \(4\times 4\) symmetric matrix

    IF( SIZE(A) /= n_sym4x4 )THEN
      PRINT *, "** ERROR in determinant_sym4x4_grid in MODULE utility.", &
               " This subroutine needs a symmetric matrix with 10 components,",&
               " and a ", SIZE(A), "component matrix was given instead."
      STOP
    ENDIF

    det=   A(itt)*(A(ixx)*(A(iyy)*A(izz) &
         - A(iyz)* A(iyz)) &
         + A(ixy)*(A(iyz)* A(ixz) &
         - A(ixy)* A(izz)) &
         + A(ixz)*(A(ixy)* A(iyz) &
         - A(iyy)* A(ixz))) &
         - A(itx)*(A(itx)*(A(iyy)*A(izz) &
         - A(iyz)* A(iyz)) &
         + A(ixy)*(A(iyz)* A(itz) &
         - A(ity)* A(izz)) &
         + A(ixz)*(A(ity)* A(iyz) &
         - A(iyy)* A(itz))) &
         + A(ity)*(A(itx)*(A(ixy)*A(izz) &
         - A(iyz)* A(ixz)) &
         + A(ixx)*(A(iyz)* A(itz) &
         - A(ity)* A(izz)) &
         + A(ixz)*(A(ity)* A(ixz) &
         - A(ixy)* A(itz))) &
         - A(itz)*(A(itx)*(A(ixy)*A(iyz) &
         - A(iyy)* A(ixz)) &
         + A(ixx)*(A(iyy)* A(itz) &
         - A(ity)* A(iyz)) &
         + A(ixy)*(A(ity)* A(ixz) &
         - A(ixy)* A(itz)))

  END SUBROUTINE determinant_sym4x4