tem_convergence_check Subroutine

public subroutine tem_convergence_check(me, time, status, varSys, tree)

This routine runs over each convergence object and check for convergence of each requested quantities timeControl is active on current time

Arguments

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

convergence descriptions

type(tem_time_type), intent(in) :: time

current simulation time

type(tem_status_type), intent(inout) :: status

Status bits

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

global variable system

type(treelmesh_type), intent(in) :: tree

global tree


Calls

proc~~tem_convergence_check~~CallsGraph proc~tem_convergence_check tem_convergence_check proc~tem_timecontrol_check tem_timeControl_check proc~tem_convergence_check->proc~tem_timecontrol_check proc~tem_convergence_check_point tem_convergence_check_point proc~tem_convergence_check->proc~tem_convergence_check_point proc~tem_convergence_check_element tem_convergence_check_element proc~tem_convergence_check->proc~tem_convergence_check_element proc~tem_timecontrol_update tem_timeControl_update proc~tem_timecontrol_check->proc~tem_timecontrol_update proc~tem_timecontrol_globaltriggered tem_timeControl_globalTriggered proc~tem_timecontrol_check->proc~tem_timecontrol_globaltriggered proc~tem_reduction_spatial_append tem_reduction_spatial_append proc~tem_convergence_check_point->proc~tem_reduction_spatial_append proc~tem_convergence_evaluate tem_convergence_evaluate proc~tem_convergence_check_point->proc~tem_convergence_evaluate proc~tem_get_point_chunk tem_get_point_chunk proc~tem_convergence_check_point->proc~tem_get_point_chunk proc~tem_reduction_spatial_open tem_reduction_spatial_open proc~tem_convergence_check_point->proc~tem_reduction_spatial_open proc~tem_reduction_spatial_close tem_reduction_spatial_close proc~tem_convergence_check_point->proc~tem_reduction_spatial_close proc~tem_baryofid tem_BaryOfId proc~tem_convergence_check_point->proc~tem_baryofid proc~tem_convergence_check_element->proc~tem_reduction_spatial_append proc~tem_convergence_check_element->proc~tem_convergence_evaluate proc~tem_get_element_chunk tem_get_element_chunk proc~tem_convergence_check_element->proc~tem_get_element_chunk proc~tem_convergence_check_element->proc~tem_reduction_spatial_open proc~tem_convergence_check_element->proc~tem_reduction_spatial_close proc~tem_elemsize tem_ElemSize proc~tem_reduction_spatial_append->proc~tem_elemsize proc~tem_levelof tem_LevelOf proc~tem_reduction_spatial_append->proc~tem_levelof proc~tem_comparator tem_comparator proc~tem_convergence_evaluate->proc~tem_comparator proc~evaluate_residual evaluate_residual proc~tem_convergence_evaluate->proc~evaluate_residual proc~tem_timecontrol_triggered tem_timeControl_triggered proc~tem_timecontrol_update->proc~tem_timecontrol_triggered mpi_wait mpi_wait proc~tem_timecontrol_globaltriggered->mpi_wait proc~tem_timecontrol_globaltriggered->proc~tem_timecontrol_triggered mpi_iallreduce mpi_iallreduce proc~tem_timecontrol_globaltriggered->mpi_iallreduce mpi_allreduce mpi_allreduce proc~tem_timecontrol_globaltriggered->mpi_allreduce mpi_reduce mpi_reduce proc~tem_reduction_spatial_close->mpi_reduce proc~tem_elemsizelevel tem_ElemSizeLevel proc~tem_baryofid->proc~tem_elemsizelevel proc~tem_coordofid tem_CoordOfId proc~tem_baryofid->proc~tem_coordofid proc~tem_elemsize->proc~tem_elemsizelevel proc~tem_elemsize->proc~tem_levelof proc~tem_time_ge_trigger tem_time_ge_trigger proc~tem_timecontrol_triggered->proc~tem_time_ge_trigger proc~tem_time_gt_trigger tem_time_gt_trigger proc~tem_timecontrol_triggered->proc~tem_time_gt_trigger proc~tem_time_never tem_time_never proc~tem_timecontrol_triggered->proc~tem_time_never proc~tem_coordofid->proc~tem_levelof

Contents

Source Code


Source Code

  subroutine tem_convergence_check( me, time, status, varSys, tree )
    ! -------------------------------------------------------------------- !
    !> convergence descriptions
    type(tem_convergence_type), target, intent(inout)   :: me(:)
    !> current simulation time
    type(tem_time_type), intent(in)     :: time
    !> Status bits
    type(tem_status_type), intent(inout) :: status
    !> global variable system
    type(tem_varSys_type), intent(in)         :: varSys
    !> global tree
    type(treelmesh_type ), intent(in)         :: tree
    ! -------------------------------------------------------------------- !
    integer :: iConv
    logical :: triggered
    real(kind=rk), allocatable :: res(:)
    ! -------------------------------------------------------------------- !
    allocate(res(io_buffer_size))

    ! Run over all convergence objects
    do iConv = 1,size(me)

      ! Skip this convergence object, if there are no entries in the
      ! variable system
      if (me( iConv )%varMap%nScalars < 1) cycle

      ! Determine, if it is now the time to perform the convergence for each
      ! convergence object
      ! check time control and update it if triggered
      call tem_timeControl_check( me        = me( iConv )%header%timeControl, &
        &                         now       = time,                           &
        &                         comm      = me( iConv )%proc%comm,          &
        &                         triggered = triggered                       )

      ! check convergence if timeControl is triggered
      if( triggered )then
        if (me(iConv)%header%useGetPoint) then
          call tem_convergence_check_point( me     = me(iConv), &
            &                               time   = time,      &
            &                               status = status,    &
            &                               varSys = varSys,    &
            &                               tree   = tree,      &
            &                               res    = res        )
        else
          call tem_convergence_check_element( me     = me(iConv), &
            &                                 time   = time,      &
            &                                 status = status,    &
            &                                 varSys = varSys,    &
            &                                 tree   = tree,      &
            &                                 res    = res        )
        end if
      end if  ! do convergence? interval, tmin, tmax check
    end do ! iConv

    deallocate(res)
  end subroutine tem_convergence_check