20 CH_FACTORY_REGISTER(ChVariablesBodyAddedMass)
23 Maddedmass = ChMatrixDynamic<>(ndof, ndof);
24 Maddedmass.setIdentity();
25 Mmass = ChMatrixDynamic<>(ndof, ndof);
27 Mfullmass = ChMatrixDynamic<>(ndof, ndof);
28 Mfullmass.setIdentity();
29 inv_Mfullmass = ChMatrixDynamic<>(ndof, ndof);
30 inv_Mfullmass.setIdentity();
38 ChVariablesBodyOwnMass::operator=(other);
42 Maddedmass = other.Maddedmass;
43 Mfullmass = other.Mfullmass;
44 inv_Mfullmass = other.inv_Mfullmass;
49 assert(Mfullmass_in.rows() == Get_ndof());
50 assert(Mfullmass_in.cols() == Get_ndof());
104 assert(vect.size() == Get_ndof());
105 assert(result.size() == Get_ndof());
106 result = inv_Mfullmass * vect;
112 assert(vect.size() == Get_ndof());
113 assert(result.size() == Get_ndof());
114 result += inv_Mfullmass * vect;
120 assert(vect.size() == Get_ndof());
121 assert(result.size() == Get_ndof());
122 result += Mfullmass * vect;
132 const ChVectorConstRef vect,
133 const double c_a)
const {
134 int off = this->offset;
135 result.segment(off, 6) += Mfullmass*vect.segment(off, 6)*c_a;
143 assert(result.size() >= this->offset + Get_ndof());
144 for (
int i = 0; i < Get_ndof(); i++) {
145 result(this->offset + i) += c_a * Mfullmass(i, i);
154 for (
int row = 0; row < Get_ndof(); ++row)
155 for (
int col = 0; col < Get_ndof(); ++col)
156 storage.SetElement(insrow + row, inscol + col, c_a * Mfullmass(row, col));