Skip to content

Commit

Permalink
number of stages
Browse files Browse the repository at this point in the history
  • Loading branch information
maggul committed Nov 14, 2024
1 parent 7e1c978 commit b7343d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/arkode/C_serial/ark_analytic_ssprk.out
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Inequality constraint fails = 0
Initial step size = 1.930101110942615e-10
Last step size = 0.02305133855414821
Current step size = 0.02305133855414821
RHS fn evals = 9435
RHS fn evals = 9434
Number of stages used = 9

ACCURACY at the final time = 1.69688e-09
7 changes: 3 additions & 4 deletions src/arkode/arkode_lsrkstep.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <sundials/sundials_context.h>
#include <sundials/sundials_math.h>

Expand Down Expand Up @@ -545,7 +544,7 @@ int lsrkStep_TakeStepRKC(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr)
}
}

step_mem->req_stages = SUNMIN(ss, INT_MAX);
step_mem->req_stages = (int)ss;
step_mem->stage_max = SUNMAX(step_mem->req_stages, step_mem->stage_max);

#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG
Expand Down Expand Up @@ -832,7 +831,7 @@ int lsrkStep_TakeStepRKL(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr)
}
}

step_mem->req_stages = SUNMIN(ss, INT_MAX);
step_mem->req_stages = (int)ss;
step_mem->stage_max = SUNMAX(step_mem->req_stages, step_mem->stage_max);

#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG
Expand Down Expand Up @@ -1256,7 +1255,7 @@ int lsrkStep_TakeStepSSPs3(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr
sunrealtype rs = (sunrealtype)step_mem->req_stages;
sunrealtype rn = SUNRsqrt(rs);
sunrealtype rat = ONE / (rs - rn);
int in = SUNMIN(SUNRround(rn), INT_MAX);
int in = (int)rn;

#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG
SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG,
Expand Down

0 comments on commit b7343d5

Please sign in to comment.