pseudospectral_block_mod Module

Provides a derived type which representes a finite difference matrix/operator. This can be useful for preconditioning problems which use a spectral discretisation.


Uses

  • module~~pseudospectral_block_mod~~UsesGraph module~pseudospectral_block_mod pseudospectral_block_mod penf penf module~pseudospectral_block_mod->penf logger_mod logger_mod module~pseudospectral_block_mod->logger_mod factual_mod factual_mod module~pseudospectral_block_mod->factual_mod iso_fortran_env iso_fortran_env module~pseudospectral_block_mod->iso_fortran_env chebyshev_mod chebyshev_mod module~pseudospectral_block_mod->chebyshev_mod

Used by

  • module~~pseudospectral_block_mod~~UsedByGraph module~pseudospectral_block_mod pseudospectral_block_mod module~asymmetric_plume_mod asymmetric_plume_mod module~asymmetric_plume_mod->module~pseudospectral_block_mod module~coriolis_block_mod coriolis_block_mod module~asymmetric_plume_mod->module~coriolis_block_mod module~coriolis_block_mod->module~pseudospectral_block_mod module~static_plume_mod static_plume_mod module~static_plume_mod->module~pseudospectral_block_mod module~plume_mod plume_mod module~plume_mod->module~pseudospectral_block_mod

Contents


Variables

TypeVisibility AttributesNameInitial
integer, private, parameter:: no_extra_derivative =-1

Interfaces

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)


Derived Types

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.

Components

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

Coordinates of collocation points.

Constructor

private function constructor(template)

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.

Type-Bound Procedures

procedure, private :: pseudospec_block_solve_scalar
procedure, private :: pseudospec_block_solve_vector
generic, public :: solve_for => pseudospec_block_solve_scalar, pseudospec_block_solve_vector

Functions

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)

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