当前位置: 首页>>代码示例>>C++>>正文


C++ Interaction::lambda方法代码示例

本文整理汇总了C++中Interaction::lambda方法的典型用法代码示例。如果您正苦于以下问题:C++ Interaction::lambda方法的具体用法?C++ Interaction::lambda怎么用?C++ Interaction::lambda使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Interaction的用法示例。


在下文中一共展示了Interaction::lambda方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: computeOutput

void LagrangianCompliantR::computeOutput(double time, Interaction& inter, InteractionProperties& interProp, unsigned int derivativeNumber)
{
  VectorOfBlockVectors& DSlink = *interProp.DSlink;
  SiconosVector workZ = *DSlink[LagrangianR::z];
  if (derivativeNumber == 0)
  {
    SiconosVector& y = *inter.y(0);
    SiconosVector& lambda = *inter.lambda(0);
    SiconosVector workQ = *DSlink[LagrangianR::q0];

    computeh(time, workQ, lambda, workZ, y);
  }
  else
  {
    SiconosVector& y = *inter.y(derivativeNumber);
    SiconosVector& lambda = *inter.lambda(derivativeNumber);
    SiconosVector workQ = *DSlink[LagrangianR::q0];
    computeJachq(time, workQ, lambda, workZ);
    computeJachlambda(time, workQ, lambda, workZ);
    if (derivativeNumber == 1)
    {
      // y = Jach[0] q1 + Jach[1] lambda
      prod(*_jachq, *DSlink[LagrangianR::q1], y);
      prod(*_jachlambda, lambda, y, false);
    }
    else if (derivativeNumber == 2)
      prod(*_jachq, *DSlink[LagrangianR::q2], y); // Approx: y[2] = Jach[0]q[2], other terms are neglected ...
    else
      RuntimeException::selfThrow("LagrangianCompliantR::computeOutput, index out of range or not yet implemented.");
  }

  *DSlink[LagrangianR::z] = workZ;
}
开发者ID:radarsat1,项目名称:siconos,代码行数:33,代码来源:LagrangianCompliantR.cpp

示例2: contactPointProcess

void contactPointProcess(SiconosVector& answer,
                         const Interaction& inter,
                         const T& rel)
{

  answer.resize(14);
  const SiconosVector& posa = *rel.pc1();
  const SiconosVector& posb = *rel.pc2();
  const SiconosVector& nc = *rel.nc();
  const SimpleMatrix& jachqT = *rel.jachqT();
  double id = inter.number();
  double mu = ask<ForMu>(*inter.nslaw());
  SiconosVector cf(jachqT.size(1));
  prod(*inter.lambda(1), jachqT, cf, true);
  answer.setValue(0, mu);

  DEBUG_PRINTF("posa(0)=%g\n", posa(0));
  DEBUG_PRINTF("posa(1)=%g\n", posa(1));
  DEBUG_PRINTF("posa(2)=%g\n", posa(2));


  answer.setValue(1, posa(0));
  answer.setValue(2, posa(1));
  answer.setValue(3, posa(2));
  answer.setValue(4, posb(0));
  answer.setValue(5, posb(1));
  answer.setValue(6, posb(2));
  answer.setValue(7, nc(0));
  answer.setValue(8, nc(1));
  answer.setValue(9, nc(2));
  answer.setValue(10, cf(0));
  answer.setValue(11, cf(1));
  answer.setValue(12, cf(2));
  answer.setValue(13, id);
};
开发者ID:bremond,项目名称:siconos,代码行数:35,代码来源:MechanicsIO.cpp

示例3: computeInput

void LagrangianLinearTIR::computeInput(double time, Interaction& inter, InteractionProperties& interProp, unsigned int level)
{
  // get lambda of the concerned interaction
  SiconosVector& lambda = *inter.lambda(level);
  VectorOfBlockVectors& DSlink = *interProp.DSlink;
  // computation of p = Ht lambda
  prod(lambda, *_jachq, *DSlink[LagrangianR::p0 + level], false);
}
开发者ID:xhub,项目名称:siconos,代码行数:8,代码来源:LagrangianLinearTIR.cpp

示例4: computeJach

void LagrangianCompliantR::computeJach(double time, Interaction& inter, InteractionProperties& interProp)
{
  VectorOfBlockVectors& DSlink = *interProp.DSlink;
  SiconosVector q = *DSlink[LagrangianR::q0];
  SiconosVector z = *DSlink[LagrangianR::z];
  SiconosVector& lambda = *inter.lambda(0);
  computeJachq(time, q, lambda, z);
  computeJachlambda(time, q, lambda, z);
}
开发者ID:radarsat1,项目名称:siconos,代码行数:9,代码来源:LagrangianCompliantR.cpp

示例5: computeInput

void FirstOrderLinearR::computeInput(double time, Interaction& inter, unsigned int level)
{

  
  SiconosVector& lambda = *inter.lambda(level);
  VectorOfBlockVectors& DSlink = inter.linkToDSVariables();
  BlockVector& z = *DSlink[FirstOrderR::z];
  SP::SiconosVector z_vec(new SiconosVector(z));
  computeg(time, lambda, *z_vec, *DSlink[FirstOrderR::r]);
  *DSlink[FirstOrderR::z] = *z_vec;
}
开发者ID:siconos,项目名称:siconos,代码行数:11,代码来源:FirstOrderLinearR.cpp

示例6: computeInput

void LagrangianRheonomousR::computeInput(double time, Interaction& inter, InteractionProperties& interProp, unsigned int level)
{
  VectorOfBlockVectors& DSlink = *interProp.DSlink;
  SiconosVector q = *DSlink[LagrangianR::q0];
  SiconosVector z = *DSlink[LagrangianR::z];
  computeJachq(time, q, z);
  // get lambda of the concerned interaction
  SiconosVector& lambda = *inter.lambda(level);
  // data[name] += trans(G) * lambda
  prod(lambda, *_jachq, *DSlink[LagrangianR::p0 + level], false);
  *DSlink[LagrangianR::z] = z;
}
开发者ID:radarsat1,项目名称:siconos,代码行数:12,代码来源:LagrangianRheonomousR.cpp

示例7: computeInput

void LagrangianCompliantR::computeInput(double time, Interaction& inter, InteractionProperties& interProp, unsigned int level)
{
  // get lambda of the concerned interaction
  SiconosVector& lambda = *inter.lambda(level);
  VectorOfBlockVectors& DSlink = *interProp.DSlink;

  SiconosVector workQ = *DSlink[LagrangianR::q0];
  SiconosVector workZ = *DSlink[LagrangianR::z];
  computeJachq(time, workQ, lambda, workZ);
  // data[name] += trans(G) * lambda
  prod(lambda, *_jachq, *DSlink[LagrangianR::p0 + level], false);
  *DSlink[LagrangianR::z] = workZ;
}
开发者ID:radarsat1,项目名称:siconos,代码行数:13,代码来源:LagrangianCompliantR.cpp

示例8: computeJacglambda

void FirstOrderType1R::computeJacg(double time, Interaction& inter, InteractionProperties& interProp)
{
  VectorOfBlockVectors& DSlink = *interProp.DSlink;
  VectorOfVectors& workV = *interProp.workVectors;
  VectorOfSMatrices& workM = *interProp.workMatrices;
  SiconosVector& z = *workV[FirstOrderR::vec_z];
  z = *DSlink[FirstOrderR::z];
  if (!_B)
  {
    computeJacglambda(time, *inter.lambda(0), z, *workM[FirstOrderR::mat_B]);
  }
  *DSlink[FirstOrderR::z] = z;
}
开发者ID:radarsat1,项目名称:siconos,代码行数:13,代码来源:FirstOrderType1R.cpp

示例9: computeInput

void FirstOrderLinearR::computeInput(double time, Interaction& inter, InteractionProperties& interProp, unsigned int level)
{
  SiconosVector& lambda = *inter.lambda(level);
  VectorOfBlockVectors& DSlink = *interProp.DSlink;
  VectorOfVectors& workV = *interProp.workVectors;
  VectorOfSMatrices& workM = *interProp.workMatrices;
  SiconosVector& z = *workV[FirstOrderR::z];
  z = *DSlink[FirstOrderR::z];

  computeg(time, workM, lambda, z, *DSlink[FirstOrderR::r]);

  *DSlink[FirstOrderR::z] = z;
}
开发者ID:radarsat1,项目名称:siconos,代码行数:13,代码来源:FirstOrderLinearR.cpp

示例10: computeOutput

void FirstOrderLinearR::computeOutput(double time, Interaction& inter, InteractionProperties& interProp, unsigned int level)
{
  VectorOfBlockVectors& DSlink = *interProp.DSlink;
  VectorOfVectors& workV = *interProp.workVectors;
  VectorOfSMatrices& workM = *interProp.workMatrices;
  SiconosVector& z = *workV[FirstOrderR::vec_z];
  z = *DSlink[FirstOrderR::z];
  // We get y and lambda of the interaction (pointers)
  SiconosVector& y = *inter.y(0);
  SiconosVector& lambda = *inter.lambda(0);

  computeh(time, workV, workM, *DSlink[FirstOrderR::x], lambda, z, y);

  *DSlink[FirstOrderR::z] = z;
}
开发者ID:radarsat1,项目名称:siconos,代码行数:15,代码来源:FirstOrderLinearR.cpp

示例11: computeOutput

void FirstOrderLinearR::computeOutput(double time, Interaction& inter, unsigned int level)
{
  DEBUG_BEGIN("FirstOrderLinearR::computeOutput \n");
  VectorOfBlockVectors& DSlink = inter.linkToDSVariables();
  BlockVector& z = *DSlink[FirstOrderR::z];
  BlockVector& x = *DSlink[FirstOrderR::x];

  SP::SiconosVector z_vec(new SiconosVector(z));
  SiconosVector& y = *inter.y(level);
  SiconosVector& lambda = *inter.lambda(level);

  computeh(time, x, lambda, *z_vec, y);

  *DSlink[FirstOrderR::z] = *z_vec;

  DEBUG_END("FirstOrderLinearR::computeOutput \n");
}
开发者ID:siconos,项目名称:siconos,代码行数:17,代码来源:FirstOrderLinearR.cpp

示例12: assert

void FirstOrderType1R::computeInput(double time, Interaction& inter, InteractionProperties& interProp, unsigned int level)
{
  assert(_pluging && "FirstOrderType1R::computeInput() is not linked to a plugin function");

  SiconosVector& lambda = *inter.lambda(level);
  // Warning: temporary method to have contiguous values in memory, copy of block to simple.
  VectorOfBlockVectors& DSlink = *interProp.DSlink;
  VectorOfVectors& workV = *interProp.workVectors;

  SiconosVector& workR = *workV[FirstOrderR::vec_r];
  workR = *DSlink[FirstOrderR::r];
  SiconosVector& workZ = *workV[FirstOrderR::vec_z];
  workZ = *DSlink[FirstOrderR::z];

  computeg(time, lambda, workZ, workR);

  *DSlink[FirstOrderR::r] = workR;
  *DSlink[FirstOrderR::z] = workZ;
}
开发者ID:radarsat1,项目名称:siconos,代码行数:19,代码来源:FirstOrderType1R.cpp

示例13: computeOutput

void LagrangianLinearTIR::computeOutput(double time, Interaction& inter, InteractionProperties& interProp, unsigned int derivativeNumber)
{
  // get y and lambda of the interaction
  SiconosVector& y = *inter.y(derivativeNumber);
  VectorOfBlockVectors& DSlink = *interProp.DSlink;

  prod(*_jachq, *DSlink[LagrangianR::q0 + derivativeNumber], y);

  if (derivativeNumber == 0)
  {
    if (_e)
      y += *_e;
    if (_F)
      prod(*_F, *DSlink[LagrangianR::z], y, false);
  }

  if (_jachlambda)
  {
    SiconosVector& lambda = *inter.lambda(derivativeNumber);
    prod(*_jachlambda, lambda, y, false);
  }


}
开发者ID:xhub,项目名称:siconos,代码行数:24,代码来源:LagrangianLinearTIR.cpp


注:本文中的Interaction::lambda方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。