本文整理汇总了C++中ParticleSet::Properties方法的典型用法代码示例。如果您正苦于以下问题:C++ ParticleSet::Properties方法的具体用法?C++ ParticleSet::Properties怎么用?C++ ParticleSet::Properties使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParticleSet
的用法示例。
在下文中一共展示了ParticleSet::Properties方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
/// correlated sampling
WOSPotential::ValueType
WOSPotential::method2(ParticleSet& P)
{
double V0 = 0;
/// intialise the particles in WP;
WP->setP(P);
Domain domain; /// create domain;
double pe = 0.0;
double dpe = 0.0;
for(int irun = 0; irun < m_runs; irun++)
{
domain.runner = WP->R0; /// initialise runner
domain.in_device = true; /// runner is inside device
device->MaximumSphere(domain); /// calc d_{0}
domain.WalkOnSphere();
double vD0 = device->OC_contrib0(domain.radius,domain.runner,WP);
double vbare = device->OC_passage(V0,domain,WP);
WP->calcwt();
double vol = 0.0;
while(domain.in_device)
{
device->MaximumSphere(domain);
vol += device->contribk(domain,WP);
domain.WalkOnSphere();
vbare += device->OC_passage(V0,domain,WP);
}
vol *= WP->qwt; /// the half has been included
double vrun = vol + vbare + vD0;
pe += vrun;
dpe += vrun * vrun;
}
pe *= m_norm;
dpe *= m_norm;
dpe = ( dpe - pe * pe )/static_cast<double>(m_runs-1);
/// CHANGE FOR DMC, WARNING Tau is zero for VMC WOS
pe += dpe * Tau; // sigma^2 * Tau
// cout << "VWOS: "<< pe << '\t' << Tau << endl;
P.Properties(WOSVAR) = -dpe;
//P.Properties(WOSVAR) = dpe;
return pe;
}