#include "gromacs/fileio/warninp.h"
#include "gromacs/gmxpreprocess/gpp_atomtype.h"
#include "gromacs/gmxpreprocess/gpp_bond_atomtype.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
#include "gromacs/gmxpreprocess/notset.h"
#include "gromacs/gmxpreprocess/readir.h"
#include "gromacs/gmxpreprocess/topdirs.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/utility/stringutil.h"
-void generate_nbparams(int comb, int ftype, t_params *plist, gpp_atomtype_t atype,
- warninp_t wi)
+void generate_nbparams(int comb, int ftype, t_params *plist, gpp_atomtype *atype,
+ warninp *wi)
{
int i, j, k = -1, nf;
int nr, nrfp;
}
}
-static void realloc_nb_params(gpp_atomtype_t at,
+/*! \brief Used to temporarily store the explicit non-bonded parameter
+ * combinations, which will be copied to t_params. */
+struct t_nbparam
+{
+ //! Has this combination been set.
+ bool bSet;
+ //! The non-bonded parameters
+ real c[4];
+};
+
+static void realloc_nb_params(gpp_atomtype *at,
t_nbparam ***nbparam, t_nbparam ***pair)
{
/* Add space in the non-bonded parameters matrix */
}
}
+int copy_nbparams(t_nbparam **param, int ftype, t_params *plist, int nr)
+{
+ int i, j, f;
+ int nrfp, ncopy;
+
+ nrfp = NRFP(ftype);
+
+ ncopy = 0;
+ for (i = 0; i < nr; i++)
+ {
+ for (j = 0; j <= i; j++)
+ {
+ GMX_RELEASE_ASSERT(param, "Must have valid parameters");
+ if (param[i][j].bSet)
+ {
+ for (f = 0; f < nrfp; f++)
+ {
+ plist->param[nr*i+j].c[f] = param[i][j].c[f];
+ plist->param[nr*j+i].c[f] = param[i][j].c[f];
+ }
+ ncopy++;
+ }
+ }
+ }
+
+ return ncopy;
+}
+
+void free_nbparam(t_nbparam **param, int nr)
+{
+ int i;
+
+ GMX_RELEASE_ASSERT(param, "Must have valid parameters");
+ for (i = 0; i < nr; i++)
+ {
+ GMX_RELEASE_ASSERT(param[i], "Must have valid parameters");
+ sfree(param[i]);
+ }
+ sfree(param);
+}
+
static void copy_B_from_A(int ftype, double *c)
{
int nrfpA, nrfpB, i;
}
}
-void push_at (t_symtab *symtab, gpp_atomtype_t at, t_bond_atomtype bat,
+void push_at (t_symtab *symtab, gpp_atomtype *at, gpp_bond_atomtype *bat,
char *line, int nb_funct,
t_nbparam ***nbparam, t_nbparam ***pair,
- warninp_t wi)
+ warninp *wi)
{
typedef struct {
const char *entry;
int ftype,
bool bAllowRepeat,
const char * line,
- warninp_t wi)
+ warninp *wi)
{
int nr = bt->nr;
int nrfp = NRFP(ftype);
}
void push_bt(Directive d, t_params bt[], int nral,
- gpp_atomtype_t at,
- t_bond_atomtype bat, char *line,
- warninp_t wi)
+ gpp_atomtype *at,
+ gpp_bond_atomtype *bat, char *line,
+ warninp *wi)
{
const char *formal[MAXATOMLIST+1] = {
"%s",
void push_dihedraltype(Directive d, t_params bt[],
- t_bond_atomtype bat, char *line,
- warninp_t wi)
+ gpp_bond_atomtype *bat, char *line,
+ warninp *wi)
{
const char *formal[MAXATOMLIST+1] = {
"%s",
}
-void push_nbt(Directive d, t_nbparam **nbt, gpp_atomtype_t atype,
+void push_nbt(Directive d, t_nbparam **nbt, gpp_atomtype *atype,
char *pline, int nb_funct,
- warninp_t wi)
+ warninp *wi)
{
/* swap the atoms */
const char *form3 = "%*s%*s%*s%lf%lf%lf";
}
void
-push_cmaptype(Directive d, t_params bt[], int nral, gpp_atomtype_t at,
- t_bond_atomtype bat, char *line,
- warninp_t wi)
+push_cmaptype(Directive d, t_params bt[], int nral, gpp_atomtype *at,
+ gpp_bond_atomtype *bat, char *line,
+ warninp *wi)
{
const char *formal = "%s%s%s%s%s%s%s%s%n";
char *resnumberic,
char *resname, char *name, real m0, real q0,
int typeB, char *ctypeB, real mB, real qB,
- warninp_t wi)
+ warninp *wi)
{
int j, resind = 0, resnr;
unsigned char ric;
}
void push_atom(t_symtab *symtab, t_block *cgs,
- t_atoms *at, gpp_atomtype_t atype, char *line, int *lastcg,
- warninp_t wi)
+ t_atoms *at, gpp_atomtype *atype, char *line, int *lastcg,
+ warninp *wi)
{
int nr, ptype;
int cgnumber, atomnr, type, typeB, nscan;
}
void push_molt(t_symtab *symtab, int *nmol, t_molinfo **mol, char *line,
- warninp_t wi)
+ warninp *wi)
{
char type[STRLEN];
int nrexcl, i;
}
static bool default_cmap_params(t_params bondtype[],
- t_atoms *at, gpp_atomtype_t atype,
+ t_atoms *at, gpp_atomtype *atype,
t_param *p, bool bB,
int *cmap_type, int *nparam_def,
- warninp_t wi)
+ warninp *wi)
{
int i, nparam_found;
int ct;
}
static bool default_params(int ftype, t_params bt[],
- t_atoms *at, gpp_atomtype_t atype,
+ t_atoms *at, gpp_atomtype *atype,
t_param *p, bool bB,
t_param **param_def,
int *nparam_def)
void push_bond(Directive d, t_params bondtype[], t_params bond[],
- t_atoms *at, gpp_atomtype_t atype, char *line,
+ t_atoms *at, gpp_atomtype *atype, char *line,
bool bBonded, bool bGenPairs, real fudgeQQ,
bool bZero, bool *bWarn_copy_A_B,
- warninp_t wi)
+ warninp *wi)
{
const char *aaformat[MAXATOMLIST] = {
"%d%d",
}
void push_cmap(Directive d, t_params bondtype[], t_params bond[],
- t_atoms *at, gpp_atomtype_t atype, char *line,
- warninp_t wi)
+ t_atoms *at, gpp_atomtype *atype, char *line,
+ warninp *wi)
{
const char *aaformat[MAXATOMLIST+1] =
{
void push_vsitesn(Directive d, t_params bond[],
t_atoms *at, char *line,
- warninp_t wi)
+ warninp *wi)
{
char *ptr;
int type, ftype, j, n, ret, nj, a;
void push_mol(int nrmols, t_molinfo mols[], char *pline, int *whichmol,
int *nrcopies,
- warninp_t wi)
+ warninp *wi)
{
char type[STRLEN];
}
}
-void push_excl(char *line, gmx::ExclusionBlocks *b2, warninp_t wi)
+void push_excl(char *line, gmx::ExclusionBlocks *b2, warninp *wi)
{
int i, j;
int n;
while (n == 1);
}
-int add_atomtype_decoupled(t_symtab *symtab, gpp_atomtype_t at,
+int add_atomtype_decoupled(t_symtab *symtab, gpp_atomtype *at,
t_nbparam ***nbparam, t_nbparam ***pair)
{
t_atom atom;
plist[F_LJ14].param = nullptr;
}
-static void generate_LJCpairsNB(t_molinfo *mol, int nb_funct, t_params *nbp, warninp_t wi)
+static void generate_LJCpairsNB(t_molinfo *mol, int nb_funct, t_params *nbp, warninp *wi)
{
int n, ntype, i, j, k;
t_atom *atom;
static void decouple_atoms(t_atoms *atoms, int atomtype_decouple,
int couple_lam0, int couple_lam1,
- const char *mol_name, warninp_t wi)
+ const char *mol_name, warninp *wi)
{
int i;
void convert_moltype_couple(t_molinfo *mol, int atomtype_decouple, real fudgeQQ,
int couple_lam0, int couple_lam1,
bool bCoupleIntra, int nb_funct, t_params *nbp,
- warninp_t wi)
+ warninp *wi)
{
convert_pairs_to_pairsQ(mol->plist, fudgeQQ, &mol->atoms);
if (!bCoupleIntra)