version 0.6.0
Loading...
Searching...
No Matches
type_discrete_stencil Module Reference

The Finite Difference Scheme type definition. More...

Data Types

type  t_stencil_1d
 The 1D stencil type. More...
 
type  t_stencil_2d
 The 2D stencil type. More...
 
type  t_stencil_3d
 The 3D stencil type. More...
 

Functions/Subroutines

subroutine stencil_1d_init (self, index_start, index_end)
 Initialize a 1D stencil.
 
pure double precision function stencil_1d_apply (self, values)
 Simply apply (multiply) the stencil to the given values.
 
subroutine stencil_1d_set (self, weights)
 Simply sets the weight to the given value.
 
subroutine stencil_2d_init (self, index_start, index_end)
 Initialize a 2D stencil.
 
pure double precision function stencil_2d_apply (self, values)
 Simply apply (multiply) the stencil to the given values.
 
subroutine stencil_3d_init (self, index_start, index_end)
 Initialize a 3D stencil.
 
pure double precision function stencil_3d_apply (self, values)
 Simply apply (multiply) the stencil to the given values.
 

Detailed Description

A finite difference scheme is defined as an array of weights associated to a serie of discrete values of a function \( \phi \). The reference element \( \phi_i \) is numbered \( 0 \). The finite difference scheme is relative to this element. Thus, relative indices are used as the array indices.

Example
weight(-2) is the weight associated to \( \phi_{i-2} \)
Note
The maximum size of any fd_scheme is defined by \( max\_index*2+1 \)

The value of fd_scheme%index_start (resp. index_end) is set to the index of the first (resp. last) usable value in fd_scheme%weight, when the scheme is built (see the various scheme constructors).

We advise the developer who develops his own scheme to read the Schemes documentation page.

Function/Subroutine Documentation

◆ stencil_1d_apply()

pure double precision function type_discrete_stencil::stencil_1d_apply ( class(t_stencil_1d), intent(in) self,
double precision, dimension(:), intent(in) values )
Parameters
[in,out]selfthe element
[in]valuesthe input \( \phi_i \) values associated with the stencil, where the array is of of size thisindex_end:thisindex_start.
Returns
the resulting stencil applied to the input values

◆ stencil_1d_init()

subroutine type_discrete_stencil::stencil_1d_init ( class(t_stencil_1d), intent(inout) self,
integer, intent(in) index_start,
integer, intent(in) index_end )
Parameters
[in,out]selfthe element
[in]index_startthe starting index
[in]index_endthe ending index (>= index_start)

◆ stencil_1d_set()

subroutine type_discrete_stencil::stencil_1d_set ( class(t_stencil_1d), intent(inout) self,
double precision, dimension(:), intent(in) weights )
Parameters
[in,out]selfthe element
[in]weightsthe given weights

◆ stencil_2d_apply()

pure double precision function type_discrete_stencil::stencil_2d_apply ( class(t_stencil_2d), intent(in) self,
double precision, dimension(:,:), intent(in) values )
Parameters
[in,out]selfthe element
[in]valuesthe input \( \phi_i \) values associated with the stencil, where the array is of of size thisindex_end:thisindex_start.
Returns
the resulting stencil applied to the input values

◆ stencil_2d_init()

subroutine type_discrete_stencil::stencil_2d_init ( class(t_stencil_2d), intent(inout) self,
integer, dimension(2), intent(in) index_start,
integer, dimension(2), intent(in) index_end )
Parameters
[in,out]selfthe element
[in]index_startthe starting index
[in]index_endthe ending index (>= index_start)

◆ stencil_3d_apply()

pure double precision function type_discrete_stencil::stencil_3d_apply ( class(t_stencil_3d), intent(in) self,
double precision, dimension(:,:,:), intent(in) values )
Parameters
[in,out]selfthe element
[in]valuesthe input \( \phi_i \) values associated with the stencil, where the array is of of size thisindex_end:thisindex_start.
Returns
the resulting stencil applied to the input values

◆ stencil_3d_init()

subroutine type_discrete_stencil::stencil_3d_init ( class(t_stencil_3d), intent(inout) self,
integer, dimension(3), intent(in) index_start,
integer, dimension(3), intent(in) index_end )
Parameters
[in,out]selfthe element
[in]index_startthe starting index
[in]index_endthe ending index (>= index_start)