Пример #1
0
 /// Build the mass matrix (for these variables) scaled by c_a, storing
 /// it in 'storage' sparse matrix, at given column/row offset.
 /// Note, most iterative solvers don't need to know mass matrix explicitly.
 /// Optimized: doesn't fill unneeded elements except mass and 3x3 inertia.
 public override void Build_M(ChSparseMatrix storage, int insrow, int inscol, double c_a)
 {
     storage.SetElement(insrow + 0, inscol + 0, c_a * mass);
     storage.SetElement(insrow + 1, inscol + 1, c_a * mass);
     storage.SetElement(insrow + 2, inscol + 2, c_a * mass);
     // ChMatrix33<double> scaledJ = (ChMatrix33<double>)(inertia.nm.matrix * c_a);
     // storage.PasteMatrix(scaledJ, insrow + 3, inscol + 3);
 }
Пример #2
0
 /// Build the mass matrix (for these variables) scaled by c_a, storing
 /// it in 'storage' sparse matrix, at given column/row offset.
 /// Note, most iterative solvers don't need to know mass matrix explicitly.
 public override void Build_M(ChSparseMatrix storage, int insrow, int inscol, double c_a)
 {
     for (int row = 0; row < Mmass.matrix.GetRows(); ++row)
     {
         for (int col = 0; col < Mmass.matrix.GetColumns(); ++col)
         {
             storage.SetElement(insrow + row, inscol + col, c_a * Mmass.matrix.GetElement(row, col));
         }
     }
 }
Пример #3
0
 /// Build the mass matrix (for these variables) scaled by c_a, storing
 /// it in 'storage' sparse matrix, at given column/row offset.
 /// Note, most iterative solvers don't need to know mass matrix explicitly.
 /// Optimized: doesn't fill unneeded elements except mass.
 public override void Build_M(ChSparseMatrix storage, int insrow, int inscol, double c_a)
 {
     storage.SetElement(insrow + 0, inscol + 0, c_a * m_inertia);
 }