本文整理汇总了C++中sp::Topology::indexSet0方法的典型用法代码示例。如果您正苦于以下问题:C++ Topology::indexSet0方法的具体用法?C++ Topology::indexSet0怎么用?C++ Topology::indexSet0使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sp::Topology
的用法示例。
在下文中一共展示了Topology::indexSet0方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: computeLevelsForInputAndOutput
void Simulation::computeLevelsForInputAndOutput()
{
DEBUG_PRINT("Simulation::computeLevelsForInputAndOutput()\n");
SP::Topology topo = model()->nonSmoothDynamicalSystem()->topology();
InteractionsGraph::VIterator ui, uiend;
SP::InteractionsGraph indexSet0 = topo->indexSet0();
for (std11::tie(ui, uiend) = indexSet0->vertices(); ui != uiend; ++ui)
{
computeLevelsForInputAndOutput(indexSet0->bundle(*ui), true);
}
unsigned int indxSize = topo->indexSetsSize();
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);
}
DEBUG_PRINTF("_numberOfIndexSets =%d\n", _numberOfIndexSets);
DEBUG_PRINTF("_levelMinForInput =%d\n", _levelMinForInput);
DEBUG_PRINTF("_levelMaxForInput =%d\n", _levelMaxForInput);
DEBUG_PRINTF("_levelMinForOutput =%d\n", _levelMinForInput);
DEBUG_PRINTF("_levelMaxForOutput =%d\n", _levelMaxForInput);
}
示例2: initialize
void FrictionContact::initialize(SP::Simulation sim)
{
// - Checks memory allocation for main variables (M,q,w,z)
// - Formalizes the problem if the topology is time-invariant
// This function performs all steps that are time-invariant
// General initialize for OneStepNSProblem
LinearOSNS::initialize(sim);
// Connect to the right function according to dim. of the problem
// get topology
SP::Topology topology =
simulation()->model()->nonSmoothDynamicalSystem()->topology();
// Note that interactionBlocks is up to date since updateInteractionBlocks
// has been called during OneStepNSProblem::initialize()
// Fill vector of friction coefficients
int sizeMu = simulation()->model()->nonSmoothDynamicalSystem()
->topology()->indexSet(0)->size();
_mu->reserve(sizeMu);
// If the topology is TimeInvariant ie if M structure does not
// change during simulation:
if (topology->indexSet0()->size()>0)
{
// Get index set from Simulation
SP::InteractionsGraph indexSet =
simulation()->indexSet(indexSetLevel());
InteractionsGraph::VIterator ui, uiend;
for (std11::tie(ui, uiend) = indexSet->vertices(); ui != uiend; ++ui)
{
_mu->push_back(std11::static_pointer_cast<NewtonImpactFrictionNSL>
(indexSet->bundle(*ui)->nonSmoothLaw())->mu());
}
}
}
示例3: getNumberOfInteractions
/** get the number of Interactions present in the NSDS.
* \return an unsigned int
*/
inline unsigned int getNumberOfInteractions() const
{
return _topology->indexSet0()->size();
};