diff --git a/include/arkode/arkode_lsrkstep.h b/include/arkode/arkode_lsrkstep.h index 86ccbda380..63c8c49e68 100644 --- a/include/arkode/arkode_lsrkstep.h +++ b/include/arkode/arkode_lsrkstep.h @@ -29,6 +29,13 @@ typedef int (*ARKSprFn)(sunrealtype t, sunrealtype* extsprad, void* user_data); * LSRKStep Constants * ------------------ */ +/* Method ID for RKC*/ +#define RKC 1 +/* Method ID for RKL*/ +#define RKL 2 +/* Method ID for RKG*/ +#define RKG 3 + /* ------------------- * Exported Functions * ------------------- */ @@ -38,17 +45,17 @@ typedef int (*ARKSprFn)(sunrealtype t, sunrealtype* extsprad, void* user_data); SUNDIALS_EXPORT void* LSRKStepCreate(ARKRhsFn fe, ARKRhsFn fi, sunrealtype t0, N_Vector y0, SUNContext sunctx); -SUNDIALS_EXPORT int LSRKodeSetMethod(void* arkode_mem, int method); +SUNDIALS_EXPORT int LSRKStepSetMethod(void* arkode_mem, int method); -SUNDIALS_EXPORT int LSRKodeSetSprRadFn(void* arkode_mem, ARKSprFn spr); +SUNDIALS_EXPORT int LSRKStepSetSprRadFn(void* arkode_mem, ARKSprFn spr); -SUNDIALS_EXPORT int LSRKodeSetConstJac(void* arkode_mem); +SUNDIALS_EXPORT int LSRKStepSetConstJac(void* arkode_mem); -SUNDIALS_EXPORT int LSRKodeSetSprRadFrequency(void* arkode_mem, int nsteps); +SUNDIALS_EXPORT int LSRKStepSetSprRadFrequency(void* arkode_mem, int nsteps); -SUNDIALS_EXPORT int LSRKodeSetMaxStageNum(void* arkode_mem, int stagemaxlimit); +SUNDIALS_EXPORT int LSRKStepSetMaxStageNum(void* arkode_mem, int stagemaxlimit); -SUNDIALS_EXPORT int LSRKodeSetSprRadSafetyFactor(void* arkode_mem, +SUNDIALS_EXPORT int LSRKStepSetSprRadSafetyFactor(void* arkode_mem, sunrealtype sprsfty); SUNDIALS_EXPORT int LSRKStepReInit(void* arkode_mem, ARKRhsFn fe, ARKRhsFn fi, @@ -72,4 +79,4 @@ SUNDIALS_EXPORT int LSRKStepGetTimestepperStats( } #endif -#endif +#endif \ No newline at end of file diff --git a/src/arkode/arkode_lsrkstep.c b/src/arkode/arkode_lsrkstep.c index 87d4d60992..f9fcbcc9c8 100644 --- a/src/arkode/arkode_lsrkstep.c +++ b/src/arkode/arkode_lsrkstep.c @@ -978,10 +978,9 @@ sunbooleantype lsrkStep_CheckNVector(N_Vector tmpl) } /*--------------------------------------------------------------- - lsrkStep_SprRadUpdateLogic: + lsrkStep_ComputeNewSprRad: - This routine checks if the step is accepted or not and reassigns - the SprRad update flags accordingly. + This routine computes new SprRad and returns SUN_SUCCESS. ---------------------------------------------------------------*/ int lsrkStep_ComputeNewSprRad(ARKodeMem ark_mem, ARKodeLSRKStepMem step_mem) @@ -998,7 +997,7 @@ int lsrkStep_ComputeNewSprRad(ARKodeMem ark_mem, ARKodeLSRKStepMem step_mem) { printf("\nInternal SprRad is not supported yet!"); printf( - "\nCall LSRKodeSetSprRadFn to provide an external SprRad function\n"); + "\nCall LSRKStepSetSprRadFn to provide an external SprRad function\n"); return (ARK_ILL_INPUT); } @@ -1043,4 +1042,4 @@ void lsrkStep_SprRadUpdateLogic(ARKodeMem ark_mem, ARKodeLSRKStepMem step_mem, /*=============================================================== EOF - ===============================================================*/ + ===============================================================*/ \ No newline at end of file diff --git a/src/arkode/arkode_lsrkstep_impl.h b/src/arkode/arkode_lsrkstep_impl.h index a2e0833d76..568eac27b5 100644 --- a/src/arkode/arkode_lsrkstep_impl.h +++ b/src/arkode/arkode_lsrkstep_impl.h @@ -111,7 +111,6 @@ int lsrkStep_AccessStepMem(ARKodeMem ark_mem, const char* fname, void lsrkStep_SprRadUpdateLogic(ARKodeMem ark_mem, ARKodeLSRKStepMem step_mem, sunrealtype dsm); sunbooleantype lsrkStep_CheckNVector(N_Vector tmpl); -int lsrkStep_ComputeNewSprRad(ARKodeMem ark_mem, ARKodeLSRKStepMem step_mem); /*=============================================================== Reusable LSRKStep Error Messages @@ -124,4 +123,4 @@ int lsrkStep_ComputeNewSprRad(ARKodeMem ark_mem, ARKodeLSRKStepMem step_mem); } #endif -#endif +#endif \ No newline at end of file diff --git a/src/arkode/arkode_lsrkstep_io.c b/src/arkode/arkode_lsrkstep_io.c index 762c451e43..7f8a4e21ea 100644 --- a/src/arkode/arkode_lsrkstep_io.c +++ b/src/arkode/arkode_lsrkstep_io.c @@ -32,12 +32,12 @@ ===============================================================*/ /*--------------------------------------------------------------- - LSRKodeSetMethod sets method - RKC => method = 1 - RKL => method = 2 - RKG => method = 3 + LSRKStepSetMethod sets method + RKC => method = RKC + RKL => method = RKL + RKG => method = RKG ---------------------------------------------------------------*/ -int LSRKodeSetMethod(void* arkode_mem, int method) +int LSRKStepSetMethod(void* arkode_mem, int method) { ARKodeMem ark_mem; ARKodeLSRKStepMem step_mem; @@ -50,15 +50,15 @@ int LSRKodeSetMethod(void* arkode_mem, int method) switch (method) { - case 1: + case RKC: ark_mem->step = lsrkStep_TakeStepRKC; printf("\nSolving with RKC method\n\n"); break; - case 2: + case RKL: ark_mem->step = lsrkStep_TakeStepRKL; printf("\nSolving with RKL method\n\n"); break; - case 3: + case RKG: ark_mem->step = lsrkStep_TakeStepRKG; printf("\nSolving with RKG method\n\n"); break; @@ -73,9 +73,9 @@ int LSRKodeSetMethod(void* arkode_mem, int method) } /*--------------------------------------------------------------- - LSRKodeSetSprRadFn specifies the SprRad function. + LSRKStepSetSprRadFn specifies the SprRad function. ---------------------------------------------------------------*/ -int LSRKodeSetSprRadFn(void* arkode_mem, ARKSprFn spr) +int LSRKStepSetSprRadFn(void* arkode_mem, ARKSprFn spr) { ARKodeMem ark_mem; ARKodeLSRKStepMem step_mem; @@ -106,9 +106,9 @@ int LSRKodeSetSprRadFn(void* arkode_mem, ARKSprFn spr) } /*--------------------------------------------------------------- - LSRKodeSetConstJac sets Constant Jacobian. + LSRKStepSetConstJac sets Constant Jacobian. ---------------------------------------------------------------*/ -int LSRKodeSetConstJac(void* arkode_mem) +int LSRKStepSetConstJac(void* arkode_mem) { ARKodeMem ark_mem; ARKodeLSRKStepMem step_mem; @@ -125,10 +125,10 @@ int LSRKodeSetConstJac(void* arkode_mem) } /*--------------------------------------------------------------- - LSRKodeSetSprRadFrequency sets SprRad computation frequency - + LSRKStepSetSprRadFrequency sets SprRad computation frequency - Spectral Radius is recomputed after "nsteps" successful steps. ---------------------------------------------------------------*/ -int LSRKodeSetSprRadFrequency(void* arkode_mem, int nsteps) +int LSRKStepSetSprRadFrequency(void* arkode_mem, int nsteps) { ARKodeMem ark_mem; ARKodeLSRKStepMem step_mem; @@ -152,9 +152,9 @@ int LSRKodeSetSprRadFrequency(void* arkode_mem, int nsteps) } /*--------------------------------------------------------------- - LSRKodeSetMaxStageNum sets the maximum number of stages allowed. + LSRKStepSetMaxStageNum sets the maximum number of stages allowed. ---------------------------------------------------------------*/ -int LSRKodeSetMaxStageNum(void* arkode_mem, int stagemaxlimit) +int LSRKStepSetMaxStageNum(void* arkode_mem, int stagemaxlimit) { ARKodeMem ark_mem; ARKodeLSRKStepMem step_mem; @@ -178,9 +178,9 @@ int LSRKodeSetMaxStageNum(void* arkode_mem, int stagemaxlimit) } /*--------------------------------------------------------------- - LSRKodeSetSprRadSafetyFactor sets the maximum number of stages allowed. + LSRKStepSetSprRadSafetyFactor sets the maximum number of stages allowed. ---------------------------------------------------------------*/ -int LSRKodeSetSprRadSafetyFactor(void* arkode_mem, sunrealtype sprsfty) +int LSRKStepSetSprRadSafetyFactor(void* arkode_mem, sunrealtype sprsfty) { ARKodeMem ark_mem; ARKodeLSRKStepMem step_mem; @@ -444,6 +444,7 @@ int lsrkStep_WriteParameters(ARKodeMem ark_mem, FILE* fp) /* print integrator parameters to file */ fprintf(fp, "LSRKStep time step module parameters:\n"); + fprintf(fp, " Method order %i\n", NULL); fprintf(fp, "\n"); printf("\nlsrkStep_WriteParameters is not ready yet!\n"); @@ -453,4 +454,4 @@ int lsrkStep_WriteParameters(ARKodeMem ark_mem, FILE* fp) /*=============================================================== EOF - ===============================================================*/ + ===============================================================*/ \ No newline at end of file