Generate the gradient and Laplacian operators. s = divand_operators(mask,pmn,nu,iscyclic) Form sparse matrixes representing the gradient and Laplacian using finite differences Input: mask: binary mask delimiting the domain. 1 is inside and 0 outside. For oceanographic application, this is the land-sea mask. pmn: scale factor of the grid. nu: diffusion coefficient of the Laplacian Output: s: stucture containing s.Dx: cell array of the gradient s.D: Laplaciant s.sv: structure describing the state vector s.mask: land-sea mask s.WE: diagonal matrix where each element is the surface of a grid cell
Package: divand