Skip to content

Commit

Permalink
Differencing.m: Add DiffPlusOp and DiffMinusOp
Browse files Browse the repository at this point in the history
These operators take forward and backward differences without dividing by the grid spacing.
  • Loading branch information
ianhinder committed Sep 28, 2010
1 parent 8ef294b commit 2417f7d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Tools/CodeGen/Differencing.m
Expand Up @@ -136,6 +136,8 @@ A GridFunctionDerivative (GFD) is an expression of the form
GridFunctionDerivativesInExpression::usage = "";
DPlus::usage = "";
DMinus::usage = "";
DiffPlusOp::usage = "";
DiffMinusOp::usage = "";
DZero::usage = "";
shift::usage = "";
spacing::usage = "";
Expand All @@ -145,6 +147,8 @@ A GridFunctionDerivative (GFD) is an expression of the form

DPlus[n_] := (shift[n] - 1)/spacing[n];
DMinus[n_] := (1 - 1/shift[n])/spacing[n];
DiffPlusOp[n_] := (shift[n] - 1);
DiffMinusOp[n_] := (1 - 1/shift[n]);
DZero[n_] := (DPlus[n] + DMinus[n])/2;

(*************************************************************)
Expand Down

0 comments on commit 2417f7d

Please sign in to comment.