本文整理汇总了C++中sp::Interaction::lowerLevelForOutput方法的典型用法代码示例。如果您正苦于以下问题:C++ Interaction::lowerLevelForOutput方法的具体用法?C++ Interaction::lowerLevelForOutput怎么用?C++ Interaction::lowerLevelForOutput使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sp::Interaction
的用法示例。
在下文中一共展示了Interaction::lowerLevelForOutput方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: lambda
SP::SiconosVector Simulation::lambda(unsigned int level, unsigned int coor)
{
// return input(level) (ie with lambda[level]) for all Interactions.
// assert(level>=0);
DEBUG_BEGIN("Simulation::input(unsigned int level, unsigned int coor)\n");
DEBUG_PRINTF("with level = %i and coor = %i \n", level,coor);
InteractionsGraph::VIterator ui, uiend;
SP::Interaction inter;
SP::InteractionsGraph indexSet0 = _nsds->topology()->indexSet0();
SP::SiconosVector lambda (new SiconosVector (_nsds->topology()->indexSet0()->size() ));
int i=0;
for (std11::tie(ui, uiend) = indexSet0->vertices(); ui != uiend; ++ui)
{
inter = indexSet0->bundle(*ui);
assert(inter->lowerLevelForOutput() <= level);
assert(inter->upperLevelForOutput() >= level);
lambda->setValue(i,inter->lambda(level)->getValue(coor));
i++;
}
DEBUG_END("Simulation::input(unsigned int level, unsigned int coor)\n");
return lambda;
}
示例2: updateOutput
void Simulation::updateOutput(unsigned int level)
{
// To compute output(level) (ie with y[level]) for all Interactions.
// assert(level>=0);
DEBUG_PRINTF("Simulation::updateOutput(unsigned int level) starts for level = %i\n", level);
double time = model()->currentTime();
InteractionsGraph::VIterator ui, uiend;
SP::Interaction inter;
SP::InteractionsGraph indexSet0 = model()->nonSmoothDynamicalSystem()->topology()->indexSet0();
for (std11::tie(ui, uiend) = indexSet0->vertices(); ui != uiend; ++ui)
{
inter = indexSet0->bundle(*ui);
assert(inter->lowerLevelForOutput() <= level);
assert(inter->upperLevelForOutput() >= level);
inter->computeOutput(time, indexSet0->properties(*ui), level);
}
DEBUG_PRINTF("Simulation::updateOutput(unsigned int level) ends for level = %i\n", level);
}