Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: feedback overhaul #386

Draft
wants to merge 159 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
159 commits
Select commit Hold shift + click to select a range
95f140a
shifted things around so that feedback is now executed after hydro.
mabruzzo Nov 9, 2023
c527b7e
consolidate Apply_Unresolved_SN and Apply_Wind
mabruzzo Oct 31, 2023
d779f79
Add support for running resolved SN without DE formalism. Also fixed …
mabruzzo Oct 31, 2023
1828a48
partially factored out s99-table parsing.
mabruzzo Nov 8, 2023
c2c908c
Finished factoring out s99 table-parsing.
mabruzzo Nov 8, 2023
f02486b
add some explanatory comments to feedback::Cluster_Feedback
mabruzzo Nov 9, 2023
cc8684b
removed the option to rewind feedback.
mabruzzo Nov 9, 2023
270d65d
further simplifying feedback::Cluster_Feedback
mabruzzo Nov 9, 2023
db3a306
Restructured quite a bit more of feedback::Cluster_Feedback
mabruzzo Nov 9, 2023
30a1e1b
altered feedback::Cluster_Feedback so that it no longer returns any v…
mabruzzo Nov 9, 2023
9f87227
mostly factored out new SNRateCalc class
mabruzzo Nov 10, 2023
fcef514
Mostly factored out new SWRateCalc class
mabruzzo Nov 10, 2023
4ee6023
Introduce ClusterFeedbackMethod. It's not doing much quite yet.
mabruzzo Nov 11, 2023
5d4bb29
convert feedback::Init_State and feedback::Init_Wind_state into
mabruzzo Nov 11, 2023
50daeae
removing Calc_Timestep from feedback routines.
mabruzzo Nov 11, 2023
b86e63c
finished removing the time_direction variable from feedback kernel.
mabruzzo Nov 11, 2023
a9ce37a
remove the loop variable.
mabruzzo Nov 11, 2023
04320ed
finished excising dti from feedback kernels.
mabruzzo Nov 11, 2023
6c642db
removed the prev_dens ptr from feedback
mabruzzo Nov 11, 2023
94f0941
consolidated named feedback_info indices.
mabruzzo Nov 13, 2023
517ce54
unhooked stellar-winds from feedback scheme.
mabruzzo Nov 13, 2023
7e3374f
Consolidate Adjust_Cluster_Mass_Kernel into Cluster_Feedback_Kernel
mabruzzo Nov 13, 2023
06273d0
fixed a minor bug in the accumulation of summary statistics.
mabruzzo Nov 13, 2023
eb44db2
consolidate Set_Ave_Density_Kernel with Cluster_Feedback_Kernel
mabruzzo Nov 13, 2023
f6ae5fa
factored out calculation of the number of SN per cycle.
mabruzzo Nov 13, 2023
8c8d418
add option to run with single sn
mabruzzo Nov 13, 2023
6226ed4
added the ability to enable/disable feedback or only model a single s…
mabruzzo Nov 13, 2023
223478d
a bunch of refactoring. Nothing algorithmic changed here. Unfortunate…
mabruzzo Nov 15, 2023
fbdc5ca
factor out the reduction from Cluster_Feedback_Kernel.
mabruzzo Nov 16, 2023
38db26f
removed the Cluster_Feedback_Helper function. It was effectively cons…
mabruzzo Nov 16, 2023
943e543
A bunch of restructuring. We now support no-feedback, resolved-only, …
mabruzzo Nov 16, 2023
b1d5468
factoring out and refactoring CIC stencil in feedback.
mabruzzo Nov 17, 2023
f38e8b7
intermediate commit.
mabruzzo Nov 19, 2023
f394ef0
incremental commit
mabruzzo Nov 20, 2023
05bef1b
slight tweak
mabruzzo Nov 20, 2023
74b3163
lightly refactored Apply_Energy_Momentum_Deposition.
mabruzzo Nov 20, 2023
ec3f0c4
reduced the number of arguments passed to apply_feedback.
mabruzzo Nov 20, 2023
2a4e3d6
some more changes.
mabruzzo Nov 21, 2023
a13abef
add experimental support for larger stencil.
mabruzzo Nov 21, 2023
5110840
started passing around particle velocities (they're not actually used…
mabruzzo Nov 21, 2023
dd9a6da
introduced the ParticleProps and FieldSpatialProps structs for the pu…
mabruzzo Nov 25, 2023
26149b9
refactor so that feedback_models don't need get passed any particle a…
mabruzzo Nov 27, 2023
86b47ef
consolidated some feedback-kernel args into CycleProps and deleted th…
mabruzzo Nov 28, 2023
da75c21
refactor feedback-kernels to use grid-strided for-loops.
mabruzzo Nov 28, 2023
4827ebf
some more shuffling and preparation for new tests.
mabruzzo Dec 4, 2023
a707406
laid ground-work for OverlapScheduler.
mabruzzo Dec 5, 2023
6cc8b78
start using cooperative launch
mabruzzo Dec 5, 2023
8ec701d
added for_each_possible_overlap method to each stencil.
mabruzzo Dec 5, 2023
2021272
finished integrating overlap_scheduler with feedback_details::Cluster…
mabruzzo Dec 6, 2023
47ba456
added a test of the overlap scheduler.
mabruzzo Dec 6, 2023
3d038e1
enabled the momentum-conserving feedback.
mabruzzo Dec 6, 2023
048d474
Refactored OverlapScheduler so it manages its own memory.
mabruzzo Dec 6, 2023
a69b4b9
added a test to validate that momentum of particle is properly handle…
mabruzzo Dec 6, 2023
da3dbbf
renaming stencil-related things.
mabruzzo Dec 8, 2023
b063aea
first stab at new momentum-depostion stencil.
mabruzzo Dec 8, 2023
a840930
factored stencil out of Apply_Energy_Momentum_Deposition
mabruzzo Dec 8, 2023
47637f4
refactored unresolved feedback to make it more self-consistent.
mabruzzo Dec 8, 2023
21d759d
making both stencils selectable for unresolved SNe
mabruzzo Dec 8, 2023
e2d9653
took some steps towards better boundary handling.
mabruzzo Dec 8, 2023
088c18b
added preliminary support for hacky-boundary handling.
mabruzzo Dec 10, 2023
65d7db0
remove unused Particle_Is_Alone device function
mabruzzo Dec 10, 2023
0327330
minor tweak to Sphere27::for_each_overlap_zone
mabruzzo Dec 11, 2023
58b8648
improved stencil-test-coverage.
mabruzzo Dec 11, 2023
ad75803
refactor feedback_model and feedback_stencil.
mabruzzo Dec 12, 2023
0199d20
removed default-value from feedback_sn_model (except in cases where c…
mabruzzo Dec 12, 2023
f2708cc
refactored stencil::for_each to take a single Arr3<Real> arg instead …
mabruzzo Dec 13, 2023
7436bc8
refactored stencil::for_each_enclosedCellVol to take a single Arr3<Re…
mabruzzo Dec 14, 2023
49fe401
corrected the implementation of Sphere27::for_each_vecflavor
mabruzzo Dec 14, 2023
4ada6ce
added new for_each flavors to LegacyCIC27 to make it easier to test.
mabruzzo Dec 16, 2023
98aa7a1
revised the unresolved fb prescription to overwrite momentum with avg…
mabruzzo Dec 16, 2023
09fa9f5
consolidate implementation of multiple flavors of Sphere27::for_each
mabruzzo Dec 18, 2023
f07feee
slight refactor of sliding_stencil_test.
mabruzzo Dec 18, 2023
b34be6c
made the sliding stencil test slightly more rigorous.
mabruzzo Dec 18, 2023
fb08e05
some light refactoring to simplify testing of feedback boundary-handl…
mabruzzo Dec 19, 2023
0560fd9
added new feedback-tests. Fixed a slight bug in unresolved feedback.
mabruzzo Dec 20, 2023
ffa57b8
fixed a bug related to averaging momentum.
mabruzzo Dec 20, 2023
12f0d54
Generalized the tests of injection magnitude into more cases. Refacto…
mabruzzo Dec 20, 2023
2998a38
added some basic-tests of the boundary-handling strategy
mabruzzo Dec 20, 2023
bf38c09
excised an unnecessary test.
mabruzzo Dec 20, 2023
f0169fa
removed the n_ghost member of fb_stencil::LegacyCIC27
mabruzzo Dec 20, 2023
ce66d14
removed the commented version of Apply_Energy_Momentum_Deposition
mabruzzo Dec 20, 2023
633469a
slightly refactored ResolvedAndUnresolvedSNe::for_each_possible_overlap
mabruzzo Dec 20, 2023
632c753
renamed feedback_model -> fb_prescription
mabruzzo Dec 20, 2023
66265ef
rename feedback_model.h -> prescription.h
mabruzzo Dec 20, 2023
5f15c3d
fixing some cuda/hip compatability issues
mabruzzo Jan 24, 2024
4d9a46c
minor feedback tweaks.
mabruzzo Feb 7, 2024
2308c93
Merge branch 's99_f-backport' into s99_f-feedback
mabruzzo Mar 26, 2024
84f1ce1
Merge branch 's99_f_galaxy' into s99_f-feedback
mabruzzo Apr 17, 2024
712029c
minor bugfix in the tests.
mabruzzo May 6, 2024
a49a765
Merge branch 's99_f_galaxy' into s99_f-feedback
mabruzzo May 6, 2024
d47f11b
alter the criterion for switching between resolved and unresolved fee…
mabruzzo May 16, 2024
ce21fa9
Merge branch 'dev' into s99_f-feedback
mabruzzo Jun 4, 2024
230ef08
Merge branch 'dev' into s99_f-feedback
mabruzzo Jul 11, 2024
583f11f
improved debugger logging in feedback/kernel.h
mabruzzo Jul 15, 2024
52b533b
break off thread-crash-handling into a separate kernel in VL+CT solver
mabruzzo Jul 19, 2024
84e2165
modify Average_Cell_Single_Field to account for stale cells.
mabruzzo Jul 19, 2024
3a0ad02
light refactoring.
mabruzzo Jul 19, 2024
50a26c0
adding an explanatory docstring.
mabruzzo Jul 19, 2024
7e7cb4e
forgot to commit a file.
mabruzzo Jul 19, 2024
291b1b6
Check for slow-cells in `Average_Cell_All_Fields`
mabruzzo Jul 22, 2024
94f44f3
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 22, 2024
c594775
a few assorted tweaks.
mabruzzo Jul 23, 2024
dbf7153
tweak Average_Slow_Cells_3D so that we ignore slow-cells in the ghost…
mabruzzo Jul 23, 2024
afa081c
tidying up
mabruzzo Jul 23, 2024
d7ac36d
Merge branch 'improving-thread-crash-logic' into s99_f-feedback
mabruzzo Jul 23, 2024
e8427df
changing the default reconstruction type in disk-problem and the star…
mabruzzo Jul 24, 2024
b391b35
Refactored ParameterMap initialization
mabruzzo Jul 24, 2024
037e679
updated parameters to be more consistent with CGOLs-style sim
mabruzzo Jul 25, 2024
f754356
tweak the default truncation radius.
mabruzzo Jul 25, 2024
4e40aef
add support for calling Particles3D::initialize without gravity
mabruzzo May 2, 2024
95dd375
misc changes to compile without grav
mabruzzo May 2, 2024
cf3ac58
turn off gravity in starblast test problem.
mabruzzo May 4, 2024
3ecde7c
satisfy clang-tidy and clang-format
mabruzzo Jul 26, 2024
1a4ef75
first step towards runtime-configurable chemistry.
mabruzzo Aug 2, 2024
29fbc9e
another step towards runtime-configuration of chemistry.
mabruzzo Aug 2, 2024
8ae8ee5
yet another step towards runtime-configuration of chemistry.
mabruzzo Aug 2, 2024
dd74f42
Removed most remaining CLOUDY_COOL and COOLING_GPU macros from the so…
mabruzzo Aug 2, 2024
b4a8917
moved the location where we check for unused parameters.
mabruzzo Aug 2, 2024
51709b9
fix a few assorted things.
mabruzzo Aug 2, 2024
58f92e2
address clang-tidy issues.
mabruzzo Aug 3, 2024
de38ca8
make format.
mabruzzo Aug 3, 2024
1d2583f
a bunch of refactoring.
mabruzzo Aug 3, 2024
e22f16f
make it possible to enable photoelectric heating.
mabruzzo Aug 3, 2024
dbc0a7c
Merge branch 'cooling-choice-photoelectric-heating' into s99_f-feedback
mabruzzo Aug 3, 2024
bd3f1af
minor refactor.
mabruzzo Aug 3, 2024
7c3b984
introducing new tests for parameter-tables.
mabruzzo Aug 3, 2024
bdff8ab
intermediate commit
mabruzzo Aug 3, 2024
ed7b425
another incremental commit.
mabruzzo Aug 5, 2024
2b0eddd
significant cleanup
mabruzzo Aug 5, 2024
ff2f2db
some simplification.
mabruzzo Aug 5, 2024
c73c2fb
introduce the Enforce_Table_Content_Uniform_Access_Status method.
mabruzzo Aug 5, 2024
9c666ba
Merge branch 'parameter-tables' into cooling-choice-photoelectric-hea…
mabruzzo Aug 5, 2024
944a959
we now raise an error if the [chemistry] parameter group gets passed …
mabruzzo Aug 5, 2024
b6feec3
adding ability to specify more parameters.
mabruzzo Aug 5, 2024
060e09b
fix a clang-tidy warning.
mabruzzo Aug 9, 2024
2a753ad
Merge branch 'particleNoGrav-backport' into s99_f-feedback
mabruzzo Aug 9, 2024
3c95ca5
fix a bug where heating would break subcycling within cooling_kernel.
mabruzzo Aug 15, 2024
e90b418
fix a bug where heating would break subcycling within cooling_kernel.
mabruzzo Aug 15, 2024
7375284
minor formatting tweak.
mabruzzo Oct 2, 2024
d0a47ce
start logging the type of SNe
mabruzzo Aug 19, 2024
d854af1
deposit feedback AFTER we apply floors.
mabruzzo Oct 18, 2024
48ee8c8
fixing a bug in GPU_Error_Check
mabruzzo Sep 27, 2024
d1beaa4
fixing the bug in the launch of PostUpdate_Conserved_Correct_Crashed_3D
mabruzzo Sep 30, 2024
9291767
make print statements about manual overrides more explicit.
mabruzzo Sep 30, 2024
bb738c5
slightly refactor the style of Average_Cell_All_Fields
mabruzzo Oct 2, 2024
63f5540
we now report errors when we can't slow-cell-average
mabruzzo Oct 3, 2024
1f7eda4
during cell-averaging we now print skipped values.
mabruzzo Oct 7, 2024
a17d8b9
Refactored DE to respect Crashed Cells
mabruzzo Oct 19, 2024
8acb34b
Average_Cell_All_Fields now respects DE Formalism
mabruzzo Oct 19, 2024
3603e88
introduce `gravity.gas_only_use_static_grav` parameter.
mabruzzo Nov 15, 2024
8a72b03
propagate `gravity.gas_only_use_static_grav` parameter to disk_ICs.
mabruzzo Nov 15, 2024
bed1fce
refactor feedback star particles.
mabruzzo Nov 20, 2024
ca00140
introduce CoolRecipeTI and light refactoring.
mabruzzo Nov 21, 2024
3517dfd
light refactoring of cooling_cuda.cu to simplify logic within Cooling…
mabruzzo Nov 22, 2024
1e0103c
slightly more refactoring of cooling_cuda.cu
mabruzzo Nov 22, 2024
d87c34d
reintroduce a clarifying comment.
mabruzzo Nov 22, 2024
ccf9e20
Merge branch 'cooling-choice-TIcool' into s99_f-feedback
mabruzzo Nov 22, 2024
6ccda13
minor bugfix in formatting error message
mabruzzo Dec 2, 2024
c564088
Merge branch 'cooling-choice-TIcool' into s99_f-feedback
mabruzzo Dec 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion builds/make.type.disk
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ DFLAGS += -DGRAVITY_5_POINTS_GRADIENT

DFLAGS += -DMPI_CHOLLA
DFLAGS += -DPRECISION=2
DFLAGS += -DPLMC
DFLAGS += -DPLMP
DFLAGS += -DHLLC
DFLAGS += -DVL

Expand Down
10 changes: 5 additions & 5 deletions builds/make.type.starblast
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ DFLAGS += -DANALYSIS
#DFLAGS += -DPARTICLES_KDK


DFLAGS += -DGRAVITY
DFLAGS += -DGRAVITY_GPU
#DFLAGS += -DGRAVITY
#DFLAGS += -DGRAVITY_GPU
# Use both -DSOR and -DPARIS_GALACTIC to run analytic test and compare solutions
#DFLAGS += -DSOR
DFLAGS += -DPARIS_GALACTIC
#DFLAGS += -DPARIS_GALACTIC
#DFLAGS += -DGRAVITY_ANALYTIC_COMP
DFLAGS += -DGRAVITY_5_POINTS_GRADIENT
#DFLAGS += -DGRAVITY_5_POINTS_GRADIENT

#DFLAGS += -DSTATIC_GRAV

#DFLAGS += -DOUTPUT_ALWAYS
DFLAGS += -DCUDA
DFLAGS += -DMPI_CHOLLA
DFLAGS += -DPRECISION=2
DFLAGS += -DPLMC
DFLAGS += -DPLMP
DFLAGS += -DHLLC
DFLAGS += -DVL

Expand Down
10 changes: 6 additions & 4 deletions examples/3D/disk_particle.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ n_hydro=10
gamma=1.66666667
# name of initial conditions
init=Disk_3D_particles
snr_filename=./src/feedback/starburst99_snr.txt
sw_filename=./src/feedback/starburst99_sw.txt
feedback_sn_model=legacy
feedback_boundary_strategy=snap
bc_potential_type=1
# domain properties
xmin=-2
Expand Down Expand Up @@ -51,3 +47,9 @@ ddelta_dt=-0.001
# path to output directory
outdir=./
prng_seed=41


feedback.snr_filename=./src/feedback/starburst99_snr.txt
feedback.sw_filename=./src/feedback/starburst99_sw.txt
feedback.sn_model=legacy
feedback.boundary_strategy=snap
4 changes: 2 additions & 2 deletions examples/3D/isolated_star_particle.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ n_hydro=10
gamma=1.66666667
# name of initial conditions
init=Isolated_Stellar_Cluster
snr_filename=./src/feedback/starburst99_snr.txt
sw_filename=./src/feedback/starburst99_sw.txt
feedback.snr_filename=./src/feedback/starburst99_snr.txt
feedback.sw_filename=./src/feedback/starburst99_sw.txt
bc_potential_type=1
# domain properties
xmin=-0.5
Expand Down
52 changes: 52 additions & 0 deletions src/cooling/chemistry.cu
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#include <string>

#include "../cooling/cooling_cuda.h" // provides configure_cooling_callback
#include "../grid/grid3D.h"
#include "../io/ParameterMap.h"
#include "chemistry.h"

std::function<void(Grid3D&)> configure_chemistry_callback(ParameterMap& pmap)
{
// we need to enforce this check so that we can accurately identify unnecessary parameters at the end of this func
pmap.Enforce_Table_Content_Uniform_Access_Status("chemistry", true);

// we use the traditional macros to set default-chemistry kinds to avoid
// breaking older setups.
// -> in the future, I think we can do away with this...
std::string default_kind = "none";
#if defined(COOLING_GPU) && defined(CLOUDY_COOL)
default_kind = "tabulated-cloudy";
#elif defined(COOLING_GPU)
default_kind = "piecewise-cie";
#elif defined(CHEMISTRY_GPU)
default_kind = "chemistry-gpu";
#elif defined(COOLING_GRACKLE)
default_kind = "grackle";
#endif

std::string chemistry_kind = pmap.value_or("chemistry.kind", default_kind);

std::function<void(Grid3D&)> out{};

#if defined(CHEMISTRY_GPU) || defined(COOLING_GRACKLE)
CHOLLA_ASSERT(chemistry_kind == default_kind,
"based on the defined macros, it is currently an error to pass a value to the "
"chemistry.kind parameter other than \"%s\" (even \"none\" is invalid) This is "
"because the \"%s\" functionality is invoked outside of the chemistry_callback "
"machinery (this will be fixed in the near future)",
default_kind.c_str(), default_kind.c_str());
#else
if (chemistry_kind == "none") {
// do nothing
} else if (chemistry_kind == "chemistry-gpu" or chemistry_kind == "grackle") {
CHOLLA_ERROR("chemistry.kind doesn't support %s yet (unless certain macros are defined)", chemistry_kind.c_str());
} else if (chemistry_kind != "none") {
out = configure_cooling_callback(chemistry_kind, pmap);
if (not out) CHOLLA_ERROR("\"%s\" is not a supported chemistry.kind parameter value.", chemistry_kind.c_str());
}
#endif // defined(CHEMISTRY_GPU) || defined(COOLING_GRACKLE)

// ensure any errors if there are any parameters in the chemistry group that we have not accessed
pmap.Enforce_Table_Content_Uniform_Access_Status("chemistry", false);
return out;
}
14 changes: 14 additions & 0 deletions src/cooling/chemistry.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// this is the public header for unified chemistry heating and cooling

#pragma once

#include <functional>

#include "../global/global.h"
#include "../grid/grid3D.h"

/* construct the chemistry callback (or not based on the specified parameters & compilation mode)
*
* \note
* we always define the following function regardless of the defined compiler flags */
std::function<void(Grid3D&)> configure_chemistry_callback(ParameterMap& pmap);
Loading
Loading