DomainBoxBoundaryId3D Function

public function DomainBoxBoundaryId3D(elemCoords, s, extent, tol, bcids) result(bcid)

Identifies which of the six planes of the box [0,extent(1)] x [0,extent(2)] x [0,extent(3)] contains face s of the element, and returns the corresponding boundary condition id (StructuredMesh side ordering).

Arguments

TypeIntentOptionalAttributesName
real(kind=prec), intent(in) :: elemCoords(1:3,1:2,1:2,1:2)
integer, intent(in) :: s
real(kind=prec), intent(in) :: extent(1:3)
real(kind=prec), intent(in) :: tol
integer, intent(in) :: bcids(1:6)

Return Value integer


Calls

proc~~domainboxboundaryid3d~~CallsGraph proc~domainboxboundaryid3d DomainBoxBoundaryId3D proc~bilinearfacepoint3d BilinearFacePoint3D proc~domainboxboundaryid3d->proc~bilinearfacepoint3d

Called by

proc~~domainboxboundaryid3d~~CalledByGraph proc~domainboxboundaryid3d DomainBoxBoundaryId3D proc~simpleanisomortarmesh_mesh3d_t SimpleAnisoMortarMesh_Mesh3D_t proc~simpleanisomortarmesh_mesh3d_t->proc~domainboxboundaryid3d

Contents

Source Code


Source Code

  function DomainBoxBoundaryId3D(elemCoords,s,extent,tol,bcids) result(bcid)
    !! Identifies which of the six planes of the box [0,extent(1)] x [0,extent(2)] x
    !! [0,extent(3)] contains face s of the element, and returns the corresponding
    !! boundary condition id (StructuredMesh side ordering).
    implicit none
    real(prec),intent(in) :: elemCoords(1:3,1:2,1:2,1:2)
    integer,intent(in) :: s
    real(prec),intent(in) :: extent(1:3),tol
    integer,intent(in) :: bcids(1:6)
    integer :: bcid
    ! Local
    real(prec) :: c(1:3)

    c = BilinearFacePoint3D(elemCoords,s,0.0_prec,0.0_prec)

    if(abs(c(3)) < tol) then
      bcid = bcids(1) ! bottom, z = 0
    elseif(abs(c(2)) < tol) then
      bcid = bcids(2) ! south, y = 0
    elseif(abs(c(1)-extent(1)) < tol) then
      bcid = bcids(3) ! east
    elseif(abs(c(2)-extent(2)) < tol) then
      bcid = bcids(4) ! north
    elseif(abs(c(1)) < tol) then
      bcid = bcids(5) ! west, x = 0
    elseif(abs(c(3)-extent(3)) < tol) then
      bcid = bcids(6) ! top
    else
      print*,"DomainBoxBoundaryId3D : face centroid is not on a domain boundary plane"
      stop 1
    endif

  endfunction DomainBoxBoundaryId3D