Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for surface tracking in DVGeometryMulti #214

Merged
merged 7 commits into from
Sep 26, 2023

Conversation

sseraj
Copy link
Collaborator

@sseraj sseraj commented Aug 7, 2023

Purpose

My initial implementation of surface tracking in DVGeometryMulti had a few shortcomings. This PR makes the following improvements:

  1. Moved the identification of which points get projected to tracked surfaces or the component as a whole from project to addPointSet. This process only needs to happen once, not every time the projection occurs.
  2. Fixed the case where a point could be associated with multiple tracked surfaces. This would previously raise a ValueError when removing points from the component-wide indices. Now the exception is caught, and the duplicate surface association is removed. This edge case can sometimes be avoided by tuning the surface tracking tolerances, but it is unavoidable in some cases. One example is if the upper and lower surfaces of a wing share points on the leading edge curve.
  3. Renamed several variables related to indexing to help distinguish between indices, dictionaries of indicies, mappings to indices, and dictionaries of mappings to indices. This still may not be super clear, so suggestions are welcome.

Expected time until merged

1-2 weeks

Type of change

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (non-backwards-compatible fix or feature)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Documentation update
  • Maintenance update
  • Other (please describe)

Testing

The current test includes surface tracking, which verifies that the refactoring did not break the primal or derivative computations. I added a separate test for shared points between tracked surfaces. This test fails without the fix and passes with the fix.

Checklist

  • I have run flake8 and black to make sure the Python code adheres to PEP-8 and is consistently formatted
  • I have formatted the Fortran code with fprettify or C/C++ code with clang-format as applicable
  • I have run unit and regression tests which pass locally with my changes
  • I have added new tests that prove my fix is effective or that my feature works
  • I have added necessary documentation

@sseraj sseraj requested a review from a team as a code owner August 7, 2023 16:09
@sseraj sseraj requested review from hajdik and marcomangano August 7, 2023 16:09
@codecov
Copy link

codecov bot commented Aug 7, 2023

Codecov Report

Merging #214 (2d59edc) into main (e169ab2) will increase coverage by 0.06%.
The diff coverage is 98.24%.

@@            Coverage Diff             @@
##             main     #214      +/-   ##
==========================================
+ Coverage   64.72%   64.78%   +0.06%     
==========================================
  Files          47       47              
  Lines       12055    12073      +18     
==========================================
+ Hits         7802     7821      +19     
+ Misses       4253     4252       -1     
Files Coverage Δ
pygeo/parameterization/DVGeoMulti.py 91.24% <98.24%> (+0.20%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@anilyil anilyil requested review from anilyil and removed request for marcomangano August 29, 2023 08:37
Copy link
Contributor

@anilyil anilyil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes are good w/ me, but lets make sure none of the currently developed scripts that use this break. @bernardopacini, maybe check your code with this?

@hajdik hajdik merged commit d6e2d9c into mdolab:main Sep 26, 2023
11 checks passed
@sseraj sseraj deleted the trackSurfaces-fix branch September 26, 2023 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants