GetBCForID Function

public function GetBCForID(list, bcid) result(node)

Returns the node associated with the given bcid. If the bcid is not found, a null pointer is returned.

Arguments

TypeIntentOptionalAttributesName
class(BoundaryConditionList), intent(in) :: list
integer, intent(in) :: bcid

Return Value type(BoundaryCondition),pointer


Contents

Source Code


Source Code

  function GetBCForID(list,bcid) result(node)
    !! Returns the node associated with the given bcid.
    !! If the bcid is not found, a null pointer is returned.
    class(BoundaryConditionList),intent(in) :: list
    integer,intent(in) :: bcid
    type(BoundaryCondition),pointer :: node

    node => list%head

    do while(associated(node))
      if(node%bcid == bcid) then
        return
      endif
      node => node%next
    enddo
    ! If we reach this point, the bcid was not found
    node => null()

  endfunction GetBCForID