Stellarator-Tools
|
Module is part of the LIBSTELL. This modules contains code to define and integrate along an arbitray path. More...
Data Types | |
interface | integration_path_class |
Base class containing the parameters of the integration method to use. More... | |
interface | integration_path_gleg_class |
Subclass to use Gauss Legendre Quadrature. More... | |
interface | integration_path_hp_glep_class |
Subclass to use hp approch. More... | |
type | vertex |
A single point in space defined by an z, y, z coordinate. A vertex is structured as a singly linked list. More... | |
type | test_context |
A type for the test cases. More... | |
type | test_search_context |
A type for the test cases. More... | |
interface | path_construct |
Construction interface using path_construct_vertex. More... | |
interface | path_destruct |
Destruct interface using path_destruct_vertex. More... | |
interface | check |
Interface for checking the results of the unit tests. More... | |
Functions/Subroutines | |
class(integration_path_class) function, pointer | make_integrator (method, npoints, length) |
Factory method to construct a path integrator using a method. More... | |
class(integration_path_class) function, pointer | integration_path_construct () |
Construct an integration_path_class object. More... | |
class(integration_path_gleg_class) function, pointer | integration_path_gleg_construct (npoints) |
Construct an integration_path_class object. More... | |
class(integration_path_hp_glep_class) function, pointer | integration_path_hp_glep_construct (npoints, length) |
Construct an integration_path_class object. More... | |
type(vertex) function, pointer | path_construct_vertex (position) |
Construct a single vertex. More... | |
subroutine | integration_path_gleg_destruct (this) |
Deconstruct a integration_path_gleg_class object. More... | |
recursive subroutine | path_destruct_vertex (this) |
Deconstruct a vertex object. More... | |
recursive subroutine | path_append_vertex (this, position) |
Append a vertex to a path. More... | |
recursive real(rprec) function | integration_path_integrate_paths (this, path, context) |
Integrate along the paths. More... | |
recursive real(rprec) function, dimension(3) | search_paths (path, context, found) |
Search along the path. More... | |
real(rprec) function | integration_path_integrate_path (this, context, vertex1, vertex2) |
Line integrate between to points. More... | |
real(rprec) function | integration_path_gleg_integrate_path (this, context, vertex1, vertex2) |
Line integrate between to points. More... | |
real(rprec) function | integration_path_hp_gleg_integrate_path (this, context, vertex1, vertex2) |
Line integrate between to points. More... | |
subroutine | path_get_gaussqad_weights (a, b, abscissas, weights) |
@breif Calculate the weights and abscissas for Gauss-Legendre integration. More... | |
logical function | path_test () |
Path unit test function. More... | |
logical function | test_search_function (context, xcart1, xcart2) |
Call back function to test the search. More... | |
Variables | |
real(rprec), parameter | path_default_dx = 0.0025 |
Default step size of the integration. | |
Module is part of the LIBSTELL. This modules contains code to define and integrate along an arbitray path.
class (integration_path_class) function, pointer integration_path::integration_path_construct |
Construct an integration_path_class object.
class (integration_path_gleg_class) function, pointer integration_path::integration_path_gleg_construct | ( | integer, intent(in) | npoints | ) |
Construct an integration_path_class object.
[in] | npoints | Number of quadrature points to use. |
subroutine integration_path::integration_path_gleg_destruct | ( | type (integration_path_gleg_class), intent(inout) | this | ) |
Deconstruct a integration_path_gleg_class object.
Deallocates memory and uninitializes a integration_path_gleg_class object.
[in,out] | this | A integration_path_gleg_class instance. |
real (rprec) function integration_path::integration_path_gleg_integrate_path | ( | class (integration_path_gleg_class), intent(in) | this, |
class (integration_path_context_class), intent(in) | context, | ||
type (vertex), intent(in) | vertex1, | ||
type (vertex), intent(in) | vertex2 | ||
) |
Line integrate between to points.
This chooses the specific integration method.
[in] | this | In instance of a integration_path_class instance. |
[in] | context | Generic object that contains data for the integration function. |
[in] | vertex1 | Starting point. |
[in] | vertex2 | Ending point. |
real (rprec) function integration_path::integration_path_hp_gleg_integrate_path | ( | class (integration_path_hp_glep_class), intent(in) | this, |
class (integration_path_context_class), intent(in) | context, | ||
type (vertex), intent(in) | vertex1, | ||
type (vertex), intent(in) | vertex2 | ||
) |
Line integrate between to points.
This chooses the specific integration method.
[in] | this | In instance of a integration_path_class instance. |
[in] | context | Generic object that contains data for the integration function. |
[in] | vertex1 | Starting point. |
[in] | vertex2 | Ending point. |
class (integration_path_hp_glep_class) function, pointer integration_path::integration_path_hp_glep_construct | ( | integer, intent(in) | npoints, |
real (rprec), intent(in) | length | ||
) |
Construct an integration_path_class object.
[in] | npoints | Number of quadrature points to use. |
[in] | length | Length of the interval. |
real (rprec) function integration_path::integration_path_integrate_path | ( | class (integration_path_class), intent(in) | this, |
class (integration_path_context_class), intent(in) | context, | ||
type (vertex), intent(in) | vertex1, | ||
type (vertex), intent(in) | vertex2 | ||
) |
Line integrate between to points.
This chooses the specific integration method.
[in] | this | In instance of a integration_path_class instance. |
[in] | context | Generic object that contains data for the integration function. |
[in] | vertex1 | Starting point. |
[in] | vertex2 | Ending point. |
recursive real (rprec) function integration_path::integration_path_integrate_paths | ( | class (integration_path_class), intent(in) | this, |
type (vertex), intent(in) | path, | ||
class (integration_path_context_class), intent(in) | context | ||
) |
Integrate along the paths.
Recursively runs through the next vertex to find the last vertex. Once the last vertex is found, integrate alone that path. The integrand is proveded by means of call back function.
[in] | this | In instance of a integration_path_class instance. |
[in] | path | Starting vertex to of the path to integrate. |
[in] | context | Generic object that contains data for the integration function. |
class (integration_path_class) function, pointer integration_path::make_integrator | ( | character (len=*), intent(in) | method, |
integer, intent(in) | npoints, | ||
real (rprec), intent(in) | length | ||
) |
Factory method to construct a path integrator using a method.
[in] | method | Integartion method to use. |
[in] | npoints | Number of quadrature points to use. |
[in] | length | Length of the interval. |
recursive subroutine integration_path::path_append_vertex | ( | type (vertex), pointer | this, |
real (rprec), dimension(3), intent(in) | position | ||
) |
Append a vertex to a path.
Recursively runs through the next vertex to find the last vertex. Once the last vertex is found, a new vertex is allocated and appended to the path. This allow works as a constructer and allocates the first vertex if needed.
[in,out] | this | Vertex to append path to. |
[in] | position | Cartesian position of the vertex object. |
type (vertex) function, pointer integration_path::path_construct_vertex | ( | real (rprec), dimension(3), intent(in) | position | ) |
recursive subroutine integration_path::path_destruct_vertex | ( | type (vertex), pointer | this | ) |
subroutine integration_path::path_get_gaussqad_weights | ( | real (rprec), intent(in) | a, |
real (rprec), intent(in) | b, | ||
real(rprec), dimension(:), intent(out) | abscissas, | ||
real(rprec), dimension(:), intent(out) | weights | ||
) |
@breif Calculate the weights and abscissas for Gauss-Legendre integration.
This suprogram calculated the weights and abscissas for Gauss-Legendre integration. The subroutine is adapted from NIMROD which was adapted from Numerical Recipies, 2ed., Cambridge Press.
[in] | a | Start point for integration. |
[in] | b | End point for integration. |
[out] | abscissas | Array of abscissas. |
[out] | weights | Array of weights. |
logical function integration_path::path_test |
Path unit test function.
This runs the associated unit tests and returns the result.
recursive real (rprec) function, dimension(3) integration_path::search_paths | ( | type (vertex), intent(in) | path, |
class (search_path_context_class), intent(in) | context, | ||
logical, intent(out) | found | ||
) |
Search along the path.
Recursively runs through the next vertex to find the last vertex. Once the last vertex is found, a new vertex is allocated and appended to the path. The integrand is proveded by means of call back function.
[in] | path | Starting vertex to begin search. |
[in] | context | Generic object that contains data for the integration function. |
[out] | found | Signals if the condition was met. |
logical function integration_path::test_search_function | ( | class (test_search_context), intent(in) | context, |
real (rprec), dimension(3), intent(in) | xcart1, | ||
real (rprec), dimension(3), intent(in) | xcart2 | ||
) |
Call back function to test the search.
Returns true if the positions bound the loaction we are looking for.
[in] | context | Generic object that contains data for the integration function. |
[in] | xcart1 | Lower test point. |
[in] | xcart2 | Higher test point. |