@@ -202,19 +202,17 @@ Abstract Type for all NonlinearSolve.jl Caches.
202
202
abstract type AbstractNonlinearSolveCache{iip, timeit} end
203
203
204
204
function SymbolicIndexingInterface. symbolic_container (cache:: AbstractNonlinearSolveCache )
205
- cache. prob
205
+ return cache. prob
206
206
end
207
207
function SymbolicIndexingInterface. parameter_values (cache:: AbstractNonlinearSolveCache )
208
- parameter_values (symbolic_container (cache))
208
+ return parameter_values (symbolic_container (cache))
209
209
end
210
210
function SymbolicIndexingInterface. state_values (cache:: AbstractNonlinearSolveCache )
211
- state_values (symbolic_container (cache))
211
+ return state_values (symbolic_container (cache))
212
212
end
213
213
214
214
function Base. getproperty (cache:: AbstractNonlinearSolveCache , sym:: Symbol )
215
- if sym == :ps
216
- return ParameterIndexingProxy (cache)
217
- end
215
+ sym == :ps && return ParameterIndexingProxy (cache)
218
216
return getfield (cache, sym)
219
217
end
220
218
@@ -230,10 +228,16 @@ function __show_cache(io::IO, cache::AbstractNonlinearSolveCache, indent = 0)
230
228
println (io, " $(nameof (typeof (cache))) (" )
231
229
__show_algorithm (io, cache. alg,
232
230
(" " ^ (indent + 4 )) * " alg = " * string (get_name (cache. alg)), indent + 4 )
233
- println (io, " ," )
234
- println (io, (" " ^ (indent + 4 )) * " u = " , get_u (cache), " ," )
235
- println (io, (" " ^ (indent + 4 )) * " residual = " , get_fu (cache), " ," )
236
- println (io, (" " ^ (indent + 4 )) * " inf-norm(residual) = " , norm (get_fu (cache), Inf ), " ," )
231
+
232
+ ustr = sprint (show, get_u (cache); context= (:compact => true , :limit => true ))
233
+ println (io, " ,\n " * (" " ^ (indent + 4 )) * " u = $(ustr) ," )
234
+
235
+ residstr = sprint (show, get_fu (cache); context= (:compact => true , :limit => true ))
236
+ println (io, (" " ^ (indent + 4 )) * " residual = $(residstr) ," )
237
+
238
+ normstr = sprint (show, norm (get_fu (cache), Inf ); context= (:compact => true , :limit => true ))
239
+ println (io, (" " ^ (indent + 4 )) * " inf-norm(residual) = $(normstr) ," )
240
+
237
241
println (io, " " ^ (indent + 4 ) * " nsteps = " , cache. stats. nsteps, " ," )
238
242
println (io, " " ^ (indent + 4 ) * " retcode = " , cache. retcode)
239
243
print (io, " " ^ (indent) * " )" )
0 commit comments