A Newton solve for the steady state of a discretised nonlinear diffusion operator on…
PHYSICS · Multi-part · Fermi University Physics · Computational Physics · Scientific programming for physicists · Scientific programming for physicists
Scientific Computing for Physicists, Ch The numerical toolkit closed: backward error and the audit of a library routine
Problem
A Newton solve for the steady state of a discretised nonlinear diffusion operator on a square grid of Ng=200 points per side (so N=Ng2=40000 unknowns) needs the Jacobian J=∂Fi/∂xj of a five-point finite-difference stencil at every Newton step. For a clean count, assume every row of J has exactly 5 nonzero entries (the interior stencil count, ignoring the reduction at the boundary).
((a)) Using binary64 (8 bytes per entry) and storing J as a dense N×N array, compute the number of bytes needed.
((b)) J is instead stored in compressed sparse row (CSR) format: one binary64 value and one 4-byte column index per nonzero entry, plus one 4-byte row-pointer integer for each of the N+1 rows. Compute the number of bytes needed for this sparse storage.
((c)) Give the ratio of the dense to the sparse storage, and state in one sentence why Newton's method for systems on a discretised operator at this grid size is only practical in the sparse representation.