diff options
author | Erik Schnetter <schnetter@cct.lsu.edu> | 2010-01-25 18:14:47 -0600 |
---|---|---|
committer | Erik Schnetter <schnetter@cct.lsu.edu> | 2010-01-25 18:14:47 -0600 |
commit | 08571b14f158653ced2d954f75b36b4105a582e2 (patch) | |
tree | 4ff8b3689747f3687fa2349372e4b35c42baf51f /m | |
parent | b34404d76b7ffbc9088fb0efc44380229c6d3132 (diff) |
Avoid division-by-zero problems when ShiftGammaCoeff=0
Diffstat (limited to 'm')
-rw-r--r-- | m/McLachlan_BSSN.m | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/m/McLachlan_BSSN.m b/m/McLachlan_BSSN.m index da0bd80..c6a4dae 100644 --- a/m/McLachlan_BSSN.m +++ b/m/McLachlan_BSSN.m @@ -345,12 +345,21 @@ convertFromADMBaseGammaCalc = A -> - dtalp / (harmonicF alpha^harmonicN) (LapseAdvectionCoeff - 1), - B1 -> 1/ShiftGammaCoeff - (dtbetax - ShiftAdvectionCoeff beta[ua] PDu[beta1,la]), - B2 -> 1/ShiftGammaCoeff - (dtbetay - ShiftAdvectionCoeff beta[ua] PDu[beta2,la]), - B3 -> 1/ShiftGammaCoeff - (dtbetaz - ShiftAdvectionCoeff beta[ua] PDu[beta3,la]) + (* If ShiftGammaCoeff=0, then B^i is not evolved, in the sense + that it does not influence the time evolution of other + variables. *) + B1 -> IfThen[ShiftGammaCoeff, + 1/ShiftGammaCoeff + (dtbetax - ShiftAdvectionCoeff beta[ua] PDu[beta1,la]), + 0], + B2 -> IfThen[ShiftGammaCoeff, + 1/ShiftGammaCoeff + (dtbetay - ShiftAdvectionCoeff beta[ua] PDu[beta2,la]), + 0], + B3 -> IfThen[ShiftGammaCoeff, + 1/ShiftGammaCoeff + (dtbetaz - ShiftAdvectionCoeff beta[ua] PDu[beta3,la]), + 0] } }; |