1
0
mirror of https://github.com/TREX-CoE/qmckl.git synced 2024-11-19 12:32:40 +01:00

Added provide local energy.

This commit is contained in:
v1j4y 2022-10-09 00:04:15 +02:00
parent 77d399f460
commit b925cac7e2

View File

@ -177,6 +177,42 @@ typedef struct qmckl_local_energy_struct {
Some values are initialized by default, and are not concerned by
this mechanism.
** Access functions
When all the data for the local energy have been provided, the following
function returns ~true~.
#+begin_src c :comments org :tangle (eval h_func)
bool qmckl_local_energy_provided (const qmckl_context context);
#+end_src
#+begin_src c :comments org :tangle (eval c) :noweb yes :exports none
bool qmckl_local_energy_provided(const qmckl_context context) {
if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
return false;
}
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
qmckl_exit_code rc;
if(!qmckl_electron_provided(context)) return QMCKL_NOT_PROVIDED;
if(!qmckl_nucleus_provided(context)) return QMCKL_NOT_PROVIDED;
rc = qmckl_provide_ao_basis_ao_vgl(context);
if (rc != QMCKL_SUCCESS) return rc;
rc = qmckl_provide_mo_basis_mo_vgl(context);
if (rc != QMCKL_SUCCESS) return rc;
ctx->local_energy.provided = (ctx->local_energy.uninitialized == 0);
return ctx->local_energy.provided;
}
#+end_src
* Computation
** Kinetic energy
:PROPERTIES: