Symplectic tracking through curved three-dimensional fields by a method of generating functions | Synapse