diff options
author | rhaas <rhaas@b2a53a04-0f4f-0410-87ed-f9f25ced00cf> | 2010-05-16 19:54:00 +0000 |
---|---|---|
committer | rhaas <rhaas@b2a53a04-0f4f-0410-87ed-f9f25ced00cf> | 2010-05-16 19:54:00 +0000 |
commit | ddf2734f87761928bbf50965d1d623fc885bf9ac (patch) | |
tree | 76a35f44def437c133fe3b1d542b441d6c606168 /src/Newton.c | |
parent | d7765676a3157e8c9d63e5c7bab17e0fa6caf062 (diff) |
TwoPunctures: improve search for ADM masses of black holes
Incorporates the additions by Barry Wardell:
1) When the bare masses are not given as parameters (give_bare_mass=no), they
are calculated at double precision, but the par_m_plus and par_m_minus
parameters are then only set at single precision.
2) When the bare masses have been calculated, they are printed to stdout. In
some cases, the initial guess for the bare mass is printed rather than the
final calculated bare mass.
3) After looking at this section of code further, it seems that the termination
criterion for the bare mass search could be improved. Attached is an updated
patch which implements and improved check. It now continues trying to find the
bare masses until the ADM masses are within a specified tolerance of their
target. Other than the change in termination criterion, the algorithm is
unchanged, although I have simplified the calculation of a new bare mass guess
somewhat.
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinInitialData/TwoPunctures/trunk@103 b2a53a04-0f4f-0410-87ed-f9f25ced00cf
Diffstat (limited to 'src/Newton.c')
-rw-r--r-- | src/Newton.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/Newton.c b/src/Newton.c index 54fad9e..a33b564 100644 --- a/src/Newton.c +++ b/src/Newton.c @@ -518,8 +518,12 @@ Newton (CCTK_POINTER_TO_CONST const cctkGH, #pragma omp parallel for for (int j = 0; j < ntotal; j++) dv.d0[j] = 0; - printf ("Newton: it=%d \t |F|=%e\n", it, (double)dmax); - printf ("bare mass: mp=%g \t mm=%g\n", (double) par_m_plus, (double) par_m_minus); + + if(verbose==1){ + printf ("Newton: it=%d \t |F|=%e\n", it, (double)dmax); + printf ("bare mass: mp=%g \t mm=%g\n", (double) par_m_plus, (double) par_m_minus); + } + fflush(stdout); ii = bicgstab (cctkGH, @@ -536,7 +540,10 @@ Newton (CCTK_POINTER_TO_CONST const cctkGH, F_of_v (cctkGH, nvar, n1, n2, n3, v, F, u); dmax = norm_inf (F, ntotal); } - printf ("Newton: it=%d \t |F|=%e \n", it, (double)dmax); + + if(verbose==1) + printf ("Newton: it=%d \t |F|=%e \n", it, (double)dmax); + fflush(stdout); free_dvector (F, 0, ntotal - 1); |