-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add torques #21
Add torques #21
Conversation
* added parameterization to test different nbody algorithms to show bug * bug fix- thanks Raul!
…otation between functions
@RaulPPelaez Functionality is finally all here- I had a bit of a time getting the NBody wall corrections to work, but they're all tested now. I made the necessary interface changes to get everything to work as I went along, but some of them might need to change. Here are a few things of note:
Let me know any other fixes I should make! I know the documentation still needs to get updated, but I thought I'd wait until the interface was more solidified. |
You da best ❤️
Your call_mdot looks fine to me, python side the user can call: mf, mt = solver.Mdot(forces=f, torques=t) But also mf, mt = solver.Mdot(f) which will interpret f as forces.
We have the "needs_torque" variable (which we should rename to needsTorque for consistent btw). If that is false you can safely assume only the M_tt block is needed. Why would we need to change the interface here? As a matter of fact, I will add checks for torques being passed when needs_torques is false. If you are going more along the lines of the implementation computing torques always due to laziness I think that is ok for this PR. Interface is more important than implementation/performance. Let's get the functionality out there and make it fast in another PR. |
That is what I was mostly talking about. Since we're happy with just the functionality and tests and it looks like you updated the documentation (thanks for that!), I think this should be good to go! Thank you for your help! |
Reintroduces torques into the interface.
Mdot will now take two optional arrays (force and/or torque) and will return two arrays, (linear and angular displacements).
Similarly for computeHydrodynamicDisplacements.
sqrtMdot will simply return two arrays.
A new parameter, needsTorque, has been added to the MobilityInterface parameters. Some solvers need to know in advance if torques are required. For instance DPStokes needs different parameters if torques are needed vs only forces.
Currently all modules will fail if torques are provided by raising a "not implemented" error.
@rykerfish please add torque tests to this PR, remove the exception throwing as you enable solvers to use torques.
Closes #12