GetQuadraturePoints
The GetQuadraturePoints
method generates quadrature points for numerical integration over a finite element.
Interface 1
MODULE SUBROUTINE obj_GetQuadraturePoints1(obj, quad, globalElement, &
quadratureType, order, alpha, beta, lambda, islocal)
CLASS(FEDOF_), INTENT(INOUT) :: obj
!! fedof object
TYPE(QuadraturePoint_), INTENT(INOUT) :: quad
!! quadrature points
INTEGER(I4B), INTENT(IN) :: globalElement
!! global element number
INTEGER(I4B), INTENT(IN) :: quadratureType
!! Type of quadrature points
!! GaussLegendre ! GaussLegendreLobatto
!! GaussLegendreRadau, GaussLegendreRadauLeft
!! GaussLegendreRadauRight ! GaussChebyshev
!! GaussChebyshevLobatto ! GaussChebyshevRadau, GaussChebyshevRadauLeft
!! GaussChebyshevRadauRight
INTEGER(I4B), INTENT(IN) :: order
!! Order of integrand
!! either the order or the nips should be present
!! Both nips and order should not be present
REAL(DFP), OPTIONAL, INTENT(IN) :: alpha
!! Jacobi parameter
REAL(DFP), OPTIONAL, INTENT(IN) :: beta
!! Jacobi parameter
REAL(DFP), OPTIONAL, INTENT(IN) :: lambda
!! Ultraspherical parameter
LOGICAL(LGT), OPTIONAL, INTENT(IN) :: islocal
!! if true then global element is local element
END SUBROUTINE obj_GetQuadraturePoints1
Interface 2
MODULE SUBROUTINE obj_GetQuadraturePoints2(obj, quad, globalElement, &
p, q, r, quadratureType1, quadratureType2, quadratureType3, alpha1, &
beta1, lambda1, alpha2, beta2, lambda2, alpha3, beta3, lambda3, islocal)
CLASS(FEDOF_), INTENT(INOUT) :: obj
!! abstract finite element
TYPE(QuadraturePoint_), INTENT(INOUT) :: quad
!! quadrature point
INTEGER(I4B), INTENT(IN) :: globalElement
!! global element number
INTEGER(I4B), INTENT(IN) :: p
!! order of integrand in x
INTEGER(I4B), INTENT(IN) :: q
!! order of integrand in y
INTEGER(I4B), INTENT(IN) :: r
!! order of integrand in z direction
INTEGER(I4B), INTENT(IN) :: quadratureType1
!! Type of quadrature points ! GaussLegendre ! GaussLegendreLobatto
!! GaussLegendreRadau ! GaussLegendreRadauLeft ! GaussLegendreRadauRight
!! GaussChebyshev ! GaussChebyshevLobatto ! GaussChebyshevRadau
!! GaussChebyshevRadauLeft ! GaussChebyshevRadauRight
INTEGER(I4B), INTENT(IN) :: quadratureType2
!! Type of quadrature points
INTEGER(I4B), INTENT(IN) :: quadratureType3
!! Type of quadrature points
REAL(DFP), OPTIONAL, INTENT(IN) :: alpha1, beta1, lambda1
!! Jacobi parameter and Ultraspherical parameters
REAL(DFP), OPTIONAL, INTENT(IN) :: alpha2, beta2, lambda2
!! Jacobi parameter and Ultraspherical parameters
REAL(DFP), OPTIONAL, INTENT(IN) :: alpha3, beta3, lambda3
!! Jacobi parameter and Ultraspherical parameters
LOGICAL(LGT), OPTIONAL, INTENT(IN) :: islocal
!! if true then the global element is local element
END SUBROUTINE obj_GetQuadraturePoints2
Description
The GetQuadraturePoints
method generates quadrature points for numerical integration over a finite element. It provides two variants:
GetQuadraturePoints1
- For isotropic integration (same order in all directions)GetQuadraturePoints2
- For anisotropic integration (different orders in different directions)
These quadrature points are essential for accurately evaluating integrals in the finite element formulation.
Parameters for GetQuadraturePoints1 (Isotropic)
obj
- Input/Output,CLASS(FEDOF_)
, FEDOF object instancequad
- Output,TYPE(QuadraturePoint_)
, quadrature points objectglobalElement
- Input,INTEGER(I4B)
, global or local element numberquadratureType
- Input,INTEGER(I4B)
, type of quadrature rule (Gauss-Legendre, Gauss-Chebyshev, etc.)order
- Input,INTEGER(I4B)
, polynomial order of the integrandalpha
,beta
- Optional Input,REAL(DFP)
, Jacobi polynomial parameterslambda
- Optional Input,REAL(DFP)
, Ultraspherical polynomial parameterislocal
- Optional Input,LOGICAL(LGT)
, if true,globalElement
is treated as a local element number
Parameters for GetQuadraturePoints2 (Anisotropic)
obj
- Input/Output,CLASS(FEDOF_)
, FEDOF object instancequad
- Output,TYPE(QuadraturePoint_)
, quadrature points objectglobalElement
- Input,INTEGER(I4B)
, global or local element numberp
,q
,r
- Input,INTEGER(I4B)
, polynomial orders in x, y, and z directionsquadratureType1
,quadratureType2
,quadratureType3
- Input,INTEGER(I4B)
, quadrature rule types for each directionalpha1
,beta1
,lambda1
, etc. - Optional Input,REAL(DFP)
, polynomial parameters for each directionislocal
- Optional Input,LOGICAL(LGT)
, if true,globalElement
is treated as a local element number
Implementation Details
Both methods determine the element topology and delegate to the appropriate finite element object:
ii = obj%mesh%GetElemTopologyIndx(globalElement=globalElement, islocal=islocal)
CALL obj%fe(ii)%ptr%GetQuadraturePoints(quad=quad, order=order,
quadratureType = quadratureType, alpha = alpha, beta = beta, lambda = lambda)
For the anisotropic version:
CALL obj%fe(ii)%ptr%GetQuadraturePoints(quad=quad, p=p, q=q, r=r,
quadratureType1 = quadratureType1, quadratureType2 = quadratureType2,
quadratureType3 = quadratureType3, alpha1 = alpha1, beta1 = beta1,
lambda1 = lambda1, alpha2 = alpha2, beta2 = beta2, lambda2 = lambda2,
alpha3 = alpha3, beta3 = beta3, lambda3 = lambda3)
Usage Example
! Example to get quadrature points for numerical integration
USE QuadraturePoint_Class
TYPE(QuadraturePoint_) :: myQuad
TYPE(FEDOF_) :: myDOF
! Isotropic quadrature (same order in all directions)
CALL myDOF%GetQuadraturePoints(quad=myQuad, globalElement=5, &
quadratureType=GaussLegendre, order=4)
! Anisotropic quadrature (different orders in different directions)
CALL myDOF%GetQuadraturePoints(quad=myQuad, globalElement=5, &
p=4, q=3, r=2, &
quadratureType1=GaussLegendre, &
quadratureType2=GaussLegendre, &
quadratureType3=GaussLegendre)
! Now use myQuad for numerical integration
! ...
Important Notes
- The
quadratureType
parameters should use predefined constants for different quadrature rules - The order should typically be at least twice the polynomial order of the element for accurate integration
- Special parameters (alpha, beta, lambda) allow customization of certain quadrature rules
- Different element types (triangles, tetrahedra, etc.) require appropriate quadrature rule selections
Related Methods
GetLocalElemShapeData
- Uses quadrature points to evaluate shape functionsGetGlobalElemShapeData
- Maps quadrature points to the global coordinate systemGetCellOrder
- Can be used to determine appropriate integration order
The GetQuadraturePoints
method is a fundamental component of finite element analysis, providing the integration points and weights necessary for accurately evaluating weak form integrals in the finite element method.
Example 1
!> author: Vikas Sharma, Ph. D.
! date: 2025-06-08
! summary: Testing GetQuadraturePoints method of FEDOF class
! obj_GetQuadraturePoints1(obj, quad, globalElement, quadratureType, &
! order, alpha, beta, lambda, islocal)
PROGRAM main
USE FEDOF_Class
USE FEDomain_Class
USE AbstractMesh_Class
USE HDF5File_Class
USE Display_Method
USE GlobalData
USE Test_Method
USE ExceptionHandler_Class, ONLY: e, EXCEPTION_INFORMATION
USE BaseType, ONLY: QuadraturePoint_, TypeQuadratureOpt
USE QuadraturePoint_Method
IMPLICIT NONE
TYPE(FEDOF_) :: obj
TYPE(FEDomain_) :: dom
CLASS(AbstractMesh_), POINTER :: meshptr => NULL()
CHARACTER(*), PARAMETER :: &
filename = "../../FEMesh/examples/meshdata/small_tri3_mesh.h5", &
baseContinuity = "H1", &
baseInterpolation = "Hierarchical", &
testname = baseContinuity//" "//baseInterpolation// " GetQuadraturePoints test:"
TYPE(HDF5File_) :: meshfile
TYPE(QuadraturePoint_) :: quad
INTEGER(I4B) :: globalElement, telements, order
CALL e%setQuietMode(EXCEPTION_INFORMATION, .TRUE.)
CALL meshfile%Initiate(filename, mode="READ")
CALL meshfile%OPEN()
CALL dom%Initiate(meshfile, '')
meshptr => dom%GetMeshPointer()
CALL test1
CALL test2
CALL test3
CALL dom%DEALLOCATE()
CALL meshfile%DEALLOCATE()
CONTAINS
!----------------------------------------------------------------------------
! test1
!----------------------------------------------------------------------------
SUBROUTINE test1
order = 1
CALL obj%Initiate(baseContinuity=baseContinuity, &
baseInterpolation=baseInterpolation, &
order=order, mesh=meshptr, &
ipType=TypeQuadratureOpt%equidistance)
telements = 1
globalElement = 1
order = 2
CALL obj%GetQuadraturePoints(quad=quad, globalElement=globalElement, &
quadratureType=TypeQuadratureOpt%GaussLegendre, &
order=order, islocal=.TRUE.)
CALL Display(quad, testname//" quad: ")
END SUBROUTINE test1
!----------------------------------------------------------------------------
! test2
!----------------------------------------------------------------------------
SUBROUTINE test2
order = 2
CALL obj%Initiate(baseContinuity=baseContinuity, &
baseInterpolation=baseInterpolation, &
order=order, mesh=meshptr, &
ipType=TypeQuadratureOpt%equidistance)
telements = 1
globalElement = 1
order = 2
CALL obj%GetQuadraturePoints(quad=quad, globalElement=globalElement, &
quadratureType=TypeQuadratureOpt%GaussLegendre, &
order=order, islocal=.TRUE.)
CALL Display(quad, testname//" quad: ")
END SUBROUTINE test2
!----------------------------------------------------------------------------
! test3
!----------------------------------------------------------------------------
SUBROUTINE test3
order = 2
CALL obj%Initiate(baseContinuity=baseContinuity, &
baseInterpolation=baseInterpolation, &
order=order, mesh=meshptr, &
ipType=TypeQuadratureOpt%equidistance)
telements = 1
globalElement = 1
order = 2
CALL obj%GetQuadraturePoints(quad=quad, globalElement=globalElement, &
quadratureType=TypeQuadratureOpt%GaussLegendre, &
order=order, islocal=.TRUE.)
CALL Display(quad, testname //" quad: ")
END SUBROUTINE test3
END PROGRAM main
! total nodes = 25
! total elements = 16
! total faces = 40
! total edges = 0