Using continuous gradients in lammps, any built-in tools avaliable?

Dear lammps users,
I was looking for a while and don’t see an obvious implementation route for the following:
I have a regular 3-D lattice (periodic, cubic I think is the proper terminology), in let’s say a numpy array. The points in this lattice represent the force gradient values. I would like to interpolate these values to use as an external force for particles in the simulation. The gradient does not evolve with time.

I don’t see an obvious tools to use here except writing my own fix. If anyone has any simpler suggestions that I wasn’t able to find I would be grateful for the help.

Thank you for all and any aid,
Jakub Jozefowicz

Can you be more specific about your gradient? If it is a simple function (such as linear, cubic, etc… with position) then LAMMPS can easily do this. If your gradient is highly non-uniform (for instance a complex electric field) it is still possible but is not as simple.

I will wait for your reply before before bombarding you with information.