Lines Matching refs:pdata

42                            void *pdata);
46 N_Vector vv, void *pdata);
52 static int KBBDDQJac(KBBDPrecData pdata,
71 KBBDPrecData pdata; in KINBBDPrecInit() local
100 pdata = NULL; in KINBBDPrecInit()
101 pdata = (KBBDPrecData) malloc(sizeof *pdata); in KINBBDPrecInit()
102 if (pdata == NULL) { in KINBBDPrecInit()
109 pdata->kin_mem = kinmem; in KINBBDPrecInit()
110 pdata->gloc = gloc; in KINBBDPrecInit()
111 pdata->gcomm = gcomm; in KINBBDPrecInit()
112 pdata->mudq = SUNMIN(Nlocal-1, SUNMAX(0, mudq)); in KINBBDPrecInit()
113 pdata->mldq = SUNMIN(Nlocal-1, SUNMAX(0, mldq)); in KINBBDPrecInit()
116 pdata->mukeep = muk; in KINBBDPrecInit()
117 pdata->mlkeep = mlk; in KINBBDPrecInit()
123 pdata->PP = NULL; in KINBBDPrecInit()
124 pdata->PP = SUNBandMatrixStorage(Nlocal, muk, mlk, storage_mu); in KINBBDPrecInit()
125 if (pdata->PP == NULL) { in KINBBDPrecInit()
126 free(pdata); pdata = NULL; in KINBBDPrecInit()
133 pdata->zlocal = NULL; in KINBBDPrecInit()
134 pdata->zlocal = N_VNew_Serial(Nlocal); in KINBBDPrecInit()
135 if (pdata->zlocal == NULL) { in KINBBDPrecInit()
136 SUNMatDestroy(pdata->PP); in KINBBDPrecInit()
137 free(pdata); pdata = NULL; in KINBBDPrecInit()
143 pdata->rlocal = NULL; in KINBBDPrecInit()
144 pdata->rlocal = N_VNewEmpty_Serial(Nlocal); /* empty vector */ in KINBBDPrecInit()
145 if (pdata->rlocal == NULL) { in KINBBDPrecInit()
146 N_VDestroy(pdata->zlocal); in KINBBDPrecInit()
147 SUNMatDestroy(pdata->PP); in KINBBDPrecInit()
148 free(pdata); pdata = NULL; in KINBBDPrecInit()
154 pdata->tempv1 = NULL; in KINBBDPrecInit()
155 pdata->tempv1 = N_VClone(kin_mem->kin_vtemp1); in KINBBDPrecInit()
156 if (pdata->tempv1 == NULL) { in KINBBDPrecInit()
157 N_VDestroy(pdata->zlocal); in KINBBDPrecInit()
158 N_VDestroy(pdata->rlocal); in KINBBDPrecInit()
159 SUNMatDestroy(pdata->PP); in KINBBDPrecInit()
160 free(pdata); pdata = NULL; in KINBBDPrecInit()
166 pdata->tempv2 = NULL; in KINBBDPrecInit()
167 pdata->tempv2 = N_VClone(kin_mem->kin_vtemp1); in KINBBDPrecInit()
168 if (pdata->tempv2 == NULL) { in KINBBDPrecInit()
169 N_VDestroy(pdata->zlocal); in KINBBDPrecInit()
170 N_VDestroy(pdata->rlocal); in KINBBDPrecInit()
171 N_VDestroy(pdata->tempv1); in KINBBDPrecInit()
172 SUNMatDestroy(pdata->PP); in KINBBDPrecInit()
173 free(pdata); pdata = NULL; in KINBBDPrecInit()
179 pdata->tempv3 = NULL; in KINBBDPrecInit()
180 pdata->tempv3 = N_VClone(kin_mem->kin_vtemp1); in KINBBDPrecInit()
181 if (pdata->tempv3 == NULL) { in KINBBDPrecInit()
182 N_VDestroy(pdata->zlocal); in KINBBDPrecInit()
183 N_VDestroy(pdata->rlocal); in KINBBDPrecInit()
184 N_VDestroy(pdata->tempv1); in KINBBDPrecInit()
185 N_VDestroy(pdata->tempv2); in KINBBDPrecInit()
186 SUNMatDestroy(pdata->PP); in KINBBDPrecInit()
187 free(pdata); pdata = NULL; in KINBBDPrecInit()
194 pdata->LS = NULL; in KINBBDPrecInit()
195 pdata->LS = SUNLinSol_Band(pdata->zlocal, pdata->PP); in KINBBDPrecInit()
196 if (pdata->LS == NULL) { in KINBBDPrecInit()
197 N_VDestroy(pdata->zlocal); in KINBBDPrecInit()
198 N_VDestroy(pdata->rlocal); in KINBBDPrecInit()
199 N_VDestroy(pdata->tempv1); in KINBBDPrecInit()
200 N_VDestroy(pdata->tempv2); in KINBBDPrecInit()
201 N_VDestroy(pdata->tempv3); in KINBBDPrecInit()
202 SUNMatDestroy(pdata->PP); in KINBBDPrecInit()
203 free(pdata); pdata = NULL; in KINBBDPrecInit()
210 flag = SUNLinSolInitialize(pdata->LS); in KINBBDPrecInit()
212 N_VDestroy(pdata->zlocal); in KINBBDPrecInit()
213 N_VDestroy(pdata->rlocal); in KINBBDPrecInit()
214 N_VDestroy(pdata->tempv1); in KINBBDPrecInit()
215 N_VDestroy(pdata->tempv2); in KINBBDPrecInit()
216 N_VDestroy(pdata->tempv3); in KINBBDPrecInit()
217 SUNMatDestroy(pdata->PP); in KINBBDPrecInit()
218 SUNLinSolFree(pdata->LS); in KINBBDPrecInit()
219 free(pdata); pdata = NULL; in KINBBDPrecInit()
226 pdata->rel_uu = (dq_rel_uu > ZERO) ? dq_rel_uu : SUNRsqrt(kin_mem->kin_uround); in KINBBDPrecInit()
229 pdata->n_local = Nlocal; in KINBBDPrecInit()
232 pdata->rpwsize = 0; in KINBBDPrecInit()
233 pdata->ipwsize = 0; in KINBBDPrecInit()
236 pdata->rpwsize += 3*lrw1; in KINBBDPrecInit()
237 pdata->ipwsize += 3*liw1; in KINBBDPrecInit()
239 if (pdata->zlocal->ops->nvspace) { in KINBBDPrecInit()
240 N_VSpace(pdata->zlocal, &lrw1, &liw1); in KINBBDPrecInit()
241 pdata->rpwsize += lrw1; in KINBBDPrecInit()
242 pdata->ipwsize += liw1; in KINBBDPrecInit()
244 if (pdata->rlocal->ops->nvspace) { in KINBBDPrecInit()
245 N_VSpace(pdata->rlocal, &lrw1, &liw1); in KINBBDPrecInit()
246 pdata->rpwsize += lrw1; in KINBBDPrecInit()
247 pdata->ipwsize += liw1; in KINBBDPrecInit()
249 if (pdata->PP->ops->space) { in KINBBDPrecInit()
250 flag = SUNMatSpace(pdata->PP, &lrw, &liw); in KINBBDPrecInit()
251 pdata->rpwsize += lrw; in KINBBDPrecInit()
252 pdata->ipwsize += liw; in KINBBDPrecInit()
254 if (pdata->LS->ops->space) { in KINBBDPrecInit()
255 flag = SUNLinSolSpace(pdata->LS, &lrw, &liw); in KINBBDPrecInit()
256 pdata->rpwsize += lrw; in KINBBDPrecInit()
257 pdata->ipwsize += liw; in KINBBDPrecInit()
259 pdata->nge = 0; in KINBBDPrecInit()
266 kinls_mem->pdata = pdata; in KINBBDPrecInit()
288 KBBDPrecData pdata; in KINBBDPrecGetWorkSpace() local
304 if (kinls_mem->pdata == NULL) { in KINBBDPrecGetWorkSpace()
309 pdata = (KBBDPrecData) kinls_mem->pdata; in KINBBDPrecGetWorkSpace()
311 *lenrwBBDP = pdata->rpwsize; in KINBBDPrecGetWorkSpace()
312 *leniwBBDP = pdata->ipwsize; in KINBBDPrecGetWorkSpace()
325 KBBDPrecData pdata; in KINBBDPrecGetNumGfnEvals() local
341 if (kinls_mem->pdata == NULL) { in KINBBDPrecGetNumGfnEvals()
346 pdata = (KBBDPrecData) kinls_mem->pdata; in KINBBDPrecGetNumGfnEvals()
348 *ngevalsBBDP = pdata->nge; in KINBBDPrecGetNumGfnEvals()
387 KBBDPrecData pdata; in KINBBDPrecSetup() local
391 pdata = (KBBDPrecData) bbd_data; in KINBBDPrecSetup()
393 kin_mem = (KINMem) pdata->kin_mem; in KINBBDPrecSetup()
396 retval = SUNMatZero(pdata->PP); in KINBBDPrecSetup()
403 retval = KBBDDQJac(pdata, uu, uscale, in KINBBDPrecSetup()
404 pdata->tempv1, pdata->tempv2, pdata->tempv3); in KINBBDPrecSetup()
412 retval = SUNLinSolSetup_Band(pdata->LS, pdata->PP); in KINBBDPrecSetup()
450 KBBDPrecData pdata; in KINBBDPrecSolve() local
455 pdata = (KBBDPrecData) bbd_data; in KINBBDPrecSolve()
459 zd = N_VGetArrayPointer(pdata->zlocal); in KINBBDPrecSolve()
462 N_VSetArrayPointer(vd, pdata->rlocal); in KINBBDPrecSolve()
465 retval = SUNLinSolSolve(pdata->LS, pdata->PP, pdata->zlocal, in KINBBDPrecSolve()
466 pdata->rlocal, ZERO); in KINBBDPrecSolve()
469 for (i=0; i<pdata->n_local; i++) in KINBBDPrecSolve()
482 KBBDPrecData pdata; in KINBBDPrecFree() local
487 if (kinls_mem->pdata == NULL) return(0); in KINBBDPrecFree()
488 pdata = (KBBDPrecData) kinls_mem->pdata; in KINBBDPrecFree()
490 SUNLinSolFree(pdata->LS); in KINBBDPrecFree()
491 N_VDestroy(pdata->zlocal); in KINBBDPrecFree()
492 N_VDestroy(pdata->rlocal); in KINBBDPrecFree()
493 N_VDestroy(pdata->tempv1); in KINBBDPrecFree()
494 N_VDestroy(pdata->tempv2); in KINBBDPrecFree()
495 N_VDestroy(pdata->tempv3); in KINBBDPrecFree()
496 SUNMatDestroy(pdata->PP); in KINBBDPrecFree()
498 free(pdata); in KINBBDPrecFree()
499 pdata = NULL; in KINBBDPrecFree()
518 static int KBBDDQJac(KBBDPrecData pdata, in KBBDDQJac() argument
528 kin_mem = (KINMem) pdata->kin_mem; in KBBDDQJac()
541 if (pdata->gcomm != NULL) { in KBBDDQJac()
542 retval = pdata->gcomm(pdata->n_local, uu, kin_mem->kin_user_data); in KBBDDQJac()
546 retval = pdata->gloc(pdata->n_local, uu, gu, kin_mem->kin_user_data); in KBBDDQJac()
547 pdata->nge++; in KBBDDQJac()
551 width = pdata->mldq + pdata->mudq + 1; in KBBDDQJac()
552 ngroups = SUNMIN(width, pdata->n_local); in KBBDDQJac()
558 for(j = group - 1; j < pdata->n_local; j += width) { in KBBDDQJac()
559 inc = pdata->rel_uu * SUNMAX(SUNRabs(udata[j]), (ONE / uscdata[j])); in KBBDDQJac()
564 retval = pdata->gloc(pdata->n_local, utemp, gtemp, kin_mem->kin_user_data); in KBBDDQJac()
565 pdata->nge++; in KBBDDQJac()
569 for (j = group - 1; j < pdata->n_local; j += width) { in KBBDDQJac()
571 col_j = SUNBandMatrix_Column(pdata->PP,j); in KBBDDQJac()
572 inc = pdata->rel_uu * SUNMAX(SUNRabs(udata[j]) , (ONE / uscdata[j])); in KBBDDQJac()
574 i1 = SUNMAX(0, (j - pdata->mukeep)); in KBBDDQJac()
575 i2 = SUNMIN((j + pdata->mlkeep), (pdata->n_local - 1)); in KBBDDQJac()