Identifies which of the six domain boundary planes of the SimpleMortarMesh contains face s of the element, and returns the corresponding boundary condition id. The domain is [0,3dx] x [0,2dx] x [0,2dx] with the region x > 2dx, above/below the small elements, outside the mesh; the x = 3dx plane is the domain east.
| 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) | :: | dx | |||
| real(kind=prec), | intent(in) | :: | tol | |||
| integer, | intent(in) | :: | bcids(1:6) |
function DomainBoundaryId3D(elemCoords,s,dx,tol,bcids) result(bcid)
!! Identifies which of the six domain boundary planes of the SimpleMortarMesh
!! contains face s of the element, and returns the corresponding boundary
!! condition id. The domain is [0,3dx] x [0,2dx] x [0,2dx] with the region
!! x > 2dx, above/below the small elements, outside the mesh; the x = 3dx plane
!! is the domain east.
implicit none
real(prec),intent(in) :: elemCoords(1:3,1:2,1:2,1:2)
integer,intent(in) :: s
real(prec),intent(in) :: dx,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)-3.0_prec*dx) < tol) then
bcid = bcids(3) ! east, x = 3dx
elseif(abs(c(2)-2.0_prec*dx) < tol) then
bcid = bcids(4) ! north, y = 2dx
elseif(abs(c(1)) < tol) then
bcid = bcids(5) ! west, x = 0
elseif(abs(c(3)-2.0_prec*dx) < tol) then
bcid = bcids(6) ! top, z = 2dx
else
print*,"DomainBoundaryId3D : face centroid is not on a domain boundary plane"
stop 1
endif
endfunction DomainBoundaryId3D