Skip to main content

JacobiSpace1D example 2

  • This example shows how to get the recurrence coefficients.
  • Following methods are tested.
  • [[JacobiSpace1D_#GetRecurrenceCoeff]]
  • [[JacobiSpace1D_#GetRecurrenceCoeff2]]
  • [[JacobiSpace1D_#GetAlpha]]
  • [[JacobiSpace1D_#GetBeta]]

Modules and classes

  • [[JacobiSpace1D_]]

Usage

PROGRAM main
use easifembase
use easifemclasses
implicit none
class(AbstractOrthopolSpace1D_), pointer :: aptr
real(dfp), allocatable :: coeff(:,:)
integer(i4b) :: n

!!! note "JacobiSpace1D_Pointer" Construct an instance of JacobiSpace1D_ by specifying α>1.0\alpha>-1.0 and β>1.0\beta>-1.0.

  aptr => JacobiSpace1D_Pointer(alpha=0.0_DFP, beta=0.0_DFP)

!!! note "GetRecurrenceCoeff"

  n = 10
coeff = aptr%GetRecurrenceCoeff(n=n)
call display(MdEncode(coeff), "coeff="//CHAR_LF)

!!! example "result" coeff=

αn\alpha_{n}βn\beta_{n}
02
00.33333
00.26667
00.25714
00.25397
00.25253
00.25175
00.25128
00.25098
00.25077

!!! note "GetRecurrenceCoeff2"

  n = 10
coeff = aptr%GetRecurrenceCoeff2(n=n)
call display(MdEncode(coeff), "coeff2="//CHAR_LF)

!!! example "result" coeff2=

ana_{n}bnb_{n}cnc_{n}
1-01.4142
1.500.5
1.666700.66667
1.7500.75
1.800.8
1.833300.83333
1.857100.85714
1.87500.875
1.888900.88889
1.900.9

!!! note "GetAlpha"

  CALL Display(aptr%GetAlpha(n=2_I4B), "alpha_2=")

!!! note "GetBeta"

  CALL Display(aptr%GetBeta(n=2_I4B), "beta_2=")

!!! note "cleanup"

  CALL aptr%Deallocate()
Deallocate(aptr)
END PROGRAM main