@@ -657,6 +657,14 @@ function __construct_problem(
657657end
658658
659659__firk_iip_ad_diffmode (:: Val{true} , :: AutoEnzyme ) = AutoForwardDiff ()
660+ __firk_iip_ad_diffmode (:: Val{true} , :: AutoMooncake ) = AutoForwardDiff ()
661+ function __firk_iip_ad_diffmode (iip, diffmode:: AutoSparse )
662+ return AutoSparse (
663+ __firk_iip_ad_diffmode (iip, get_dense_ad (diffmode));
664+ sparsity_detector = __default_sparsity_detector (diffmode),
665+ coloring_algorithm = __default_coloring_algorithm (diffmode)
666+ )
667+ end
660668__firk_iip_ad_diffmode (_, diffmode) = diffmode
661669
662670__firk_iip_needs_diffcache (iip, diffmode:: AutoSparse ) = __firk_iip_needs_diffcache (
@@ -754,7 +762,7 @@ function __construct_problem(
754762 ) where {iip, T, DC, tune_parameters, BC, C, LF}
755763 (; prob, alg, stage, bcresid_prototype, f_prototype) = cache
756764 (; jac_alg) = alg
757- (; bc_diffmode) = jac_alg
765+ bc_diffmode = __firk_iip_ad_diffmode ( Val (iip), jac_alg. bc_diffmode)
758766 N = length (cache. mesh)
759767
760768 resid_bc = cache. bcresid_prototype
@@ -844,7 +852,7 @@ function __construct_problem(
844852 ) where {iip, T, DC, tune_parameters, BC, C, LF}
845853 (; prob, alg, stage, bcresid_prototype, f_prototype) = cache
846854 (; jac_alg) = alg
847- (; bc_diffmode) = jac_alg
855+ bc_diffmode = __firk_iip_ad_diffmode ( Val (iip), jac_alg. bc_diffmode)
848856 N = length (cache. mesh)
849857
850858 resid_bc = cache. bcresid_prototype
@@ -1110,7 +1118,7 @@ function __construct_problem(
11101118 loss:: LF , :: StandardBVProblem , :: Val{true}
11111119 ) where {iip, T, DC, tune_parameters, BC, C, LF}
11121120 (; jac_alg) = cache. alg
1113- (; bc_diffmode) = jac_alg
1121+ bc_diffmode = __firk_iip_ad_diffmode ( Val (iip), jac_alg. bc_diffmode)
11141122 (; bcresid_prototype, f_prototype) = cache
11151123 N = length (cache. mesh)
11161124 resid_bc = cache. bcresid_prototype
@@ -1196,7 +1204,7 @@ function __construct_problem(
11961204 loss:: LF , :: StandardBVProblem , :: Val{false}
11971205 ) where {iip, T, DC, tune_parameters, BC, C, LF}
11981206 (; jac_alg) = cache. alg
1199- (; bc_diffmode) = jac_alg
1207+ bc_diffmode = __firk_iip_ad_diffmode ( Val (iip), jac_alg. bc_diffmode)
12001208 (; bcresid_prototype, f_prototype, prob) = cache
12011209 N = length (cache. mesh)
12021210 resid_bc = cache. bcresid_prototype
0 commit comments