[Commits] [svn:einsteintoolkit] GRHydro_InitData/trunk/ (Rev. 196)

rhaas at tapir.caltech.edu rhaas at tapir.caltech.edu
Fri Jan 11 09:04:15 CST 2013


User: rhaas
Date: 2013/01/11 09:04 AM

Modified:
 /trunk/
  param.ccl
 /trunk/src/
  GRHydro_BondiM.c

Log:
 GRHydro_InitData: add parameter to offset radial origin
 
 r_code = r_KS - r0 with r0=1M by default. This avoids placing the
 central singularity on the grid.
 
 From: Roland Haas <roland.haas at physics.gatech.edu>

File Changes:

Directory: /trunk/src/
======================

File [modified]: GRHydro_BondiM.c
Delta lines: +15 -0
===================================================================
--- trunk/src/GRHydro_BondiM.c	2013-01-11 15:04:13 UTC (rev 195)
+++ trunk/src/GRHydro_BondiM.c	2013-01-11 15:04:15 UTC (rev 196)
@@ -1097,6 +1097,21 @@
     xpos[YY] = y[i] ;
     xpos[ZZ] = z[i] ;
 
+    if (bondi_radial_offset > 0.) {
+      double rspher_orig = sqrt(SQR(xpos[XX])+SQR(xpos[YY])+SQR(xpos[ZZ]));
+      double rspher_new = rspher_orig + bondi_radial_offset;
+      if(rspher_orig < SMALL_BONDI) { 
+        xpos[XX] = rspher_new;
+        xpos[YY] = 0.;
+        xpos[ZZ] = 0.;
+      } else {
+        for(int n = XX ; n <= ZZ ; n++) {
+          xpos[n] *= rspher_new/rspher_orig;
+        }
+      }
+    }
+
+
     switch( coord_type ) {
   
     case COORD_BOYERLINDQUIST :

Directory: /trunk/
==================

File [modified]: param.ccl
Delta lines: +5 -0
===================================================================
--- trunk/param.ccl	2013-01-11 15:04:13 UTC (rev 195)
+++ trunk/param.ccl	2013-01-11 15:04:15 UTC (rev 196)
@@ -381,6 +381,11 @@
   0:* :: "Anything positive"
 } 0.01
 
+CCTK_REAL bondi_radial_offset "redefine r_grid=r_KS-r0 to avoid singularity on grid"
+{
+  0:* :: "Any positive number"
+} 0.0
+
 CCTK_BOOLEAN set_bondi_beta_sonicpt "Set plasma beta parameter instead of bondi_bmag"
 {
 } no



More information about the Commits mailing list