dftlibs / xcfun

XCFun: A library of exchange-correlation functionals with arbitrary-order derivatives
https://dftlibs.org/xcfun/
Mozilla Public License 2.0
58 stars 32 forks source link

[WIP] Additional overlay for the functional setup. #48

Closed ilfreddy closed 6 years ago

ilfreddy commented 6 years ago

The new routine takes a few integers as input. It combines them with bit manipulations. The final value corresponds to a unique eval xc_vars. Another integer fixes eval xc_mode. The return statement calls the original xc_eval_setup.

I have not tested it yet. Feedback welcome :-)

Still missing:

bast commented 6 years ago

I think this might indeed be more user/library friendly. Comments:

uekstrom commented 6 years ago

The purpose of the (indeed very verbose) enums was to be extremely clear not only of what quantities are expected from the user, but also of the layout of the input and output arrays. Mistakes regarding this layout was a source of some bugs in the past. Then the enum names became too long for some of the meta functionals so I had to abbreviate (2ND_TAYLOR etc).

ilfreddy commented 6 years ago

Thanks for the FB. If you like the concept, let me know

uekstrom commented 6 years ago

if you want me to give explicit values to the enum xc_vars so that they match the respective bits.

This sounds like a good idea, I do not like your shifting where it's hard to see where a bit ends up eventually.

ilfreddy commented 6 years ago

You are right. It was just a lazy implementation. I will try to write a clearer version.