Added initialization of the variables after allocation #162
Added initialization of the variables after allocation #162mnottoli merged 5 commits intoddsolvation:mainfrom
Conversation
|
I changed a bit how the guess for the adjoint screened Poisson equation is done. |
Unfortunately, it is not working. However, the error message is a new one. Before the Jacobi solver did not converge but now we get "In fill_guess, the RHS is not initialized" |
|
I think the problem is here: https://github.com/robin-dahl/tblite/blob/d4b819c17af6f4748d1fa690718ee5759da1ea67/src/tblite/solvation/ddx.f90#L324C20-L324C23 You are calling |
|
Isn't that done by allocate_state? |
|
No, |
|
Alright, calling the setup however also requires calling multipole_electrostatics and multipole_psi, which I just do now with arbitrary point charges that are equal to zero. Seems to work though! |
This PR addresses two minor issues encountered during the self-consistent implementation of ddX.
Initialization in allocate_state
While working on the self-consistent implementation of ddX, we noticed that the initial guesses for the direct and adjoint solutions can be problematic. This was traced back to the
allocate_stateroutine, where variables are allocated but not initialized to zero. This PR adds zero-initialization to the variables.This change should not affect the behavior of ddX.
Jacobi Solver Convergence in ddLPB
During the implementation of ddLPB, we observed that one of the Jacobi solvers in the
lpb_guess_adjointroutine fails to converge after the first SCF iteration. We resolved this by explicitly resettinghsp_guessto zero within theprec_tstarxroutine.This change is not expected to affect ddX, as the
hsp_guessis already set to zero in the beginning, which explains why the first iteration works correctly but not the subsequent ones.