MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
drvhinge.h
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/mbdyn/struct/drvhinge.h,v 1.33 2017/01/12 14:46:43 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 
35 #ifndef DRVHINGE_H
36 #define DRVHINGE_H
37 
38 #include "joint.h"
39 #include "constltp.h"
40 
41 
42 /* DriveHingeJoint - begin */
43 
45 virtual public Elem, public Joint, public TplDriveOwner<Vec3> {
46 private:
47 
48 protected:
51  const Mat3x3 R1h;
52  const Mat3x3 R2h;
53 
56 
59 
61 
62  bool bFirstRes;
63 
64  void AssMat(FullSubMatrixHandler& WM, doublereal dCoef);
65  void AssVec(SubVectorHandler& WorkVec, doublereal dCoef);
66 
67 public:
68  /* Costruttore non banale */
69  DriveHingeJoint(unsigned int uL,
70  const DofOwner* pDO,
71  const TplDriveCaller<Vec3>* pDC,
72  const StructNode* pN1,
73  const StructNode* pN2,
74  const Mat3x3& R1,
75  const Mat3x3& R2,
76  flag fOut);
77 
78  /* Distruttore */
79  virtual ~DriveHingeJoint(void);
80 
81  /* Tipo di joint */
82  virtual Joint::Type GetJointType(void) const {
83  return DRIVEHINGE;
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 3;
100  };
101 
102  virtual std::ostream&
103  DescribeDof(std::ostream& out,
104  const char *prefix = "",
105  bool bInitial = false) const;
106 
107  virtual void
108  DescribeDof(std::vector<std::string>& desc,
109  bool bInitial = false,
110  int i = -1) const;
111 
112  virtual std::ostream&
113  DescribeEq(std::ostream& out,
114  const char *prefix = "",
115  bool bInitial = false) const;
116 
117  virtual void
118  DescribeEq(std::vector<std::string>& desc,
119  bool bInitial = false,
120  int i = -1) const;
121 
122  virtual DofOrder::Order GetDofType(unsigned int i) const {
123  ASSERT(i >= 0 && i <= 3);
124  return DofOrder::ALGEBRAIC;
125  };
126 
127  virtual void WorkSpaceDim(integer* piNumRows,
128  integer* piNumCols) const {
129  *piNumRows = 9;
130  *piNumCols = 9;
131  };
132 
133  /* assemblaggio jacobiano */
134  virtual VariableSubMatrixHandler&
136  doublereal dCoef,
137  const VectorHandler& XCurr,
138  const VectorHandler& XPrimeCurr);
139 
140  /* assemblaggio residuo */
141  virtual SubVectorHandler&
142  AssRes(SubVectorHandler& WorkVec,
143  doublereal dCoef,
144  const VectorHandler& XCurr,
145  const VectorHandler& XPrimeCurr);
146 
147  /* Aggiorna le deformazioni ecc. */
148  virtual void AfterPredict(VectorHandler& X, VectorHandler& XP);
149  /* funzioni usate nell'assemblaggio iniziale */
150  virtual unsigned int iGetInitialNumDof(void) const {
151  return 6;
152  };
153 
154  virtual void InitialWorkSpaceDim(integer* piNumRows,
155  integer* piNumCols) const {
156  *piNumRows = 18;
157  *piNumCols = 18;
158  };
159 
160  /* Contributo allo jacobiano durante l'assemblaggio iniziale */
161  virtual VariableSubMatrixHandler&
163  const VectorHandler& XCurr);
164 
165  /* Contributo al residuo durante l'assemblaggio iniziale */
166  virtual SubVectorHandler&
168  const VectorHandler& XCurr);
169 
170  /* Dati privati (aggiungere magari le reazioni vincolari) */
171  virtual unsigned int iGetNumPrivData(void) const;
172 
173  unsigned int iGetPrivDataIdx(const char *s) const;
174 
175  virtual doublereal dGetPrivData(unsigned int i = 0) const;
176 
177  /* *******PER IL SOLUTORE PARALLELO******** */
178  /* Fornisce il tipo e la label dei nodi che sono connessi all'elemento
179  utile per l'assemblaggio della matrice di connessione fra i dofs */
180  virtual void GetConnectedNodes(std::vector<const Node *>& connectedNodes) const {
181  connectedNodes.resize(2);
182  connectedNodes[0] = pNode1;
183  connectedNodes[1] = pNode2;
184  };
185  /* ************************************************ */
186 };
187 
188 /* DriveHingeJoint - end */
189 
190 #endif /* DRVHINGE_H */
191 
Definition: hint.h:38
virtual ~DriveHingeJoint(void)
Definition: drvhinge.cc:71
virtual Joint::Type GetJointType(void) const
Definition: drvhinge.h:82
Type
Definition: joint.h:66
virtual std::ostream & Restart(std::ostream &out) const
Definition: drvhinge.cc:79
long int flag
Definition: mbdyn.h:43
DriveHingeJoint(unsigned int uL, const DofOwner *pDO, const TplDriveCaller< Vec3 > *pDC, const StructNode *pN1, const StructNode *pN2, const Mat3x3 &R1, const Mat3x3 &R2, flag fOut)
Definition: drvhinge.cc:44
Definition: matvec3.h:98
virtual void AfterPredict(VectorHandler &X, VectorHandler &XP)
Definition: drvhinge.cc:391
virtual unsigned int iGetInitialNumDof(void) const
Definition: drvhinge.h:150
virtual DofOrder::Order GetDofType(unsigned int i) const
Definition: drvhinge.h:122
virtual Hint * ParseHint(DataManager *pDM, const char *s) const
Definition: drvhinge.cc:150
virtual void Output(OutputHandler &OH) const
Definition: drvhinge.cc:94
virtual doublereal dGetPrivData(unsigned int i=0) const
Definition: drvhinge.cc:329
virtual SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: drvhinge.cc:431
void SetValue(DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *ph=0)
Definition: drvhinge.cc:107
std::vector< Hint * > Hints
Definition: simentity.h:89
const Mat3x3 R1h
Definition: drvhinge.h:51
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: drvhinge.h:127
virtual unsigned int iGetNumPrivData(void) const
Definition: drvhinge.cc:288
virtual std::ostream & DescribeDof(std::ostream &out, const char *prefix="", bool bInitial=false) const
Definition: drvhinge.cc:174
virtual void GetConnectedNodes(std::vector< const Node * > &connectedNodes) const
Definition: drvhinge.h:180
virtual unsigned int iGetNumDof(void) const
Definition: drvhinge.h:98
unsigned int iGetPrivDataIdx(const char *s) const
Definition: drvhinge.cc:294
Mat3x3 RRef
Definition: drvhinge.h:55
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: drvhinge.h:154
const StructNode * pNode2
Definition: drvhinge.h:50
virtual VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: drvhinge.cc:352
virtual VariableSubMatrixHandler & InitialAssJac(VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
Definition: drvhinge.cc:490
#define ASSERT(expression)
Definition: colamd.c:977
Mat3x3 R1Ref
Definition: drvhinge.h:54
const StructNode * pNode1
Definition: drvhinge.h:49
Vec3 ThetaCurr
Definition: drvhinge.h:58
virtual SubVectorHandler & InitialAssRes(SubVectorHandler &WorkVec, const VectorHandler &XCurr)
Definition: drvhinge.cc:565
Definition: elem.h:75
void AssMat(FullSubMatrixHandler &WM, doublereal dCoef)
Definition: drvhinge.cc:414
void AssVec(SubVectorHandler &WorkVec, doublereal dCoef)
Definition: drvhinge.cc:465
virtual std::ostream & DescribeEq(std::ostream &out, const char *prefix="", bool bInitial=false) const
Definition: drvhinge.cc:232
const Mat3x3 R2h
Definition: drvhinge.h:52
Definition: joint.h:50
double doublereal
Definition: colamd.c:52
bool bFirstRes
Definition: drvhinge.h:62
long int integer
Definition: colamd.c:51