This function computes the residual from indices to points in the
concentration array. ``Up'' refers to the positive
-direction, ``down'' to negative
, ``left'' to negative
and
``right'' to positive
.
static inline PetscScalar ch_residual_2d ( PetscScalar* conc, PetscScalar alpha, PetscScalar beta, PetscScalar mparam, PetscScalar hx, PetscScalar hy, int upup, int upleft, int up, int upright, int leftleft, int left, int current, int right, int rightright, int downleft, int down, int downright, int downdown )
inline PetscScalar ch_residual_2d Returns the residual itself
This calculates the
-term,
times the Laplacian of
,
then subtracts the
-term,
.