diff options
-rw-r--r-- | param.ccl | 11 | ||||
-rw-r--r-- | src/exactmetric.F | 9 | ||||
-rw-r--r-- | src/flatfunny.F | 105 | ||||
-rw-r--r-- | src/make.code.defn | 3 |
4 files changed, 127 insertions, 1 deletions
@@ -53,6 +53,7 @@ KEYWORD exactmodel "The exact solution used in thorn exact" "multiBH" :: Maximally charged multi BH solutions "bowl" :: Non-Einstein bowl (bag-of-gold) spacetime "fakebinary" :: Non-Einstein fake-binary of Thorn et al + "flatfunny" :: Minkowski spacetime in non-trivial spatial coordinates } "minkowski" @@ -333,4 +334,14 @@ REAL co_bh4z "z coord of black hole 4" } 0.0 +# Parameters for flatfunny. +REAL flatfunny_a "Amplitude of gaussian" +{ +0.0:1.0 :: "Positive and smaller than 1 please" +} 0.0 + +REAL flatfunny_s "Width of gaussian" +{ +0.0: :: "Positive please" +} 1.0
\ No newline at end of file diff --git a/src/exactmetric.F b/src/exactmetric.F index 6896e67..34a57d3 100644 --- a/src/exactmetric.F +++ b/src/exactmetric.F @@ -116,6 +116,15 @@ C Call the corresponding routine. $ gutt, gutx, guty, gutz, $ guxx, guyy, guzz, guxy, guyz, guxz) + elseif (CCTK_Equals(exactmodel,"flatfunny").eq.1) then + + call flatfunny( + $ x, y, z, t, + $ gdtt, gdtx, gdty, gdtz, + $ gdxx, gdyy, gdzz, gdxy, gdyz, gdxz, + $ gutt, gutx, guty, gutz, + $ guxx, guyy, guzz, guxy, guyz, guxz) + else call CCTK_WARN(0,"Unknown value of parameter exactmodel") diff --git a/src/flatfunny.F b/src/flatfunny.F new file mode 100644 index 0000000..48e4864 --- /dev/null +++ b/src/flatfunny.F @@ -0,0 +1,105 @@ +#include "cctk.h" +#include "cctk_Parameters.h" + + subroutine flatfunny( + $ x, y, z, t, + $ gdtt, gdtx, gdty, gdtz, + $ gdxx, gdyy, gdzz, gdxy, gdyz, gdzx, + $ gutt, gutx, guty, gutz, + $ guxx, guyy, guzz, guxy, guyz, guzx) + +c The metric given here corresponds to that of flat spacetime +c but with non-trivial spatial coordinates. Basically, I take +c the flat metric in spherical coordinates, define a new +c radial coordinate such that: +c +c r = r ( 1 - a f(r ) ) +c new new +c +c where f(r) is a gaussian centered at r=0 with amplitude 1. +c Finally, I transform back to cartesian coordinates. +c For 0 <= a < 1, the transformation above is monotonic. + + implicit none + + DECLARE_CCTK_PARAMETERS + +c Input. + + CCTK_REAL x,y,z,t + +c Output. + + CCTK_REAL gdtt, gdtx, gdty, gdtz, + $ gdxx, gdyy, gdzz, gdxy, gdyz, gdzx, + $ gutt, gutx, guty, gutz, + $ guxx, guyy, guzz, guxy, guyz, guzx + +c Internal. + + CCTK_REAL a,s + CCTK_REAL r,r2,x2,y2,z2 + CCTK_REAL f,fp,g11,g22 + CCTK_REAL det,zero,one,two + +c Define numbers. + + zero = 0.0d0 + one = 1.0d0 + two = 2.0d0 + +c Read parameters + + a = flatfunny_a + s = flatfunny_s + +c Find transformation function. + + x2 = x**2 + y2 = y**2 + z2 = z**2 + + r2 = x2 + y2 + z2 + r = dsqrt(r2) + + f = dexp(-r2/s**2) + fp = - two*r/s**2*f + +c Give metric components. + + g11 = (one - a*(f + r*fp))**2 + g22 = (one - a*f)**2 + + gdtt = - one + gdtx = zero + gdty = zero + gdtz = zero + + gdxx = (x2*g11 + (y2 + z2)*g22)/r2 + gdyy = (y2*g11 + (x2 + z2)*g22)/r2 + gdzz = (z2*g11 + (x2 + y2)*g22)/r2 + + gdxy = x*y*(g11 - g22)/r2 + gdzx = x*z*(g11 - g22)/r2 + gdyz = y*z*(g11 - g22)/r2 + +c Find inverse metric. + + gutt = - one + gutx = zero + guty = zero + gutz = zero + + det = gdxx*gdyy*gdzz + two*gdxy*gdzx*gdyz + . - gdxx*gdyz**2 - gdyy*gdzx**2 - gdzz*gdxy**2 + + guxx = (gdyy*gdzz - gdyz**2)/det + guyy = (gdxx*gdzz - gdzx**2)/det + guzz = (gdxx*gdyy - gdxy**2)/det + + guxy = (gdzx*gdyz - gdzz*gdxy)/det + guyz = (gdxy*gdzx - gdxx*gdyz)/det + guzx = (gdxy*gdyz - gdyy*gdzx)/det + + return + end diff --git a/src/make.code.defn b/src/make.code.defn index 4987480..c66021e 100644 --- a/src/make.code.defn +++ b/src/make.code.defn @@ -5,7 +5,8 @@ SRCS = exactinitialize.F exactgauge.F exactboundary.F \ exactdata.F exactmetric.F \ boostrotmetric.F finkelstein.F kerrschild.F flatschwarz.F \ - starschwarz.F bowl.F novikov.F minkowski.F fakebinary.F multiBH.F \ + starschwarz.F bowl.F novikov.F minkowski.F fakebinary.F \ + multiBH.F flatfunny.F \ exactblendbound.F exactcartblendbound.F \ slice_initialize.F slice_evolve.F slice_data.F linextraponebound.F \ Startup.c |