commit/enzo-dev: 2 new changesets

0 views
Skip to first unread message

commits...@bitbucket.org

unread,
Oct 16, 2018, 12:54:11 PM10/16/18
to enzo...@googlegroups.com
2 new commits in enzo-dev:

https://bitbucket.org/enzo/enzo-dev/commits/5b4ee21ea10b/
Changeset: 5b4ee21ea10b
Branch: week-of-code
User: brittonsmith
Date: 2018-07-19 21:09:28+00:00
Summary: Adjust Grackle UVB off/drop parameters if higher than FinalRedshift.
Affected #: 1 file

diff -r 149dd1d6513b -r 5b4ee21ea10b src/enzo/ReadParameterFile.C
--- a/src/enzo/ReadParameterFile.C
+++ b/src/enzo/ReadParameterFile.C
@@ -1645,6 +1645,14 @@
if (initialize_chemistry_data(&grackle_units) == FAIL) {
ENZO_FAIL("Error in Grackle initialize_chemistry_data.\n");
}
+
+ // Need to set these after initialize_chemistry_data since
+ // that function sets them automatically based on the tables.
+ if (FinalRedshift < grackle_data->UVbackground_redshift_off) {
+ grackle_data->UVbackground_redshift_off = FinalRedshift;
+ grackle_data->UVbackground_redshift_drop = FinalRedshift;
+ }
+
} // if (grackle_data->use_grackle == TRUE)

else {


https://bitbucket.org/enzo/enzo-dev/commits/51cf125453f3/
Changeset: 51cf125453f3
Branch: week-of-code
User: gbryan
Date: 2018-10-16 16:53:59+00:00
Summary: Merged in brittonsmith/enzo-dev (pull request #423)

Adjust Grackle UVB off/drop parameters if higher than FinalRedshift.

Approved-by: Greg Bryan <gbr...@astro.columbia.edu>
Approved-by: John Regan <johnanth...@gmail.com>
Approved-by: John Wise <jw...@physics.gatech.edu>
Affected #: 1 file

diff -r cb68638cae46 -r 51cf125453f3 src/enzo/ReadParameterFile.C
--- a/src/enzo/ReadParameterFile.C
+++ b/src/enzo/ReadParameterFile.C
@@ -1645,6 +1645,14 @@
if (initialize_chemistry_data(&grackle_units) == FAIL) {
ENZO_FAIL("Error in Grackle initialize_chemistry_data.\n");
}
+
+ // Need to set these after initialize_chemistry_data since
+ // that function sets them automatically based on the tables.
+ if (FinalRedshift < grackle_data->UVbackground_redshift_off) {
+ grackle_data->UVbackground_redshift_off = FinalRedshift;
+ grackle_data->UVbackground_redshift_drop = FinalRedshift;
+ }
+
} // if (grackle_data->use_grackle == TRUE)

else {

Repository URL: https://bitbucket.org/enzo/enzo-dev/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.

commits...@bitbucket.org

unread,
Oct 16, 2018, 2:18:07 PM10/16/18
to enzo...@googlegroups.com
2 new commits in enzo-dev:

https://bitbucket.org/enzo/enzo-dev/commits/983e780bd0ee/
Changeset: 983e780bd0ee
Branch: week-of-code
User: brittonsmith
Date: 2018-07-24 20:49:39+00:00
Summary: Adding must-refine particle option to de-refine to level of coarsest particle.
Affected #: 3 files

diff -r 149dd1d6513b -r 983e780bd0ee doc/manual/source/parameters/index.rst
--- a/doc/manual/source/parameters/index.rst
+++ b/doc/manual/source/parameters/index.rst
@@ -904,7 +904,21 @@
constrained by static grids. Instead, refinement around dark matter
particles is allowed down to the level of a particle's generation level.
Refinement beyond this level is allowed around particles within the MUSIC
- ellipsoidal making region.
+ ellipsoidal masking region. Note, dark matter particles corresponding to
+ a generation level N are guaranteed to be refined to at least level N, but
+ may also exist on levels N > 1 if in the vicinity of an N > 1 dark matter
+ particle or a tagged must-refine particle.
+ 4. Similar to setting 3, except dark matter particles corresponding to a
+ generation level N are refined only to level N and no further. If two
+ dark matter particles from different levels occupy the same cell, that
+ cell will be refined to the coarser level. Tagged must-refine particles
+ near coarse dark matter particles will be similarly de-refined. Compared
+ to option 3, this can be used to prevent unnecessary mesh refinement in
+ regions where coarser particles enter into higher resolution regions,
+ slowing down the simulation. Note, with this setting, coarse boundary
+ particles entering into a high resolution region will eventually lead
+ to total derefinement of the region of interest.
+

``MustRefineParticlesRefineToLevel`` (external)
The maximum level on which ``MustRefineParticles`` are required to

diff -r 149dd1d6513b -r 983e780bd0ee src/enzo/FindSubgrids.C
--- a/src/enzo/FindSubgrids.C
+++ b/src/enzo/FindSubgrids.C
@@ -85,7 +85,8 @@
}

/* Set the static (permanent) regions. */
- if (MustRefineParticlesCreateParticles != 3){
+ if (MustRefineParticlesCreateParticles != 3 &&
+ MustRefineParticlesCreateParticles != 4) {
if (CurrentGrid->SetFlaggingFieldStaticRegions(level, NumberOfFlaggedCells)
== FAIL) {
ENZO_FAIL("Error in grid->SetFlaggingFieldStaticRegions.");

diff -r 149dd1d6513b -r 983e780bd0ee src/enzo/Grid_DepositMustRefineParticles.C
--- a/src/enzo/Grid_DepositMustRefineParticles.C
+++ b/src/enzo/Grid_DepositMustRefineParticles.C
@@ -80,25 +80,49 @@
FlaggingField[i] = 0;

float UniformParticleMass = 0.0;
- if (ProblemType == 30 && MustRefineParticlesCreateParticles == 3)
+ if (ProblemType == 30 &&
+ (MustRefineParticlesCreateParticles == 3 ||
+ MustRefineParticlesCreateParticles == 4))
UniformParticleMass = OmegaDarkMatterNow / OmegaMatterNow;

/* Loop over all particles, marking wich ones are must refine
To add rules, modify number of rules here and add to loop below */
- bool *rules;
+ bool *rules, rule0;
const int NumberOfRules = 2;
rules = new bool[NumberOfRules];

+ // Rules to prevent refinement, cancelling out the above rules.
+ bool *antirules;
+ int *AntiFlaggingField;
+ int NumberOfAntiRules = 0;
+ antirules = new bool[NumberOfAntiRules];
+
+ // Add an antirule to unflag over-refined dark matter particles.
+ if (MustRefineParticlesCreateParticles == 4) {
+ NumberOfAntiRules++;
+ }
+
+ if (NumberOfAntiRules > 0) {
+ antirules = new bool[NumberOfAntiRules];
+ AntiFlaggingField = new int[size];
+ for (i = 0; i < size; i++)
+ AntiFlaggingField[i] = 0;
+ }
+
// Flag particles as must refine particles
- int *IsParticleMustRefine;
+ int *IsParticleMustRefine, *IsParticleNotMustRefine;
IsParticleMustRefine = new int[NumberOfParticles];
+ if (NumberOfAntiRules > 0) {
+ IsParticleNotMustRefine = new int[NumberOfParticles];
+ }
for (i = 0; i < NumberOfParticles; i ++){
IsParticleMustRefine[i] = 1;

// check particle type and uniform mass
- rules[0] = (ParticleType[i] == PARTICLE_TYPE_MUST_REFINE ||
+ rule0 = (ParticleType[i] == PARTICLE_TYPE_MUST_REFINE ||
ParticleType[i] == PARTICLE_TYPE_MBH) ||
(ParticleMass[i] < UniformParticleMass);
+ rules[0] = rule0;

// check particle mass greater than minimum mass
rules[1] = (ParticleMass[i] > MustRefineParticlesMinimumMass);
@@ -110,6 +134,17 @@
// set flag for this particle
for (int j = 0; j < NumberOfRules; j++)
IsParticleMustRefine[i] *= rules[j];
+
+ // anti-rules
+ if (NumberOfAntiRules > 0) {
+ IsParticleNotMustRefine[i] = 1;
+ // check for over-refined dark matter particles
+ antirules[0] = !rule0;
+ }
+
+ // set antiflag for this particle
+ for (int j = 0; j < NumberOfAntiRules; j++)
+ IsParticleNotMustRefine[i] *= antirules[j];
}

PFORTRAN_NAME(cic_flag)(IsParticleMustRefine,
@@ -118,6 +153,18 @@
LeftEdge, GridDimension, GridDimension+1, GridDimension+2,
&CellSize, &ParticleBufferSize);

+ if (NumberOfAntiRules > 0) {
+ PFORTRAN_NAME(cic_flag)(IsParticleNotMustRefine,
+ ParticlePosition[0], ParticlePosition[1], ParticlePosition[2],
+ &GridRank, &NumberOfParticles, AntiFlaggingField,
+ LeftEdge, GridDimension, GridDimension+1, GridDimension+2,
+ &CellSize, &ParticleBufferSize);
+
+ for (i = 0;i < size;i++) {
+ FlaggingField[i] *= !(AntiFlaggingField[i]);
+ }
+ }
+
/* Increase particle mass flagging field for definite refinement */

float MustRefineMass =
@@ -131,7 +178,9 @@
particles, and don't use the particle mass field. */

int NumberOfFlaggedCells = 0;
- if (!(ProblemType == 30 && MustRefineParticlesCreateParticles == 3 &&
+ if (!(ProblemType == 30 &&
+ (MustRefineParticlesCreateParticles == 3 ||
+ MustRefineParticlesCreateParticles == 4) &&
level == MustRefineParticlesRefineToLevel)) {
for (i = 0; i < size; i++)
if (FlaggingField[i]) {
@@ -160,6 +209,12 @@
delete [] IsParticleMustRefine;
delete [] rules;

+ if (NumberOfAntiRules > 0) {
+ delete [] AntiFlaggingField;
+ delete [] IsParticleNotMustRefine;
+ delete [] antirules;
+ }
+
return NumberOfFlaggedCells;

}


https://bitbucket.org/enzo/enzo-dev/commits/bc76c0b9ebf0/
Changeset: bc76c0b9ebf0
Branch: week-of-code
User: gbryan
Date: 2018-10-16 18:17:58+00:00
Summary: Merged in brittonsmith/enzo-dev (pull request #424)

Add new must-refine particle option

Approved-by: Greg Bryan <gbr...@astro.columbia.edu>
Approved-by: John Regan <johnanth...@gmail.com>
Approved-by: Brian O'shea <os...@msu.edu>
Affected #: 3 files

diff -r 51cf125453f3 -r bc76c0b9ebf0 doc/manual/source/parameters/index.rst
--- a/doc/manual/source/parameters/index.rst
+++ b/doc/manual/source/parameters/index.rst
@@ -904,7 +904,21 @@
constrained by static grids. Instead, refinement around dark matter
particles is allowed down to the level of a particle's generation level.
Refinement beyond this level is allowed around particles within the MUSIC
- ellipsoidal making region.
+ ellipsoidal masking region. Note, dark matter particles corresponding to
+ a generation level N are guaranteed to be refined to at least level N, but
+ may also exist on levels N > 1 if in the vicinity of an N > 1 dark matter
+ particle or a tagged must-refine particle.
+ 4. Similar to setting 3, except dark matter particles corresponding to a
+ generation level N are refined only to level N and no further. If two
+ dark matter particles from different levels occupy the same cell, that
+ cell will be refined to the coarser level. Tagged must-refine particles
+ near coarse dark matter particles will be similarly de-refined. Compared
+ to option 3, this can be used to prevent unnecessary mesh refinement in
+ regions where coarser particles enter into higher resolution regions,
+ slowing down the simulation. Note, with this setting, coarse boundary
+ particles entering into a high resolution region will eventually lead
+ to total derefinement of the region of interest.
+

``MustRefineParticlesRefineToLevel`` (external)
The maximum level on which ``MustRefineParticles`` are required to

diff -r 51cf125453f3 -r bc76c0b9ebf0 src/enzo/FindSubgrids.C
--- a/src/enzo/FindSubgrids.C
+++ b/src/enzo/FindSubgrids.C
@@ -85,7 +85,8 @@
}

/* Set the static (permanent) regions. */
- if (MustRefineParticlesCreateParticles != 3){
+ if (MustRefineParticlesCreateParticles != 3 &&
+ MustRefineParticlesCreateParticles != 4) {
if (CurrentGrid->SetFlaggingFieldStaticRegions(level, NumberOfFlaggedCells)
== FAIL) {
ENZO_FAIL("Error in grid->SetFlaggingFieldStaticRegions.");

diff -r 51cf125453f3 -r bc76c0b9ebf0 src/enzo/Grid_DepositMustRefineParticles.C
--- a/src/enzo/Grid_DepositMustRefineParticles.C
+++ b/src/enzo/Grid_DepositMustRefineParticles.C
@@ -80,25 +80,49 @@
FlaggingField[i] = 0;

float UniformParticleMass = 0.0;
- if (ProblemType == 30 && MustRefineParticlesCreateParticles == 3)
+ if (ProblemType == 30 &&
+ (MustRefineParticlesCreateParticles == 3 ||
+ MustRefineParticlesCreateParticles == 4))
UniformParticleMass = OmegaDarkMatterNow / OmegaMatterNow;

/* Loop over all particles, marking wich ones are must refine
To add rules, modify number of rules here and add to loop below */
- bool *rules;
+ bool *rules, rule0;
const int NumberOfRules = 2;
rules = new bool[NumberOfRules];

+ // Rules to prevent refinement, cancelling out the above rules.
+ bool *antirules;
+ int *AntiFlaggingField;
+ int NumberOfAntiRules = 0;
+ antirules = new bool[NumberOfAntiRules];
+
+ // Add an antirule to unflag over-refined dark matter particles.
+ if (MustRefineParticlesCreateParticles == 4) {
+ NumberOfAntiRules++;
+ }
+
+ if (NumberOfAntiRules > 0) {
+ antirules = new bool[NumberOfAntiRules];
+ AntiFlaggingField = new int[size];
+ for (i = 0; i < size; i++)
+ AntiFlaggingField[i] = 0;
+ }
+
// Flag particles as must refine particles
- int *IsParticleMustRefine;
+ int *IsParticleMustRefine, *IsParticleNotMustRefine;
IsParticleMustRefine = new int[NumberOfParticles];
+ if (NumberOfAntiRules > 0) {
+ IsParticleNotMustRefine = new int[NumberOfParticles];
+ }
for (i = 0; i < NumberOfParticles; i ++){
IsParticleMustRefine[i] = 1;

// check particle type and uniform mass
- rules[0] = (ParticleType[i] == PARTICLE_TYPE_MUST_REFINE ||
+ rule0 = (ParticleType[i] == PARTICLE_TYPE_MUST_REFINE ||
ParticleType[i] == PARTICLE_TYPE_MBH) ||
(ParticleMass[i] < UniformParticleMass);
+ rules[0] = rule0;

// check particle mass greater than minimum mass
rules[1] = (ParticleMass[i] > MustRefineParticlesMinimumMass);
@@ -110,6 +134,17 @@
// set flag for this particle
for (int j = 0; j < NumberOfRules; j++)
IsParticleMustRefine[i] *= rules[j];
+
+ // anti-rules
+ if (NumberOfAntiRules > 0) {
+ IsParticleNotMustRefine[i] = 1;
+ // check for over-refined dark matter particles
+ antirules[0] = !rule0;
+ }
+
+ // set antiflag for this particle
+ for (int j = 0; j < NumberOfAntiRules; j++)
+ IsParticleNotMustRefine[i] *= antirules[j];
}

PFORTRAN_NAME(cic_flag)(IsParticleMustRefine,
@@ -118,6 +153,18 @@
LeftEdge, GridDimension, GridDimension+1, GridDimension+2,
&CellSize, &ParticleBufferSize);

+ if (NumberOfAntiRules > 0) {
+ PFORTRAN_NAME(cic_flag)(IsParticleNotMustRefine,
+ ParticlePosition[0], ParticlePosition[1], ParticlePosition[2],
+ &GridRank, &NumberOfParticles, AntiFlaggingField,
+ LeftEdge, GridDimension, GridDimension+1, GridDimension+2,
+ &CellSize, &ParticleBufferSize);
+
+ for (i = 0;i < size;i++) {
+ FlaggingField[i] *= !(AntiFlaggingField[i]);
+ }
+ }
+
/* Increase particle mass flagging field for definite refinement */

float MustRefineMass =
@@ -131,7 +178,9 @@
particles, and don't use the particle mass field. */

int NumberOfFlaggedCells = 0;
- if (!(ProblemType == 30 && MustRefineParticlesCreateParticles == 3 &&
+ if (!(ProblemType == 30 &&
+ (MustRefineParticlesCreateParticles == 3 ||
+ MustRefineParticlesCreateParticles == 4) &&
level == MustRefineParticlesRefineToLevel)) {
for (i = 0; i < size; i++)
if (FlaggingField[i]) {
@@ -160,6 +209,12 @@
delete [] IsParticleMustRefine;
delete [] rules;

+ if (NumberOfAntiRules > 0) {
+ delete [] AntiFlaggingField;
+ delete [] IsParticleNotMustRefine;
+ delete [] antirules;
+ }
+
return NumberOfFlaggedCells;
Reply all
Reply to author
Forward
0 new messages