Lagrange2D example 1
This example shows the usage of [[Lagrange2D_]] class.
Modules and classes
- [[Lagrange2D_]]
Usage
PROGRAM main
use easifemBase
use easifemClasses
implicit none
type(Lagrange2D_) :: f1
type(Lagrange2D_), allocatable :: f(:)
real(dfp), allocatable :: x( :, : )
integer(i4b) :: ii, order, n
!!! note "order=1"
order=1
x = EquidistancePoint(order=order, elemType=Triangle)
f1=Lagrange2D( order=order, i=1, x=x, name1="x", name2="y", elemType=Triangle )
call f1%display( 'f(x)=' )
f1=Lagrange2D( order=order, i=2, x=x, name1="x", name2="y", elemType=Triangle )
call f1%display( 'f(x)=' )
f1=Lagrange2D( order=order, i=3, x=x, name1="x", name2="y", elemType=Triangle )
call f1%display( 'f(x)=' )
!!! example "result"
!!! note "order=2"
order = 2_I4B
x = EquidistancePoint(order=order, elemType=Triangle)
n = LagrangeDOF( order=order, elemType=Triangle )
allocate( f(n) )
do ii = 1, n
f(ii) = Lagrange2D(i=ii, x=x, order=order, &
& name1="x", name2="y", elemType=Triangle)
call f(ii)%display("l_{"//tostring(ii)//"}=")
end do
deallocate(f)
!!! example "result"
!!! note "order=3"
order = 3_I4B
x = EquidistancePoint(order=order, elemType=Triangle)
n = LagrangeDOF( order=order, elemType=Triangle )
allocate( f(n) )
do ii = 1, n
f(ii) = Lagrange2D(i=ii, x=x, order=order, &
& name1="x", name2="y", elemType=Triangle)
call f(ii)%display("l_{"//tostring(ii)//"}=")
end do
deallocate(f)
!!! example "result"
END PROGRAM main