HeirarchicalBasis
Evaluate all modal basis (heirarchical polynomial) on Quadrangle.
Interface
- ܀ Interface
- ️܀ See example
- Example 2
- Example 3
- Example 4
- ↢
INTERFACE
MODULE PURE FUNCTION HeirarchicalBasis_Quadrangle(order, pe1, pe2, pe3,&
& xij, refQuadrangle) RESULT(ans)
INTEGER(I4B), INTENT(IN) :: order
!! order in the cell of triangle, it should be greater than 2
INTEGER(I4B), INTENT(IN) :: pe1
!! order of interpolation on edge e1
INTEGER(I4B), INTENT(IN) :: pe2
!! order of interpolation on edge e2
INTEGER(I4B), INTENT(IN) :: pe3
!! order of interpolation on edge e3
REAL(DFP), INTENT(IN) :: xij(:, :)
!! points of evaluation in xij format
CHARACTER(*), INTENT(IN) :: refQuadrangle
!! reference triangle
REAL(DFP) :: ans( &
& SIZE(xij, 2), &
& pe1 + pe2 + pe3 + INT((order - 1) * (order - 2) / 2))
!!
END FUNCTION HeirarchicalBasis_Quadrangle
END INTERFACE
program main
use easifembase
use easifemClasses
implicit none
real(dfp), allocatable :: xij(:,:), avec(:)
integer(i4b) :: ii, jj, n, cnt
real(dfp), allocatable :: ans(:,:)
integer(i4b) :: pb, qb, pe3, pe4, qe1, qe2, ii
type( VTKPlot_ ) :: aplot
character(len=*), parameter :: fname="./results/"
n = 51
call reallocate(xij, 2, int(n*n))
avec= linspace(-1.0_DFP, 1.0_DFP, n)
cnt=0
do ii = 1, n
do jj = 1, n
cnt=cnt+1
xij(1,cnt) = avec(ii)
xij(2,cnt) = avec(jj)
end do
end do
pb = 1; qb=1; pe3=1; pe4=1; qe1=1; qe2=1
ans = HeirarchicalBasis_Quadrangle( &
& pb=pb, &
& qb=qb, &
& pe3=pe3, &
& pe4=pe4, &
& qe1=qe1, &
& qe2=qe2, &
& xij=xij )
do ii = 1, size(ans,2)
call aplot%scatter3D( &
& x=xij(1,:), &
& y=xij(2, :), &
& z=ans(:,ii), &
& filename=fname//"Qh( pb=" // tostring(pb) // &
& "qb="//tostring(qb) // &
& ", qe1="//tostring(qe1) // &
& ", qe2="//tostring(qe2) // &
& ", pe3="//tostring(pe3) // &
& ", pe4="//tostring(pe4) // &
& " )" // tostring(ii) // &
& ".vtp", &
& label="P")
end do
end program main
note
"pb = 4; qb=2; pe3=2; pe4=3; qe1=2; qe2=1"
program main
use easifembase
use easifemClasses
implicit none
real(dfp), allocatable :: xij(:,:), avec(:)
integer(i4b) :: ii, jj, n, cnt
real(dfp), allocatable :: ans(:,:)
integer(i4b) :: pb, qb, pe3, pe4, qe1, qe2, ii
type( VTKPlot_ ) :: aplot
character(len=*), parameter :: fname="./results/"
n = 51
call reallocate(xij, 2, int(n*n))
avec= linspace(-1.0_DFP, 1.0_DFP, n)
cnt=0
do ii = 1, n
do jj = 1, n
cnt=cnt+1
xij(1,cnt) = avec(ii)
xij(2,cnt) = avec(jj)
end do
end do
pb = 4; qb=2; pe3=2; pe4=3; qe1=2; qe2=1
ans = HeirarchicalBasis_Quadrangle( &
& pb=pb, &
& qb=qb, &
& pe3=pe3, &
& pe4=pe4, &
& qe1=qe1, &
& qe2=qe2, &
& xij=xij )
do ii = 1, size(ans,2)
call aplot%scatter3D( &
& x=xij(1,:), &
& y=xij(2, :), &
& z=ans(:,ii), &
& filename=fname//"Qh( pb=" // tostring(pb) // &
& "qb="//tostring(qb) // &
& ", qe1="//tostring(qe1) // &
& ", qe2="//tostring(qe2) // &
& ", pe3="//tostring(pe3) // &
& ", pe4="//tostring(pe4) // &
& " )" // tostring(ii) // &
& ".vtp", &
& label="P")
end do
end program main
program main
use easifembase
use easifemClasses
implicit none
real(dfp), allocatable :: xij(:,:), avec(:)
integer(i4b) :: ii, jj, n, cnt
real(dfp), allocatable :: ans(:,:)
integer(i4b) :: pb, qb, pe3, pe4, qe1, qe2, ii
type( VTKPlot_ ) :: aplot
character(len=*), parameter :: fname="./results/"
n = 51
call reallocate(xij, 2, int(n*n))
avec= linspace(-1.0_DFP, 1.0_DFP, n)
cnt=0
do ii = 1, n
do jj = 1, n
cnt=cnt+1
xij(1,cnt) = avec(ii)
xij(2,cnt) = avec(jj)
end do
end do
pb = 3; qb=3; pe3=3; pe4=3; qe1=3; qe2=3
ans = HeirarchicalBasis_Quadrangle( &
& pb=pb, &
& qb=qb, &
& pe3=pe3, &
& pe4=pe4, &
& qe1=qe1, &
& qe2=qe2, &
& xij=xij )
do ii = 1, size(ans,2)
call aplot%scatter3D(x=xij(1,:), y=xij(2, :), z=ans(:,ii), &
& filename=fname//"Qh( pb=" // tostring(pb) // &
& "qb="//tostring(qb) // &
& ", qe1="//tostring(qe1) // &
& ", qe2="//tostring(qe2) // &
& ", pe3="//tostring(pe3) // &
& ", pe4="//tostring(pe4) // &
& " )" // tostring(ii) // &
& ".vtp", &
& label="P")
end do
end program main
program main
use easifembase
use easifemClasses
implicit none
real(dfp), allocatable :: xij(:,:), avec(:)
integer(i4b) :: ii, jj, n, cnt
real(dfp), allocatable :: ans(:,:)
integer(i4b) :: pb, qb, pe3, pe4, qe1, qe2, ii
type( VTKPlot_ ) :: aplot
character(len=*), parameter :: fname="./results/"
n = 51
call reallocate(xij, 2, int(n*n))
avec= linspace(-1.0_DFP, 1.0_DFP, n)
cnt=0
do ii = 1, n
do jj = 1, n
cnt=cnt+1
xij(1,cnt) = avec(ii)
xij(2,cnt) = avec(jj)
end do
end do
pb = 4; qb=4; pe3=4; pe4=4; qe1=4; qe2=4
ans = HeirarchicalBasis_Quadrangle( &
& pb=pb, &
& qb=qb, &
& pe3=pe3, &
& pe4=pe4, &
& qe1=qe1, &
& qe2=qe2, &
& xij=xij )
do ii = 1, size(ans,2)
call aplot%scatter3D(x=xij(1,:), y=xij(2, :), z=ans(:,ii), &
& filename=fname//"Qh( pb=" // tostring(pb) // &
& "qb="//tostring(qb) // &
& ", qe1="//tostring(qe1) // &
& ", qe2="//tostring(qe2) // &
& ", pe3="//tostring(pe3) // &
& ", pe4="//tostring(pe4) // &
& " )" // tostring(ii) // &
& ".vtp", &
& label="P")
end do
end program main
Interface 2
INTERFACE HeirarchicalBasis_Quadrangle
MODULE PURE FUNCTION HeirarchicalBasis_Quadrangle2(p, q, xij) RESULT(ans)
INTEGER(I4B), INTENT(IN) :: p
!! order of interpolation inside the quadrangle in x1 direction
INTEGER(I4B), INTENT(IN) :: q
!! order of interpolation inside the quadrangle in x2 direction
REAL(DFP), INTENT(IN) :: xij(:, :)
!! points of evaluation in xij format
REAL(DFP) :: ans(SIZE(xij, 2), (p + 1) * (q + 1))
!!
END FUNCTION HeirarchicalBasis_Quadrangle2
END INTERFACE HeirarchicalBasis_Quadrangle