From b2998b99ec9e041f72c810bc2182708dbd4e8726 Mon Sep 17 00:00:00 2001 From: "Vikas@easifem@archlinux@work" Date: Fri, 8 Mar 2024 14:37:41 +0900 Subject: [PATCH] Updates in Reference quadrangle --- .../src/ReferenceQuadrangle_Method.F90 | 28 ++++++--- .../src/QuadrangleInterpolationUtility.F90 | 17 +----- .../ReferenceQuadrangle_Method@Methods.F90 | 60 ++++++++++++++++++- ...QuadrangleInterpolationUtility@Methods.F90 | 25 ++------ 4 files changed, 84 insertions(+), 46 deletions(-) diff --git a/src/modules/Geometry/src/ReferenceQuadrangle_Method.F90 b/src/modules/Geometry/src/ReferenceQuadrangle_Method.F90 index 60d5847c..be85b597 100644 --- a/src/modules/Geometry/src/ReferenceQuadrangle_Method.F90 +++ b/src/modules/Geometry/src/ReferenceQuadrangle_Method.F90 @@ -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 @@ -35,6 +35,8 @@ MODULE ReferenceQuadrangle_Method PUBLIC :: QuadArea2D, QuadrangleArea2D PUBLIC :: QuadrangleName PUBLIC :: GetEdgeConnectivity_Quadrangle +PUBLIC :: RefQuadrangleCoord +PUBLIC :: RefCoord_Quadrangle !---------------------------------------------------------------------------- ! QuadrangleName @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/src/modules/Polynomial/src/QuadrangleInterpolationUtility.F90 b/src/modules/Polynomial/src/QuadrangleInterpolationUtility.F90 index 0a37bae0..d2608a79 100644 --- a/src/modules/Polynomial/src/QuadrangleInterpolationUtility.F90 +++ b/src/modules/Polynomial/src/QuadrangleInterpolationUtility.F90 @@ -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 @@ -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 !---------------------------------------------------------------------------- @@ -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 diff --git a/src/submodules/Geometry/src/ReferenceQuadrangle_Method@Methods.F90 b/src/submodules/Geometry/src/ReferenceQuadrangle_Method@Methods.F90 index c73fcbee..ce09061b 100644 --- a/src/submodules/Geometry/src/ReferenceQuadrangle_Method@Methods.F90 +++ b/src/submodules/Geometry/src/ReferenceQuadrangle_Method@Methods.F90 @@ -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 @@ -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 !---------------------------------------------------------------------------- @@ -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 !---------------------------------------------------------------------------- @@ -181,6 +191,7 @@ !---------------------------------------------------------------------------- MODULE PROCEDURE Quadrangle_quality +ans = 0.0_DFP END PROCEDURE Quadrangle_quality !---------------------------------------------------------------------------- @@ -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 diff --git a/src/submodules/Polynomial/src/QuadrangleInterpolationUtility@Methods.F90 b/src/submodules/Polynomial/src/QuadrangleInterpolationUtility@Methods.F90 index 36b3eb9e..eb256e3a 100644 --- a/src/submodules/Polynomial/src/QuadrangleInterpolationUtility@Methods.F90 +++ b/src/submodules/Polynomial/src/QuadrangleInterpolationUtility@Methods.F90 @@ -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", & @@ -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 !----------------------------------------------------------------------------