diff options
author | goodale <goodale@50555cc7-fb31-491a-85db-9a2874240742> | 2000-03-29 07:42:18 +0000 |
---|---|---|
committer | goodale <goodale@50555cc7-fb31-491a-85db-9a2874240742> | 2000-03-29 07:42:18 +0000 |
commit | ed3cf91b28bead60b68fa95e0829ab8a7d68b64e (patch) | |
tree | 36aff42d1af9000e07722827eec1e698520aad7e | |
parent | 06b619c73980740e6ce2bce7ed7bbc6b6a72e002 (diff) |
Changed to use timelevels - thanks for putting the rotation in PUGH Ed.
Note that the no-boundary condition tests assumed that phi_new had zero
at its boundaries. This is, or course, no longer true with timelevel
rotation.
Tom
git-svn-id: http://svn.cactuscode.org/arrangements/CactusWave/WaveToyCXX/trunk@22 50555cc7-fb31-491a-85db-9a2874240742
-rw-r--r-- | interface.ccl | 12 | ||||
-rw-r--r-- | schedule.ccl | 1 | ||||
-rw-r--r-- | src/InitSymBound.cc | 18 | ||||
-rw-r--r-- | src/WaveToy.cc | 33 | ||||
-rw-r--r-- | test/test_wavetoycxx/phi.dl | 4 | ||||
-rw-r--r-- | test/test_wavetoycxx/phi.xl | 92 | ||||
-rw-r--r-- | test/test_wavetoycxx/phi.yl | 92 | ||||
-rw-r--r-- | test/test_wavetoycxx/phi_max.tl | 6 | ||||
-rw-r--r-- | test/test_wavetoycxx/phi_min.tl | 2 | ||||
-rw-r--r-- | test/test_wavetoycxx/phi_nm1.tl | 10 | ||||
-rw-r--r-- | test/test_wavetoycxx/phi_nm2.tl | 4 |
11 files changed, 125 insertions, 149 deletions
diff --git a/interface.ccl b/interface.ccl index 679343c..969469f 100644 --- a/interface.ccl +++ b/interface.ccl @@ -2,20 +2,16 @@ # $Header$ implements: wavetoy + +USES INCLUDE: Boundary.h +USES INCLUDE: Symmetry.h public: -cctk_real scalarevolve type = GF +cctk_real scalarevolve type = GF Timelevels=3 { phi - phi_old } "The evolved scalar field" -private: - -cctk_real scalartmps type = GF -{ - phi_new -} "Temporary GF for WaveToy" diff --git a/schedule.ccl b/schedule.ccl index 00425b3..4b26eaa 100644 --- a/schedule.ccl +++ b/schedule.ccl @@ -16,7 +16,6 @@ schedule WaveToyCXX_InitSymBound at BASEGRID schedule WaveToyCXX_Evolution as WaveToy_Evolution at EVOL { LANG: C - STORAGE: scalartmps } "Evolution of 3D wave equation" diff --git a/src/InitSymBound.cc b/src/InitSymBound.cc index 585272b..17405af 100644 --- a/src/InitSymBound.cc +++ b/src/InitSymBound.cc @@ -28,18 +28,16 @@ extern "C" void WaveToyCXX_InitSymBound(CCTK_ARGUMENTS) { - DECLARE_CCTK_ARGUMENTS - - int sym[3]; + DECLARE_CCTK_ARGUMENTS + + int sym[3]; - sym[0] = 1; - sym[1] = 1; - sym[2] = 1; + sym[0] = 1; + sym[1] = 1; + sym[2] = 1; - SetCartSymmetry(cctkGH, sym,"wavetoy::phi"); - SetCartSymmetry(cctkGH, sym,"wavetoycxx::phi_new"); - - + SetCartSymmetry(cctkGH, sym,"wavetoy::phi"); + return; } diff --git a/src/WaveToy.cc b/src/WaveToy.cc index 23843fc..978f1e8 100644 --- a/src/WaveToy.cc +++ b/src/WaveToy.cc @@ -77,8 +77,8 @@ extern "C" void WaveToyCXX_Evolution(CCTK_ARGUMENTS) { int index = CCTK_GFINDEX3D(cctkGH,i,j,k); - phi_new[index] = - factor*phi[index] - phi_old[index] + phi_n[index] = + factor*phi[index] - phi_p[index] + dt2 * ( ( val( phi, i+1,j ,k ) + val( phi, i-1,j ,k) )*dx2i +( val( phi, i ,j+1,k ) + val( phi, i ,j-1,k) )*dy2i @@ -91,30 +91,14 @@ extern "C" void WaveToyCXX_Evolution(CCTK_ARGUMENTS) // // Synchronize before applying boundary conditions // - CCTK_SyncGroup(cctkGH,"wavetoycxx::scalartmps"); + CCTK_SyncGroup(cctkGH,"wavetoy::scalarevolve"); // // Apply boundary conditions // WaveToyC_Boundaries(CCTK_PASS_CTOC); - // - // Update timeslices - // - { - for (int k=0; k<cctk_lsh[2]; k++) - for (int j=0; j<cctk_lsh[1]; j++) - for (int i=0; i<cctk_lsh[0]; i++) - { - int index = CCTK_GFINDEX3D(cctkGH,i,j,k); - - phi_old[index] = phi[index]; - phi[index] = phi_new[index]; - } - } - - - + return; } /*@@ @@ -145,15 +129,15 @@ static void WaveToyC_Boundaries(CCTK_ARGUMENTS) sw[1]=1; sw[2]=1; - ierr = CartSymBCGroup(cctkGH,"wavetoycxx::scalartmps"); + ierr = CartSymBCGroup(cctkGH,"wavetoy::scalarevolve"); if (CCTK_Equals(bound,"flat")) { - ierr = FlatBCVar(cctkGH,sw,"wavetoycxx::phi_new"); + ierr = FlatBCVar(cctkGH,sw,"wavetoy::phi"); } else if (CCTK_Equals(bound,"radiation")) { - ierr = RadiativeBCVar(cctkGH,0,1,sw,"wavetoycxx::phi_new","wavetoy::phi"); + ierr = RadiativeBCVar(cctkGH,0,1,sw,"wavetoy::phi","wavetoy::phi"); } if (ierr < 0) @@ -161,8 +145,7 @@ static void WaveToyC_Boundaries(CCTK_ARGUMENTS) CCTK_WARN(0,"Boundary conditions not applied - giving up!"); } - - + return; } diff --git a/test/test_wavetoycxx/phi.dl b/test/test_wavetoycxx/phi.dl index 16493b0..12f574d 100644 --- a/test/test_wavetoycxx/phi.dl +++ b/test/test_wavetoycxx/phi.dl @@ -121,7 +121,7 @@ -0.683704 -0.0000000003848 -0.592544 -0.0000008256207 -0.501383 -0.0001851985238 --0.410223 -0.0080724403496 +-0.410223 -0.0080724403495 -0.319062 -0.0860002778716 -0.227901 -0.3020549188440 -0.136741 -0.2694342257320 @@ -130,7 +130,7 @@ 0.136741 -0.2694342257320 0.227901 -0.3020549188440 0.319062 -0.0860002778716 -0.410223 -0.0080724403496 +0.410223 -0.0080724403495 0.501383 -0.0001851985238 0.592544 -0.0000008256207 0.683704 -0.0000000003848 diff --git a/test/test_wavetoycxx/phi.xl b/test/test_wavetoycxx/phi.xl index 9bef5dd..55a520c 100644 --- a/test/test_wavetoycxx/phi.xl +++ b/test/test_wavetoycxx/phi.xl @@ -24,7 +24,7 @@ "Time = 0.052632 --0.500000 0.0000000000000 +-0.500000 0.0000000001579 -0.447368 0.0000002442580 -0.394737 0.0000055185355 -0.342105 0.0000636892398 @@ -43,13 +43,13 @@ 0.342105 0.0000636892398 0.394737 0.0000055185355 0.447368 0.0000002442580 -0.500000 0.0000000000000 +0.500000 0.0000000001579 "Time = 0.105263 -0.500000 0.0000000000000 --0.447368 0.0000074500351 --0.394737 0.0000571366688 +-0.447368 0.0000074500893 +-0.394737 0.0000571366787 -0.342105 0.0000891850929 -0.289474 -0.0021735254063 -0.236842 -0.0208336611591 @@ -64,17 +64,17 @@ 0.236842 -0.0208336611591 0.289474 -0.0021735254063 0.342105 0.0000891850929 -0.394737 0.0000571366688 -0.447368 0.0000074500351 +0.394737 0.0000571366787 +0.447368 0.0000074500893 0.500000 0.0000000000000 "Time = 0.157895 --0.500000 0.0000000000000 --0.447368 0.0000404464126 --0.394737 -0.0000934612273 --0.342105 -0.0028408356519 --0.289474 -0.0203343223830 +-0.500000 0.0000000000121 +-0.447368 0.0000404464522 +-0.394737 -0.0000934611932 +-0.342105 -0.0028408356421 +-0.289474 -0.0203343223824 -0.236842 -0.0840586024960 -0.184211 -0.2362253936422 -0.131579 -0.4920251452215 @@ -85,54 +85,54 @@ 0.131579 -0.4920251452215 0.184211 -0.2362253936422 0.236842 -0.0840586024960 -0.289474 -0.0203343223830 -0.342105 -0.0028408356519 -0.394737 -0.0000934612273 -0.447368 0.0000404464126 -0.500000 0.0000000000000 +0.289474 -0.0203343223824 +0.342105 -0.0028408356421 +0.394737 -0.0000934611932 +0.447368 0.0000404464522 +0.500000 0.0000000000121 "Time = 0.210526 --0.500000 0.0000000000000 --0.447368 -0.0002560735304 --0.394737 -0.0032223677845 --0.342105 -0.0191504024223 --0.289474 -0.0718425508255 --0.236842 -0.1869773941527 --0.184211 -0.3531984196037 +-0.500000 0.0000000001579 +-0.447368 -0.0002560735181 +-0.394737 -0.0032223677598 +-0.342105 -0.0191504023972 +-0.289474 -0.0718425508170 +-0.236842 -0.1869773941516 +-0.184211 -0.3531984196036 -0.131579 -0.4762760737732 -0.078947 -0.4212470397782 -0.026316 -0.2663944260771 0.026316 -0.2663944260771 0.078947 -0.4212470397782 0.131579 -0.4762760737732 -0.184211 -0.3531984196037 -0.236842 -0.1869773941527 -0.289474 -0.0718425508255 -0.342105 -0.0191504024223 -0.394737 -0.0032223677845 -0.447368 -0.0002560735304 -0.500000 0.0000000000000 +0.184211 -0.3531984196036 +0.236842 -0.1869773941516 +0.289474 -0.0718425508170 +0.342105 -0.0191504023972 +0.394737 -0.0032223677598 +0.447368 -0.0002560735181 +0.500000 0.0000000001579 "Time = 0.263158 -0.500000 0.0000000000000 --0.447368 -0.0034053135086 --0.394737 -0.0177523942899 --0.342105 -0.0616617809349 --0.289474 -0.1512610524732 --0.236842 -0.2676581405563 --0.184211 -0.3314593226331 --0.131579 -0.2530697030291 --0.078947 -0.0930373771551 +-0.447368 -0.0034053134726 +-0.394737 -0.0177523942812 +-0.342105 -0.0616617809179 +-0.289474 -0.1512610524542 +-0.236842 -0.2676581405491 +-0.184211 -0.3314593226319 +-0.131579 -0.2530697030290 +-0.078947 -0.0930373771550 -0.026316 -0.0172399268943 0.026316 -0.0172399268943 -0.078947 -0.0930373771551 -0.131579 -0.2530697030291 -0.184211 -0.3314593226331 -0.236842 -0.2676581405563 -0.289474 -0.1512610524732 -0.342105 -0.0616617809349 -0.394737 -0.0177523942899 -0.447368 -0.0034053135086 +0.078947 -0.0930373771550 +0.131579 -0.2530697030290 +0.184211 -0.3314593226319 +0.236842 -0.2676581405491 +0.289474 -0.1512610524542 +0.342105 -0.0616617809179 +0.394737 -0.0177523942812 +0.447368 -0.0034053134726 0.500000 0.0000000000000 diff --git a/test/test_wavetoycxx/phi.yl b/test/test_wavetoycxx/phi.yl index 9bef5dd..55a520c 100644 --- a/test/test_wavetoycxx/phi.yl +++ b/test/test_wavetoycxx/phi.yl @@ -24,7 +24,7 @@ "Time = 0.052632 --0.500000 0.0000000000000 +-0.500000 0.0000000001579 -0.447368 0.0000002442580 -0.394737 0.0000055185355 -0.342105 0.0000636892398 @@ -43,13 +43,13 @@ 0.342105 0.0000636892398 0.394737 0.0000055185355 0.447368 0.0000002442580 -0.500000 0.0000000000000 +0.500000 0.0000000001579 "Time = 0.105263 -0.500000 0.0000000000000 --0.447368 0.0000074500351 --0.394737 0.0000571366688 +-0.447368 0.0000074500893 +-0.394737 0.0000571366787 -0.342105 0.0000891850929 -0.289474 -0.0021735254063 -0.236842 -0.0208336611591 @@ -64,17 +64,17 @@ 0.236842 -0.0208336611591 0.289474 -0.0021735254063 0.342105 0.0000891850929 -0.394737 0.0000571366688 -0.447368 0.0000074500351 +0.394737 0.0000571366787 +0.447368 0.0000074500893 0.500000 0.0000000000000 "Time = 0.157895 --0.500000 0.0000000000000 --0.447368 0.0000404464126 --0.394737 -0.0000934612273 --0.342105 -0.0028408356519 --0.289474 -0.0203343223830 +-0.500000 0.0000000000121 +-0.447368 0.0000404464522 +-0.394737 -0.0000934611932 +-0.342105 -0.0028408356421 +-0.289474 -0.0203343223824 -0.236842 -0.0840586024960 -0.184211 -0.2362253936422 -0.131579 -0.4920251452215 @@ -85,54 +85,54 @@ 0.131579 -0.4920251452215 0.184211 -0.2362253936422 0.236842 -0.0840586024960 -0.289474 -0.0203343223830 -0.342105 -0.0028408356519 -0.394737 -0.0000934612273 -0.447368 0.0000404464126 -0.500000 0.0000000000000 +0.289474 -0.0203343223824 +0.342105 -0.0028408356421 +0.394737 -0.0000934611932 +0.447368 0.0000404464522 +0.500000 0.0000000000121 "Time = 0.210526 --0.500000 0.0000000000000 --0.447368 -0.0002560735304 --0.394737 -0.0032223677845 --0.342105 -0.0191504024223 --0.289474 -0.0718425508255 --0.236842 -0.1869773941527 --0.184211 -0.3531984196037 +-0.500000 0.0000000001579 +-0.447368 -0.0002560735181 +-0.394737 -0.0032223677598 +-0.342105 -0.0191504023972 +-0.289474 -0.0718425508170 +-0.236842 -0.1869773941516 +-0.184211 -0.3531984196036 -0.131579 -0.4762760737732 -0.078947 -0.4212470397782 -0.026316 -0.2663944260771 0.026316 -0.2663944260771 0.078947 -0.4212470397782 0.131579 -0.4762760737732 -0.184211 -0.3531984196037 -0.236842 -0.1869773941527 -0.289474 -0.0718425508255 -0.342105 -0.0191504024223 -0.394737 -0.0032223677845 -0.447368 -0.0002560735304 -0.500000 0.0000000000000 +0.184211 -0.3531984196036 +0.236842 -0.1869773941516 +0.289474 -0.0718425508170 +0.342105 -0.0191504023972 +0.394737 -0.0032223677598 +0.447368 -0.0002560735181 +0.500000 0.0000000001579 "Time = 0.263158 -0.500000 0.0000000000000 --0.447368 -0.0034053135086 --0.394737 -0.0177523942899 --0.342105 -0.0616617809349 --0.289474 -0.1512610524732 --0.236842 -0.2676581405563 --0.184211 -0.3314593226331 --0.131579 -0.2530697030291 --0.078947 -0.0930373771551 +-0.447368 -0.0034053134726 +-0.394737 -0.0177523942812 +-0.342105 -0.0616617809179 +-0.289474 -0.1512610524542 +-0.236842 -0.2676581405491 +-0.184211 -0.3314593226319 +-0.131579 -0.2530697030290 +-0.078947 -0.0930373771550 -0.026316 -0.0172399268943 0.026316 -0.0172399268943 -0.078947 -0.0930373771551 -0.131579 -0.2530697030291 -0.184211 -0.3314593226331 -0.236842 -0.2676581405563 -0.289474 -0.1512610524732 -0.342105 -0.0616617809349 -0.394737 -0.0177523942899 -0.447368 -0.0034053135086 +0.078947 -0.0930373771550 +0.131579 -0.2530697030290 +0.184211 -0.3314593226319 +0.236842 -0.2676581405491 +0.289474 -0.1512610524542 +0.342105 -0.0616617809179 +0.394737 -0.0177523942812 +0.447368 -0.0034053134726 0.500000 0.0000000000000 diff --git a/test/test_wavetoycxx/phi_max.tl b/test/test_wavetoycxx/phi_max.tl index 6355b45..7d6d6cf 100644 --- a/test/test_wavetoycxx/phi_max.tl +++ b/test/test_wavetoycxx/phi_max.tl @@ -2,6 +2,6 @@ 0.000000 0.8124050503725 0.052632 0.0002832523498 0.105263 0.0000891850929 -0.157895 0.0000404464126 -0.210526 0.0000003961843 -0.263158 0.0000001100396 +0.157895 0.0000404464522 +0.210526 0.0000003961856 +0.263158 0.0000001100397 diff --git a/test/test_wavetoycxx/phi_min.tl b/test/test_wavetoycxx/phi_min.tl index c002c48..a1d8579 100644 --- a/test/test_wavetoycxx/phi_min.tl +++ b/test/test_wavetoycxx/phi_min.tl @@ -4,4 +4,4 @@ 0.105263 -1.1290503258507 0.157895 -0.9019842677611 0.210526 -0.4997593550838 -0.263158 -0.3594146186544 +0.263158 -0.3594146186543 diff --git a/test/test_wavetoycxx/phi_nm1.tl b/test/test_wavetoycxx/phi_nm1.tl index 5ac6c8a..895a3b0 100644 --- a/test/test_wavetoycxx/phi_nm1.tl +++ b/test/test_wavetoycxx/phi_nm1.tl @@ -1,7 +1,7 @@ "phi norm1 v time 0.000000 0.0047741452163 -0.052632 0.0023586563889 -0.105263 0.0094832901772 -0.157895 0.0166095490057 -0.210526 0.0237365580785 -0.263158 0.0308582835984 +0.052632 0.0023586563905 +0.105263 0.0094832901779 +0.157895 0.0166095490059 +0.210526 0.0237365580784 +0.263158 0.0308582835960 diff --git a/test/test_wavetoycxx/phi_nm2.tl b/test/test_wavetoycxx/phi_nm2.tl index e9504b4..0fea72d 100644 --- a/test/test_wavetoycxx/phi_nm2.tl +++ b/test/test_wavetoycxx/phi_nm2.tl @@ -3,5 +3,5 @@ 0.052632 0.0158441957039 0.105263 0.0637392141088 0.157895 0.0805995803466 -0.210526 0.0821416890830 -0.263158 0.0821638479507 +0.210526 0.0821416890828 +0.263158 0.0821638479495 |