Cartesius Library
points Module Reference

Implements points in different spaces and coordinate systems. More...

Data Types

interface  assignment(=)
 
interface  index_of_eqv_action
 
interface  index_of_eqv_action_frac
 
interface  operator(*)
 
interface  operator(.eqf.)
 
interface  operator(.eqft.)
 
interface  operator(.eqt.)
 
interface  operator(==)
 
type  point
 Contains the coordinates of a point relative to the local affine frame. More...
 
interface  point_array_to_list
 
interface  point_list_to_array
 
type  point_ptr
 
type  pointarray
 

Functions/Subroutines

subroutine point_to_point (p1, p2)
 Assigns the fields of one point to another. More...
 
subroutine tocartesian (this)
 Tranforms the coordinate system and coordinates to cartesian. More...
 
subroutine tospherical (this)
 Tranforms the coordinate system and coordinates to cartesian. More...
 
subroutine init_laboratory_frame (laboratory, system)
 Unified initializer for laboratory frame. Creates a laboratory frame with no displacement (r = [0,0,0]) and identity rotation (o = E3). Creates a new spaceTree and adds the new laboratory frame as its root. More...
 
subroutine add_child_point (parent_point, id, system, r, o, result_point)
 Adds a point as a child to the given point. Initailzes all fields of the point. More...
 
type(point) function, pointer getpointfromspacetree (tree, pointID)
 
type(node) function, pointer get_point_node (pPoint)
 Returns the node of the point in the spaceTree. More...
 
type(point) function, pointer getparentpoint (pPoint)
 
subroutine normalize_point_frac (pnt)
 Returns the point with shift coordinates between 0 and 1. If the shift is close to 1, it is assumed to be equal to 0. More...
 
type(point) function invert_point (pnt)
 Returns a point whose action on the original point produces the identity transformation. More...
 
type(point) function apply_point (point_a, point_b)
 Returns the combined affine transform given by the composition A ○ B. More...
 
logical function points_equal (point_a, point_b)
 Returns true if the affine transformations given by the two points are the same. More...
 
logical function points_equal_translation (point_a, point_b)
 Returns true if the translational part of the two points is the same. More...
 
logical function points_equal_wrapper (xpoint_a, xpoint_b)
 Wrapper for points_equal for calls with lists and trees. More...
 
logical function points_equal_fractional (point_a, point_b)
 Returns true if the affine transformations given by the two points are the same, up to fractional coordinates. More...
 
logical function points_equal_fractional_translation (point_a, point_b)
 Returns true if the translational part of the two points is the same, up to fractional coordinates. More...
 
logical function points_equal_fractional_wrapper (xpoint_a, xpoint_b)
 Wrapper for points_equal_fractional for calls with lists and trees. More...
 
integer function index_of_eqv_action_ptr (point_array, ref_action, orig_point)
 Returns the index of the element of point_array which sends orig_point to the same coordinates as ref_action. More...
 
integer function index_of_eqv_action_type (point_array, ref_action, orig_point)
 Returns the index of the element of point_array which sends orig_point to the same coordinates as ref_action. More...
 
integer function index_of_eqv_action_frac_ptr (point_array, ref_action, orig_point)
 Returns the index of the element of point_array which sends orig_point to the same coordinates as ref_action (up to translation) More...
 
integer function index_of_eqv_action_frac_type (point_array, ref_action, orig_point)
 Returns the index of the element of point_array which sends orig_point to the same coordinates as ref_action (up to translation) More...
 
subroutine reduce (somePoint)
 
type(point) function reducedaffinetransform_node (point_node)
 Returns the total affine transform from the given point's frame (contained in the given node) to the laboratory frame. More...
 
type(point) function reducedaffinetransform (somePoint)
 Returns the total affine transform from the given point's frame to the laboratory frame. More...
 
type(point) function localaffinetransform (somePoint)
 Returns the total affine transform from the laboratory frame to the given point's frame. More...
 
real function, dimension(3) reducedcoords (somePoint)
 Returns the coordinates of the point in the laboratory frame without changing the spaceTree structure. More...
 
real function, dimension(3) localcoords (somePoint, vec)
 Converts the coordinates of a point, given by vec, from the laboratory frame to the somePoint local frame. More...
 
real function, dimension(3, 3) reducedtransformmatrix_node (point_node)
 
real function, dimension(3, 3) reducedtransformmatrix (somePoint)
 Returns the total transformation matrix from the local frame to the laboratory frame. More...
 
real function, dimension(3, 3) localtransformmatrix (somePoint)
 Returns the total transformation matrix from the laboratory frame to the local frame. More...
 
real function, dimension(1:3) reducedtransform (somePoint, vec)
 Converts the given vector coordinates from the somePoint local frame to the laboratory frame by applying all spaceTree coordinate transformations successively. More...
 
real function, dimension(3) localtransform (somePoint, vec)
 Converts the given vector coordinates from the laboratory frame to the somePoint local frame by applying inverse spaceTree coordinate transformations successively. More...
 
subroutine reducecoordinates (somePoint)
 
subroutine reducetothesame (point1, point2)
 
subroutine reducecoordinatestothesame (point1, point2)
 
subroutine reducethreepointstothesame (point1, point2, point3)
 
subroutine reducethreepointscoordstothesame (point1, point2, point3)
 
real function distance (point1, point2)
 Returns the distance between two points. More...
 
real function distance_with_reducing (point1, point2)
 Returns the distance between the points, reducing them to the same spaceTree node. More...
 
real function angle (point1, point2, point3)
 Returns the angle formed by points 123. More...
 
real function angle_with_reducing (point1, point2, point3)
 Returns the angle formed by points 123, reducing them to the same spaceTree node. More...
 
subroutine write_spacetree_node_to_gnuplot (tree, handle)
 
subroutine write_spacetree_to_gnuplot (tree, filename)
 
subroutine print_spacetree (somePoint)
 
subroutine print_point_node_new (pNode, arg)
 
type(point) function, pointer point_from_polymorphic (x)
 Converts a polymorpihc pointer to a point pointer if possible, else returns a null-pointer. More...
 
subroutine point_list_to_array_alloc (point_list, point_array)
 
subroutine point_list_to_array_ptr_alloc (point_list, point_array)
 
subroutine point_list_to_array_type (point_list, point_array)
 
subroutine point_array_alloc_to_list (point_array, point_list)
 
subroutine point_array_ptr_alloc_to_list (point_array, point_list)
 
subroutine point_array_type_to_list (point_array, point_list)
 
subroutine deallocate_point (pValue)
 Deallocates the given point. Does not deallocate its spaceTree. More...
 

Variables

character(len=9), parameter, public key_cartesian = 'cartesian'
 
character(len=9), parameter, public key_spherical = 'spherical'
 
character(len=11), parameter, public key_cylindrical = 'cylindrical'
 

Detailed Description

Implements points in different spaces and coordinate systems.

Author
???

Function/Subroutine Documentation

◆ add_child_point()

subroutine points::add_child_point ( class(point), intent(in)  parent_point,
character(len = *), intent(in)  id,
character(len = *), intent(in), optional  system,
real, dimension(3), intent(in), optional  r,
real, dimension(3,3), intent(in), optional  o,
type(point), intent(out), optional, pointer  result_point 
)

Adds a point as a child to the given point. Initailzes all fields of the point.

Parameters
id[in] Identifier of the new point. Normally should end with 'point'.
system[in, optional] Type of coordinate system of the new point. Defaults to cartesian.
r[in, optional] Coordinate shift relative to the parent. Defaults to zero.
o[in, optional] Transformation matrix applied to (possible) children of the new point. Defaults to identity.
result_point[out, optional] Pointer to the newly created point.
Todo:
Rewrite library to automatically add 'point' to ends of all point IDs
Here is the call graph for this function:

◆ angle()

real function points::angle ( type(point), intent(in)  point1,
type(point), intent(in)  point2,
type(point), intent(in)  point3 
)

Returns the angle formed by points 123.

Here is the call graph for this function:

◆ angle_with_reducing()

real function points::angle_with_reducing ( type(point), intent(inout)  point1,
type(point), intent(inout)  point2,
type(point), intent(inout)  point3 
)

Returns the angle formed by points 123, reducing them to the same spaceTree node.

Warning
See the warning for the 'distance' function
Here is the call graph for this function:

◆ apply_point()

type(point) function points::apply_point ( type(point), intent(in)  point_a,
type(point), intent(in)  point_b 
)

Returns the combined affine transform given by the composition A ○ B.

◆ deallocate_point()

subroutine points::deallocate_point ( class(*), intent(inout), pointer  pValue)

Deallocates the given point. Does not deallocate its spaceTree.

◆ distance()

real function points::distance ( type(point), intent(inout)  point1,
type(point), intent(inout)  point2 
)

Returns the distance between two points.

Warning
DR Reducing the coordinates of the two points to the same space in the spaceTree does not guarantee their coordinate systems will both become cartesian. Am I missing something or do we need to add a toCartesian subroutine?
Here is the call graph for this function:

◆ distance_with_reducing()

real function points::distance_with_reducing ( type(point), intent(inout)  point1,
type(point), intent(inout)  point2 
)

Returns the distance between the points, reducing them to the same spaceTree node.

Warning
See the warning for the 'distance' function
Here is the call graph for this function:

◆ get_point_node()

type(node) function, pointer points::get_point_node ( class(point), intent(in)  pPoint)

Returns the node of the point in the spaceTree.

Todo:
Remove get_point_node and make sure every point knows its node by construction. E.g. by always using add_child_point
Here is the call graph for this function:

◆ getparentpoint()

type(point) function, pointer points::getparentpoint ( type(point), intent(in)  pPoint)
Here is the call graph for this function:

◆ getpointfromspacetree()

type(point) function, pointer points::getpointfromspacetree ( type(node), intent(inout)  tree,
character(len=*), intent(in)  pointID 
)
Here is the call graph for this function:

◆ index_of_eqv_action_frac_ptr()

integer function points::index_of_eqv_action_frac_ptr ( type(point_ptr), dimension(:), intent(in)  point_array,
type(point), intent(in)  ref_action,
type(point), intent(in)  orig_point 
)

Returns the index of the element of point_array which sends orig_point to the same coordinates as ref_action (up to translation)

◆ index_of_eqv_action_frac_type()

integer function points::index_of_eqv_action_frac_type ( class(pointarray), intent(in)  point_array,
type(point), intent(in)  ref_action,
type(point), intent(in)  orig_point 
)

Returns the index of the element of point_array which sends orig_point to the same coordinates as ref_action (up to translation)

◆ index_of_eqv_action_ptr()

integer function points::index_of_eqv_action_ptr ( type(point_ptr), dimension(:), intent(in)  point_array,
type(point), intent(in)  ref_action,
type(point), intent(in)  orig_point 
)

Returns the index of the element of point_array which sends orig_point to the same coordinates as ref_action.

◆ index_of_eqv_action_type()

integer function points::index_of_eqv_action_type ( class(pointarray), intent(in)  point_array,
type(point), intent(in)  ref_action,
type(point), intent(in)  orig_point 
)

Returns the index of the element of point_array which sends orig_point to the same coordinates as ref_action.

◆ init_laboratory_frame()

subroutine points::init_laboratory_frame ( type(point), intent(inout), target  laboratory,
character(len=*), intent(in), optional  system 
)

Unified initializer for laboratory frame. Creates a laboratory frame with no displacement (r = [0,0,0]) and identity rotation (o = E3). Creates a new spaceTree and adds the new laboratory frame as its root.

Parameters
system[in, optional]
Here is the call graph for this function:

◆ invert_point()

type(point) function points::invert_point ( type(point), intent(in)  pnt)

Returns a point whose action on the original point produces the identity transformation.

Here is the call graph for this function:

◆ localaffinetransform()

type(point) function points::localaffinetransform ( type(point), intent(in)  somePoint)

Returns the total affine transform from the laboratory frame to the given point's frame.

Here is the call graph for this function:

◆ localcoords()

real function, dimension(3) points::localcoords ( type(point), intent(in)  somePoint,
real, dimension(3), intent(in)  vec 
)

Converts the coordinates of a point, given by vec, from the laboratory frame to the somePoint local frame.

Here is the call graph for this function:

◆ localtransform()

real function, dimension(3) points::localtransform ( type(point), intent(in)  somePoint,
real, dimension(3), intent(in)  vec 
)

Converts the given vector coordinates from the laboratory frame to the somePoint local frame by applying inverse spaceTree coordinate transformations successively.

Here is the call graph for this function:

◆ localtransformmatrix()

real function, dimension(3,3) points::localtransformmatrix ( type(point), intent(in)  somePoint)

Returns the total transformation matrix from the laboratory frame to the local frame.

Here is the call graph for this function:

◆ normalize_point_frac()

subroutine points::normalize_point_frac ( type(point), intent(inout)  pnt)

Returns the point with shift coordinates between 0 and 1. If the shift is close to 1, it is assumed to be equal to 0.

◆ point_array_alloc_to_list()

subroutine points::point_array_alloc_to_list ( type(point), dimension(:), intent(in), allocatable  point_array,
type(list), intent(out)  point_list 
)

◆ point_array_ptr_alloc_to_list()

subroutine points::point_array_ptr_alloc_to_list ( type(point_ptr), dimension(:), intent(in), allocatable  point_array,
type(list), intent(out)  point_list 
)

◆ point_array_type_to_list()

subroutine points::point_array_type_to_list ( type(pointarray), intent(in)  point_array,
type(list), intent(out)  point_list 
)

◆ point_from_polymorphic()

type(point) function, pointer points::point_from_polymorphic ( class(*), intent(in), pointer  x)

Converts a polymorpihc pointer to a point pointer if possible, else returns a null-pointer.

◆ point_list_to_array_alloc()

subroutine points::point_list_to_array_alloc ( type(list), intent(in)  point_list,
type(point), dimension(:), intent(out), allocatable  point_array 
)

◆ point_list_to_array_ptr_alloc()

subroutine points::point_list_to_array_ptr_alloc ( type(list), intent(in)  point_list,
type(point_ptr), dimension(:), intent(out), allocatable  point_array 
)

◆ point_list_to_array_type()

subroutine points::point_list_to_array_type ( type(list), intent(in)  point_list,
type(pointarray), intent(out)  point_array 
)

◆ point_to_point()

subroutine points::point_to_point ( type(point), intent(out)  p1,
type(point), intent(in)  p2 
)

Assigns the fields of one point to another.

◆ points_equal()

logical function points::points_equal ( type(point), intent(in)  point_a,
type(point), intent(in)  point_b 
)

Returns true if the affine transformations given by the two points are the same.

◆ points_equal_fractional()

logical function points::points_equal_fractional ( type(point), intent(in)  point_a,
type(point), intent(in)  point_b 
)

Returns true if the affine transformations given by the two points are the same, up to fractional coordinates.

◆ points_equal_fractional_translation()

logical function points::points_equal_fractional_translation ( type(point), intent(in)  point_a,
type(point), intent(in)  point_b 
)

Returns true if the translational part of the two points is the same, up to fractional coordinates.

◆ points_equal_fractional_wrapper()

logical function points::points_equal_fractional_wrapper ( class(*), intent(in)  xpoint_a,
class(*), intent(in)  xpoint_b 
)

Wrapper for points_equal_fractional for calls with lists and trees.

Here is the call graph for this function:

◆ points_equal_translation()

logical function points::points_equal_translation ( type(point), intent(in)  point_a,
type(point), intent(in)  point_b 
)

Returns true if the translational part of the two points is the same.

◆ points_equal_wrapper()

logical function points::points_equal_wrapper ( class(*), intent(in)  xpoint_a,
class(*), intent(in)  xpoint_b 
)

Wrapper for points_equal for calls with lists and trees.

Here is the call graph for this function:

◆ print_point_node_new()

subroutine points::print_point_node_new ( type(node), intent(inout)  pNode,
class(*), intent(inout), pointer  arg 
)

◆ print_spacetree()

subroutine points::print_spacetree ( type(point), intent(inout)  somePoint)

◆ reduce()

subroutine points::reduce ( type(point), intent(inout)  somePoint)
Attention
What is a spaceTree and how does it play into reducing the coordinates to the laboratory frame?
Warning
DR This procedure changes the structure of the spaceTree irreversibly. What are the repecussions of not preserving it?

◆ reducecoordinates()

subroutine points::reducecoordinates ( type(point), intent(inout)  somePoint)
Warning
DR This procedure changes the coordinates of the point without changing its spaceTree, and the reverse function is not implemented. Should not be used with pointer arguments.

◆ reducecoordinatestothesame()

subroutine points::reducecoordinatestothesame ( type(point), intent(inout)  point1,
type(point), intent(inout)  point2 
)
Warning
@see reduceCoordinates
Here is the call graph for this function:

◆ reducedaffinetransform()

type(point) function points::reducedaffinetransform ( type(point), intent(in)  somePoint)

Returns the total affine transform from the given point's frame to the laboratory frame.

Here is the call graph for this function:

◆ reducedaffinetransform_node()

type(point) function points::reducedaffinetransform_node ( type(node), intent(in)  point_node)

Returns the total affine transform from the given point's frame (contained in the given node) to the laboratory frame.

Here is the call graph for this function:

◆ reducedcoords()

real function, dimension(3) points::reducedcoords ( type(point), intent(in)  somePoint)

Returns the coordinates of the point in the laboratory frame without changing the spaceTree structure.

Here is the call graph for this function:

◆ reducedtransform()

real function, dimension(1:3) points::reducedtransform ( type(point), intent(in)  somePoint,
real, dimension(1:3), intent(in), optional  vec 
)

Converts the given vector coordinates from the somePoint local frame to the laboratory frame by applying all spaceTree coordinate transformations successively.

◆ reducedtransformmatrix()

real function, dimension(3,3) points::reducedtransformmatrix ( type(point), intent(in)  somePoint)

Returns the total transformation matrix from the local frame to the laboratory frame.

Here is the call graph for this function:

◆ reducedtransformmatrix_node()

real function, dimension(3,3) points::reducedtransformmatrix_node ( type(node), intent(in)  point_node)
Here is the call graph for this function:

◆ reducethreepointscoordstothesame()

subroutine points::reducethreepointscoordstothesame ( type(point), intent(inout)  point1,
type(point), intent(inout)  point2,
type(point), intent(inout)  point3 
)
Warning
@see reduceCoordinates
Here is the call graph for this function:

◆ reducethreepointstothesame()

subroutine points::reducethreepointstothesame ( type(point), intent(inout)  point1,
type(point), intent(inout)  point2,
type(point), intent(inout)  point3 
)
Warning
DR This procedure changes the structure of the spaceTree irreversibly.
Here is the call graph for this function:

◆ reducetothesame()

subroutine points::reducetothesame ( type(point), intent(inout)  point1,
type(point), intent(inout)  point2 
)
Warning
DR This procedure changes the structure of the spaceTree irreversibly.
Here is the call graph for this function:

◆ tocartesian()

subroutine points::tocartesian ( class(point), intent(inout)  this)

Tranforms the coordinate system and coordinates to cartesian.

◆ tospherical()

subroutine points::tospherical ( type(point), intent(inout)  this)

Tranforms the coordinate system and coordinates to cartesian.

◆ write_spacetree_node_to_gnuplot()

subroutine points::write_spacetree_node_to_gnuplot ( type(node), intent(inout)  tree,
class(*), intent(inout), pointer  handle 
)
Here is the call graph for this function:

◆ write_spacetree_to_gnuplot()

subroutine points::write_spacetree_to_gnuplot ( type(node), intent(inout)  tree,
character(len=*), intent(in), optional  filename 
)
Here is the call graph for this function:

Variable Documentation

◆ key_cartesian

character(len=9), parameter, public points::key_cartesian = 'cartesian'

◆ key_cylindrical

character(len=11), parameter, public points::key_cylindrical = 'cylindrical'

◆ key_spherical

character(len=9), parameter, public points::key_spherical = 'spherical'