pseudospec_block Derived Type

type, public :: pseudospec_block

A data type representing a matrix pseudospectral differentiation operator. It can be useful when preconditioning systems which use a spectral discretisation, if higher accuracy than finite difference is needed. It is inherently 1-D in its implementation. Note that multiplication of a field will simply call that field's differentiation operator, which may or may not use a pseudospectral method.


Inherited by

type~~pseudospec_block~~InheritedByGraph type~pseudospec_block pseudospec_block type~plume plume type~plume->type~pseudospec_block precond type~static_plume static_plume type~static_plume->type~pseudospec_block precond type~asym_plume asym_plume type~asym_plume->type~pseudospec_block precond type~coriolis_block coriolis_block type~asym_plume->type~coriolis_block vel_precond type~coriolis_block->type~pseudospec_block integrator

Contents

Source Code


Components

TypeVisibility AttributesNameInitial
real(kind=r8), private, dimension(:), pointer:: xvals

Coordinates of collocation points.


Constructor

public interface pseudospec_block

  • private 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.

    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)


Type-Bound Procedures

procedure, private :: pseudospec_block_solve_scalar

  • private function pseudospec_block_solve_scalar(this, rhs, bound_loc, bound_val, good_bound) result(solution)

    Author
    Chris MacMackin
    Date
    September 2017

    Solves the linear(ised) system represented by this finite difference block, for a given right hand side state vector (represented by a scalar field).

    Read more…

    Arguments

    Type IntentOptional AttributesName
    class(pseudospec_block), intent(inout) :: this
    class(scalar_field), intent(in) :: rhs

    The right hand side of the linear(ised) system.

    integer, intent(in) :: bound_loc

    Which boundary is being set. The boundary will be the one normal to dimension of number abs(boundary). If the argument is negative, then the lower boundary is returned. If positive, then the upper boundary is returned.

    class(scalar_field), intent(in) :: bound_val

    The value of the result at the specified boundary.

    integer, intent(in), optional :: good_bound

    If provided, indicates which boundary contains trusted information from which to calculate the power of the highest frequency mode. Defaults to the opposite of bound_loc.

    Return Value class(scalar_field), pointer

procedure, private :: pseudospec_block_solve_vector

  • private function pseudospec_block_solve_vector(this, rhs, bound_loc, bound_val, good_bound) result(solution)

    Author
    Chris MacMackin
    Date
    September 2017

    Solves the linear(ised) system represented by this finite difference block, for a given right hand side state vector (represented by a vector field).

    Read more…

    Arguments

    Type IntentOptional AttributesName
    class(pseudospec_block), intent(inout) :: this
    class(cheb1d_vector_field), intent(in) :: rhs

    The right hand side of the linear(ised) system.

    integer, intent(in) :: bound_loc

    Which boundary is being set. The boundary will be the one normal to dimension of number abs(boundary). If the argument is negative, then the lower boundary is returned. If positive, then the upper boundary is returned.

    class(vector_field), intent(in) :: bound_val

    The value of the result at the specified boundary.

    integer, intent(in), optional :: good_bound

    If provided, indicates which boundary contains trusted information from which to calculate the power of the highest frequency mode. Defaults to the opposite of bound_loc.

    Return Value class(vector_field), pointer

  • private function pseudospec_block_solve_scalar(this, rhs, bound_loc, bound_val, good_bound) result(solution)

    Author
    Chris MacMackin
    Date
    September 2017

    Solves the linear(ised) system represented by this finite difference block, for a given right hand side state vector (represented by a scalar field).

    Read more…

    Arguments

    Type IntentOptional AttributesName
    class(pseudospec_block), intent(inout) :: this
    class(scalar_field), intent(in) :: rhs

    The right hand side of the linear(ised) system.

    integer, intent(in) :: bound_loc

    Which boundary is being set. The boundary will be the one normal to dimension of number abs(boundary). If the argument is negative, then the lower boundary is returned. If positive, then the upper boundary is returned.

    class(scalar_field), intent(in) :: bound_val

    The value of the result at the specified boundary.

    integer, intent(in), optional :: good_bound

    If provided, indicates which boundary contains trusted information from which to calculate the power of the highest frequency mode. Defaults to the opposite of bound_loc.

    Return Value class(scalar_field), pointer

  • private function pseudospec_block_solve_vector(this, rhs, bound_loc, bound_val, good_bound) result(solution)

    Author
    Chris MacMackin
    Date
    September 2017

    Solves the linear(ised) system represented by this finite difference block, for a given right hand side state vector (represented by a vector field).

    Read more…

    Arguments

    Type IntentOptional AttributesName
    class(pseudospec_block), intent(inout) :: this
    class(cheb1d_vector_field), intent(in) :: rhs

    The right hand side of the linear(ised) system.

    integer, intent(in) :: bound_loc

    Which boundary is being set. The boundary will be the one normal to dimension of number abs(boundary). If the argument is negative, then the lower boundary is returned. If positive, then the upper boundary is returned.

    class(vector_field), intent(in) :: bound_val

    The value of the result at the specified boundary.

    integer, intent(in), optional :: good_bound

    If provided, indicates which boundary contains trusted information from which to calculate the power of the highest frequency mode. Defaults to the opposite of bound_loc.

    Return Value class(vector_field), pointer

Source Code

  type, public :: pseudospec_block
    !* Author: Chris MacMackin
    !  Date: December 2016
    !
    ! A data type representing a matrix pseudospectral differentiation
    ! operator. It can be useful when preconditioning systems which
    ! use a spectral discretisation, if higher accuracy than finite
    ! difference is needed. It is inherently 1-D in its
    ! implementation. Note that multiplication of a field will simply
    ! call that field's differentiation operator, which may or may not
    ! use a pseudospectral method.
    !
    private
    real(r8), dimension(:), pointer :: xvals
      !! Coordinates of collocation points.
  contains
    private
    procedure :: pseudospec_block_solve_scalar
    procedure :: pseudospec_block_solve_vector
    generic, public :: solve_for => pseudospec_block_solve_scalar, &
                                    pseudospec_block_solve_vector
  end type pseudospec_block