Polynomial3D example 1
This example shows the usage of [[Polynomial3D_]] class.
Modules and classes
- [[Polynomial3D_]]
Usage
PROGRAM main
use easifemBase
use easifemClasses
implicit none
type(Polynomial3D_) :: f1
real(dfp), allocatable :: coeff( : )
integer(i4b), allocatable :: degree( :, : )
!!! note "Initiate"
coeff = [1,1,1,1]
call reallocate( degree, 4, 3 )
degree(:,1) = [0,1,0,0]
degree(:,2) = [0,0,1,0]
degree(:,3) = [0,0,0,1]
f1=Polynomial3D( coeff, degree, "x", "y", "z" )
call f1%display( 'f(x,y)=' )
!!! example "result"
!!! note "Initiate"
coeff = [1,2,3,4]
call reallocate( degree, 4, 3 )
degree(:,1) = [0,1,0,0]
degree(:,2) = [0,0,1,0]
degree(:,3) = [0,0,0,1]
f1=Polynomial3D( coeff, degree, "x", "y", "z" )
call f1%display( 'f(x,y)=' )
call f1%deallocate()
!!! example "result"
!!! note "Initiate" Check duplicates.
coeff = [1,2,3,2,2]
call reallocate( degree, 5, 3 )
degree(:,1) = [0,1,0,0,0]
degree(:,2) = [0,0,1,0,0]
degree(:,3) = [0,0,0,1,1]
f1=Polynomial3D( coeff, degree, "x", "y", "z" )
call f1%display( 'f(x,y)=' )
call f1%deallocate()
!!! example "result"
END PROGRAM main