tem_varSys_append_luaVar Subroutine

public subroutine tem_varSys_append_luaVar(luaVar, varSys, st_funList, solverData_evalElem)

subroutine to add the variables from the input lua script to the varsys

Arguments

Type IntentOptional Attributes Name
type(tem_variable_type), intent(in) :: luaVar(:)

variables defined in the lua file

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

global variable system to which luaVar to be appended

type(tem_st_fun_linkedList_type), intent(inout) :: st_funList

contains spacetime functions of all variables

type(tem_varSys_solverData_evalElem_type), intent(in), optional :: solverData_evalElem

A callback routine to allow the definition of solver specific element evaluation for space-time functions.

This routine can be used to construct more than a single degree of freedom for a spacetime function in an element.


Calls

proc~~tem_varsys_append_luavar~~CallsGraph proc~tem_varsys_append_luavar tem_varSys_append_luaVar interface~positionofval~5 positionofval proc~tem_varsys_append_luavar->interface~positionofval~5 proc~tem_varsys_append_opervar tem_varSys_append_operVar proc~tem_varsys_append_luavar->proc~tem_varsys_append_opervar interface~tem_varsys_append_stfun tem_varSys_append_stfun proc~tem_varsys_append_luavar->interface~tem_varsys_append_stfun proc~posofval_label posofval_label interface~positionofval~5->proc~posofval_label proc~check_opvar_prerequisites check_opVar_prerequisites proc~tem_varsys_append_opervar->proc~check_opvar_prerequisites proc~tem_get_new_varsys_data_ptr tem_get_new_varSys_data_ptr proc~tem_varsys_append_opervar->proc~tem_get_new_varsys_data_ptr proc~tem_varsys_append_dervar tem_varSys_append_derVar proc~tem_varsys_append_opervar->proc~tem_varsys_append_dervar proc~tem_varsys_append_stfunvar tem_varSys_append_stFunVar interface~tem_varsys_append_stfun->proc~tem_varsys_append_stfunvar proc~tem_varsys_append_stfun_raw tem_varSys_append_stFun_raw interface~tem_varsys_append_stfun->proc~tem_varsys_append_stfun_raw interface~sortedposofval~5 sortedposofval proc~posofval_label->interface~sortedposofval~5 proc~check_opvar_prerequisites->interface~positionofval~5 proc~tem_abort tem_abort proc~check_opvar_prerequisites->proc~tem_abort proc~tem_varsys_append_stfunvar->proc~tem_varsys_append_dervar proc~tem_varsys_append_stfunvar->proc~tem_abort proc~tem_varsys_assignevaltype tem_varSys_assignEvalType proc~tem_varsys_append_stfunvar->proc~tem_varsys_assignevaltype interface~append~9 append proc~tem_varsys_append_stfunvar->interface~append~9 proc~tem_varsys_append_dervar->interface~positionofval~5 proc~tem_varsys_append_dervar->interface~append~9 proc~tem_varsys_append_stfun_raw->proc~tem_varsys_append_dervar proc~tem_varsys_append_stfun_raw->proc~tem_abort proc~tem_varsys_append_stfun_raw->proc~tem_varsys_assignevaltype proc~tem_varsys_append_stfun_raw->interface~append~9 proc~sortposofval_label sortposofval_label interface~sortedposofval~5->proc~sortposofval_label mpi_abort mpi_abort proc~tem_abort->mpi_abort proc~append_da_veclabel append_da_veclabel interface~append~9->proc~append_da_veclabel proc~append_da_label append_da_label interface~append~9->proc~append_da_label

Contents


Source Code

  subroutine tem_varSys_append_luaVar( luaVar, varSys, st_funList, &
    &                                  solverData_evalElem         )
    !--------------------------------------------------------------------------
    !> variables defined in the lua file
    type(tem_variable_type), intent(in) :: luaVar(:)

    !> global variable system to which luaVar to be appended
    type(tem_varSys_type), intent(inout) :: varSys

    !> contains spacetime functions of all variables
    type(tem_st_fun_linkedList_type), intent(inout) :: st_funList

    !> A callback routine to allow the definition of solver specific
    !! element evaluation for space-time functions.
    !!
    !! This routine can be used to construct more than a single degree of
    !! freedom for a spacetime function in an element.
    type(tem_varSys_solverData_evalElem_type), &
      &  optional, intent(in) :: solverData_evalElem
    ! --------------------------------------------------------------------------
    integer :: iVar, varPos
    ! --------------------------------------------------------------------------
    if (size(luaVar) > 0) &
      & write(logUnit(5),*) 'Append variables defined in lua file to varSys'

    do iVar = 1, size(luaVar)
      write(logUnit(5),'(A,I2,A)') 'Appending variable ', iVar, ': ' &
        & // trim(luaVar(iVar)%label)
      varPos = PositionOfVal( me  = varSys%varName,          &
        &                     val = trim(luaVar(iVar)%label) )
      ! If variable already exist in varSys then do nothing
      if (varPos>0) then
        write(logUnit(5),*) 'Variable already exists!'
        cycle
      end if

      select case(trim(luaVar(iVar)%varType))
      case('st_fun')
        call tem_varSys_append_stFun(                    &
          &    stFunVar            = luaVar(iVar),       &
          &    varSys              = varSys,             &
          &    st_funList          = st_funList,         &
          &    solverData_evalElem = solverData_evalElem )

      case('operation')
        call tem_varSys_append_operVar(                       &
          &    operVar                  = luaVar(iVar),       &
          &    varSys                   = varSys,             &
          &    solverData_evalElem      = solverData_evalElem )

      case default
        if (associated(luaVar(iVar)%append_solverVar)) then
          call luaVar(iVar)%append_solverVar(                           &
            &                 varSys              = varSys,             &
            &                 solverData_evalElem = solverData_evalElem )
        else
          write(logUnit(1),*) 'WARNING: varType: '           &
            &                 // trim(luaVar(iVar)%varType)  &
            &                 // ' not supported. Variable ' &
            &                 // trim(luaVar(iVar)%label)    &
            &                 // ' is not appended.'
          cycle ! go to next variable
        end if
      end select

    end do !iVar

  end subroutine tem_varSys_append_luaVar