Skip to content

Commit

Permalink
Updates in Reference quadrangle
Browse files Browse the repository at this point in the history
  • Loading branch information
vickysharma0812 committed Mar 8, 2024
1 parent 5aeecf7 commit b2998b9
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 46 deletions.
28 changes: 21 additions & 7 deletions src/modules/Geometry/src/ReferenceQuadrangle_Method.F90
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
!

!> author: Vikas Sharma, Ph. D.
! date: 5 March 2021
! date: 5 March 2021
! summary: This module contains methods for [[ReferenceQuadrangle_]]

MODULE ReferenceQuadrangle_Method
Expand All @@ -35,6 +35,8 @@ MODULE ReferenceQuadrangle_Method
PUBLIC :: QuadArea2D, QuadrangleArea2D
PUBLIC :: QuadrangleName
PUBLIC :: GetEdgeConnectivity_Quadrangle
PUBLIC :: RefQuadrangleCoord
PUBLIC :: RefCoord_Quadrangle

!----------------------------------------------------------------------------
! QuadrangleName
Expand Down Expand Up @@ -94,7 +96,8 @@ END FUNCTION reference_Quadrangle
! summary: Returns linear Quadrangle element

INTERFACE ReferenceQuadrangle_Pointer
MODULE FUNCTION reference_Quadrangle_Pointer(NSD, xij, domainName) RESULT(obj)
MODULE FUNCTION reference_Quadrangle_Pointer(NSD, xij, domainName) &
& RESULT(obj)
INTEGER(I4B), INTENT(IN) :: NSD
REAL(DFP), INTENT(IN), OPTIONAL :: xij(:, :)
CHARACTER(*), OPTIONAL, INTENT(IN) :: domainName
Expand Down Expand Up @@ -159,9 +162,9 @@ MODULE FUNCTION Quadrangle_Quality(refelem, xij, measure) RESULT(Ans)
END FUNCTION Quadrangle_Quality
END INTERFACE Quality_Quadrangle

!-----------------------------------------------------------------------------
!----------------------------------------------------------------------------
!
!-----------------------------------------------------------------------------
!----------------------------------------------------------------------------

!> author: Vikas Sharma, Ph. D.
! date: 10 Aug 2022
Expand All @@ -183,9 +186,9 @@ MODULE PURE SUBROUTINE QuadArea3D(q, ans)
END SUBROUTINE QuadArea3D
END INTERFACE QuadrangleArea3D

!-----------------------------------------------------------------------------
!
!-----------------------------------------------------------------------------
!----------------------------------------------------------------------------
! QuadrangleArea2D
!----------------------------------------------------------------------------

!> author: Vikas Sharma, Ph. D.
! date: 10 Aug 2022
Expand Down Expand Up @@ -228,4 +231,15 @@ MODULE SUBROUTINE GetEdgeConnectivity_Quadrangle(con, opt)
END SUBROUTINE GetEdgeConnectivity_Quadrangle
END INTERFACE

!----------------------------------------------------------------------------
! RefQuadrangleCoord
!----------------------------------------------------------------------------

INTERFACE RefCoord_Quadrangle
MODULE PURE FUNCTION RefQuadrangleCoord(refQuadrangle) RESULT(ans)
CHARACTER(*), INTENT(IN) :: refQuadrangle
REAL(DFP) :: ans(2, 4)
END FUNCTION RefQuadrangleCoord
END INTERFACE RefCoord_Quadrangle

END MODULE ReferenceQuadrangle_Method
17 changes: 2 additions & 15 deletions src/modules/Polynomial/src/QuadrangleInterpolationUtility.F90
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ MODULE QuadrangleInterpolationUtility
PUBLIC :: HorizontalEdgeBasis_Quadrangle
PUBLIC :: CellBasis_Quadrangle
PUBLIC :: HeirarchicalBasis_Quadrangle
PUBLIC :: RefQuadrangleCoord
PUBLIC :: RefCoord_Quadrangle
PUBLIC :: IJ2VEFC_Quadrangle_Clockwise
PUBLIC :: IJ2VEFC_Quadrangle_AntiClockwise
PUBLIC :: LagrangeEvalAll_Quadrangle
Expand Down Expand Up @@ -106,17 +104,6 @@ MODULE PURE FUNCTION QuadratureNumber_Quadrangle( &
END FUNCTION QuadratureNumber_Quadrangle
END INTERFACE

!----------------------------------------------------------------------------
! RefQuadrangleCoord
!----------------------------------------------------------------------------

INTERFACE RefCoord_Quadrangle
MODULE PURE FUNCTION RefQuadrangleCoord(refQuadrangle) RESULT(ans)
CHARACTER(*), INTENT(IN) :: refQuadrangle
REAL(DFP) :: ans(2, 4)
END FUNCTION RefQuadrangleCoord
END INTERFACE RefCoord_Quadrangle

!----------------------------------------------------------------------------
! LagrangeDegree_Quadrangle
!----------------------------------------------------------------------------
Expand Down Expand Up @@ -1721,8 +1708,8 @@ MODULE FUNCTION LagrangeGradientEvalAll_Quadrangle1( &
REAL(DFP) :: ans(SIZE(x, 2), SIZE(xij, 2), 2)
!! Value of gradient of nth order Lagrange polynomials at point x
!! The first index denotes point of evaluation
!! the second index denotes Lagrange polynomial number
!! The third index denotes the spatial dimension in which gradient is
!! the second index denotes Lagrange polynomial number
!! The third index denotes the spatial dimension in which gradient is
!! computed
END FUNCTION LagrangeGradientEvalAll_Quadrangle1
END INTERFACE LagrangeGradientEvalAll_Quadrangle
Expand Down
60 changes: 57 additions & 3 deletions src/submodules/Geometry/src/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,17 @@
! summary: This submodule contains method for [[ReferenceQuadrangle_]]

SUBMODULE(ReferenceQuadrangle_Method) Methods
USE BaseMethod
USE ReferenceElement_Method
USE ApproxUtility
USE QuadrangleInterpolationUtility, ONLY: InterpolationPoint_Quadrangle, &
& LagrangeDOF_Quadrangle
USE AppendUtility
USE StringUtility
USE ArangeUtility
USE InputUtility
USE ReferenceTriangle_Method, ONLY: TRIANGLEAREA2D
USE ReferenceLine_Method, ONLY: Linename

IMPLICIT NONE
CONTAINS

Expand Down Expand Up @@ -99,7 +109,7 @@
!----------------------------------------------------------------------------

MODULE PROCEDURE reference_Quadrangle
CALL Initiate(obj=obj, nsd=NSD, xij=xij, domainName=domainName)
CALL initiate_ref_quadrangle(obj=obj, nsd=NSD, xij=xij, domainName=domainName)
END PROCEDURE reference_Quadrangle

!----------------------------------------------------------------------------
Expand All @@ -108,7 +118,7 @@

MODULE PROCEDURE reference_Quadrangle_Pointer
ALLOCATE (obj)
CALL Initiate(obj=obj, nsd=NSD, xij=xij, domainName=domainName)
CALL initiate_ref_quadrangle(obj=obj, nsd=NSD, xij=xij, domainName=domainName)
END PROCEDURE reference_Quadrangle_Pointer

!----------------------------------------------------------------------------
Expand Down Expand Up @@ -181,6 +191,7 @@
!----------------------------------------------------------------------------

MODULE PROCEDURE Quadrangle_quality
ans = 0.0_DFP
END PROCEDURE Quadrangle_quality

!----------------------------------------------------------------------------
Expand Down Expand Up @@ -322,4 +333,47 @@ PURE SUBROUTINE PARALLELOGRAMAREA2D(p, ans)
& - (p(2, 2) - p(2, 1)) * (p(1, 3) - p(1, 1))
END SUBROUTINE PARALLELOGRAMAREA2D

!----------------------------------------------------------------------------
! RefQuadrangleCoord
!----------------------------------------------------------------------------

MODULE PROCEDURE RefQuadrangleCoord
CHARACTER(:), ALLOCATABLE :: astr
astr = UpperCase(refQuadrangle)
SELECT CASE (astr)
CASE ("UNIT")
ans(1, :) = [0.0_DFP, 1.0_DFP, 1.0_DFP, 0.0_DFP]
ans(2, :) = [0.0_DFP, 0.0_DFP, 1.0_DFP, 1.0_DFP]
CASE ("BIUNIT")
ans(1, :) = [-1.0_DFP, 1.0_DFP, 1.0_DFP, -1.0_DFP]
ans(2, :) = [-1.0_DFP, -1.0_DFP, 1.0_DFP, 1.0_DFP]
END SELECT
astr = ""
END PROCEDURE RefQuadrangleCoord

!----------------------------------------------------------------------------
! GetEdgeConnectivity_Quadrangle
!----------------------------------------------------------------------------

MODULE PROCEDURE GetEdgeConnectivity_Quadrangle
INTEGER(I4B) :: opt0

opt0 = Input(default=1_I4B, option=opt)

SELECT CASE (opt0)
CASE (1_I4B)
con(:, 1) = [1, 2]
con(:, 2) = [4, 3]
con(:, 3) = [1, 4]
con(:, 4) = [2, 3]
CASE (2_I4B)
!! For Lagrangian polynomial
con(:, 1) = [1, 2]
con(:, 2) = [2, 3]
con(:, 3) = [3, 4]
con(:, 4) = [4, 1]
END SELECT

END PROCEDURE GetEdgeConnectivity_Quadrangle

END SUBMODULE Methods
25 changes: 4 additions & 21 deletions src/submodules/Polynomial/src/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@
!----------------------------------------------------------------------------

MODULE PROCEDURE FacetConnectivity_Quadrangle
TYPE(String) :: baseInterpol0
TYPE(String) :: baseContinuity0
CHARACTER(:), ALLOCATABLE :: baseInterpol0
! TYPE(String) :: baseContinuity0

baseInterpol0 = UpperCase(baseInterpol)
baseContinuity0 = UpperCase(baseContinuity)
! baseContinuity0 = UpperCase(baseContinuity)

SELECT CASE (baseInterpol0%chars())
SELECT CASE (baseInterpol0)
CASE ( &
& "HIERARCHYPOLYNOMIAL", &
& "HIERARCHY", &
Expand Down Expand Up @@ -70,23 +70,6 @@
ans(2) = QuadratureNumber_Line(order=q, quadType=quadType2)
END PROCEDURE QuadratureNumber_Quadrangle

!----------------------------------------------------------------------------
! RefQuadrangleCoord
!----------------------------------------------------------------------------

MODULE PROCEDURE RefQuadrangleCoord
TYPE(String) :: astr
astr = UpperCase(refQuadrangle)
SELECT CASE (astr%chars())
CASE ("UNIT")
ans(1, :) = [0.0_DFP, 1.0_DFP, 1.0_DFP, 0.0_DFP]
ans(2, :) = [0.0_DFP, 0.0_DFP, 1.0_DFP, 1.0_DFP]
CASE ("BIUNIT")
ans(1, :) = [-1.0_DFP, 1.0_DFP, 1.0_DFP, -1.0_DFP]
ans(2, :) = [-1.0_DFP, -1.0_DFP, 1.0_DFP, 1.0_DFP]
END SELECT
END PROCEDURE RefQuadrangleCoord

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

0 comments on commit b2998b9

Please sign in to comment.