}
/*! \brief Return global topology molecule information for global atom index \p i_gl */
-static void global_atomnr_to_moltype_ind(const gmx_reverse_top_t* rt, int i_gl, int* mb, int* mt, int* mol, int* i_mol)
+static void global_atomnr_to_moltype_ind(ArrayRef<const MolblockIndices> molblockIndices,
+ int i_gl,
+ int* mb,
+ int* mt,
+ int* mol,
+ int* i_mol)
{
- const MolblockIndices* mbi = rt->mbi.data();
+ const MolblockIndices* mbi = molblockIndices.data();
int start = 0;
- int end = rt->mbi.size(); /* exclusive */
+ int end = molblockIndices.size(); /* exclusive */
int mid = 0;
/* binary search for molblock_ind */
gmx_bool bInterMolInteractions,
int ind_start,
int ind_end,
- const gmx_domdec_t* dd,
+ const gmx_ga2la_t& ga2la,
const gmx_domdec_zones_t* zones,
const gmx_molblock_t* molb,
gmx_bool bRCheckMB,
/* The vsite construction goes where the vsite itself is */
if (iz == 0)
{
- add_vsite(*dd->ga2la, index, rtil, ftype, nral, TRUE, i, i_gl, i_mol, iatoms.data(), idef);
+ add_vsite(ga2la, index, rtil, ftype, nral, TRUE, i, i_gl, i_mol, iatoms.data(), idef);
}
}
else
/* Get the global index using the offset in the molecule */
(i_gl + iatoms[2] - i_mol)
: iatoms[2];
- if (const auto* entry = dd->ga2la->find(k_gl))
+ if (const auto* entry = ga2la.find(k_gl))
{
int kz = entry->cell;
if (kz >= zones->n)
/* Get the global index using the offset in the molecule */
(i_gl + iatoms[k] - i_mol)
: iatoms[k];
- const auto* entry = dd->ga2la->find(k_gl);
+ const auto* entry = ga2la.find(k_gl);
if (entry == nullptr || entry->cell >= zones->n)
{
/* We do not have this atom of this interaction
* With thread parallelizing each thread acts on a different atom range:
* at_start to at_end.
*/
-static int make_bondeds_zone(gmx_domdec_t* dd,
+static int make_bondeds_zone(gmx_reverse_top_t* rt,
+ ArrayRef<const int> globalAtomIndices,
+ const gmx_ga2la_t& ga2la,
const gmx_domdec_zones_t* zones,
const std::vector<gmx_molblock_t>& molb,
gmx_bool bRCheckMB,
int mol = 0;
int i_mol = 0;
- gmx_reverse_top_t* rt = dd->reverse_top;
-
const auto ddBondedChecking = rt->options.ddBondedChecking;
int nbonded_local = 0;
for (int i : atomRange)
{
/* Get the global atom number */
- const int i_gl = dd->globalAtomIndices[i];
- global_atomnr_to_moltype_ind(rt, i_gl, &mb, &mt, &mol, &i_mol);
+ const int i_gl = globalAtomIndices[i];
+ global_atomnr_to_moltype_ind(rt->mbi, i_gl, &mb, &mt, &mol, &i_mol);
/* Check all intramolecular interactions assigned to this atom */
gmx::ArrayRef<const int> index = rt->ril_mt[mt].index;
gmx::ArrayRef<const t_iatom> rtil = rt->ril_mt[mt].il;
FALSE,
index[i_mol],
index[i_mol + 1],
- dd,
+ ga2la,
zones,
&molb[mb],
bRCheckMB,
TRUE,
index[i_gl],
index[i_gl + 1],
- dd,
+ ga2la,
zones,
&molb[mb],
bRCheckMB,
}
/*! \brief Set the exclusion data for i-zone \p iz */
-static void make_exclusions_zone(gmx_domdec_t* dd,
+static void make_exclusions_zone(ArrayRef<const int> globalAtomIndices,
+ const gmx_ga2la_t& ga2la,
gmx_domdec_zones_t* zones,
+ ArrayRef<const MolblockIndices> molblockIndices,
const std::vector<gmx_moltype_t>& moltype,
const int* cginfo,
ListOfLists<int>* lexcls,
int at_end,
const gmx::ArrayRef<const int> intermolecularExclusionGroup)
{
- const gmx_ga2la_t& ga2la = *dd->ga2la;
-
const auto& jAtomRange = zones->iZones[iz].jAtomRange;
const gmx::index oldNumLists = lexcls->ssize();
int a_mol = 0;
/* Copy the exclusions from the global top */
- int a_gl = dd->globalAtomIndices[at];
- global_atomnr_to_moltype_ind(dd->reverse_top, a_gl, &mb, &mt, &mol, &a_mol);
+ int a_gl = globalAtomIndices[at];
+ global_atomnr_to_moltype_ind(molblockIndices, a_gl, &mb, &mt, &mol, &a_mol);
const auto excls = moltype[mt].excls[a_mol];
for (const int aj_mol : excls)
{
bool isExcludedAtom = !intermolecularExclusionGroup.empty()
&& std::find(intermolecularExclusionGroup.begin(),
intermolecularExclusionGroup.end(),
- dd->globalAtomIndices[at])
+ globalAtomIndices[at])
!= intermolecularExclusionGroup.end();
if (isExcludedAtom)
{
for (int qmAtomGlobalIndex : intermolecularExclusionGroup)
{
- if (const auto* entry = dd->ga2la->find(qmAtomGlobalIndex))
+ if (const auto* entry = ga2la.find(qmAtomGlobalIndex))
{
exclusionsForAtom.push_back(entry->la);
}
idef_t->clear();
}
- rt->th_work[thread].nbonded = make_bondeds_zone(dd,
+ rt->th_work[thread].nbonded = make_bondeds_zone(rt,
+ dd->globalAtomIndices,
+ *dd->ga2la,
zones,
mtop->molblock,
bRCheckMB,
}
/* No charge groups and no distance check required */
- make_exclusions_zone(
- dd, zones, mtop->moltype, cginfo, excl_t, izone, cg0t, cg1t, mtop->intermolecularExclusionGroup);
+ make_exclusions_zone(dd->globalAtomIndices,
+ *dd->ga2la,
+ zones,
+ rt->mbi,
+ mtop->moltype,
+ cginfo,
+ excl_t,
+ izone,
+ cg0t,
+ cg1t,
+ mtop->intermolecularExclusionGroup);
}
}
GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR