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

Equipotential plotting #3626

Merged
merged 14 commits into from
May 4, 2023

Conversation

eggrobin
Copy link
Member

@eggrobin eggrobin commented May 2, 2023


struct Equipotentials {
Equipotential<Barycentric, Navigation>::Lines lines;
Parameters parameters;
Copy link
Member

Choose a reason for hiding this comment

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

It feels a bit odd to return the parameters.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, but because of the asynchronicity we need them to know whether we can use the result.

ksp_plugin/geometric_potential_plotter.hpp Outdated Show resolved Hide resolved
ksp_plugin/geometric_potential_plotter.cpp Outdated Show resolved Hide resolved
ksp_plugin/geometric_potential_plotter.cpp Outdated Show resolved Hide resolved
if (plotter_idle_) {
plotter_idle_ = false;
plotter_ = MakeStoppableThread(
[this, parameters]() { PlotEquipotentials(parameters).IgnoreError(); });
Copy link
Member

Choose a reason for hiding this comment

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

We generally don't write bodies on a single line, so line breaks after { and before }.

Copy link
Member Author

Choose a reason for hiding this comment

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

We do for λs.

[this]() { absl::Status const status = RepeatedlyRunAction(); });

&t](Position<Navigation> const& position) {
auto const acceleration = reference_frame.GeometricAcceleration(
t, {position, Velocity<Navigation>{}});
// Note the sign.
Copy link
Member

Choose a reason for hiding this comment

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

I noted it, but maybe explain why it's there.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done, and renamed the λ.

ksp_plugin/geometric_potential_plotter.cpp Show resolved Hide resolved
ksp_plugin/geometric_potential_plotter.cpp Show resolved Hide resolved
ksp_plugin/geometric_potential_plotter.cpp Show resolved Hide resolved
int __cdecl principia__EquipotentialCount(Plugin* const plugin) {
journal::Method<journal::EquipotentialCount> m({plugin});
CHECK_NOTNULL(plugin);
plugin->geometric_potential_plotter().RefreshEquipotentials();
Copy link
Member

Choose a reason for hiding this comment

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

Why do we refresh if we are not in a rotating pulsating frame? That seems wasteful.

Copy link
Member Author

Choose a reason for hiding this comment

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

RefreshEquipotentials isn’t RequestEquipotentials (the terminology is the same as in the analyser), the most it does is a swap.

@pleroy pleroy added the LGTM label May 4, 2023
@eggrobin eggrobin merged commit 55f42bf into mockingbirdnest:master May 4, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants