Esempio n. 1
0
t_pbc *set_pbc_dd(t_pbc *pbc, int ePBC,
                  const ivec domdecCells,
                  gmx_bool bSingleDir, const matrix box)
{
    if (ePBC == epbcNONE)
    {
        pbc->ePBC = ePBC;

        return NULL;
    }

    if (nullptr == domdecCells)
    {
        low_set_pbc(pbc, ePBC, NULL, box);
    }
    else
    {
        if (ePBC == epbcSCREW && domdecCells[XX] > 1)
        {
            /* The rotation has been taken care of during coordinate communication */
            ePBC = epbcXYZ;
        }

        ivec usePBC;
        int  npbcdim = 0;
        for (int i = 0; i < DIM; i++)
        {
            usePBC[i] = 0;
            if (domdecCells[i] <= (bSingleDir ? 1 : 2) &&
                !(ePBC == epbcXY && i == ZZ))
            {
                usePBC[i] = 1;
                npbcdim++;
            }
        }

        if (npbcdim > 0)
        {
            low_set_pbc(pbc, ePBC, usePBC, box);
        }
        else
        {
            pbc->ePBC = epbcNONE;
        }
    }

    return (pbc->ePBC != epbcNONE ? pbc : NULL);
}
Esempio n. 2
0
t_pbc *set_pbc_dd(t_pbc *pbc,int ePBC,
                  gmx_domdec_t *dd,gmx_bool bSingleDir,matrix box)
{
    ivec nc2;
    int  npbcdim,i;

    if (dd == NULL) {
        npbcdim = DIM;
    } else {
        if (ePBC == epbcSCREW && dd->nc[XX] > 1) {
            /* The rotation has been taken care of during coordinate communication */
            ePBC = epbcXYZ;
        }
        npbcdim = 0;
        for(i=0; i<DIM; i++) {
            if (dd->nc[i] <= (bSingleDir ? 1 : 2)) {
                nc2[i] = 1;
                if (!(ePBC == epbcXY && i == ZZ))
                    npbcdim++;
            } else {
                nc2[i] = dd->nc[i];
            }
        }
    }

    if (npbcdim > 0)
        low_set_pbc(pbc,ePBC,npbcdim<DIM ? &nc2 : NULL,box);

    return (npbcdim > 0 ? pbc : NULL);
}
Esempio n. 3
0
void set_pbc(t_pbc *pbc,int ePBC,matrix box)
{
    if (ePBC == -1)
        ePBC = guess_ePBC(box);

    low_set_pbc(pbc,ePBC,NULL,box);
}
Esempio n. 4
0
void set_pbc(t_pbc *pbc, int ePBC, const matrix box)
{
    if (ePBC == -1)
    {
        ePBC = guess_ePBC(box);
    }

    low_set_pbc(pbc, ePBC, NULL, box);
}