49 template <
typename propagator_state_t>
52 if (state.options.debug) {
53 std::stringstream dstream;
54 dstream <<
" " << status <<
" ";
55 dstream << std::setw(state.options.debugPfxWidth);
58 dstream << std::setw(state.options.debugMsgWidth);
59 dstream << logAction() <<
'\n';
60 state.options.debugString += dstream.str();
75 template <
typename propagator_state_t,
typename stepper_t>
77 const stepper_t& )
const {
78 if (state.navigation.targetReached) {
83 state.stepping.pathAccumulated;
84 double tolerance = state.options.targetTolerance;
86 bool limitReached = (distance * distance < tolerance * tolerance);
89 std::stringstream dstream;
90 dstream <<
"Path limit reached at distance " << distance;
94 state.navigation.targetReached =
true;
97 std::stringstream dstream;
98 dstream <<
"Target stepSize (path limit) updated to ";
99 dstream << state.stepping.stepSize.toString();
100 return dstream.str();
120 template <
typename propagator_state_t,
typename stepper_t>
122 return (*
this)(state,
stepper, *state.navigation.targetSurface);
133 template <
typename propagator_state_t,
typename stepper_t>
135 const Surface& targetSurface)
const {
136 if (state.navigation.targetReached) {
143 if ((state.navigation.currentSurface &&
144 state.navigation.currentSurface == &targetSurface)) {
146 std::string ds(
"Target surface reached.");
150 state.navigation.targetReached =
true;
154 const double tolerance = state.options.targetTolerance;
155 const auto sIntersection = targetSurface.
intersect(
156 state.geoContext, stepper.position(state.stepping),
157 state.stepping.navDir * stepper.direction(state.stepping),
true);
161 (sIntersection.intersection.status == Intersection::Status::onSurface);
167 std::stringstream dstream;
168 dstream <<
"Target surface reached at distance (tolerance) ";
169 dstream << distance <<
" (" << tolerance <<
")";
170 return dstream.str();
173 state.navigation.currentSurface = &targetSurface;
175 std::stringstream dstream;
176 dstream <<
"Current surface set to target surface ";
177 dstream << state.navigation.currentSurface->geoID();
178 return dstream.str();
181 state.navigation.targetReached =
true;
184 const double overstepLimit = stepper.overstepLimit(state.stepping);
186 if (distance < overstepLimit and sIntersection.alternative) {
188 distance = sIntersection.alternative.pathLength;
190 state.stepping.stepSize.update(state.stepping.navDir * distance,
193 std::stringstream dstream;
194 dstream <<
"Target stepSize (surface) updated to ";
195 dstream << state.stepping.stepSize.toString();
196 return dstream.str();
200 return targetReached;
214 template <
typename propagator_state_t,
typename stepper_t>
216 const stepper_t& )
const {
217 if (state.navigation.currentVolume !=
nullptr) {
220 state.navigation.targetReached =
true;