Skip to content

Commit

Permalink
Merge pull request #300 from easifem/dev
Browse files Browse the repository at this point in the history
Support for higher order element
  • Loading branch information
vickysharma0812 authored Mar 22, 2024
2 parents 48ba8b7 + 4f5bee4 commit 9e37a34
Show file tree
Hide file tree
Showing 41 changed files with 1,296 additions and 3,201 deletions.
219 changes: 3 additions & 216 deletions src/modules/Geometry/src/ReferenceElement_Method.F90
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,10 @@ MODULE ReferenceElement_Method
PUBLIC :: TotalEntities
PUBLIC :: FacetTopology
PUBLIC :: GetVTKelementType
PUBLIC :: GetEdgeConnectivity
PUBLIC :: GetFaceConnectivity
PUBLIC :: GetTotalNodes
PUBLIC :: GetTotalEdges
PUBLIC :: GetTotalFaces
PUBLIC :: GetTotalCells
PUBLIC :: ReferenceElementInfo
PUBLIC :: RefElemGetGeoParam
PUBLIC :: GetFaceElemType
PUBLIC :: GetElementIndex

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 @@ -102,9 +92,9 @@ MODULE ReferenceElement_Method
& Triangle, &
& Quadrangle, &
& Tetrahedron, Hexahedron, Prism, Pyramid]
INTEGER(I4B) :: maxFaces = REFELEM_MAX_FACES
INTEGER(I4B) :: maxEdges = REFELEM_MAX_EDGES
INTEGER(I4B) :: maxPoints = REFELEM_MAX_POINTS
INTEGER(I4B) :: maxFaces = 6
INTEGER(I4B) :: maxEdges = 12
INTEGER(I4B) :: maxPoints = 8
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 @@ -130,58 +120,6 @@ MODULE ReferenceElement_Method
TYPE(ReferenceElementInfo_), PARAMETER :: ReferenceElementInfo = &
& ReferenceElementInfo_()

!----------------------------------------------------------------------------
! GetElementIndex@GeometryMethods
!----------------------------------------------------------------------------

!> author: Vikas Sharma, Ph. D.
! date: 2024-03-19
! summary: Returns the index of an element based on its topology
!
!# Introduction
!
! Point 1
! Line 2
! Triangle 3
! Quadrangle 4
! Tetrahedron 5
! Hexahedron 6
! Prism 7
! Pyramid 8

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

!----------------------------------------------------------------------------
! 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 @@ -197,93 +135,6 @@ MODULE PURE FUNCTION GetTotalEdges1(elemType) RESULT(ans)
END FUNCTION GetTotalEdges1
END INTERFACE GetTotalEdges

!----------------------------------------------------------------------------
! GetEdgeConnectivity@GeometryMethods
!----------------------------------------------------------------------------

!> author: Vikas Sharma, Ph. D.
! date: 2024-03-07
! summary: Returns number of edges in the element

INTERFACE GetEdgeConnectivity
MODULE PURE SUBROUTINE GetEdgeConnectivity1(elemType, con, opt)
INTEGER(I4B), INTENT(IN) :: elemType
!! name of element
INTEGER(I4B), INTENT(INOUT) :: con(:, :)
!! Connectivity
!! The columns represents the face number
!! The row represents a face
!! 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
END SUBROUTINE GetEdgeConnectivity1
END INTERFACE GetEdgeConnectivity

!----------------------------------------------------------------------------
! GetFaceConnectivity@GeometryMethods
!----------------------------------------------------------------------------

!> author: Vikas Sharma, Ph. D.
! date: 2024-03-07
! summary: Returns number of edges in the element

INTERFACE GetFaceConnectivity
MODULE PURE SUBROUTINE GetFaceConnectivity1(elemType, con, opt)
INTEGER(I4B), INTENT(IN) :: elemType
!! name of element
INTEGER(I4B), INTENT(INOUT) :: con(:, :)
!! Connectivity
!! The columns represents the face number
!! The row represents a face
!! 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
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
!----------------------------------------------------------------------------
Expand Down Expand Up @@ -1160,22 +1011,6 @@ END FUNCTION refelem_FacetElements
! date: 16 June 2021
! summary: This routine returns the facet elements

INTERFACE FacetElements
MODULE FUNCTION refelem_FacetElements_elemType(elemType, nsd) RESULT(ans)
INTEGER(I4B), INTENT(IN) :: elemType
INTEGER(I4B), INTENT(IN) :: nsd
TYPE(ReferenceElement_), ALLOCATABLE :: ans(:)
END FUNCTION refelem_FacetElements_elemType
END INTERFACE FacetElements

!----------------------------------------------------------------------------
! FacetElements@FacetElementMethods
!----------------------------------------------------------------------------

!> author: Vikas Sharma, Ph. D.
! date: 16 June 2021
! summary: This routine returns the facet elements

INTERFACE
MODULE SUBROUTINE refelem_FacetElements_Line(refelem, ans)
CLASS(ReferenceElement_), INTENT(IN) :: refelem
Expand All @@ -1191,22 +1026,6 @@ END SUBROUTINE refelem_FacetElements_Line
! date: 16 June 2021
! summary: This routine returns the facet elements

INTERFACE
MODULE SUBROUTINE refelem_FacetElements_Line_elemType(elemType, nsd, ans)
INTEGER(I4B), INTENT(IN) :: elemType
INTEGER(I4B), INTENT(IN) :: nsd
TYPE(ReferenceElement_), INTENT(INOUT) :: ans(:)
END SUBROUTINE refelem_FacetElements_Line_elemType
END INTERFACE

!----------------------------------------------------------------------------
! FacetElements@FacetElementMethods
!----------------------------------------------------------------------------

!> author: Vikas Sharma, Ph. D.
! date: 16 June 2021
! summary: This routine returns the facet elements

INTERFACE
MODULE SUBROUTINE refelem_FacetElements_Surface(refelem, ans)
CLASS(ReferenceElement_), INTENT(IN) :: refelem
Expand All @@ -1222,45 +1041,13 @@ END SUBROUTINE refelem_FacetElements_Surface
! date: 16 June 2021
! summary: This routine returns the facet elements

INTERFACE
MODULE SUBROUTINE refelem_FacetElements_Surface_elemType(elemType, nsd, ans)
INTEGER(I4B), INTENT(IN) :: elemType
INTEGER(I4B), INTENT(IN) :: nsd
TYPE(ReferenceElement_), INTENT(INOUT) :: ans(:)
END SUBROUTINE refelem_FacetElements_Surface_elemType
END INTERFACE

!----------------------------------------------------------------------------
! FacetElements@FacetElementMethods
!----------------------------------------------------------------------------

!> author: Vikas Sharma, Ph. D.
! date: 16 June 2021
! summary: This routine returns the facet elements

INTERFACE
MODULE SUBROUTINE refelem_FacetElements_Volume(refelem, ans)
CLASS(ReferenceElement_), INTENT(IN) :: refelem
TYPE(ReferenceElement_), INTENT(INOUT) :: ans(:)
END SUBROUTINE refelem_FacetElements_Volume
END INTERFACE

!----------------------------------------------------------------------------
! FacetElements@FacetElementMethods
!----------------------------------------------------------------------------

!> author: Vikas Sharma, Ph. D.
! date: 16 June 2021
! summary: This routine returns the facet elements

INTERFACE
MODULE SUBROUTINE refelem_FacetElements_Volume_elemType(elemType, nsd, ans)
INTEGER(I4B), INTENT(IN) :: elemType
INTEGER(I4B), INTENT(IN) :: nsd
TYPE(ReferenceElement_), INTENT(INOUT) :: ans(:)
END SUBROUTINE refelem_FacetElements_Volume_elemType
END INTERFACE

!----------------------------------------------------------------------------
! FacetTopology@GeometryMethods
!----------------------------------------------------------------------------
Expand Down
Loading

0 comments on commit 9e37a34

Please sign in to comment.