# Tonti Diagrams

`AlgebraicDynamics.Tonti.TontiDiagram`

— TypeConstructor for Tonti Diagram

This constructor generates an empty Tonti diagram of a given dimension. The dimensionality determines which spatial elements will be included in the data structure.

`AlgebraicDynamics.Tonti.TontiDiagram`

— MethodConstructor for Tonti Diagram with variables

This constructor accepts variables which are each associated with a corner.

`AlgebraicDynamics.Tonti.addBC!`

— MethodAdds a boundary condition to a Tonti Diagram

TODO: Extend this to beyond a mask over certain values. Currently this allows for constant boundaries by applying a mask to the vectorfield result, but this does not generalize to all mathematical boundary conditions.

`AlgebraicDynamics.Tonti.addSpace!`

— MethodAdds topological transformations to a 1D Tonti Diagram

Note that since the complex is not embedded, we are unable to use a true dual derivative.

`AlgebraicDynamics.Tonti.addSpace!`

— MethodAdds topological transformations to a 2D Tonti Diagram

Note that since the complex is not embedded, we are unable to use a true dual derivative.

TODO: These should be able to be removed, but considerations must be made for what it means for a particle system to exist on an embedded complex.

`AlgebraicDynamics.Tonti.addSpace!`

— MethodAdds topological transformations to a 2D Tonti Diagram (from an embedded complex)

`AlgebraicDynamics.Tonti.addTime!`

— MethodAdds temporal transformations to a Tonti Diagram

Currently all temporal transformations simply apply Euler's method. When attached to DifferentialEquations, more complex timestepping can be accomplished.

TODO: Develop more time-stepping techniques for the Tonti diagram structure

`AlgebraicDynamics.Tonti.addTransform!`

— MethodAdds a transformation to the Tonti diagram between given variables

This expects a Julia function which will take as input an array of values the length of argument `dom`

and will return an array the length of argument `codom`

. The order of variables passed to and recieved from `func`

is determined by the order in `dom`

and `codom`

.

`AlgebraicDynamics.Tonti.addTransform!`

— MethodAdds a transformation to the Tonti diagram between given variables

TODO: Remove this function, since hodge-star is not defined element-wise and cannot be added at this step.

`AlgebraicDynamics.Tonti.disj_union`

— MethodConstructs a Tonti diagram from two source Tonti diagrams, combining over the corners.

The result Tonti diagram contains all information from the independent Tonti diagrams and with variables on the same corners as before.

TODO: Make this accept a UWD so that tonti diagrams can be joined over shared variables as well (also just provides a cleaner joining interface)

`AlgebraicDynamics.Tonti.gen_form`

— MethodConstruct a 0-form based on a scalar function

This operator accepts a scalar function and evaulates it at each point on the simplex, returning a 0-form.

`AlgebraicDynamics.Tonti.vectorfield`

— MethodGenerates a vectorfield for simulation of a system given a Tonti diagram

This function performs a topological sort to determine dependencies between variables (forgetting the temporal transformations). It then determines the necessary set of state variables to define the value of each variable for each time step.

TODO: Convert dependencies to Graph in Catlab and take advantage of the topological sort tooling from there. Will significantly reduce the size of this function.