Skip to content

Hold a copy of the external parameter array in each functional instance.

Susi Lehtola requested to merge external_parameters into master

Previously, instances of functionals didn't have copies of the external parameter arrays, which meant that setting parameters by name reset the other parameters. The old system also had other peculiarities that were revealed by the deorbitalized functionals, as in !416 (merged): the initializers used to have extra code to override the setting of the default parameters.

This MR introduces a copy of the external parameter array in each xc_func_type instance. Although this means some redundancy, since the parameter values typically end up being stored elsewhere (through the void *params pointer or the hyb_coeff and hyb_omega entries), it is the path of least effort to ensure that the parameter vectors are consistent. Whenever an external parameters is set, the internal copy of the full array is updated, and the parameter setter is called as before.

Closes #285 (closed) and #286 (closed)

Merge request reports