<div dir="ltr">Dear Nicolas,<div><br></div><div>In order to define a coordination number that involves more atoms, just specify the atom's indexes as</div><div>ATOMS_FROM .....</div><div>ATOMS_TO ....</div><div>You can list as many atoms as you like. You can also use KINDS_FROM and KINDS_TO.</div><div><br></div><div>Any combination of collective variables can be defined through the </div><div>COMBINE_COLVAR section. </div><div>In your case it would be the sum of two distances, and you can also use the </div><div>DISTANCE_FUNCTION section.</div><div><br></div><div>Have a look into </div><div><p style="font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 0, 0);"><span style="font-variant-ligatures: no-common-ligatures">tests/SE/regtest-4/6ring4.inp</span></p><p style="font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 0, 0);"><span style="font-variant-ligatures: no-common-ligatures"></span></p><p style="font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 0, 0);"><span style="font-variant-ligatures: no-common-ligatures">tests/Fist/regtest-6/water_3_ddist.inp</span></p><p style="font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 0, 0);"><span style="font-variant-ligatures: no-common-ligatures"> </span></p><p style="font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 0, 0);"><span style="font-variant-ligatures: no-common-ligatures"><br></span></p><p style="font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 0, 0);"><span style="font-variant-ligatures: no-common-ligatures">Regards</span></p><p style="font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 0, 0);">Marcella</p><p style="font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 0, 0);"><br></p><p style="font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 0, 0);"><span style="font-variant-ligatures: no-common-ligatures"><br></span></p></div><div><br></div><div><br></div><div><br>On Tuesday, June 18, 2019 at 4:39:39 AM UTC+2, Nicolás Marcelo Rozas Castro wrote:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">Dear all,<br><br><div>I'm trying to run a metadynamic using as a 
collective variable (CV) the coordination number between two atoms. I 
have two main questions about this:</div><div><br></div>1.- How can I use more than one atom in the coordination number formula?<br><div>2.- How can I write a mathematical expression to use as a CV? For example something like:<img src="https://groups.google.com/group/cp2k/attach/202b1466812f9/Auto%20Generated%20Inline%20Image%201?part=0.1&view=1&authuser=0" alt=""> where <img src="https://groups.google.com/group/cp2k/attach/202b1466812f9/Auto%20Generated%20Inline%20Image%202?part=0.2&view=1&authuser=0" alt=""> is the length of the i-th bond. <br></div><div><br></div><div>Regards<br>Nicolás Rozas Castro<br></div><div><br></div><div><br></div></blockquote></div></div>