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

New functions in MPhys wrapper #193

Merged
merged 32 commits into from
May 22, 2023
Merged

Conversation

hajdik
Copy link
Contributor

@hajdik hajdik commented Mar 28, 2023

Purpose

Adding addLocalSectionDVs to the MPhys wrapper and adding ways to return the geometry component's DVCon and DVGeo (or child DVGeo) objects so the user can use each class's methods directly

Expected time until merged

2 months

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

soon

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

@hajdik hajdik requested a review from a team as a code owner March 28, 2023 17:54
@hajdik hajdik requested review from marcomangano and anilyil March 28, 2023 17:54
marcomangano
marcomangano previously approved these changes Mar 28, 2023
@codecov
Copy link

codecov bot commented Mar 28, 2023

Codecov Report

Merging #193 (9e7bf7c) into main (52ebeaf) will decrease coverage by 0.09%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main     #193      +/-   ##
==========================================
- Coverage   64.87%   64.78%   -0.09%     
==========================================
  Files          47       47              
  Lines       11953    11969      +16     
==========================================
  Hits         7754     7754              
- Misses       4199     4215      +16     
Impacted Files Coverage Δ
pygeo/mphys/mphys_dvgeo.py 0.00% <0.00%> (ø)

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

if self.geo_type != "ffd":
raise RuntimeError(f"Only FFD-based DVGeo objects can use local DVs, not type:{self.geo_type}")

# add the DV to a child DVGeo
Copy link
Contributor

Choose a reason for hiding this comment

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

isn't this comment backwards?

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.

left a minor comment, good otherwise

@hajdik
Copy link
Contributor Author

hajdik commented Mar 28, 2023

Lucas is testing this with his case, don't merge until we double check that it's good there.

anilyil
anilyil previously approved these changes Mar 28, 2023
@hajdik hajdik changed the title LocalSectionDVs in MPhys wrapper New functions in MPhys wrapper Apr 3, 2023
@hajdik
Copy link
Contributor Author

hajdik commented Apr 3, 2023

I added other functions I've been needing in MPhys to this PR and updated the info. Lucas said local shape variables have been working for him so I think everything is good to go.

@hajdik hajdik requested a review from bernardopacini April 10, 2023 14:38
@hajdik
Copy link
Contributor Author

hajdik commented Apr 22, 2023

This PR is still ready for review and now has docstrings, by popular demand.

pygeo/mphys/mphys_dvgeo.py Outdated Show resolved Hide resolved
pygeo/mphys/mphys_dvgeo.py Outdated Show resolved Hide resolved
@bernardopacini
Copy link
Collaborator

From today's maintenance meeting, we decided to remove methods from the MPhys wrapper that do not add input / outputs for OpenMDAO (with the exception of adding a reference axis). Instead, we should add a method that just returns the DVGeo object so the user can directly interface with the underlying object methods.

@hajdik
Copy link
Contributor Author

hajdik commented May 16, 2023

From today's maintenance meeting, we decided to remove methods from the MPhys wrapper that do not add input / outputs for OpenMDAO (with the exception of adding a reference axis). Instead, we should add a method that just returns the DVGeo object so the user can directly interface with the underlying object methods.

These changes have been addressed.

@anilyil anilyil requested review from anilyil and bernardopacini May 17, 2023 01:54
anilyil
anilyil previously approved these changes May 17, 2023
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.

Thanks for the recent changes.

@anilyil anilyil mentioned this pull request May 17, 2023
13 tasks
@anilyil anilyil self-requested a review May 17, 2023 12:59
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.

Actually, can you add the ref axis call back? Just because that is a critical routine that is almost always called with FFDs. It does affect the outputs of DVGeo, but not OM states.

Most other routines are just utility functions that help with i/o or get indices etc, so they can be accessed through the DVGeo object.

Copy link
Collaborator

@bernardopacini bernardopacini left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @hajdik

@anilyil anilyil merged commit 1137883 into mdolab:main May 22, 2023
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.

6 participants