Dear gmx users, I have calculated the bonded distibutions of a polymer melt by writing an analysis tool (template.c). The tool was written in gmx 4.0.7 version.
code snippet **************************************************************************************** * do { /* coordinates are available in the vector fr.x * you can find this and all other structures in * the types directory under the gromacs include dir. * Note how flags determines wheter to read x/v/f! */ for(i = 0; i < top.atoms.nr;) { dist = distance(fr.x[i][XX], fr.x[i + 1][XX],\ fr.x[i][YY], fr.x[i + 1][YY],\ fr.x[i][ZZ], fr.x[i + 1][ZZ]); histogram(dist, &hist_AB[0]); i = i + 9; } } while(read_next_frame(status,&fr)); for(i = 1; i < maxbin; i++) fprintf(fdistAB,"%f %f\n", (i-1)*delr, hist_AB[i]); float distance(float xi, float xj, float yi, float yj, float zi, float zj) { float dist = 0.0; dist = sqrt(pow((xi - xj), 2) + pow((yi - yj), 2) + pow((zi - zj), 2)); return (dist); } int histogram(float dist, float *hist) { int bin = 0; bin = (int)(dist/delr) + 1; if(bin < maxbin) { hist[bin] = hist[bin] + 1; } return 0; } * ************************************************************************************************** Now, I want to import the code to the latest version (4.6.x). I find that the structure of template is different. Can anyone guide me ? Also, I want to implement the following lines in the template. How can this be done? *for(i = 0; i < top.atoms.nr; i++){ fprintf(fw,"ATOM %5d %-4s OW %4d %8.3f%8.3f%8.3f\n",\ i,*(top.atoms.atomname[i]),top.atoms.atom[i].resnr, fr.x[i][XX]*10, fr.x[i][YY]*10, fr.x[i][ZZ]*10); } * Any suggestions would b every helpful. Chandan -- Chandan kumar Choudhury NCL, Pune INDIA -- gmx-users mailing list gmx-users@gromacs.org http://lists.gromacs.org/mailman/listinfo/gmx-users * Please search the archive at http://www.gromacs.org/Support/Mailing_Lists/Search before posting! * Please don't post (un)subscribe requests to the list. Use the www interface or send it to gmx-users-requ...@gromacs.org. * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists