colvars icon indicating copy to clipboard operation
colvars copied to clipboard

Is it possible to write grid files using the maximal available precision?

Open HanatoK opened this issue 2 years ago • 5 comments

Sometimes if I get a grad file like https://gist.github.com/HanatoK/cc03687d55caa6c9a730a3a01ef1de06, then it is not able to integrate by abf_integrate. The error message is:

ERROR: wrong coordinates in gradient file
Expected -12.1756, got -12.1755

Is it possible to increase the precision of grid files? I realize this may increase the file size, but can we use an option to specify the output precision?

HanatoK avatar Aug 11 '22 16:08 HanatoK

Can you try just relaxing the test criterion slightly - in abf_data.cpp, replace lines 112-113 with:

            double diff = mins[j] + widths[j] * (pos[j] + 0.5) - xi;
            if ( diff * diff > 1e-7 )  {

I'm quite sure this is enough to catch the mistakes it is intended to detect.

jhenin avatar Aug 12 '22 11:08 jhenin

Independently from that, maybe your needs would be covered by the poisson_integrator program under colvartools?

jhenin avatar Aug 12 '22 11:08 jhenin

Independently from that, maybe your needs would be covered by the poisson_integrator program under colvartools?

@jhenin Thanks a lot! I have already tuned the parameters and rerun the simulation, so now abf_integrate works fine. The reason why I do not want to use the pABF integrator is due to the artifacts near the boundaries, and my metastable states are just lying at the boundaries.

HanatoK avatar Aug 12 '22 15:08 HanatoK

The reason why I do not want to use the pABF integrator is due to the artifacts near the boundaries, and my metastable states are just lying at the boundaries.

I want to improve the integrator to avoid such artifacts. Can you send me separately an example of gradient data that is not integrated correctly? Thanks!

jhenin avatar Aug 12 '22 16:08 jhenin

@jhenin Hi, I have sent the files to your email address at ibpc.fr. Thanks!

HanatoK avatar Aug 14 '22 13:08 HanatoK

Fixed by 6a7f38554e700e780c261e327a51e91468a9c5e4

jhenin avatar Sep 01 '22 20:09 jhenin

@jhenin https://github.com/Colvars/colvars/commit/6a7f38554e700e780c261e327a51e91468a9c5e4 does not solve the issue completely, please see the files in https://gist.github.com/HanatoK/f4d17f914d1bc81b272879fe7ebec669. I just created a PR to use the same precision as the colvars.traj file.

HanatoK avatar Sep 12 '22 08:09 HanatoK

Solved by #497

HanatoK avatar Sep 26 '22 09:09 HanatoK