ezpzbz / aiida-catmat

Collection of AiiDA WorkChains Developed in CATMAT project
MIT License
3 stars 1 forks source link

[Feature] Enable possibility of using KSPACING #8

Closed ezpzbz closed 4 years ago

ezpzbz commented 4 years ago

My initial inspection and tests reveals that it is not currently possible at plugin level. Although there is function _need_kp which would check whether kpoints are required to parse, in the base part of calculation plugin there is not exception and it goes for parsing and writing KPOINTS. I need to investigate it in more detail to see if there would be workarounds to avoid modifying the plugin (which seems to me inevitable). However, it is already seen in our workchain and fixing this issue should not be a big deal.

ezpzbz commented 4 years ago

It is fixed now. I opened a PR in aiida-vasp with the fix: https://github.com/aiida-vasp/aiida-vasp/pull/377

Currently, we can use my kspcing branch to have this option available! https://github.com/pzarabadip/aiida-vasp/tree/kspacing

ezpzbz commented 4 years ago

It can be solved in another ways using AiiDA KpointsData object that can be constructed as:

from aiida.plugins import DataFactory
KpointsData = DataFactory('array.kpoints')
KpointsData.set_kpoints_mesh_from_density(distance, offset, force_parity)

Here is the link to the function. I'm leaving it here for later inclusion in our documentation when addressing #14 https://github.com/aiidateam/aiida-core/blob/f2d1e9492ee33304fd197b0c8788896f76abb17d/aiida/orm/nodes/data/array/kpoints.py#L296-L313