<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Hi,<br><br>From the code below it seems you have mirrored only the velocities.<br>But if the wall is at w and your particle is at z&lt;w then you also need to do z -= 2*(z-w)<br><br>Berk<br><br><hr id="stopSpelling">Date: Wed, 4 Nov 2009 17:32:08 -0800<br>Subject: Re: [gmx-users] Setting up an infinitely hard wall<br>From: kgp.amit@gmail.com<br>To: gmx-users@gromacs.org<br><br>Hi Everyone,<div><br></div><div>So i did set up the velocity mirror as described in the previous email.&nbsp;</div><div><br></div><div>I did few more standard calculations on water with the velocity mirror on and compared with the past results obtained when done with other force field &amp; package. The results seem to be convincing. In all, the thing did work out.</div>
<div><br></div><div>Thank you everyone and specially Berk for this.</div><div><br></div><div>Amit</div><div><br></div><div><br></div><div><br><br><div class="ecxgmail_quote">On Fri, Oct 30, 2009 at 4:54 PM, Amit Choubey <span dir="ltr">&lt;<a href="mailto:kgp.amit@gmail.com">kgp.amit@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="ecxgmail_quote" style="border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi Berk,<div><br></div><div>I am mailing about the issue of setting up infinite potential well.&nbsp;</div><div><br></div><div>
I now want to simplify the task of inversing the velocity and mirroring the particle by the following procedure. If a particle is found in z&lt;delta then i only change the z-component of the velocity v_z to mod(v_z) . This kind of mimic's a mirror at z=0 for the velocities. This way, i wont have to worry about the constraints because i never touch the co-ordinates of the particles. I also think that this would work fine with pbc = xyz .&nbsp;</div>

<div><br></div><div>Now i present the part&nbsp;(do_update_md)<span style="font-family: Monaco; font-size: 10px;"><span style="font-family: arial; font-size: small;">&nbsp;of update.c that has to be changed. The bold lines are the ones that i included</span></span></div>

<div><br></div><div><p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;"><span style="color: rgb(170, 13, 145);">static</span> <span style="color: rgb(170, 13, 145);">void</span> do_update_md(<span style="color: rgb(170, 13, 145);">int</span> start,<span style="color: rgb(170, 13, 145);">int</span> homenr,<span style="color: rgb(170, 13, 145);">double</span> dt,</p>


<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; t_grp_tcstat *tcstat,t_grp_acc *gstat,real nh_xi[],</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rvec accel[],ivec nFreeze[],real invmass[],</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: rgb(170, 13, 145);">unsigned</span> <span style="color: rgb(170, 13, 145);">short</span> ptype[],<span style="color: rgb(170, 13, 145);">unsigned</span> <span style="color: rgb(170, 13, 145);">short</span> cFREEZE[],</p>


<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: rgb(170, 13, 145);">unsigned</span> <span style="color: rgb(170, 13, 145);">short</span> cACC[],<span style="color: rgb(170, 13, 145);">unsigned</span> <span style="color: rgb(170, 13, 145);">short</span> cTC[],</p>


<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rvec x[],rvec xprime[],rvec v[],</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rvec f[],matrix M,bool bExtended)</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">{</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; <span style="color: rgb(170, 13, 145);">double</span> imass,w_dt;</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; <span style="color: rgb(170, 13, 145);">int</span>&nbsp; &nbsp; gf=<span style="color: rgb(28, 0, 207);">0</span>,ga=<span style="color: rgb(28, 0, 207);">0</span>,gt=<span style="color: rgb(28, 0, 207);">0</span>;</p>


<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; rvec &nbsp; vrel;</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; real &nbsp; vn,vv,va,vb,vnrel;</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; real &nbsp; lg,xi,u;</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; <span style="color: rgb(170, 13, 145);">int</span>&nbsp; &nbsp; n,d;</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; min-height: 14px;"><br></p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; <span style="color: rgb(170, 13, 145);">if</span>(bExtended) {</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; color: rgb(0, 116, 0);"><span style="color: rgb(0, 0, 0);">&nbsp; &nbsp; </span>/* Update with coupling to extended ensembles, used for</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; color: rgb(0, 116, 0);">&nbsp;&nbsp; &nbsp; * Nose-Hoover and Parrinello-Rahman coupling</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; color: rgb(0, 116, 0);">&nbsp;&nbsp; &nbsp; * Nose-Hoover uses the reversible leap-frog integrator from</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; color: rgb(0, 116, 0);">&nbsp;&nbsp; &nbsp; * Holian et al. Phys Rev E 52(3) : 2338, 1995</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; color: rgb(0, 116, 0);">&nbsp;&nbsp; &nbsp; */</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; &nbsp; <span style="color: rgb(170, 13, 145);">for</span>(n=start; n&lt;start+homenr; n++) {</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; &nbsp; &nbsp; imass = invmass[n];</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; &nbsp; &nbsp; <span style="color: rgb(170, 13, 145);">if</span> (cFREEZE)</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;"><span style="white-space: pre;">        </span>gf &nbsp; = cFREEZE[n];</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; &nbsp; &nbsp; <span style="color: rgb(170, 13, 145);">if</span> (cACC)</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;"><span style="white-space: pre;">        </span>ga &nbsp; = cACC[n];</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; &nbsp; &nbsp; <span style="color: rgb(170, 13, 145);">if</span> (cTC)</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;"><span style="white-space: pre;">        </span>gt &nbsp; = cTC[n];</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; &nbsp; &nbsp; lg &nbsp; = tcstat[gt].lambda;</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; &nbsp; &nbsp; xi &nbsp; = nh_xi[gt];</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; min-height: 14px;"><br></p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; &nbsp; &nbsp; rvec_sub(v[n],gstat[ga].u,vrel);</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; min-height: 14px;"><br></p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; &nbsp; &nbsp; <span style="color: rgb(170, 13, 145);">for</span>(d=<span style="color: rgb(28, 0, 207);">0</span>; d&lt;DIM; d++) {</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: rgb(170, 13, 145);">if</span>((ptype[n] != eptVSite) &amp;&amp; (ptype[n] != eptShell) &amp;&amp; !nFreeze[gf][d]) {</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; vnrel = lg*(vrel[d] + dt*(imass*f[n][d] - <span style="color: rgb(28, 0, 207);">0.5</span>*xi*vrel[d]</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;"><span style="white-space: pre;">                                </span>&nbsp; &nbsp; - iprod(M[d],vrel)))/(<span style="color: rgb(28, 0, 207);">1</span> + <span style="color: rgb(28, 0, 207);">0.5</span>*xi*dt); &nbsp;</p>

<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; color: rgb(0, 116, 0);"><span style="color: rgb(0, 0, 0);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span>/* do not scale the mean velocities u */</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; vn &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = gstat[ga].u[d] + accel[ga][d]*dt + vnrel;&nbsp;</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; v[n][d]&nbsp; &nbsp; &nbsp; &nbsp; = vn;</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xprime[n][d] &nbsp; = x[n][d]+vn*dt;</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; &nbsp; &nbsp; &nbsp; } <span style="color: rgb(170, 13, 145);">else</span> {</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;"><span style="white-space: pre;">        </span>&nbsp; v[n][d]&nbsp; &nbsp; &nbsp; &nbsp; = <span style="color: rgb(28, 0, 207);">0.0</span>;</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xprime[n][d] &nbsp; = x[n][d];</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;"><span style="white-space: pre;">        </span>}</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; &nbsp; &nbsp; }</p><p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;"><b>if(xprime[n][2] &lt; delta) if(v[n][2] &lt; 0) v[n][2] = -v[n][2];</b>&nbsp;</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; &nbsp; }</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; min-height: 14px;"><br></p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; } <span style="color: rgb(170, 13, 145);">else</span> {</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; color: rgb(0, 116, 0);"><span style="color: rgb(0, 0, 0);">&nbsp; &nbsp; </span>/* Classic version of update, used with berendsen coupling */</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; &nbsp; <span style="color: rgb(170, 13, 145);">for</span>(n=start; n&lt;start+homenr; n++) {</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; &nbsp; &nbsp; w_dt = invmass[n]*dt;</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; &nbsp; &nbsp; <span style="color: rgb(170, 13, 145);">if</span> (cFREEZE)</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;"><span style="white-space: pre;">        </span>gf &nbsp; = cFREEZE[n];</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; &nbsp; &nbsp; <span style="color: rgb(170, 13, 145);">if</span> (cACC)</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;"><span style="white-space: pre;">        </span>ga &nbsp; = cACC[n];</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; &nbsp; &nbsp; <span style="color: rgb(170, 13, 145);">if</span> (cTC)</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;"><span style="white-space: pre;">        </span>gt &nbsp; = cTC[n];</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; &nbsp; &nbsp; lg &nbsp; = tcstat[gt].lambda;</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; min-height: 14px;"><br></p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; &nbsp; &nbsp; <span style="color: rgb(170, 13, 145);">for</span>(d=<span style="color: rgb(28, 0, 207);">0</span>; d&lt;DIM; d++) {</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; &nbsp; &nbsp; &nbsp; vn &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = v[n][d];</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; min-height: 14px;"><br></p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: rgb(170, 13, 145);">if</span>((ptype[n] != eptVSite) &amp;&amp; (ptype[n] != eptShell) &amp;&amp; !nFreeze[gf][d]) {</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; vv &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = lg*(vn + f[n][d]*w_dt);</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; min-height: 14px;"><br></p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; color: rgb(0, 116, 0);"><span style="color: rgb(0, 0, 0);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span>/* do not scale the mean velocities u */</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; u&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = gstat[ga].u[d];</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; va &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = vv + accel[ga][d]*dt;</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; vb &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = va + (<span style="color: rgb(28, 0, 207);">1.0</span>-lg)*u;</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; v[n][d]&nbsp; &nbsp; &nbsp; &nbsp; = vb;</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xprime[n][d] &nbsp; = x[n][d]+vb*dt;</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; &nbsp; &nbsp; &nbsp; } <span style="color: rgb(170, 13, 145);">else</span> {</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; v[n][d]&nbsp; &nbsp; &nbsp; &nbsp; = <span style="color: rgb(28, 0, 207);">0.0</span>;</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xprime[n][d] &nbsp; = x[n][d];</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; &nbsp; &nbsp; &nbsp; }</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; &nbsp; &nbsp; }</p><p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;"><b>if(xprime[n][2] &lt; delta) if(v[n][2] &lt; 0) v[n][2] = -v[n][2];</b>&nbsp;</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; &nbsp; }</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp; }</p>
<p style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">}</p><div><font face="Monaco" size="2"><span style="font-size: 10px;"><br></span></font></div></div><div><br>
</div><div>I assume that xprime[n][2] and v[n][2] refer to the z-components of position and velocity. xprime means the new co-ordinates. Do you think this change is enough to implement the stuff i was talking about? I must acknowledge that i have very little knowledge about the gromacs codes and my views might be very short sighted. So, please do let me know any of the shortcomings that you notice.&nbsp;</div>

<div><br></div><div>If everything is fine with the above, could you also suggest me how to recompile everything.&nbsp;</div><div><br></div><div>I cannot thank you all enough for helping me out.</div><div><br></div><font color="#888888"><div>
Amit</div></font><div><div></div><div class="h5">
<div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br><div class="ecxgmail_quote">On Fri, Oct 23, 2009 at 1:09 AM, Berk Hess <span dir="ltr">&lt;<a href="mailto:gmx3@hotmail.com">gmx3@hotmail.com</a>&gt;</span> wrote:<br>

<blockquote class="ecxgmail_quote" style="border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">



<div>
Hi,<br><br>If you have a wall potential, you can reweight the configurations<br>with weight 0 if one or more particles are beyond the wall<br>and exp(Vwall/kT) if no particles are beyond the wall.<br>This will only work efficiently if you choose the wall potential in a smart way.<br>

I managed to get an efficiency of 70%.<br><br>If you have constraints, an atom that goes beyond the wall is directly<br>coupled to the atoms it is constrained to. You will have to work out<br>the equations for such a situation. It might be as simple that you can<br>

just correct x and v for the atom that went beyond the wall and then<br>apply the constraints as normal.<br><br>Berk<br><br><hr>Date: Fri, 23 Oct 2009 00:26:08 -0700<br>Subject: Re: [gmx-users] Setting up an infinitely hard wall<div>

<div></div><div><br>From: <a href="mailto:kgp.amit@gmail.com">kgp.amit@gmail.com</a><br>To: <a href="mailto:gmx-users@gromacs.org">gmx-users@gromacs.org</a><br><br>Hi Berk,<div><br>
</div><div>Thank you for the response.<br><br><div><blockquote style="padding-left: 1ex;"><div>I have obtained distributions with in infinite wall by simulating with an softer wall<br>


and unbiasing with configurations with the wall potential.<br></div></blockquote><div><br></div><div>Could you explain the above ? I am not sure if i get your point.</div><div>&nbsp;</div><blockquote style="padding-left: 1ex;">


<div>But if you need the dynamics, or you want less hassle during the simulation,<br>you will have to do a bit more effort in coding an infinitely hard wall.<br><br>You will not only have to inverse the velocity, but also mirror the position<br>


of the particle in the wall. </div></blockquote><div><br></div><div>That's true. I am sorry i didnt mention that.</div><div>&nbsp;</div><blockquote style="padding-left: 1ex;">
<div>This should on require a few lines of code in do_update_md<br>in src/mdlib/update.c.<br></div></blockquote><div><br></div><div>Great, I will try this as soon as possible.&nbsp;</div><blockquote style="padding-left: 1ex;">


<div><br>Note that this will only work easily when you do not have constraints present.<br>With constraints things get much more complicated.<br></div></blockquote><div><br></div><div>I do have constraints present. Thank you for pointing this. I am working with SPC water and I should, in principle be able to figure out the co-ordinates of all atoms in the molecule if I am given one of the water's atom's co-ordinate. Does that sound ok?</div>


<div><br></div><div>Thanks for the input again,</div><div>Amit</div><div>&nbsp;</div><blockquote style="padding-left: 1ex;"><div><br>Berk<br><br><hr>Date: Thu, 22 Oct 2009 14:34:06 -0700<br>


From: <a href="mailto:kgp.amit@gmail.com">kgp.amit@gmail.com</a><br>To: <a href="mailto:gmx-users@gromacs.org">gmx-users@gromacs.org</a><br>Subject: [gmx-users] Setting up an infinitely hard wall<div>


<div></div><div><br><br><div>Hi everyone,</div><div><br></div><div>I am sending this email again hoping for any quick input for my question.</div><div><br></div><div>
<br></div><div><div><br></div><div>I have been trying to set up an "infinitely" hard potential wall.&nbsp;</div><div><br></div><div>I tried to use the available wall options and could not really get it to do what i needed. I wanted a steep repulsive potential but when i created that, the system was blowing up, reason being that it requires smaller time step and i cant afford to have smaller time step.&nbsp;</div>




<div><br></div><div>My idea to overcome this issue is to just reverse the velocity of the particle whenever it hits the wall. I am not sure if there is any thing in GROMACS which does this but any suggestions will be very helpful.</div>




<div><br></div><div>If there is nothing set up for something like above, i would like to play around with the code to figure it out. If this is the case, could somebody direct me to a starting point.</div><div><br></div>



<div>
Thank you&nbsp;</div><div>Amit</div>
</div><br>                                               <br></div></div><hr>New Windows 7: Find the right PC for you. <a href="http://windows.microsoft.com/shop">Learn more.</a></div>
<br>_______________________________________________<br>
gmx-users mailing list &nbsp; &nbsp;<a href="mailto:gmx-users@gromacs.org">gmx-users@gromacs.org</a><br>
<a href="http://lists.gromacs.org/mailman/listinfo/gmx-users">http://lists.gromacs.org/mailman/listinfo/gmx-users</a><br>
Please search the archive at <a href="http://www.gromacs.org/search">http://www.gromacs.org/search</a> before posting!<br>
Please don't post (un)subscribe requests to the list. Use the<br>
www interface or send it to <a href="mailto:gmx-users-request@gromacs.org">gmx-users-request@gromacs.org</a>.<br>
Can't post? Read <a href="http://www.gromacs.org/mailing_lists/users.php">http://www.gromacs.org/mailing_lists/users.php</a><br></blockquote></div><br></div>                                               <br></div></div><div>
<hr>Express yourself instantly with MSN Messenger! <a href="http://clk.atdmt.com/AVE/go/onm00200471ave/direct/01/">MSN Messenger</a></div></div>
<br>_______________________________________________<br>
gmx-users mailing list &nbsp; &nbsp;<a href="mailto:gmx-users@gromacs.org">gmx-users@gromacs.org</a><br>
<a href="http://lists.gromacs.org/mailman/listinfo/gmx-users">http://lists.gromacs.org/mailman/listinfo/gmx-users</a><br>
Please search the archive at <a href="http://www.gromacs.org/search">http://www.gromacs.org/search</a> before posting!<br>
Please don't post (un)subscribe requests to the list. Use the<br>
www interface or send it to <a href="mailto:gmx-users-request@gromacs.org">gmx-users-request@gromacs.org</a>.<br>
Can't post? Read <a href="http://www.gromacs.org/mailing_lists/users.php">http://www.gromacs.org/mailing_lists/users.php</a><br></blockquote></div><br></div>
</div></div></blockquote></div><br></div>                                               <br /><hr />Express yourself instantly with MSN Messenger! <a href='http://clk.atdmt.com/AVE/go/onm00200471ave/direct/01/' target='_new'>MSN Messenger</a></body>
</html>