tem_tracker Subroutine

public subroutine tem_tracker(track, simControl, varSys, tree)

This routine runs over each tracking object and dump requested quantities if timeControl is active on current time

Arguments

Type IntentOptional Attributes Name
type(tem_tracking_type), intent(inout) :: track

tracking object containing all tracking relevant information

type(tem_simControl_type), intent(in) :: simControl

Simulation control contains current simulation time and status bits

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

global variable system

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

global tree


Calls

proc~~tem_tracker~~CallsGraph proc~tem_tracker tem_tracker proc~hvs_output_close hvs_output_close proc~tem_tracker->proc~hvs_output_close proc~hvs_output_open hvs_output_open proc~tem_tracker->proc~hvs_output_open proc~hvs_output_write hvs_output_write proc~tem_tracker->proc~hvs_output_write proc~tem_tracking_has_triggered tem_tracking_has_triggered proc~tem_tracker->proc~tem_tracking_has_triggered proc~hvs_asciispatial_close hvs_asciiSpatial_close proc~hvs_output_close->proc~hvs_asciispatial_close proc~hvs_vtk_close hvs_vtk_close proc~hvs_output_close->proc~hvs_vtk_close proc~tem_restart_closewrite tem_restart_closeWrite proc~hvs_output_close->proc~tem_restart_closewrite proc~hvs_asciispatial_open hvs_asciiSpatial_open proc~hvs_output_open->proc~hvs_asciispatial_open proc~hvs_vtk_open hvs_vtk_open proc~hvs_output_open->proc~hvs_vtk_open proc~hvs_vtk_write_meshdata hvs_vtk_write_meshdata proc~hvs_output_open->proc~hvs_vtk_write_meshdata proc~hvs_vtk_write_varsys hvs_vtk_write_varSys proc~hvs_output_open->proc~hvs_vtk_write_varsys proc~tem_restart_openwrite tem_restart_openWrite proc~hvs_output_open->proc~tem_restart_openwrite proc~tem_time_reset tem_time_reset proc~hvs_output_open->proc~tem_time_reset proc~tem_updatepropertybits tem_updatePropertyBits proc~hvs_output_open->proc~tem_updatepropertybits proc~hvs_ascii_dump_elem_data hvs_ascii_dump_elem_data proc~hvs_output_write->proc~hvs_ascii_dump_elem_data proc~hvs_ascii_dump_point_data hvs_ascii_dump_point_data proc~hvs_output_write->proc~hvs_ascii_dump_point_data proc~hvs_asciispatial_dump_elem_data hvs_asciiSpatial_dump_elem_data proc~hvs_output_write->proc~hvs_asciispatial_dump_elem_data proc~hvs_asciispatial_dump_point_data hvs_asciiSpatial_dump_point_data proc~hvs_output_write->proc~hvs_asciispatial_dump_point_data proc~hvs_vtk_dump_data hvs_vtk_dump_data proc~hvs_output_write->proc~hvs_vtk_dump_data proc~tem_restart_dump_data tem_restart_dump_data proc~hvs_output_write->proc~tem_restart_dump_data proc~tem_status_run_end tem_status_run_end proc~tem_tracking_has_triggered->proc~tem_status_run_end proc~tem_status_run_terminate tem_status_run_terminate proc~tem_tracking_has_triggered->proc~tem_status_run_terminate proc~tem_timecontrol_check tem_timeControl_check proc~tem_tracking_has_triggered->proc~tem_timecontrol_check

Source Code

  subroutine tem_tracker( track, simControl, varSys, tree )
    ! -------------------------------------------------------------------- !
    !> tracking object containing all tracking relevant information
    type(tem_tracking_type ), intent(inout)   :: track
    !> Simulation control contains current simulation time and
    !! status bits
    type(tem_simControl_type), intent(in)     :: simControl
    !> global variable system
    type(tem_varSys_type), intent(in)         :: varSys
    !> global tree
    type(treelmesh_type ), intent(in)         :: tree
    ! -------------------------------------------------------------------- !
    integer :: iLog, iConfig
    ! -------------------------------------------------------------------- !
    
    ! Run over all tracking objects
    do iLog = 1, track%control%nActive
      iConfig = track%instance(iLog)%pntConfig

      ! Skip this tracking object, if there are no entries in the
      ! variable system
      if (track%instance( iLog )%varMap%nScalars < 1) cycle

      ! dump tracking when at least one of following conditions is triggered:
      !   tracking timeControl is triggered
      !   simulation reached steady state
      !   stop file is defined
      !   simulation is terminated abruptly
      !   simulation reaches the maximum simulation time
      if ( tem_tracking_has_triggered(                           & 
        &    timeControl = track%config(iConfig)%timeControl,    &
        &    simControl  = simControl,                           &
        &    proc        = track%instance(iLog)%output_file%proc ) ) then
        
        if( track%instance( iLog )%subTree%useGlobalMesh ) then
          ! Open the output files, this also generates the vertices for the
          ! mesh, and writes the mesh data to disk. Also writes header file
          ! depends on output vis_kind
          call hvs_output_open(                                 &
            &    out_file = track%instance(iLog)%output_file,   &
            &    use_iter = track%config(iConfig)%output_config &
            &                    %vtk%iter_filename,            &
            &    mesh     = tree,                               &
            &    varSys   = varSys,                             &
            &    time     = simControl%now                      )

          ! Evaluate and write results to disk
          call hvs_output_write( out_file = track%instance(iLog)%output_file, &
            &                    varSys   = varSys,                           &
            &                    mesh     = tree                              )

          ! Close opened files
          call hvs_output_close( out_file = track%instance(iLog)%output_file, &
            &                    varSys   = varSys,                           &
            &                    mesh     = tree                              )
        else
          ! Open the output files, this also generates the vertices for the
          ! mesh, and writes the mesh data to disk. Also writes header file
          ! depends on output vis_kind
          call hvs_output_open(                                 &
            &    out_file = track%instance(iLog)%output_file,   &
            &    use_iter = track%config(iConfig)%output_config &
            &                    %vtk%iter_filename,            &
            &    mesh     = tree,                               &
            &    varSys   = varSys,                             &
            &    subTree  = track%instance(iLog)%subTree,       &
            &    time     = simControl%now                      )

          ! Evaluate and write results to disk
          call hvs_output_write( out_file = track%instance(iLog)%output_file, &
            &                    varSys   = varSys,                           &
            &                    mesh     = tree,                             &
            &                    subTree  = track%instance(iLog)%subTree      )

          ! Close opened files
          call hvs_output_close( out_file = track%instance(iLog)%output_file, &
            &                    varSys   = varSys,                           &
            &                    mesh     = tree,                             &
            &                    subTree  = track%instance(iLog)%subTree      )
        end if !Global mesh
      
      end if  ! do tracking? interval, tmin, tmax check
    end do ! iLog

  end subroutine tem_tracker