proteus  1.8.1
C/C++/Fortran libraries
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
13 // =============================================================================
14 
15 #ifndef CHVARIABLESBODYADDEDMASS_H
16 #define CHVARIABLESBODYADDEDMASS_H
17 
18 #include "chrono/solver/ChVariablesBodyOwnMass.h"
19 
20 namespace 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 
45  ChVariablesBodyAddedMass& operator=(const ChVariablesBodyAddedMass& other);
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 
83  virtual void Compute_inc_invMb_v(ChVectorRef result, const ChVectorConstRef vect) const override;
84 
87  virtual void Compute_inc_Mb_v(ChVectorRef result, const ChVectorConstRef vect) const override;
88 
95  virtual void MultiplyAndAdd(ChVectorRef result,
96  const ChVectorConstRef vect,
97  const double c_a) const override;
98 
103  virtual void DiagonalAdd(ChVectorRef result, const double c_a) const override;
104 
109  virtual void Build_M(ChSparseMatrix& storage, int insrow, int inscol, const double c_a) override;
110 
111 };
112 
113 
114 } // end namespace chrono
115 
116 #endif
chrono::ChVariablesBodyAddedMass::~ChVariablesBodyAddedMass
virtual ~ChVariablesBodyAddedMass()
Definition: ChVariablesBodyAddedMass.h:42
chrono::ChVariablesBodyAddedMass
Definition: ChVariablesBodyAddedMass.h:28
chrono::ChVariablesBodyAddedMass::GetMfullmass
ChMatrixDynamic & GetMfullmass()
Access the inertia matrix.
Definition: ChVariablesBodyAddedMass.h:57
chrono
Definition: ChBodyAddedMass.cpp:4
chrono::ChVariablesBodyAddedMass::GetInvMfullmass
ChMatrixDynamic & GetInvMfullmass()
Access the inverted inertia matrix.
Definition: ChVariablesBodyAddedMass.h:60