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).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| 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) |
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