本文整理汇总了C++中snew_bc函数的典型用法代码示例。如果您正苦于以下问题:C++ snew_bc函数的具体用法?C++ snew_bc怎么用?C++ snew_bc使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了snew_bc函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: bc_atomtypes
static void bc_atomtypes(const t_commrec *cr, t_atomtypes *atomtypes)
{
int nr;
block_bc(cr,atomtypes->nr);
nr = atomtypes->nr;
snew_bc(cr,atomtypes->radius,nr);
snew_bc(cr,atomtypes->vol,nr);
snew_bc(cr,atomtypes->surftens,nr);
snew_bc(cr,atomtypes->gb_radius,nr);
snew_bc(cr,atomtypes->S_hct,nr);
nblock_bc(cr,nr,atomtypes->radius);
nblock_bc(cr,nr,atomtypes->vol);
nblock_bc(cr,nr,atomtypes->surftens);
nblock_bc(cr,nr,atomtypes->gb_radius);
nblock_bc(cr,nr,atomtypes->S_hct);
}
示例2: bc_pull
static void bc_pull(const t_commrec *cr,t_pull *pull)
{
int g;
block_bc(cr,*pull);
snew_bc(cr,pull->grp,pull->ngrp+1);
for(g=0; g<pull->ngrp+1; g++)
{
bc_pullgrp(cr,&pull->grp[g]);
}
}
示例3: bc_cmap
static void bc_cmap(const t_commrec *cr, gmx_cmap_t *cmap_grid)
{
int i, j, nelem, ngrid;
block_bc(cr, cmap_grid->ngrid);
block_bc(cr, cmap_grid->grid_spacing);
ngrid = cmap_grid->ngrid;
nelem = cmap_grid->grid_spacing * cmap_grid->grid_spacing;
if (ngrid > 0)
{
snew_bc(cr, cmap_grid->cmapdata, ngrid);
for (i = 0; i < ngrid; i++)
{
snew_bc(cr, cmap_grid->cmapdata[i].cmap, 4*nelem);
nblock_bc(cr, 4*nelem, cmap_grid->cmapdata[i].cmap);
}
}
}
示例4: bc_simtempvals
static void bc_simtempvals(const t_commrec *cr, t_simtemp *simtemp, int n_lambda)
{
block_bc(cr, simtemp->simtemp_low);
block_bc(cr, simtemp->simtemp_high);
block_bc(cr, simtemp->eSimTempScale);
snew_bc(cr, simtemp->temperatures, n_lambda);
nblock_bc(cr, n_lambda, simtemp->temperatures);
if (debug)
{
fprintf(debug, "after bc_simtempvals\n");
}
}
示例5: bc_swapions
static void bc_swapions(const t_commrec *cr, t_swapcoords *swap)
{
int i;
block_bc(cr, *swap);
/* Broadcast ion group atom indices */
snew_bc(cr, swap->ind, swap->nat);
nblock_bc(cr, swap->nat, swap->ind);
/* Broadcast split groups atom indices */
for (i = 0; i < 2; i++)
{
snew_bc(cr, swap->ind_split[i], swap->nat_split[i]);
nblock_bc(cr, swap->nat_split[i], swap->ind_split[i]);
}
/* Broadcast solvent group atom indices */
snew_bc(cr, swap->ind_sol, swap->nat_sol);
nblock_bc(cr, swap->nat_sol, swap->ind_sol);
}
示例6: bc_symtab
static void bc_symtab(const t_commrec *cr, t_symtab *symtab)
{
int i, nr, len;
t_symbuf *symbuf;
block_bc(cr, symtab->nr);
nr = symtab->nr;
snew_bc(cr, symtab->symbuf, 1);
symbuf = symtab->symbuf;
symbuf->bufsize = nr;
snew_bc(cr, symbuf->buf, nr);
for (i = 0; i < nr; i++)
{
if (MASTER(cr))
{
len = strlen(symbuf->buf[i]) + 1;
}
block_bc(cr, len);
snew_bc(cr, symbuf->buf[i], len);
nblock_bc(cr, len, symbuf->buf[i]);
}
}
示例7: bc_molblock
static void bc_molblock(const t_commrec *cr, gmx_molblock_t *molb)
{
block_bc(cr, molb->type);
block_bc(cr, molb->nmol);
block_bc(cr, molb->natoms_mol);
block_bc(cr, molb->nposres_xA);
if (molb->nposres_xA > 0)
{
snew_bc(cr, molb->posres_xA, molb->nposres_xA);
nblock_bc(cr, molb->nposres_xA*DIM, molb->posres_xA[0]);
}
block_bc(cr, molb->nposres_xB);
if (molb->nposres_xB > 0)
{
snew_bc(cr, molb->posres_xB, molb->nposres_xB);
nblock_bc(cr, molb->nposres_xB*DIM, molb->posres_xB[0]);
}
if (debug)
{
fprintf(debug, "after bc_molblock\n");
}
}
示例8: bc_inputrec
static void bc_inputrec(const t_commrec *cr, t_inputrec *inputrec)
{
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->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);
}
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);
}
}
示例9: bc_inputrec
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);
}
}
示例10: bc_fepvals
static void bc_fepvals(const t_commrec *cr, t_lambda *fep)
{
gmx_bool bAlloc = TRUE;
int i;
block_bc(cr, fep->nstdhdl);
block_bc(cr, fep->init_lambda);
block_bc(cr, fep->init_fep_state);
block_bc(cr, fep->delta_lambda);
block_bc(cr, fep->bPrintEnergy);
block_bc(cr, fep->n_lambda);
if (fep->n_lambda > 0)
{
snew_bc(cr, fep->all_lambda, efptNR);
nblock_bc(cr, efptNR, fep->all_lambda);
for (i = 0; i < efptNR; i++)
{
snew_bc(cr, fep->all_lambda[i], fep->n_lambda);
nblock_bc(cr, fep->n_lambda, fep->all_lambda[i]);
}
}
block_bc(cr, fep->sc_alpha);
block_bc(cr, fep->sc_power);
block_bc(cr, fep->sc_r_power);
block_bc(cr, fep->sc_sigma);
block_bc(cr, fep->sc_sigma_min);
block_bc(cr, fep->bScCoul);
nblock_bc(cr, efptNR, &(fep->separate_dvdl[0]));
block_bc(cr, fep->dhdl_derivatives);
block_bc(cr, fep->dh_hist_size);
block_bc(cr, fep->dh_hist_spacing);
if (debug)
{
fprintf(debug, "after bc_fepvals\n");
}
}
示例11: bc_swapions
static void bc_swapions(const t_commrec *cr, t_swapcoords *swap)
{
block_bc(cr, *swap);
/* Broadcast atom indices for split groups, solvent group, and for all user-defined swap groups */
snew_bc(cr, swap->grp, swap->ngrp);
for (int i = 0; i < swap->ngrp; i++)
{
t_swapGroup *g = &swap->grp[i];
block_bc(cr, *g);
snew_bc(cr, g->ind, g->nat);
nblock_bc(cr, g->nat, g->ind);
int len = 0;
if (MASTER(cr))
{
len = strlen(g->molname);
}
block_bc(cr, len);
snew_bc(cr, g->molname, len);
nblock_bc(cr, len, g->molname);
}
}
示例12: bc_pull
static void bc_pull(const t_commrec *cr, pull_params_t *pull)
{
int g;
block_bc(cr, *pull);
snew_bc(cr, pull->group, pull->ngroup);
for (g = 0; g < pull->ngroup; g++)
{
bc_pull_group(cr, &pull->group[g]);
}
snew_bc(cr, pull->coord, pull->ncoord);
nblock_bc(cr, pull->ncoord, pull->coord);
for (int c = 0; c < pull->ncoord; c++)
{
if (!MASTER(cr))
{
pull->coord[c].externalPotentialProvider = NULL;
}
if (pull->coord[c].eType == epullEXTERNAL)
{
bc_cstring(cr, &pull->coord[c].externalPotentialProvider);
}
}
}
示例13: bc_ilists
static void bc_ilists(const t_commrec *cr, t_ilist *ilist)
{
int ftype;
/* Here we only communicate the non-zero length ilists */
if (MASTER(cr))
{
for (ftype = 0; ftype < F_NRE; ftype++)
{
if (ilist[ftype].nr > 0)
{
block_bc(cr, ftype);
block_bc(cr, ilist[ftype].nr);
nblock_bc(cr, ilist[ftype].nr, ilist[ftype].iatoms);
}
}
ftype = -1;
block_bc(cr, ftype);
}
else
{
for (ftype = 0; ftype < F_NRE; ftype++)
{
ilist[ftype].nr = 0;
}
do
{
block_bc(cr, ftype);
if (ftype >= 0)
{
block_bc(cr, ilist[ftype].nr);
snew_bc(cr, ilist[ftype].iatoms, ilist[ftype].nr);
nblock_bc(cr, ilist[ftype].nr, ilist[ftype].iatoms);
}
}
while (ftype >= 0);
}
if (debug)
{
fprintf(debug, "after bc_ilists\n");
}
}
示例14: bc_strings
static void bc_strings(const t_commrec *cr,t_symtab *symtab,int nr,char ****nm)
{
int i;
int *handle;
char ***NM;
snew(handle,nr);
if (MASTER(cr)) {
NM = *nm;
for(i=0; (i<nr); i++)
handle[i] = lookup_symtab(symtab,NM[i]);
}
nblock_bc(cr,nr,handle);
if (!MASTER(cr)) {
snew_bc(cr,*nm,nr);
NM = *nm;
for (i=0; (i<nr); i++)
(*nm)[i] = get_symtab_handle(symtab,handle[i]);
}
sfree(handle);
}
示例15: bc_groups
static void bc_groups(const t_commrec *cr, t_symtab *symtab,
int natoms, gmx_groups_t *groups)
{
int dummy;
int g, n;
bc_grps(cr, groups->grps);
block_bc(cr, groups->ngrpname);
bc_strings(cr, symtab, groups->ngrpname, &groups->grpname);
for (g = 0; g < egcNR; g++)
{
if (MASTER(cr))
{
if (groups->grpnr[g])
{
n = natoms;
}
else
{
n = 0;
}
}
block_bc(cr, n);
if (n == 0)
{
groups->grpnr[g] = NULL;
}
else
{
snew_bc(cr, groups->grpnr[g], n);
nblock_bc(cr, n, groups->grpnr[g]);
}
}
if (debug)
{
fprintf(debug, "after bc_groups\n");
}
}