2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
5 * Copyright (c) 2001-2004, The GROMACS development team.
6 * Copyright (c) 2012,2014, by the GROMACS development team, led by
7 * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
8 * and including many others, as listed in the AUTHORS file in the
9 * top-level source directory and at http://www.gromacs.org.
11 * GROMACS is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public License
13 * as published by the Free Software Foundation; either version 2.1
14 * of the License, or (at your option) any later version.
16 * GROMACS is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with GROMACS; if not, see
23 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
24 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 * If you want to redistribute modifications to GROMACS, please
27 * consider that scientific software is very special. Version
28 * control is crucial - bugs must be traceable. We will be happy to
29 * consider code for inclusion in the official distribution, but
30 * derived work must not be called official GROMACS. Details are found
31 * in the README & COPYING files - if they are missing, get the
32 * official version at http://www.gromacs.org.
34 * To help us fund GROMACS development, we humbly ask that you cite
35 * the research papers on the package. Check out http://www.gromacs.org.
37 #ifndef GMX_TOPOLOGY_ATOMS_H
38 #define GMX_TOPOLOGY_ATOMS_H
40 #include "../utility/basedefinitions.h"
41 #include "../utility/real.h"
50 eptAtom, eptNucleus, eptShell, eptBond, eptVSite, eptNR
52 /* The particle type */
56 real m, q; /* Mass and charge */
57 real mB, qB; /* Mass and charge for Free Energy calc */
58 unsigned short type; /* Atom type */
59 unsigned short typeB; /* Atom type for Free Energy calc */
60 int ptype; /* Particle type */
61 int resind; /* Index into resinfo (in t_atoms) */
62 int atomnumber; /* Atomic Number or NOTSET */
63 char elem[4]; /* Element name */
66 typedef struct t_resinfo
68 char **name; /* Pointer to the residue name */
69 int nr; /* Residue number */
70 unsigned char ic; /* Code for insertion of residues */
71 int chainnum; /* Iincremented at TER or new chain id */
72 char chainid; /* Chain identifier written/read to pdb */
73 char **rtp; /* rtp building block name (optional) */
76 typedef struct t_pdbinfo
78 int type; /* PDB record name */
79 int atomnr; /* PDB atom number */
80 char altloc; /* Alternate location indicator */
81 char atomnm[6]; /* True atom name including leading spaces */
82 real occup; /* Occupancy */
83 real bfac; /* B-factor */
84 gmx_bool bAnisotropic; /* (an)isotropic switch */
85 int uij[6]; /* Anisotropic B-factor */
90 int nr; /* Number of different groups */
91 int *nm_ind; /* Index in the group names */
94 typedef struct t_atoms
96 int nr; /* Nr of atoms */
97 t_atom *atom; /* Array of atoms (dim: nr) */
98 /* The following entries will not */
99 /* always be used (nres==0) */
100 char ***atomname; /* Array of pointers to atom name */
101 /* use: (*(atomname[i])) */
102 char ***atomtype; /* Array of pointers to atom types */
103 /* use: (*(atomtype[i])) */
104 char ***atomtypeB; /* Array of pointers to B atom types */
105 /* use: (*(atomtypeB[i])) */
106 int nres; /* The number of resinfo entries */
107 t_resinfo *resinfo; /* Array of residue names and numbers */
108 t_pdbinfo *pdbinfo; /* PDB Information, such as aniso. Bfac */
111 typedef struct t_atomtypes
113 int nr; /* number of atomtypes */
114 real *radius; /* GBSA radius for each atomtype */
115 real *vol; /* GBSA efective volume for each atomtype */
116 real *surftens; /* implicit solvent surftens for each atomtype */
117 real *gb_radius; /* GB radius for each atom type */
118 real *S_hct; /* Overlap factors for HCT/OBC GB models */
119 int *atomnumber; /* Atomic number, used for QM/MM */
122 #define PERTURBED(a) (((a).mB != (a).m) || ((a).qB != (a).q) || ((a).typeB != (a).type))
124 void init_atom(t_atoms *at);
125 void init_atomtypes(t_atomtypes *at);
126 void done_atom(t_atoms *at);
127 void done_atomtypes(t_atomtypes *at);
129 void init_t_atoms(t_atoms *atoms, int natoms, gmx_bool bPdbinfo);
130 /* allocate memory for the arrays, set nr to natoms and nres to 0
131 * set pdbinfo to NULL or allocate memory for it */
133 t_atoms *copy_t_atoms(t_atoms *src);
134 /* copy an atoms struct from src to a new one */
136 void add_t_atoms(t_atoms *atoms, int natom_extra, int nres_extra);
137 /* allocate extra space for more atoms and or residues */
139 void t_atoms_set_resinfo(t_atoms *atoms, int atom_ind, struct t_symtab *symtab,
140 const char *resname, int resnr, unsigned char ic,
141 int chainnum, char chainid);
142 /* Set the residue name, number, insertion code and chain identifier
143 * of atom index atom_ind.
146 void free_t_atoms(t_atoms *atoms, gmx_bool bFreeNames);
147 /* Free all the arrays and set the nr and nres to 0.
148 * bFreeNames tells if to free the atom and residue name strings,
149 * don't free them if they still need to be used in e.g. the topology struct.