51 (void)read_tpx((
char *)file.c_str(), &ir, gbox, &natoms,
nullptr,
nullptr,
54 size_t ifirstatom = 0;
56 size_t nmolblock = mtop.molblock.size();
58 for (
size_t iblock = 0; iblock < nmolblock; ++iblock) {
59 gmx_moltype_t *mol = &(mtop.moltype[mtop.molblock[iblock].type]);
61 std::string molname = *(mol->name);
65 t_atoms *atoms = &(mol->atoms);
67 for (
Index i = 0; i < atoms->nres; i++) {
71 for (
Index imol = 0; imol < mtop.molblock[iblock].nmol; ++imol) {
74 size_t natoms_mol = mtop.moltype[mtop.molblock[iblock].type].atoms.nr;
76 for (
size_t iatom = 0; iatom < natoms_mol; iatom++) {
77 t_atom *a = &(atoms->atom[iatom]);
79 std::string bead_type = *(atoms->atomtype[iatom]);
85 bead_type, a->resind + res_offset, a->m, a->q);
88 nm << bead->
getResnr() + 1 - res_offset <<
":"
95 for (
size_t iatom = 0; iatom < natoms_mol; iatom++) {
96 std::list<Bead *> excl_list;
97 gmx::ListOfLists<int> &excl = mol->excls;
98 for (
const Index k : excl[iatom]) {
99 excl_list.push_back(top.
getBead(k + ifirstatom));
135#if GMX_VERSION >= 20260000
136 std::array<int, 2> ftypes = {
137 static_cast<int>(InteractionFunction::Bonds),
138 static_cast<int>(InteractionFunction::Constraints)};
140 std::array<int, 2> ftypes = {F_BONDS, F_CONSTR};
159 for (
int ftype : ftypes) {
160 const InteractionList &ilist = mol->ilist[ftype];
161 Index nratoms = interaction_function[ftype].nratoms;
162 Index stride = nratoms + 1;
163 for (
Index i = 0; i <
Index(ilist.size()); i += stride) {
169 Index atom1 = ilist.iatoms[i + 1];
170 Index atom2 = ilist.iatoms[i + 2];
189 ifirstatom += natoms_mol;
194 for (
Index i = 0; i < 3; i++) {
195 for (
Index j = 0; j < 3; j++) {
196 m(i, j) = gbox[j][i];