Skip to content

inertia box fluid model #191

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

@thowell thowell linked an issue Apr 27, 2025 that may be closed by this pull request
Copy link
Collaborator

@adenzler-nvidia adenzler-nvidia left a comment

Choose a reason for hiding this comment

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

Thanks - some comments, mostly about wp.static usage.

lvel_torque = rotT @ torque
lvel_force = rotT @ force

if m.opt.wind[0] or m.opt.wind[1] or m.opt.wind[2]:
Copy link
Collaborator

Choose a reason for hiding this comment

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

not sure if there is a big benefit to this, but could be wp.max(m.opt.wind) > 0.0.

Or I guess this information is even statically available, so maybe wrap in wp.static? actually, you're not running that code right now anyway if all of them are zero, are you going to reuse this function in a different kernel?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

wrapped in wp.static

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the functionality from _inertia_box_fluid_model is moved into box_fluid

Copy link
Collaborator

@erikfrey erikfrey left a comment

Choose a reason for hiding this comment

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

This is lovely code and nicely written, just a few nits

@@ -227,22 +227,6 @@ def test_get_data_into_m(self):
np.testing.assert_allclose(mjd.qLD, mjd_ref.qLD)
np.testing.assert_allclose(mjd.qM, mjd_ref.qM)

def test_option_physical_constants(self):
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe we should still check for ellipsoid fluid and fail?

opt_viscosity = opt.viscosity
opt_density = opt.density

@nested_kernel
Copy link
Collaborator

Choose a reason for hiding this comment

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

This gets a bit subjective, but I think the bar might be higher for using a nested kernel. For tiles we have no choice, but for here, we can pass the opts in as params.

If it led to a significant performance difference I would understand, but this kernel looks pretty cheap.

In particular, my understanding is that the performance hit comes from thread divergence. e.g. some threads have viscosity and others don't. I don't think that's the case here, no?

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.

Box fluid model
4 participants