|
|
@@ -1135,30 +1135,12 @@ static int residueKS(N_Vector yp, N_Vector res, void *user_data) |
|
|
|
static void lookupDpdt(UserData data, realtype t, realtype *P, realtype *dPdt) |
|
|
|
{ |
|
|
|
|
|
|
|
realtype *tData, *PData, *dPdtData; |
|
|
|
tData = N_VGetArrayPointer_Serial(data->tArray); |
|
|
|
PData = N_VGetArrayPointer_Serial(data->PArray); |
|
|
|
realtype *dPdtData; |
|
|
|
dPdtData = N_VGetArrayPointer_Serial(data->dPdtArray); |
|
|
|
int jguess=data->jguess; |
|
|
|
int k=0; |
|
|
|
int safel=0; |
|
|
|
int nOrder=4; |
|
|
|
|
|
|
|
realtype dy; |
|
|
|
int npts=data->tArraySize; |
|
|
|
|
|
|
|
if(t<=data->t1){ |
|
|
|
//k=hunt(t, tData, npts, jguess); |
|
|
|
////printf("Desired value at %d: %15.6e\t%15.6e\t%15.6e\n",k,t,P(k),dPdt(k)); |
|
|
|
//safel=IMIN(IMAX(k-(nOrder)/2,0),data->tArraySize+1-nOrder-1); |
|
|
|
//data->jguess=safel; |
|
|
|
////printf("safel %d: \n",safel); |
|
|
|
////printf("safel val %15.6e: \n",*(tData+safel)); |
|
|
|
//polint(tData+safel-1, PData+safel-1, nOrder+1, t, P, &dy); |
|
|
|
////printf("P error %15.6e: \n",dy); |
|
|
|
//polint(tData+safel-1, dPdtData+safel-1, nOrder+1, t, dPdt, &dy); |
|
|
|
////printf("dPdt error %15.6e: \n",dy); |
|
|
|
//// |
|
|
|
|
|
|
|
*P=gsl_spline_eval(data->spline,t,data->acc); |
|
|
|
*dPdt=gsl_spline_eval(data->splinedot,t,data->accdot); |
|
|
|