HalfMatches3D Function

public function HalfMatches3D(coordsBig, sBig, h, split, coordsSmall, sSmall, flip, tol) result(matched)

Determines whether face sSmall of the small element coincides with half h of face sBig of the big element, split along big-face trace coordinate split (1 or 2), under the given flip: face_small(F_flip(u,v)) == face_big(half_h(u,v)) at the sampled points.

Arguments

TypeIntentOptionalAttributesName
real(kind=prec), intent(in) :: coordsBig(1:3,1:2,1:2,1:2)
integer, intent(in) :: sBig
integer, intent(in) :: h
integer, intent(in) :: split
real(kind=prec), intent(in) :: coordsSmall(1:3,1:2,1:2,1:2)
integer, intent(in) :: sSmall
integer, intent(in) :: flip
real(kind=prec), intent(in) :: tol

Return Value logical


Calls

proc~~halfmatches3d~~CallsGraph proc~halfmatches3d HalfMatches3D proc~bilinearfacepoint3d BilinearFacePoint3D proc~halfmatches3d->proc~bilinearfacepoint3d proc~flipfacecoords3d FlipFaceCoords3D proc~halfmatches3d->proc~flipfacecoords3d

Called by

proc~~halfmatches3d~~CalledByGraph proc~halfmatches3d HalfMatches3D proc~simpleanisomortarmesh_mesh3d_t SimpleAnisoMortarMesh_Mesh3D_t proc~simpleanisomortarmesh_mesh3d_t->proc~halfmatches3d

Contents

Source Code


Source Code

  function HalfMatches3D(coordsBig,sBig,h,split,coordsSmall,sSmall,flip,tol) result(matched)
    !! Determines whether face sSmall of the small element coincides with half h of
    !! face sBig of the big element, split along big-face trace coordinate split (1 or
    !! 2), under the given flip: face_small(F_flip(u,v)) == face_big(half_h(u,v)) at
    !! the sampled points.
    implicit none
    real(prec),intent(in) :: coordsBig(1:3,1:2,1:2,1:2)
    integer,intent(in) :: sBig,h,split
    real(prec),intent(in) :: coordsSmall(1:3,1:2,1:2,1:2)
    integer,intent(in) :: sSmall,flip
    real(prec),intent(in) :: tol
    logical :: matched
    ! Local
    real(prec),parameter :: us(1:5) = [-1.0_prec,1.0_prec,-1.0_prec,1.0_prec,0.25_prec]
    real(prec),parameter :: vs(1:5) = [-1.0_prec,-1.0_prec,1.0_prec,1.0_prec,-0.5_prec]
    real(prec) :: pBig(1:3),pSmall(1:3)
    real(prec) :: uh,vh,u2,v2
    integer :: n

    matched = .true.
    do n = 1,5
      ! Big-face coordinates of the half's point
      uh = us(n)
      vh = vs(n)
      if(split == 1) then
        uh = 0.5_prec*(us(n)+real(2*h-3,prec))
      else
        vh = 0.5_prec*(vs(n)+real(2*h-3,prec))
      endif
      pBig = BilinearFacePoint3D(coordsBig,sBig,uh,vh)
      call FlipFaceCoords3D(us(n),vs(n),flip,u2,v2)
      pSmall = BilinearFacePoint3D(coordsSmall,sSmall,u2,v2)
      if(maxval(abs(pBig-pSmall)) > tol) then
        matched = .false.
        return
      endif
    enddo

  endfunction HalfMatches3D