Remove temperature from interface - #49
Conversation
|
Agree with everything except for the rename of hydrodynamic velocities as long as it is well documented. The other methods are really clear on what they do and removing the temperature makes sense (its called "sqrtMdot", without kT).
|
…MdotW and divM so there are no longer hidden scalars. rewrote hydrodynamicVelocities and called it LangevinVelocities, which now take in the necessary arguments (temperature and dt) to ensure a dimensionally consistent result & computes velocities from a Langevin equation.
…datory but the forces and torques are not
|
The idea of hydrodynamicVelocities with two arbitrary prefactors somewhat scared Brennan and I because of the complete lack of dimensional consistency that could arise from a naive user. We also thought it wouldn't be particularly useful since most time stepping methods that are more complicated than Euler-Maruyama require computations at different positions (e.g. midpoint), and I don't think something even like a stochastic Adams-Bashforth would be particularly easy since the stochastic piece isn't included from the previous timestep. I went for |
|
✅ Linter reported no issues All Python files are correctly formatted with Black. |
|
✅ Linter reported no issues All C/C++ files are correctly formatted with clang-format. |
| // Compute the divergence of the mobility matrix, | ||
| // :math:`\boldsymbol{\partial}_\boldsymbol{x}\cdot |
There was a problem hiding this comment.
Should we document these the right way with Doxygen, even when we are not rendering them at all in the docs?
Perhaps we should do so and render them in the "How to add a new solver" page. I will take care of it in another PR.
RaulPPelaez
left a comment
There was a problem hiding this comment.
Looks good to me, please consider my comments but feel free to merge as is.
|
I bumped UAMMD to the latest version, which introduces compatibility with CUDA 12.9, also solves some anoying warnings. |
I found a bug where the default implementation for
sqrtMdotWwas not accounting for the temperature in the interface. This affected NBody and DPStokes since they rely on Lanczos, but did not affect PSE or SelfMobility since they have their own implementations. I discovered this since changing thetemperatureparameter in the fluctuation-dissipation tests only made SelfMobility and PSE fail, while the other solvers continued to pass since they acted as if they hadtemperature=1.Instead of rectifying this, Brennan and I thought it would be better to remove$\sqrt{2 k_BT}$ and $k_BT$ , respectively. We like this more since a hidden always-there prefactor on some functions is a bit counter-intuitive and created this bug in the first place. I removed
temperaturefrom the interface entirely. This would makesqrtMdotWandthermalDriftreturn without the prefactors oftemperaturefrom the interface but I'm currently taking it as an argument inhydrodynamicVelocitiesso the temperature-related prefactors can be added there.However,$MF$ and $M^{1/2}$ terms will have different prefactors of
hydrodynamicVelocitiesas a function is likely to be misleading. In most time integrators I think thedton them, so we wouldn't be able to usehydrodynamicVelocitiesto do something like an Euler-Maruyama step without also taking indtas a parameter. I suggest we either renamehydrodynamicVelocitiesto something likeEM-stepand take in adtparameter as well so we can add it correctly, or just entirely remove it from the interface. This would be a slight performance hit toPSE, but might be worth it.@RaulPPelaez what do you think? I summarized the main questions below since this got long.
sqrtMdotWandthermalDrift)hydrodynamicVelocities