aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Equations.c4
-rw-r--r--src/TwoPunctures.c8
2 files changed, 10 insertions, 2 deletions
diff --git a/src/Equations.c b/src/Equations.c
index 1c9c5f4..4bbcbef 100644
--- a/src/Equations.c
+++ b/src/Equations.c
@@ -88,6 +88,10 @@ BY_Aijofxyz (double x, double y, double z, double Aij[3][3])
r2_plus = (x - par_b) * (x - par_b) + y * y + z * z;
r2_minus = (x + par_b) * (x + par_b) + y * y + z * z;
+ if (r2_plus < TP_Tiny)
+ r2_plus = TP_Tiny;
+ if (r2_minus < TP_Tiny)
+ r2_minus = TP_Tiny;
r_plus = sqrt (r2_plus);
r_minus = sqrt (r2_minus);
r3_plus = r_plus * r2_plus;
diff --git a/src/TwoPunctures.c b/src/TwoPunctures.c
index 66ee93a..4ae122f 100644
--- a/src/TwoPunctures.c
+++ b/src/TwoPunctures.c
@@ -275,9 +275,9 @@ TwoPunctures (CCTK_ARGUMENTS)
const int ind = CCTK_GFINDEX3D (cctkGH, i, j, k);
- const double r_plus
+ double r_plus
= sqrt(pow2(x[ind] - par_b) + pow2(y[ind]) + pow2(z[ind]));
- const double r_minus
+ double r_minus
= sqrt(pow2(x[ind] + par_b) + pow2(y[ind]) + pow2(z[ind]));
double U;
@@ -294,6 +294,10 @@ TwoPunctures (CCTK_ARGUMENTS)
default:
assert (0);
}
+ if (r_plus < TP_Tiny)
+ r_plus = TP_Tiny;
+ if (r_minus < TP_Tiny)
+ r_minus = TP_Tiny;
const double psi1 = 1
+ 0.5 * par_m_plus / r_plus
+ 0.5 * par_m_minus / r_minus + U;