Skip to content

Commit

Permalink
Merge pull request #297 from easifem/EASIFEM-3-create-facet-elements-…
Browse files Browse the repository at this point in the history
…from-elem-type

Adding FaceConnectivity methods to 3D elems
  • Loading branch information
Shion Shimizu committed Mar 22, 2024
2 parents e60be4d + b0f08dc commit beb2df9
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 24 deletions.
12 changes: 10 additions & 2 deletions src/modules/Geometry/src/ReferenceHexahedron_Method.F90
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,12 @@ END SUBROUTINE HexahedronVolume3D

!> author: Vikas Sharma, Ph. D.
! date: 2024-03-08
!> author: Shion Shimizu
! update: 2024-03-22
! summary: Returns number of edges in the element

INTERFACE
MODULE PURE SUBROUTINE GetEdgeConnectivity_Hexahedron(con, opt)
MODULE PURE SUBROUTINE GetEdgeConnectivity_Hexahedron(con, opt, order)
INTEGER(I4B), INTENT(INOUT) :: con(:, :)
!! Connectivity
!! The columns represents the edge number
Expand All @@ -151,6 +153,8 @@ MODULE PURE SUBROUTINE GetEdgeConnectivity_Hexahedron(con, opt)
!! If opt = 1, then edge connectivity for hierarchial approximation
!! If opt =2, then edge connectivity for Lagrangian approximation
!! opt=1 is default
INTEGER(I4B), OPTIONAL, INTENT(IN) :: order
!! order default is 1
END SUBROUTINE GetEdgeConnectivity_Hexahedron
END INTERFACE

Expand All @@ -160,10 +164,12 @@ END SUBROUTINE GetEdgeConnectivity_Hexahedron

!> author: Vikas Sharma, Ph. D.
! date: 2024-03-08
!> author: Shion Shimizu
! update : 2024-03-22
! summary: Returns number of edges in the element

INTERFACE
MODULE PURE SUBROUTINE GetFaceConnectivity_Hexahedron(con, opt)
MODULE PURE SUBROUTINE GetFaceConnectivity_Hexahedron(con, opt, order)
INTEGER(I4B), INTENT(INOUT) :: con(:, :)
!! Connectivity
!! The columns represents the face number
Expand All @@ -173,6 +179,8 @@ MODULE PURE SUBROUTINE GetFaceConnectivity_Hexahedron(con, opt)
!! If opt = 1, then face connectivity for hierarchial approximation
!! If opt =2, then face connectivity for Lagrangian approximation
!! opt=1 is default
INTEGER(I4B), OPTIONAL, INTENT(IN) :: order
!! order default is 1
END SUBROUTINE GetFaceConnectivity_Hexahedron
END INTERFACE

Expand Down
48 changes: 27 additions & 21 deletions src/submodules/Geometry/src/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@
!----------------------------------------------------------------------------

MODULE PROCEDURE GetEdgeConnectivity_Hexahedron
INTEGER(I4B) :: order0, ii, jj, iface
con(1:2, 1) = [1, 2]
con(1:2, 2) = [1, 4]
con(1:2, 3) = [1, 5]
Expand All @@ -220,40 +221,45 @@
con(1:2, 10) = [5, 8]
con(1:2, 11) = [6, 7]
con(1:2, 12) = [7, 8]

order0 = Input(default=1_I4B, option=order)
jj = 8

DO iface = 1, 12
DO ii = 1, order0 - 1
con(2 + ii, iface) = jj + ii
END DO
jj = jj + order0 - 1
END DO

END PROCEDURE GetEdgeConnectivity_Hexahedron

!----------------------------------------------------------------------------
! GetFaceConnectivity_Hexahedron
!----------------------------------------------------------------------------

MODULE PROCEDURE GetFaceConnectivity_Hexahedron
INTEGER(I4B) :: order0, ii
con(1:4, 1) = [1, 4, 3, 2] ! back
con(1:4, 2) = [5, 6, 7, 8] ! front
con(1:4, 3) = [1, 5, 8, 4] ! left
con(1:4, 4) = [2, 3, 7, 6] ! right
con(1:4, 5) = [1, 2, 6, 5] ! bottom
con(1:4, 6) = [3, 4, 8, 7] ! top
! INTEGER(I4B) :: opt0
!
! opt0 = Input(default=1_I4B, option=opt)
!
! SELECT CASE (opt0)
! CASE (1_I4B)
! con(1:4, 1) = [1, 2, 3, 4] ! back
! con(1:4, 2) = [5, 6, 7, 8] ! front
! con(1:4, 3) = [1, 4, 8, 5] ! left
! con(1:4, 4) = [2, 3, 7, 6] ! right
! con(1:4, 5) = [1, 2, 6, 5] ! bottom
! con(1:4, 6) = [4, 3, 7, 8] ! top
!
! CASE (2_I4B)
! con(1:4, 1) = [1, 4, 3, 2] ! back
! con(1:4, 2) = [5, 6, 7, 8] ! front
! con(1:4, 3) = [1, 5, 8, 4] ! left
! con(1:4, 4) = [2, 3, 7, 6] ! right
! con(1:4, 5) = [1, 2, 6, 5] ! bottom
! con(1:4, 6) = [3, 4, 8, 7] ! top
! END SELECT

order0 = Input(default=1_I4B, option=order)
ii = 5

SELECT CASE (order0)
CASE (2_I4B)
con(ii:8, 1) = [10, 14, 12, 9, 21] ! back
con(ii:8, 2) = [17, 19, 20, 18, 22] ! front
con(ii:8, 3) = [11, 18, 16, 10, 23] ! left
con(ii:8, 4) = [12, 15, 19, 13, 24] ! right
con(ii:8, 5) = [9, 13, 17, 11, 25] ! bottom
con(ii:8, 6) = [14, 16, 20, 15, 26] ! top
END SELECT

END PROCEDURE GetFaceConnectivity_Hexahedron

!----------------------------------------------------------------------------
Expand Down
15 changes: 14 additions & 1 deletion src/submodules/Geometry/src/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,8 @@
DO iface = 1, 6
DO ii = 1, order0 - 1
con(2 + ii, iface) = jj + ii
jj = jj + 1
END DO
jj = jj + order0 - 1
END DO

END PROCEDURE GetEdgeConnectivity_Tetrahedron
Expand All @@ -355,10 +355,23 @@
!----------------------------------------------------------------------------

MODULE PROCEDURE GetFaceConnectivity_Tetrahedron
INTEGER(I4B) :: order0, jj
con(1:3, 1) = [1, 3, 2]
con(1:3, 2) = [1, 2, 4]
con(1:3, 3) = [1, 4, 3]
con(1:3, 4) = [2, 3, 4]

order0 = Input(default=1_I4B, option=order)
jj = 4_I4B

SELECT CASE (order0)
CASE (2_I4B)
con(jj:6, 1) = [6, 8, 5]
con(jj:6, 2) = [5, 9, 7]
con(jj:6, 3) = [7, 10, 6]
con(jj:6, 4) = [8, 10, 9]
END SELECT

END PROCEDURE GetFaceConnectivity_Tetrahedron

!----------------------------------------------------------------------------
Expand Down

0 comments on commit beb2df9

Please sign in to comment.