<div dir="ltr">CONSTRAINT X, Y, Z, XY, XZ, YZ under https://manual.cp2k.org/trunk/CP2K_INPUT/MOTION/CELL_OPT.html<br><br>On Monday, June 25, 2018 at 2:16:41 PM UTC-4, Marcelo Carignano wrote:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir="ltr">Hello,<div><br></div><div>I see at the end of cell_opt_utils.F (V 5.1) the code copied below suggesting that different constraints for the box deformation can be defined.</div><div>It is a CASE statement using my_constraint_id as argument.</div><div><br></div><div>How and where can this variable be defined? I do not see how to control this from the input.</div><div>Should I (hard) define constraint_id and recompile?</div><div><br></div><div>Thanks,</div><div><br></div><div>Marcelo.</div><div><br></div><div><p style="font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(207,180,238)"><span>      SELECT CASE (my_constraint_id)</span></p>
<p style="font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(207,180,238)"><span>      CASE (fix_x)</span></p>
<p style="font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(207,180,238)"><span>         gradient(1:2) = 0.0_dp</span></p>
<p style="font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(207,180,238)"><span>         gradient(4) = 0.0_dp</span></p>
<p style="font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(207,180,238)"><span>      CASE (fix_y)</span></p>
<p style="font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(207,180,238)"><span>         gradient(2:3) = 0.0_dp</span></p>
<p style="font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(207,180,238)"><span>         gradient(5) = 0.0_dp</span></p>
<p style="font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(207,180,238)"><span>      CASE (fix_z)</span></p>
<p style="font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(207,180,238)"><span>         gradient(4:6) = 0.0_dp</span></p>
<p style="font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(207,180,238)"><span>      CASE (fix_xy)</span></p>
<p style="font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(207,180,238)"><span>         gradient(1:5) = 0.0_dp</span></p>
<p style="font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(207,180,238)"><span>      CASE (fix_xz)</span></p>
<p style="font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(207,180,238)"><span>         gradient(1:2) = 0.0_dp</span></p>
<p style="font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(207,180,238)"><span>         gradient(4:6) = 0.0_dp</span></p>
<p style="font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(207,180,238)"><span>      CASE (fix_yz)</span></p>
<p style="font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(207,180,238)"><span>         gradient(2:6) = 0.0_dp</span></p>
<p style="font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(207,180,238)"><span>      CASE (fix_none)</span></p>
<p style="font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(207,180,238)"><span>         ! Nothing to do</span></p>
<p style="font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(207,180,238)"><span>      END SELECT</span></p></div><div><span><br></span></div><div><br><br>On Sunday, January 26, 2014 at 1:49:33 PM UTC+3, Florian Schiffmann wrote:<blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<br><br>what Marcella says is correct in an ideal world. In reality there are numerics,... if it happens that your cell changes or you want to be on the save side, you might want to set the cell gradient in the nonperiodic direction to a perfect 0.<br>This can be done in the cell_opt_utils.F at the end of the subroutine get_dg_dh.<br>simply set gradient(n)=0.0_dp (n=1 for x, n=3 for y, n=6 for z as np direction).<br>Recompile and your cell is fixed in that direction. <br><br>Flo<br></div></blockquote></div></div></blockquote></div>