本文整理汇总了C++中sp::Topology::resetIndexSetPtr方法的典型用法代码示例。如果您正苦于以下问题:C++ Topology::resetIndexSetPtr方法的具体用法?C++ Topology::resetIndexSetPtr怎么用?C++ Topology::resetIndexSetPtr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sp::Topology
的用法示例。
在下文中一共展示了Topology::resetIndexSetPtr方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: computeLevelsForInputAndOutput
void Simulation::computeLevelsForInputAndOutput(SP::Interaction inter, bool init)
{
DEBUG_PRINT("Simulation::computeLevelsForInputAndOutput(SP::Interaction inter, bool init)\n");
/** \warning. We test only for the first Dynamical of the interaction.
* we assume that the osi(s) are consistent for one interaction
*/
SP::InteractionsGraph indexSet0 = model()->nonSmoothDynamicalSystem()->topology()->indexSet(0);
SP::DynamicalSystem ds = indexSet0->properties(indexSet0->descriptor(inter)).source;
// Note FP : we should probably connect osi and graph before, in simulation->initialize?
DSOSIConstIterator it = _osiMap.find(ds);
SP::OneStepIntegrator osi = it->second;
if (!osi)
RuntimeException::selfThrow("Simulation::computeLevelsForInputAndOutput osi does not exists");
indexSet0->properties(indexSet0->descriptor(inter)).osi = osi;
std11::shared_ptr<SetupLevels> setupLevels;
setupLevels.reset(new SetupLevels(shared_from_this(), inter, ds));
osi->accept(*(setupLevels.get()));
if (!init) // We are not computing the levels at the initialization
{
SP::Topology topo = model()->nonSmoothDynamicalSystem()->topology();
unsigned int indxSize = topo->indexSetsSize();
assert (_numberOfIndexSets >0);
if ((indxSize == LEVELMAX) || (indxSize < _numberOfIndexSets ))
{
topo->indexSetsResize(_numberOfIndexSets);
// Init if the size has changed
for (unsigned int i = indxSize; i < topo->indexSetsSize(); i++) // ++i ???
topo->resetIndexSetPtr(i);
}
}
}