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 ReferenceElements #286

Merged
merged 1 commit into from
Mar 9, 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
49 changes: 49 additions & 0 deletions src/modules/Geometry/src/ReferenceElement_Method.F90
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ MODULE ReferenceElement_Method
PUBLIC :: FacetTopology
PUBLIC :: GetVTKelementType
PUBLIC :: GetTotalEdges
PUBLIC :: GetEdgeConnectivity
PUBLIC :: GetTotalFaces
PUBLIC :: GetTotalCells
PUBLIC :: ReferenceElementInfo
Expand Down Expand Up @@ -135,6 +136,30 @@ 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 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

!----------------------------------------------------------------------------
! GetTotalFaces@GeometryMethods
!----------------------------------------------------------------------------
Expand All @@ -150,6 +175,30 @@ MODULE PURE FUNCTION GetTotalFaces1(elemType) RESULT(ans)
END FUNCTION GetTotalFaces1
END INTERFACE GetTotalFaces

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

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

INTERFACE GetFaceConnectivity
MODULE 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

!----------------------------------------------------------------------------
! GetTotalCells@GeometryMethods
!----------------------------------------------------------------------------
Expand Down
59 changes: 53 additions & 6 deletions src/modules/Geometry/src/ReferenceHexahedron_Method.F90
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ MODULE ReferenceHexahedron_Method
PUBLIC :: highorderElement_Hexahedron
PUBLIC :: Measure_Simplex_Hexahedron
PUBLIC :: Hexahedron_Quality
PUBLIC :: Quality_Hexahedron
PUBLIC :: HexahedronVolume3D
PUBLIC :: GetEdgeConnectivity_Hexahedron
PUBLIC :: GetFaceConnectivity_Hexahedron

!----------------------------------------------------------------------------
! Initiate@Hexahedron
Expand All @@ -57,7 +60,7 @@ END SUBROUTINE initiate_ref_Hexahedron
MODULE PURE FUNCTION reference_Hexahedron(nsd, xij, domainName) RESULT(obj)
INTEGER(I4B), INTENT(IN) :: NSD
REAL(DFP), INTENT(IN), OPTIONAL :: xij(:, :)
CHARACTER(*), OPTIONAL, INTENT( IN ) :: domainName
CHARACTER(*), OPTIONAL, INTENT(IN) :: domainName
TYPE(ReferenceHexahedron_) :: obj
END FUNCTION reference_Hexahedron
END INTERFACE ReferenceHexahedron
Expand All @@ -71,7 +74,7 @@ MODULE FUNCTION reference_Hexahedron_Pointer(nsd, xij, domainName) &
& RESULT(obj)
INTEGER(I4B), INTENT(IN) :: NSD
REAL(DFP), INTENT(IN), OPTIONAL :: xij(:, :)
CHARACTER(*), OPTIONAL, INTENT( IN ) :: domainName
CHARACTER(*), OPTIONAL, INTENT(IN) :: domainName
CLASS(ReferenceHexahedron_), POINTER :: obj
END FUNCTION reference_Hexahedron_Pointer
END INTERFACE ReferenceHexahedron_Pointer
Expand Down Expand Up @@ -106,14 +109,14 @@ END FUNCTION Measure_Simplex_Hexahedron
! Hexahedron_quality
!----------------------------------------------------------------------------

INTERFACE
MODULE FUNCTION Hexahedron_quality(refelem, xij, measure) RESULT(Ans)
INTERFACE Quality_Hexahedron
MODULE FUNCTION Hexahedron_Quality(refelem, xij, measure) RESULT(Ans)
CLASS(ReferenceElement_), INTENT(IN) :: refelem
REAL(DFP), INTENT(IN) :: xij(:, :)
INTEGER(I4B), INTENT(IN) :: measure
REAL(DFP) :: Ans
END FUNCTION Hexahedron_quality
END INTERFACE
END FUNCTION Hexahedron_Quality
END INTERFACE Quality_Hexahedron

!----------------------------------------------------------------------------
! HexahedronVolume3D
Expand All @@ -126,4 +129,48 @@ MODULE PURE SUBROUTINE HexahedronVolume3D(xij, ans)
END SUBROUTINE HexahedronVolume3D
END INTERFACE

!----------------------------------------------------------------------------
! GetEdgeConnectivity
!----------------------------------------------------------------------------

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

INTERFACE
MODULE SUBROUTINE GetEdgeConnectivity_Hexahedron(con, opt)
INTEGER(I4B), INTENT(INOUT) :: con(:, :)
!! Connectivity
!! The columns represents the edge number
!! The row represents a edge
!! 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 GetEdgeConnectivity_Hexahedron
END INTERFACE

!----------------------------------------------------------------------------
! GetFaceConnectivity
!----------------------------------------------------------------------------

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

INTERFACE
MODULE SUBROUTINE GetFaceConnectivity_Hexahedron(con, opt)
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 face connectivity for hierarchial approximation
!! If opt =2, then face connectivity for Lagrangian approximation
!! opt=1 is default
END SUBROUTINE GetFaceConnectivity_Hexahedron
END INTERFACE

END MODULE ReferenceHexahedron_Method
55 changes: 49 additions & 6 deletions src/modules/Geometry/src/ReferenceLine_Method.F90
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,14 @@ MODULE ReferenceLine_Method
PUBLIC :: Initiate
PUBLIC :: ReferenceLine
PUBLIC :: ReferenceLine_Pointer
PUBLIC :: highorderElement_Line
PUBLIC :: HighOrderElement_Line
PUBLIC :: Measure_Simplex_Line
PUBLIC :: Line_Quality
PUBLIC :: Quality_Line
PUBLIC :: LineName
PUBLIC :: GetEdgeConnectivity_Line
PUBLIC :: RefLineCoord
PUBLIC :: RefCoord_Line

!----------------------------------------------------------------------------
! LineName
Expand Down Expand Up @@ -184,7 +188,7 @@ END FUNCTION reference_line_pointer_1
! summary: This function returns lagrange element on line
!
!# Introduction
! Returns lagrange line element of higher order. By lagrange element we means
! Returns lagrange line element of Higher order. By lagrange element we means
! standard finite elements, with equi-distance lagrange interpolation points.
!
!### Usage
Expand All @@ -195,12 +199,12 @@ END FUNCTION reference_line_pointer_1
! call random_number( xij )
! call initiate( obj=obj1, nsd=3, xij=xij )
! call display( obj1, "obj1 : " )
! call obj1%highorderElement( order=2, Highorderobj=obj3 ) <---
! call obj1%HighOrderElement( order=2, HighOrderobj=obj3 ) <---
! call display( obj3, "Second order Lagrange Element : ")
!```

INTERFACE
MODULE SUBROUTINE highorderElement_Line(refelem, order, obj, &
MODULE SUBROUTINE HighOrderElement_Line(refelem, order, obj, &
& ipType)
CLASS(ReferenceElement_), INTENT(IN) :: refelem
!! Linear line element
Expand All @@ -209,7 +213,7 @@ MODULE SUBROUTINE highorderElement_Line(refelem, order, obj, &
CLASS(ReferenceElement_), INTENT(INOUT) :: obj
!! High order lagrange line element
INTEGER(I4B), INTENT(IN) :: ipType
END SUBROUTINE highorderElement_Line
END SUBROUTINE HighOrderElement_Line
END INTERFACE

!----------------------------------------------------------------------------
Expand Down Expand Up @@ -248,15 +252,54 @@ END FUNCTION Measure_Simplex_Line
! line_quality@Methods
!----------------------------------------------------------------------------

INTERFACE
INTERFACE Quality_Line
MODULE FUNCTION Line_Quality(refelem, xij, measure) RESULT(Ans)
CLASS(ReferenceElement_), INTENT(IN) :: refelem
REAL(DFP), INTENT(IN) :: xij(:, :)
INTEGER(I4B), INTENT(IN) :: measure
REAL(DFP) :: Ans
END FUNCTION Line_Quality
END INTERFACE Quality_Line

!----------------------------------------------------------------------------
! GetEdgeConnectivity
!----------------------------------------------------------------------------

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

INTERFACE
MODULE SUBROUTINE GetEdgeConnectivity_Line(con, opt)
INTEGER(I4B), INTENT(INOUT) :: con(:, :)
!! Connectivity
!! The columns represents the edge number
!! The row represents a edge
!! 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 GetEdgeConnectivity_Line
END INTERFACE

!----------------------------------------------------------------------------
! RefLineCoord
!----------------------------------------------------------------------------

!> author: Vikas Sharma, Ph. D.
! date: 2023-07-03
! summary: Returns the coordinate of reference triangle

INTERFACE RefCoord_Line
MODULE PURE FUNCTION RefLineCoord(refLine) RESULT(ans)
CHARACTER(*), INTENT(IN) :: refLine
!! "unit"
!! "biunit"
REAL(DFP) :: ans(1, 2)
END FUNCTION RefLineCoord
END INTERFACE RefCoord_Line

!----------------------------------------------------------------------------
!
!----------------------------------------------------------------------------
Expand Down
25 changes: 7 additions & 18 deletions src/modules/Geometry/src/ReferencePoint_Method.F90
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ MODULE ReferencePoint_Method
PUBLIC :: Initiate
PUBLIC :: ReferencePoint
PUBLIC :: ReferencePoint_Pointer
PUBLIC :: highOrderElement_Point
PUBLIC :: HighOrderElement_Point
PUBLIC :: Measure_Simplex_Point
PUBLIC :: Point_Quality
PUBLIC :: Quality_Point

!----------------------------------------------------------------------------
! Initiate@Methods
Expand Down Expand Up @@ -60,7 +61,7 @@ MODULE ReferencePoint_Method
! call display( obj1, "obj1 : " )
!```

INTERFACE
INTERFACE Initiate
MODULE PURE SUBROUTINE refPoint_Initiate(obj, NSD, XiJ)
CLASS(ReferencePoint_), INTENT(INOUT) :: obj
!! The instance
Expand All @@ -69,10 +70,6 @@ MODULE PURE SUBROUTINE refPoint_Initiate(obj, NSD, XiJ)
REAL(DFP), INTENT(IN), OPTIONAL :: XiJ(:, :)
!! Coords of element
END SUBROUTINE refPoint_Initiate
END INTERFACE

INTERFACE Initiate
MODULE PROCEDURE refPoint_Initiate
END INTERFACE Initiate

!----------------------------------------------------------------------------
Expand Down Expand Up @@ -101,16 +98,12 @@ END SUBROUTINE refPoint_Initiate
! call display( obj, 'obj : ' )
!```

INTERFACE
INTERFACE ReferencePoint
MODULE PURE FUNCTION refPoint_Constructor1(NSD, XiJ) RESULT(obj)
INTEGER(I4B), INTENT(IN) :: NSD
REAL(DFP), INTENT(IN), OPTIONAL :: XiJ(:, :)
TYPE(ReferencePoint_) :: obj
END FUNCTION refPoint_Constructor1
END INTERFACE

INTERFACE ReferencePoint
MODULE PROCEDURE refPoint_Constructor1
END INTERFACE ReferencePoint

!----------------------------------------------------------------------------
Expand Down Expand Up @@ -140,16 +133,12 @@ END FUNCTION refPoint_Constructor1
! call display( obj, "obj : ")
!```

INTERFACE
INTERFACE ReferencePoint_Pointer
MODULE PURE FUNCTION refPoint_Constructor_1(NSD, XiJ) RESULT(obj)
INTEGER(I4B), INTENT(IN) :: NSD
REAL(DFP), INTENT(IN), OPTIONAL :: XiJ(:, :)
CLASS(ReferencePoint_), POINTER :: obj
END FUNCTION refPoint_Constructor_1
END INTERFACE

INTERFACE ReferencePoint_Pointer
MODULE PROCEDURE refPoint_Constructor_1
END INTERFACE ReferencePoint_Pointer

!----------------------------------------------------------------------------
Expand Down Expand Up @@ -222,14 +211,14 @@ END FUNCTION Measure_Simplex_Point
! Point_quality
!----------------------------------------------------------------------------

INTERFACE
INTERFACE Quality_Point
MODULE FUNCTION Point_Quality(refelem, xij, measure) RESULT(Ans)
CLASS(ReferencePoint_), INTENT(IN) :: refelem
REAL(DFP), INTENT(IN) :: xij(:, :)
INTEGER(I4B), INTENT(IN) :: measure
REAL(DFP) :: Ans
END FUNCTION Point_Quality
END INTERFACE
END INTERFACE Quality_Point

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