mdolab / pygeo

pyGeo provides geometric design variables and constraints suitable for gradient-based optimization.
https://mdolab-pygeo.readthedocs-hosted.com/en/latest/?badge=latest
Apache License 2.0
124 stars 55 forks source link

Fitted FFD generation #139

Closed sseraj closed 2 years ago

sseraj commented 2 years ago

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

Testing

Checklist

codecov[bot] commented 2 years ago

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%) :arrow_up:
pygeo/geo_utils/file_io.py 37.83% <ø> (-17.97%) :arrow_down:
pygeo/geo_utils/ffd_generation.py 83.89% <83.89%> (ø)
pygeo/geo_utils/__init__.py 100.00% <100.00%> (ø)

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

ArshSaja commented 2 years ago

Nice work @sseraj . Thank you for adding it

joanibal commented 2 years ago

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

ArshSaja commented 2 years ago

This is the previous example I had. exampleFFD

sseraj commented 2 years ago

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