tem_match_bc_header Subroutine

private subroutine tem_match_bc_header(me, BC_prop)

This routine match the labels in me(tem_bc_header_type) against the labels in the bcProp(tem_BC_prop_type). If a bc label can not be matched, the code will STOP!


Type IntentOptional Attributes Name
type(tem_bc_header_type) :: me

The boundary header to fill

type(tem_BC_prop_type), intent(in) :: BC_prop

The boundary properties of the treelmesh, to connect the header to


proc~~tem_match_bc_header~~CallsGraph proc~tem_match_bc_header tem_match_bc_header proc~tem_abort tem_abort proc~tem_match_bc_header->proc~tem_abort mpi_abort mpi_abort proc~tem_abort->mpi_abort

Called by

proc~~tem_match_bc_header~~CalledByGraph proc~tem_match_bc_header tem_match_bc_header proc~tem_load_bc_header tem_load_bc_header proc~tem_load_bc_header->proc~tem_match_bc_header


Source Code

Source Code

  subroutine tem_match_bc_header( me, BC_prop )
    ! ---------------------------------------------------------------------------
    !> The boundary header to fill
    type(tem_bc_header_type) :: me
    !> The boundary properties of the treelmesh, to connect the header to
    type(tem_BC_prop_type), intent(in) :: BC_prop
    ! ---------------------------------------------------------------------------
    integer :: iBC, iBCtype
    character(len=LabelLen) :: proplabel
    logical :: MatchedBC
    ! ---------------------------------------------------------------------------

    write(logUnit(3),"(A)") ' matching boundary defination in lua to mesh'
    ! Outside loop: loop over the bc labels in BC_prop
    do iBCtype = 1, BC_prop%nBCtypes

      proplabel = adjustl(BC_prop%BC_label(iBCtype))
      matchedBC = .false.
      ! Inside loop: loop over the bc labels in bc header
      do iBC = 1, me%nBCs
        if (me%BC_ID(iBC) == -1) then
          ! This ID has not been matched yet, check it now
          ! BC_ID is set to be -1 during initialization
          if (adjustl(me%label(iBC)) == proplabel) then
            ! Found a match, assign the configured BC, and leave the loop
            me%BC_ID(iBC) = iBCtype
            matchedBC = .true.
          end if
        end if
      end do ! iBC in me%label

      ! If this BC is not matched, give a error message and stop the code.
      if ( .not. matchedBC ) then
        write(logUnit(1),*)"No configuration found for boundary "//            &
          &             trim(proplabel)//" from the BC property in the mesh!"
        write(logUnit(1),*)"This could also be caused by double definition "   &
          &            //"of the same BC in the mesh."
        write(logUnit(1),*)"This is fatal, STOPPING execution now..."
        call tem_abort()
      end if
    end do ! iBCtype in bc_prop

    if (minval(me%BC_ID) == -1) then
      write(logUnit(1),*)"WARNING: There are more boundaries defined in the "  &
        &                //" config file, than in the mesh properties!"
    end if

  end subroutine tem_match_bc_header