<br><br>----- Original Message -----<br>From: 聂雪川 &lt;niexuechuan@163.com&gt;<br>Date: Wednesday, June 23, 2010 18:29<br>Subject: [gmx-users] Problem of reading the atom'force from trr file using template.c<br>To: gmx-users@gromacs.org<br><br> <span><p> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <meta content="MSHTML 6.00.2900.5969" name="GENERATOR"> <style></style> <table><tbody><tr><td bgcolor="#c5e4cd"><p> </p><div><font size="2"><font size="3"><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>Dear all,</font><br><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>&nbsp;&nbsp; </font>I am  trying&nbsp; to analysis the force of a atom.So I change "fr.x[n][XX]" to  "fr.f[n][XX]" in the template.c .But it turns up "Segmentation fault" .(The  pointer "fr.f" is NULL) How could I get the force?<br><br>You need to supply a trajectory that has forces, and then make the program read the forces (probably with -force on the command line). Alternatively, work through how the trajectory reading code works, and see how to set the flags to make them read forces.<br><br>Mark<br><br></div> <div><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>&nbsp;</div> <div><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>My mdp file:</div> <div><font size="2"></font><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>&nbsp;</div> <div><font size="2"><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>title&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  =&nbsp;  Yo<br><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>cpp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  =&nbsp;  /usr/bin/cpp<br><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>constraints&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  =&nbsp;  all-bonds<br><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>integrator&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  =&nbsp;  md<br><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>dt&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  =&nbsp; 0.002&nbsp;; ps  !<br><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>nsteps&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  =&nbsp; 2500000&nbsp;; total 5ns.<br><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>comm_mode&nbsp;&nbsp;&nbsp;&nbsp; =  NonE<br><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>nstcomm&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  =&nbsp;  <br><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>nstxout&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  =&nbsp;  50<br><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>nstvout&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  =&nbsp;  0<br><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>nstfout&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  =&nbsp;  50<br><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>nstxtcout&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  =&nbsp;  0&nbsp;<br><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>nstlog&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  =&nbsp;  5000<br><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>nstenergy&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  =&nbsp;  5000<br><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>nstlist&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  =&nbsp;  10<br><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>ns_type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  =&nbsp;  grid<br><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>coulombtype&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  =PME<br><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>rlist&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  =&nbsp;  1.4<br><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>rcoulomb&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  =&nbsp;  1.4<br><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>rvdw&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  =&nbsp;  1.4<br><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>pbc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  =&nbsp; xyz<br><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>; Berendsen temperature coupling is on in two  groups<br><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>Tcoupl&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  =&nbsp;  berendsen<br><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>tc-grps&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   =&nbsp; CNT  SOL&nbsp;<br><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>tau_t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  =&nbsp; 0.1&nbsp;0.1 </font></div> <div><font size="2"><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>ref_t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  =&nbsp; 300 300 <br><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>; Energy  monitoring<br><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>energygrps&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  =&nbsp; CNT SOL<br><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>; Non-equilibrium MD</font></div> <div><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>&nbsp;</div> <div><font size="2"><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>freezegrps&nbsp;&nbsp;&nbsp;&nbsp;  =&nbsp;CNP&nbsp;&nbsp;<br><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>freezedim&nbsp;&nbsp;&nbsp;&nbsp; =&nbsp; Y Y  Y&nbsp;&nbsp;&nbsp; <br><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>; Isotropic pressure coupling is now  on<br><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>Pcoupl&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  =&nbsp; no<br><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>;Pcoupltype&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  =  isotropic<br><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>;tau_p&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  =&nbsp; 0.5<br><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>;compressibility&nbsp;&nbsp;&nbsp;&nbsp; =&nbsp;  4.5e-5<br><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>;ref_p&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  =&nbsp; 1.0<br><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>; Generate velocites is off at 300  K.<br><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>gen_vel&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  =&nbsp;  no<br><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>gen_temp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  =&nbsp;  300.0<br><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>gen_seed&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  =&nbsp; 537129</font></div> <div><font size="2"></font><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>&nbsp;</div> <div><font size="2"></font><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>&nbsp;</div> <div><font size="2"><font size="3"><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>Many thanks in advance,<br><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font>Chuan</font></font></div> <div><font size="2"><font style="font-style: normal; font-weight: normal; background-color: rgb(245, 248, 240); font-size: 14px;">&gt; </font><br></font></div><font size="2"></font></td></tr></tbody></table></p></span> &gt; -- <br>&gt; gmx-users mailing list&nbsp;&nbsp;&nbsp; gmx-users@gromacs.org<br>&gt; http://lists.gromacs.org/mailman/listinfo/gmx-users<br>&gt; Please search the archive at http://www.gromacs.org/search <br>&gt; before posting!<br>&gt; Please don't post (un)subscribe requests to the list. Use the <br>&gt; www interface or send it to gmx-users-request@gromacs.org.<br>&gt; Can't post? Read http://www.gromacs.org/mailing_lists/users.php