本文整理汇总了C++中ThrData::init_cdeam方法的典型用法代码示例。如果您正苦于以下问题:C++ ThrData::init_cdeam方法的具体用法?C++ ThrData::init_cdeam怎么用?C++ ThrData::init_cdeam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ThrData
的用法示例。
在下文中一共展示了ThrData::init_cdeam方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: compute
void PairCDEAMOMP::compute(int eflag, int vflag)
{
if (eflag || vflag) {
ev_setup(eflag,vflag);
} else evflag = vflag_fdotr = eflag_global = eflag_atom = 0;
const int nall = atom->nlocal + atom->nghost;
const int nthreads = comm->nthreads;
const int inum = list->inum;
// grow energy and fp arrays if necessary
// need to be atom->nmax in length
if (atom->nmax > nmax) {
memory->destroy(rho);
memory->destroy(rhoB);
memory->destroy(D_values);
memory->destroy(fp);
nmax = atom->nmax;
memory->create(rho,nthreads*nmax,"pair:rho");
memory->create(rhoB,nthreads*nmax,"pair:mu");
memory->create(D_values,nthreads*nmax,"pair:D_values");
memory->create(fp,nmax,"pair:fp");
}
#if defined(_OPENMP)
#pragma omp parallel default(none) shared(eflag,vflag)
#endif
{
int ifrom, ito, tid;
loop_setup_thr(ifrom, ito, tid, inum, nthreads);
ThrData *thr = fix->get_thr(tid);
thr->timer(Timer::START);
ev_setup_thr(eflag, vflag, nall, eatom, vatom, thr);
if (force->newton_pair)
thr->init_cdeam(nall, rho, rhoB, D_values);
else
thr->init_cdeam(atom->nlocal, rho, rhoB, D_values);
switch (cdeamVersion) {
case 1:
if (evflag) {
if (eflag) {
if (force->newton_pair) eval<1,1,1,1>(ifrom, ito, thr);
else eval<1,1,0,1>(ifrom, ito, thr);
} else {
if (force->newton_pair) eval<1,0,1,1>(ifrom, ito, thr);
else eval<1,0,0,1>(ifrom, ito, thr);
}
} else {
if (force->newton_pair) eval<0,0,1,1>(ifrom, ito, thr);
else eval<0,0,0,1>(ifrom, ito, thr);
}
break;
case 2:
if (evflag) {
if (eflag) {
if (force->newton_pair) eval<1,1,1,2>(ifrom, ito, thr);
else eval<1,1,0,2>(ifrom, ito, thr);
} else {
if (force->newton_pair) eval<1,0,1,2>(ifrom, ito, thr);
else eval<1,0,0,2>(ifrom, ito, thr);
}
} else {
if (force->newton_pair) eval<0,0,1,2>(ifrom, ito, thr);
else eval<0,0,0,2>(ifrom, ito, thr);
}
break;
default:
{
#if defined(_OPENMP)
#pragma omp master
#endif
error->all(FLERR,"unsupported eam/cd pair style variant");
}
}
thr->timer(Timer::PAIR);
reduce_thr(this, eflag, vflag, thr);
} // end of omp parallel region
}