Skip to content

Commit

Permalink
Tweak to FlatBar::GetValue (func_flatbar) to avoid possible uninitial…
Browse files Browse the repository at this point in the history
…ized variable
  • Loading branch information
perwin committed Jul 25, 2024
1 parent 897970e commit 54dceef
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions function_objects/func_flatbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,22 @@ double FlatBar::GetValue( double x, double y )
}
totalIntensity = theSum / (nSubsamples*nSubsamples);
}
// else {
// double deltaPA = fabs(atan(yp/xp));
// if (deltaPA > deltaPA_max_rad)
// //totalIntensity = I_0 * exp(-r/h1);
// h2_current = h1;
// else {
// std::tie(r_b_current, h2_current) = GetAdjustedRbh2(xp, yp, r, r_circ);
// }
// totalIntensity = CalculateIntensity(r, h2_current, r_b_current);
// }
else {
std::tie(r_b_current, h2_current) = GetAdjustedRbh2(xp, yp, r, r_circ);
double deltaPA = fabs(atan(yp/xp));
if (deltaPA > deltaPA_max_rad)
if (deltaPA > deltaPA_max_rad) {
//totalIntensity = I_0 * exp(-r/h1);
h2_current = h1;
else {
std::tie(r_b_current, h2_current) = GetAdjustedRbh2(xp, yp, r, r_circ);
}
totalIntensity = CalculateIntensity(r, h2_current, r_b_current);
}
Expand Down

0 comments on commit 54dceef

Please sign in to comment.