本文整理汇总了C++中ChMatrix33::MatrMultiplyT方法的典型用法代码示例。如果您正苦于以下问题:C++ ChMatrix33::MatrMultiplyT方法的具体用法?C++ ChMatrix33::MatrMultiplyT怎么用?C++ ChMatrix33::MatrMultiplyT使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ChMatrix33
的用法示例。
在下文中一共展示了ChMatrix33::MatrMultiplyT方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ddAB
void ChProximityContainerMeshless::AccumulateStep1()
{
// Per-edge data computation
std::list<ChProximityMeshless*>::iterator iterproximity = proximitylist.begin();
while(iterproximity != proximitylist.end())
{
ChMatterMeshless* mmatA = (ChMatterMeshless*)(*iterproximity)->GetModelA()->GetPhysicsItem();
ChMatterMeshless* mmatB = (ChMatterMeshless*)(*iterproximity)->GetModelB()->GetPhysicsItem();
ChNodeMeshless* mnodeA =(ChNodeMeshless*) mmatA->GetNode ( ((ChModelBulletNode*)(*iterproximity)->GetModelA())->GetNodeId() );
ChNodeMeshless* mnodeB =(ChNodeMeshless*) mmatB->GetNode ( ((ChModelBulletNode*)(*iterproximity)->GetModelB())->GetNodeId() );
ChVector<> x_A = mnodeA->GetPos();
ChVector<> x_B = mnodeB->GetPos();
ChVector<> x_Aref = mnodeA->GetPosReference();
ChVector<> x_Bref = mnodeB->GetPosReference();
ChVector<> u_A = (x_A -x_Aref);
ChVector<> u_B = (x_B -x_Bref);
ChVector<> d_BA = x_Bref - x_Aref;
ChVector<> g_BA = u_B - u_A;
double dist_BA = d_BA.Length();
double W_BA = W_sph( dist_BA, mnodeA->GetKernelRadius() );
double W_AB = W_sph( dist_BA, mnodeB->GetKernelRadius() );
// increment data of connected nodes
mnodeA->density += mnodeB->GetMass() * W_BA;
mnodeB->density += mnodeA->GetMass() * W_AB;
ChMatrixNM<double, 3,1> mdist;
mdist.PasteVector(d_BA,0,0);
ChMatrixNM<double, 3,1> mdistT;
mdistT.PasteVector(d_BA,0,0);
ChMatrix33<> ddBA;
ddBA.MatrMultiplyT(mdist, mdistT);
ChMatrix33<> ddAB(ddBA);
ddBA.MatrScale(W_BA);
mnodeA->Amoment.MatrInc(ddBA); // increment the moment matrix: Aa += d_BA*d_BA'*W_BA
ddAB.MatrScale(W_AB);
mnodeB->Amoment.MatrInc(ddAB); // increment the moment matrix: Ab += d_AB*d_AB'*W_AB
ChVector<> m_inc_BA = (d_BA) * W_BA;
ChVector<> m_inc_AB = (-d_BA) * W_AB;
ChVector<> dwg; // increment the J matrix
dwg = m_inc_BA * g_BA.x;
mnodeA->J.PasteSumVector(dwg,0,0);
dwg = m_inc_BA * g_BA.y;
mnodeA->J.PasteSumVector(dwg,0,1);
dwg = m_inc_BA * g_BA.z;
mnodeA->J.PasteSumVector(dwg,0,2);
dwg = m_inc_AB * (-g_BA.x); // increment the J matrix
mnodeB->J.PasteSumVector(dwg,0,0);
dwg = m_inc_AB * (-g_BA.y);
mnodeB->J.PasteSumVector(dwg,0,1);
dwg = m_inc_AB * (-g_BA.z);
mnodeB->J.PasteSumVector(dwg,0,2);
++iterproximity;
}
}