tem_reduction_spatial_open Subroutine

public subroutine tem_reduction_spatial_open(me, varSys, varPos)

Prepare the reduction data type

Arguments

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

The reduction type to work on. All definitions should be present in here

type(tem_varSys_type), intent(in) :: varSys

global variable system defined in solver

integer, intent(in) :: varPos(:)

Called by

proc~~tem_reduction_spatial_open~~CalledByGraph proc~tem_reduction_spatial_open tem_reduction_spatial_open proc~tem_convergence_check_point tem_convergence_check_point proc~tem_convergence_check_point->proc~tem_reduction_spatial_open proc~tem_convergence_check_element tem_convergence_check_element proc~tem_convergence_check_element->proc~tem_reduction_spatial_open proc~hvs_ascii_dump_point_data hvs_ascii_dump_point_data proc~hvs_ascii_dump_point_data->proc~tem_reduction_spatial_open proc~hvs_ascii_dump_elem_data hvs_ascii_dump_elem_data proc~hvs_ascii_dump_elem_data->proc~tem_reduction_spatial_open proc~tem_convergence_check tem_convergence_check proc~tem_convergence_check->proc~tem_convergence_check_point proc~tem_convergence_check->proc~tem_convergence_check_element proc~hvs_output_write hvs_output_write proc~hvs_output_write->proc~hvs_ascii_dump_point_data proc~hvs_output_write->proc~hvs_ascii_dump_elem_data proc~tem_tracker tem_tracker proc~tem_tracker->proc~hvs_output_write

Contents


Source Code

  subroutine tem_reduction_spatial_open(me, varSys, varPos)
    ! ---------------------------------------------------------------------------
    !> The reduction type to work on. All definitions should be
    !! present in here
    type( tem_reduction_spatial_type ), intent(inout)    :: me(:)
    !> global variable system defined in solver
    type( tem_varSys_type ), intent(in)          :: varSys
    integer, intent(in)                          :: varPos(:)
    ! ---------------------------------------------------------------------------
    integer :: iReduce
    ! ---------------------------------------------------------------------------

    do iReduce = 1, size( me )
      ! Reset the number of treated elements.
      ! Must be counted up during _append
      me( iReduce )%nElems = 0

      ! Take the components of the connected variable system
      me( iReduce )%nComponents = varSys%method%val(varPos(iReduce))%nComponents
      if( .not. allocated( me( iReduce )%val ))                                &
        & allocate( me( iReduce )%val( me(iReduce)%nComponents ))

      select case( trim(me( iReduce )%reduceType) )
        case('max')
          me( iReduce )%val(:) = -huge(1._rk)
        case('min')
          me( iReduce )%val(:) = huge(1._rk)
        case default ! ('sum', 'average', 'l2norm', 'none', ...
          me( iReduce )%val(:) = 0._rk
      end select
    end do

  end subroutine tem_reduction_spatial_open