Commits

Matthew Turk  committed 17f93ed

Changed exp to PEXP where it was used as a positioning argument. This fixed
some problems with initializing SphereType=4 in CollapseTest. Added PEXP to
macros_and_parameters.h, and upped MAX_DEPTH_OF_HIERARCHY to 50. (I've run to
53, but at that point it died in standard enzo chemistry. Further experiments
may be forthcoming.)

  • Participants
  • Parent commits de62aa3
  • Branches grid-positioning

Comments (0)

Files changed (5)

File src/enzo/Grid_CollapseTestInitializeGrid.C

 	  ERF(SphereRadius[sphere]/SphereCoreRadius[sphere]);
 	term2 = 0.25 * SphereRadius[sphere] *
 	  pow(SphereCoreRadius[sphere], 2) *
-	  exp(-0.5 * pow((SphereRadius[sphere]/SphereCoreRadius[sphere]), 2));
+	  PEXP(-0.5 * pow((SphereRadius[sphere]/SphereCoreRadius[sphere]), 2));
 	SphereMass = (4*pi*SphereDensity[sphere]*DensityUnits) * 
 	  pow(LengthUnits, 3) * (term1 - term2);
 	break;
 
 	      if (SphereType[sphere] == 4) {
 		dens1 = SphereDensity[sphere]*
-		  exp(-0.5*pow(r/SphereCoreRadius[sphere], 2));
+		  PEXP(-0.5*pow(r/SphereCoreRadius[sphere], 2));
 	      }
 
 	      /* 5) r^-2 power law with core radius */
 		  /* Compute density (Kruit & Searle 1982). */
 
 		  if (dim == 0)
-		    dens1 = SphereDensity[sphere]*exp(-drad/ScaleHeightR)/
+		    dens1 = SphereDensity[sphere]*PEXP(-drad/ScaleHeightR)/
 		      pow(cosh(zheight/max(ScaleHeightz, CellWidth[0][0])), 2);
 
 		  //		if (dens1 < density)

File src/enzo/Grid_GalaxySimulationInitializeGrid.C

 		}
 	      else
 		{
-		  dens1 = DiskDensity*exp(-drad/(ScaleHeightR*Mpc/LengthUnits))/POW(cosh(zheight/CellWidth[0][0]), 2);
+		  dens1 = DiskDensity*PEXP(-drad/(ScaleHeightR*Mpc/LengthUnits))/POW(cosh(zheight/CellWidth[0][0]), 2);
 		}	  
-	    dens2 = DiskDensity*exp(-drad/(ScaleHeightR*Mpc/LengthUnits))/POW(cosh(zheight/max((ScaleHeightz*Mpc/LengthUnits), CellWidth[0][0])), 2);
+	    dens2 = DiskDensity*PEXP(-drad/(ScaleHeightR*Mpc/LengthUnits))/POW(cosh(zheight/max((ScaleHeightz*Mpc/LengthUnits), CellWidth[0][0])), 2);
 	    
 	    if (dens2 < density)
 	      break;
 
  // Mass of gas disk and DM at given radius
 
-     M_gas=8.0*M_PI*ScaleHeightz*Mpc/100*ScaleHeightR*Mpc/100*ScaleHeightR*Mpc/100*DiskDensity*DensityUnits*1000*exp(-r/(ScaleHeightR*Mpc/100))*(exp(r/(ScaleHeightR*Mpc/100))-r/(ScaleHeightR*Mpc/100)-1.0);
+     M_gas=8.0*M_PI*ScaleHeightz*Mpc/100*ScaleHeightR*Mpc/100*ScaleHeightR*Mpc/100*DiskDensity*DensityUnits*1000*PEXP(-r/(ScaleHeightR*Mpc/100))*(PEXP(r/(ScaleHeightR*Mpc/100))-r/(ScaleHeightR*Mpc/100)-1.0);
 
      M_DM=(M_200/f_C)*(log(1.0+r/r_s)-(r/r_s)/(1.0+r/r_s));
 
  double den,r1,nx,ny,nz;
 
  points = 100;
- den = DiskDensity*exp(-r/ScaleHeightR)/(POW(cosh(z/(2.0*ScaleHeightz)),2));
+ den = DiskDensity*PEXP(-r/ScaleHeightR)/(POW(cosh(z/(2.0*ScaleHeightz)),2));
 
  for (i=0;i<points;i++)
    {
      ny = drand48()*cellwidth-cellwidth/2.0;
      nz = drand48()*cellwidth-cellwidth/2.0;
      r1 = sqrt(POW((xpos+nx),2)+POW((ypos+ny),2)+POW((zpos+nz),2)); 
-     den = den+DiskDensity*exp(-r1/ScaleHeightR)/(POW(cosh(z/(2.0*ScaleHeightz)),2));
+     den = den+DiskDensity*PEXP(-r1/ScaleHeightR)/(POW(cosh(z/(2.0*ScaleHeightz)),2));
    }
 
  double av_den = den/points;

File src/enzo/Grid_GravityEquilibriumTestInitializeGrid.C

  
     /* Set density for exponential atmosphere. */
  
-    density = 1.0*exp(CellLeftEdge[0][i]/ScaleHeight);
+    density = 1.0*PEXP(CellLeftEdge[0][i]/ScaleHeight);
     if (i == GridStartIndex[0])
       density_old = density;
  

File src/enzo/Grid_PhotonTestInitializeGrid.C

 	    /* 4) Gaussian */
 	    if (SphereType[sphere] == 4) {
 	      dens1 = SphereDensity[sphere]*
-                      exp(-0.5*pow(r/SphereCoreRadius[sphere], 2));
+                      PEXP(-0.5*pow(r/SphereCoreRadius[sphere], 2));
 	    }
 
 	    /* 5) r^-2 power law with core radius */
 		/* Compute density (Kruit & Searle 1982). */
 
 		if (dim == 0)
-		  dens1 = SphereDensity[sphere]*exp(-drad/ScaleHeightR)/
+		  dens1 = SphereDensity[sphere]*PEXP(-drad/ScaleHeightR)/
 		    pow(cosh(zheight/max(ScaleHeightz, CellWidth[0][0])), 2);
 
 		if (dens1 < density)

File src/enzo/macros_and_parameters.h

 
 #ifdef CONFIG_PFLOAT_4
 #define FLOAT Eflt32
+#define PEXP expf
 #define PSYM "f"
 #define GSYM "g"
 #define GOUTSYM ".8g"
 
 #ifdef CONFIG_PFLOAT_8
 #define FLOAT double
+#define PEXP exp
 #define PSYM "lf"
 #define GSYM "g"
 #define GOUTSYM ".14g"
 
 #ifdef CONFIG_PFLOAT_16
 #define FLOAT long_double
+#define PEXP expl
 #define PSYM "Lf"
 #define GSYM "g"
 #define GOUTSYM ".21Lg"