Provides a derived type which representes a finite difference matrix/operator. This can be useful for preconditioning problems which use a spectral discretisation.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | private, | parameter | :: | no_extra_derivative | = | -1 |
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 | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_field), | intent(in) | :: | template | A scalar field with the same grid as any fields passed as arguments to the solve_for method. |
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.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
real(kind=r8), | private, | dimension(:), pointer | :: | xvals | Coordinates of collocation points. |
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. |
procedure, private :: pseudospec_block_solve_scalar | |
procedure, private :: pseudospec_block_solve_vector | |
generic, public :: solve_for => pseudospec_block_solve_scalar, pseudospec_block_solve_vector |
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 | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_field), | intent(in) | :: | template | A scalar field with the same grid as any fields passed as arguments to the solve_for method. |
Solves the linear(ised) system represented by this finite difference block, for a given right hand side state vector (represented by a scalar field).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
||
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 |
Solves the linear(ised) system represented by this finite difference block, for a given right hand side state vector (represented by a vector field).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
||
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 |