tem_reduction_transient_init Subroutine

public subroutine tem_reduction_transient_init(me, nElems, nComponents, nDofs)

Initialize time reduction.

Arguments

Type IntentOptional Attributes Name
type(tem_reduction_transient_type), intent(inout) :: me

current time reduction

integer, intent(in) :: nElems

Number of elements in tree

integer, intent(in) :: nComponents

nComponents of operation variable

integer, intent(in) :: nDofs

Number of degrees of freedom


Calls

proc~~tem_reduction_transient_init~~CallsGraph proc~tem_reduction_transient_init tem_reduction_transient_init proc~tem_abort tem_abort proc~tem_reduction_transient_init->proc~tem_abort mpi_abort mpi_abort proc~tem_abort->mpi_abort

Called by

proc~~tem_reduction_transient_init~~CalledByGraph proc~tem_reduction_transient_init tem_reduction_transient_init proc~tem_opvar_reduction_transient_init tem_opVar_reduction_transient_init proc~tem_opvar_reduction_transient_init->proc~tem_reduction_transient_init

Contents


Source Code

  subroutine tem_reduction_transient_init(me, nElems, nComponents, nDofs)
    ! -------------------------------------------------------------------- !
    !> current time reduction
    type(tem_reduction_transient_type), intent(inout) :: me
    !> Number of elements in tree
    integer, intent(in) :: nElems
    !> nComponents of operation variable
    integer, intent(in) :: nComponents
    !> Number of degrees of freedom
    integer, intent(in) :: nDofs
    ! -------------------------------------------------------------------- !
    ! -------------------------------------------------------------------- !

    me%nTimes = 0
    me%last = 1
    me%curr = 2
    me%nDofs = nDofs
    me%nComponents = nComponents
    me%nEntries = nElems * nComponents * nDofs

    allocate(me%val(me%nEntries,2))

    select case(trim(me%config%reduceType))
      case('min')
        me%val(:,me%curr) = huge(1.0_rk)

      case('max')
        me%val(:,me%curr) = tiny(1.0_rk)

      case('sum', 'average')
        me%val(:,me%curr) = 0.0_rk

      case default
        write(logUnit(1),*)'Unknown time reduction operation: '//       &
          &            trim(me%config%reduceType)
        call tem_abort()
    end select

  end subroutine tem_reduction_transient_init