9 USE ieee_arithmetic,
ONLY: ieee_is_finite
21 REAL(kind=
dp),
DIMENSION(1, 1) :: charges
25 NULLIFY (mixing_store, para_env)
29 ALLOCATE (mixing_store)
30 mixing_store%ncall = 0
31 mixing_store%nbuffer = 4
32 mixing_store%n_simple_mix = 0
33 mixing_store%nskip_mixing = 0
34 mixing_store%alpha = 0.1_dp
35 mixing_store%broy_w0 = 0.01_dp
36 mixing_store%nat_local = 1
37 mixing_store%max_shell = 1
38 ALLOCATE (mixing_store%acharge(1, 1, 4), mixing_store%dacharge(1, 1, 4), &
39 mixing_store%dfbroy(1, 1, 4), mixing_store%ubroy(1, 1, 4), &
40 mixing_store%abroy(4, 4), mixing_store%wbroy(4), mixing_store%atlist(1))
41 mixing_store%acharge = 0.0_dp
42 mixing_store%dacharge = 0.0_dp
43 mixing_store%dfbroy = 0.0_dp
44 mixing_store%ubroy = 0.0_dp
45 mixing_store%abroy = 0.0_dp
46 mixing_store%wbroy = 0.0_dp
47 mixing_store%atlist = 1
55 charges(1, 1) = mixing_store%acharge(1, 1, 2) - mixing_store%dacharge(1, 1, 1)
58 IF (.NOT. all(ieee_is_finite(charges)))
THEN
59 error stop
"Broyden mixing produced non-finite charges for identical residuals"
61 IF (.NOT. all(mixing_store%dfbroy(:, :, 1) == 0.0_dp))
THEN
62 error stop
"Degenerate Broyden direction was not discarded"
66 DEALLOCATE (mixing_store)
Defines the basic variable types.
integer, parameter, public dp
Interface to the message passing library MPI.
subroutine, public mp_world_init(mp_comm)
initializes the system default communicator
subroutine, public mp_world_finalize()
Finalize the system default communicator and MPI when CP2K owns MPI.
subroutine, public charge_mixing(mixing_method, mixing_store, charges, para_env, iter_count, scc_mixer, tblite_mixer_iterations, tblite_mixer_damping, tblite_mixer_memory, tblite_mixer_omega0, tblite_mixer_min_weight, tblite_mixer_max_weight, tblite_mixer_weight_factor)
Driver for TB SCC variable mixing, calls the requested method.
module that contains the definitions of the scf types
integer, parameter, public broyden_mixing_nr
subroutine, public mixing_storage_release(mixing_store)
releases a mixing_storage
program qs_charge_mixing_unittest
stores all the informations relevant to an mpi environment