MCPcopy Create free account
hub / github.com/boutproject/BOUT-dev / CVodeMalloc

Function CVodeMalloc

externalpackages/PVODE/source/cvode.cpp:476–697  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

474*****************************************************************/
475
476void *CVodeMalloc(integer N, RhsFn f, real t0, N_Vector y0, int lmm, int iter,
477 int itol, real *reltol, void *abstol, void *f_data,
478 FILE *errfp, boole optIn, long int iopt[], real ropt[],
479 void *machEnv)
480{
481 boole allocOK, ioptExists, roptExists, neg_abstol, ewtsetOK;
482 int maxord;
483 CVodeMem cv_mem;
484 FILE *fp;
485
486 /* Check for legal input parameters */
487
488 fp = (errfp == NULL) ? stdout : errfp;
489
490 if (y0==NULL) {
491 fprintf(fp, MSG_Y0_NULL);
492 return(NULL);
493 }
494
495 if (N <= 0) {
496 fprintf(fp, MSG_BAD_N, N);
497 return(NULL);
498 }
499
500 if ((lmm != ADAMS) && (lmm != BDF)) {
501 fprintf(fp, MSG_BAD_LMM, lmm, ADAMS, BDF);
502 return(NULL);
503 }
504
505 if ((iter != FUNCTIONAL) && (iter != NEWTON)) {
506 fprintf(fp, MSG_BAD_ITER, iter, FUNCTIONAL, NEWTON);
507 return(NULL);
508 }
509
510 if ((itol != SS) && (itol != SV)) {
511 fprintf(fp, MSG_BAD_ITOL, itol, SS, SV);
512 return(NULL);
513 }
514
515 if (f == NULL) {
516 fprintf(fp, MSG_F_NULL);
517 return(NULL);
518 }
519
520 if (reltol == NULL) {
521 fprintf(fp, MSG_RELTOL_NULL);
522 return(NULL);
523 }
524
525 if (*reltol < ZERO) {
526 fprintf(fp, MSG_BAD_RELTOL, *reltol);
527 return(NULL);
528 }
529
530 if (abstol == NULL) {
531 fprintf(fp, MSG_ABSTOL_NULL);
532 return(NULL);
533 }

Callers 1

initMethod · 0.85

Calls 7

N_VMinFunction · 0.85
CVAllocVectorsFunction · 0.85
CVEwtSetFunction · 0.85
CVFreeVectorsFunction · 0.85
UnitRoundoffFunction · 0.85
N_VScaleFunction · 0.85
fFunction · 0.85

Tested by

no test coverage detected