@@ -34,15 +34,15 @@ template <size_t VECDIM>
34
34
}
35
35
36
36
template <size_t S1, size_t S2>
37
- [[nodiscard]] [[gnu::const ]] constexpr auto dot (const std::array<double , S1> x, const std::array< double , S2> y)
38
- -> double
37
+ [[nodiscard]] [[gnu::const ]] constexpr auto dot (const std::array<double , S1> x,
38
+ const std::array< double , S2> y) -> double
39
39
// vector dot product
40
40
{
41
41
return std::inner_product (x.begin (), x.end (), y.begin (), 0 .);
42
42
}
43
43
44
- [[nodiscard]] [[gnu::pure]] constexpr auto get_velocity (std::span<const double , 3 > x, const double t)
45
- -> std::array<double, 3>
44
+ [[nodiscard]] [[gnu::pure]] constexpr auto get_velocity (std::span<const double , 3 > x,
45
+ const double t) -> std::array<double, 3>
46
46
// Routine for getting velocity vector of the flow at a position with homologous expansion.
47
47
{
48
48
return std::array<double , 3 >{x[0 ] / t, x[1 ] / t, x[2 ] / t};
@@ -59,8 +59,8 @@ template <size_t S1, size_t S2>
59
59
return std::array<double , 3 >{vec[0 ] * scalefactor, vec[1 ] * scalefactor, vec[2 ] * scalefactor};
60
60
}
61
61
62
- [[nodiscard]] [[gnu::const ]] constexpr auto angle_ab (const std::array<double , 3 > dir1, const std::array< double , 3 > vel)
63
- -> std::array<double, 3>
62
+ [[nodiscard]] [[gnu::const ]] constexpr auto angle_ab (const std::array<double , 3 > dir1,
63
+ const std::array< double , 3 > vel) -> std::array<double, 3>
64
64
// aberation of angles in special relativity
65
65
// dir1: direction unit vector in frame1
66
66
// vel: velocity of frame2 relative to frame1
@@ -141,17 +141,17 @@ template <size_t S1, size_t S2>
141
141
return doppler_nucmf_on_nurf (dir_rf, get_velocity (pos_rf, prop_time));
142
142
}
143
143
144
+ template <double CLIGHT_ASSUMED = CLIGHT_PROP>
144
145
constexpr auto move_pkt_withtime (std::span<double , 3 > pos_rf, const std::array<double , 3 > dir_rf, double &prop_time,
145
146
const double nu_rf, double &nu_cmf, const double e_rf, double &e_cmf,
146
- const double distance, bool neglect_exp = false ) -> double
147
+ const double distance) -> double
147
148
// / Subroutine to move a packet along a straight line (specified by current
148
149
// / dir vector). The distance moved is in the rest frame.
149
150
{
150
- double CLIGHT_PROP_DIST_CALC = (neglect_exp) ? 100 * CLIGHT_PROP : CLIGHT_PROP;
151
151
assert_always (distance >= 0 );
152
152
153
153
const double nu_cmf_old = nu_cmf;
154
- prop_time += distance / CLIGHT_PROP_DIST_CALC ;
154
+ prop_time += distance / CLIGHT_ASSUMED ;
155
155
156
156
pos_rf[0 ] += (dir_rf[0 ] * distance);
157
157
pos_rf[1 ] += (dir_rf[1 ] * distance);
@@ -171,9 +171,10 @@ constexpr auto move_pkt_withtime(std::span<double, 3> pos_rf, const std::array<d
171
171
return dopplerfactor;
172
172
}
173
173
174
- constexpr auto move_pkt_withtime (Packet &pkt, const double distance, bool neglect_exp = false ) -> double {
175
- return move_pkt_withtime (pkt.pos , pkt.dir , pkt.prop_time , pkt.nu_rf , pkt.nu_cmf , pkt.e_rf , pkt.e_cmf , distance,
176
- neglect_exp);
174
+ template <double CLIGHT_ASSUMED = CLIGHT_PROP>
175
+ constexpr auto move_pkt_withtime (Packet &pkt, const double distance) -> double {
176
+ return move_pkt_withtime<CLIGHT_ASSUMED>(pkt.pos , pkt.dir , pkt.prop_time , pkt.nu_rf , pkt.nu_cmf , pkt.e_rf , pkt.e_cmf ,
177
+ distance);
177
178
}
178
179
179
180
[[nodiscard]] [[gnu::const ]] constexpr auto get_arrive_time (const Packet &pkt) -> double
@@ -310,8 +311,8 @@ constexpr auto move_pkt_withtime(Packet &pkt, const double distance, bool neglec
310
311
}
311
312
312
313
// Routine to transform the Stokes Parameters from RF to CMF
313
- constexpr auto frame_transform (const std::array<double , 3 > n_rf, double *Q, double *U, const std::array< double , 3 > v)
314
- -> std::array<double, 3> {
314
+ constexpr auto frame_transform (const std::array<double , 3 > n_rf, double *Q, double *U,
315
+ const std::array< double , 3 > v) -> std::array<double, 3> {
315
316
// Meridian frame in the RF
316
317
const auto [ref1_rf, ref2_rf] = meridian (n_rf);
317
318
0 commit comments