constructor Function

private function constructor(template) result(this)

Builds a Chebyshsev pseudospectral differentiation matrix block which can be used to solve the inverse problem. The result can only be used with fields having the same grid as the template.

Arguments

Type IntentOptional AttributesName
class(abstract_field), intent(in) :: template

A scalar field with the same grid as any fields passed as arguments to the solve_for method.

Return Value type(pseudospec_block)


Calls

proc~~constructor~5~~CallsGraph proc~constructor~5 constructor collocation_points collocation_points proc~constructor~5->collocation_points

Called by

proc~~constructor~5~~CalledByGraph proc~constructor~5 constructor interface~pseudospec_block pseudospec_block interface~pseudospec_block->proc~constructor~5

Contents

Source Code


Source Code

  function constructor(template) result(this)
    !* Author: Chris MacMackin
    !  Date: September 2017
    !
    ! Builds a Chebyshsev pseudospectral differentiation matrix block
    ! which can be used to solve the inverse problem. The result can
    ! only be used with fields having the same grid as the template.
    !
    class(abstract_field), intent(in)     :: template
      !! A scalar field with the same grid as any fields passed as
      !! arguments to the [[pseudospec_block(type):solve_for]] method.
    type(pseudospec_block)                :: this

    real(r8), dimension(:,:), allocatable :: domain
    
    domain = template%domain()
    this%xvals => collocation_points(template%elements()-1, domain(1,1), &
                                     domain(1,2))
  end function constructor