New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicit streamline length calculation on master #1510

Merged
merged 2 commits into from Dec 12, 2018

Conversation

Projects
None yet
2 participants
@Lestropie
Copy link
Member

Lestropie commented Dec 9, 2018

As re-raised on forum.

Turns out I should have paid closer attention to the contents of that function than just the function template 馃槥

Addressing this separately to #1507. That introduces changes in behaviour and interface in a number of different contexts. This PR is purely to address the erroneous calculation of lengths of nonlinearly-warped streamlines.

Streamline::calc_length(): Make no assumptions
Previous version of this function estimated the step size from the central segment of the streamline, and then assumed that this step size applied to the rest of the streamline (apart from the first and last segments) by calling the Streamline::calc_length(float step_size) function. If streamlines have been non-linearly warped, this is not going to be a safe assumption. Therefore, both in any context where a fixed step size is not known, or in tckstats if the user specifies the -explicit option, explicitly sum the distances between streamline vertices.

@Lestropie Lestropie added the bug label Dec 9, 2018

@Lestropie Lestropie self-assigned this Dec 9, 2018

@Lestropie Lestropie requested a review from jdtournier Dec 9, 2018

@jdtournier
Copy link
Member

jdtournier left a comment

Looks good - and less reliant on assumptions...

@Lestropie Lestropie merged commit d7f497c into master Dec 12, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@Lestropie Lestropie deleted the tckstats_explicit_fix branch Dec 12, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment