convert_matrice_format Subroutine

public subroutine convert_matrice_format(mat)

Arguments

Type IntentOptional AttributesName
type(MAT_SOLV), intent(inout), target:: mat

high level system type


Calls

proc~~convert_matrice_format~~CallsGraph proc~convert_matrice_format convert_matrice_format proc~from_elemental_to_assembled from_elemental_to_assembled proc~convert_matrice_format->proc~from_elemental_to_assembled

Called by

proc~~convert_matrice_format~~CalledByGraph proc~convert_matrice_format convert_matrice_format proc~solve_fe_film solve_FE_film proc~solve_fe_film->proc~convert_matrice_format proc~multi_scale_solve_fe_film multi_scale_solve_fe_film proc~multi_scale_solve_fe_film->proc~convert_matrice_format proc~multi_scale_solve_fe_film->proc~solve_fe_film proc~solve_ms_prob solve_ms_prob proc~solve_ms_prob->proc~multi_scale_solve_fe_film proc~elementary_full_domain_fe_film_reynolds elementary_full_domain_FE_film_reynolds proc~elementary_full_domain_fe_film_reynolds->proc~solve_fe_film proc~solve_fe_prob solve_fe_prob proc~solve_fe_prob->proc~solve_fe_film proc~test_rough_fe test_rough_fe proc~test_rough_fe->proc~solve_fe_prob proc~test_bearing_x_fe test_bearing_x_fe proc~test_bearing_x_fe->proc~solve_fe_prob proc~test_pocket_fe test_pocket_fe proc~test_pocket_fe->proc~solve_fe_prob proc~test_bearing_y_fe test_bearing_y_fe proc~test_bearing_y_fe->proc~solve_fe_prob proc~test_rough_ms test_rough_ms proc~test_rough_ms->proc~solve_ms_prob proc~test_slider_fe test_slider_fe proc~test_slider_fe->proc~solve_fe_prob proc~test_slider_ms test_slider_ms proc~test_slider_ms->proc~solve_ms_prob proc~run_test run_test proc~run_test->proc~test_rough_fe proc~run_test->proc~test_bearing_x_fe proc~run_test->proc~test_pocket_fe proc~run_test->proc~test_bearing_y_fe proc~run_test->proc~test_rough_ms proc~run_test->proc~test_slider_fe proc~run_test->proc~test_slider_ms program~main main program~main->proc~run_test

Contents


Source Code

   subroutine convert_matrice_format(mat)
   implicit none
   type(MAT_SOLV), intent(inout), target :: mat   !! *high level system type*
      integer(kind=I4) :: i

      ! =======================================================================================================================
      ! Compressed Column Storage (CCS) is also called the Harwell-Boeing sparse matrix format.
      ! ************************************************
      ! Elemental entries (example provided by MUMP):
      ! A1 = 1|-1  2  3| A2 = 3|2 -1  3|
      !      2| 2  1  1|      4|1  2 -1|
      !      3| 1  1  1|      5|3  2  1| => a_elt = (-1, 2, 1, 2, 1, 1, 3, 1, 1, 2, 1, 3, -1, 2, 2, 3, -1, 1)
      !
      ! A  = 1|-1  2  3  0  0|
      !      2| 2  1  1  0  0|
      !      3| 1  1  3 -1  3|
      !      4| 0  0  1  2 -1|
      !      5| 0  0  3  2  1| => eltvar = (1, 2, 3, 3, 4, 5), it locates the elemental matrix line in the assembled matrix
      !                        => eltptr = (1, 4, 7), it gives the elemental matrix first entry position in eltvar (last
      !                                               position being size(eltvar)+1)
      !
      ! ************************************************
      ! Assembled matrix :
      ! A being the same, a_elt = (-1, 2, 1, 2, 1, 1, 3, 1, 3, 1, 3, -1, 2, 2, 3, -1, 1)
      !                    irow = ( 1, 2, 3, 1, 2, 3, 1, 2, 3, 4, 5,  3, 4, 5, 3,  4, 5)
      !                    jptr = (1, 4, 7, 12, 15, 18)
      !
      ! =======================================================================================================================
      ! Triplet form
      ! ************************************************
      ! For each non zero a_elt entry, returns its row and column number
      ! A being the same, a_elt = (-1, 2, 1, 2, 1, 1, 3, 1, 3, 1, 3, -1, 2, 2, 3, -1, 1)
      !                    irow = ( 1, 2, 3, 1, 2, 3, 1, 2, 3, 4, 5,  3, 4, 5, 3,  4, 5)
      !                    jcol = ( 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3,  4, 4, 4, 5,  5, 5)

      call from_elemental_to_assembled(mat = mat)

      select case(mat%slv_t)

         case(MA48)  ! Triplet form: irow, jcol, a_elt
#if WITH_MA48
            continue
#else
   stop 'MA48_LIB not defined'
#endif

         case(MUMP)  ! Compressed row, elemental entries chosen: eltptr, eltvar, a_elt
            continue

         case(UMFP, SULU)  ! Compressed row, assembled form: irow, jptr, a_elt
            deallocate( mat%jcol ) ! no more needed
            ! UMFP and SULU allocations begin at 0 (C convention)
            do i = 1, mat%nn +1
               mat%jptr(i) = mat%jptr(i) -1
            enddo

            if (mat%slv_t==SULU) mat%matsulu%jptr => mat%jptr ! otherwise, matsulu%jptr will be associated to
                                                              ! a deallocated part of memory

            do i = 1, mat%nz
               mat%irow(i) = mat%irow(i) -1
            enddo

         case default
            stop 'Unknown solver type, CONVERT_MATRICE_FORMAT'

      endselect
   return
   endsubroutine convert_matrice_format