anchor.diff:      &                    Node(this%NodeInd(7))%Pos(:),Node(this%NodeInd(8))%Pos(:))
     end function
     
  -  !---------------------------------------------------------
  -  ! get the k_th neighbour element index of this hexahedron
  -  !---------------------------------------------------------
  -  ! Note: we are getting neighbour element index, not neighbour hexahedron index, though the
  -  !       neighbour element is likely to be a hexahedron
  +  !------------------------------------------------------------
  +  ! get the k_th neighbour element or facet of this hexahedron
  +  !------------------------------------------------------------
  +  ! Note: if facet are found, the function will return the negative value of the facet index.
  +  ! Note: we are getting neighbour element or facet, not neighbour hexahedron or quadrilateral
  +  !       index, though the neighbour element (facet) is likely to be a hexahedron (quadrilateral).
     function getHexNeib(this,k)
       class(typeHex),intent(in)::this
       integer,intent(in)::k
  -    integer getHexNeib,lPHex(8)
  +    integer getHexNeib,lPHex(8),lPQuad(4)
       logical maskHex(8)
       getHexNeib=0
       if(k<1.or.k>6)then
  
positive.code:         case default
        end select
      end do
    end function
    
    !----------------------------------------------------
  
negative.code:         case default
        end select
      end do
      if(getHexNeib==0)then ! need to find from facets
        do i=1,nFacet
          select case(Facet(i)%ShapeType)
            case(3) ! the neigbour facet can be a quadrilateral
              maskHex(:)=.false.
              lPQuad(:)=Quad(Facet(i)%ShapeInd)%NodeInd(:)
              do j=1,8
                if(any(lPQuad(:)==this%NodeInd(j)))then
                  maskHex(j)=.true.
                end if
              end do
              if(all(maskHex(SurfTabHex(k,:))))then
                getHexNeib=-i
                exit
              end if
            case default
          end select
        end do
      end if
    end function
    
    !---------------------------------------------------
  