Skip to content

Conversation

@robfalck
Copy link
Contributor

Summary

  • Birkhoff will at least report error during grid refinement now, but isn't fully operational yet.
  • set_state_vals can be called (num_state_input_nodes,) + shape set of state values.
  • set_control_vals can be called with (num_control_input_nodes,) + shape
  • Birkhoff will attempt to build a guess of state rates in set_state_vals if given enough information (states and times).
  • Birkhoff state defects are now not linear if initial and final state values are not design variables.

Related Issues

None

Backwards incompatibilities

None

New Dependencies

None

shape = options['shape']
if isinstance(shape, int):
shape = (shape,)
val_shape = (num_nodes,) + shape
Copy link
Member

Choose a reason for hiding this comment

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

Might be cleaner to just compute val_shape once and then use it for all three different kinds of targerts, since it only depends on options.

configure_controls_introspection, configure_parameters_introspection, \
configure_timeseries_output_introspection, classify_var
from ..utils.misc import _unspecified, create_subprob
from ..utils.misc import _unspecified, create_subprob, is_scalar_or_singleton
Copy link
Member

Choose a reason for hiding this comment

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

I was hoping you were getting rid of the relative import while you were here...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Consider this a christmas present from me :)

"""
raise NotImplementedError(f'Transcription {self.__class__.__name__} does not implement method '
'_phase_set_val.')
# All phases at least set state vals at the input nodes
Copy link
Member

Choose a reason for hiding this comment

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

"all phases" means "all transcriptions" ?

# Case 2: We've been given a single value of a shaped state.
state_vals = np.broadcast_to(vals_array, (num_state_input_nodes,) + state_shape)
else:
if time_vals is None:
Copy link
Member

Choose a reason for hiding this comment

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

This "else" statement only contains an if/elif/else block, so I think you can bring them all up one level into the main if.

Copy link
Member

@Kenneth-T-Moore Kenneth-T-Moore left a comment

Choose a reason for hiding this comment

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

Looks good, but see comments.

@robfalck robfalck merged commit 683618e into OpenMDAO:master Dec 19, 2025
1 check 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.

2 participants