MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
vb.h
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/mbdyn/struct/vb.h,v 1.10 2017/01/12 14:46:44 masarati Exp $ */
2 /*
3  * MBDyn (C) is a multibody analysis code.
4  * http://www.mbdyn.org
5  *
6  * Copyright (C) 1996-2017
7  *
8  * Pierangelo Masarati <masarati@aero.polimi.it>
9  * Paolo Mantegazza <mantegazza@aero.polimi.it>
10  *
11  * Dipartimento di Ingegneria Aerospaziale - Politecnico di Milano
12  * via La Masa, 34 - 20156 Milano, Italy
13  * http://www.aero.polimi.it
14  *
15  * Changing this copyright notice is forbidden.
16  *
17  * This program is free software; you can redistribute it and/or modify
18  * it under the terms of the GNU General Public License as published by
19  * the Free Software Foundation (version 2 of the License).
20  *
21  *
22  * This program is distributed in the hope that it will be useful,
23  * but WITHOUT ANY WARRANTY; without even the implied warranty of
24  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25  * GNU General Public License for more details.
26  *
27  * You should have received a copy of the GNU General Public License
28  * along with this program; if not, write to the Free Software
29  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30  */
31 
32 /* Deformable hinges */
33 
34 #ifndef VB_H
35 #define VB_H
36 
37 #include "joint.h"
38 #include "constltp.h"
39 
40 
41 /* ViscousBody - begin */
42 
43 class ViscousBody :
44 virtual public Elem, public Joint, public ConstitutiveLaw6DOwner {
45 protected:
46  const StructNode* pNode;
47  mutable Vec3 tilde_f;
48  mutable Mat3x3 tilde_Rh;
49 
51 
53 
54  bool bFirstRes;
55 
58 
61 
62  void AssMats(FullSubMatrixHandler& WMA,
64  doublereal dCoef);
65  void AssVec(SubVectorHandler& WorkVec);
66 
67 public:
68  /* Costruttore non banale */
69  ViscousBody(unsigned int uL,
70  const DofOwner* pDO,
71  const ConstitutiveLaw6D* pCL,
72  const StructNode* pN,
73  const Vec3& tilde_f,
74  const Mat3x3& tilde_Rh,
76  flag fOut);
77 
78  /* Distruttore */
79  virtual ~ViscousBody(void);
80 
81  /* Tipo di Joint */
82  virtual Joint::Type GetJointType(void) const {
83  return Joint::VISCOUSBODY;
84  };
85 
86  /* Contributo al file di restart */
87  virtual std::ostream& Restart(std::ostream& out) const;
88 
89  virtual void Output(OutputHandler& OH) const;
90 
91  void SetValue(DataManager *pDM,
93  SimulationEntity::Hints *ph = 0);
94 
95  virtual Hint *
96  ParseHint(DataManager *pDM, const char *s) const;
97 
98  virtual unsigned int iGetNumDof(void) const {
99  return 0;
100  };
101 
102  virtual DofOrder::Order GetDofType(unsigned int /* i */ ) const {
103  return DofOrder::UNKNOWN;
104  };
105 
106  virtual void WorkSpaceDim(integer* piNumRows, integer* piNumCols) const {
107  *piNumRows = 6;
108  *piNumCols = 6;
109  };
110 
111  /* funzioni usate nell'assemblaggio iniziale */
112 
113  virtual unsigned int iGetInitialNumDof(void) const {
114  return 0;
115  };
116 
117  virtual unsigned int iGetNumPrivData(void) const;
118  virtual unsigned int iGetPrivDataIdx(const char *s) const;
119  virtual doublereal dGetPrivData(unsigned int i) const;
120 
121  /* *******PER IL SOLUTORE PARALLELO******** */
122  /* Fornisce il tipo e la label dei nodi che sono connessi all'elemento
123  utile per l'assemblaggio della matrice di connessione fra i dofs */
124  virtual void GetConnectedNodes(std::vector<const Node *>& connectedNodes) const {
125  connectedNodes.resize(1);
126  connectedNodes[0] = pNode;
127  };
128  /* ************************************************ */
129 
130  /* assemblaggio jacobiano */
131  virtual VariableSubMatrixHandler&
133  doublereal dCoef,
134  const VectorHandler& XCurr,
135  const VectorHandler& XPrimeCurr);
136 
137  /* assemblaggio jacobiano */
138  virtual void
140  VariableSubMatrixHandler& WorkMatB,
141  const VectorHandler& XCurr,
142  const VectorHandler& XPrimeCurr);
143 
144  /* assemblaggio residuo */
145  virtual SubVectorHandler&
146  AssRes(SubVectorHandler& WorkVec,
147  doublereal dCoef,
148  const VectorHandler& XCurr,
149  const VectorHandler& XPrimeCurr);
150 
151  /* inverse dynamics capable element */
152  virtual bool bInverseDynamics(void) const;
153 
154  /* Inverse Dynamics residual assembly */
156  AssRes(SubVectorHandler& WorkVec,
157  const VectorHandler& XCurr,
158  const VectorHandler& XPrimeCurr,
159  const VectorHandler& XPrimePrimeCurr,
161 
162  /* Contributo al residuo durante l'assemblaggio iniziale */
163  virtual SubVectorHandler&
164  InitialAssRes(SubVectorHandler& WorkVec, const VectorHandler& XCurr);
165 
166  /* Tipo di DeformableDispHinge */
167  virtual ConstLawType::Type GetConstLawType(void) const {
168  return ConstLawType::VISCOUS;
169  };
170 
171  virtual void
172  AfterConvergence(const VectorHandler& X, const VectorHandler& XP);
173 
174  /* Aggiorna le deformazioni ecc. */
175  virtual void AfterPredict(VectorHandler& X, VectorHandler& XP);
176 
177  /* Aggiorna le deformazioni ecc. */
178  virtual void
179  InitialWorkSpaceDim(integer* piNumRows, integer* piNumCols) const {
180  *piNumRows = 6;
181  *piNumCols = 6;
182  };
183 
184  /* Contributo allo jacobiano durante l'assemblaggio iniziale */
185  virtual VariableSubMatrixHandler&
187  const VectorHandler& XCurr);
188 
189 };
190 
191 /* ViscousBody - end */
192 
193 #endif // VB_H
194 
Definition: hint.h:38
Type
Definition: joint.h:66
void AssMats(FullSubMatrixHandler &WMA, FullSubMatrixHandler &WMB, doublereal dCoef)
Definition: vb.cc:398
virtual void AfterConvergence(const VectorHandler &X, const VectorHandler &XP)
Definition: vb.cc:472
bool bFirstRes
Definition: vb.h:54
long int flag
Definition: mbdyn.h:43
Definition: matvec3.h:98
Vec3 tilde_f
Definition: vb.h:47
virtual unsigned int iGetNumDof(void) const
Definition: vb.h:98
virtual SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: vb.cc:311
OrientationDescription
Definition: matvec3.h:1597
virtual unsigned int iGetInitialNumDof(void) const
Definition: vb.h:113
virtual void Output(OutputHandler &OH) const
Definition: vb.cc:95
virtual Hint * ParseHint(DataManager *pDM, const char *s) const
Definition: vb.cc:121
std::vector< Hint * > Hints
Definition: simentity.h:89
virtual ~ViscousBody(void)
Definition: vb.cc:75
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: vb.h:106
virtual VariableSubMatrixHandler & InitialAssJac(VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
Definition: vb.cc:480
Definition: vb.h:43
virtual Joint::Type GetJointType(void) const
Definition: vb.h:82
virtual doublereal dGetPrivData(unsigned int i) const
Definition: vb.cc:194
virtual VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: vb.cc:248
Vec6 tilde_kPrime
Definition: vb.h:52
Vec6 F
Definition: vb.h:59
virtual ConstLawType::Type GetConstLawType(void) const
Definition: vb.h:167
Definition: matvec6.h:37
Mat3x3 tilde_Rh
Definition: vb.h:48
virtual std::ostream & Restart(std::ostream &out) const
Definition: vb.cc:83
Mat6x6 FDEPrime
Definition: vb.h:60
OrientationDescription od
Definition: vb.h:50
virtual DofOrder::Order GetDofType(unsigned int) const
Definition: vb.h:102
virtual void GetConnectedNodes(std::vector< const Node * > &connectedNodes) const
Definition: vb.h:124
Mat3x3 Rh
Definition: vb.h:57
virtual void AfterPredict(VectorHandler &X, VectorHandler &XP)
Definition: vb.cc:448
virtual unsigned int iGetNumPrivData(void) const
Definition: vb.cc:127
virtual SubVectorHandler & InitialAssRes(SubVectorHandler &WorkVec, const VectorHandler &XCurr)
Definition: vb.cc:375
virtual unsigned int iGetPrivDataIdx(const char *s) const
Definition: vb.cc:133
Definition: elem.h:75
ViscousBody(unsigned int uL, const DofOwner *pDO, const ConstitutiveLaw6D *pCL, const StructNode *pN, const Vec3 &tilde_f, const Mat3x3 &tilde_Rh, const OrientationDescription &od, flag fOut)
Definition: vb.cc:43
Definition: joint.h:50
const StructNode * pNode
Definition: vb.h:46
void AssVec(SubVectorHandler &WorkVec)
Definition: vb.cc:424
virtual bool bInverseDynamics(void) const
Definition: vb.cc:337
void SetValue(DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *ph=0)
Definition: vb.cc:110
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
Vec3 f
Definition: vb.h:56
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: vb.h:179