GLYLIB  0.3.0b
load_amber_prmtop.c
Go to the documentation of this file.
00001 /* File load_amber_prmtop.c begun on 20080608 by BLFoley
00002         Purpose:  read amber-style prmtop files into an
00003                 assembly for later use. */
00004 
00005 #include "AMBER/amber_prmtop.h"
00006 
00007 assembly load_amber_prmtop(fileset F){
00008 amber_prmtop *P;
00009 int m,r;
00010 assembly A;
00011 
00012 /* initialize the amber prmtop info */
00013 P=(amber_prmtop *)calloc(1,sizeof(amber_prmtop));
00014 amber_prmtop_init(P); 
00015 
00016 /* load info as-is into sections */
00017 read_amber_prmtop_asis(F,P);
00018 
00019 /* parse sections into a glylib assembly structure */
00020 A=parse_amber_prmtop(P);
00021 
00022 /* Make sure the molecule indexes are all set */
00023 set_assembly_molindexes(&A);
00024 /* Set the non-redundant bonding */
00025 for(m=0;m<A.nm;m++)
00026         {
00027         for(r=0;r<A.m[m][0].nr;r++)
00028                 {
00029                 set_residue_atom_nodes_from_bonds(&A.m[m][0].r[r]);
00030                 }
00031         set_molecule_residue_molbonds(A.m[m]);
00032         set_molecule_residue_nodes_from_bonds(A.m[m]);
00033         set_molecule_atom_nodes_from_bonds(A.m[m]);
00034         }
00035 
00036 return A;
00037 }
 All Classes Files Functions Variables Typedefs Defines