This module implements differentiation over a one dimensional pencil. It exports concrete derived types
differentiator_type
:: periodic differentiationnonperiodic_differentiator_type
:: non periodic differentiationBoth types provide access to a single type-procedure diff
that
performs the differentiation and return the derivative evaluated
over the input pencil.
Instances of differentiator derived types are created on the
client side via constructor procedures <method>_<order>
(e.g. sixth_order_compact_1
). These constructor procedures are
implemented as a generic interface to concrete constructors for
the periodic case (no boundary conditions are specified) or the
noneriodic case (boundary conditions are specified). See module
boundary_schemes
.
use boundary_schemes, only:: get_dirichlet_4th
real :: f(:), df(:), dx
! ...
! ...
differentiatior = sixth_order_compact_1( &
& east = get_dirichlet_4th(), &
& west = get_dirichlet_4th(), &
& )
df = differentiatior%diff(f, dx)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(boundary_type), | intent(in) | :: | east | |||
type(boundary_type), | intent(in) | :: | west |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(boundary_type), | intent(in) | :: | east | |||
type(boundary_type), | intent(in) | :: | west |
Implements differentiation over a periodic stencil.
differentiator_type
provides access a a unique type-bound
procedure diff
procedure , public :: diff => diff_periodic Function |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
type(stencil_type), | public | :: | east_stencils(2) | ||||
type(stencil_type), | public | :: | west_stencils(2) |
procedure , public :: diff => diff_nonperiodic Function |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(boundary_type), | intent(in) | :: | east | |||
type(boundary_type), | intent(in) | :: | west |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(boundary_type), | intent(in) | :: | east | |||
type(boundary_type), | intent(in) | :: | west |
Apply a differentiation stencil along a one dimensional pencil,
then apply boundary conditions on both ends. Boundary
conditions are applied as arrays of type stencil_type
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(nonperiodic_differentiator_type), | intent(in) | :: | self | |||
real, | intent(in) | :: | f(:) | |||
real, | intent(in) | :: | dx |
Apply a differentiation stencil along a one dimensional pencil, assuming periodic boundaries. For instance, with a four point stencil and weights
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(differentiator_type), | intent(in) | :: | self | |||
real, | intent(in) | :: | f(:) |
Function to be derive, evaluated on pencil |
||
real, | intent(in) | :: | dx |
Step size |
Derivative, evaluated on pencil
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(in) | :: | x(:) |