|Original GitHub post:|
I think it would be very useful if we could query the PME grid dimensions for the AmoebaMultipoleForce in a Context. Currently there is no way to get the grid dimensions if the user specifies ewaldErrorTolerance - the grid dimensions are calculated automatically when creating the Context, but if I call simulation.context.getSystem().getForce(force_num).getPmeGridDimensions() the return value is (0,0,0).
On the CUDA platform, the grid dimensions are automatically set in AmoebaCudaKernels.cpp if the user doesn't provide them explicitly. If the AmoebaMultipoleForce argument weren't declared as const, then we could call AmoebaMultipoleForce.setPmeGridDimensions() and the user could query them from the application layer. This seems to go against the current design, does anyone have ideas that might work?
Peter's suggested solution:
Perhaps AmoebaMultipoleForce and NonbondedForce could each have an alternate version of getPMEParameters() that takes a Context as an additional argument, and returns the specific values being used in that Context?