V3FIT
Functions/Subroutines
coordinate_utilities Module Reference

Module is part of the LIBSTELL. This modules containes code to convert from different coordinate systems. More...

Functions/Subroutines

pure real(rprec) function, dimension(3), public cart_to_cyl (cart)
 Convert a point from cartes cartesian coordinates to cylindical coordinates. More...
 
pure real(rprec) function, dimension(3), public cyl_to_cart (cyl)
 Convert a point from cylindical coordinates to cartesian coordinates. More...
 
pure real(rprec) function, dimension(3), public cyl_to_cart_vec (cyl, vec)
 Convert vector from cylindical coordinates to cartesian coordinates. More...
 
pure real(rprec) function, dimension(3) cart_to_cyl_vec (cart, vec)
 Convert vector from cartesian coordinates to cylindical coordinates. More...
 
logical function, public cood_utils_test ()
 Coordinate utilities unit test function. More...
 
logical function, private check (expected, received, testNum, name)
 Check a value. More...
 

Detailed Description

Module is part of the LIBSTELL. This modules containes code to convert from different coordinate systems.

Function/Subroutine Documentation

◆ cart_to_cyl()

pure real (rprec) function, dimension(3), public coordinate_utilities::cart_to_cyl ( real (rprec), dimension(3), intent(in)  cart)

Convert a point from cartes cartesian coordinates to cylindical coordinates.

r = Sqrt(x*x + y*y) phi = atan(y/x) z = z

Parameters
[in]cartPoint in cartesian coordinates.
Returns
The point in cyclindical coordinates.

Definition at line 40 of file coordinate_utilities.f.

◆ cart_to_cyl_vec()

pure real (rprec) function, dimension(3) coordinate_utilities::cart_to_cyl_vec ( real (rprec), dimension(3), intent(in)  cart,
real (rprec), dimension(3), intent(in)  vec 
)

Convert vector from cartesian coordinates to cylindical coordinates.

[ v_r ] [ x/r y/r 0 ] [ v_x ] [ v_phi ] = [ -y/r x/r 0 ] * [ v_y ] [ v_z ] [ 0 0 1 ] [ v_z ]

Where r = Sqrt(x*x + y*y)

Note
Phi must be in radians.
Parameters
[in]cartPoint in cartesian coordinates.
[in]vecPoint in cartesian coordinates.
Returns
The point in cylindical coordinates.

Definition at line 126 of file coordinate_utilities.f.

◆ check()

logical function, private coordinate_utilities::check ( real (rprec), intent(in)  expected,
real (rprec), intent(in)  received,
integer, intent(in)  testNum,
character (len=*), intent(in)  name 
)
private

Check a value.

Checks that the expected value matches the recieved. Otherwise report an error.

Parameters
[in]expectedThe known value.
[in]receivedThe known test value.
[in]testNumThe number of the test.
[in]nameThe name of the test.
Returns
True if the check passes and false otherwise.

Definition at line 271 of file coordinate_utilities.f.

◆ cood_utils_test()

logical function, public coordinate_utilities::cood_utils_test

Coordinate utilities unit test function.

This runs the associated unit tests and returns the result.

Returns
True if the tests pass and false otherwise.

Definition at line 157 of file coordinate_utilities.f.

◆ cyl_to_cart()

pure real (rprec) function, dimension(3), public coordinate_utilities::cyl_to_cart ( real (rprec), dimension(3), intent(in)  cyl)

Convert a point from cylindical coordinates to cartesian coordinates.

x = r*cos(phi) y = r*sin(phi) z = z

Note
Phi must be in radians.
Parameters
[in]cylPoint in cylindical coordinates.
Returns
The point in cartesian coordinates.

Definition at line 67 of file coordinate_utilities.f.

◆ cyl_to_cart_vec()

pure real (rprec) function, dimension(3), public coordinate_utilities::cyl_to_cart_vec ( real (rprec), dimension(3), intent(in)  cyl,
real (rprec), dimension(3), intent(in)  vec 
)

Convert vector from cylindical coordinates to cartesian coordinates.

[ v_x ] [ cos[phi] -sin[phi] 0 ] [ v_r ] [ v_y ] = [ sin[phi] cos[phi] 0 ] * [ v_phi ] [ v_z ] [ 0 0 1 ] [ v_z ]

Note
Phi must be in radians.
Parameters
[in]cylPoint in cylindical coordinates.
[in]vecVector in cylindical coordinates.
Returns
The point in cartesian coordinates.

Definition at line 95 of file coordinate_utilities.f.