Hi,
The attached patch fixes a couple of minor problems in the TwoPunctures thorn:
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.
Regards, Barry Wardell
Hello Barry, all,
Thank you for the patch.
- 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.
- 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.
The patch looks good to me. I would likely remove the explicit cast to (double) in the assignment to new_mass since new_mass is CCTK_REAL as are *mp and *mm. The casts to (double) in sprintf and CCTK_VInfo seem like a cautious thing to do in case CCTK_REAL is ever "long double", (since floats are always promoted to double for vararg functions).
Yours, Roland
Hi Roland,
Thanks for reviewing the patch.
On 13/05/2010 17:32, Roland Haas wrote:
Hello Barry, all,
Thank you for the patch.
- 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.
- 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.
The patch looks good to me. I would likely remove the explicit cast to (double) in the assignment to new_mass since new_mass is CCTK_REAL as are *mp and *mm. The casts to (double) in sprintf and CCTK_VInfo seem like a cautious thing to do in case CCTK_REAL is ever "long double", (since floats are always promoted to double for vararg functions).
Part of this patch removes the explicit cast to double in the assignment to new_mass as you suggest. I've just noticed that there is a similar cast in the assignment to old_mass which I think should also be removed.
Regards Barry
Hello Barry,
Part of this patch removes the explicit cast to double in the assignment to new_mass as you suggest. I've just noticed that there is a similar cast in the assignment to old_mass which I think should also be removed.
I don't see, to see this second patch. Did you forget to attach it? I'll commit the patch to TwoPunctures once I receive it unless I hear any objections.
Yours, Roland
Hi Roland,
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.
Barry
On 14/05/2010 02:52, Roland Haas wrote:
Hello Barry,
Part of this patch removes the explicit cast to double in the assignment to new_mass as you suggest. I've just noticed that there is a similar cast in the assignment to old_mass which I think should also be removed.
I don't see, to see this second patch. Did you forget to attach it? I'll commit the patch to TwoPunctures once I receive it unless I hear any objections.
Yours, Roland
users@lists.einsteintoolkit.org