LagrangeDegree
This routine returns the degrees of monomials for lagrange polynomial.
Interface
- ܀ Interface
- ️܀ Example 1
- Example 2
- Example 3
- Example 4
- ↢
INTERFACE
MODULE PURE FUNCTION LagrangeDegree(order, elemType) RESULT(ans)
INTEGER(I4B), INTENT(IN) :: order
INTEGER(I4B), INTENT(IN) :: elemType
INTEGER(I4B), ALLOCATABLE :: ans(:, :)
END FUNCTION LagrangeDegree
END INTERFACE
program main
use easifembase
implicit none
integer( i4b ) :: i1, i2, order, elemType
integer( i4b ), allocatable :: ans( :, : )
order=1; elemType=Line
ans = LagrangeDegree( order=order, elemType=elemType )
call display( ans, "ans (order="//tostring(order)//")=" )
call blanklines(nol=2)
order=2
ans = LagrangeDegree( order=order, elemType=elemType )
call display( ans, "ans (order="//tostring(order)//")=" )
call blanklines(nol=2)
order=3
ans = LagrangeDegree( order=order, elemType=elemType )
call display( ans, "ans (order="//tostring(order)//")=" )
call blanklines(nol=2)
end program main
See results
results
ans (order=1)=
--------------
0
1
ans (order=2)=
--------------
0
1
2
ans (order=3)=
--------------
0
1
2
3
program main
use easifembase
implicit none
integer( i4b ) :: i1, i2, order, elemType
integer( i4b ), allocatable :: ans( :, : )
order=1; elemType=Quadrangle
ans = LagrangeDegree( order=order, elemType=elemType )
call display( ans, "ans (order="//tostring(order)//")=" )
call blanklines(nol=2)
order=2
ans = LagrangeDegree( order=order, elemType=elemType )
call display( ans, "ans (order="//tostring(order)//")=" )
call blanklines(nol=2)
order=3
ans = LagrangeDegree( order=order, elemType=elemType )
call display( ans, "ans (order="//tostring(order)//")=" )
call blanklines(nol=2)
end program main
See results
results
ans (order=1)=
--------------
0 0
1 0
0 1
1 1
ans (order=2)=
--------------
0 0
1 0
2 0
0 1
1 1
2 1
0 2
1 2
2 2
ans (order=3)=
--------------
0 0
1 0
2 0
3 0
0 1
1 1
2 1
3 1
0 2
1 2
2 2
3 2
0 3
1 3
2 3
3 3
program main
use easifembase
implicit none
integer( i4b ) :: i1, i2, order, elemType
integer( i4b ), allocatable :: ans( :, : )
order=1; elemType=Triangle
ans = LagrangeDegree( order=order, elemType=elemType )
call display( ans, "ans (order="//tostring(order)//")=" )
call blanklines(nol=2)
order=2
ans = LagrangeDegree( order=order, elemType=elemType )
call display( ans, "ans (order="//tostring(order)//")=" )
call blanklines(nol=2)
order=3
ans = LagrangeDegree( order=order, elemType=elemType )
call display( ans, "ans (order="//tostring(order)//")=" )
call blanklines(nol=2)
end program main
See results
results
ans (order=1)=
--------------
0 0
1 0
0 1
ans (order=2)=
--------------
0 0
1 0
2 0
0 1
1 1
0 2
ans (order=3)=
--------------
0 0
1 0
2 0
3 0
0 1
1 1
2 1
0 2
1 2
0 3
program main
use easifembase
implicit none
integer( i4b ) :: i1, i2, order, elemType
integer( i4b ), allocatable :: ans( :, : )
order=1; elemType=Tetrahedron
ans = LagrangeDegree( order=order, elemType=elemType )
call display( ans, "ans (order="//tostring(order)//")=" )
call blanklines(nol=2)
order=2
ans = LagrangeDegree( order=order, elemType=elemType )
call display( ans, "ans (order="//tostring(order)//")=" )
call blanklines(nol=2)
order=3
ans = LagrangeDegree( order=order, elemType=elemType )
call display( ans, "ans (order="//tostring(order)//")=" )
call blanklines(nol=2)
end program main
See results
results
ans (order=1)=
--------------
0 0 0
1 0 0
0 1 0
0 0 1
ans (order=2)=
--------------
0 0 0
1 0 0
2 0 0
0 1 0
1 1 0
0 2 0
0 0 1
1 0 1
0 1 1
0 0 2
ans (order=3)=
--------------
0 0 0
1 0 0
2 0 0
3 0 0
0 1 0
1 1 0
2 1 0
0 2 0
1 2 0
0 3 0
0 0 1
1 0 1
2 0 1
0 1 1
1 1 1
0 2 1
0 0 2
1 0 2
0 1 2
0 0 3