Skip to content

Commit f30ebc8

Browse files
committed
Moved check for controller type to only occur for adaptive runs
1 parent 3f24c50 commit f30ebc8

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

src/arkode/arkode_mristep.c

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,17 +1233,6 @@ int mriStep_Init(ARKodeMem ark_mem, int init_type)
12331233
}
12341234
}
12351235

1236-
/* get timestep adaptivity type, and return an error if an
1237-
incompatible type is detected */
1238-
adapt_type = SUNAdaptController_GetType(ark_mem->hadapt_mem->hcontroller);
1239-
if ((adapt_type != SUN_ADAPTCONTROLLER_MRI_TOL) &&
1240-
(adapt_type != SUN_ADAPTCONTROLLER_H))
1241-
{
1242-
arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__,
1243-
"SUNAdaptController type is unsupported by MRIStep");
1244-
return (ARK_ILL_INPUT);
1245-
}
1246-
12471236
/*** Perform timestep adaptivity checks and initial setup ***/
12481237

12491238
if (ark_mem->fixedstep)
@@ -1259,6 +1248,18 @@ int mriStep_Init(ARKodeMem ark_mem, int init_type)
12591248
}
12601249
else
12611250
{
1251+
1252+
/* get timestep adaptivity type, and return an error if an
1253+
incompatible type is detected */
1254+
adapt_type = SUNAdaptController_GetType(ark_mem->hadapt_mem->hcontroller);
1255+
if ((adapt_type != SUN_ADAPTCONTROLLER_MRI_TOL) &&
1256+
(adapt_type != SUN_ADAPTCONTROLLER_H))
1257+
{
1258+
arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__,
1259+
"SUNAdaptController type is unsupported by MRIStep");
1260+
return (ARK_ILL_INPUT);
1261+
}
1262+
12621263
/* Controller provides adaptivity (at least at the slow time scale):
12631264
- verify that the MRI method includes an embedding, and
12641265
- estimate initial slow step size (store in ark_mem->hin) */

0 commit comments

Comments
 (0)