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

Computer for evaluating Finite Difference Schemes. More...

Functions/Subroutines

double precision function fd_compute_from_values (scheme, steps, values)
 Compute the finite difference via the scheme by giving the associated field values.
 
double precision function fd_weno_compute_from_values (scheme, step, steps, values)
 Compute the WENO finite difference via the scheme by giving the associated field values.
 
double precision function fd_compute_from_scheme (scheme, values)
 Compute the finite difference of the scheme by giving the associated field values.
 
double precision function fd_compute_from_array (scheme, step_array, array, index)
 Compute the finite difference via the scheme by giving the associated array, the step array (see below), the index where to compute the FD.
 
double precision function fd_compute_from_field (scheme, x_step_array, y_step_array, z_step_array, field, i, j, k, axis)
 Compute the finite difference via the scheme by giving the associated field, the step arrays for each dimension, the indices (position) and the direction (x,y or z).
 
double precision function fd_compute_from_field_offset (scheme, x_step_array, y_step_array, z_step_array, field, i, j, k, axis, offset)
 Compute the finite difference via the scheme by giving the associated field, the step arrays for each dimension, the indices (position) and the direction (x,y or z).
 
double precision function fd_weno_compute_from_array (scheme, step, step_array, array, index)
 Compute the WENO finite difference via the scheme by giving the associated array, the step array (see below), the index where to compute the FD.
 
double precision function fd_weno_compute_from_field (scheme, step, x_step_array, y_step_array, z_step_array, field, i, j, k, axis)
 Compute the WENO finite difference via the scheme by giving the associated field, the step arrays for each dimension, the indices (position) and the direction (x,y or z).
 

Detailed Description

All the methods defined here are used to effectively compute/evaluate finite differences. They take as argument a scheme that is built through the various schemes of the module (see mod_finite_differences_scheme_first_o1 for example).

Function/Subroutine Documentation

◆ fd_compute_from_array()

double precision function mod_finite_differences_computer::fd_compute_from_array ( class(t_fd_scheme) scheme,
double precision, dimension(:), intent(in) step_array,
double precision, dimension(:), intent(in) array,
integer, intent(in) index )
Parameters
[in]schemethe finite difference scheme
[in]step_arraythe discretization step array where step_array(i) is the step between array(i) and array(i+1)
[in]arraythe array \(\phi(i)\) to which apply the scheme at the given indices.
[in]indexthe index where to compute the FD
Returns
the value of the scheme evaluated with the input values

◆ fd_compute_from_field()

double precision function mod_finite_differences_computer::fd_compute_from_field ( class(t_fd_scheme) scheme,
double precision, dimension(:), intent(in) x_step_array,
double precision, dimension(:), intent(in) y_step_array,
double precision, dimension(:), intent(in) z_step_array,
double precision, dimension(:,:,:), intent(in) field,
integer, intent(in) i,
integer, intent(in) j,
integer, intent(in) k,
integer, intent(in) axis )
Parameters
[in]schemethe finite difference scheme
[in]x_step_arraythe discretization step array in the x direction
[in]y_step_arraythe discretization step array in the y direction
[in]z_step_arraythe discretization step array in the z direction
[in]fieldthe field \(\phi(i,j,k)\) to which apply the scheme at the given indices.
[in]i,j,kthe indices where to compute the FD
[in]axisthe axis (direction) \(axis={1,2,3}\) for \({x,y,z}\)
Returns
the value of the scheme evaluated with the input values
Warning
This function is not the most efficient, especialy when used in a i,j,k loop, because it switches for each direction!

◆ fd_compute_from_field_offset()

double precision function mod_finite_differences_computer::fd_compute_from_field_offset ( class(t_fd_scheme) scheme,
double precision, dimension(:), intent(in) x_step_array,
double precision, dimension(:), intent(in) y_step_array,
double precision, dimension(:), intent(in) z_step_array,
double precision, dimension(:,:,:), intent(in) field,
integer, intent(in) i,
integer, intent(in) j,
integer, intent(in) k,
integer, intent(in) axis,
integer, intent(in) offset )
Parameters
[in]schemethe finite difference scheme
[in]x_step_arraythe discretization step array in the x direction
[in]y_step_arraythe discretization step array in the y direction
[in]z_step_arraythe discretization step array in the z direction
[in]fieldthe field \(\phi(i,j,k)\) to which apply the scheme at the given indices.
[in]i,j,kthe indices where to compute the FD
[in]axisthe axis (direction) \(axis={1,2,3}\) for \({x,y,z}\)
[in]offsetoffset the dx
Returns
the value of the scheme evaluated with the input values
Warning
This function is not the most efficient, especialy when used in a i,j,k loop, because it switches for each direction!

◆ fd_compute_from_scheme()

double precision function mod_finite_differences_computer::fd_compute_from_scheme ( class(t_fd_scheme) scheme,
double precision, dimension(:), intent(in) values )
Parameters
[in]schemethe finite difference scheme (previously defined)
[in]valuesthe field values to which to apply the scheme. They must be of the same dimension as the scheme
Returns
the value of the scheme evaluated with the input values
Precondition
the scheme has already been init and filled!

◆ fd_compute_from_values()

double precision function mod_finite_differences_computer::fd_compute_from_values ( class(t_fd_scheme) scheme,
double precision, dimension(:), intent(in) steps,
double precision, dimension(:), intent(in) values )
Parameters
[in]schemethe finite difference scheme
[in]stepsthe discretization steps, with size(steps)==size(values)-1
[in]valuesthe field values to which to apply the scheme. They must be of the same dimension as the scheme
Returns
the value of the scheme evaluated with the input values

◆ fd_weno_compute_from_array()

double precision function mod_finite_differences_computer::fd_weno_compute_from_array ( class(t_fd_weno_scheme) scheme,
double precision, intent(in) step,
double precision, dimension(:), intent(in) step_array,
double precision, dimension(:), intent(in) array,
integer, intent(in) index )
Parameters
[in]schemethe finite difference scheme
[in]stepthe step where to evaluate the scheme (starting from the reference node)
[in]step_arraythe discretization step array where step_array(i) is the step between array(i) and array(i+1)
[in]arraythe array \(\phi(i)\) to which apply the scheme at the given indices.
[in]indexthe index where to compute the FD
Returns
the value of the scheme evaluated with the input values

◆ fd_weno_compute_from_field()

double precision function mod_finite_differences_computer::fd_weno_compute_from_field ( class(t_fd_weno_scheme) scheme,
double precision, intent(in) step,
double precision, dimension(:), intent(in) x_step_array,
double precision, dimension(:), intent(in) y_step_array,
double precision, dimension(:), intent(in) z_step_array,
double precision, dimension(:,:,:), intent(in) field,
integer, intent(in) i,
integer, intent(in) j,
integer, intent(in) k,
integer, intent(in) axis )
Parameters
[in]schemethe finite difference scheme
[in]stepthe step where to evaluate the scheme (starting from the reference node)
[in]x_step_arraythe discretization step array in the x direction
[in]y_step_arraythe discretization step array in the y direction
[in]z_step_arraythe discretization step array in the z direction
[in]fieldthe field \(\phi(i,j,k)\) to which apply the scheme at the given indices.
[in]i,j,kthe indices where to compute the FD
[in]axisthe axis (direction) \(axis={1,2,3}\) for \({x,y,z}\)
Returns
the value of the scheme evaluated with the input values
Warning
This function is not the most efficient, especialy when used in a i,j,k loop, because it switches for each direction!

◆ fd_weno_compute_from_values()

double precision function mod_finite_differences_computer::fd_weno_compute_from_values ( class(t_fd_weno_scheme) scheme,
double precision, intent(in) step,
double precision, dimension(:), intent(in) steps,
double precision, dimension(:), intent(in) values )
Parameters
[in]schemethe finite difference scheme
[in]stepthe step where to evaluate the scheme (starting from the reference node)
[in]stepsthe discretization steps, with size(steps)==size(values)-1
[in]valuesthe field values to which to apply the scheme. They must be of the same dimension as the scheme
Returns
the value of the scheme evaluated with the input values