@@ -202,19 +202,17 @@ Abstract Type for all NonlinearSolve.jl Caches.
202202abstract type AbstractNonlinearSolveCache{iip, timeit} end
203203
204204function SymbolicIndexingInterface. symbolic_container (cache:: AbstractNonlinearSolveCache )
205- cache. prob
205+ return cache. prob
206206end
207207function SymbolicIndexingInterface. parameter_values (cache:: AbstractNonlinearSolveCache )
208- parameter_values (symbolic_container (cache))
208+ return parameter_values (symbolic_container (cache))
209209end
210210function SymbolicIndexingInterface. state_values (cache:: AbstractNonlinearSolveCache )
211- state_values (symbolic_container (cache))
211+ return state_values (symbolic_container (cache))
212212end
213213
214214function Base. getproperty (cache:: AbstractNonlinearSolveCache , sym:: Symbol )
215- if sym == :ps
216- return ParameterIndexingProxy (cache)
217- end
215+ sym == :ps && return ParameterIndexingProxy (cache)
218216 return getfield (cache, sym)
219217end
220218
@@ -230,10 +228,16 @@ function __show_cache(io::IO, cache::AbstractNonlinearSolveCache, indent = 0)
230228 println (io, " $(nameof (typeof (cache))) (" )
231229 __show_algorithm (io, cache. alg,
232230 (" " ^ (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+
237241 println (io, " " ^ (indent + 4 ) * " nsteps = " , cache. stats. nsteps, " ," )
238242 println (io, " " ^ (indent + 4 ) * " retcode = " , cache. retcode)
239243 print (io, " " ^ (indent) * " )" )
0 commit comments