OK, I know this does not work:
[codebox]struct deriv
{
float * x;
float * dx;
float dxi[4];
};
struct p
{
float rho, drho;
};
[/codebox]
I can’t make x, dx in deriv point to rho, drho in p and expect the pointers to work in a compute kernel.
This is the way I typically build a Runge-Kutta 4 integrator. I iterate over an array of deriv objects instead of writing a custom integrator for struct p, which may have any number of differential equations, and there may be different variants of “p” being integrated in parallel.
Can someone propose an alternative method to accomplish a generic RK4 code without having to hand-code the RK4 integration routine for each differential equation? Right now I am at a loss for a good, clean way to do this, and I’m sure someone here has gone through this before…
Thanks,
philski