Geometry Module

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

The purpose of this object is to provide a Curve object with a custom iterator allowing for the Birkhoff algorithm to be applied.

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.

energy

float

The total Hamiltonian energy to be used in the simulation.

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 nodes in the curve.

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.

configuration

dict

A dictionary containing the information from the configuration file.

__init__(start_point, end_point, number_of_nodes, energy)[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.
  • energy (float) – The total Hamiltonian energy to be used in the simulation.
__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.
Return type:bool
get_points()[source]

Accessor method for the points attribute.

Returns:An array containing all of the points of the curve.
Return type: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.
Return type: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.
geometricmd.geometry.convert_atoms_to_vector(atoms)[source]

Converts an Atomistic Simulation Environment atoms object into a vector which can be used with the curve shortening algorithm.

Parameters:atoms (ase.atoms) – The ASE atoms object whose position is to be converted to a vector.
Returns:A vector of atomistic positions.
Return type:numpy.array
geometricmd.geometry.convert_vector_to_atoms(vector, dimension=3)[source]

The inverse of convert_atoms_to_vector.

Parameters:
  • vector (numpy.array) – The vector containing the position of the atoms to be converted.
  • dimension (optional int) – The dimension of the space in which the simulation is taking place. The default value is 3.
Returns:

An ASE atoms object friendly NumPy array containing the atomistic positions.

Return type:

numpy.array

References

[Sutton2013]Microscopic Hamiltonian Systems and their Effective Description, Daniel C. Sutton, 2013.