diff options
author | Ian Hinder <ian.hinder@aei.mpg.de> | 2012-01-22 17:19:18 +0100 |
---|---|---|
committer | Ian Hinder <ian.hinder@aei.mpg.de> | 2012-01-22 17:19:18 +0100 |
commit | 45071fec4db209205c3e0e89f9fc9c2e283ad99d (patch) | |
tree | f62f437a1f8f87a9b355ce1d4cbf3c192f4668c9 /Auxiliary/Cactus | |
parent | 121ff02440893cfabee9899a90048b393dadaa7c (diff) | |
parent | b9dbd186f1d2a8bdaec160fde110d7e160117228 (diff) |
Merge branch 'hydro'
Conflicts:
Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/MathematicaCompat.h
Examples/kranc.th
Tools/CodeGen/Kranc.m
Tools/CodeGen/KrancTensor.m
Tools/CodeGen/Schedule.m
Tools/CodeGen/Thorn.m
Diffstat (limited to 'Auxiliary/Cactus')
-rw-r--r-- | Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/MathematicaCompat.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/MathematicaCompat.h b/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/MathematicaCompat.h index d2a1b0d..72a05f9 100644 --- a/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/MathematicaCompat.h +++ b/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/MathematicaCompat.h @@ -6,6 +6,7 @@ #ifdef KRANC_C # define Abs(x) (fabs(x)) # define Min(x, y) (fmin(x,y)) +# define Min3(x, y, z) (fmin(fmin((x), (y)), (z))) # define Max(x, y) (fmax(x,y)) # define IfThen(x,y,z) ((x) ? (y) : (z)) #else @@ -15,6 +16,18 @@ # define IfThen(x,y,z) ((x)*(y) + (1-(x))*(z)) #endif +#ifdef KRANC_C +# define Sign(x) (copysign(1.0,(x))) +# define ToReal(x) ((CCTK_REAL)(x)) +#else +# define Sign(x) (sgn(x)) +# define ToReal(x) (real((x),kind(khalf))) +#endif + +#define MinMod(x, y) ((x) * (y) < 0 ? 0 : (fabs((x)) < fabs((y)) ? (x) : (y))) + +#define VanLeer(x, y) ((x) * (y) < 0 ? 0 : (Min3(2*fabs(x),2*fabs(y),0.5*(fabs(x)+fabs(y)))*Sign((x)+(y)))) + #define Exp(x) (exp(x)) #define Log(x) (log(x)) @@ -45,9 +58,10 @@ #ifdef KRANC_C # define E M_E # define Pi M_PI + #else # define E 2.71828182845904523536029d0 # define Pi 3.14159265358979323846264d0 #endif -#define UnitStep(x) ((x)>0) +#define StepFunction(x) ((x)>0) |