Tckgen iFOD1 fix max angle at seed master#3335
Draft
Lestropie wants to merge 2 commits into
Draft
Conversation
Mostly indentation changes, but also minor cleanup in handling of init() method.
With iFOD1, the second half of a bidirectional streamline starts in the opposite direction from the first half. The seed direction is determined first, and then used as the initial direction of tracking for both halves. But the actual direction of the first step is taken as a random sample within the angular constraint about that seed direction, and because this happens both ways, and with the same seed direction, it is possible for the angle between the two line segments either side of the seed point to be up to twice the max angle. The solution here involves setting the initial direction of tracking for the second half of the streamline to the (opposite of the) *actual* direction of the first step of the first half, rather than the seed direction initially determined. This ensures that the first step of the second half of the streamline is taken within the max angle constraint of what is effectively the incoming direction of tracking. To achieve this, the reverse_track() method was extended to perform the actual track reversal and set the position and initial direction of tracking, and overridden in the iFOD1 method to set things appropriately.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supersedes #2325 by targeting
master.I'm initially creating this as a draft PR.
My instinct is that this requires a little bit more tweaking.
Desired behaviour for both first-order and intrinsically second-order methods RE tangent at track reversal:
method.dirafter the completion ofinit()that needs to be loaded in as the content ofmethod.dirafter reversal, but the direction of the first step.It seems that the behaviour of iFOD1 vs. iFOD2 with a user-specified seed direction is quite different.
next()is called it's doing the same thing again. So the actual tangent of the first step could be outside of the permissible angle from the user-specified initial direction.Perhaps the correct behaviour is to check whether it's feasible to find a direction at the seed point relative to the user-specified seed direction, and if a suitable direction can be found, then the seed point is accepted, but
method.dirremains equivalent to the user-specified seed direction. That way, on the first call tonext(), the direction of the first step remains within the permissible angle relative to the user-specified seed direction.