Skip to content

Commit

Permalink
Merge pull request fmihpc#1057 from ykempf/fix_ionosphere_coupling_st…
Browse files Browse the repository at this point in the history
…epping_interpolation

Reverse direction when stepping back to hit exact radius when tracing.
  • Loading branch information
ursg authored Nov 8, 2024
2 parents e20ea65 + 4af1a05 commit cc6068f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fieldtracing/fieldtracing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ namespace FieldTracing {
const std::array<Real,3> x_in = x;
Real r_in = sqrt(x[0]*x[0] + x[1]*x[1] + x[2]*x[2]);
// Take a step back and find the innerRadius crossing point
stepFieldLine(x,v, stepSize,fieldTracingParameters.min_tracer_dx_ionospere_coupling,fieldTracingParameters.max_tracer_dx_ionospere_coupling,fieldTracingParameters.tracingMethod,dipoleFieldOnly,false);
stepFieldLine(x,v, stepSize,fieldTracingParameters.min_tracer_dx_ionospere_coupling,fieldTracingParameters.max_tracer_dx_ionospere_coupling,fieldTracingParameters.tracingMethod,dipoleFieldOnly,true);
Real r_out = sqrt(x[0]*x[0] + x[1]*x[1] + x[2]*x[2]);
Real alpha = (SBC::Ionosphere::innerRadius - r_in)/(r_out - r_in);
alpha = std::fmax(std::fmin(alpha,1.0),0.0);
Expand Down

0 comments on commit cc6068f

Please sign in to comment.