diff options
author | knarf <knarf@b2a53a04-0f4f-0410-87ed-f9f25ced00cf> | 2005-02-16 12:23:03 +0000 |
---|---|---|
committer | knarf <knarf@b2a53a04-0f4f-0410-87ed-f9f25ced00cf> | 2005-02-16 12:23:03 +0000 |
commit | cb207efdd29c16a329e7b462a680a0b844fd5ca1 (patch) | |
tree | 2de913905ae5d2aa6c6e34ab62ac3ee9aa1f4c2e /src/TwoPunctures.c | |
parent | da4c9a8aacb9af3ba9227629c6b34261ef0ee4bb (diff) |
better debug output,
fixed initial guess setting
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinInitialData/TwoPunctures/trunk@34 b2a53a04-0f4f-0410-87ed-f9f25ced00cf
Diffstat (limited to 'src/TwoPunctures.c')
-rw-r--r-- | src/TwoPunctures.c | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/src/TwoPunctures.c b/src/TwoPunctures.c index 5d1f792..c3bd889 100644 --- a/src/TwoPunctures.c +++ b/src/TwoPunctures.c @@ -59,32 +59,28 @@ void set_initial_guess(CCTK_POINTER_TO_CONST cctkGH, rx3_To_xyz (nvar, s_x[i3D], r, phi, &(s_y[i3D]), &(s_z[i3D]), U); } Set_Initial_Guess_for_u(cctkGH, n1*n2*n3, v.d0, s_x, s_y, s_z); - - if (do_initial_debug_output) - debug_file=fopen("initial.dat", "w"); for (i = 0; i < n1; i++) for (j = 0; j < n2; j++) - { for (k = 0; k < n3; k++) { - indx=Index(0,i,j,k,1,n1,n2,n3); - tmp_r= s_x[indx]*s_x[indx]+ - s_y[indx]*s_y[indx]+ - s_z[indx]*s_z[indx]; - v.d0[indx]/=-tmp_r/((sqrt(tmp_r)+10)*(sqrt(tmp_r)+10))+1; + indx = Index(0,i,j,k,1,n1,n2,n3); + v.d0[indx]/=(-cos(Pih * (2 * i + 1) / n1)-1.0); } - indx=Index(0,i,j,0,1,n1,n2,n3); - if (do_initial_debug_output) + Derivatives_AB3 (nvar, n1, n2, n3, v); + if (do_initial_debug_output) + { + debug_file=fopen("initial.dat", "w"); + for (i = 0; i < n1; i++) + for (j = 0; j < n2; j++) { - fprintf(debug_file, "%.8g %.8g %.8g %.8g %.8g\n", s_x[indx], s_y[indx], + fprintf(debug_file, "%.8g %.8g %.8g %.8g %.8g\n", + s_x[indx], s_y[indx], v.d0[indx], - v.d0[indx]*(-cos(Pih * (2 * i + 1) / n1)-1.0), - (-cos(Pih * (2 * i + 1) / n1)-1.0)); + (-cos(Pih * (2 * i + 1) / n1)-1.0), + v.d1[indx]); } - } - if (do_initial_debug_output) fclose(debug_file); - Derivatives_AB3 (nvar, n1, n2, n3, v); + } free(s_z); free(s_y); free(s_x); @@ -124,7 +120,6 @@ TwoPunctures (CCTK_ARGUMENTS) if (use_external_initial_guess) { set_initial_guess(cctkGH, v); - F_of_v (cctkGH, nvar, n1, n2, n3, v, F, u); } Newton (cctkGH, nvar, n1, n2, n3, v, Newton_tol, Newton_maxit); |