proteus 1.9.0
C/C++/Fortran libraries
Loading...
Searching...
No Matches
ChVariablesBodyAddedMass.h
Go to the documentation of this file.
1// =============================================================================
2// PROJECT CHRONO - http://projectchrono.org
3//
4// Copyright (c) 2014 projectchrono.org
5// All rights reserved.
6//
7// Use of this source code is governed by a BSD-style license that can be found
8// in the LICENSE file at the top level of the distribution and at
9// http://projectchrono.org/license-chrono.txt.
10//
11// =============================================================================
12// Authors: Tristan de Lataillade, Chris Kees
13// =============================================================================
14
15#ifndef CHVARIABLESBODYADDEDMASS_H
16#define CHVARIABLESBODYADDEDMASS_H
17
18#include "chrono/solver/ChVariablesBodyOwnMass.h"
19
20namespace chrono {
21
27
28 class ChApi ChVariablesBodyAddedMass : public ChVariablesBodyOwnMass {
29
30 private:
31 int ndof;
33 ChMatrixDynamic<> Mmass;
35 ChMatrixDynamic<> Maddedmass;
37 ChMatrixDynamic<> Mfullmass;
38 ChMatrixDynamic<> inv_Mfullmass;
39
40 public:
43
46
47 /* /// Access the inertia matrix */
48 /* ChMatrix<>& GetMaddedmass() { return Maddedmass; } */
49
50 /* /// Access the inertia matrix */
51 /* ChMatrix<>& GetMmass() { return Mmass; } */
52
54 void SetMfullmass(ChMatrixDynamic<>& Mfullmass_in);
55
57 ChMatrixDynamic<>& GetMfullmass() { return Mfullmass; }
58
60 ChMatrixDynamic<>& GetInvMfullmass() { return inv_Mfullmass; }
61
62 /* /// Set the inertia matrix */
63 /* void SetBodyInertia(const ChMatrix33<>& minertia); */
64
65 /* /// Set the mass associated with translation of body */
66 /* void SetBodyMass(const double mmass); */
67
68 /* /// Get the mass associated with translation of body */
69 /* virtual double GetBodyMass() const override { return ChVariablesBodyOwnMass::mmass; } */
70
71 /* /// Access the 3x3 inertia matrix */
72 /* virtual ChMatrix33<>& GetBodyInertia() override { return ChVariablesBodyOwnInertia::inertia; } */
73
74 /* /// Set the mass associated with translation of body */
75 /* void SetBodyAddedMass(ChMatrixDynamic<>& Maddedmass_in); */
76
79 //virtual void Compute_invMb_v(ChVectorRef result, const ChVectorConstRef vect) const override;
80 virtual void ComputeMassInverseTimesVector(ChVectorRef result, ChVectorConstRef vect) const override;
81
84 virtual void Compute_inc_invMb_v(ChVectorRef result, ChVectorConstRef vect) const;
85
88 //virtual void Compute_inc_Mb_v(ChVectorRef result, const ChVectorConstRef vect) const override;
89 virtual void AddMassTimesVector(ChVectorRef results, ChVectorConstRef vect) const override;
90
97 //virtual void MultiplyAndAdd(ChVectorRef result,
98 // const ChVectorConstRef vect,
99 // const double c_a) const override;
100 virtual void AddMassTimesVectorInto(ChVectorRef result, ChVectorConstRef vect, const double ca) const override;
101
106 //virtual void DiagonalAdd(ChVectorRef result, const double c_a) const override;
107 virtual void AddMassDiagonalInto(ChVectorRef result, const double c_a) const override;
108
113 //virtual void Build_M(ChSparseMatrix& storage, int insrow, int inscol, const double c_a) override;
114 virtual void PasteMassInto(ChSparseMatrix& mat, unsigned int insrow, unsigned int inscol, const double c_a) const override;
115
116 };
117
118
119} // end namespace chrono
120
121#endif
ChMatrixDynamic & GetInvMfullmass()
Access the inverted inertia matrix.
ChMatrixDynamic & GetMfullmass()
Access the inertia matrix.