void generate_nbparams(int comb,
int ftype,
- InteractionTypeParameters *plist,
+ InteractionsOfType *interactions,
PreprocessingAtomTypes *atypes,
warninp *wi)
{
/* Lean mean shortcuts */
nr = atypes->size();
nrfp = NRFP(ftype);
- plist->interactionTypes.clear();
+ interactions->interactionTypes.clear();
std::array<real, MAXFORCEPARAM> forceParam = {NOTSET};
/* Fill the matrix with force parameters */
c = std::sqrt(ci * cj);
forceParam[nf] = c;
}
- plist->interactionTypes.emplace_back(InteractionType({}, forceParam));
+ interactions->interactionTypes.emplace_back(InteractionOfType({}, forceParam));
}
}
break;
forceParam[0] *= -1;
}
forceParam[1] = std::sqrt(ci1*cj1);
- plist->interactionTypes.emplace_back(InteractionType({}, forceParam));
+ interactions->interactionTypes.emplace_back(InteractionOfType({}, forceParam));
}
}
forceParam[0] *= -1;
}
forceParam[1] = std::sqrt(ci1*cj1);
- plist->interactionTypes.emplace_back(InteractionType({}, forceParam));
+ interactions->interactionTypes.emplace_back(InteractionOfType({}, forceParam));
}
}
forceParam[1] = 2.0/(1/bi+1/bj);
}
forceParam[2] = std::sqrt(ci2 * cj2);
- plist->interactionTypes.emplace_back(InteractionType({}, forceParam));
+ interactions->interactionTypes.emplace_back(InteractionOfType({}, forceParam));
}
}
}
/*! \brief Used to temporarily store the explicit non-bonded parameter
- * combinations, which will be copied to InteractionTypeParameters. */
+ * combinations, which will be copied to InteractionsOfType. */
struct t_nbparam
{
//! Has this combination been set.
}
}
-int copy_nbparams(t_nbparam **param, int ftype, InteractionTypeParameters *plist, int nr)
+int copy_nbparams(t_nbparam **param, int ftype, InteractionsOfType *interactions, int nr)
{
int nrfp, ncopy;
{
for (int f = 0; f < nrfp; f++)
{
- plist->interactionTypes[nr*i+j].setForceParameter(f, param[i][j].c[f]);
- plist->interactionTypes[nr*j+i].setForceParameter(f, param[i][j].c[f]);
+ interactions->interactionTypes[nr*i+j].setForceParameter(f, param[i][j].c[f]);
+ interactions->interactionTypes[nr*j+i].setForceParameter(f, param[i][j].c[f]);
}
ncopy++;
}
forceParam[i] = c[i];
}
- InteractionType interactionType({}, forceParam, "");
+ InteractionOfType interactionType({}, forceParam, "");
batype_nr = bondAtomType->addBondAtomType(symtab, btype);
std::equal(a.begin(), a.end(), b.rbegin()));
}
-static void push_bondtype(InteractionTypeParameters *bt,
- const InteractionType &b,
- int nral,
- int ftype,
- bool bAllowRepeat,
- const char *line,
- warninp *wi)
+static void push_bondtype(InteractionsOfType *bt,
+ const InteractionOfType &b,
+ int nral,
+ int ftype,
+ bool bAllowRepeat,
+ const char *line,
+ warninp *wi)
{
int nr = bt->size();
int nrfp = NRFP(ftype);
{
/* fill the arrays up and down */
bt->interactionTypes.emplace_back(
- InteractionType(b.atoms(), b.forceParam(), b.interactionTypeName()));
+ InteractionOfType(b.atoms(), b.forceParam(), b.interactionTypeName()));
/* need to store force values because they might change below */
std::vector<real> forceParam(b.forceParam().begin(), b.forceParam().end());
{
atoms.emplace_back(*oldAtom);
}
- bt->interactionTypes.emplace_back(InteractionType(atoms, forceParam, b.interactionTypeName()));
+ bt->interactionTypes.emplace_back(InteractionOfType(atoms, forceParam, b.interactionTypeName()));
}
}
void push_bt(Directive d,
- gmx::ArrayRef<InteractionTypeParameters> bt,
+ gmx::ArrayRef<InteractionsOfType> bt,
int nral,
PreprocessingAtomTypes *at,
PreprocessingBondAtomType *bondAtomType,
{
forceParam[i] = c[i];
}
- push_bondtype (&(bt[ftype]), InteractionType(atoms, forceParam), nral, ftype, FALSE, line, wi);
+ push_bondtype (&(bt[ftype]), InteractionOfType(atoms, forceParam), nral, ftype, FALSE, line, wi);
}
-void push_dihedraltype(Directive d, gmx::ArrayRef<InteractionTypeParameters> bt,
+void push_dihedraltype(Directive d, gmx::ArrayRef<InteractionsOfType> bt,
PreprocessingBondAtomType *bondAtomType, char *line,
warninp *wi)
{
/* Always use 4 atoms here, since we created two wildcard atoms
* if there wasn't of them 4 already.
*/
- push_bondtype (&(bt[ftype]), InteractionType(atoms, forceParam), 4, ftype, bAllowRepeat, line, wi);
+ push_bondtype (&(bt[ftype]), InteractionOfType(atoms, forceParam), 4, ftype, bAllowRepeat, line, wi);
}
void
push_cmaptype(Directive d,
- gmx::ArrayRef<InteractionTypeParameters> bt,
+ gmx::ArrayRef<InteractionsOfType> bt,
int nral,
PreprocessingAtomTypes *atomtypes,
PreprocessingBondAtomType *bondAtomType,
std::array<real, MAXFORCEPARAM> forceParam = {NOTSET};
/* Push the bond to the bondlist */
- push_bondtype (&(bt[ftype]), InteractionType(atoms, forceParam), nral, ftype, FALSE, line, wi);
+ push_bondtype (&(bt[ftype]), InteractionOfType(atoms, forceParam), nral, ftype, FALSE, line, wi);
}
}
}
-static bool default_nb_params(int ftype, gmx::ArrayRef<InteractionTypeParameters> bt, t_atoms *at,
- InteractionType *p, int c_start, bool bB, bool bGenPairs)
+static bool default_nb_params(int ftype, gmx::ArrayRef<InteractionsOfType> bt, t_atoms *at,
+ InteractionOfType *p, int c_start, bool bB, bool bGenPairs)
{
- int ti, tj, ntype;
- bool bFound;
- InteractionType *pi = nullptr;
- int nr = bt[ftype].size();
- int nral = NRAL(ftype);
- int nrfp = interaction_function[ftype].nrfpA;
- int nrfpB = interaction_function[ftype].nrfpB;
+ int ti, tj, ntype;
+ bool bFound;
+ InteractionOfType *pi = nullptr;
+ int nr = bt[ftype].size();
+ int nral = NRAL(ftype);
+ int nrfp = interaction_function[ftype].nrfpA;
+ int nrfpB = interaction_function[ftype].nrfpB;
if ((!bB && nrfp == 0) || (bB && nrfpB == 0))
{
return bFound;
}
-static bool default_cmap_params(gmx::ArrayRef<InteractionTypeParameters> bondtype,
+static bool default_cmap_params(gmx::ArrayRef<InteractionsOfType> bondtype,
t_atoms *at, PreprocessingAtomTypes *atypes,
- InteractionType *p, bool bB,
+ InteractionOfType *p, bool bB,
int *cmap_type, int *nparam_def,
warninp *wi)
{
/* Returns the number of exact atom type matches, i.e. non wild-card matches,
* returns -1 when there are no matches at all.
*/
-static int natom_match(const InteractionType &pi,
+static int natom_match(const InteractionOfType &pi,
int type_i, int type_j, int type_k, int type_l,
const PreprocessingAtomTypes* atypes)
{
}
}
-static int findNumberOfDihedralAtomMatches(const InteractionType ¤tParamFromParameterArray,
- const InteractionType ¶meterToAdd,
- const t_atoms *at,
- const PreprocessingAtomTypes *atypes,
- bool bB)
+static int findNumberOfDihedralAtomMatches(const InteractionOfType ¤tParamFromParameterArray,
+ const InteractionOfType ¶meterToAdd,
+ const t_atoms *at,
+ const PreprocessingAtomTypes *atypes,
+ bool bB)
{
if (bB)
{
}
}
-static std::vector<InteractionType>::iterator
-defaultInteractionTypeParameters(int ftype, gmx::ArrayRef<InteractionTypeParameters> bt,
- t_atoms *at, PreprocessingAtomTypes *atypes,
- const InteractionType &p, bool bB,
- int *nparam_def)
+static std::vector<InteractionOfType>::iterator
+defaultInteractionsOfType(int ftype, gmx::ArrayRef<InteractionsOfType> bt,
+ t_atoms *at, PreprocessingAtomTypes *atypes,
+ const InteractionOfType &p, bool bB,
+ int *nparam_def)
{
int nparam_found;
int nrfpA = interaction_function[ftype].nrfpA;
-void push_bond(Directive d, gmx::ArrayRef<InteractionTypeParameters> bondtype,
- gmx::ArrayRef<InteractionTypeParameters> bond,
+void push_bond(Directive d, gmx::ArrayRef<InteractionsOfType> bondtype,
+ gmx::ArrayRef<InteractionsOfType> bond,
t_atoms *at, PreprocessingAtomTypes *atypes, char *line,
bool bBonded, bool bGenPairs, real fudgeQQ,
bool bZero, bool *bWarn_copy_A_B,
/* Get force params for normal and free energy perturbation
* studies, as determined by types!
*/
- InteractionType param(atoms, forceParam, "");
+ InteractionOfType param(atoms, forceParam, "");
- std::vector<InteractionType>::iterator foundAParameter = bondtype[ftype].interactionTypes.end();
- std::vector<InteractionType>::iterator foundBParameter = bondtype[ftype].interactionTypes.end();
+ std::vector<InteractionOfType>::iterator foundAParameter = bondtype[ftype].interactionTypes.end();
+ std::vector<InteractionOfType>::iterator foundBParameter = bondtype[ftype].interactionTypes.end();
if (bBonded)
{
- foundAParameter = defaultInteractionTypeParameters(ftype,
- bondtype,
- at,
- atypes,
- param,
- FALSE,
- &nparam_defA);
+ foundAParameter = defaultInteractionsOfType(ftype,
+ bondtype,
+ at,
+ atypes,
+ param,
+ FALSE,
+ &nparam_defA);
if (foundAParameter != bondtype[ftype].interactionTypes.end())
{
/* Copy the A-state and B-state default parameters. */
{
bFoundA = true;
}
- foundBParameter = defaultInteractionTypeParameters(ftype,
- bondtype,
- at,
- atypes,
- param,
- TRUE,
- &nparam_defB);
+ foundBParameter = defaultInteractionsOfType(ftype,
+ bondtype,
+ at,
+ atypes,
+ param,
+ TRUE,
+ &nparam_defB);
if (foundBParameter != bondtype[ftype].interactionTypes.end())
{
/* Copy only the B-state default parameters */
}
}
-void push_cmap(Directive d, gmx::ArrayRef<InteractionTypeParameters> bondtype,
- gmx::ArrayRef<InteractionTypeParameters> bond,
+void push_cmap(Directive d, gmx::ArrayRef<InteractionsOfType> bondtype,
+ gmx::ArrayRef<InteractionsOfType> bond,
t_atoms *at, PreprocessingAtomTypes *atypes, char *line,
warninp *wi)
{
{
atoms.emplace_back(aa[j]-1);
}
- std::array<real, MAXFORCEPARAM> forceParam = {0.0};
- InteractionType param(atoms, forceParam, "");
+ std::array<real, MAXFORCEPARAM> forceParam = {0.0};
+ InteractionOfType param(atoms, forceParam, "");
/* Get the cmap type for this cmap angle */
bFound = default_cmap_params(bondtype, at, atypes, ¶m, FALSE, &cmap_type, &ncmap_params, wi);
-void push_vsitesn(Directive d, gmx::ArrayRef<InteractionTypeParameters> bond,
+void push_vsitesn(Directive d, gmx::ArrayRef<InteractionsOfType> bond,
t_atoms *at, char *line,
warninp *wi)
{
forceParam[0] = nj;
forceParam[1] = weight[j]/weight_tot;
/* Put the values in the appropriate arrays */
- add_param_to_list (&bond[ftype], InteractionType(atoms, forceParam));
+ add_param_to_list (&bond[ftype], InteractionOfType(atoms, forceParam));
}
sfree(atc);
atom.ptype = eptAtom;
std::array<real, MAXFORCEPARAM> forceParam = {0.0};
- nr = at->addType(symtab, atom, "decoupled", InteractionType({}, forceParam, ""), -1, 0);
+ nr = at->addType(symtab, atom, "decoupled", InteractionOfType({}, forceParam, ""), -1, 0);
/* Add space in the non-bonded parameters matrix */
realloc_nb_params(at, nbparam, pair);
return nr;
}
-static void convert_pairs_to_pairsQ(gmx::ArrayRef<InteractionTypeParameters> plist,
+static void convert_pairs_to_pairsQ(gmx::ArrayRef<InteractionsOfType> interactions,
real fudgeQQ, t_atoms *atoms)
{
/* Add the pair list to the pairQ list */
- std::vector<InteractionType> paramnew;
+ std::vector<InteractionOfType> paramnew;
- gmx::ArrayRef<const InteractionType> paramp1 = plist[F_LJ14].interactionTypes;
- gmx::ArrayRef<const InteractionType> paramp2 = plist[F_LJC14_Q].interactionTypes;
+ gmx::ArrayRef<const InteractionOfType> paramp1 = interactions[F_LJ14].interactionTypes;
+ gmx::ArrayRef<const InteractionOfType> paramp2 = interactions[F_LJC14_Q].interactionTypes;
/* Fill in the new F_LJC14_Q array with the old one. NOTE:
it may be possible to just ADD the converted F_LJ14 array
fudgeQQ, atoms->atom[param.ai()].q, atoms->atom[param.aj()].q,
param.c0(), param.c1()
};
- paramnew.emplace_back(InteractionType(param.atoms(), forceParam, ""));
+ paramnew.emplace_back(InteractionOfType(param.atoms(), forceParam, ""));
}
/* now assign the new data to the F_LJC14_Q structure */
- plist[F_LJC14_Q].interactionTypes = paramnew;
+ interactions[F_LJC14_Q].interactionTypes = paramnew;
/* Empty the LJ14 pairlist */
- plist[F_LJ14].interactionTypes.clear();
+ interactions[F_LJ14].interactionTypes.clear();
}
-static void generate_LJCpairsNB(MoleculeInformation *mol, int nb_funct, InteractionTypeParameters *nbp, warninp *wi)
+static void generate_LJCpairsNB(MoleculeInformation *mol, int nb_funct, InteractionsOfType *nbp, warninp *wi)
{
int n, ntype;
t_atom *atom;
nbp->interactionTypes[ntype*atom[i].type+atom[j].type].c0(),
nbp->interactionTypes[ntype*atom[i].type+atom[j].type].c1()
};
- add_param_to_list(&mol->plist[F_LJC_PAIRS_NB], InteractionType(atoms, forceParam));
+ add_param_to_list(&mol->interactions[F_LJC_PAIRS_NB], InteractionOfType(atoms, forceParam));
}
}
}
void convert_moltype_couple(MoleculeInformation *mol, int atomtype_decouple, real fudgeQQ,
int couple_lam0, int couple_lam1,
- bool bCoupleIntra, int nb_funct, InteractionTypeParameters *nbp,
+ bool bCoupleIntra, int nb_funct, InteractionsOfType *nbp,
warninp *wi)
{
- convert_pairs_to_pairsQ(mol->plist, fudgeQQ, &mol->atoms);
+ convert_pairs_to_pairsQ(mol->interactions, fudgeQQ, &mol->atoms);
if (!bCoupleIntra)
{
generate_LJCpairsNB(mol, nb_funct, nbp, wi);