proteus  1.8.1
C/C++/Fortran libraries
ChBodyAddedMass.h
Go to the documentation of this file.
1 #ifndef CHBODYADDEDMASS_H
2 #define CHBODYADDEDMASS_H
3 
4 #include "chrono/physics/ChBody.h"
6 
7 namespace chrono {
8  class ChBodyAddedMass : public ChBody {
9  protected:
11  public:
13  virtual ~ChBodyAddedMass() {}
14  void SetMass(double newmass);
15  void SetInertia(const ChMatrix33<>& iner);
16  void SetInertiaXX(const ChVector<>& iner);
17  void SetInertiaXY(const ChVector<>& iner);
18  /* ChVector<> GetInertiaXX(); */
19  /* ChVector<> GetInertiaXY(); */
20  /* double GetMass() { return variables.GetBodyMass(); }; */
21  /* const ChMatrix33<>& GetInertia() { return variables.GetBodyInertia(); } */
22  void SetMfullmass(ChMatrixDynamic<> Mfullmass_in);
23  void SetInvMfullmass(ChMatrixDynamic<> inv_Mfullmass_in);
24  ChVariables& Variables() override { return variables; }
25  ChVariablesBodyOwnMass& VariablesBody() { return variables; }
27  //
28  // STATE FUNCTIONS
29  //
30 
31  // (override/implement interfaces for global state vectors, see ChPhysicsItem for comments.)
32 
33  virtual void IntToDescriptor(const unsigned int off_v,
34  const ChStateDelta& v,
35  const ChVectorDynamic<>& R,
36  const unsigned int off_L,
37  const ChVectorDynamic<>& L,
38  const ChVectorDynamic<>& Qc) override;
39  virtual void IntFromDescriptor(const unsigned int off_v,
40  ChStateDelta& v,
41  const unsigned int off_L,
42  ChVectorDynamic<>& L) override;
43  virtual void IntLoadResidual_F(const unsigned int off, ChVectorDynamic<>& R, const double c) override;
44 
45  virtual void IntLoadResidual_Mv(const unsigned int off,
46  ChVectorDynamic<>& R,
47  const ChVectorDynamic<>& w,
48  const double c) override;
49 
50  //
51  // SOLVER FUNCTIONS
52  //
53 
54  // Override/implement solver system functions of ChPhysicsItem
55  // (to assemble/manage data for system solver)
56 
58  virtual void VariablesFbReset() override;
59 
62  virtual void VariablesFbLoadForces(double factor = 1) override;
63 
67  virtual void VariablesQbLoadSpeed() override;
68 
72  virtual void VariablesFbIncrementMq() override;
73 
80  virtual void VariablesQbSetSpeed(double step = 0) override;
81 
88  virtual void VariablesQbIncrementPosition(double step) override;
89 
92  virtual void InjectVariables(ChSystemDescriptor& mdescriptor) override;
93 
94  };
95 
96 } // end namespace chrono
97 
99 
100 #endif
101 
chrono::ChBodyAddedMass::InjectVariables
virtual void InjectVariables(ChSystemDescriptor &mdescriptor) override
Definition: ChBodyAddedMass.cpp:97
chrono::ChBodyAddedMass::SetMass
void SetMass(double newmass)
Definition: ChBodyAddedMass.cpp:13
chrono::ChBodyAddedMass::VariablesFbReset
virtual void VariablesFbReset() override
Sets the 'fb' part of the encapsulated ChVariablesBodyOwnMass to zero.
Definition: ChBodyAddedMass.cpp:102
w
#define w(x)
Definition: jf.h:22
newChBodyAddedMass
chrono::ChBodyAddedMass * newChBodyAddedMass()
Definition: ChBodyAddedMass.cpp:199
chrono::ChBodyAddedMass::ChBodyAddedMass
ChBodyAddedMass()
Definition: ChBodyAddedMass.cpp:9
chrono::ChBodyAddedMass::~ChBodyAddedMass
virtual ~ChBodyAddedMass()
Definition: ChBodyAddedMass.h:13
chrono::ChBodyAddedMass::Variables
ChVariables & Variables() override
Definition: ChBodyAddedMass.h:24
chrono::ChBodyAddedMass::variables
ChVariablesBodyAddedMass variables
Definition: ChBodyAddedMass.h:10
chrono::ChBodyAddedMass::VariablesQbSetSpeed
virtual void VariablesQbSetSpeed(double step=0) override
Definition: ChBodyAddedMass.cpp:127
L
Double L
Definition: Headers.h:72
chrono::ChBodyAddedMass::VariablesBody
ChVariablesBodyOwnMass & VariablesBody()
Definition: ChBodyAddedMass.h:25
chrono::ChBodyAddedMass::SetMfullmass
void SetMfullmass(ChMatrixDynamic<> Mfullmass_in)
Definition: ChBodyAddedMass.cpp:58
R
Double R
Definition: Headers.h:82
chrono::ChBodyAddedMass::IntLoadResidual_Mv
virtual void IntLoadResidual_Mv(const unsigned int off, ChVectorDynamic<> &R, const ChVectorDynamic<> &w, const double c) override
Definition: ChBodyAddedMass.cpp:186
chrono::ChBodyAddedMass::VariablesFbIncrementMq
virtual void VariablesFbIncrementMq() override
Definition: ChBodyAddedMass.cpp:117
v
Double v
Definition: Headers.h:95
chrono::ChBodyAddedMass::VariablesFbLoadForces
virtual void VariablesFbLoadForces(double factor=1) override
Definition: ChBodyAddedMass.cpp:106
chrono::ChVariablesBodyAddedMass
Definition: ChVariablesBodyAddedMass.h:28
c
Double c
Definition: Headers.h:54
chrono::ChBodyAddedMass::SetInertiaXY
void SetInertiaXY(const ChVector<> &iner)
Definition: ChBodyAddedMass.cpp:31
chrono::ChBodyAddedMass::IntFromDescriptor
virtual void IntFromDescriptor(const unsigned int off_v, ChStateDelta &v, const unsigned int off_L, ChVectorDynamic<> &L) override
Definition: ChBodyAddedMass.cpp:88
chrono::ChBodyAddedMass::SetInvMfullmass
void SetInvMfullmass(ChMatrixDynamic<> inv_Mfullmass_in)
ChVariablesBodyAddedMass.h
chrono::ChBodyAddedMass::VariablesBodyAddedMass
ChVariablesBodyAddedMass & VariablesBodyAddedMass()
Definition: ChBodyAddedMass.h:26
chrono
Definition: ChBodyAddedMass.cpp:4
chrono::ChBodyAddedMass::VariablesQbLoadSpeed
virtual void VariablesQbLoadSpeed() override
Definition: ChBodyAddedMass.cpp:121
chrono::ChBodyAddedMass::VariablesQbIncrementPosition
virtual void VariablesQbIncrementPosition(double step) override
Definition: ChBodyAddedMass.cpp:147
chrono::ChBodyAddedMass::IntToDescriptor
virtual void IntToDescriptor(const unsigned int off_v, const ChStateDelta &v, const ChVectorDynamic<> &R, const unsigned int off_L, const ChVectorDynamic<> &L, const ChVectorDynamic<> &Qc) override
Definition: ChBodyAddedMass.cpp:78
chrono::ChBodyAddedMass::IntLoadResidual_F
virtual void IntLoadResidual_F(const unsigned int off, ChVectorDynamic<> &R, const double c) override
Definition: ChBodyAddedMass.cpp:171
chrono::ChBodyAddedMass::SetInertiaXX
void SetInertiaXX(const ChVector<> &iner)
Definition: ChBodyAddedMass.cpp:23
chrono::ChBodyAddedMass
Definition: ChBodyAddedMass.h:8
chrono::ChBodyAddedMass::SetInertia
void SetInertia(const ChMatrix33<> &iner)
Definition: ChBodyAddedMass.cpp:18