readConfAndAtoms(infile, &symtab, &name, &atoms, ePBC, x, v, box);
- init_mtop(mtop);
convertAtomsToMtop(&symtab, put_symtab(&symtab, name), &atoms, mtop);
sfree(name);
}
static void do_mtop(t_fileio *fio, gmx_mtop_t *mtop, gmx_bool bRead,
int file_version)
{
- if (bRead)
- {
- init_mtop(mtop);
- }
do_symtab(fio, &(mtop->symtab), bRead);
do_symstr(fio, &(mtop->name), bRead, &(mtop->symtab));
char buf[STRLEN];
char warn_buf[STRLEN];
- init_mtop(sys);
-
/* TOPOLOGY processing */
sys->name = do_top(bVerbose, topfile, topppfile, opts, bZero, &(sys->symtab),
plist, comb, reppow, fudgeQQ,
struct gmx_cmap_t
{
- int grid_spacing; /* Grid spacing */
- std::vector<gmx_cmapdata_t> cmapdata; /* Lists of grids with actual, pre-interpolated data */
+ int grid_spacing = 0; /* Grid spacing */
+ std::vector<gmx_cmapdata_t> cmapdata; /* Lists of grids with actual, pre-interpolated data */
};
/* TODO: Consider merging functype and iparams, either by storing
* the functype in t_iparams or by putting both in a single class.
*/
- int atnr; /* The number of non-bonded atom types */
- std::vector<t_functype> functype; /* The function type per type */
- std::vector<t_iparams> iparams; /* Force field parameters per type */
- double reppow; /* The repulsion power for VdW: C12*r^-reppow */
- real fudgeQQ; /* The scaling factor for Coulomb 1-4: f*q1*q2 */
- gmx_cmap_t cmap_grid; /* The dihedral correction maps */
+ int atnr = 0; /* The number of non-bonded atom types */
+ std::vector<t_functype> functype; /* The function type per type */
+ std::vector<t_iparams> iparams; /* Force field parameters per type */
+ double reppow = 0.0; /* The repulsion power for VdW: C12*r^-reppow */
+ real fudgeQQ = 0._real; /* The scaling factor for Coulomb 1-4: f*q1*q2 */
+ gmx_cmap_t cmap_grid; /* The dihedral correction maps */
};
enum {
}
-void init_mtop(gmx_mtop_t *mtop)
-{
- mtop->name = nullptr;
-
- // TODO: Move to ffparams when that is converted to C++
- mtop->ffparams.functype.clear();
- mtop->ffparams.iparams.clear();
- mtop->ffparams.cmap_grid.grid_spacing = 0;
- mtop->ffparams.cmap_grid.cmapdata.clear();
-
- mtop->moltype.clear();
- mtop->molblock.clear();
- mtop->bIntermolecularInteractions = FALSE;
- mtop->intermolecular_ilist = nullptr;
-
- mtop->natoms = 0;
- mtop->maxres_renum = 0;
- mtop->maxresnr = -1;
- init_atomtypes(&mtop->atomtypes);
- init_groups(&mtop->groups);
- open_symtab(&mtop->symtab);
-}
-
void init_top(t_topology *top)
{
top->name = nullptr;
gmx_mtop_t::gmx_mtop_t()
{
- init_mtop(this);
+ init_atomtypes(&atomtypes);
+ init_groups(&groups);
+ open_symtab(&symtab);
}
gmx_mtop_t::~gmx_mtop_t()
~gmx_mtop_t();
- char **name; /* Name of the topology */
+ //! Name of the topology.
+ char **name = nullptr;
+ //! Force field parameters used.
gmx_ffparams_t ffparams;
+ //! Vector of different molecule types.
std::vector<gmx_moltype_t> moltype;
+ //! Vector of different molecule blocks.
std::vector<gmx_molblock_t> molblock;
- gmx_bool bIntermolecularInteractions; /* Are there intermolecular
- * interactions? */
- std::unique_ptr<InteractionLists> intermolecular_ilist; /* List of intermolecular interactions
- * using system wide atom indices,
- * either NULL or size F_NRE */
- int natoms;
- int maxres_renum; /* Parameter for residue numbering */
- int maxresnr; /* The maximum residue number in moltype */
- t_atomtypes atomtypes; /* Atomtype properties */
- gmx_groups_t groups; /* Groups of atoms for different purposes */
- t_symtab symtab; /* The symbol table */
- bool haveMoleculeIndices; /* Tells whether we have valid molecule indices */
-
- /* Derived data */
- std::vector<MoleculeBlockIndices> moleculeBlockIndices; /* Indices for each molblock entry for fast lookup of atom properties */
+ //! Are there intermolecular interactions?
+ bool bIntermolecularInteractions = false;
+ /* \brief
+ * List of intermolecular interactions using system wide
+ * atom indices, either NULL or size F_NRE
+ */
+ std::unique_ptr<InteractionLists> intermolecular_ilist = nullptr;
+ //! Number of global atoms.
+ int natoms = 0;
+ //! Parameter for residue numbering.
+ int maxres_renum = 0;
+ //! The maximum residue number in moltype
+ int maxresnr = -1;
+ //! Atomtype properties
+ t_atomtypes atomtypes;
+ //! Groups of atoms for different purposes
+ gmx_groups_t groups;
+ //! The symbol table
+ t_symtab symtab;
+ //! Tells whether we have valid molecule indices
+ bool haveMoleculeIndices = false;
+
+ /* Derived data below */
+ //! Indices for each molblock entry for fast lookup of atom properties
+ std::vector<MoleculeBlockIndices> moleculeBlockIndices;
};
/* The mdrun node-local topology struct, completely written out */
t_symtab symtab; /* The symbol table */
} t_topology;
-void init_mtop(gmx_mtop_t *mtop);
void init_top(t_topology *top);
void done_gmx_groups_t(gmx_groups_t *g);
void done_top(t_topology *top);