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
122 stars 54 forks source link

Add ability for `writeSurfaceTecplot` to get surface from DVGeo #209

Closed A-CGray closed 1 year ago

A-CGray commented 1 year ago

Purpose

The writeSurfaceSTL in DVConstraints has the ability to write out a surface that is not stored in a DVConstraints object but in the associated DVGeo. This PR just extends that functionality to the writeSurfaceTecplot function.

Expected time until merged

1 day

Type of change

Testing

Checklist

codecov[bot] commented 1 year ago

Codecov Report

Merging #209 (0b39596) into main (d4784ad) will increase coverage by 0.00%. The diff coverage is 53.84%.

:exclamation: Current head 0b39596 differs from pull request most recent head 0730b2b. Consider uploading reports for the commit 0730b2b to get more accurate results

@@           Coverage Diff           @@
##             main     #209   +/-   ##
=======================================
  Coverage   64.76%   64.76%           
=======================================
  Files          47       47           
  Lines       12018    12018           
=======================================
+ Hits         7783     7784    +1     
+ Misses       4235     4234    -1     
Impacted Files Coverage Δ
pygeo/constraints/DVCon.py 71.87% <53.84%> (+0.14%) :arrow_up:

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

A-CGray commented 1 year ago

Changes look good. One minor thing: can you add what the default behavior is when fromDVGeo is set to None? Does it just write the original coordinates? To someone looking at the current state of the code w/o any of its history, it would be difficult to understand the different behavior.

Sure, please check that my explanation makes sense to you. As far as I can see, if fromDVGeo=None then the points are taken from the DVCon's self.surfaces dict, which only ever contains the original surface coordinates. Whereas, if you supply a DVGeo name, it will retreive the current deformed coordinates from DVGeo

anilyil commented 1 year ago

Yeah set surface just gets an initial copy of the vertices, which is what is saved in DVCon. The explanation is correct.