@@ -34,10 +34,10 @@ Options::Options(py::dict options)
34
34
}
35
35
36
36
using_iterative_solver = false ;
37
- if (linear_solver == " SUNLinSol_Dense" && jacobian == " dense" )
37
+ if (linear_solver == " SUNLinSol_Dense" && ( jacobian == " dense" || jacobian == " none " ) )
38
38
{
39
39
}
40
- else if (linear_solver == " SUNLinSol_LapackDense" && jacobian == " dense" )
40
+ else if (linear_solver == " SUNLinSol_LapackDense" && ( jacobian == " dense" || jacobian == " none " ) )
41
41
{
42
42
}
43
43
else if (linear_solver == " SUNLinSol_KLU" && jacobian == " sparse" )
@@ -54,25 +54,35 @@ Options::Options(py::dict options)
54
54
else if (jacobian == " sparse" )
55
55
{
56
56
throw std::domain_error (
57
- " Unknown linear solver or incompatible options. For a sparse jacobian "
57
+ " Unknown linear solver or incompatible options: "
58
+ " jacobian = \" " + jacobian + " \" linear solver = \" " + linear_solver +
59
+ " \" . For a sparse jacobian "
58
60
" please use the SUNLinSol_KLU linear solver"
59
61
);
60
62
}
61
63
else if (jacobian == " matrix-free" )
62
64
{
63
65
throw std::domain_error (
64
- " Unknown linear solver or incompatible options. For a matrix-free jacobian "
65
- " please use one of the iterative linear solvers: \" SUNLinSol_SPBCGS\" , "
66
- " \" SUNLinSol_SPFGMR\" , \" SUNLinSol_SPGMR\" , or \" SUNLinSol_SPTFQMR\" ."
67
- );
66
+ " Unknown linear solver or incompatible options. "
67
+ " jacobian = \" " + jacobian + " \" linear solver = \" " + linear_solver +
68
+ " \" . For a matrix-free jacobian "
69
+ " please use one of the iterative linear solvers: \" SUNLinSol_SPBCGS\" , "
70
+ " \" SUNLinSol_SPFGMR\" , \" SUNLinSol_SPGMR\" , or \" SUNLinSol_SPTFQMR\" ."
71
+ );
72
+ }
73
+ else if (jacobian == " none" )
74
+ {
75
+ throw std::domain_error (
76
+ " Unknown linear solver or incompatible options: "
77
+ " jacobian = \" " + jacobian + " \" linear solver = \" " + linear_solver +
78
+ " \" . For no jacobian please use the SUNLinSol_Dense solver"
79
+ );
68
80
}
69
81
else
70
82
{
71
83
throw std::domain_error (
72
- " Unknown linear solver \" " s + linear_solver +
73
- " \" , use one of \" SUNLinSol_KLU\" , \" SUNLinSol_Dense\" , "
74
- " \" SUNLinSol_LapackDense\" , \" SUNLinSol_SPBCGS\" , \" SUNLinSol_SPFGMR\" , "
75
- " \" SUNLinSol_SPGMR\" , or \" SUNLinSol_SPTFQMR\" "
84
+ " Unknown linear solver or incompatible options. "
85
+ " jacobian = \" " + jacobian + " \" linear solver = \" " + linear_solver + " \" "
76
86
);
77
87
}
78
88
0 commit comments