Polynomial2D example 5
This example shows the usage of [[Polynomial2D_]] class.
Modules and classes
- [[Polynomial2D_]]
Usage
PROGRAM main
use easifemBase
use easifemClasses
implicit none
type(Polynomial2D_) :: f1, f2
real(dfp), allocatable :: coeff( : )
integer(i4b), allocatable :: degree( :, : )
!!! note "Initiate" Initiate the object.
coeff = [1,1,1,1]
call reallocate( degree, 4, 2 )
degree(:,1) = [0,1,0,1]
degree(:,2) = [0,0,1,1]
call f1%initiate( coeff, degree, "x", "y" )
call f1%display( 'f(x,y)=' )
!!! note "Grad"
f2 = f1 .GRAD. 1
call f2%display( "dfdx=" )
!!! example "result"
!!! note "Grad"
f2 = f1 .GRAD. 2
call f2%display( "dfdy=" )
!!! example "result"
END PROGRAM main