本文整理汇总了C++中CVodeGetNumSteps函数的典型用法代码示例。如果您正苦于以下问题:C++ CVodeGetNumSteps函数的具体用法?C++ CVodeGetNumSteps怎么用?C++ CVodeGetNumSteps使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CVodeGetNumSteps函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PrintFinalStats
static void PrintFinalStats(void *cvode_mem)
{
long int nst, nfe, nsetups, nje, nfeLS, nni, ncfn, netf, nge;
int flag;
flag = CVodeGetNumSteps(cvode_mem, &nst);
check_flag(&flag, "CVodeGetNumSteps", 1);
flag = CVodeGetNumRhsEvals(cvode_mem, &nfe);
check_flag(&flag, "CVodeGetNumRhsEvals", 1);
flag = CVodeGetNumLinSolvSetups(cvode_mem, &nsetups);
check_flag(&flag, "CVodeGetNumLinSolvSetups", 1);
flag = CVodeGetNumErrTestFails(cvode_mem, &netf);
check_flag(&flag, "CVodeGetNumErrTestFails", 1);
flag = CVodeGetNumNonlinSolvIters(cvode_mem, &nni);
check_flag(&flag, "CVodeGetNumNonlinSolvIters", 1);
flag = CVodeGetNumNonlinSolvConvFails(cvode_mem, &ncfn);
check_flag(&flag, "CVodeGetNumNonlinSolvConvFails", 1);
flag = CVDlsGetNumJacEvals(cvode_mem, &nje);
check_flag(&flag, "CVDlsGetNumJacEvals", 1);
flag = CVDlsGetNumRhsEvals(cvode_mem, &nfeLS);
check_flag(&flag, "CVDlsGetNumRhsEvals", 1);
flag = CVodeGetNumGEvals(cvode_mem, &nge);
check_flag(&flag, "CVodeGetNumGEvals", 1);
printf("\nFinal Statistics:\n");
printf("nst = %-6ld nfe = %-6ld nsetups = %-6ld nfeLS = %-6ld nje = %ld\n",
nst, nfe, nsetups, nfeLS, nje);
printf("nni = %-6ld ncfn = %-6ld netf = %-6ld nge = %ld\n \n",
nni, ncfn, netf, nge);
}
示例2: PrintFinalStats
static void PrintFinalStats(void *cvode_mem)
{
long int lenrw, leniw ;
long int lenrwSPGMR, leniwSPGMR;
long int nst, nfe, nsetups, nni, ncfn, netf;
long int nli, npe, nps, ncfl, nfeSPGMR;
int flag;
flag = CVodeGetWorkSpace(cvode_mem, &lenrw, &leniw);
flag = CVodeGetNumSteps(cvode_mem, &nst);
flag = CVodeGetNumRhsEvals(cvode_mem, &nfe);
flag = CVodeGetNumLinSolvSetups(cvode_mem, &nsetups);
flag = CVodeGetNumErrTestFails(cvode_mem, &netf);
flag = CVodeGetNumNonlinSolvIters(cvode_mem, &nni);
flag = CVodeGetNumNonlinSolvConvFails(cvode_mem, &ncfn);
flag = CVSpilsGetWorkSpace(cvode_mem, &lenrwSPGMR, &leniwSPGMR);
flag = CVSpilsGetNumLinIters(cvode_mem, &nli);
flag = CVSpilsGetNumPrecEvals(cvode_mem, &npe);
flag = CVSpilsGetNumPrecSolves(cvode_mem, &nps);
flag = CVSpilsGetNumConvFails(cvode_mem, &ncfl);
flag = CVSpilsGetNumRhsEvals(cvode_mem, &nfeSPGMR);
printf("\nFinal Statistics.. \n\n");
printf("lenrw = %6ld leniw = %6ld\n", lenrw, leniw);
printf("llrw = %6ld lliw = %6ld\n", lenrwSPGMR, leniwSPGMR);
printf("nst = %6ld\n" , nst);
printf("nfe = %6ld nfel = %6ld\n" , nfe, nfeSPGMR);
printf("nni = %6ld nli = %6ld\n" , nni, nli);
printf("nsetups = %6ld netf = %6ld\n" , nsetups, netf);
printf("npe = %6ld nps = %6ld\n" , npe, nps);
printf("ncfn = %6ld ncfl = %6ld\n\n", ncfn, ncfl);
}
示例3: PrintOutput
static void PrintOutput(void *cvode_mem, realtype t)
{
long int nst, nfe, nni;
int qu, flag;
realtype hu;
flag = CVodeGetNumSteps(cvode_mem, &nst);
check_flag(&flag, "CVodeGetNumSteps", 1);
flag = CVodeGetNumRhsEvals(cvode_mem, &nfe);
check_flag(&flag, "CVodeGetNumRhsEvals", 1);
flag = CVodeGetNumNonlinSolvIters(cvode_mem, &nni);
check_flag(&flag, "CVodeGetNumNonlinSolvIters", 1);
flag = CVodeGetLastOrder(cvode_mem, &qu);
check_flag(&flag, "CVodeGetLastOrder", 1);
flag = CVodeGetLastStep(cvode_mem, &hu);
check_flag(&flag, "CVodeGetLastStep", 1);
#if defined(SUNDIALS_EXTENDED_PRECISION)
printf("t = %10.2Le nst = %ld nfe = %ld nni = %ld", t, nst, nfe, nni);
printf(" qu = %d hu = %11.2Le\n\n", qu, hu);
#elif defined(SUNDIALS_DOUBLE_PRECISION)
printf("t = %10.2le nst = %ld nfe = %ld nni = %ld", t, nst, nfe, nni);
printf(" qu = %d hu = %11.2le\n\n", qu, hu);
#else
printf("t = %10.2e nst = %ld nfe = %ld nni = %ld", t, nst, nfe, nni);
printf(" qu = %d hu = %11.2e\n\n", qu, hu);
#endif
}
示例4: PrintOutput
static void PrintOutput(void *cvode_mem, realtype t, N_Vector u)
{
long int nst;
int qu, flag;
realtype hu, *udata;
udata = N_VGetArrayPointer_Serial(u);
flag = CVodeGetNumSteps(cvode_mem, &nst);
check_flag(&flag, "CVodeGetNumSteps", 1);
flag = CVodeGetLastOrder(cvode_mem, &qu);
check_flag(&flag, "CVodeGetLastOrder", 1);
flag = CVodeGetLastStep(cvode_mem, &hu);
check_flag(&flag, "CVodeGetLastStep", 1);
#if defined(SUNDIALS_EXTENDED_PRECISION)
printf("%8.3Le %2d %8.3Le %5ld\n", t, qu, hu, nst);
#elif defined(SUNDIALS_DOUBLE_PRECISION)
printf("%8.3e %2d %8.3e %5ld\n", t, qu, hu, nst);
#else
printf("%8.3e %2d %8.3e %5ld\n", t, qu, hu, nst);
#endif
printf(" Solution ");
#if defined(SUNDIALS_EXTENDED_PRECISION)
printf("%12.4Le %12.4Le %12.4Le \n", udata[0], udata[1], udata[2]);
#elif defined(SUNDIALS_DOUBLE_PRECISION)
printf("%12.4e %12.4e %12.4e \n", udata[0], udata[1], udata[2]);
#else
printf("%12.4e %12.4e %12.4e \n", udata[0], udata[1], udata[2]);
#endif
}
示例5: PrintOutput
static void PrintOutput(void *cvode_mem, realtype t, N_Vector u)
{
long int nst;
int qu, flag;
realtype hu;
flag = CVodeGetNumSteps(cvode_mem, &nst);
check_flag(&flag, "CVodeGetNumSteps", 1);
flag = CVodeGetLastOrder(cvode_mem, &qu);
check_flag(&flag, "CVodeGetLastOrder", 1);
flag = CVodeGetLastStep(cvode_mem, &hu);
check_flag(&flag, "CVodeGetLastStep", 1);
#if defined(SUNDIALS_EXTENDED_PRECISION)
printf("%8.3Le %2d %8.3Le %5ld\n", t, qu, hu ,nst);
#elif defined(SUNDIALS_DOUBLE_PRECISION)
printf("%8.3le %2d %8.3le %5ld\n", t, qu, hu ,nst);
#else
printf("%8.3e %2d %8.3e %5ld\n", t, qu, hu ,nst);
#endif
printf(" Solution ");
#if defined(SUNDIALS_EXTENDED_PRECISION)
printf("%12.4Le \n", N_VMaxNorm(u));
#elif defined(SUNDIALS_DOUBLE_PRECISION)
printf("%12.4le \n", N_VMaxNorm(u));
#else
printf("%12.4e \n", N_VMaxNorm(u));
#endif
}
示例6: PrintFinalStatistics
/*=======================================================================
Print the final statistics returned from the most recent call to CVODE
-----------------------------------------------------------------------*/
static void PrintFinalStatistics(void *cvode_mem)
{
long int nst, nfe, nsetups, nje, nfeLS, nni, ncfn, netf;
int flag;
flag = CVodeGetNumSteps(cvode_mem, &nst);
check_flag(&flag, "CVodeGetNumSteps", 1);
flag = CVodeGetNumRhsEvals(cvode_mem, &nfe);
check_flag(&flag, "CVodeGetNumRhsEvals", 1);
flag = CVodeGetNumLinSolvSetups(cvode_mem, &nsetups);
check_flag(&flag, "CVodeGetNumLinSolvSetups", 1);
flag = CVodeGetNumErrTestFails(cvode_mem, &netf);
check_flag(&flag, "CVodeGetNumErrTestFails", 1);
flag = CVodeGetNumNonlinSolvIters(cvode_mem, &nni);
check_flag(&flag, "CVodeGetNumNonlinSolvIters", 1);
flag = CVodeGetNumNonlinSolvConvFails(cvode_mem, &ncfn);
check_flag(&flag, "CVodeGetNumNonlinSolvConvFails", 1);
flag = CVDlsGetNumJacEvals(cvode_mem, &nje);
check_flag(&flag, "CVDlsGetNumJacEvals", 1);
flag = CVDlsGetNumRhsEvals(cvode_mem, &nfeLS);
check_flag(&flag, "CVDlsGetNumRhsEvals", 1);
#pragma omp critical (statistics)
#ifdef OPENMP
printf("\nFinal Statistics (thread %d):\n", omp_get_thread_num());
#endif
printf("nst = %-6ld nfe = %-6ld nsetups = %-6ld nfeLS = %-6ld\n",
nst, nfe, nsetups, nfeLS);
printf("nje = %-6ld nni = %-6ld ncfn = %-6ld netf = %-6ld\n",
nje, nni, ncfn, netf);
}
示例7: PrintFinalStats
static void PrintFinalStats(void *cvode_mem, booleantype sensi,
booleantype err_con, int sensi_meth)
{
long int nst;
long int nfe, nsetups, nni, ncfn, netf;
long int nfSe, nfeS, nsetupsS, nniS, ncfnS, netfS;
int retval;
retval = CVodeGetNumSteps(cvode_mem, &nst);
check_retval(&retval, "CVodeGetNumSteps", 1, 0);
retval = CVodeGetNumRhsEvals(cvode_mem, &nfe);
check_retval(&retval, "CVodeGetNumRhsEvals", 1, 0);
retval = CVodeGetNumLinSolvSetups(cvode_mem, &nsetups);
check_retval(&retval, "CVodeGetNumLinSolvSetups", 1, 0);
retval = CVodeGetNumErrTestFails(cvode_mem, &netf);
check_retval(&retval, "CVodeGetNumErrTestFails", 1, 0);
retval = CVodeGetNumNonlinSolvIters(cvode_mem, &nni);
check_retval(&retval, "CVodeGetNumNonlinSolvIters", 1, 0);
retval = CVodeGetNumNonlinSolvConvFails(cvode_mem, &ncfn);
check_retval(&retval, "CVodeGetNumNonlinSolvConvFails", 1, 0);
if (sensi) {
retval = CVodeGetSensNumRhsEvals(cvode_mem, &nfSe);
check_retval(&retval, "CVodeGetSensNumRhsEvals", 1, 0);
retval = CVodeGetNumRhsEvalsSens(cvode_mem, &nfeS);
check_retval(&retval, "CVodeGetNumRhsEvalsSens", 1, 0);
retval = CVodeGetSensNumLinSolvSetups(cvode_mem, &nsetupsS);
check_retval(&retval, "CVodeGetSensNumLinSolvSetups", 1, 0);
retval = CVodeGetSensNumErrTestFails(cvode_mem, &netfS);
if (err_con) {
retval = CVodeGetSensNumErrTestFails(cvode_mem, &netfS);
check_retval(&retval, "CVodeGetSensNumErrTestFails", 1, 0);
} else {
netfS = 0;
}
if ((sensi_meth == CV_STAGGERED) || (sensi_meth == CV_STAGGERED1)) {
retval = CVodeGetSensNumNonlinSolvIters(cvode_mem, &nniS);
check_retval(&retval, "CVodeGetSensNumNonlinSolvIters", 1, 0);
retval = CVodeGetSensNumNonlinSolvConvFails(cvode_mem, &ncfnS);
check_retval(&retval, "CVodeGetSensNumNonlinSolvConvFails", 1, 0);
} else {
nniS = 0;
ncfnS = 0;
}
}
printf("\nFinal Statistics\n\n");
printf("nst = %5ld\n\n", nst);
printf("nfe = %5ld\n", nfe);
printf("netf = %5ld nsetups = %5ld\n", netf, nsetups);
printf("nni = %5ld ncfn = %5ld\n", nni, ncfn);
if(sensi) {
printf("\n");
printf("nfSe = %5ld nfeS = %5ld\n", nfSe, nfeS);
printf("netfs = %5ld nsetupsS = %5ld\n", netfS, nsetupsS);
printf("nniS = %5ld ncfnS = %5ld\n", nniS, ncfnS);
}
}
示例8: ode_solver_print_stats
void ode_solver_print_stats(const ode_solver* solver, FILE* outF){
long int nst;
long int nfe, nsetups, nni, ncfn, netf;
long int nfSe, nfeS, nsetupsS, nniS, ncfnS, netfS;
long int nje, nfeLS;
int flag;
void* cvode_mem = solver->cvode_mem;
flag = CVodeGetNumSteps(cvode_mem, &nst);
flag = CVodeGetNumRhsEvals(cvode_mem, &nfe);
flag = CVodeGetNumLinSolvSetups(cvode_mem, &nsetups);
flag = CVodeGetNumErrTestFails(cvode_mem, &netf);
flag = CVodeGetNumNonlinSolvIters(cvode_mem, &nni);
flag = CVodeGetNumNonlinSolvConvFails(cvode_mem, &ncfn);
if (solver->yS != 0) {
flag = CVodeGetSensNumRhsEvals(cvode_mem, &nfSe);
flag = CVodeGetNumRhsEvalsSens(cvode_mem, &nfeS);
flag = CVodeGetSensNumLinSolvSetups(cvode_mem, &nsetupsS);
flag = CVodeGetSensNumErrTestFails(cvode_mem, &netfS);
flag = CVodeGetSensNumNonlinSolvIters(cvode_mem, &nniS);
flag = CVodeGetSensNumNonlinSolvConvFails(cvode_mem, &ncfnS);
}
flag = CVDlsGetNumJacEvals(cvode_mem, &nje);
flag = CVDlsGetNumRhsEvals(cvode_mem, &nfeLS);
fprintf(outF,"\n# Solver Statistics\n\n");
fprintf(outF,"# Steps = %5ld\n\n", nst);
fprintf(outF,"# RhsEvals = %5ld\n", nfe);
fprintf(outF,"# ErrTestFails = %5ld LinSolvSetups = %5ld\n", netf, nsetups);
fprintf(outF,"# NonlinSolvIters = %5ld NonlinSolvConvFails = %5ld\n", nni, ncfn);
if(solver->yS != 0) {
fprintf(outF,"\n# Sensitivities Statistics\n");
fprintf(outF,"# SensRhsEvals = %5ld RhsEvals = %5ld\n", nfSe, nfeS);
fprintf(outF,"# ErrTestFails = %5ld LinSolvSetups = %5ld\n", netfS, nsetupsS);
fprintf(outF,"# NonlinSolvIters = %5ld NonlinSolvConvFails = %5ld\n", nniS, ncfnS);
}
fprintf(outF,"\n# Jacobian Statistics\n");
fprintf(outF,"# JacEvals = %5ld RhsEvals = %5ld\n", nje, nfeLS);
}
示例9: CVodeGetNumSteps
int OpenSMOKE_CVODE_Sundials<T>::GetNumberOfSteps() const
{
long int nst;
int flag = CVodeGetNumSteps(cvode_mem_, &nst);
check_flag(&flag, std::string("CVodeGetNumSteps"), 1);
return int(nst);
}
示例10: PrintFinalStats
static void PrintFinalStats(void *cvode_mem, booleantype sensi)
{
long int nst;
long int nfe, nsetups, nni, ncfn, netf;
long int nfSe, nfeS, nsetupsS, nniS, ncfnS, netfS;
long int nje, nfeLS;
int retval;
retval = CVodeGetNumSteps(cvode_mem, &nst);
check_retval(&retval, "CVodeGetNumSteps", 1);
retval = CVodeGetNumRhsEvals(cvode_mem, &nfe);
check_retval(&retval, "CVodeGetNumRhsEvals", 1);
retval = CVodeGetNumLinSolvSetups(cvode_mem, &nsetups);
check_retval(&retval, "CVodeGetNumLinSolvSetups", 1);
retval = CVodeGetNumErrTestFails(cvode_mem, &netf);
check_retval(&retval, "CVodeGetNumErrTestFails", 1);
retval = CVodeGetNumNonlinSolvIters(cvode_mem, &nni);
check_retval(&retval, "CVodeGetNumNonlinSolvIters", 1);
retval = CVodeGetNumNonlinSolvConvFails(cvode_mem, &ncfn);
check_retval(&retval, "CVodeGetNumNonlinSolvConvFails", 1);
if (sensi) {
retval = CVodeGetSensNumRhsEvals(cvode_mem, &nfSe);
check_retval(&retval, "CVodeGetSensNumRhsEvals", 1);
retval = CVodeGetNumRhsEvalsSens(cvode_mem, &nfeS);
check_retval(&retval, "CVodeGetNumRhsEvalsSens", 1);
retval = CVodeGetSensNumLinSolvSetups(cvode_mem, &nsetupsS);
check_retval(&retval, "CVodeGetSensNumLinSolvSetups", 1);
retval = CVodeGetSensNumErrTestFails(cvode_mem, &netfS);
check_retval(&retval, "CVodeGetSensNumErrTestFails", 1);
retval = CVodeGetSensNumNonlinSolvIters(cvode_mem, &nniS);
check_retval(&retval, "CVodeGetSensNumNonlinSolvIters", 1);
retval = CVodeGetSensNumNonlinSolvConvFails(cvode_mem, &ncfnS);
check_retval(&retval, "CVodeGetSensNumNonlinSolvConvFails", 1);
}
retval = CVDlsGetNumJacEvals(cvode_mem, &nje);
check_retval(&retval, "CVDlsGetNumJacEvals", 1);
retval = CVDlsGetNumRhsEvals(cvode_mem, &nfeLS);
check_retval(&retval, "CVDlsGetNumRhsEvals", 1);
printf("\nFinal Statistics\n\n");
printf("nst = %5ld\n\n", nst);
printf("nfe = %5ld\n", nfe);
printf("netf = %5ld nsetups = %5ld\n", netf, nsetups);
printf("nni = %5ld ncfn = %5ld\n", nni, ncfn);
if(sensi) {
printf("\n");
printf("nfSe = %5ld nfeS = %5ld\n", nfSe, nfeS);
printf("netfs = %5ld nsetupsS = %5ld\n", netfS, nsetupsS);
printf("nniS = %5ld ncfnS = %5ld\n", nniS, ncfnS);
}
printf("\n");
printf("nje = %5ld nfeLS = %5ld\n", nje, nfeLS);
}
示例11: PrintFinalStats
static void PrintFinalStats(void *cvode_mem, booleantype sensi)
{
long int nst;
long int nfe, nsetups, nni, ncfn, netf;
long int nfSe, nfeS, nsetupsS, nniS, ncfnS, netfS;
long int njeD, nfeD;
int flag;
flag = CVodeGetNumSteps(cvode_mem, &nst);
check_flag(&flag, "CVodeGetNumSteps", 1);
flag = CVodeGetNumRhsEvals(cvode_mem, &nfe);
check_flag(&flag, "CVodeGetNumRhsEvals", 1);
flag = CVodeGetNumLinSolvSetups(cvode_mem, &nsetups);
check_flag(&flag, "CVodeGetNumLinSolvSetups", 1);
flag = CVodeGetNumErrTestFails(cvode_mem, &netf);
check_flag(&flag, "CVodeGetNumErrTestFails", 1);
flag = CVodeGetNumNonlinSolvIters(cvode_mem, &nni);
check_flag(&flag, "CVodeGetNumNonlinSolvIters", 1);
flag = CVodeGetNumNonlinSolvConvFails(cvode_mem, &ncfn);
check_flag(&flag, "CVodeGetNumNonlinSolvConvFails", 1);
if (sensi) {
flag = CVodeGetNumSensRhsEvals(cvode_mem, &nfSe);
check_flag(&flag, "CVodeGetNumSensRhsEvals", 1);
flag = CVodeGetNumRhsEvalsSens(cvode_mem, &nfeS);
check_flag(&flag, "CVodeGetNumRhsEvalsSens", 1);
flag = CVodeGetNumSensLinSolvSetups(cvode_mem, &nsetupsS);
check_flag(&flag, "CVodeGetNumSensLinSolvSetups", 1);
flag = CVodeGetNumSensErrTestFails(cvode_mem, &netfS);
check_flag(&flag, "CVodeGetNumSensErrTestFails", 1);
flag = CVodeGetNumSensNonlinSolvIters(cvode_mem, &nniS);
check_flag(&flag, "CVodeGetNumSensNonlinSolvIters", 1);
flag = CVodeGetNumSensNonlinSolvConvFails(cvode_mem, &ncfnS);
check_flag(&flag, "CVodeGetNumSensNonlinSolvConvFails", 1);
}
flag = CVDenseGetNumJacEvals(cvode_mem, &njeD);
check_flag(&flag, "CVDenseGetNumJacEvals", 1);
flag = CVDenseGetNumRhsEvals(cvode_mem, &nfeD);
check_flag(&flag, "CVDenseGetNumRhsEvals", 1);
printf("\nFinal Statistics\n\n");
printf("nst = %5ld\n\n", nst);
printf("nfe = %5ld\n", nfe);
printf("netf = %5ld nsetups = %5ld\n", netf, nsetups);
printf("nni = %5ld ncfn = %5ld\n", nni, ncfn);
if(sensi) {
printf("\n");
printf("nfSe = %5ld nfeS = %5ld\n", nfSe, nfeS);
printf("netfs = %5ld nsetupsS = %5ld\n", netfS, nsetupsS);
printf("nniS = %5ld ncfnS = %5ld\n", nniS, ncfnS);
}
printf("\n");
printf("njeD = %5ld nfeD = %5ld\n", njeD, nfeD);
}
示例12: PrintFinalStats
static void PrintFinalStats(void *cvode_mem)
{
long int lenrw, leniw ;
long int lenrwLS, leniwLS;
long int lenrwBBDP, leniwBBDP, ngevalsBBDP;
long int nst, nfe, nsetups, nni, ncfn, netf;
long int nli, npe, nps, ncfl, nfeLS;
int flag;
flag = CVodeGetWorkSpace(cvode_mem, &lenrw, &leniw);
check_flag(&flag, "CVodeGetWorkSpace", 1, 0);
flag = CVodeGetNumSteps(cvode_mem, &nst);
check_flag(&flag, "CVodeGetNumSteps", 1, 0);
flag = CVodeGetNumRhsEvals(cvode_mem, &nfe);
check_flag(&flag, "CVodeGetNumRhsEvals", 1, 0);
flag = CVodeGetNumLinSolvSetups(cvode_mem, &nsetups);
check_flag(&flag, "CVodeGetNumLinSolvSetups", 1, 0);
flag = CVodeGetNumErrTestFails(cvode_mem, &netf);
check_flag(&flag, "CVodeGetNumErrTestFails", 1, 0);
flag = CVodeGetNumNonlinSolvIters(cvode_mem, &nni);
check_flag(&flag, "CVodeGetNumNonlinSolvIters", 1, 0);
flag = CVodeGetNumNonlinSolvConvFails(cvode_mem, &ncfn);
check_flag(&flag, "CVodeGetNumNonlinSolvConvFails", 1, 0);
flag = CVSpilsGetWorkSpace(cvode_mem, &lenrwLS, &leniwLS);
check_flag(&flag, "CVSpilsGetWorkSpace", 1, 0);
flag = CVSpilsGetNumLinIters(cvode_mem, &nli);
check_flag(&flag, "CVSpilsGetNumLinIters", 1, 0);
flag = CVSpilsGetNumPrecEvals(cvode_mem, &npe);
check_flag(&flag, "CVSpilsGetNumPrecEvals", 1, 0);
flag = CVSpilsGetNumPrecSolves(cvode_mem, &nps);
check_flag(&flag, "CVSpilsGetNumPrecSolves", 1, 0);
flag = CVSpilsGetNumConvFails(cvode_mem, &ncfl);
check_flag(&flag, "CVSpilsGetNumConvFails", 1, 0);
flag = CVSpilsGetNumRhsEvals(cvode_mem, &nfeLS);
check_flag(&flag, "CVSpilsGetNumRhsEvals", 1, 0);
printf("\nFinal Statistics: \n\n");
printf("lenrw = %5ld leniw = %5ld\n", lenrw, leniw);
printf("lenrwls = %5ld leniwls = %5ld\n", lenrwLS, leniwLS);
printf("nst = %5ld\n" , nst);
printf("nfe = %5ld nfels = %5ld\n" , nfe, nfeLS);
printf("nni = %5ld nli = %5ld\n" , nni, nli);
printf("nsetups = %5ld netf = %5ld\n" , nsetups, netf);
printf("npe = %5ld nps = %5ld\n" , npe, nps);
printf("ncfn = %5ld ncfl = %5ld\n\n", ncfn, ncfl);
flag = CVBBDPrecGetWorkSpace(cvode_mem, &lenrwBBDP, &leniwBBDP);
check_flag(&flag, "CVBBDPrecGetWorkSpace", 1, 0);
flag = CVBBDPrecGetNumGfnEvals(cvode_mem, &ngevalsBBDP);
check_flag(&flag, "CVBBDPrecGetNumGfnEvals", 1, 0);
printf("In CVBBDPRE: real/integer local work space sizes = %ld, %ld\n",
lenrwBBDP, leniwBBDP);
printf(" no. flocal evals. = %ld\n",ngevalsBBDP);
}
示例13: PrintFinalStats
static void PrintFinalStats(void *cvode_mem)
{
long int lenrw, leniw ;
long int lenrwLS, leniwLS;
long int lenrwBP, leniwBP;
long int nst, nfe, nsetups, nni, ncfn, netf;
long int nli, npe, nps, ncfl, nfeLS;
long int nfeBP;
int flag;
flag = CVodeGetWorkSpace(cvode_mem, &lenrw, &leniw);
check_flag(&flag, "CVodeGetWorkSpace", 1);
flag = CVodeGetNumSteps(cvode_mem, &nst);
check_flag(&flag, "CVodeGetNumSteps", 1);
flag = CVodeGetNumRhsEvals(cvode_mem, &nfe);
check_flag(&flag, "CVodeGetNumRhsEvals", 1);
flag = CVodeGetNumLinSolvSetups(cvode_mem, &nsetups);
check_flag(&flag, "CVodeGetNumLinSolvSetups", 1);
flag = CVodeGetNumErrTestFails(cvode_mem, &netf);
check_flag(&flag, "CVodeGetNumErrTestFails", 1);
flag = CVodeGetNumNonlinSolvIters(cvode_mem, &nni);
check_flag(&flag, "CVodeGetNumNonlinSolvIters", 1);
flag = CVodeGetNumNonlinSolvConvFails(cvode_mem, &ncfn);
check_flag(&flag, "CVodeGetNumNonlinSolvConvFails", 1);
flag = CVSpilsGetWorkSpace(cvode_mem, &lenrwLS, &leniwLS);
check_flag(&flag, "CVSpilsGetWorkSpace", 1);
flag = CVSpilsGetNumLinIters(cvode_mem, &nli);
check_flag(&flag, "CVSpilsGetNumLinIters", 1);
flag = CVSpilsGetNumPrecEvals(cvode_mem, &npe);
check_flag(&flag, "CVSpilsGetNumPrecEvals", 1);
flag = CVSpilsGetNumPrecSolves(cvode_mem, &nps);
check_flag(&flag, "CVSpilsGetNumPrecSolves", 1);
flag = CVSpilsGetNumConvFails(cvode_mem, &ncfl);
check_flag(&flag, "CVSpilsGetNumConvFails", 1);
flag = CVSpilsGetNumRhsEvals(cvode_mem, &nfeLS);
check_flag(&flag, "CVSpilsGetNumRhsEvals", 1);
flag = CVBandPrecGetWorkSpace(cvode_mem, &lenrwBP, &leniwBP);
check_flag(&flag, "CVBandPrecGetWorkSpace", 1);
flag = CVBandPrecGetNumRhsEvals(cvode_mem, &nfeBP);
check_flag(&flag, "CVBandPrecGetNumRhsEvals", 1);
printf("\nFinal Statistics.. \n\n");
printf("lenrw = %5ld leniw = %5ld\n", lenrw, leniw);
printf("lenrwls = %5ld leniwls = %5ld\n", lenrwLS, leniwLS);
printf("lenrwbp = %5ld leniwbp = %5ld\n", lenrwBP, leniwBP);
printf("nst = %5ld\n" , nst);
printf("nfe = %5ld nfetot = %5ld\n" , nfe, nfe+nfeLS+nfeBP);
printf("nfeLS = %5ld nfeBP = %5ld\n" , nfeLS, nfeBP);
printf("nni = %5ld nli = %5ld\n" , nni, nli);
printf("nsetups = %5ld netf = %5ld\n" , nsetups, netf);
printf("npe = %5ld nps = %5ld\n" , npe, nps);
printf("ncfn = %5ld ncfl = %5ld\n\n", ncfn, ncfl);
}
示例14: PrintOutput
static void PrintOutput(void *cvode_mem, int my_pe, MPI_Comm comm,
N_Vector u, realtype t)
{
int qu, flag;
realtype hu, *udata, tempu[2];
int npelast;
long int i0, i1, nst;
MPI_Status status;
npelast = NPEX*NPEY - 1;
udata = NV_DATA_P(u);
/* Send c1,c2 at top right mesh point to PE 0 */
if (my_pe == npelast) {
i0 = NVARS*MXSUB*MYSUB - 2;
i1 = i0 + 1;
if (npelast != 0)
MPI_Send(&udata[i0], 2, PVEC_REAL_MPI_TYPE, 0, 0, comm);
else {
tempu[0] = udata[i0];
tempu[1] = udata[i1];
}
}
/* On PE 0, receive c1,c2 at top right, then print performance data
and sampled solution values */
if (my_pe == 0) {
if (npelast != 0)
MPI_Recv(&tempu[0], 2, PVEC_REAL_MPI_TYPE, npelast, 0, comm, &status);
flag = CVodeGetNumSteps(cvode_mem, &nst);
check_flag(&flag, "CVodeGetNumSteps", 1, my_pe);
flag = CVodeGetLastOrder(cvode_mem, &qu);
check_flag(&flag, "CVodeGetLastOrder", 1, my_pe);
flag = CVodeGetLastStep(cvode_mem, &hu);
check_flag(&flag, "CVodeGetLastStep", 1, my_pe);
#if defined(SUNDIALS_EXTENDED_PRECISION)
printf("t = %.2Le no. steps = %ld order = %d stepsize = %.2Le\n",
t, nst, qu, hu);
printf("At bottom left: c1, c2 = %12.3Le %12.3Le \n", udata[0], udata[1]);
printf("At top right: c1, c2 = %12.3Le %12.3Le \n\n", tempu[0], tempu[1]);
#elif defined(SUNDIALS_DOUBLE_PRECISION)
printf("t = %.2le no. steps = %ld order = %d stepsize = %.2le\n",
t, nst, qu, hu);
printf("At bottom left: c1, c2 = %12.3le %12.3le \n", udata[0], udata[1]);
printf("At top right: c1, c2 = %12.3le %12.3le \n\n", tempu[0], tempu[1]);
#else
printf("t = %.2e no. steps = %ld order = %d stepsize = %.2e\n",
t, nst, qu, hu);
printf("At bottom left: c1, c2 = %12.3e %12.3e \n", udata[0], udata[1]);
printf("At top right: c1, c2 = %12.3e %12.3e \n\n", tempu[0], tempu[1]);
#endif
}
}
示例15: PrintFinalStats
static void PrintFinalStats(void *cvode_mem, int linsolver)
{
long int lenrw, leniw ;
long int lenrwLS, leniwLS;
long int nst, nfe, nsetups, nni, ncfn, netf;
long int nli, npe, nps, ncfl, nfeLS;
int retval;
retval = CVodeGetWorkSpace(cvode_mem, &lenrw, &leniw);
check_retval(&retval, "CVodeGetWorkSpace", 1);
retval = CVodeGetNumSteps(cvode_mem, &nst);
check_retval(&retval, "CVodeGetNumSteps", 1);
retval = CVodeGetNumRhsEvals(cvode_mem, &nfe);
check_retval(&retval, "CVodeGetNumRhsEvals", 1);
retval = CVodeGetNumLinSolvSetups(cvode_mem, &nsetups);
check_retval(&retval, "CVodeGetNumLinSolvSetups", 1);
retval = CVodeGetNumErrTestFails(cvode_mem, &netf);
check_retval(&retval, "CVodeGetNumErrTestFails", 1);
retval = CVodeGetNumNonlinSolvIters(cvode_mem, &nni);
check_retval(&retval, "CVodeGetNumNonlinSolvIters", 1);
retval = CVodeGetNumNonlinSolvConvFails(cvode_mem, &ncfn);
check_retval(&retval, "CVodeGetNumNonlinSolvConvFails", 1);
retval = CVodeGetLinWorkSpace(cvode_mem, &lenrwLS, &leniwLS);
check_retval(&retval, "CVodeGetLinWorkSpace", 1);
retval = CVodeGetNumLinIters(cvode_mem, &nli);
check_retval(&retval, "CVodeGetNumLinIters", 1);
retval = CVodeGetNumPrecEvals(cvode_mem, &npe);
check_retval(&retval, "CVodeGetNumPrecEvals", 1);
retval = CVodeGetNumPrecSolves(cvode_mem, &nps);
check_retval(&retval, "CVodeGetNumPrecSolves", 1);
retval = CVodeGetNumLinConvFails(cvode_mem, &ncfl);
check_retval(&retval, "CVodeGetNumLinConvFails", 1);
retval = CVodeGetNumLinRhsEvals(cvode_mem, &nfeLS);
check_retval(&retval, "CVodeGetNumLinRhsEvals", 1);
printf("\nFinal Statistics.. \n\n");
printf("lenrw = %5ld leniw = %5ld\n" , lenrw, leniw);
printf("lenrwLS = %5ld leniwLS = %5ld\n" , lenrwLS, leniwLS);
printf("nst = %5ld\n" , nst);
printf("nfe = %5ld nfeLS = %5ld\n" , nfe, nfeLS);
printf("nni = %5ld nli = %5ld\n" , nni, nli);
printf("nsetups = %5ld netf = %5ld\n" , nsetups, netf);
printf("npe = %5ld nps = %5ld\n" , npe, nps);
printf("ncfn = %5ld ncfl = %5ld\n\n", ncfn, ncfl);
if (linsolver < 2)
printf("======================================================================\n\n");
}