ConvectiveMatrix example 24
!!! note ""
This example shows how to USE the SUBROUTINE called ConvectiveMatrix
to create a convective matrix in space domain for Triangle3 element.
Here, we want to DO the following.
In this example, convective matrix is formed for
- [[ReferenceTriangle_]] element
- [[QuadraturePoint_]]
GaussLegendre
Modules and classesβ
- [[ElemshapeData_]]
- [[QuadraturePoint_]]
- [[ReferenceTriangle_]]
- [[FEVariable_]]
Usageβ
PROGRAM main
USE easifemBase
IMPLICIT NONE
TYPE(ElemshapeData_) :: test, trial
TYPE(QuadraturePoint_) :: quad
TYPE(ReferenceTriangle_) :: refelem
REAL(DFP), ALLOCATABLE :: mat(:, :)
REAL(DFP), ALLOCATABLE :: XiJ(:, :)
INTEGER( I4B ), PARAMETER :: order = 1, nsd=2
!!! note "" Let us now create the physical coordinate of the line element.
XiJ = RESHAPE([0,0, 1,0,0,1], [2, 3])
!!! note "" Now we create an instance of [[ReferenceTriangle_]].
refelem = referenceTriangle(nsd=nsd)
!!! note "" Here, we create the quadrature points.
CALL initiate( obj=quad, refelem=refelem, order=2*order-1, &
& quadratureType='GaussLegendre' )
!!! note "" Initiate an instance of [[ElemshapeData_]]. You can learn more about it from [[ElemshapeData_test]]
CALL initiate(obj=test, &
& quad=quad, &
& refelem=refelem, &
& ContinuityType=typeH1, &
& InterpolType=typeLagrangeInterpolation)
CALL Set(obj=test, val=xij, N=test%N, dNdXi=test%dNdXi)
!! note "" Let us now create the following convective matrix.
mat=ConvectiveMatrix(test=test, trial=test, term1=1, term2=0, dim=1)
CALL Display(mat, "mat:")
??? example "Results"
mat:
-------------------------------
-0.166667 -0.166667 -0.166667
0.166667 0.166667 0.166667
0.000000 0.000000 0.000000
!! note "" Let us now create the following convective matrix.
mat=ConvectiveMatrix(test=test, trial=test, term1=1, term2=0, dim=2)
CALL Display(mat, "mat:")
??? example "Results"
mat:
-------------------------------
-0.166667 -0.166667 -0.166667
0.000000 0.000000 0.000000
0.166667 0.166667 0.166667
!! note "" Let us now create the following convective matrix.
mat=ConvectiveMatrix(test=test, trial=test, term1=0, term2=1, dim=1)
CALL Display(mat, "mat:")
??? example "Results"
mat:
-----------------------------
-0.166667 0.166667 0.000000
-0.166667 0.166667 0.000000
-0.166667 0.166667 0.000000
!! note "" Let us now create the following convective matrix.
mat=ConvectiveMatrix(test=test, trial=test, term1=0, term2=1, dim=2)
CALL Display(mat, "mat:")
??? example "Results"
mat:
-----------------------------
-0.166667 0.000000 0.166667
-0.166667 0.000000 0.166667
-0.166667 0.000000 0.166667
!!! settings "Cleanup"
END PROGRAM main