I am trying to solve the equations of motion of a particle under a potential field E(\vec{r},\vec{v}) that depends both on the position and the velocity of the particle.
The equation is of the form:
\frac{df(\vec{r},\vec{v})}{dt} = \frac{\partial f(\vec{r},\vec{v})}{\partial \vec{v}} \frac{\partial E(\vec{r},\vec{v})}{\partial \vec{r}} - \frac{\partial f(\vec{r},\vec{v})}{\partial \vec{r}} \frac{\partial E(\vec{r},\vec{v})}{\partial \vec{v}}
The potential field doesn’t have a closed form - it is the result of another calculation that gives the field as a 6-dimensional matrix (specifically a numpy array) of the value of E for a set of values of \vec{r} and \vec{v}. The discretization of \vec{r} and \vec{v} is pre-deterined, and the values have to be interpolated onto the mesh elements.
I have been going over all the FEniCS documentation and questions/posts that I can find, but I don’t see any example of how to do this. Any help with this will be highly appreciated.
Many thanks!