theochem / grid

Python library for numerical integration, interpolation, and differentiation on (molecular) grids.
https://grid.qcdevs.org/
GNU Lesser General Public License v3.0
46 stars 19 forks source link

Poisson Solver initial value problem implementation is not robust. #162

Open PaulWAyers opened 1 year ago

PaulWAyers commented 1 year ago

The current boundary-value-problem for the Poisson solver is pretty robust. The initial value problem is a lot less robust.

It's a good first issue to try to make this work more efficiently. I will post some notes on how to do this.

Aditish51 commented 8 months ago

@PaulWAyers Can you please give me more details on it? I would like to work on it.

Charlie-1-3 commented 8 months ago

The current code uses a large initial interval (r_interval[0]) for the IVP solver. This might be unnecessary, especially if f decays rapidly with increasing r. Reducing the initial interval to a value just larger than the region of interest can potentially improve performance.

PaulWAyers commented 8 months ago

@Charlie-1-3 did you test it to see if this helped?

@Ali-Tehrani do you have some examples for this? I seem to recall that Carlos had an example that was problematic, but I don't remember for certain.

Charlie-1-3 commented 8 months ago

@PaulWAyers Yes it worked for a few test cases where function f was inversely proportional to r. Cases, when f depends directly on r, might add extra computation in IVP because of larger domain traversal. Use of Relaxation Techniques for Poisson’s Equation one of which is Successive Over-Relaxation (SOR) would help too.