Lagrange1D example 1
This example shows the usage of [[Lagrange1D_]] class.
Modules and classes
- [[Lagrange1D_]]
Usage
PROGRAM main
use easifemBase
use easifemClasses
implicit none
type(Lagrange1D_), allocatable :: f(:)
type(Lagrange1D_) :: f1
real(dfp), allocatable :: x( : )
integer(i4b) :: ii, order
!!! note "Lagrange1D" Initiate lagrange polynomial in one dimension
x = [0.0,1.0]
order=1
f1=Lagrange1D( i=1, x=x, order=order, varname="x" )
call f1%display( 'f(x)=' )
f1=Lagrange1D( i=2, x=x, order=order, varname="x" )
call f1%display( 'f(x)=' )
!!! example "result"
!!! note "Higher order Lagrange polynomial"
!!! note "Lagrange1D"
order = 4_I4B
x = linspace(0.0_DFP, 1.0_DFP, order+1)
allocate( f(order+1) )
do ii = 1, order+1
f(ii) = Lagrange1D(ii, x=x, order=order, varname="x")
call f(ii)%display("l_{"//tostring(ii)//"}=")
end do
!!! example "result"
END PROGRAM main