Esempio n. 1
0
static void print_rtp(const char *filenm, const char *title, t_atoms *atoms,
                      t_params plist[], gpp_atomtype_t atype, int cgnr[])
{
    FILE *fp;
    int   i, tp;
    char *tpnm;

    fp = gmx_fio_fopen(filenm, "w");
    fprintf(fp, "; %s\n", title);
    fprintf(fp, "\n");
    fprintf(fp, "[ %s ]\n", *atoms->resinfo[0].name);
    fprintf(fp, "\n");
    fprintf(fp, "[ atoms ]\n");
    for (i = 0; (i < atoms->nr); i++)
    {
        tp = atoms->atom[i].type;
        if ((tpnm = get_atomtype_name(tp, atype)) == NULL)
        {
            gmx_fatal(FARGS, "tp = %d, i = %d in print_rtp", tp, i);
        }
        fprintf(fp, "%-8s  %12s  %8.4f  %5d\n",
                *atoms->atomname[i], tpnm,
                atoms->atom[i].q, cgnr[i]);
    }
    print_pl(fp, plist, F_BONDS, "bonds", atoms->atomname);
    print_pl(fp, plist, F_ANGLES, "angles", atoms->atomname);
    print_pl(fp, plist, F_PDIHS, "dihedrals", atoms->atomname);
    print_pl(fp, plist, F_IDIHS, "impropers", atoms->atomname);

    gmx_fio_fclose(fp);
}
Esempio n. 2
0
int main(int argc, char *argv[]){
	int i,j;
	char ch;
	scanf("%d\n",&n);
	for(i=0;i<n;i++){
		for(j=0;j<i;j++){
			scanf("%c",&ch);
			if(ch=='+'){
				p[i].wl[j]=1;
				p[j].wl[i]=0;
			}
			else{
				p[i].wl[j]=0;
				p[j].wl[i]=1;
			}
		}
		scanf("#\n");
	}
	print_pl();	
	for(i=2;i<n;i++){
		if(rec_gr(i)==1){
			print_way();
			return 0;
		}
		printf("----\n");
	}
	return 0;
}