Initiate
We can construct an instance of ElemshapeData
by using a generic method called Initiate()
. There are several ways to construct the instance. You can learn about this method from following examples.
Interface-1:
MODULE SUBROUTINE Initiate(obj, quad, refElem, continuityType, &
& interpolType)
CLASS(ElemshapeData_), INTENT(INOUT) :: obj
!! ElemshapeData to be formed
CLASS(QuadraturePoint_), INTENT(IN) :: quad
!! Quadrature points
CLASS(ReferenceElement_), INTENT(IN) :: refelem
!! reference element
CHARACTER(LEN=*), INTENT(IN) :: continuityType
!! continuity/ conformity of shape function
CHARACTER(LEN=*), INTENT(IN) :: interpolType
!! interpolation/polynomial family type
END SUBROUTINE Initiate
Interface-2:
MODULE SUBROUTINE Initiate( obj1, obj2 )
TYPE(ElemshapeData_), INTENT( INOUT ) :: obj1
TYPE(ElemshapeData_), INTENT( IN ) :: obj2
END SUBROUTINE Initiate
In interface-2, we copy an instance of ElemshapeData into another instance of same class. This method is used for extending the [[#Assignment(=)]] operator.
Interface-3:
MODULE PURE SUBROUTINE Initiate(obj, elemsd)
TYPE(STElemshapeData_), ALLOCATABLE, INTENT(INOUT) :: obj(:)
TYPE(ElemshapeData_), INTENT(IN) :: elemsd
!! It has information about location shape function for time element
END SUBROUTINE Initiate
- This subroutine initiates the shape-function data related to time domain in the instance of STElemshapeData_.
- User should provide an instance of Elemshapedata_ elemsd,
- The
elemsd
, actually contains the information of the shape-function in the time domain - The shape-function data in the time domain is
- This routine uses
elemsd
to setobj%T
,obj%dTdTheta
,obj%Jt
,obj%Wt
,obj%Theta
.
Assignment(=)
MODULE SUBROUTINE Initiate( obj1, obj2 )
TYPE(ElemshapeData_), INTENT( INOUT ) :: obj1
TYPE(ElemshapeData_), INTENT( IN ) :: obj2
END SUBROUTINE Initiate
MODULE SUBROUTINE Initiate( obj1, obj2 )
TYPE(ElemshapeData_), INTENT( INOUT ) :: obj1
TYPE(STElemshapeData_), INTENT( IN ) :: obj2
END SUBROUTINE Initiate
MODULE SUBROUTINE Initiate( obj1, obj2 )
TYPE(STElemshapeData_), INTENT( INOUT ) :: obj1
TYPE(ElemshapeData_), INTENT( IN ) :: obj2
END SUBROUTINE Initiate
MODULE SUBROUTINE Initiate( obj1, obj2 )
TYPE(STElemshapeData_), INTENT( INOUT ) :: obj1
TYPE(STElemshapeData_), INTENT( IN ) :: obj2
END SUBROUTINE Initiate
Example: shape functions on line element
- ️Lagrange polynomial
- ↢
PROGRAM main
USE easifemBase
IMPLICIT NONE
TYPE(ElemShapeData_) :: elemsd
TYPE(QuadraturePoint_) :: quad
TYPE(ReferenceLine_) :: refelem
INTEGER(I4B) :: quadratureType, ipType, basisType, order
refelem = ReferenceLine(nsd=1_I4B)
order = 4_I4B
quadratureType = GaussLegendre
CALL Initiate( &
& obj=quad, &
& refElem=refElem, &
& order=order, &
& quadratureType=quadratureType)
order = 1
ipType = Equidistance
basisType = Monomial
CALL Initiate( &
& obj=elemsd, &
& quad=quad, &
& refelem=refelem, &
& baseContinuity=TypeH1, &
& baseInterpolation=TypeLagrangeInterpolation, &
& ipType=ipType, &
& basisType=basisType, &
& order=order)
! CALL Display(elemsd%N, "elemsd: ")
! CALL Display(elemsd%dNdXi, "elemsd: ")
CALL Display(ElemshapeData_MdEncode(elemsd), "")
END PROGRAM main
See results
x1 | -0.7746 | 1.59632E-16 | 0.7746 |
w | 0.55556 | 0.88889 | 0.55556 |
N
0.8873 | 0.5 | 0.1127 | |
0.1127 | 0.5 | 0.8873 |
dNdXi(:, :, 1 )
-0.5 | |
0.5 |
dNdXi(:, :, 2 )
-0.5 | |
0.5 |
dNdXi(:, :, 3 )