Stellarator-Tools
line_segment Module Reference

Module is part of the LIBSTELL. This module contains code to create a profile constructed of line sigments. These line segments are assumed to be specified such that xx(i) < xx(i + 1) More...

Functions/Subroutines

subroutine, public line_seg (x, y, xx, yy, n)
 Interpolate a point on a line. More...
 
subroutine, public line_seg_int (x, y, xx, yy, n)
 Integrate to a point on a line. More...
 
logical function, public line_seg_test ()
 Line segment unit test function. More...
 

Detailed Description

Module is part of the LIBSTELL. This module contains code to create a profile constructed of line sigments. These line segments are assumed to be specified such that xx(i) < xx(i + 1)

Function/Subroutine Documentation

◆ line_seg()

subroutine, public line_segment::line_seg ( real (rprec), intent(in)  x,
real (rprec), intent(out)  y,
real (rprec), dimension(:), intent(in)  xx,
real (rprec), dimension(:), intent(in)  yy,
integer, intent(in)  n 
)

Interpolate a point on a line.

Find the linearly interpolated value of y at position x from line sigments specified by yy(xx).

Parameters
[in]xX point to interpolate the line at.
[out]yThe value of the interpolated point.
[in]xxX positions defining the line segments.
[in]yyY positions defining the line segments.
[in]nNumber of points defining the line.

◆ line_seg_int()

subroutine, public line_segment::line_seg_int ( real (rprec), intent(in)  x,
real (rprec), intent(out)  y,
real (rprec), dimension(:), intent(in)  xx,
real (rprec), dimension(:), intent(in)  yy,
integer, intent(in)  n 
)

Integrate to a point on a line.

Find the linearly integrated value of y at position x from line sigments specified by yy(xx).

Parameters
[in]xX point to interpolate the line at.
[out]yThe value of the interpolated point.
[in]xxX positions defining the line segments.
[in]yyY positions defining the line segments.
[in]nNumber of points defining the line.

◆ line_seg_test()

logical function, public line_segment::line_seg_test

Line segment unit test function.

This runs the associated unit tests and returns the result.

Returns
True if the tests pass and false otherwise.