Exemplo n.º 1
0
static void enter_function(t_params *p, t_functype ftype, int comb, real reppow,
                           gmx_ffparams_t *ffparams, t_ilist *il,
                           int *maxtypes,
                           gmx_bool bNB, gmx_bool bAppend)
{
    int     k, type, nr, nral, delta, start;

    start = ffparams->ntypes;
    nr    = p->nr;

    for (k = 0; k < nr; k++)
    {
        if (*maxtypes <= ffparams->ntypes)
        {
            *maxtypes += 1000;
            srenew(ffparams->functype, *maxtypes);
            srenew(ffparams->iparams, *maxtypes);
            if (debug)
            {
                fprintf(debug, "%s, line %d: srenewed idef->functype and idef->iparams to %d\n",
                        __FILE__, __LINE__, *maxtypes);
            }
        }
        type = enter_params(ffparams, ftype, p->param[k].c, comb, reppow, start, bAppend);
        /* Type==-1 is used as a signal that this interaction is all-zero and should not be added. */
        if (!bNB && type >= 0)
        {
            nral  = NRAL(ftype);
            delta = nr*(nral+1);
            srenew(il->iatoms, il->nr+delta);
            append_interaction(il, type, nral, p->param[k].a);
        }
    }
}
Exemplo n.º 2
0
static void enter_function(t_params *p, t_functype ftype, int comb, real reppow,
                           gmx_ffparams_t *ffparams, InteractionList *il,
                           bool bNB, bool bAppend)
{
    int     k, type, nr, nral, start;

    start = ffparams->numTypes();
    nr    = p->nr;

    for (k = 0; k < nr; k++)
    {
        type = enter_params(ffparams, ftype, p->param[k].c, comb, reppow, start, bAppend);
        /* Type==-1 is used as a signal that this interaction is all-zero and should not be added. */
        if (!bNB && type >= 0)
        {
            assert(il);
            nral  = NRAL(ftype);
            append_interaction(il, type, nral, p->param[k].a);
        }
    }
}