From d3513669c8d7d0c547095187ac580b11b4284d73 Mon Sep 17 00:00:00 2001 From: dcollins4096 Date: Thu, 7 Feb 2013 12:59:39 -0700 Subject: [PATCH 01/25] adding a missing ifdef that suppresses the deletion of AccelerationField in HydroRK2, with Accelerationboundary-yes --HG-- branch : week-of-code --- src/enzo/hydro_rk/EvolveLevel_RK2.C | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/enzo/hydro_rk/EvolveLevel_RK2.C b/src/enzo/hydro_rk/EvolveLevel_RK2.C index b6d76b98c..6337c0853 100644 --- a/src/enzo/hydro_rk/EvolveLevel_RK2.C +++ b/src/enzo/hydro_rk/EvolveLevel_RK2.C @@ -508,11 +508,13 @@ int EvolveLevel_RK2(TopGridData *MetaData, LevelHierarchyEntry *LevelArray[], /* Gravity: clean up AccelerationField. */ +#ifndef SAB if ((level != MaximumGravityRefinementLevel || MaximumGravityRefinementLevel == MaximumRefinementLevel)) Grids[grid1]->GridData->DeleteAccelerationField(); Grids[grid1]->GridData->DeleteParticleAcceleration(); +#endif //!SAB if (UseFloor) Grids[grid1]->GridData->SetFloor(); From 9bcf456fee9e44f30291df772a9bb47100a4dc33 Mon Sep 17 00:00:00 2001 From: Sam Skillman Date: Fri, 8 Feb 2013 09:28:00 -0700 Subject: [PATCH 02/25] Adding shock finding to ShockInABox, as well as fixing a field ordering bug. --HG-- branch : week-of-code --- src/enzo/Grid_HydroShockTubesInitializeGrid.C | 40 +++++++++ src/enzo/HydroShockTubesInitialize.C | 11 +++ src/enzo/ShockInABoxInitialize.C | 83 +++++++++++-------- 3 files changed, 101 insertions(+), 33 deletions(-) diff --git a/src/enzo/Grid_HydroShockTubesInitializeGrid.C b/src/enzo/Grid_HydroShockTubesInitializeGrid.C index 87b052c8d..d406782d2 100644 --- a/src/enzo/Grid_HydroShockTubesInitializeGrid.C +++ b/src/enzo/Grid_HydroShockTubesInitializeGrid.C @@ -24,6 +24,8 @@ int grid::HydroShockTubesInitializeGrid(float x0, ) { + int MachNum, PSTempNum, PSDenNum; + NumberOfBaryonFields = 0; FieldType[NumberOfBaryonFields++] = Density; FieldType[NumberOfBaryonFields++] = Velocity1; @@ -34,6 +36,14 @@ int grid::HydroShockTubesInitializeGrid(float x0, FieldType[NumberOfBaryonFields++] = InternalEnergy; } + if(ShockMethod){ + FieldType[MachNum = NumberOfBaryonFields++] = Mach; + if(StorePreShockFields){ + FieldType[PSTempNum = NumberOfBaryonFields++] = PreShockTemperature; + FieldType[PSDenNum = NumberOfBaryonFields++] = PreShockDensity; + } + } + if (ProcessorNumber != MyProcessorNumber) { return SUCCESS; @@ -86,6 +96,16 @@ int grid::HydroShockTubesInitializeGrid(float x0, BaryonField[ieint][i] = etotr - 0.5*(vxr*vxr+vyr*vyr+vzr*vzr); } } + + //Shock + if (ShockMethod) { + BaryonField[MachNum][i] = tiny_number; + if (StorePreShockFields) { + BaryonField[PSTempNum][i] = tiny_number; + BaryonField[PSDenNum][i] = tiny_number; + } + } + } return SUCCESS; @@ -102,6 +122,8 @@ int grid::HydroShockTubesInitializeGrid(float x0, float x1, ) { + int MachNum, PSTempNum, PSDenNum; + NumberOfBaryonFields = 0; FieldType[NumberOfBaryonFields++] = Density; FieldType[NumberOfBaryonFields++] = Velocity1; @@ -112,6 +134,15 @@ int grid::HydroShockTubesInitializeGrid(float x0, float x1, FieldType[NumberOfBaryonFields++] = InternalEnergy; } + + + if(ShockMethod){ + FieldType[MachNum = NumberOfBaryonFields++] = Mach; + if(StorePreShockFields){ + FieldType[PSTempNum = NumberOfBaryonFields++] = PreShockTemperature; + FieldType[PSDenNum = NumberOfBaryonFields++] = PreShockDensity; + } + } if (ProcessorNumber != MyProcessorNumber) { return SUCCESS; @@ -177,6 +208,15 @@ int grid::HydroShockTubesInitializeGrid(float x0, float x1, BaryonField[ieint][i] = etotr - 0.5*(vxr*vxr+vyr*vyr+vzr*vzr); } } + + //Shock + if (ShockMethod) { + BaryonField[MachNum][i] = tiny_number; + if (StorePreShockFields) { + BaryonField[PSTempNum][i] = tiny_number; + BaryonField[PSDenNum][i] = tiny_number; + } + } } return SUCCESS; diff --git a/src/enzo/HydroShockTubesInitialize.C b/src/enzo/HydroShockTubesInitialize.C index dbc794ae2..5673c4191 100644 --- a/src/enzo/HydroShockTubesInitialize.C +++ b/src/enzo/HydroShockTubesInitialize.C @@ -35,6 +35,9 @@ int HydroShockTubesInitialize(FILE *fptr, FILE *Outfptr, char *Vel2Name = "y-velocity"; char *Vel3Name = "z-velocity"; char *ColourName = "colour"; + char *MachName = "Mach"; + char *PSTempName = "PreShock_Temperature"; + char *PSDenName = "PreShock_Density"; /* declarations */ @@ -209,6 +212,14 @@ int HydroShockTubesInitialize(FILE *fptr, FILE *Outfptr, DataLabel[count++] = GEName; } + if (ShockMethod) { + DataLabel[count++] = MachName; + if(StorePreShockFields){ + DataLabel[count++] = PSTempName; + DataLabel[count++] = PSDenName; + } + } + for (i = 0; i < count; i++) DataUnits[i] = NULL; diff --git a/src/enzo/ShockInABoxInitialize.C b/src/enzo/ShockInABoxInitialize.C index 96358b040..72dab3e0e 100644 --- a/src/enzo/ShockInABoxInitialize.C +++ b/src/enzo/ShockInABoxInitialize.C @@ -38,6 +38,9 @@ int ShockInABoxInitialize(FILE *fptr, FILE *Outfptr, HierarchyEntry &TopGrid, char *Vel2Name = "y-velocity"; char *Vel3Name = "z-velocity"; + char *MachName = "Mach"; + char *PSTempName = "PreShock_Temperature"; + char *PSDenName = "PreShock_Density"; /* declarations */ char line[MAX_LINE_LENGTH]; @@ -81,18 +84,18 @@ int ShockInABoxInitialize(FILE *fptr, FILE *Outfptr, HierarchyEntry &TopGrid, ret += sscanf(line, "ShockInABoxBoundary = %"PSYM, &ShockInABoxBoundary); - ret += sscanf(line, "ShockInABoxLeftDensity = %"FSYM, + ret += sscanf(line, "ShockInABoxLeftDensity = %"ESYM, &ShockInABoxDensity[0]); - ret += sscanf(line, "ShockInABoxLeftPressure = %"FSYM, + ret += sscanf(line, "ShockInABoxLeftPressure = %"ESYM, &ShockInABoxPressure[0]); - ret += sscanf(line, "ShockInABoxLeftVelocity = %"FSYM, + ret += sscanf(line, "ShockInABoxLeftVelocity = %"ESYM, &ShockInABoxVelocity[0]); - ret += sscanf(line, "ShockInABoxRightDensity = %"FSYM, + ret += sscanf(line, "ShockInABoxRightDensity = %"ESYM, &ShockInABoxDensity[1]); - ret += sscanf(line, "ShockInABoxRightPressure = %"FSYM, + ret += sscanf(line, "ShockInABoxRightPressure = %"ESYM, &ShockInABoxPressure[1]); - ret += sscanf(line, "ShockInABoxRightVelocity = %"FSYM, + ret += sscanf(line, "ShockInABoxRightVelocity = %"ESYM, &ShockInABoxVelocity[1]); ret += sscanf(line, "ShockInABoxSubgridLeft = %"PSYM, @@ -103,7 +106,7 @@ int ShockInABoxInitialize(FILE *fptr, FILE *Outfptr, HierarchyEntry &TopGrid, /* if the line is suspicious, issue a warning */ if (ret == 0 && strstr(line, "=") && strstr(line, "ShockInABox")) - fprintf(stderr, "warning: the following parameter line was not interpreted:\n%s\n", line); + fprintf(stderr, "ShockInABox warning: the following parameter line was not interpreted:\n%s\n", line); } @@ -174,17 +177,46 @@ int ShockInABoxInitialize(FILE *fptr, FILE *Outfptr, HierarchyEntry &TopGrid, } } + + /* set up field names and units */ + + DataLabel[0] = DensName; + DataLabel[1] = Vel1Name; + DataLabel[2] = Vel2Name; + DataLabel[3] = Vel3Name; + DataLabel[4] = TEName; + + DataUnits[0] = NULL; + DataUnits[1] = NULL; + DataUnits[2] = NULL; + DataUnits[3] = NULL; + DataUnits[4] = NULL; + + int field_counter = 5; + + if (ShockMethod) { + DataLabel[field_counter++] = MachName; + if(StorePreShockFields){ + DataLabel[field_counter++] = PSTempName; + DataLabel[field_counter++] = PSDenName; + } + } + for (int j = 0; j < field_counter; j++) + DataUnits[j] = NULL; + /* Initialize the exterior. */ Exterior.Prepare(TopGrid.GridData); - float InflowValue[5], Dummy[5]; + float InflowValue[field_counter], Dummy[field_counter]; + for (int j = 0; j < field_counter; j++){ + InflowValue[j] = 0.0; + Dummy[j] = 0.0; + } InflowValue[0] = ShockInABoxDensity[0]; - InflowValue[1] = ShockInABoxPressure[0]/(Gamma-1.0)/ShockInABoxDensity[0] + InflowValue[1] = ShockInABoxVelocity[0]; + InflowValue[4] = ShockInABoxPressure[0]/(Gamma-1.0)/ShockInABoxDensity[0] + 0.5*POW(ShockInABoxVelocity[0], 2); - InflowValue[2] = ShockInABoxVelocity[0]; - InflowValue[3] = 0.0; - InflowValue[4] = 0.0; if (Exterior.InitializeExternalBoundaryFace(0, inflow, outflow, InflowValue, Dummy) == FAIL) { @@ -198,21 +230,6 @@ int ShockInABoxInitialize(FILE *fptr, FILE *Outfptr, HierarchyEntry &TopGrid, Exterior.InitializeExternalBoundaryFace(2, reflecting, reflecting, Dummy, Dummy); - - /* set up field names and units */ - - DataLabel[0] = DensName; - DataLabel[1] = TEName; - DataLabel[2] = Vel1Name; - DataLabel[3] = Vel2Name; - DataLabel[4] = Vel3Name; - - DataUnits[0] = NULL; - DataUnits[1] = NULL; - DataUnits[2] = NULL; - DataUnits[3] = NULL; - DataUnits[4] = NULL; - /* Write parameters to parameter output file */ if (MyProcessorNumber == ROOT_PROCESSOR) { @@ -221,16 +238,16 @@ int ShockInABoxInitialize(FILE *fptr, FILE *Outfptr, HierarchyEntry &TopGrid, fprintf(Outfptr, "ShockInABoxBoundary = %"GOUTSYM"\n\n", ShockInABoxBoundary); - fprintf(Outfptr, "ShockInABoxLeftDensity = %"FSYM"\n", ShockInABoxDensity[0]); - fprintf(Outfptr, "ShockInABoxLeftPressure = %"FSYM"\n", + fprintf(Outfptr, "ShockInABoxLeftDensity = %"ESYM"\n", ShockInABoxDensity[0]); + fprintf(Outfptr, "ShockInABoxLeftPressure = %"ESYM"\n", ShockInABoxPressure[0]); - fprintf(Outfptr, "ShockInABoxLeftVelocity = %"FSYM"\n\n", + fprintf(Outfptr, "ShockInABoxLeftVelocity = %"ESYM"\n\n", ShockInABoxVelocity[0]); - fprintf(Outfptr, "ShockInABoxRightDensity = %"FSYM"\n", ShockInABoxDensity[1]); - fprintf(Outfptr, "ShockInABoxRightPressure = %"FSYM"\n", + fprintf(Outfptr, "ShockInABoxRightDensity = %"ESYM"\n", ShockInABoxDensity[1]); + fprintf(Outfptr, "ShockInABoxRightPressure = %"ESYM"\n", ShockInABoxPressure[1]); - fprintf(Outfptr, "ShockInABoxRightVelocity = %"FSYM"\n\n", + fprintf(Outfptr, "ShockInABoxRightVelocity = %"ESYM"\n\n", ShockInABoxVelocity[1]); } From 4c442c9839c73d16e0cef9f7ff1ba7d2c6452ff3 Mon Sep 17 00:00:00 2001 From: Stephen Skory Date: Wed, 13 Feb 2013 14:34:12 -0700 Subject: [PATCH 03/25] Adding LeftFaceBoundaryCondition to the list of parameters passed to Python/yt. --HG-- branch : week-of-code --- src/enzo/InitializePythonInterface.C | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/enzo/InitializePythonInterface.C b/src/enzo/InitializePythonInterface.C index 9e6d737ea..c34537021 100644 --- a/src/enzo/InitializePythonInterface.C +++ b/src/enzo/InitializePythonInterface.C @@ -264,6 +264,13 @@ void ExportParameterFile(TopGridData *MetaData, FLOAT CurrentTime, FLOAT OldTime PyDict_SetItemString(yt_parameter_file, "TopGridDimensions", tgd_tuple); Py_XDECREF(tgd_tuple); Py_XDECREF(tgd0); Py_XDECREF(tgd1); Py_XDECREF(tgd2); + tgd0 = PyLong_FromLong((long) MetaData->LeftFaceBoundaryCondition[0]); + tgd1 = PyLong_FromLong((long) MetaData->LeftFaceBoundaryCondition[1]); + tgd2 = PyLong_FromLong((long) MetaData->LeftFaceBoundaryCondition[2]); + tgd_tuple = PyTuple_Pack(3, tgd0, tgd1, tgd2); + PyDict_SetItemString(yt_parameter_file, "LeftFaceBoundaryCondition", tgd_tuple); + Py_XDECREF(tgd_tuple); Py_XDECREF(tgd0); Py_XDECREF(tgd1); Py_XDECREF(tgd2); + /* Do the conversion factors */ for (int dim = 0; dim < MAX_NUMBER_OF_BARYON_FIELDS; dim++) { if (DataLabel[dim]) { From dbb78209540adad7e174aed09e2b96b3ef23fd80 Mon Sep 17 00:00:00 2001 From: Sam Skillman Date: Fri, 15 Feb 2013 11:30:14 -0700 Subject: [PATCH 04/25] Allowing HydroShockTubes to be run in 2D and 3D. --HG-- branch : week-of-code --- src/enzo/Grid_HydroShockTubesInitializeGrid.C | 89 +++++++++---------- 1 file changed, 44 insertions(+), 45 deletions(-) diff --git a/src/enzo/Grid_HydroShockTubesInitializeGrid.C b/src/enzo/Grid_HydroShockTubesInitializeGrid.C index d406782d2..475a62c95 100644 --- a/src/enzo/Grid_HydroShockTubesInitializeGrid.C +++ b/src/enzo/Grid_HydroShockTubesInitializeGrid.C @@ -50,13 +50,10 @@ int grid::HydroShockTubesInitializeGrid(float x0, } - int size = 1, activesize = 1, dim; + int size = 1, index, dim; for (dim = 0; dim < GridRank; dim++) size *= GridDimension[dim]; - for (dim = 0; dim < GridRank; dim++) - activesize *= (GridDimension[dim] - 2*NumberOfGhostZones); - int field; for (field = 0; field < NumberOfBaryonFields; field++) if (BaryonField[field] == NULL) @@ -73,36 +70,39 @@ int grid::HydroShockTubesInitializeGrid(float x0, FLOAT x; int i; + for (int k = 0; k < GridDimension[2]; k++) { + for (int j = 0; j < GridDimension[1]; j++) { for (i = 0; i < GridDimension[0]; i++) { x = CellLeftEdge[0][i] + 0.5*CellWidth[0][i]; + index = GRIDINDEX_NOGHOST(i,j,k); if (x <= x0) { - BaryonField[iden ][i] = rhol; - BaryonField[ivx ][i] = vxl; - BaryonField[ivy ][i] = vyl; - BaryonField[ivz ][i] = vzl; - BaryonField[ietot][i] = etotl; + BaryonField[iden ][index] = rhol; + BaryonField[ivx ][index] = vxl; + BaryonField[ivy ][index] = vyl; + BaryonField[ivz ][index] = vzl; + BaryonField[ietot][index] = etotl; if (DualEnergyFormalism) { - BaryonField[ieint][i] = etotl - 0.5*(vxl*vxl+vyl*vyl+vzl*vzl); + BaryonField[ieint][index] = etotl - 0.5*(vxl*vxl+vyl*vyl+vzl*vzl); } } else { - BaryonField[iden ][i] = rhor; - BaryonField[ivx ][i] = vxr; - BaryonField[ivy ][i] = vyr; - BaryonField[ivz ][i] = vzr; - BaryonField[ietot][i] = etotr; + BaryonField[iden ][index] = rhor; + BaryonField[ivx ][index] = vxr; + BaryonField[ivy ][index] = vyr; + BaryonField[ivz ][index] = vzr; + BaryonField[ietot][index] = etotr; if (DualEnergyFormalism) { - BaryonField[ieint][i] = etotr - 0.5*(vxr*vxr+vyr*vyr+vzr*vzr); + BaryonField[ieint][index] = etotr - 0.5*(vxr*vxr+vyr*vyr+vzr*vzr); } } //Shock if (ShockMethod) { - BaryonField[MachNum][i] = tiny_number; + BaryonField[MachNum][index] = tiny_number; if (StorePreShockFields) { - BaryonField[PSTempNum][i] = tiny_number; - BaryonField[PSDenNum][i] = tiny_number; + BaryonField[PSTempNum][index] = tiny_number; + BaryonField[PSDenNum][index] = tiny_number; } } @@ -149,18 +149,14 @@ int grid::HydroShockTubesInitializeGrid(float x0, float x1, } - int size = 1, activesize = 1, dim; + int size = 1, dim, index; for (dim = 0; dim < GridRank; dim++) size *= GridDimension[dim]; - for (dim = 0; dim < GridRank; dim++) - activesize *= (GridDimension[dim] - 2*NumberOfGhostZones); - int field; for (field = 0; field < NumberOfBaryonFields; field++) if (BaryonField[field] == NULL) BaryonField[field] = new float[size]; - /* transform pressure to total energy */ float etotl, etotr, etotc, v2; @@ -175,46 +171,49 @@ int grid::HydroShockTubesInitializeGrid(float x0, float x1, FLOAT x; int i; + for (int k = 0; k < GridDimension[2]; k++) { + for (int j = 0; j < GridDimension[1]; j++) { for (i = 0; i < GridDimension[0]; i++) { x = CellLeftEdge[0][i] + 0.5*CellWidth[0][i]; + index = GRIDINDEX_NOGHOST(i,j,k); if (x <= x0) { - BaryonField[iden ][i] = rhol; - BaryonField[ivx ][i] = vxl; - BaryonField[ivy ][i] = vyl; - BaryonField[ivz ][i] = vzl; - BaryonField[ietot][i] = etotl; + BaryonField[iden ][index] = rhol; + BaryonField[ivx ][index] = vxl; + BaryonField[ivy ][index] = vyl; + BaryonField[ivz ][index] = vzl; + BaryonField[ietot][index] = etotl; if (DualEnergyFormalism) { - BaryonField[ieint][i] = etotl - 0.5*(vxl*vxl+vyl*vyl+vzl*vzl); + BaryonField[ieint][index] = etotl - 0.5*(vxl*vxl+vyl*vyl+vzl*vzl); } } else if (x <= x1) { - BaryonField[iden ][i] = rhoc; - BaryonField[ivx ][i] = vxc; - BaryonField[ivy ][i] = vyc; - BaryonField[ivz ][i] = vzc; - BaryonField[ietot][i] = etotc; + BaryonField[iden ][index] = rhoc; + BaryonField[ivx ][index] = vxc; + BaryonField[ivy ][index] = vyc; + BaryonField[ivz ][index] = vzc; + BaryonField[ietot][index] = etotc; if (DualEnergyFormalism) { - BaryonField[ieint][i] = etotc - 0.5*(vxc*vxc+vyc*vyc+vzc*vzc); + BaryonField[ieint][index] = etotc - 0.5*(vxc*vxc+vyc*vyc+vzc*vzc); } } else { - BaryonField[iden ][i] = rhor; - BaryonField[ivx ][i] = vxr; - BaryonField[ivy ][i] = vyr; - BaryonField[ivz ][i] = vzr; - BaryonField[ietot][i] = etotr; + BaryonField[iden ][index] = rhor; + BaryonField[ivx ][index] = vxr; + BaryonField[ivy ][index] = vyr; + BaryonField[ivz ][index] = vzr; + BaryonField[ietot][index] = etotr; if (DualEnergyFormalism) { - BaryonField[ieint][i] = etotr - 0.5*(vxr*vxr+vyr*vyr+vzr*vzr); + BaryonField[ieint][index] = etotr - 0.5*(vxr*vxr+vyr*vyr+vzr*vzr); } } //Shock if (ShockMethod) { - BaryonField[MachNum][i] = tiny_number; + BaryonField[MachNum][index] = tiny_number; if (StorePreShockFields) { - BaryonField[PSTempNum][i] = tiny_number; - BaryonField[PSDenNum][i] = tiny_number; + BaryonField[PSTempNum][index] = tiny_number; + BaryonField[PSDenNum][index] = tiny_number; } } } From 59d32f3c42de4065032938fecb9c123345858e84 Mon Sep 17 00:00:00 2001 From: Sam Skillman Date: Fri, 15 Feb 2013 14:20:17 -0700 Subject: [PATCH 05/25] Adding ShockInABox test problem, which allows users to specify physical densities/temperatures/mach numbers. Also a bugfix to the hydro shock tubes grid initializer. --HG-- branch : week-of-code --- .../Hydro-1D/ShockInABox/CustomShockBox.enzo | 71 ++++++++++++++ .../Hydro-1D/ShockInABox/input_shock.enzo | 52 ++++++++++ run/Hydro/Hydro-1D/ShockInABox/make_plots.py | 50 ++++++++++ run/Hydro/Hydro-1D/ShockInABox/make_shock.py | 98 +++++++++++++++++++ src/enzo/Grid_HydroShockTubesInitializeGrid.C | 6 +- 5 files changed, 275 insertions(+), 2 deletions(-) create mode 100644 run/Hydro/Hydro-1D/ShockInABox/CustomShockBox.enzo create mode 100644 run/Hydro/Hydro-1D/ShockInABox/input_shock.enzo create mode 100644 run/Hydro/Hydro-1D/ShockInABox/make_plots.py create mode 100755 run/Hydro/Hydro-1D/ShockInABox/make_shock.py diff --git a/run/Hydro/Hydro-1D/ShockInABox/CustomShockBox.enzo b/run/Hydro/Hydro-1D/ShockInABox/CustomShockBox.enzo new file mode 100644 index 000000000..98e70e423 --- /dev/null +++ b/run/Hydro/Hydro-1D/ShockInABox/CustomShockBox.enzo @@ -0,0 +1,71 @@ +# +# Custom ShockInABox Problem. +# Shock Mach Number: 3.000000 +# PreShock Temperature: 2.727273e+06 +# PostShock Temperature: 1.000000e+07 +# PreShock Density: 1.000000e+00 +# + +# +# AMR PROBLEM DEFINITION FILE: 1D Shock Propogation test +# +# define problem +# +ProblemType = 5 // Shock In A Box +TopGridRank = 1 +TopGridDimensions = 32 + +ShockInABoxBoundary = 0.5 + +LeftFaceBoundaryCondition = 2 0 0 // set left faces to inflow +RightFaceBoundaryCondition = 1 0 0 // set right faces to outflow + +# +# set I/O and stop/start parameters +# +StopTime = 1.0e0 +dtDataDump = 1.0e-1 + +# +# set Hydro parameters +# +HydroMethod = 0 +Gamma = 1.66667 +CourantSafetyNumber = 0.8 +PPMDiffusionParameter = 1 // diffusion on +PPMFlatteningParameter = 1 // flattening on +PPMSteepeningParameter = 1 // steepening on + +# +# set grid refinement parameters +# +StaticHierarchy = 0 // static hierarchy +MaximumRefinementLevel = 2 +RefineBy = 2 // refinement factor +CellFlaggingMethod = 1 +MinimumEfficiency = 0.5 + +# +# set some misc global parameters +# +OutputTemperature = 1 + +# +# Turn on Shock Finding +# +ShockTemperatureFloor=1.0e0 +StorePreShockFields = 1 +FindShocksOnlyOnOutput = 1 +ShockMethod = 1 + + +DensityUnits = 1.67453400e-24 +LengthUnits = 3.08567758e+24 +TimeUnits = 3.15576000e+16 +ShockInABoxLeftDensity = 1.00000000e+00 +ShockInABoxLeftVelocity = 6.90120768e-01 +ShockInABoxLeftPressure = 3.91989033e-02 +ShockInABoxRightDensity = 3.00000000e+00 +ShockInABoxRightVelocity = 1.78920199e-01 +ShockInABoxRightPressure = 4.31187936e-01 + diff --git a/run/Hydro/Hydro-1D/ShockInABox/input_shock.enzo b/run/Hydro/Hydro-1D/ShockInABox/input_shock.enzo new file mode 100644 index 000000000..d862cd8fd --- /dev/null +++ b/run/Hydro/Hydro-1D/ShockInABox/input_shock.enzo @@ -0,0 +1,52 @@ +# +# AMR PROBLEM DEFINITION FILE: 1D Shock Propogation test +# +# define problem +# +ProblemType = 5 // Shock In A Box +TopGridRank = 1 +TopGridDimensions = 32 + +ShockInABoxBoundary = 0.5 + +LeftFaceBoundaryCondition = 2 0 0 // set left faces to inflow +RightFaceBoundaryCondition = 1 0 0 // set right faces to outflow + +# +# set I/O and stop/start parameters +# +StopTime = 1.0e0 +dtDataDump = 1.0e-1 + +# +# set Hydro parameters +# +HydroMethod = 0 +Gamma = 1.66667 +CourantSafetyNumber = 0.8 +PPMDiffusionParameter = 1 // diffusion on +PPMFlatteningParameter = 1 // flattening on +PPMSteepeningParameter = 1 // steepening on + +# +# set grid refinement parameters +# +StaticHierarchy = 0 // static hierarchy +MaximumRefinementLevel = 2 +RefineBy = 2 // refinement factor +CellFlaggingMethod = 1 +MinimumEfficiency = 0.5 + +# +# set some misc global parameters +# +OutputTemperature = 1 + +# +# Turn on Shock Finding +# +ShockTemperatureFloor=1.0e0 +StorePreShockFields = 1 +FindShocksOnlyOnOutput = 1 +ShockMethod = 1 + diff --git a/run/Hydro/Hydro-1D/ShockInABox/make_plots.py b/run/Hydro/Hydro-1D/ShockInABox/make_plots.py new file mode 100644 index 000000000..d10a0322f --- /dev/null +++ b/run/Hydro/Hydro-1D/ShockInABox/make_plots.py @@ -0,0 +1,50 @@ +from yt.mods import * +import pylab + +### define problem name +problem_name = 'CustomShockBox' + +### define simulation output directory and filename base +output_dir_base = 'DD' +datafile_base = 'data' + +### load data +ts = TimeSeriesData.from_filenames("*/*.hierarchy") +for pf in ts: + pylab.clf() + print pf.current_time + + ### extract an ortho_ray (1D solution vector) + ray = pf.h.ortho_ray(0, [0.5, 0.5]) + + pylab.figure(1, figsize=(10,8)) + + # Density Plot + pylab.subplot(2,2,1) + pylab.semilogy(ray['x'],ray['Density'], 'k') + pylab.xlabel('Position') + pylab.ylabel('Density') + + # Temperature Plot + pylab.subplot(2,2,2) + pylab.semilogy(ray['x'],ray['Temperature'], 'b') + pylab.xlabel('Position') + pylab.ylabel('Temperature') + + # Mach Plot + pylab.subplot(2,2,3) + pylab.plot(ray['x'],ray['Mach'], 'k') + pylab.xlabel('x') + pylab.ylabel('Mach') + + # Mach Plot + pylab.subplot(2,2,4) + pylab.plot(ray['x'],ray['VelocityMagnitude'], 'k') + pylab.xlabel('x') + pylab.ylabel('|v|') + + ### Save plot + pylab.savefig('%s_thermal.png' % pf) + +pylab.clf() + diff --git a/run/Hydro/Hydro-1D/ShockInABox/make_shock.py b/run/Hydro/Hydro-1D/ShockInABox/make_shock.py new file mode 100755 index 000000000..d07f10e57 --- /dev/null +++ b/run/Hydro/Hydro-1D/ShockInABox/make_shock.py @@ -0,0 +1,98 @@ +#!/usr/bin/python +import sys +import os + +kboltz = 1.3806504e-16 # erg K^-1 +sec_per_Gyr = 31.5576e15 +mpc_per_cm = 3.24077929e-25 +cm_per_mpc = 1.0 / mpc_per_cm +mh = 1.674534e-24 # g +mu = 0.6 + +def setup_shockbox(length_units, time_units, d1, T1, m, gamma=None): + if gamma is None: gamma = 5./3. + + dens_units = mh + temp_units = dens_units*(length_units/time_units)**2/kboltz + p1 = (T1/temp_units)*d1/mu + d2 = d1*((gamma+1.)*m*m)/((gamma-1.)*m*m + 2.); + p2 = p1*(2.0*gamma*m*m - (gamma-1.))/(gamma+1.); + c1 = (gamma*p1/(d1))**0.5; + v1 = 0.0 + v2 = m*c1*(1.-d1/d2); + shockspeed = 0.9*c1 * m; + + vel_units = length_units/time_units + + lines = [] + lines.append('\n') + lines.append('DensityUnits = %0.8e\n' % dens_units) + lines.append('LengthUnits = %0.8e\n' % length_units) + lines.append('TimeUnits = %0.8e\n' % time_units) + lines.append('ShockInABoxLeftDensity = %0.8e\n' % (d1)) + lines.append('ShockInABoxLeftVelocity = %0.8e\n' % ((shockspeed - v1))) + lines.append('ShockInABoxLeftPressure = %0.8e\n' % (p1) ) + + lines.append('ShockInABoxRightDensity = %0.8e\n' % (d2)) + lines.append('ShockInABoxRightVelocity = %0.8e\n' % ((shockspeed - v2))) + lines.append('ShockInABoxRightPressure = %0.8e\n' % (p2) ) + lines.append('\n') + + return lines + +def get_header(d1, T1, T2, M): + lines = [] + lines.append('# \n') + lines.append('# Custom ShockInABox Problem.\n') + lines.append('# Shock Mach Number: %f\n' % M) + lines.append('# PreShock Temperature: %e\n' % T1) + lines.append('# PostShock Temperature: %e\n' % T2) + lines.append('# PreShock Density: %e\n' % d1) + lines.append('# \n\n') + return lines + +def write_lines(outfile, lines): + f = file(outfile,'w') + f.writelines(lines) + f.close() + +def get_lines(infile): + f = file(infile,'r') + lines = f.readlines() + f.close() + return lines + +def add_lines(infile, outfile, lines): + orig_lines = get_lines(infile) + of = file(outfile,'w') + of.writelines(orig_lines) + of.writelines(lines) + of.close() + +def TempJump(mach): + Gamma = 5.0/3.0 + M2 = mach*mach; + TJ = (2.0*Gamma*M2-(Gamma-1.0))*((Gamma-1.0)*M2+2.0)/(M2*(Gamma+1.0)**2); + return TJ + +simtime = 1.0*sec_per_Gyr # 1 Gyr +boxsize = 1.0*cm_per_mpc # 1 Mpc box +pre_shock_den = 1.0e0 # part/cc +postT = 1.0e7 # K +mach = 3.0 + +infile = 'input_shock.enzo' +myname = 'CustomShockBox.enzo' + +# No modification is needed below here. + +preT = postT/TempJump(mach) + +header = get_header(pre_shock_den, preT, postT, mach) +inlines = get_lines(infile) +customlines = setup_shockbox(boxsize, simtime, pre_shock_den, preT, mach) + +write_lines(myname, header+inlines+customlines) + + + diff --git a/src/enzo/Grid_HydroShockTubesInitializeGrid.C b/src/enzo/Grid_HydroShockTubesInitializeGrid.C index 475a62c95..1203b4ee5 100644 --- a/src/enzo/Grid_HydroShockTubesInitializeGrid.C +++ b/src/enzo/Grid_HydroShockTubesInitializeGrid.C @@ -107,6 +107,8 @@ int grid::HydroShockTubesInitializeGrid(float x0, } } + } + } return SUCCESS; } @@ -134,8 +136,6 @@ int grid::HydroShockTubesInitializeGrid(float x0, float x1, FieldType[NumberOfBaryonFields++] = InternalEnergy; } - - if(ShockMethod){ FieldType[MachNum = NumberOfBaryonFields++] = Mach; if(StorePreShockFields){ @@ -217,6 +217,8 @@ int grid::HydroShockTubesInitializeGrid(float x0, float x1, } } } + } + } return SUCCESS; } From fe9447eba02bb10ed230d80899bb014fdb355c29 Mon Sep 17 00:00:00 2001 From: Sam Skillman Date: Fri, 15 Feb 2013 14:42:30 -0700 Subject: [PATCH 06/25] Adding test of shock mach number. --HG-- branch : week-of-code --- .../CustomShockBox__test_customshockbox.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 run/Hydro/Hydro-1D/ShockInABox/CustomShockBox__test_customshockbox.py diff --git a/run/Hydro/Hydro-1D/ShockInABox/CustomShockBox__test_customshockbox.py b/run/Hydro/Hydro-1D/ShockInABox/CustomShockBox__test_customshockbox.py new file mode 100644 index 000000000..d78710b05 --- /dev/null +++ b/run/Hydro/Hydro-1D/ShockInABox/CustomShockBox__test_customshockbox.py @@ -0,0 +1,14 @@ +from yt.mods import * +from yt.funcs import * +from yt.testing import * +from yt.frontends.enzo.answer_testing_support import \ + requires_outputlog +import os + +# Verifies that OutputLog exists +@requires_outputlog(os.path.dirname(__file__), "CustomShockBox.enzo") +def test_customshockbox(): + pf = load('DD0010/data0010') + mach = pf.h.find_max('Mach')[0] + yield assert_allclose(mach, 3.0, rtol=1.0e-2) + From 8a083d4f771a952b6d8a0496ee8f535f230aef83 Mon Sep 17 00:00:00 2001 From: Sam Skillman Date: Fri, 15 Feb 2013 14:43:10 -0700 Subject: [PATCH 07/25] Adding CustomShockBox enzotest file. --HG-- branch : week-of-code --- .../Hydro-1D/ShockInABox/CustomShockBox.enzotest | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 run/Hydro/Hydro-1D/ShockInABox/CustomShockBox.enzotest diff --git a/run/Hydro/Hydro-1D/ShockInABox/CustomShockBox.enzotest b/run/Hydro/Hydro-1D/ShockInABox/CustomShockBox.enzotest new file mode 100644 index 000000000..692f1a69e --- /dev/null +++ b/run/Hydro/Hydro-1D/ShockInABox/CustomShockBox.enzotest @@ -0,0 +1,11 @@ +name = 'CustomShockBox' +answer_testing_script = None +nprocs = 1 +runtime = 'short' +hydro = True +gravity = False +dimensionality = 1 +max_time_minutes = 1 +fullsuite = True +pushsuite = True +quicksuite = True From aba00ff8cca09f2e6b65191f1a22e746f622aeed Mon Sep 17 00:00:00 2001 From: Sam Skillman Date: Fri, 15 Feb 2013 15:29:50 -0700 Subject: [PATCH 08/25] Moving files around. Now ShockInABox.enzo is standard, and make_shock.py will create CustomShockBox.enzo --HG-- branch : week-of-code --- .../ShockInABox/{CustomShockBox.enzo => ShockInABox.enzo} | 2 +- .../{CustomShockBox.enzotest => ShockInABox.enzotest} | 4 ++-- ...est_customshockbox.py => ShockInABox__test_shockinabox.py} | 2 +- run/Hydro/Hydro-1D/ShockInABox/make_plots.py | 3 --- 4 files changed, 4 insertions(+), 7 deletions(-) rename run/Hydro/Hydro-1D/ShockInABox/{CustomShockBox.enzo => ShockInABox.enzo} (98%) rename run/Hydro/Hydro-1D/ShockInABox/{CustomShockBox.enzotest => ShockInABox.enzotest} (64%) rename run/Hydro/Hydro-1D/ShockInABox/{CustomShockBox__test_customshockbox.py => ShockInABox__test_shockinabox.py} (82%) diff --git a/run/Hydro/Hydro-1D/ShockInABox/CustomShockBox.enzo b/run/Hydro/Hydro-1D/ShockInABox/ShockInABox.enzo similarity index 98% rename from run/Hydro/Hydro-1D/ShockInABox/CustomShockBox.enzo rename to run/Hydro/Hydro-1D/ShockInABox/ShockInABox.enzo index 98e70e423..b3434abe2 100644 --- a/run/Hydro/Hydro-1D/ShockInABox/CustomShockBox.enzo +++ b/run/Hydro/Hydro-1D/ShockInABox/ShockInABox.enzo @@ -1,5 +1,5 @@ # -# Custom ShockInABox Problem. +# ShockInABox Problem. # Shock Mach Number: 3.000000 # PreShock Temperature: 2.727273e+06 # PostShock Temperature: 1.000000e+07 diff --git a/run/Hydro/Hydro-1D/ShockInABox/CustomShockBox.enzotest b/run/Hydro/Hydro-1D/ShockInABox/ShockInABox.enzotest similarity index 64% rename from run/Hydro/Hydro-1D/ShockInABox/CustomShockBox.enzotest rename to run/Hydro/Hydro-1D/ShockInABox/ShockInABox.enzotest index 692f1a69e..d572732dd 100644 --- a/run/Hydro/Hydro-1D/ShockInABox/CustomShockBox.enzotest +++ b/run/Hydro/Hydro-1D/ShockInABox/ShockInABox.enzotest @@ -1,5 +1,5 @@ -name = 'CustomShockBox' -answer_testing_script = None +name = 'ShockInABox' +answer_testing_script = 'ShockInABox__test_shockinabox.py' nprocs = 1 runtime = 'short' hydro = True diff --git a/run/Hydro/Hydro-1D/ShockInABox/CustomShockBox__test_customshockbox.py b/run/Hydro/Hydro-1D/ShockInABox/ShockInABox__test_shockinabox.py similarity index 82% rename from run/Hydro/Hydro-1D/ShockInABox/CustomShockBox__test_customshockbox.py rename to run/Hydro/Hydro-1D/ShockInABox/ShockInABox__test_shockinabox.py index d78710b05..7e998876c 100644 --- a/run/Hydro/Hydro-1D/ShockInABox/CustomShockBox__test_customshockbox.py +++ b/run/Hydro/Hydro-1D/ShockInABox/ShockInABox__test_shockinabox.py @@ -6,7 +6,7 @@ import os # Verifies that OutputLog exists -@requires_outputlog(os.path.dirname(__file__), "CustomShockBox.enzo") +@requires_outputlog(os.path.dirname(__file__), "ShockInABox.enzo") def test_customshockbox(): pf = load('DD0010/data0010') mach = pf.h.find_max('Mach')[0] diff --git a/run/Hydro/Hydro-1D/ShockInABox/make_plots.py b/run/Hydro/Hydro-1D/ShockInABox/make_plots.py index d10a0322f..4504e41ea 100644 --- a/run/Hydro/Hydro-1D/ShockInABox/make_plots.py +++ b/run/Hydro/Hydro-1D/ShockInABox/make_plots.py @@ -1,9 +1,6 @@ from yt.mods import * import pylab -### define problem name -problem_name = 'CustomShockBox' - ### define simulation output directory and filename base output_dir_base = 'DD' datafile_base = 'data' From 0d4efcf646b25512c7e4fd45ebfe2488b2e704b0 Mon Sep 17 00:00:00 2001 From: Sam Skillman Date: Fri, 15 Feb 2013 16:10:28 -0700 Subject: [PATCH 09/25] Fixing the test method to use the AssertionWrapper. --HG-- branch : week-of-code --- .../Hydro-1D/ShockInABox/ShockInABox__test_shockinabox.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/run/Hydro/Hydro-1D/ShockInABox/ShockInABox__test_shockinabox.py b/run/Hydro/Hydro-1D/ShockInABox/ShockInABox__test_shockinabox.py index 7e998876c..c09d74bb7 100644 --- a/run/Hydro/Hydro-1D/ShockInABox/ShockInABox__test_shockinabox.py +++ b/run/Hydro/Hydro-1D/ShockInABox/ShockInABox__test_shockinabox.py @@ -3,12 +3,14 @@ from yt.testing import * from yt.frontends.enzo.answer_testing_support import \ requires_outputlog +from yt.utilities.answer_testing.framework import AssertWrapper import os # Verifies that OutputLog exists @requires_outputlog(os.path.dirname(__file__), "ShockInABox.enzo") -def test_customshockbox(): +def test_shockinabox(): pf = load('DD0010/data0010') mach = pf.h.find_max('Mach')[0] - yield assert_allclose(mach, 3.0, rtol=1.0e-2) + myname = 'ShockInABox_Mach' + yield AssertWrapper(myname, assert_allclose, mach, 3.0, 1.0e-2) From 5a91256dd7ca2b3b50346f8a04d8e2e4e3ce58c6 Mon Sep 17 00:00:00 2001 From: Sam Skillman Date: Wed, 20 Feb 2013 10:05:00 -0700 Subject: [PATCH 10/25] Addressing PR comments: make different gamma's work throughout make_shock.py, also having it write Gamma to the CustomShockBox.enzo. Removing unused code in ShockInABoxInitialize.C. --HG-- branch : week-of-code --- run/Hydro/Hydro-1D/ShockInABox/input_shock.enzo | 1 - run/Hydro/Hydro-1D/ShockInABox/make_shock.py | 16 +++++++++------- src/enzo/ShockInABoxInitialize.C | 8 -------- 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/run/Hydro/Hydro-1D/ShockInABox/input_shock.enzo b/run/Hydro/Hydro-1D/ShockInABox/input_shock.enzo index d862cd8fd..040fc6b5c 100644 --- a/run/Hydro/Hydro-1D/ShockInABox/input_shock.enzo +++ b/run/Hydro/Hydro-1D/ShockInABox/input_shock.enzo @@ -22,7 +22,6 @@ dtDataDump = 1.0e-1 # set Hydro parameters # HydroMethod = 0 -Gamma = 1.66667 CourantSafetyNumber = 0.8 PPMDiffusionParameter = 1 // diffusion on PPMFlatteningParameter = 1 // flattening on diff --git a/run/Hydro/Hydro-1D/ShockInABox/make_shock.py b/run/Hydro/Hydro-1D/ShockInABox/make_shock.py index d07f10e57..f2dc9a08f 100755 --- a/run/Hydro/Hydro-1D/ShockInABox/make_shock.py +++ b/run/Hydro/Hydro-1D/ShockInABox/make_shock.py @@ -20,7 +20,7 @@ def setup_shockbox(length_units, time_units, d1, T1, m, gamma=None): c1 = (gamma*p1/(d1))**0.5; v1 = 0.0 v2 = m*c1*(1.-d1/d2); - shockspeed = 0.9*c1 * m; + shockspeed = 1.0 * c1 * m; vel_units = length_units/time_units @@ -29,6 +29,7 @@ def setup_shockbox(length_units, time_units, d1, T1, m, gamma=None): lines.append('DensityUnits = %0.8e\n' % dens_units) lines.append('LengthUnits = %0.8e\n' % length_units) lines.append('TimeUnits = %0.8e\n' % time_units) + lines.append('Gamma = %f\n' % gamma) lines.append('ShockInABoxLeftDensity = %0.8e\n' % (d1)) lines.append('ShockInABoxLeftVelocity = %0.8e\n' % ((shockspeed - v1))) lines.append('ShockInABoxLeftPressure = %0.8e\n' % (p1) ) @@ -69,8 +70,9 @@ def add_lines(infile, outfile, lines): of.writelines(lines) of.close() -def TempJump(mach): - Gamma = 5.0/3.0 +def TempJump(mach, Gamma=None): + if Gamma is None: + Gamma = 5.0/3.0 M2 = mach*mach; TJ = (2.0*Gamma*M2-(Gamma-1.0))*((Gamma-1.0)*M2+2.0)/(M2*(Gamma+1.0)**2); return TJ @@ -80,19 +82,19 @@ def TempJump(mach): pre_shock_den = 1.0e0 # part/cc postT = 1.0e7 # K mach = 3.0 +gas_gamma = 5./3. infile = 'input_shock.enzo' myname = 'CustomShockBox.enzo' # No modification is needed below here. -preT = postT/TempJump(mach) +preT = postT/TempJump(mach, gas_gamma) header = get_header(pre_shock_den, preT, postT, mach) inlines = get_lines(infile) -customlines = setup_shockbox(boxsize, simtime, pre_shock_den, preT, mach) +customlines = setup_shockbox(boxsize, simtime, pre_shock_den, preT, mach, + gamma=gas_gamma) write_lines(myname, header+inlines+customlines) - - diff --git a/src/enzo/ShockInABoxInitialize.C b/src/enzo/ShockInABoxInitialize.C index 72dab3e0e..32f389532 100644 --- a/src/enzo/ShockInABoxInitialize.C +++ b/src/enzo/ShockInABoxInitialize.C @@ -115,14 +115,6 @@ int ShockInABoxInitialize(FILE *fptr, FILE *Outfptr, HierarchyEntry &TopGrid, if( ShockInABoxDirection != 0 ) ENZO_FAIL("Only ShockInABoxDirection=0 supported at the moment!"); -// if (TopGrid.GridData->ShockTubeInitializeGrid(ShockInABoxDirection, -// ShockInABoxBoundary, -// ShockInABoxDensity, -// ShockInABoxPressure, -// ShockInABoxVelocity) == FAIL) { -// ENZO_FAIL("Error in ShockTubeInitializeGrid.\n"); -// } - if (TopGrid.GridData-> HydroShockTubesInitializeGrid(ShockInABoxBoundary, ShockInABoxDensity[0], ShockInABoxDensity[1], From ce895d2827c93cb6592f18cc9eeab3d7e355f25c Mon Sep 17 00:00:00 2001 From: John Wise Date: Tue, 12 Mar 2013 12:31:26 -0400 Subject: [PATCH 11/25] Adding options for constant pressure spheres and smooth ambient-sphere density interfaces for collapse and photon tests. --HG-- branch : week-of-code --- src/enzo/CollapseTestInitialize.C | 40 +++++++++++++++++----- src/enzo/Grid.h | 3 ++ src/enzo/Grid_CollapseTestInitializeGrid.C | 33 +++++++++++++++--- src/enzo/Grid_PhotonTestInitializeGrid.C | 35 ++++++++++++++++--- src/enzo/PhotonGrid_Methods.h | 3 ++ src/enzo/PhotonTestInitialize.C | 32 ++++++++++++++--- 6 files changed, 124 insertions(+), 22 deletions(-) diff --git a/src/enzo/CollapseTestInitialize.C b/src/enzo/CollapseTestInitialize.C index 833512487..30f876ff1 100644 --- a/src/enzo/CollapseTestInitialize.C +++ b/src/enzo/CollapseTestInitialize.C @@ -87,10 +87,13 @@ int CollapseTestInitialize(FILE *fptr, FILE *Outfptr, CollapseTestSphereCutOff[MAX_SPHERES], CollapseTestSphereAng1[MAX_SPHERES], CollapseTestSphereAng2[MAX_SPHERES], - CollapseTestSphereMetallicity[MAX_SPHERES]; + CollapseTestSphereMetallicity[MAX_SPHERES], + CollapseTestSphereSmoothRadius[MAX_SPHERES]; int CollapseTestSphereNumShells[MAX_SPHERES], CollapseTestSphereInitialLevel[MAX_SPHERES], - CollapseTestSphereType[MAX_SPHERES]; + CollapseTestSphereType[MAX_SPHERES], + CollapseTestSphereConstantPressure[MAX_SPHERES], + CollapseTestSphereSmoothSurface[MAX_SPHERES]; FLOAT CollapseTestSphereRadius[MAX_SPHERES], CollapseTestSphereCoreRadius[MAX_SPHERES], CollapseTestSpherePosition[MAX_SPHERES][MAX_DIMENSION]; @@ -107,6 +110,7 @@ int CollapseTestInitialize(FILE *fptr, FILE *Outfptr, CollapseTestSphereAng1[sphere] = 0; CollapseTestSphereAng2[sphere] = 0; CollapseTestSphereNumShells[sphere] = 1; + CollapseTestSphereSmoothRadius[sphere] = 1.2; CollapseTestSphereMetallicity[sphere] = 0; CollapseTestSphereInitialLevel[sphere] = 0; @@ -116,6 +120,8 @@ int CollapseTestInitialize(FILE *fptr, FILE *Outfptr, CollapseTestSphereVelocity[sphere][dim] = 0; } CollapseTestSphereType[sphere] = 0; + CollapseTestSphereConstantPressure[sphere] = FALSE; + CollapseTestSphereSmoothSurface[sphere] = FALSE; } for (dim = 0; dim < MAX_DIMENSION; dim++) CollapseTestUniformVelocity[dim] = 0; @@ -199,6 +205,15 @@ int CollapseTestInitialize(FILE *fptr, FILE *Outfptr, if (sscanf(line, "CollapseTestSphereInitialLevel[%"ISYM"]", &sphere) > 0) ret += sscanf(line, "CollapseTestSphereInitialLevel[%"ISYM"] = %"ISYM, &sphere, &CollapseTestSphereInitialLevel[sphere]); + if (sscanf(line, "CollapseTestSphereConstantPressure[%"ISYM"]", &sphere) > 0) + ret += sscanf(line, "CollapseTestSphereConstantPressure[%"ISYM"] = %"ISYM, &sphere, + &CollapseTestSphereConstantPressure[sphere]); + if (sscanf(line, "CollapseTestSphereSmoothSurface[%"ISYM"]", &sphere) > 0) + ret += sscanf(line, "CollapseTestSphereSmoothSurface[%"ISYM"] = %"ISYM, &sphere, + &CollapseTestSphereSmoothSurface[sphere]); + if (sscanf(line, "CollapseTestSphereSmoothRadius[%"ISYM"]", &sphere) > 0) + ret += sscanf(line, "CollapseTestSphereSmoothRadius[%"FSYM"] = %"FSYM, &sphere, + &CollapseTestSphereSmoothRadius[sphere]); /* if the line is suspicious, issue a warning */ @@ -219,8 +234,9 @@ int CollapseTestInitialize(FILE *fptr, FILE *Outfptr, CollapseTestSphereDispersion, CollapseTestSphereCutOff, CollapseTestSphereAng1, CollapseTestSphereAng2, CollapseTestSphereNumShells, - CollapseTestSphereType, CollapseTestUseParticles, - CollapseTestParticleMeanDensity, + CollapseTestSphereType, CollapseTestSphereConstantPressure, + CollapseTestSphereSmoothSurface, CollapseTestSphereSmoothRadius, + CollapseTestUseParticles, CollapseTestParticleMeanDensity, CollapseTestUniformVelocity, CollapseTestUseColour, CollapseTestUseMetals, CollapseTestInitialTemperature, CollapseTestInitialDensity, @@ -322,8 +338,9 @@ int CollapseTestInitialize(FILE *fptr, FILE *Outfptr, CollapseTestSphereDispersion, CollapseTestSphereCutOff, CollapseTestSphereAng1, CollapseTestSphereAng2, CollapseTestSphereNumShells, - CollapseTestSphereType, CollapseTestUseParticles, - CollapseTestParticleMeanDensity, + CollapseTestSphereType, CollapseTestSphereConstantPressure, + CollapseTestSphereSmoothSurface, CollapseTestSphereSmoothRadius, + CollapseTestUseParticles, CollapseTestParticleMeanDensity, CollapseTestUniformVelocity, CollapseTestUseColour, CollapseTestUseMetals, CollapseTestInitialTemperature, CollapseTestInitialDensity, @@ -365,8 +382,9 @@ int CollapseTestInitialize(FILE *fptr, FILE *Outfptr, CollapseTestSphereDispersion, CollapseTestSphereCutOff, CollapseTestSphereAng1, CollapseTestSphereAng2, CollapseTestSphereNumShells, - CollapseTestSphereType, CollapseTestUseParticles, - CollapseTestParticleMeanDensity, + CollapseTestSphereType, CollapseTestSphereConstantPressure, + CollapseTestSphereSmoothSurface, CollapseTestSphereSmoothRadius, + CollapseTestUseParticles, CollapseTestParticleMeanDensity, CollapseTestUniformVelocity, CollapseTestUseColour, CollapseTestUseMetals, CollapseTestInitialTemperature, CollapseTestInitialDensity, @@ -480,6 +498,12 @@ int CollapseTestInitialize(FILE *fptr, FILE *Outfptr, CollapseTestSphereAng2[sphere]); fprintf(Outfptr, "CollapseTestSphereNumShells[%"ISYM"] = %"ISYM"\n", sphere, CollapseTestSphereNumShells[sphere]); + fprintf(Outfptr, "CollapseTestSphereConstantPressure[%"ISYM"] = %"ISYM"\n", sphere, + CollapseTestSphereConstantPressure[sphere]); + fprintf(Outfptr, "CollapseTestSphereSmoothSurface[%"ISYM"] = %"ISYM"\n", sphere, + CollapseTestSphereSmoothSurface[sphere]); + fprintf(Outfptr, "CollapseTestSphereConstantPressure[%"ISYM"] = %"ISYM"\n", sphere, + CollapseTestSphereConstantPressure[sphere]); } } diff --git a/src/enzo/Grid.h b/src/enzo/Grid.h index f85b98a4f..c4f76df33 100644 --- a/src/enzo/Grid.h +++ b/src/enzo/Grid.h @@ -1922,6 +1922,9 @@ int zEulerSweep(int j, int NumberOfSubgrids, fluxes *SubgridFluxes[], float SphereAng2[MAX_SPHERES], int SphereNumShells[MAX_SPHERES], int SphereType[MAX_SPHERES], + int SphereConstantPressure[MAX_SPHERES], + int SphereSmoothSurface[MAX_SPHERES], + float SphereSmoothRadius[MAX_SPHERES], int SphereUseParticles, float ParticleMeanDensity, float UniformVelocity[MAX_DIMENSION], diff --git a/src/enzo/Grid_CollapseTestInitializeGrid.C b/src/enzo/Grid_CollapseTestInitializeGrid.C index 4d2fdf804..9531578fc 100644 --- a/src/enzo/Grid_CollapseTestInitializeGrid.C +++ b/src/enzo/Grid_CollapseTestInitializeGrid.C @@ -78,6 +78,9 @@ int grid::CollapseTestInitializeGrid(int NumberOfSpheres, float SphereAng2[MAX_SPHERES], int SphereNumShells[MAX_SPHERES], int SphereType[MAX_SPHERES], + int SphereConstantPressure[MAX_SPHERES], + int SphereSmoothSurface[MAX_SPHERES], + float SphereSmoothRadius[MAX_SPHERES], int SphereUseParticles, float ParticleMeanDensity, float UniformVelocity[MAX_DIMENSION], @@ -275,7 +278,8 @@ int grid::CollapseTestInitializeGrid(int NumberOfSpheres, float density, dens1, old_density, Velocity[MAX_DIMENSION], DiskVelocity[MAX_DIMENSION], temperature, temp1, sigma, sigma1, - colour, weight, a, DMVelocity[MAX_DIMENSION], metallicity; + colour, weight, a, DMVelocity[MAX_DIMENSION], metallicity, + outer_radius; FLOAT r, rcyl, x, y = 0, z = 0; int n = 0, ibin; @@ -477,7 +481,9 @@ int grid::CollapseTestInitializeGrid(int NumberOfSpheres, /* Compute Cartesian coordinates for rotational properties */ - if (r < SphereRadius[sphere]) { + outer_radius = (SphereSmoothSurface[sphere] == TRUE) ? + SphereSmoothRadius[sphere]*SphereRadius[sphere] : SphereRadius[sphere]; + if (r < outer_radius) { /* Compute spherical coordinate theta */ @@ -755,10 +761,15 @@ int grid::CollapseTestInitializeGrid(int NumberOfSpheres, // temp1 = InitialTemperature; if (SphereType[sphere] != 7 && SphereType[sphere] != 9) - if (temp1 == InitialTemperature) - temperature = SphereTemperature[sphere]; - else + if (temp1 == InitialTemperature) { + if (SphereConstantPressure[sphere] == TRUE) { + temperature = SphereTemperature[sphere] * (SphereDensity[sphere] / dens1); + } else { + temperature = SphereTemperature[sphere]; + } + } else { temperature = temp1; + } sigma = sigma1; if (SphereType[sphere] != 10) @@ -828,6 +839,18 @@ int grid::CollapseTestInitializeGrid(int NumberOfSpheres, } + if (SphereSmoothSurface[sphere] == TRUE && + r < SphereSmoothRadius[sphere]*SphereRadius[sphere] && + r > SphereRadius[sphere]) { + float ramp = 1.0 - 1.0 * tanh((3.0/(SphereSmoothRadius[sphere]-1.0))* + (r/SphereRadius[sphere] - 1.0)); + ramp = max(ramp, 1.0/density); + density *= ramp; + if (SphereConstantPressure[sphere] == TRUE) { + temperature /= ramp; + } + } // end: if (SmoothSurface) + } // end: loop over spheres /* Set density. */ diff --git a/src/enzo/Grid_PhotonTestInitializeGrid.C b/src/enzo/Grid_PhotonTestInitializeGrid.C index 03d502238..2be6de981 100644 --- a/src/enzo/Grid_PhotonTestInitializeGrid.C +++ b/src/enzo/Grid_PhotonTestInitializeGrid.C @@ -60,6 +60,9 @@ int grid::PhotonTestInitializeGrid(int NumberOfSpheres, float SphereAng2[MAX_SPHERES], int SphereNumShells[MAX_SPHERES], int SphereType[MAX_SPHERES], + int SphereConstantPressure[MAX_SPHERES], + int SphereSmoothSurface[MAX_SPHERES], + float SphereSmoothRadius[MAX_SPHERES], float SphereHII[MAX_SPHERES], float SphereHeII[MAX_SPHERES], float SphereHeIII[MAX_SPHERES], @@ -298,7 +301,7 @@ int grid::PhotonTestInitializeGrid(int NumberOfSpheres, /* Loop over the mesh. */ float density, dens1, Velocity[MAX_DIMENSION], - temperature, temp1, sigma, sigma1, colour; + temperature, temp1, sigma, sigma1, colour, outer_radius; float HII_Fraction, HeII_Fraction, HeIII_Fraction, H2I_Fraction; FLOAT r, x, y = 0, z = 0; int n = 0; @@ -415,7 +418,9 @@ int grid::PhotonTestInitializeGrid(int NumberOfSpheres, pow(fabs(z-SpherePosition[sphere][2]), 2) ); r = max(r, 0.1*CellWidth[0][0]); - if (r < SphereRadius[sphere]) { + outer_radius = (SphereSmoothSurface[sphere] == TRUE) ? + SphereSmoothRadius[sphere]*SphereRadius[sphere] : SphereRadius[sphere]; + if (r < outer_radius) { /* Compute Cartesian coordinates for rotational properties */ @@ -648,9 +653,16 @@ int grid::PhotonTestInitializeGrid(int NumberOfSpheres, if (dens1 > density) { density = dens1; - if (temp1 == InitialTemperature) - temp1 = SphereTemperature[sphere]; - temperature = temp1; + if (SphereType[sphere] != 7 && SphereType[sphere] != 9) + if (temp1 == InitialTemperature) { + if (SphereConstantPressure[sphere] == TRUE) { + temperature = SphereTemperature[sphere] * (SphereDensity[sphere] / dens1); + } else { + temperature = SphereTemperature[sphere]; + } + } else { + temperature = temp1; + } sigma = sigma1; if (SphereType[sphere] != 6 && SphereType[sphere] != 10 && @@ -666,6 +678,19 @@ int grid::PhotonTestInitializeGrid(int NumberOfSpheres, } } // end: if (r < SphereRadius) + + if (SphereSmoothSurface[sphere] == TRUE && + r < SphereSmoothRadius[sphere]*SphereRadius[sphere] && + r > SphereRadius[sphere]) { + float ramp = 1.0 - 1.0 * tanh((3.0/(SphereSmoothRadius[sphere]-1.0))* + (r/SphereRadius[sphere] - 1.0)); + ramp = max(ramp, 1.0/density); + density *= ramp; + if (SphereConstantPressure[sphere] == TRUE) { + temperature /= ramp; + } + } // end: if (SmoothSurface) + } // end: loop over spheres /* Set density. */ diff --git a/src/enzo/PhotonGrid_Methods.h b/src/enzo/PhotonGrid_Methods.h index 38f4cd09c..73d8561de 100644 --- a/src/enzo/PhotonGrid_Methods.h +++ b/src/enzo/PhotonGrid_Methods.h @@ -412,6 +412,9 @@ int PhotonTestInitializeGrid(int NumberOfSpheres, float SphereAng2[MAX_SPHERES], int SphereNumShells[MAX_SPHERES], int SphereType[MAX_SPHERES], + int SphereConstantPressure[MAX_SPHERES], + int SphereSmoothSurface[MAX_SPHERES], + float SphereSmoothRadius[MAX_SPHERES], float SphereHII[MAX_SPHERES], float SphereHeII[MAX_SPHERES], float SphereHeIII[MAX_SPHERES], diff --git a/src/enzo/PhotonTestInitialize.C b/src/enzo/PhotonTestInitialize.C index 0f40e5cae..4075d2664 100644 --- a/src/enzo/PhotonTestInitialize.C +++ b/src/enzo/PhotonTestInitialize.C @@ -94,7 +94,9 @@ int PhotonTestInitialize(FILE *fptr, FILE *Outfptr, int PhotonTestUseParticles = FALSE; int PhotonTestUseColour = FALSE; float PhotonTestInitialTemperature = 1000; - int PhotonTestSphereType[MAX_SPHERES]; + int PhotonTestSphereType[MAX_SPHERES], + PhotonTestSphereConstantPressure[MAX_SPHERES], + PhotonTestSphereSmoothSurface[MAX_SPHERES]; float PhotonTestSphereDensity[MAX_SPHERES], PhotonTestSphereTemperature[MAX_SPHERES], PhotonTestSphereVelocity[MAX_SPHERES][MAX_DIMENSION], @@ -104,6 +106,7 @@ int PhotonTestInitialize(FILE *fptr, FILE *Outfptr, PhotonTestSphereCutOff[MAX_SPHERES], PhotonTestSphereAng1[MAX_SPHERES], PhotonTestSphereAng2[MAX_SPHERES], + PhotonTestSphereSmoothRadius[MAX_SPHERES], PhotonTestSphereRadius[MAX_SPHERES], PhotonTestSphereCoreRadius[MAX_SPHERES], PhotonTestSphereHIIFraction[MAX_SPHERES], @@ -137,6 +140,7 @@ int PhotonTestInitialize(FILE *fptr, FILE *Outfptr, PhotonTestSphereAng1[sphere] = 0; PhotonTestSphereAng2[sphere] = 0; PhotonTestSphereNumShells[sphere] = 1; + PhotonTestSphereSmoothRadius[sphere] = 1.2; PhotonTestSphereHIIFraction[sphere] = PhotonTestInitialFractionHII; PhotonTestSphereHeIIFraction[sphere] = PhotonTestInitialFractionHeII; PhotonTestSphereHeIIIFraction[sphere] = PhotonTestInitialFractionHeIII; @@ -148,6 +152,8 @@ int PhotonTestInitialize(FILE *fptr, FILE *Outfptr, PhotonTestSphereVelocity[sphere][dim] = 0; } PhotonTestSphereType[sphere] = 0; + PhotonTestSphereConstantPressure[sphere] = FALSE; + PhotonTestSphereSmoothSurface[sphere] = FALSE; } for (dim = 0; dim < MAX_DIMENSION; dim++) PhotonTestUniformVelocity[dim] = 0; @@ -178,6 +184,15 @@ int PhotonTestInitialize(FILE *fptr, FILE *Outfptr, if (sscanf(line, "PhotonTestSphereType[%"ISYM"]", &sphere) > 0) ret += sscanf(line, "PhotonTestSphereType[%"ISYM"] = %"ISYM, &sphere, &PhotonTestSphereType[sphere]); + if (sscanf(line, "PhotonTestSphereConstantPressure[%"ISYM"]", &sphere) > 0) + ret += sscanf(line, "PhotonTestSphereConstantPressure[%"ISYM"] = %"ISYM, &sphere, + &PhotonTestSphereConstantPressure[sphere]); + if (sscanf(line, "PhotonTestSphereSmoothSurface[%"ISYM"]", &sphere) > 0) + ret += sscanf(line, "PhotonTestSphereSmoothSurface[%"ISYM"] = %"ISYM, &sphere, + &PhotonTestSphereSmoothSurface[sphere]); + if (sscanf(line, "PhotonTestSphereSmoothRadius[%"ISYM"]", &sphere) > 0) + ret += sscanf(line, "PhotonTestSphereSmoothRadius[%"FSYM"] = %"FSYM, &sphere, + &PhotonTestSphereSmoothRadius[sphere]); if (sscanf(line, "PhotonTestSphereRadius[%"ISYM"]", &sphere) > 0) ret += sscanf(line, "PhotonTestSphereRadius[%"ISYM"] = %"FSYM, &sphere, &PhotonTestSphereRadius[sphere]); @@ -291,7 +306,8 @@ int PhotonTestInitialize(FILE *fptr, FILE *Outfptr, PhotonTestFracKeplerianRot, PhotonTestSphereTurbulence, PhotonTestSphereCutOff, PhotonTestSphereAng1, PhotonTestSphereAng2, PhotonTestSphereNumShells, - PhotonTestSphereType, + PhotonTestSphereType, PhotonTestSphereConstantPressure, + PhotonTestSphereSmoothSurface, PhotonTestSphereSmoothRadius, PhotonTestSphereHIIFraction, PhotonTestSphereHeIIFraction, PhotonTestSphereHeIIIFraction, PhotonTestSphereH2IFraction, PhotonTestUseParticles, @@ -358,7 +374,8 @@ int PhotonTestInitialize(FILE *fptr, FILE *Outfptr, PhotonTestFracKeplerianRot, PhotonTestSphereTurbulence, PhotonTestSphereCutOff, PhotonTestSphereAng1, PhotonTestSphereAng2, PhotonTestSphereNumShells, - PhotonTestSphereType, + PhotonTestSphereType, PhotonTestSphereConstantPressure, + PhotonTestSphereSmoothSurface, PhotonTestSphereSmoothRadius, PhotonTestSphereHIIFraction, PhotonTestSphereHeIIFraction, PhotonTestSphereHeIIIFraction, PhotonTestSphereH2IFraction, PhotonTestUseParticles, @@ -411,7 +428,8 @@ int PhotonTestInitialize(FILE *fptr, FILE *Outfptr, PhotonTestFracKeplerianRot, PhotonTestSphereTurbulence, PhotonTestSphereCutOff, PhotonTestSphereAng1, PhotonTestSphereAng2, PhotonTestSphereNumShells, - PhotonTestSphereType, + PhotonTestSphereType, PhotonTestSphereConstantPressure, + PhotonTestSphereSmoothSurface, PhotonTestSphereSmoothRadius, PhotonTestSphereHIIFraction, PhotonTestSphereHeIIFraction, PhotonTestSphereHeIIIFraction, PhotonTestSphereH2IFraction, PhotonTestUseParticles, @@ -521,6 +539,10 @@ int PhotonTestInitialize(FILE *fptr, FILE *Outfptr, for (sphere = 0; sphere < PhotonTestNumberOfSpheres; sphere++) { fprintf(Outfptr, "PhotonTestSphereType[%"ISYM"] = %"ISYM"\n", sphere, PhotonTestSphereType[sphere]); + fprintf(Outfptr, "PhotonTestSphereConstantPressure[%"ISYM"] = %"ISYM"\n", sphere, + PhotonTestSphereConstantPressure[sphere]); + fprintf(Outfptr, "PhotonTestSphereSmoothSurface[%"ISYM"] = %"ISYM"\n", sphere, + PhotonTestSphereSmoothSurface[sphere]); fprintf(Outfptr, "PhotonTestSphereRadius[%"ISYM"] = %"GOUTSYM"\n", sphere, PhotonTestSphereRadius[sphere]); fprintf(Outfptr, "PhotonTestSphereCoreRadius[%"ISYM"] = %"GOUTSYM"\n", sphere, @@ -529,6 +551,8 @@ int PhotonTestInitialize(FILE *fptr, FILE *Outfptr, PhotonTestSphereDensity[sphere]); fprintf(Outfptr, "PhotonTestSphereTemperature[%"ISYM"] = %"FSYM"\n", sphere, PhotonTestSphereTemperature[sphere]); + fprintf(Outfptr, "PhotonTestSphereConstantPressure[%"ISYM"] = %"ISYM"\n", sphere, + PhotonTestSphereConstantPressure[sphere]); fprintf(Outfptr, "PhotonTestSpherePosition[%"ISYM"] = ", sphere); WriteListOfFloats(Outfptr, MetaData.TopGridRank, PhotonTestSpherePosition[sphere]); From 1c3496b73d3c49cc23df530171b7e2132aad0cc3 Mon Sep 17 00:00:00 2001 From: John Wise Date: Tue, 12 Mar 2013 12:45:24 -0400 Subject: [PATCH 12/25] Adding new parameters to the docs and fixing some duplicated/missing printfs of the parameters. --HG-- branch : week-of-code --- doc/manual/source/parameters/problemtypes.rst | 9 +++++++++ src/enzo/CollapseTestInitialize.C | 4 ++-- src/enzo/PhotonTestInitialize.C | 4 ++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/doc/manual/source/parameters/problemtypes.rst b/doc/manual/source/parameters/problemtypes.rst index b29ee6cd9..37c852d08 100644 --- a/doc/manual/source/parameters/problemtypes.rst +++ b/doc/manual/source/parameters/problemtypes.rst @@ -684,6 +684,15 @@ Collapse Test (27) ``CollapseTestSphereAng2`` are set, the rotational axis linearly changes with radius between ``CollapseTestSphereAng1`` and ``CollapseTestSphereAng2``. Units in radians. Default: 0. +``CollapseTestSphereConstantPressure`` (external) + Constant pressure inside the sphere that is equal to the pressure + at the outer radius. Default: 0 +``CollapseTestSphereSmoothSurface`` (external) + The density interface between the ambient and sphere medium is + smoothed with a hyperbolic tangent. Default: 0 +``CollapseTestSmoothRadius`` (external) + The outer radius of the smoothed interface. This parameter is in + units of the sphere radius. Default: 1.2 ``CollapseTestSphereInitialLevel`` (external) Failed experiment to try to force refinement to a specified level. Not working. Default: 0. diff --git a/src/enzo/CollapseTestInitialize.C b/src/enzo/CollapseTestInitialize.C index 30f876ff1..019238e4d 100644 --- a/src/enzo/CollapseTestInitialize.C +++ b/src/enzo/CollapseTestInitialize.C @@ -502,8 +502,8 @@ int CollapseTestInitialize(FILE *fptr, FILE *Outfptr, CollapseTestSphereConstantPressure[sphere]); fprintf(Outfptr, "CollapseTestSphereSmoothSurface[%"ISYM"] = %"ISYM"\n", sphere, CollapseTestSphereSmoothSurface[sphere]); - fprintf(Outfptr, "CollapseTestSphereConstantPressure[%"ISYM"] = %"ISYM"\n", sphere, - CollapseTestSphereConstantPressure[sphere]); + fprintf(Outfptr, "CollapseTestSphereSmoothRadius[%"ISYM"] = %"GOUTSYM"\n", sphere, + CollapseTestSphereSmoothRadius[sphere]); } } diff --git a/src/enzo/PhotonTestInitialize.C b/src/enzo/PhotonTestInitialize.C index 4075d2664..ed316e139 100644 --- a/src/enzo/PhotonTestInitialize.C +++ b/src/enzo/PhotonTestInitialize.C @@ -543,6 +543,8 @@ int PhotonTestInitialize(FILE *fptr, FILE *Outfptr, PhotonTestSphereConstantPressure[sphere]); fprintf(Outfptr, "PhotonTestSphereSmoothSurface[%"ISYM"] = %"ISYM"\n", sphere, PhotonTestSphereSmoothSurface[sphere]); + fprintf(Outfptr, "PhotonTestSphereSmoothRadius[%"ISYM"] = %"GOUTSYM"\n", sphere, + PhotonTestSphereSmoothRadius[sphere]); fprintf(Outfptr, "PhotonTestSphereRadius[%"ISYM"] = %"GOUTSYM"\n", sphere, PhotonTestSphereRadius[sphere]); fprintf(Outfptr, "PhotonTestSphereCoreRadius[%"ISYM"] = %"GOUTSYM"\n", sphere, @@ -551,8 +553,6 @@ int PhotonTestInitialize(FILE *fptr, FILE *Outfptr, PhotonTestSphereDensity[sphere]); fprintf(Outfptr, "PhotonTestSphereTemperature[%"ISYM"] = %"FSYM"\n", sphere, PhotonTestSphereTemperature[sphere]); - fprintf(Outfptr, "PhotonTestSphereConstantPressure[%"ISYM"] = %"ISYM"\n", sphere, - PhotonTestSphereConstantPressure[sphere]); fprintf(Outfptr, "PhotonTestSpherePosition[%"ISYM"] = ", sphere); WriteListOfFloats(Outfptr, MetaData.TopGridRank, PhotonTestSpherePosition[sphere]); From 904f9c9896456fc68bb69573f7d54225b5f39e6b Mon Sep 17 00:00:00 2001 From: Cameron Hummels Date: Tue, 12 Mar 2013 11:34:32 -0700 Subject: [PATCH 13/25] Changing hard fails to warnings for when ParallelRootGridIO and ParallelParticleIO are not set and > 64 cpus used. This is not as much of a problem as it used to be in older hardware when read-in times took a very long period. --HG-- branch : week-of-code --- src/enzo/Grid_CosmologySimulationInitializeGrid.C | 2 +- src/enzo/Grid_NestedCosmologySimulationInitializeGrid.C | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/enzo/Grid_CosmologySimulationInitializeGrid.C b/src/enzo/Grid_CosmologySimulationInitializeGrid.C index c31f18b1f..389a9a609 100644 --- a/src/enzo/Grid_CosmologySimulationInitializeGrid.C +++ b/src/enzo/Grid_CosmologySimulationInitializeGrid.C @@ -178,7 +178,7 @@ int grid::CosmologySimulationInitializeGrid( if ( (ParallelRootGridIO != TRUE) || (ParallelParticleIO != TRUE && !CosmologySimulationCalculatePositions) ) { - ENZO_FAIL("ParallelRootGridIO and ParallelParticleIO MUST be set for > 64 cpus!"); + fprintf(stderr, "WARNING: ParallelRootGridIO and ParallelParticleIO are recommended for > 64 cpus to shrink data read-in time."); } } diff --git a/src/enzo/Grid_NestedCosmologySimulationInitializeGrid.C b/src/enzo/Grid_NestedCosmologySimulationInitializeGrid.C index 888a83920..d75c27d35 100644 --- a/src/enzo/Grid_NestedCosmologySimulationInitializeGrid.C +++ b/src/enzo/Grid_NestedCosmologySimulationInitializeGrid.C @@ -181,7 +181,7 @@ int grid::NestedCosmologySimulationInitializeGrid( { if ( (ParallelRootGridIO != TRUE) && (ParallelParticleIO != TRUE) ) { - // ENZO_FAIL("ParallelRootGridIO (and possibly ParallelParticleIO) should be set for > 64 cpus!\n"); + fprintf(stderr, "WARNING: ParallelRootGridIO and ParallelParticleIO are recommended for > 64 cpus to shrink data read-in time."); } } From e81feb15b445bd34b7dca56126e8254d2d0e4b8f Mon Sep 17 00:00:00 2001 From: Matthew Turk Date: Wed, 13 Mar 2013 14:48:05 -0400 Subject: [PATCH 14/25] Switching a few routines to use preincludes.h and fixing new-problem-types-yes. --HG-- branch : week-of-code --- src/enzo/ClusterInitialize.C | 4 +--- src/enzo/Grid_ClusterInitializeGrid.C | 4 +--- src/enzo/HydroShockTubesInitialize.C | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/enzo/ClusterInitialize.C b/src/enzo/ClusterInitialize.C index 9a37b4c3d..07608654c 100644 --- a/src/enzo/ClusterInitialize.C +++ b/src/enzo/ClusterInitialize.C @@ -15,9 +15,7 @@ // This routine intializes a new simulation based on the parameter file. // -#include -#include -#include +#include "preincludes.h" #include "macros_and_parameters.h" #include "typedefs.h" #include "global_data.h" diff --git a/src/enzo/Grid_ClusterInitializeGrid.C b/src/enzo/Grid_ClusterInitializeGrid.C index 7dc8d0999..a93870761 100644 --- a/src/enzo/Grid_ClusterInitializeGrid.C +++ b/src/enzo/Grid_ClusterInitializeGrid.C @@ -12,9 +12,7 @@ / ************************************************************************/ -#include -#include -#include +#include "preincludes.h" #include "macros_and_parameters.h" #include "typedefs.h" #include "global_data.h" diff --git a/src/enzo/HydroShockTubesInitialize.C b/src/enzo/HydroShockTubesInitialize.C index dbc794ae2..029cb1c63 100644 --- a/src/enzo/HydroShockTubesInitialize.C +++ b/src/enzo/HydroShockTubesInitialize.C @@ -1,6 +1,4 @@ -#include -#include -#include +#include "preincludes.h" #include "macros_and_parameters.h" #include "typedefs.h" #include "global_data.h" From 8a968bbb706f01d08cdd216988fb9c27ddf30e0e Mon Sep 17 00:00:00 2001 From: pgrete Date: Thu, 14 Mar 2013 13:41:11 +0100 Subject: [PATCH 15/25] Add OutputOnDensity support for RK based solvers --HG-- branch : week-of-code --- src/enzo/hydro_rk/EvolveLevel_RK2.C | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/enzo/hydro_rk/EvolveLevel_RK2.C b/src/enzo/hydro_rk/EvolveLevel_RK2.C index b6d76b98c..0f5a7a628 100644 --- a/src/enzo/hydro_rk/EvolveLevel_RK2.C +++ b/src/enzo/hydro_rk/EvolveLevel_RK2.C @@ -484,7 +484,15 @@ int EvolveLevel_RK2(TopGridData *MetaData, LevelHierarchyEntry *LevelArray[], } // ENDIF UseHydro + /* If we're supposed to be outputting on Density, we need to update + the current maximum value of that Density. */ + if(OutputOnDensity == 1){ + int DensNum = FindField(Density, FieldType, NumberOfBaryonFields); + for(i = 0; i < size; i++) + CurrentMaximumDensity = max(BaryonField[DensNum][i], CurrentMaximumDensity); + } + /* Solve the cooling and species rate equations. */ Grids[grid1]->GridData->MultiSpeciesHandler(); From b73dee8b0b2ba82bff7619847380c1f63de9a555 Mon Sep 17 00:00:00 2001 From: "David Collins (dcollins4096@gmail.com)" Date: Thu, 14 Mar 2013 10:27:12 -0600 Subject: [PATCH 16/25] SetAccelerationBoundary in RK2: Making DeleteParticleAcceleration always happen, DeleteAccelerationField not when SAB is on. --HG-- branch : week-of-code --- src/enzo/hydro_rk/EvolveLevel_RK2.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/enzo/hydro_rk/EvolveLevel_RK2.C b/src/enzo/hydro_rk/EvolveLevel_RK2.C index 6337c0853..52e76375d 100644 --- a/src/enzo/hydro_rk/EvolveLevel_RK2.C +++ b/src/enzo/hydro_rk/EvolveLevel_RK2.C @@ -513,8 +513,8 @@ int EvolveLevel_RK2(TopGridData *MetaData, LevelHierarchyEntry *LevelArray[], MaximumGravityRefinementLevel == MaximumRefinementLevel)) Grids[grid1]->GridData->DeleteAccelerationField(); - Grids[grid1]->GridData->DeleteParticleAcceleration(); #endif //!SAB + Grids[grid1]->GridData->DeleteParticleAcceleration(); if (UseFloor) Grids[grid1]->GridData->SetFloor(); From 23a39cc82e8d935a667a641529cb6e632acf7b79 Mon Sep 17 00:00:00 2001 From: Cameron Hummels Date: Thu, 14 Mar 2013 12:53:36 -0700 Subject: [PATCH 17/25] Updating Arizona's HPC make file. --HG-- branch : week-of-code --- src/enzo/Make.mach.arizona | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/enzo/Make.mach.arizona b/src/enzo/Make.mach.arizona index cd61cc3a2..92155d0bf 100644 --- a/src/enzo/Make.mach.arizona +++ b/src/enzo/Make.mach.arizona @@ -17,7 +17,6 @@ MACH_FILE = Make.mach.arizona MACHINE_NOTES = "MACHINE_NOTES for University of Arizona's HPC Cluster: \ The following modules are needed to compile enzo here with \ the default machine file. \ - hdf5/1.8.8 \ intel/2012.0.032 \ mpt/2.04 (for SGI MPI compilers) \ \ @@ -28,14 +27,17 @@ MACHINE_NOTES = "MACHINE_NOTES for University of Arizona's HPC Cluster: \ # Install paths (local variables) #----------------------------------------------------------------------- -LOCAL_HDF5_INSTALL = /uaopt/hdf5/1.8.8 +LOCAL_MPI_INSTALL = /opt/sgi/mpt/mpt-2.04 +#LOCAL_HDF5_INSTALL = /uaopt/hdf5/1.8.8 # only if using non-yt hdf5 +LOCAL_HDF5_INSTALL = $(YT_DEST) +LOCAL_PYTHON_INSTALL = $(YT_DEST) LOCAL_COMPILER_DIR = /gsfs1/uaopt/intel/2012.0.032/composer_xe_2011_sp1.6.233/compiler #----------------------------------------------------------------------- # Compiler settings #----------------------------------------------------------------------- -MACH_CPP = cpp # C preprocessor command +MACH_CPP = icpc # C preprocessor command # With MPI # Preferred compiler is the SGI library @@ -88,13 +90,12 @@ MACH_OPT_AGGRESSIVE = -O3 # Includes #----------------------------------------------------------------------- -LOCAL_INCLUDES_MPI = # MPI includes +LOCAL_INCLUDES_MPI = -I$(LOCAL_MPI_INSTALL)/include # MPI includes LOCAL_INCLUDES_HDF5 = -I$(LOCAL_HDF5_INSTALL)/include # HDF5 includes LOCAL_INCLUDES_HYPRE = # hypre includes LOCAL_INCLUDES_PAPI = # PAPI includes MACH_INCLUDES = $(LOCAL_INCLUDES_HDF5) - MACH_INCLUDES_MPI = $(LOCAL_INCLUDES_MPI) MACH_INCLUDES_HYPRE = $(LOCAL_INCLUDES_HYPRE) MACH_INCLUDES_PAPI = $(LOCAL_INCLUDES_PAPI) @@ -103,7 +104,7 @@ MACH_INCLUDES_PAPI = $(LOCAL_INCLUDES_PAPI) # Libraries #----------------------------------------------------------------------- -LOCAL_LIBS_MPI = # MPI libraries +LOCAL_LIBS_MPI = -L$(LOCAL_MPI_INSTALL)/lib -lmpi -lmpi++ # MPI libraries LOCAL_LIBS_HDF5 = -L$(LOCAL_HDF5_INSTALL)/lib -lhdf5 -lz # HDF5 libraries LOCAL_LIBS_HYPRE = # hypre libraries LOCAL_LIBS_PAPI = # PAPI libraries From 32951cdc0ed36544665509044fb60766b936d82d Mon Sep 17 00:00:00 2001 From: pgrete Date: Fri, 15 Mar 2013 13:33:58 +0100 Subject: [PATCH 18/25] fixed previous misplaced OutputOnDensity commit --HG-- branch : week-of-code --- src/enzo/hydro_rk/EvolveLevel_RK2.C | 9 --------- src/enzo/hydro_rk/Grid_MHDRK2_2ndStep.C | 9 +++++++++ src/enzo/hydro_rk/Grid_RungeKutta2_2ndStep.C | 9 +++++++++ 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/enzo/hydro_rk/EvolveLevel_RK2.C b/src/enzo/hydro_rk/EvolveLevel_RK2.C index 0f5a7a628..314883498 100644 --- a/src/enzo/hydro_rk/EvolveLevel_RK2.C +++ b/src/enzo/hydro_rk/EvolveLevel_RK2.C @@ -484,15 +484,6 @@ int EvolveLevel_RK2(TopGridData *MetaData, LevelHierarchyEntry *LevelArray[], } // ENDIF UseHydro - /* If we're supposed to be outputting on Density, we need to update - the current maximum value of that Density. */ - - if(OutputOnDensity == 1){ - int DensNum = FindField(Density, FieldType, NumberOfBaryonFields); - for(i = 0; i < size; i++) - CurrentMaximumDensity = max(BaryonField[DensNum][i], CurrentMaximumDensity); - } - /* Solve the cooling and species rate equations. */ Grids[grid1]->GridData->MultiSpeciesHandler(); diff --git a/src/enzo/hydro_rk/Grid_MHDRK2_2ndStep.C b/src/enzo/hydro_rk/Grid_MHDRK2_2ndStep.C index eaebe8370..b8126c112 100644 --- a/src/enzo/hydro_rk/Grid_MHDRK2_2ndStep.C +++ b/src/enzo/hydro_rk/Grid_MHDRK2_2ndStep.C @@ -122,6 +122,15 @@ int grid::MHDRK2_2ndStep(fluxes *SubgridFluxes[], delete [] dU[field]; } + /* If we're supposed to be outputting on Density, we need to update + the current maximum value of that Density. */ + + if(OutputOnDensity == 1){ + int DensNum = FindField(Density, FieldType, NumberOfBaryonFields); + for(int i = 0; i < size; i++) + CurrentMaximumDensity = max(BaryonField[DensNum][i], CurrentMaximumDensity); + } + return SUCCESS; } diff --git a/src/enzo/hydro_rk/Grid_RungeKutta2_2ndStep.C b/src/enzo/hydro_rk/Grid_RungeKutta2_2ndStep.C index ebb262370..204a2e2ad 100644 --- a/src/enzo/hydro_rk/Grid_RungeKutta2_2ndStep.C +++ b/src/enzo/hydro_rk/Grid_RungeKutta2_2ndStep.C @@ -163,6 +163,15 @@ int grid::RungeKutta2_2ndStep(fluxes *SubgridFluxes[], } // PerformanceTimers[1] += ReturnWallTime() - time1; + + /* If we're supposed to be outputting on Density, we need to update + the current maximum value of that Density. */ + + if(OutputOnDensity == 1){ + int DensNum = FindField(Density, FieldType, NumberOfBaryonFields); + for(int i = 0; i < size; i++) + CurrentMaximumDensity = max(BaryonField[DensNum][i], CurrentMaximumDensity); + } return SUCCESS; From 068324a254fe5afa78698cfd5013d59b451ab624 Mon Sep 17 00:00:00 2001 From: Sam Skillman Date: Mon, 18 Mar 2013 08:12:27 -0600 Subject: [PATCH 19/25] Added tag enzogold0001 for changeset a444b00827d3 --HG-- branch : week-of-code --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 63323ff40..313515843 100644 --- a/.hgtags +++ b/.hgtags @@ -2,3 +2,4 @@ bbf0a2ffbd22c4fbecf946c9c96e6c4fac5cbdae woc_pre_fld_merge 48b4e9d9d6b90f703e48e621b488136be2a0e9cf woc_fld_merge b86d8ba026d6a0ec30f15d8134add1e55fae2958 Wise10_GalaxyBirth 2d90aa38e06f00a531db45a43225cde1faf093f2 enzo-2.2 +a444b00827d3d4351dceea8197f1e446b9ada0da enzogold0001 From 57c24e535bed0b482e22a7bcacb6e730c1106541 Mon Sep 17 00:00:00 2001 From: Sam Skillman Date: Mon, 18 Mar 2013 08:32:48 -0600 Subject: [PATCH 20/25] Updating enzogold counter. --HG-- branch : week-of-code --- run/test_runner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run/test_runner.py b/run/test_runner.py index 1fdb94164..eed4a4038 100755 --- a/run/test_runner.py +++ b/run/test_runner.py @@ -47,7 +47,7 @@ # Set the filename for the latest version of the gold standard # and for the default local standard output -ytcfg["yt", "gold_standard_filename"] = str("enzogold0000") +ytcfg["yt", "gold_standard_filename"] = str("enzogold0001") ytcfg["yt", "local_standard_filename"] = str("enzolocaldev") from yt.utilities.answer_testing.framework import \ AnswerTesting From 4167fb93864288cc326c8e3b60a2a4dc327fac20 Mon Sep 17 00:00:00 2001 From: Cameron Hummels Date: Wed, 20 Mar 2013 14:59:01 -0700 Subject: [PATCH 21/25] Adding mpi.h #include in Grid_SolveHydroEquations so as to compile with mpi intel compilers. --HG-- branch : week-of-code --- src/enzo/Grid_SolveHydroEquations.C | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/enzo/Grid_SolveHydroEquations.C b/src/enzo/Grid_SolveHydroEquations.C index 4d4358eae..38f4bd8cd 100644 --- a/src/enzo/Grid_SolveHydroEquations.C +++ b/src/enzo/Grid_SolveHydroEquations.C @@ -15,6 +15,9 @@ // Solve the hydro equations with the solver, saving the subgrid fluxes // +#ifdef USE_MPI +#include "mpi.h" +#endif /* USE_MPI */ #include #include "ErrorExceptions.h" From a9fb4a2fedcf6c81a69255d00bfc249bc9cb72c3 Mon Sep 17 00:00:00 2001 From: Cameron Hummels Date: Tue, 26 Mar 2013 18:06:19 -0700 Subject: [PATCH 22/25] Fixing a bug in the performance_tools plotting functions, wherein it would fail when confronted with all zero values in one of the counters. This sometimes occurred in situations with very few cycles recorded at the beginning of a cosmological run (where there was no refinement and thus no work for multiple processors), or if the user only ran on a single processor (thus stddev of processors = 0). --HG-- branch : week-of-code --- src/performance_tools/performance_tools.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/performance_tools/performance_tools.py b/src/performance_tools/performance_tools.py index a1e6fd58f..cb1b15520 100755 --- a/src/performance_tools/performance_tools.py +++ b/src/performance_tools/performance_tools.py @@ -59,14 +59,24 @@ def preserve_extrema(extrema, xdata, ydata): if extrema[4] == 0: minx = np.min(xdata) maxx = np.max(xdata) - miny = np.min(ydata[np.nonzero(ydata)]) - maxy = np.max(ydata[np.nonzero(ydata)]) + nonzero = ydata[np.nonzero(ydata)] + if len(nonzero) == 0: + miny = 1e-1 ### Reasonable defaults given that no data to plot + maxy = 1 + else: + miny = np.min(nonzero) + maxy = np.max(nonzero) ### Otherwise, preserve the existing extrema else: minx = np.min([extrema[0], np.min(xdata)]) maxx = np.max([extrema[1], np.max(xdata)]) - miny = np.min([extrema[2], np.min(ydata[np.nonzero(ydata)])]) - maxy = np.max([extrema[3], np.max(ydata[np.nonzero(ydata)])]) + nonzero = ydata[np.nonzero(ydata)] + if len(nonzero) == 0: + miny = extrema[2] + maxy = extrema[3] + else: + miny = np.min([extrema[2], np.min(nonzero)]) + maxy = np.max([extrema[3], np.max(nonzero)]) return [minx,maxx,miny,maxy,1] def smooth(x, window_len=11, window='hanning'): From bccd0786350d282aca0c6f9f8f429d4c7e5c4245 Mon Sep 17 00:00:00 2001 From: Cameron Hummels Date: Tue, 26 Mar 2013 18:15:51 -0700 Subject: [PATCH 23/25] No-op merge to fix spuriously added commit. --HG-- branch : week-of-code --- src/enzo/Grid_SolveHydroEquations.C | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/enzo/Grid_SolveHydroEquations.C b/src/enzo/Grid_SolveHydroEquations.C index 38f4bd8cd..4d4358eae 100644 --- a/src/enzo/Grid_SolveHydroEquations.C +++ b/src/enzo/Grid_SolveHydroEquations.C @@ -15,9 +15,6 @@ // Solve the hydro equations with the solver, saving the subgrid fluxes // -#ifdef USE_MPI -#include "mpi.h" -#endif /* USE_MPI */ #include #include "ErrorExceptions.h" From 91c42a8031763ce9217120004749e84b96052068 Mon Sep 17 00:00:00 2001 From: Cameron Hummels Date: Tue, 9 Apr 2013 18:18:55 -0700 Subject: [PATCH 24/25] Modifying the U.Arizona Makefile to account for SGI-specific mpi libraries. --HG-- branch : week-of-code --- src/enzo/Make.mach.arizona | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/enzo/Make.mach.arizona b/src/enzo/Make.mach.arizona index 92155d0bf..cfc2cdb4e 100644 --- a/src/enzo/Make.mach.arizona +++ b/src/enzo/Make.mach.arizona @@ -1,8 +1,8 @@ #======================================================================= # -# FILE: Make.mach.UofA +# FILE: Make.mach.arizona # -# DESCRIPTION: Makefile settings for University of Arizona HPC Cluster +# DESCRIPTION: Makefile settings for University of Arizona SMP Cluster # # AUTHOR: Cameron Hummels (chummels@email.arizona.edu) # @@ -10,28 +10,26 @@ # #======================================================================= -MACH_TEXT = University of Arizona's HPC Clusters +MACH_TEXT = University of Arizona SMP Cluster MACH_VALID = 1 MACH_FILE = Make.mach.arizona -MACHINE_NOTES = "MACHINE_NOTES for University of Arizona's HPC Cluster: \ +MACHINE_NOTES = " MACHINE_NOTES for University of Arizona HPC Cluster: \ The following modules are needed to compile enzo here with \ the default machine file. \ - intel/2012.0.032 \ - mpt/2.04 (for SGI MPI compilers) \ \ You can run this command, \ - $ module load hdf5 mpt intel" + $ module load intel mpt hdf5" #----------------------------------------------------------------------- # Install paths (local variables) #----------------------------------------------------------------------- -LOCAL_MPI_INSTALL = /opt/sgi/mpt/mpt-2.04 -#LOCAL_HDF5_INSTALL = /uaopt/hdf5/1.8.8 # only if using non-yt hdf5 -LOCAL_HDF5_INSTALL = $(YT_DEST) -LOCAL_PYTHON_INSTALL = $(YT_DEST) -LOCAL_COMPILER_DIR = /gsfs1/uaopt/intel/2012.0.032/composer_xe_2011_sp1.6.233/compiler +LOCAL_MPI_INSTALL = +LOCAL_HDF5_INSTALL = /uaopt/hdf5/1.8.8/ +#LOCAL_HDF5_INSTALL = $(YT_DEST) +#LOCAL_PYTHON_INSTALL = $(YT_DEST) +LOCAL_COMPILER_DIR = #----------------------------------------------------------------------- # Compiler settings @@ -72,7 +70,7 @@ MACH_DEFINES = -DLINUX -DH5_USE_16_API MACH_CPPFLAGS = -P -traditional MACH_CFLAGS = -MACH_CXXFLAGS = +MACH_CXXFLAGS = -DMPICH_IGNORE_CXX_SEEK MACH_FFLAGS = MACH_F90FLAGS = MACH_LDFLAGS = @@ -104,12 +102,13 @@ MACH_INCLUDES_PAPI = $(LOCAL_INCLUDES_PAPI) # Libraries #----------------------------------------------------------------------- -LOCAL_LIBS_MPI = -L$(LOCAL_MPI_INSTALL)/lib -lmpi -lmpi++ # MPI libraries +#LOCAL_LIBS_MPI = -L$(LOCAL_MPI_INSTALL)/lib -lmpi # MPI libraries +LOCAL_LIBS_MPI = -L$(LOCAL_MPI_INSTALL)/lib -lmpi++ # MPI libraries LOCAL_LIBS_HDF5 = -L$(LOCAL_HDF5_INSTALL)/lib -lhdf5 -lz # HDF5 libraries LOCAL_LIBS_HYPRE = # hypre libraries LOCAL_LIBS_PAPI = # PAPI libraries -LOCAL_LIBS_MACH = -L $(LOCAL_COMPILER_DIR)/lib/intel64 -lifcore -lifport -lsvml # Machine-dependent libraries +LOCAL_LIBS_MACH = -L $(LOCAL_COMPILER_DIR) -limf -lifcore -lifport -lsvml -lgfortran # Machine-dependent libraries MACH_LIBS = $(LOCAL_LIBS_HDF5) $(LOCAL_LIBS_MACH) MACH_LIBS_MPI = $(LOCAL_LIBS_MPI) From d8321fc5d88ac84e710c50f9284be9cb9bd7aa17 Mon Sep 17 00:00:00 2001 From: Cameron Hummels Date: Tue, 9 Apr 2013 18:19:40 -0700 Subject: [PATCH 25/25] Adding performance timer to CommunicationTranspose for tracking communication between nodes. --HG-- branch : week-of-code --- src/enzo/CommunicationTranspose.C | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/enzo/CommunicationTranspose.C b/src/enzo/CommunicationTranspose.C index faed0fdcc..82e121d4a 100644 --- a/src/enzo/CommunicationTranspose.C +++ b/src/enzo/CommunicationTranspose.C @@ -14,6 +14,7 @@ #include "mpi.h" #endif /* USE_MPI */ +#include "EnzoTiming.h" #include #include "ErrorExceptions.h" #include "macros_and_parameters.h" @@ -73,6 +74,7 @@ int CommunicationTranspose(region *FromRegion, int NumberOfFromRegions, region *ToRegion, int NumberOfToRegions, int TransposeOrder) { + TIMER_START("CommunicationTranspose"); int retval; switch (UnigridTranspose) { case 0: @@ -93,6 +95,7 @@ int CommunicationTranspose(region *FromRegion, int NumberOfFromRegions, default: ENZO_VFAIL("Invalid value for UnigridTranspose = %d", UnigridTranspose); } // ENDSWITCH + TIMER_STOP("CommunicationTranspose"); return retval; }