本文整理汇总了C++中ScalarField::dataGpu方法的典型用法代码示例。如果您正苦于以下问题:C++ ScalarField::dataGpu方法的具体用法?C++ ScalarField::dataGpu怎么用?C++ ScalarField::dataGpu使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ScalarField
的用法示例。
在下文中一共展示了ScalarField::dataGpu方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fex
double Fex_H2O_FittedCorrelations::compute(const ScalarFieldTilde* Ntilde, ScalarFieldTilde* Phi_Ntilde) const
{ double PhiEx = 0.0;
//Quadratic part:
ScalarFieldTilde V_O = double(gInfo.nr)*(COO*Ntilde[0] + COH*Ntilde[1]); Phi_Ntilde[0] += V_O;
ScalarFieldTilde V_H = double(gInfo.nr)*(COH*Ntilde[0] + CHH*Ntilde[1]); Phi_Ntilde[1] += V_H;
PhiEx += 0.5*gInfo.dV*(dot(V_O,Ntilde[0]) + dot(V_H,Ntilde[1]));
//Compute gaussian weighted densities:
ScalarField NObar = I(fex_gauss*Ntilde[0]), Phi_NObar; nullToZero(Phi_NObar, gInfo);
ScalarField NHbar = I(fex_gauss*Ntilde[1]), Phi_NHbar; nullToZero(Phi_NHbar, gInfo);
//Evaluated weighted density functional:
#ifdef GPU_ENABLED
ScalarField fex(ScalarFieldData::alloc(gInfo,isGpuEnabled()));
Fex_H20_FittedCorrelations_gpu(gInfo.nr, NObar->dataGpu(), NHbar->dataGpu(),
fex->dataGpu(), Phi_NObar->dataGpu(), Phi_NHbar->dataGpu());
PhiEx += integral(fex);
#else
PhiEx += gInfo.dV*threadedAccumulate(Fex_H2O_FittedCorrelations_calc, gInfo.nr,
NObar->data(), NHbar->data(), Phi_NObar->data(), Phi_NHbar->data());
#endif
//Convert gradients:
Phi_Ntilde[0] += fex_gauss*Idag(Phi_NObar);
Phi_Ntilde[1] += fex_gauss*Idag(Phi_NHbar);
return PhiEx;
}