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

Fitted FFD generation #139

Merged
merged 11 commits into from
May 6, 2022
Merged

Fitted FFD generation #139

merged 11 commits into from
May 6, 2022

Conversation

sseraj
Copy link
Collaborator

@sseraj sseraj commented May 5, 2022

Purpose

This PR adds a function for generating fitted wing FFDs. The function uses DVCon to perform surface projections, which was @anilyil's idea. @ArshSaja made the initial implementation.

Here is an example of a C172 wing FFD

c172_fitted

I added the function to a file named ffd_generation.py and also moved write_wing_FFD_file to this file because I thought it was more appropriate than file_io.py.

Expected time until merged

A week or possibly more if reviewers want to test it out on their own geometries

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

Checklist

  • I have run flake8 and black to make sure the code adheres to PEP-8 and is consistently formatted
  • 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 May 5, 2022 22:36
@sseraj sseraj requested review from hajdik and marcomangano May 5, 2022 22:36
@codecov
Copy link

codecov bot commented May 5, 2022

Codecov Report

Merging #139 (d3ef8fa) into main (cad9040) will increase coverage by 0.14%.
The diff coverage is 84.03%.

@@            Coverage Diff             @@
##             main     #139      +/-   ##
==========================================
+ Coverage   62.62%   62.76%   +0.14%     
==========================================
  Files          45       46       +1     
  Lines       11213    11262      +49     
==========================================
+ Hits         7022     7069      +47     
- Misses       4191     4193       +2     
Impacted Files Coverage Δ
pygeo/constraints/DVCon.py 71.72% <ø> (+0.88%) ⬆️
pygeo/geo_utils/file_io.py 37.83% <ø> (-17.97%) ⬇️
pygeo/geo_utils/ffd_generation.py 83.89% <83.89%> (ø)
pygeo/geo_utils/__init__.py 100.00% <100.00%> (ø)

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@ArshSaja ArshSaja self-requested a review May 5, 2022 22:52
@ArshSaja
Copy link
Contributor

ArshSaja commented May 5, 2022

Nice work @sseraj . Thank you for adding it

Copy link
Contributor

@marcomangano marcomangano left a comment

Choose a reason for hiding this comment

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

Neat implementation! I just have one comment:

>>> nSpan = [4, 4]
>>> nChord = 8
>>> relMargins = [0.01, 0.001, 0.01]
>>> absMargins = [0.05, 0.001, 0.05]
Copy link
Contributor

@marcomangano marcomangano May 6, 2022

Choose a reason for hiding this comment

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

I am a bit confused about the usage of relative and absolute margins even after checking out the implementation. What's the rationale? A one-line explanation in the docstrings above would help.

@joanibal
Copy link
Collaborator

joanibal commented May 6, 2022

How fitted are the FFDs? Can you post a picture of the embedding volume and with the points inside?

@ArshSaja
Copy link
Contributor

ArshSaja commented May 6, 2022

This is the previous example I had.
exampleFFD

@ArshSaja ArshSaja merged commit 06948e7 into main May 6, 2022
@ArshSaja ArshSaja deleted the fitted-ffd branch May 6, 2022 17:58
@sseraj
Copy link
Collaborator Author

sseraj commented May 6, 2022

How fitted are the FFDs? Can you post a picture of the embedding volume and with the points inside?

The fit will depend on the user-specified margins, so some manual tuning is required. For the C172 FFD, here is the embedded volume (blue) and the surface points.
embed1
embed2
embed3

@hajdik hajdik mentioned this pull request Jun 14, 2022
12 tasks
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.

4 participants