本文整理汇总了C++中sp::Interaction::setUpperLevelForOutput方法的典型用法代码示例。如果您正苦于以下问题:C++ Interaction::setUpperLevelForOutput方法的具体用法?C++ Interaction::setUpperLevelForOutput怎么用?C++ Interaction::setUpperLevelForOutput使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sp::Interaction
的用法示例。
在下文中一共展示了Interaction::setUpperLevelForOutput方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: visit
void visit(const Hem5OSI&)
{
unsigned int lowerLevelForOutput = LEVELMAX;
unsigned int upperLevelForOutput = 0;
unsigned int lowerLevelForInput = LEVELMAX;
unsigned int upperLevelForInput = 0;
Type::Siconos dsType = Type::value(*_ds);
/** there is only a test on the dstype and simulation since we assume that
* we implicitely the nonsmooth law when a DS type is chosen
*/
if (dsType == Type::LagrangianDS || dsType == Type::LagrangianLinearTIDS || dsType == Type::NewtonEulerDS)
{
if (Type::value(*_parent) == Type::EventDriven)
{
Type::Siconos nslType = Type::value(*_nonSmoothLaw);
if (nslType == Type::NewtonImpactNSL || nslType == Type::MultipleImpactNSL)
{
lowerLevelForOutput = 0;
upperLevelForOutput = 2 ;
lowerLevelForInput = 1;
upperLevelForInput = 2;
}
else if (nslType == Type::NewtonImpactFrictionNSL)
{
lowerLevelForOutput = 0;
upperLevelForOutput = 4;
lowerLevelForInput = 1;
upperLevelForInput = 2;
RuntimeException::selfThrow("Simulation::SetupLevels::visit - simulation of type: " + Type::name(*_parent) + " not yet implemented for nonsmooth law of type NewtonImpactFrictionNSL");
}
else
{
RuntimeException::selfThrow("Simulation::SetupLevels::visit - simulation of type: " + Type::name(*_parent) + "not yet implemented for nonsmooth of type");
}
}
else
RuntimeException::selfThrow("Simulation::SetupLevels::visit - unknown simulation type: " + Type::name(*_parent));
}
else RuntimeException::selfThrow("Simulation::SetupLevels::visit - not yet implemented for Dynamical system type :" + dsType);
_parent->_levelMinForInput = std::min<int>(lowerLevelForInput, _parent->_levelMinForInput);
_parent->_levelMaxForInput = std::max<int>(upperLevelForInput, _parent->_levelMaxForInput);
_parent->_levelMinForOutput = std::min<int>(lowerLevelForOutput, _parent->_levelMinForInput);
_parent->_levelMaxForOutput = std::max<int>(upperLevelForOutput, _parent->_levelMaxForInput);
_parent->_numberOfIndexSets = std::max<int>(_parent->_levelMaxForOutput + 1, _parent->_numberOfIndexSets);
_interaction->setLowerLevelForOutput(lowerLevelForOutput);
_interaction->setUpperLevelForOutput(upperLevelForOutput);
_interaction->setLowerLevelForInput(lowerLevelForInput);
_interaction->setUpperLevelForInput(upperLevelForInput);
_interaction->setSteps(1);
};