-
Notifications
You must be signed in to change notification settings - Fork 7
Added initialization of the variables after allocation #162
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
base: main
Are you sure you want to change the base?
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_state
routine, 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_adjoint
routine fails to converge after the first SCF iteration. We resolved this by explicitly resettinghsp_guess
to zero within theprec_tstarx
routine.This change is not expected to affect ddX, as the
hsp_guess
is already set to zero in the beginning, which explains why the first iteration works correctly but not the subsequent ones.