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

Function CVode

externalpackages/PVODE/source/cvode.cpp:738–916  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

736********************************************************************/
737
738int CVode(void *cvode_mem, real tout, N_Vector yout, real *t, int itask)
739{
740 int nstloc, kflag, istate, next_q, ier;
741 real rh, next_h;
742 boole hOK, ewtsetOK;
743 CVodeMem cv_mem;
744
745 /* Check for legal inputs in all cases */
746
747 cv_mem = (CVodeMem) cvode_mem;
748 if (cvode_mem == NULL) {
749 fprintf(stdout, MSG_CVODE_NO_MEM);
750 return(CVODE_NO_MEM);
751 }
752
753 if ((y = yout) == NULL) {
754 fprintf(errfp, MSG_YOUT_NULL);
755 return(ILL_INPUT);
756 }
757
758 if (t == NULL) {
759 fprintf(errfp, MSG_T_NULL);
760 return(ILL_INPUT);
761 }
762 *t = tn;
763
764 if ((itask != NORMAL) && (itask != ONE_STEP)) {
765 fprintf(errfp, MSG_BAD_ITASK, itask, NORMAL, ONE_STEP);
766 return(ILL_INPUT);
767 }
768
769 /* On first call, check solver functions and call linit function */
770
771 if (nst == 0) {
772 if (iter == NEWTON) {
773 if (linit == NULL) {
774 fprintf(errfp, MSG_LINIT_NULL);
775 return(ILL_INPUT);
776 }
777 if (lsetup == NULL) {
778 fprintf(errfp, MSG_LSETUP_NULL);
779 return(ILL_INPUT);
780 }
781 if (lsolve == NULL) {
782 fprintf(errfp, MSG_LSOLVE_NULL);
783 return(ILL_INPUT);
784 }
785 if (lfree == NULL) {
786 fprintf(errfp, MSG_LFREE_NULL);
787 return(ILL_INPUT);
788 }
789 linitOK = (linit(cv_mem, &(setupNonNull)) == LINIT_OK);
790 if (!linitOK) {
791 fprintf(errfp, MSG_LINIT_FAIL);
792 return(ILL_INPUT);
793 }
794 }
795

Callers 2

runMethod · 0.85
runMethod · 0.85

Calls 7

CVHinFunction · 0.85
N_VScaleFunction · 0.85
CVodeDkyFunction · 0.85
CVEwtSetFunction · 0.85
N_VWrmsNormFunction · 0.85
CVStepFunction · 0.85
CVHandleFailureFunction · 0.85

Tested by

no test coverage detected