mirror of
https://github.com/TREX-CoE/qmckl.git
synced 2025-01-03 18:16:28 +01:00
Added tests for ee_pot and en_pot. #41
This commit is contained in:
parent
0928f9ea14
commit
4167f2a1c1
@ -1721,6 +1721,7 @@ integer function qmckl_compute_ee_potential_f(context, elec_num, walk_num, &
|
|||||||
info = QMCKL_INVALID_ARG_3
|
info = QMCKL_INVALID_ARG_3
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
print *,"In calc ee_pot\n"
|
||||||
|
|
||||||
ee_pot = 0.0d0
|
ee_pot = 0.0d0
|
||||||
do nw=1,walk_num
|
do nw=1,walk_num
|
||||||
@ -1771,6 +1772,12 @@ end function qmckl_compute_ee_potential_f
|
|||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Test
|
*** Test
|
||||||
|
#+begin_src c :tangle (eval c_test)
|
||||||
|
double ee_pot[walk_num];
|
||||||
|
|
||||||
|
rc = qmckl_get_electron_ee_potential(context, &(ee_pot[0]));
|
||||||
|
assert (rc == QMCKL_SUCCESS);
|
||||||
|
#+end_src
|
||||||
** Electron-nucleus distances
|
** Electron-nucleus distances
|
||||||
|
|
||||||
*** Get
|
*** Get
|
||||||
@ -2617,7 +2624,7 @@ assert (rc == QMCKL_SUCCESS);
|
|||||||
|
|
||||||
where \(\mathcal{V}_{en}\) is the ~en~ potential, \[r_{iA}\] the ~en~
|
where \(\mathcal{V}_{en}\) is the ~en~ potential, \[r_{iA}\] the ~en~
|
||||||
distance and \[Z_A\] is the nuclear charge.
|
distance and \[Z_A\] is the nuclear charge.
|
||||||
|
|
||||||
*** Get
|
*** Get
|
||||||
|
|
||||||
#+begin_src c :comments org :tangle (eval h_func) :noweb yes
|
#+begin_src c :comments org :tangle (eval h_func) :noweb yes
|
||||||
@ -2806,6 +2813,12 @@ end function qmckl_compute_en_potential_f
|
|||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Test
|
*** Test
|
||||||
|
#+begin_src c :tangle (eval c_test)
|
||||||
|
double en_pot[walk_num];
|
||||||
|
|
||||||
|
rc = qmckl_get_electron_en_potential(context, &(en_pot[0]));
|
||||||
|
assert (rc == QMCKL_SUCCESS);
|
||||||
|
#+end_src
|
||||||
|
|
||||||
* End of files :noexport:
|
* End of files :noexport:
|
||||||
|
|
||||||
|
@ -846,6 +846,14 @@ qmckl_exit_code qmckl_provide_potential_energy(qmckl_context context) {
|
|||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rc = qmckl_provide_ee_potential(context);
|
||||||
|
if (rc != QMCKL_SUCCESS) {
|
||||||
|
return qmckl_failwith( context,
|
||||||
|
QMCKL_NOT_PROVIDED,
|
||||||
|
"qmckl_ee_potential",
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
|
|
||||||
rc = qmckl_provide_en_potential(context);
|
rc = qmckl_provide_en_potential(context);
|
||||||
if (rc != QMCKL_SUCCESS) {
|
if (rc != QMCKL_SUCCESS) {
|
||||||
return qmckl_failwith( context,
|
return qmckl_failwith( context,
|
||||||
@ -949,9 +957,9 @@ integer function qmckl_compute_potential_energy_f(context, walk_num, &
|
|||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
e_pot = 0.0d0 + repulsion
|
e_pot = 0.0d0 !+ repulsion
|
||||||
do iwalk = 1, walk_num
|
do iwalk = 1, walk_num
|
||||||
e_pot(iwalk) = e_pot(iwalk) + en_pot(iwalk) + ee_pot(iwalk)
|
e_pot(iwalk) = e_pot(iwalk) + ee_pot(iwalk) !+ en_pot(iwalk)
|
||||||
end do
|
end do
|
||||||
|
|
||||||
end function qmckl_compute_potential_energy_f
|
end function qmckl_compute_potential_energy_f
|
||||||
|
Loading…
Reference in New Issue
Block a user