MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
drvj.h
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/mbdyn/struct/drvj.h,v 1.25 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 /* Giunti di velocita' imposta */
33 
34 
35 #ifndef DRVJ_H
36 #define DRVJ_H
37 
38 #include "joint.h"
39 #include "drive.h"
40 
41 /* LinearVelocityJoint - begin */
42 
44 : virtual public Elem, public Joint, public DriveOwner {
45  private:
46  const StructNode* pNode;
49 
50  public:
51  /* Costruttore non banale */
52  LinearVelocityJoint(unsigned int uL,
53  const DofOwner* pDO,
54  const StructNode* pN,
55  const Vec3& TmpDir,
56  const DriveCaller* pDC,
57  flag fOut);
58 
59  /* Distruttore */
61 
62  /* Tipo di Joint */
63  virtual Joint::Type GetJointType(void) const
64  { return Joint::LINEARVELOCITY; };
65 
66  /* Contributo al file di restart */
67  virtual std::ostream& Restart(std::ostream& out) const;
68 
69  virtual unsigned int iGetNumDof(void) const {
70  return 1;
71  };
72 
73  DofOrder::Order GetDofType(unsigned int i) const
74  {
75  ASSERT(i == 0);
76  return DofOrder::ALGEBRAIC;
77  };
78 
79  void WorkSpaceDim(integer* piNumRows, integer* piNumCols) const
80  { *piNumRows = 4; *piNumCols = 4; };
81 
82 
84  doublereal dCoef,
85  const VectorHandler& XCurr,
86  const VectorHandler& XPrimeCurr);
88  doublereal dCoef,
89  const VectorHandler& XCurr,
90  const VectorHandler& XPrimeCurr);
91 
92  void Output(OutputHandler& OH) const;
93 
94 
95  /* funzioni usate nell'assemblaggio iniziale */
96 
97  virtual unsigned int iGetInitialNumDof(void) const { return 1; };
98  virtual void InitialWorkSpaceDim(integer* piNumRows,
99  integer* piNumCols) const {
100  *piNumRows = 4;
101  *piNumCols = 4;
102  };
103 
104  /* Contributo allo jacobiano durante l'assemblaggio iniziale */
106  const VectorHandler& XCurr);
107 
108  /* Contributo al residuo durante l'assemblaggio iniziale */
110  const VectorHandler& XCurr);
111 
112  /* dati privati */
113  virtual unsigned int iGetNumPrivData(void) const;
114  virtual unsigned int iGetPrivDataIdx(const char *s) const;
115  virtual doublereal dGetPrivData(unsigned int i = 0) const;
116 
117  /* *******PER IL SOLUTORE PARALLELO******** */
118  /* Fornisce il tipo e la label dei nodi che sono connessi all'elemento
119  utile per l'assemblaggio della matrice di connessione fra i dofs */
120  virtual void GetConnectedNodes(std::vector<const Node *>& connectedNodes) const {
121  connectedNodes.resize(1);
122  connectedNodes[0] = pNode;
123  };
124  /* ************************************************ */
125 
126 };
127 
128 /* LinearVelocityJoint - end */
129 
130 
131 /* AngularVelocityJoint - begin */
132 
134 : virtual public Elem, public Joint, public DriveOwner {
135  private:
139 
140  public:
141  /* Costruttore non banale */
142  AngularVelocityJoint(unsigned int uL,
143  const DofOwner* pDO,
144  const StructNode* pN,
145  const Vec3& TmpDir,
146  const DriveCaller* pDC,
147  flag fOut);
148 
149  /* Distruttore */
150  ~AngularVelocityJoint(void);
151 
152  /* Tipo di Joint */
153  virtual Joint::Type GetJointType(void) const
154  { return Joint::ANGULARVELOCITY; };
155 
156  /* Contributo al file di restart */
157  virtual std::ostream& Restart(std::ostream& out) const;
158 
159  virtual unsigned int iGetNumDof(void) const {
160  return 1;
161  };
162 
163  DofOrder::Order GetDofType(unsigned int i) const
164  {
165  ASSERT(i == 0);
166  return DofOrder::ALGEBRAIC;
167  };
168 
169  void WorkSpaceDim(integer* piNumRows, integer* piNumCols) const
170  { *piNumRows = 4; *piNumCols = 4; };
171 
172 
174  doublereal dCoef,
175  const VectorHandler& XCurr,
176  const VectorHandler& XPrimeCurr);
178  doublereal dCoef,
179  const VectorHandler& XCurr,
180  const VectorHandler& XPrimeCurr);
181 
182  void Output(OutputHandler& OH) const;
183 
184 
185  /* funzioni usate nell'assemblaggio iniziale */
186 
187  virtual unsigned int iGetInitialNumDof(void) const {
188  return 1;
189  };
190 
191  virtual void InitialWorkSpaceDim(integer* piNumRows,
192  integer* piNumCols) const {
193  *piNumRows = 4;
194  *piNumCols = 7;
195  };
196 
197  /* Contributo allo jacobiano durante l'assemblaggio iniziale */
199  const VectorHandler& XCurr);
200 
201  /* Contributo al residuo durante l'assemblaggio iniziale */
203  const VectorHandler& XCurr);
204 
205  /* Dati privati */
206  virtual unsigned int iGetNumPrivData(void) const;
207  virtual unsigned int iGetPrivDataIdx(const char *s) const;
208  virtual doublereal dGetPrivData(unsigned int i = 0) const;
209 
210  /* *******PER IL SOLUTORE PARALLELO******** */
211  /* Fornisce il tipo e la label dei nodi che sono connessi all'elemento
212  utile per l'assemblaggio della matrice di connessione fra i dofs */
213  virtual void GetConnectedNodes(std::vector<const Node *>& connectedNodes) const {
214  connectedNodes.resize(1);
215  connectedNodes[0] = pNode;
216  };
217  /* ************************************************ */
218 };
219 
220 /* AngularVelocityJoint - end */
221 
222 #endif
virtual unsigned int iGetNumPrivData(void) const
Definition: drvj.cc:73
const StructNode * pNode
Definition: drvj.h:46
AngularVelocityJoint(unsigned int uL, const DofOwner *pDO, const StructNode *pN, const Vec3 &TmpDir, const DriveCaller *pDC, flag fOut)
Definition: drvj.cc:253
virtual void GetConnectedNodes(std::vector< const Node * > &connectedNodes) const
Definition: drvj.h:213
virtual doublereal dGetPrivData(unsigned int i=0) const
Definition: drvj.cc:304
Type
Definition: joint.h:66
virtual unsigned int iGetInitialNumDof(void) const
Definition: drvj.h:187
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: drvj.h:98
VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: drvj.cc:312
doublereal dF
Definition: drvj.h:48
long int flag
Definition: mbdyn.h:43
Definition: matvec3.h:98
virtual unsigned int iGetNumDof(void) const
Definition: drvj.h:159
~LinearVelocityJoint(void)
Definition: drvj.cc:57
VariableSubMatrixHandler & InitialAssJac(VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
Definition: drvj.cc:182
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: drvj.h:191
DofOrder::Order GetDofType(unsigned int i) const
Definition: drvj.h:73
virtual unsigned int iGetInitialNumDof(void) const
Definition: drvj.h:97
virtual unsigned int iGetPrivDataIdx(const char *s) const
Definition: drvj.cc:292
DofOrder::Order GetDofType(unsigned int i) const
Definition: drvj.h:163
void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: drvj.h:169
virtual unsigned int iGetNumPrivData(void) const
Definition: drvj.cc:286
SubVectorHandler & InitialAssRes(SubVectorHandler &WorkVec, const VectorHandler &XCurr)
Definition: drvj.cc:433
void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: drvj.h:79
virtual std::ostream & Restart(std::ostream &out) const
Definition: drvj.cc:63
LinearVelocityJoint(unsigned int uL, const DofOwner *pDO, const StructNode *pN, const Vec3 &TmpDir, const DriveCaller *pDC, flag fOut)
Definition: drvj.cc:41
virtual doublereal dGetPrivData(unsigned int i=0) const
Definition: drvj.cc:91
~AngularVelocityJoint(void)
Definition: drvj.cc:269
virtual Joint::Type GetJointType(void) const
Definition: drvj.h:153
SubVectorHandler & InitialAssRes(SubVectorHandler &WorkVec, const VectorHandler &XCurr)
Definition: drvj.cc:207
virtual std::ostream & Restart(std::ostream &out) const
Definition: drvj.cc:276
#define ASSERT(expression)
Definition: colamd.c:977
VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: drvj.cc:99
SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: drvj.cc:126
Definition: elem.h:75
SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: drvj.cc:344
doublereal dM
Definition: drvj.h:138
Definition: joint.h:50
virtual void GetConnectedNodes(std::vector< const Node * > &connectedNodes) const
Definition: drvj.h:120
const StructNode * pNode
Definition: drvj.h:136
double doublereal
Definition: colamd.c:52
void Output(OutputHandler &OH) const
Definition: drvj.cc:170
long int integer
Definition: colamd.c:51
VariableSubMatrixHandler & InitialAssJac(VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
Definition: drvj.cc:401
virtual unsigned int iGetPrivDataIdx(const char *s) const
Definition: drvj.cc:79
virtual Joint::Type GetJointType(void) const
Definition: drvj.h:63
virtual unsigned int iGetNumDof(void) const
Definition: drvj.h:69
void Output(OutputHandler &OH) const
Definition: drvj.cc:387