check_variableOperations_byElement Subroutine

subroutine check_variableOperations_byElement(res, general, tree, varSys)

Arguments

Type IntentOptional AttributesName
logical, intent(inout) :: res
type(tem_general_type), intent(in) :: general
type(treelmesh_type), intent(in) :: tree
type(tem_varSys_type), intent(in) :: varSys

Calls

proc~~check_variableoperations_byelement~~CallsGraph proc~check_variableoperations_byelement check_variableOperations_byElement interface~positionofval~5 positionofval proc~check_variableoperations_byelement->interface~positionofval~5 proc~realtological realToLogical proc~check_variableoperations_byelement->proc~realtological proc~checkresult checkResult proc~check_variableoperations_byelement->proc~checkresult proc~posofval_label posofval_label interface~positionofval~5->proc~posofval_label interface~sortedposofval~5 sortedposofval proc~posofval_label->interface~sortedposofval~5 proc~sortposofval_label sortposofval_label interface~sortedposofval~5->proc~sortposofval_label

Called by

proc~~check_variableoperations_byelement~~CalledByGraph proc~check_variableoperations_byelement check_variableOperations_byElement proc~check_variableoperations check_variableOperations proc~check_variableoperations->proc~check_variableoperations_byelement program~tem_logical_opertor_test tem_logical_opertor_test program~tem_logical_opertor_test->proc~check_variableoperations

Contents


Source Code

  subroutine check_variableOperations_byElement(res, general, tree, varSys)
    logical, intent(inout) :: res
    type(treelmesh_type), intent(in) :: tree
    type(tem_general_type), intent(in) :: general
    type(tem_varSys_type), intent(in) :: varSys

    real(kind=rk) :: resVar(1)
    integer :: varPos

    varPos = positionOfVal(varSys%varname, 'true_and_true')
    call varSys%method%val(varPos)%get_element( &
      & varSys  = varSys,                       &
      & elemPos = (/ 1 /),                      &
      & time    = general%simControl%now,       &
      & tree    = tree,                         &
      & nElems  = 1,                            &
      & nDofs   = 1,                            &
      & res     = resVar                        )
    write(*,*) resVar
    res = res .and. realToLogical(resVar(1))
    call checkResult( res, 'Logical operator: true_and_true' )

    varPos = positionOfVal(varSys%varname, 'true_and_false')
    call varSys%method%val(varPos)%get_element( &
      & varSys  = varSys,                       &
      & elemPos = (/ 1 /),                      &
      & time    = general%simControl%now,       &
      & tree    = tree,                         &
      & nElems  = 1,                            &
      & nDofs   = 1,                            &
      & res     = resVar                        )
    write(*,*) resVar
    res = res .and..not. realToLogical(resVar(1))
    call checkResult( res, 'Logical operator: true_and_false' )

    varPos = positionOfVal(varSys%varname, 'true_or_true')
    call varSys%method%val(varPos)%get_element( &
      & varSys  = varSys,                       &
      & elemPos = (/ 1 /),                      &
      & time    = general%simControl%now,       &
      & tree    = tree,                         &
      & nElems  = 1,                            &
      & nDofs   = 1,                            &
      & res     = resVar                        )
    write(*,*) resVar
    res = res .and. realToLogical(resVar(1))
    call checkResult( res, 'Logical operator: true_or_true' )

    varPos = positionOfVal(varSys%varname, 'true_or_false')
    call varSys%method%val(varPos)%get_element( &
      & varSys  = varSys,                       &
      & elemPos = (/ 1 /),                      &
      & time    = general%simControl%now,       &
      & tree    = tree,                         &
      & nElems  = 1,                            &
      & nDofs   = 1,                            &
      & res     = resVar                        )
    write(*,*) resVar
    res = res .and. realToLogical(resVar(1))
    call checkResult( res, 'Logical operator: true_or_false' )

    varPos = positionOfVal(varSys%varname, 'false_or_false')
    call varSys%method%val(varPos)%get_element( &
      & varSys  = varSys,                       &
      & elemPos = (/ 1 /),                      &
      & time    = general%simControl%now,       &
      & tree    = tree,                         &
      & nElems  = 1,                            &
      & nDofs   = 1,                            &
      & res     = resVar                        )
    write(*,*) resVar
    res = res .and..not. realToLogical(resVar(1))
    call checkResult( res, 'Logical operator: false_or_false' )

  end subroutine check_variableOperations_byElement