<p>Hi Marcella,</p><p>Thank you very much for your helpful reply. Your explanation was very insightful and gave me a much clearer understanding of the issue.</p><p>I now realize that I was focusing too much on the distance between one specific O and one specific H, while the constrained variable in my input is actually the global coordination number defined over all Oh and all H atoms. This was a very important point, and your comment helped me see the problem from the correct perspective.</p><p>Thank you again for your clarification. It was very helpful for me.</p><p>Best regards,<br />Qi Zhang</p><br /><div class="gmail_quote"><div dir="auto" class="gmail_attr">On Saturday, February 28, 2026 at 9:13:11 PM UTC+8 Marcella Iannuzzi wrote:<br/></div><blockquote class="gmail_quote" style="margin: 0 0 0 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi<div><br></div><div>The fact that the distance between one Oh and one  hydrogen increases does not mean that the coordination number is not maintained.</div><div>You should monitor the coordination number not the distance. </div><div>If I understand correctly, the definition of the coordination number in the input considers all the Oh and all the H. The distance between one specific Oh and one specific H is not that relevant.</div><div>Regards</div><div>Marcella<br><br></div><div class="gmail_quote"><div dir="auto" class="gmail_attr">On Saturday, February 28, 2026 at 1:53:54 PM UTC+1 <a href data-email-masked rel="nofollow">zqlea...@gmail.com</a> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><p>Hello CP2K developers and users,</p><p>I am running a constrained MD simulation in CP2K and trying to keep the O–H coordination number (CN) of hydroxyl groups constrained during the trajectory. However, the constraint does not seem to hold as expected.</p><p>My setup is:</p><p>&COLVAR<br>&COORDINATION<br>KINDS_FROM  Oh<br>KINDS_TO    H<br>R_0 [angstrom] 1.25<br>NN  8<br>ND  16<br>&END COORDINATION<br>&END COLVAR</p><p>&CONSTRAINT<br>&COLLECTIVE<br>COLVAR 1<br>INTERMOLECULAR<br>TARGET 0.88<br>&END COLLECTIVE<br>&LAGRANGE_MULTIPLIERS<br>COMMON_ITERATION_LEVELS 1<br>&END<br>&END CONSTRAINT</p><p>My intention is to constrain the O–H CN so that each hydroxyl oxygen keeps its single bonded H during the MD run.</p><p>However, after about 15 ps of simulation, I found from the trajectory analysis that the CN is not actually maintained. Around ~8 ps, some O atoms in OH groups lose their only H, so their O–H CN effectively becomes 0.</p><p>To diagnose this, I checked:</p><ul><li><p>the O–H distances in the OH groups</p></li><li><p>the number of H atoms around each hydroxyl O as a function of time</p></li></ul><p>Both analyses suggest that some hydroxyl O atoms indeed lose their bonded H during the simulation, even though the collective variable is supposed to be constrained.</p><p>My questions are:</p><ol start="1"><li><p>Is this the correct way to constrain an intramolecular O–H coordination number in CP2K?</p></li><li><p>Could the use of <span dir="ltr">INTERMOLECULAR</span> here be incorrect for this purpose?</p></li><li><p>

What should I do to correctly constrain the O–H coordination number to 1?

</p></li></ol><p>

I will attach the figures and the input file showing:

</p><ul><li><p>O–H bond distances vs time</p></li><li><p>the number of H atoms around each hydroxyl O vs time</p></li></ul><p>Any suggestions would be greatly appreciated. Thank you very much for your help.</p><p>Best regards</p><p><img alt="OH_distances_vs_time.png" width="535px" height="321px" src="https://groups.google.com/group/cp2k/attach/9b8eab46f3269/OH_distances_vs_time.png?part=0.2&view=1"><br></p><p><img alt="O_H_count_vs_time.png" width="535px" height="321px" src="https://groups.google.com/group/cp2k/attach/9b8eab46f3269/O_H_count_vs_time.png?part=0.3&view=1"><br></p></blockquote></div></blockquote></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups "cp2k" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:cp2k+unsubscribe@googlegroups.com">cp2k+unsubscribe@googlegroups.com</a>.<br />
To view this discussion visit <a href="https://groups.google.com/d/msgid/cp2k/23bbbffe-03fa-40b5-95b7-5b101f35fe48n%40googlegroups.com?utm_medium=email&utm_source=footer">https://groups.google.com/d/msgid/cp2k/23bbbffe-03fa-40b5-95b7-5b101f35fe48n%40googlegroups.com</a>.<br />