# Geometry Module¶

class geodesic.geometry.Curve(start_point, end_point, number_of_nodes)[source]

The purpose of this object is to provide a Curve object with a custom iterator to perform the Birkhoff algorithm.

start_point

numpy.array

A NumPy array describing the first point in the curve.

end_point

numpy.array

A NumPy array describing the last point in the curve.

number_of_nodes

int

The total number of nodes that the curve is to consist of, including the start and end points.

tangent

numpy.array

The tangent of the straight line segment joining the start_point to the end_point.

points

numpy.array

An NumPy array containing all the points of the curve.

default_initial_state

numpy.array

A NumPy array consisting of flags that indicate which nodes are movable initially.

movement

float

A variable which records the average movement of the nodes.

nodes_moved

numpy.array

A binary NumPy array indicating whether a node has been moved. Used to determine when all the nodes in the curve have been moved.

node_movable

numpy.array

A binary NumPy array indicating whether a node is movable.

number_of_distinct_nodes_moved

int

A counter recording the total number of nodes that have moved.

__init__(start_point, end_point, number_of_nodes)[source]

The constructor for the Curve class.

Parameters: start_point (ase.atoms) – An ASE atoms object describing the initial state. A calculator needs to be set on this object. end_point (ase.atoms) – An ASE atoms object describing the final state. number_of_nodes (int) – The number of nodes that the curve is to consist of, including the start and end points.
__iter__()[source]

This special method ensures a curve object is iterable.

Returns: self
all_nodes_moved()[source]

This method determines whether every node in the global curve has been tested for length reduction.

Returns: True if all of the nodes have been tested, False otherwise. bool
get_points()[source]

Accessor method for the points attribute.

Returns: An array containing all of the points of the curve. numpy.array
next()[source]
Determine next movable node, given existing information about previously distributed nodes. Used to ensure
the curve object is Python iterable.
Returns: The node number of the next movable node. If no such node exists then it returns None. int
set_node_movable()[source]

Resets all of the flags in the curve to indicate that the current iteration of the Birkhoff algorithm is over.

set_node_position(node_number, new_position)[source]

Update the position of the node at node_number to new_position. This processes the logic for releasing neighbouring nodes for further computation.

Parameters: node_number (int) – The node number of the node whose position is to be updated. new_position (numpy.array) – The new position of the node.