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=200N_{\rm g}=200 points per side (so N=Ng2=40 000N=N_{\rm g}^2=40\,000 unknowns) needs the Jacobian J=∂Fi/∂xjJ=\partial F_i/\partial x_j of a five-point finite-difference stencil at every Newton step. For a clean count, assume every row of JJ has exactly 55 nonzero entries (the interior stencil count, ignoring the reduction at the boundary). ((a)) Using binary64 (8 bytes per entry) and storing JJ as a dense N×NN\times N array, compute the number of bytes needed. ((b)) JJ 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+1N+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.

Browse the problem library