static int f(realtype t, N_Vector u, N_Vector udot, void *user_data) { realtype *udata, *udotdata; UserData data; HYPRE_ParVector uhyp; HYPRE_ParVector udothyp; /* Extract hypre vectors */ uhyp = N_VGetVector_ParHyp(u); udothyp = N_VGetVector_ParHyp(udot); /* Access hypre vectors local data */ udata = hypre_VectorData(hypre_ParVectorLocalVector(uhyp)); udotdata = hypre_VectorData(hypre_ParVectorLocalVector(udothyp)); data = (UserData) user_data; /* Call ucomm to do inter-processor communication */ ucomm(t, u, data); /* Call fcalc to calculate all right-hand sides */ fcalc(t, udata, udotdata, data); return(0); }
static int f(realtype t, N_Vector u, N_Vector udot, void *f_data) { realtype *udata, *dudata; UserData data; udata = NV_DATA_P(u); dudata = NV_DATA_P(udot); data = (UserData) f_data; /* Call ucomm to do inter-processor communication */ ucomm(t, u, data); /* Call fcalc to calculate all right-hand sides */ fcalc(t, udata, dudata, data); return(0); }