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

Methods for level 2 revamp part 1. #651

Merged
merged 56 commits into from
Feb 26, 2025

Conversation

Kenneth-T-Moore
Copy link
Member

Summary

  1. Moved PreMissiongroup, PostMissionGroup and AviaryGroup into their own files.
  2. Created a new object called a Problem Builder which builds parts of an aviary problem that are unique to a specific mission_method.

This is a first pass at some refactoring that will allow for more customization.

Related Issues

  • Resolves #

Backwards incompatibilities

None

New Dependencies

None

fix_initial=fix_initial, fix_duration=fix_duration, units=time_units,
duration_bounds=user_options.get_val("duration_bounds", time_units),
duration_ref=user_options.get_val("duration_ref", time_units),
initial_ref=initial_ref,
Copy link
Contributor

Choose a reason for hiding this comment

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

why are we not applying the initial_bounds that the user supplied here??

Copy link
Member Author

Choose a reason for hiding this comment

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

It is potentially an oversight. We should treat initial_bounds just like initial_ref -- none unless mpi.

Kenneth-T-Moore and others added 6 commits January 28, 2025 14:23
…gine_deck() when no deck is supplied into each of the 3 different builders.
…roblem_builders. left all objective calcs in m4l2 because even if your running shooting, they could be useful and don\t have a large computational cost
@Kenneth-T-Moore Kenneth-T-Moore marked this pull request as ready for review February 4, 2025 15:54
Copy link
Contributor

@jkirk5 jkirk5 left a comment

Choose a reason for hiding this comment

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

Additional sugestions:
Change name to ProblemConfigurator (suggested file names, two_dof_problem_configurator.py, energy_problem_configurator.py)
Create a base class for the configurators to define the interface

Copy link
Contributor

Choose a reason for hiding this comment

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

We've been naming all of our files with snake case so far, so let's keep these consistent as well

@@ -0,0 +1 @@
__version__ = "0.9.7-dev"
Copy link
Contributor

Choose a reason for hiding this comment

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

copy/paste from old file? This should be blank right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch. This was definitely accidental.

@Kenneth-T-Moore
Copy link
Member Author

Latest updates fixed the naming of the new classes, bringing them in line with standards. Also added a base class.

Mission.Design.RANGE, units='NM')
self.builder.initial_guesses(self)
# This function sets all the following defaults if they were not already set
# self.engine_builders, self.mass_method, self.pre_mission_info, self_post_mission_info
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like mass_method is not dealt with in here after all, we deal with it further up

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, I have removed it.

height energy phases.
"""

def initial_guesses(self, prob):
Copy link
Contributor

Choose a reason for hiding this comment

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

We have both initial_guesses() (Set any initial guesses for variables in the aviary problem) and add_guesses() (Adds the initial guesses for each variable of a given phase to the problem.). I'm wondering if we can consolidate? I'm sure that the reason we have two is because we setup guesses in two places in M4L2

Copy link
Member Author

Choose a reason for hiding this comment

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

It is kind of weird, and something we didn't really notice until we pulled the code out. I think untangling all of these strands is going to be difficult, but will result in more maintainable code.

@Kenneth-T-Moore Kenneth-T-Moore added this pull request to the merge queue Feb 26, 2025
Merged via the queue into OpenMDAO:main with commit 45c73c2 Feb 26, 2025
6 checks passed
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