Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates in RefElem FaceElemType #293

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 96 additions & 23 deletions src/modules/Geometry/src/ReferenceElement_Method.F90
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,19 @@ MODULE ReferenceElement_Method
PUBLIC :: TotalEntities
PUBLIC :: FacetTopology
PUBLIC :: GetVTKelementType
PUBLIC :: GetTotalEdges
PUBLIC :: GetEdgeConnectivity
PUBLIC :: GetFaceConnectivity
PUBLIC :: GetTotalNodes
PUBLIC :: GetTotalEdges
PUBLIC :: GetTotalFaces
PUBLIC :: GetTotalCells
PUBLIC :: ReferenceElementInfo
PUBLIC :: RefElemGetGeoParam
PUBLIC :: GetFaceElemType

INTEGER(I4B), PARAMETER, PUBLIC :: REFELEM_MAX_FACES = 6
INTEGER(I4B), PARAMETER, PUBLIC :: REFELEM_MAX_EDGES = 12
INTEGER(I4B), PARAMETER, PUBLIC :: REFELEM_MAX_POINTS = 8

!----------------------------------------------------------------------------
! ReferenceElementInfo_
Expand All @@ -93,9 +101,9 @@ MODULE ReferenceElement_Method
& Triangle, &
& Quadrangle, &
& Tetrahedron, Hexahedron, Prism, Pyramid]
INTEGER(I4B) :: maxFaces = 6
INTEGER(I4B) :: maxEdges = 12
INTEGER(I4B) :: maxPoints = 8
INTEGER(I4B) :: maxFaces = REFELEM_MAX_FACES
INTEGER(I4B) :: maxEdges = REFELEM_MAX_EDGES
INTEGER(I4B) :: maxPoints = REFELEM_MAX_POINTS
INTEGER(I4B) :: tCells(8) = [0, 0, 0, 0, 1, 1, 1, 1]
!! Here cell is a topology for which xidim = 3
INTEGER(I4B) :: tFaces(8) = [0, 0, 1, 1, 4, 6, 5, 5]
Expand All @@ -121,6 +129,32 @@ MODULE ReferenceElement_Method
TYPE(ReferenceElementInfo_), PARAMETER :: ReferenceElementInfo = &
& ReferenceElementInfo_()

!----------------------------------------------------------------------------
! RefElemGetGeoParam@GeometryMethods
!----------------------------------------------------------------------------

!> author: Vikas Sharma, Ph. D.
! date: 2024-03-09
! summary: Returns the geometry parameters

INTERFACE RefElemGetGeoParam
MODULE PURE SUBROUTINE RefElemGetGeoParam1(elemType, tNodes, tEdges, &
& tFaces, tCells, edgeCon, faceCon, edgeOpt, faceOpt, faceElemType, &
& tFaceNodes)
INTEGER(I4B), INTENT(IN) :: elemType
INTEGER(I4B), OPTIONAL, INTENT(INOUT) :: tNodes
INTEGER(I4B), OPTIONAL, INTENT(INOUT) :: tEdges
INTEGER(I4B), OPTIONAL, INTENT(INOUT) :: tFaces
INTEGER(I4B), OPTIONAL, INTENT(INOUT) :: tCells
INTEGER(I4B), OPTIONAL, INTENT(INOUT) :: edgeCon(:, :)
INTEGER(I4B), OPTIONAL, INTENT(INOUT) :: faceCon(:, :)
INTEGER(I4B), OPTIONAL, INTENT(IN) :: edgeOpt
INTEGER(I4B), OPTIONAL, INTENT(IN) :: faceOpt
INTEGER(I4B), OPTIONAL, INTENT(INOUT) :: faceElemType(:)
INTEGER(I4B), OPTIONAL, INTENT(INOUT) :: tFaceNodes(:)
END SUBROUTINE RefElemGetGeoParam1
END INTERFACE RefElemGetGeoParam

!----------------------------------------------------------------------------
! GetTotalEdges@GeometryMethods
!----------------------------------------------------------------------------
Expand All @@ -145,7 +179,7 @@ END FUNCTION GetTotalEdges1
! summary: Returns number of edges in the element

INTERFACE GetEdgeConnectivity
MODULE SUBROUTINE GetEdgeConnectivity1(elemType, con, opt)
MODULE PURE SUBROUTINE GetEdgeConnectivity1(elemType, con, opt)
INTEGER(I4B), INTENT(IN) :: elemType
!! name of element
INTEGER(I4B), INTENT(INOUT) :: con(:, :)
Expand All @@ -160,21 +194,6 @@ MODULE SUBROUTINE GetEdgeConnectivity1(elemType, con, opt)
END SUBROUTINE GetEdgeConnectivity1
END INTERFACE GetEdgeConnectivity

!----------------------------------------------------------------------------
! GetTotalFaces@GeometryMethods
!----------------------------------------------------------------------------

!> author: Vikas Sharma, Ph. D.
! date: 2023-08-14
! summary: Returns number of faces in the element

INTERFACE GetTotalFaces
MODULE PURE FUNCTION GetTotalFaces1(elemType) RESULT(ans)
INTEGER(I4B), INTENT(IN) :: elemType
INTEGER(I4B) :: ans
END FUNCTION GetTotalFaces1
END INTERFACE GetTotalFaces

!----------------------------------------------------------------------------
! GetFaceConnectivity@GeometryMethods
!----------------------------------------------------------------------------
Expand All @@ -184,7 +203,7 @@ END FUNCTION GetTotalFaces1
! summary: Returns number of edges in the element

INTERFACE GetFaceConnectivity
MODULE SUBROUTINE GetFaceConnectivity1(elemType, con, opt)
MODULE PURE SUBROUTINE GetFaceConnectivity1(elemType, con, opt)
INTEGER(I4B), INTENT(IN) :: elemType
!! name of element
INTEGER(I4B), INTENT(INOUT) :: con(:, :)
Expand All @@ -194,11 +213,65 @@ MODULE SUBROUTINE GetFaceConnectivity1(elemType, con, opt)
!! con should be allocated by the user
INTEGER(I4B), OPTIONAL, INTENT(IN) :: opt
!! If opt = 1, then edge connectivity for hierarchial approximation
!! If opt =2, then edge connectivity for Lagrangian approximation
!! opt=1 is default
!! If opt = 2, then edge connectivity for Lagrangian approximation
!! opt = 1 is default
END SUBROUTINE GetFaceConnectivity1
END INTERFACE GetFaceConnectivity

!----------------------------------------------------------------------------
! GetFaceElemType@GeometryMethods
!----------------------------------------------------------------------------

!> author: Vikas Sharma, Ph. D.
! date: 2024-03-11
! summary: Returns the element type of each face

INTERFACE GetFaceElemType
MODULE PURE SUBROUTINE GetFaceElemType1(elemType, faceElemType, opt, &
& tFaceNodes)
INTEGER(I4B), INTENT(IN) :: elemType
!! name of element
INTEGER(I4B), INTENT(INOUT) :: faceElemType(:)
!! Element names of faces
INTEGER(I4B), OPTIONAL, INTENT(INOUT) :: tFaceNodes(:)
!! Total number of nodes in each face
INTEGER(I4B), OPTIONAL, INTENT(IN) :: opt
!! If opt = 1, then edge connectivity for hierarchial approximation
!! If opt = 2, then edge connectivity for Lagrangian approximation
!! opt = 1 is default
END SUBROUTINE GetFaceElemType1
END INTERFACE GetFaceElemType

!----------------------------------------------------------------------------
! GetTotalNodes@GeometryMethods
!----------------------------------------------------------------------------

!> author: Vikas Sharma, Ph. D.
! date: 2023-08-14
! summary: Returns number of nodes (vertices) in the element

INTERFACE GetTotalNodes
MODULE PURE FUNCTION GetTotalNodes1(elemType) RESULT(ans)
INTEGER(I4B), INTENT(IN) :: elemType
INTEGER(I4B) :: ans
END FUNCTION GetTotalNodes1
END INTERFACE GetTotalNodes

!----------------------------------------------------------------------------
! GetTotalFaces@GeometryMethods
!----------------------------------------------------------------------------

!> author: Vikas Sharma, Ph. D.
! date: 2023-08-14
! summary: Returns number of faces in the element

INTERFACE GetTotalFaces
MODULE PURE FUNCTION GetTotalFaces1(elemType) RESULT(ans)
INTEGER(I4B), INTENT(IN) :: elemType
INTEGER(I4B) :: ans
END FUNCTION GetTotalFaces1
END INTERFACE GetTotalFaces

!----------------------------------------------------------------------------
! GetTotalCells@GeometryMethods
!----------------------------------------------------------------------------
Expand Down
23 changes: 23 additions & 0 deletions src/modules/Geometry/src/ReferenceHexahedron_Method.F90
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ MODULE ReferenceHexahedron_Method
PUBLIC :: GetFaceConnectivity_Hexahedron
PUBLIC :: RefCoord_Hexahedron
PUBLIC :: RefHexahedronCoord
PUBLIC :: GetFaceElemType_Hexahedron

!----------------------------------------------------------------------------
! Initiate@Hexahedron
Expand Down Expand Up @@ -192,4 +193,26 @@ MODULE PURE FUNCTION RefHexahedronCoord(refHexahedron) RESULT(ans)
END FUNCTION RefHexahedronCoord
END INTERFACE RefCoord_Hexahedron

!----------------------------------------------------------------------------
! GetFaceElemType@GeometryMethods
!----------------------------------------------------------------------------

!> author: Vikas Sharma, Ph. D.
! date: 2024-03-11
! summary: Returns the element type of each face

INTERFACE
MODULE PURE SUBROUTINE GetFaceElemType_Hexahedron(faceElemType, opt, &
& tFaceNodes)
INTEGER(I4B), INTENT(INOUT) :: faceElemType(:)
!! Face element type
INTEGER(I4B), OPTIONAL, INTENT(INOUT) :: tFaceNodes(:)
!! total nodes in each face
INTEGER(I4B), OPTIONAL, INTENT(IN) :: opt
!! If opt = 1, then edge connectivity for hierarchial approximation
!! If opt = 2, then edge connectivity for Lagrangian approximation
!! opt = 1 is default
END SUBROUTINE GetFaceElemType_Hexahedron
END INTERFACE

END MODULE ReferenceHexahedron_Method
23 changes: 23 additions & 0 deletions src/modules/Geometry/src/ReferencePrism_Method.F90
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ MODULE ReferencePrism_Method
PUBLIC :: GetEdgeConnectivity_Prism
PUBLIC :: GetFaceConnectivity_Prism
PUBLIC :: RefCoord_Prism
PUBLIC :: GetFaceElemType_Prism

!----------------------------------------------------------------------------
! Initiate@Prism
Expand Down Expand Up @@ -230,4 +231,26 @@ MODULE PURE FUNCTION RefCoord_Prism(refPrism) RESULT(ans)
END FUNCTION RefCoord_Prism
END INTERFACE

!----------------------------------------------------------------------------
! GetFaceElemType@GeometryMethods
!----------------------------------------------------------------------------

!> author: Vikas Sharma, Ph. D.
! date: 2024-03-11
! summary: Returns the element type of each face

INTERFACE
MODULE PURE SUBROUTINE GetFaceElemType_Prism(faceElemType, opt, &
& tFaceNodes)
INTEGER(I4B), INTENT(INOUT) :: faceElemType(:)
!! Face element type
INTEGER(I4B), OPTIONAL, INTENT(INOUT) :: tFaceNodes(:)
!! total nodes in each face
INTEGER(I4B), OPTIONAL, INTENT(IN) :: opt
!! If opt = 1, then edge connectivity for hierarchial approximation
!! If opt = 2, then edge connectivity for Lagrangian approximation
!! opt = 1 is default
END SUBROUTINE GetFaceElemType_Prism
END INTERFACE

END MODULE ReferencePrism_Method
23 changes: 23 additions & 0 deletions src/modules/Geometry/src/ReferencePyramid_Method.F90
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ MODULE ReferencePyramid_Method
PUBLIC :: GetEdgeConnectivity_Pyramid
PUBLIC :: GetFaceConnectivity_Pyramid
PUBLIC :: RefCoord_Pyramid
PUBLIC :: GetFaceElemType_Pyramid

!----------------------------------------------------------------------------
! Initiate@Pyramid
Expand Down Expand Up @@ -176,4 +177,26 @@ MODULE PURE FUNCTION RefCoord_Pyramid(refPyramid) RESULT(ans)
END FUNCTION RefCoord_Pyramid
END INTERFACE

!----------------------------------------------------------------------------
! GetFaceElemType@GeometryMethods
!----------------------------------------------------------------------------

!> author: Vikas Sharma, Ph. D.
! date: 2024-03-11
! summary: Returns the element type of each face

INTERFACE
MODULE PURE SUBROUTINE GetFaceElemType_Pyramid(faceElemType, opt, &
& tFaceNodes)
INTEGER(I4B), INTENT(INOUT) :: faceElemType(:)
!! Face element type
INTEGER(I4B), OPTIONAL, INTENT(INOUT) :: tFaceNodes(:)
!! total nodes in each face
INTEGER(I4B), OPTIONAL, INTENT(IN) :: opt
!! If opt = 1, then edge connectivity for hierarchial approximation
!! If opt = 2, then edge connectivity for Lagrangian approximation
!! opt = 1 is default
END SUBROUTINE GetFaceElemType_Pyramid
END INTERFACE

END MODULE ReferencePyramid_Method
4 changes: 4 additions & 0 deletions src/modules/Geometry/src/ReferenceQuadrangle_Method.F90
Original file line number Diff line number Diff line change
Expand Up @@ -242,4 +242,8 @@ MODULE PURE FUNCTION RefQuadrangleCoord(refQuadrangle) RESULT(ans)
END FUNCTION RefQuadrangleCoord
END INTERFACE RefCoord_Quadrangle

!----------------------------------------------------------------------------
! GetFace
!----------------------------------------------------------------------------

END MODULE ReferenceQuadrangle_Method
23 changes: 23 additions & 0 deletions src/modules/Geometry/src/ReferenceTetrahedron_Method.F90
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ MODULE ReferenceTetrahedron_Method
PUBLIC :: GetEdgeConnectivity_Tetrahedron
PUBLIC :: GetFaceConnectivity_Tetrahedron
PUBLIC :: RefCoord_Tetrahedron
PUBLIC :: GetFaceElemType_Tetrahedron

!----------------------------------------------------------------------------
! Initiate@Tetrahedron
Expand Down Expand Up @@ -191,4 +192,26 @@ MODULE PURE FUNCTION RefCoord_Tetrahedron(refTetrahedron) RESULT(ans)
END FUNCTION RefCoord_Tetrahedron
END INTERFACE

!----------------------------------------------------------------------------
! GetFaceElemType@GeometryMethods
!----------------------------------------------------------------------------

!> author: Vikas Sharma, Ph. D.
! date: 2024-03-11
! summary: Returns the element type of each face

INTERFACE
MODULE PURE SUBROUTINE GetFaceElemType_Tetrahedron(faceElemType, opt, &
& tFaceNodes)
INTEGER(I4B), INTENT(INOUT) :: faceElemType(:)
!! Face element type
INTEGER(I4B), OPTIONAL, INTENT(INOUT) :: tFaceNodes(:)
!! total nodes in each face
INTEGER(I4B), OPTIONAL, INTENT(IN) :: opt
!! If opt = 1, then edge connectivity for hierarchial approximation
!! If opt = 2, then edge connectivity for Lagrangian approximation
!! opt = 1 is default
END SUBROUTINE GetFaceElemType_Tetrahedron
END INTERFACE

END MODULE ReferenceTetrahedron_Method
Loading
Loading