本文整理汇总了C++中Site::isActive方法的典型用法代码示例。如果您正苦于以下问题:C++ Site::isActive方法的具体用法?C++ Site::isActive怎么用?C++ Site::isActive使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Site
的用法示例。
在下文中一共展示了Site::isActive方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: time
SnapShot::SnapShot(KMCSolver *solver)
{
timeWhenTaken = time(NULL);
seed = Seed::initialSeed;
siteBox.set_size(solver->NX(), solver->NY(), solver->NZ());
Site* currentSite;
for (uint i = 0; i < siteBox.n_rows; ++i)
{
for (uint j = 0; j < siteBox.n_cols; ++j)
{
for (uint k = 0; k < siteBox.n_slices; ++k)
{
currentSite = solver->getSite(i, j, k);
siteBox(i, j, k) = currentSite->isActive();
if (currentSite->isActive())
{
for (Reaction * r : currentSite->associatedParticle()->reactions())
{
allRates.push_back(r->rate());
allreactions.push_back({r->x(), r->y(), r->z(),
((DiffusionReaction*)r)->xD(),
((DiffusionReaction*)r)->yD(),
((DiffusionReaction*)r)->zD()});
}
}
}
}
}
}
示例2: execute
void execute()
{
uint clusterness = 0;
uint N = 0;
Site *currentSite;
SoluteParticle *particle;
for (uint x = 0; x < NX(); ++x)
{
for (uint y = 0; y < NY(); ++y)
{
currentSite = solver()->getSite(x, y, m_layerEvent->z());
if (currentSite->isActive())
{
N++;
particle = currentSite->associatedParticle();
for (int dx = -1; dx <= 1; ++dx)
{
for (int dy = -1; dy <= 1; ++dy)
{
if (dx == dy && dy == 0)
{
continue;
}
if (particle->neighborhood(dx, dy, 0)->isActive())
{
clusterness++;
}
}
}
}
}
}
setValue(clusterness/(double)N/8);
}