t_graph *mk_graph(FILE *fplog, const t_idef *idef, int at_start, int at_end, gmx_bool bShakeOnly, gmx_bool bSettle) { t_graph *g; snew(g, 1); mk_graph_ilist(fplog, idef->il, at_start, at_end, bShakeOnly, bSettle, g); return g; }
static void low_do_pbc_mtop(FILE *fplog,int ePBC,matrix box, gmx_mtop_t *mtop,rvec x[], bool bFirst) { t_graph *graph; int mb,as,mol; gmx_molblock_t *molb; if (bFirst && fplog) fprintf(fplog,"Removing pbc first time\n"); snew(graph,1); as = 0; for(mb=0; mb<mtop->nmolblock; mb++) { molb = &mtop->molblock[mb]; if (molb->natoms_mol == 1 || (!bFirst && mtop->moltype[molb->type].cgs.nr == 1)) { /* Just one atom or charge group in the molecule, no PBC required */ as += molb->nmol*molb->natoms_mol; } else { /* Pass NULL iso fplog to avoid graph prints for each molecule type */ mk_graph_ilist(NULL,mtop->moltype[molb->type].ilist, 0,molb->natoms_mol,FALSE,FALSE,graph); for(mol=0; mol<molb->nmol; mol++) { mk_mshift(fplog,graph,ePBC,box,x+as); shift_self(graph,box,x+as); /* The molecule is whole now. * We don't need the second mk_mshift call as in do_pbc_first, * since we no longer need this graph. */ as += molb->natoms_mol; } done_graph(graph); } } sfree(graph); }