diff options
author | Ian Hinder <ian.hinder@aei.mpg.de> | 2010-09-29 00:54:41 +0100 |
---|---|---|
committer | Ian Hinder <ian.hinder@aei.mpg.de> | 2010-09-29 00:54:41 +0100 |
commit | 2417f7def1e90a9b43ab2623c971a74342d7ef41 (patch) | |
tree | 5593c33ebc52eb759a4bc7b8f47fa42ad79e334f | |
parent | 8ef294bcdc0cb258b6302457376cfaf1ddae6082 (diff) |
Differencing.m: Add DiffPlusOp and DiffMinusOp
These operators take forward and backward differences without dividing by the grid spacing.
-rw-r--r-- | Tools/CodeGen/Differencing.m | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Tools/CodeGen/Differencing.m b/Tools/CodeGen/Differencing.m index d6b9d26..32c5ddb 100644 --- a/Tools/CodeGen/Differencing.m +++ b/Tools/CodeGen/Differencing.m @@ -136,6 +136,8 @@ StandardCenteredDifferenceOperator::usage = ""; GridFunctionDerivativesInExpression::usage = ""; DPlus::usage = ""; DMinus::usage = ""; +DiffPlusOp::usage = ""; +DiffMinusOp::usage = ""; DZero::usage = ""; shift::usage = ""; spacing::usage = ""; @@ -145,6 +147,8 @@ Begin["`Private`"]; 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; (*************************************************************) |