Module containing all grid-related things.
Contains subroutines to create the base grid, Gaussian grid and
scale factors.
An integral of f(x) in [a,b] can be approximated with
f(x)≈0.5(b−a)n∑i=1[wif(0.5(b−a)xi+0.5(a+b))]!!
where wi and xi are the weights and nodes of the Gaussian quadrature.
The Gaussian grid is hence set up in every interval [a,b] across the
nodes j as
xi(j)=0.5∗dx∗wi(j)+0.5(a+b)
Interfaces
interface
-
private function dx_func_i(x)
Arguments
Type | Intent | Optional | Attributes | | Name | |
real(kind=dp), |
intent(in) |
| | :: |
x | |
Return Value real(kind=dp)
Derived Types
Components
Type | Visibility | Attributes | | Name | | Initial | |
real(kind=dp), |
public, | allocatable | :: |
base_grid(:) | | | |
real(kind=dp), |
public, | allocatable | :: |
gaussian_grid(:) | | | |
real(kind=dp), |
public, | allocatable | :: |
ef_grid(:) | | | |
procedure(dx_func_i), |
private, | pointer, nopass | :: |
dx_func | => | null() | |
type(settings_t), |
private, | pointer | :: |
settings | | | |
logical, |
private | | :: |
is_initialised | | | |
logical, |
private | | :: |
uses_custom_base_grid | | | |
logical, |
private | | :: |
uses_custom_dx | | | |
Type-Bound Procedures
procedure, private :: set_base_grid |
|
procedure, private :: set_gaussian_grid |
|
procedure, private :: set_ef_grid |
|
procedure, private :: generate_grid |
|
procedure, public :: initialise |
|
procedure, public :: set_custom_grid |
|
procedure, public :: set_spacing_function |
|
procedure, public :: get_eps |
|
procedure, public :: get_deps |
|
procedure, public :: delete |
|
Functions
public function new_grid(settings) result(grid)
Arguments
Type | Intent | Optional | Attributes | | Name | |
type(settings_t), |
intent(in), |
| target | :: |
settings | |
Return Value type(grid_t)
private impure elemental function get_eps(this, x)
Arguments
Type | Intent | Optional | Attributes | | Name | |
class(grid_t), |
intent(in) |
| | :: |
this | |
real(kind=dp), |
intent(in) |
| | :: |
x | |
Return Value real(kind=dp)
private impure elemental function get_deps(this)
Arguments
Type | Intent | Optional | Attributes | | Name | |
class(grid_t), |
intent(in) |
| | :: |
this | |
Return Value real(kind=dp)
Arguments
Type | Intent | Optional | Attributes | | Name | |
type(settings_t), |
intent(inout) |
| | :: |
settings | |
real(kind=dp), |
intent(in) |
| | :: |
custom_grid(:) | |
Return Value logical
Arguments
Type | Intent | Optional | Attributes | | Name | |
type(settings_t), |
intent(in) |
| | :: |
settings | |
procedure(dx_func_i) |
|
| | :: |
dx_func | |
Return Value integer
Arguments
Type | Intent | Optional | Attributes | | Name | |
real(kind=dp), |
intent(in) |
| | :: |
dx | |
Return Value logical
Subroutines
Arguments
Type | Intent | Optional | Attributes | | Name | |
class(grid_t), |
intent(inout) |
| | :: |
this | |
Arguments
Type | Intent | Optional | Attributes | | Name | |
class(grid_t), |
intent(inout) |
| | :: |
this | |
real(kind=dp), |
intent(in) |
| | :: |
custom(:) | |
Arguments
Type | Intent | Optional | Attributes | | Name | |
class(grid_t), |
intent(inout) |
| | :: |
this | |
procedure(dx_func_i) |
|
| | :: |
dx_func | |
Arguments
Type | Intent | Optional | Attributes | | Name | |
class(grid_t), |
intent(inout) |
| | :: |
this | |
Arguments
Type | Intent | Optional | Attributes | | Name | |
class(grid_t), |
intent(inout) |
| | :: |
this | |
Arguments
Type | Intent | Optional | Attributes | | Name | |
class(grid_t), |
intent(inout) |
| | :: |
this | |
Arguments
Type | Intent | Optional | Attributes | | Name | |
class(grid_t), |
intent(inout) |
| | :: |
this | |
private pure subroutine delete(this)
Arguments
Type | Intent | Optional | Attributes | | Name | |
class(grid_t), |
intent(inout) |
| | :: |
this | |
Arguments
Type | Intent | Optional | Attributes | | Name | |
integer, |
intent(in) |
| | :: |
old_pts | |
integer, |
intent(in) |
| | :: |
new_pts | |