mod_grid Module

Module containing all grid-related things. Contains subroutines to create the base grid, Gaussian grid and scale factors. An integral of in can be approximated with where and are the weights and nodes of the Gaussian quadrature. The Gaussian grid is hence set up in every interval across the nodes as



Contents


Interfaces

interface

  • private function dx_func_i(x)

    Arguments

    TypeIntentOptionalAttributesName
    real(kind=dp), intent(in) :: x

    Return Value real(kind=dp)


Derived Types

type, public :: grid_t

Components

TypeVisibilityAttributesNameInitial
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

TypeIntentOptionalAttributesName
type(settings_t), intent(in), target:: settings

Return Value type(grid_t)

private impure elemental function get_eps(this, x)

Arguments

TypeIntentOptionalAttributesName
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

TypeIntentOptionalAttributesName
class(grid_t), intent(in) :: this

Return Value real(kind=dp)

private function is_valid_custom_base_grid(settings, custom_grid)

Arguments

TypeIntentOptionalAttributesName
type(settings_t), intent(inout) :: settings
real(kind=dp), intent(in) :: custom_grid(:)

Return Value logical

private function get_updated_number_of_gridpoints(settings, dx_func) result(updated_pts)

Arguments

TypeIntentOptionalAttributesName
type(settings_t), intent(in) :: settings
procedure(dx_func_i) :: dx_func

Return Value integer

private function is_valid_dx(dx)

Arguments

TypeIntentOptionalAttributesName
real(kind=dp), intent(in) :: dx

Return Value logical


Subroutines

private subroutine initialise(this)

Arguments

TypeIntentOptionalAttributesName
class(grid_t), intent(inout) :: this

private subroutine set_custom_grid(this, custom)

Arguments

TypeIntentOptionalAttributesName
class(grid_t), intent(inout) :: this
real(kind=dp), intent(in) :: custom(:)

private subroutine set_spacing_function(this, dx_func)

Arguments

TypeIntentOptionalAttributesName
class(grid_t), intent(inout) :: this
procedure(dx_func_i) :: dx_func

private subroutine set_base_grid(this)

Arguments

TypeIntentOptionalAttributesName
class(grid_t), intent(inout) :: this

private pure subroutine set_gaussian_grid(this)

Arguments

TypeIntentOptionalAttributesName
class(grid_t), intent(inout) :: this

private pure subroutine set_ef_grid(this)

Arguments

TypeIntentOptionalAttributesName
class(grid_t), intent(inout) :: this

private subroutine generate_grid(this)

Arguments

TypeIntentOptionalAttributesName
class(grid_t), intent(inout) :: this

private pure subroutine delete(this)

Arguments

TypeIntentOptionalAttributesName
class(grid_t), intent(inout) :: this

private subroutine log_msg_by_gridpoint_change(old_pts, new_pts)

Arguments

TypeIntentOptionalAttributesName
integer, intent(in) :: old_pts
integer, intent(in) :: new_pts