Example #1
0
static void bc_inputrec(const t_commrec *cr, t_inputrec *inputrec)
{
    gmx_bool bAlloc = TRUE;
    int      i;

    block_bc(cr, *inputrec);

    bc_grpopts(cr, &(inputrec->opts));

    /* even if efep is efepNO, we need to initialize to make sure that
     * n_lambda is set to zero */

    snew_bc(cr, inputrec->fepvals, 1);
    if (inputrec->efep != efepNO || inputrec->bSimTemp)
    {
        bc_fepvals(cr, inputrec->fepvals);
    }
    /* need to initialize this as well because of data checked for in the logic */
    snew_bc(cr, inputrec->expandedvals, 1);
    if (inputrec->bExpanded)
    {
        bc_expandedvals(cr, inputrec->expandedvals, inputrec->fepvals->n_lambda);
    }
    snew_bc(cr, inputrec->simtempvals, 1);
    if (inputrec->bSimTemp)
    {
        bc_simtempvals(cr, inputrec->simtempvals, inputrec->fepvals->n_lambda);
    }
    if (inputrec->ePull != epullNO)
    {
        snew_bc(cr, inputrec->pull, 1);
        bc_pull(cr, inputrec->pull);
    }
    if (inputrec->bRot)
    {
        snew_bc(cr, inputrec->rot, 1);
        bc_rot(cr, inputrec->rot);
    }
    if (inputrec->bIMD)
    {
        snew_bc(cr, inputrec->imd, 1);
        bc_imd(cr, inputrec->imd);
    }
    for (i = 0; (i < DIM); i++)
    {
        bc_cosines(cr, &(inputrec->ex[i]));
        bc_cosines(cr, &(inputrec->et[i]));
    }
    if (inputrec->eSwapCoords != eswapNO)
    {
        snew_bc(cr, inputrec->swap, 1);
        bc_swapions(cr, inputrec->swap);
    }
    if (inputrec->bAdress)
    {
        snew_bc(cr, inputrec->adress, 1);
        bc_adress(cr, inputrec->adress);
    }
}
Example #2
0
static void bc_inputrec(const t_commrec *cr, t_inputrec *inputrec)
{
    /* The statement below is dangerous. It overwrites all structures in inputrec.
     * If something is added to inputrec, like efield it will need to be
     * treated here.
     */
    gmx::IInputRecExtension *eptr = inputrec->efield;
    block_bc(cr, *inputrec);
    inputrec->efield = eptr;

    bc_grpopts(cr, &(inputrec->opts));

    /* even if efep is efepNO, we need to initialize to make sure that
     * n_lambda is set to zero */

    snew_bc(cr, inputrec->fepvals, 1);
    if (inputrec->efep != efepNO || inputrec->bSimTemp)
    {
        bc_fepvals(cr, inputrec->fepvals);
    }
    /* need to initialize this as well because of data checked for in the logic */
    snew_bc(cr, inputrec->expandedvals, 1);
    if (inputrec->bExpanded)
    {
        bc_expandedvals(cr, inputrec->expandedvals, inputrec->fepvals->n_lambda);
    }
    snew_bc(cr, inputrec->simtempvals, 1);
    if (inputrec->bSimTemp)
    {
        bc_simtempvals(cr, inputrec->simtempvals, inputrec->fepvals->n_lambda);
    }
    if (inputrec->bPull)
    {
        snew_bc(cr, inputrec->pull, 1);
        bc_pull(cr, inputrec->pull);
    }
    if (inputrec->bRot)
    {
        snew_bc(cr, inputrec->rot, 1);
        bc_rot(cr, inputrec->rot);
    }
    if (inputrec->bIMD)
    {
        snew_bc(cr, inputrec->imd, 1);
        bc_imd(cr, inputrec->imd);
    }
    inputrec->efield->broadCast(cr);
    if (inputrec->eSwapCoords != eswapNO)
    {
        snew_bc(cr, inputrec->swap, 1);
        bc_swapions(cr, inputrec->swap);
    }
}