Cholla 3.0.1-dev
Cholla - Massively parallel hydro on GPUs
Loading...
Searching...
No Matches
feedback.h
Go to the documentation of this file.
1
7#pragma once
8
9#include <functional>
10
11// since this is a public header and we want to hide all implementation details, we
12// explicitly avoid including other headers in from the feedback directory. This
13// helps ALWAYS include this header in main.cpp, regardless of the defined macros flags
14#include "../analysis/feedback_analysis.h"
15#include "../global/global.h"
16#include "../io/ParameterMap.h"
17
18// we define the following as a struct so we can satisfy rules about namespace and struct
19// naming. But you should think of it as a namespace
20struct FBInfoLUT {
21 // this enum acts like a lookup table (LUT). It maps the names of analysis statistics to
22 // contiguous indices. LEN specfies the number of named analysis statistics
23 enum {
24 countSN = 0,
25 countResolved,
26 countUnresolved,
27 totalEnergy,
28 totalMomentum,
29 totalUnresEnergy,
30 totalWindMomentum,
31 totalWindEnergy,
32 // make sure the following is always the last entry so that it reflects the number of entries
33 LEN
34 };
35};
36
37namespace feedback
38{
39static const Real ENERGY_PER_SN = 1e51 / MASS_UNIT * TIME_UNIT * TIME_UNIT / LENGTH_UNIT / LENGTH_UNIT;
40// 10 solarMasses per SN
41static const Real MASS_PER_SN = 10.0;
42// 2.8e5 M_s km/s * n_0^{-0.17} -> eq.(34) Kim & Ostriker (2015)
43static const Real FINAL_MOMENTUM = 2.8e5 / LENGTH_UNIT * 1e5 * TIME_UNIT;
44
45/* construct the feedback function (or not based on the specified parameters & compilation mode)
46 *
47 * \note
48 * we could probably define the following function regardless of the defined compiler flags */
49std::function<void(Grid3D&)> configure_feedback_callback(struct Parameters& P, ParameterMap& pmap,
50 FeedbackAnalysis& analysis);
51
52} // namespace feedback
Definition feedback_analysis.h:13
Class to create a the gravity object.
Definition grid3D.h:229
A class that provides map-like access to parameter files.
Definition ParameterMap.h:74
Definition feedback.h:20
Definition global.h:217