MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
brake.h
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/mbdyn/struct/brake.h,v 1.20 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 
33 #ifndef BRAKEJ_H
34 #define BRAKEJ_H
35 
36 #include "joint.h"
37 #include "drive.h"
38 #include "friction.h"
39 
40 /* Brake - begin */
41 
42 class Brake : virtual public Elem, public Joint {
43  private:
44  /*
45  * Brake
46  *
47  * rotation axis about local axis 3
48  */
49 
50  /* Freno - asse di rotazione dato dall'asse 3 del sistema di
51  * riferimento della cerniera. Tale sistema e' noto relativamente ai due
52  * nodi. In particolare rispetto al nodo 1 la trasformazione dal sistema
53  * di riferimento della cerniera al sistema globale e': R1*R1h, mentre per
54  * il nodo 2 la medesima trasformazion e': R2*R2h.
55  * I vettori d1 e d2 esprimono, nel sistema di riferimento dei rispettivi
56  * nodi, la distanza della cerniera dai nodi stessi.
57  * I vettori F, M esprimono le reazioni vincolari di forza e coppia. */
64  //Vec3 F;
66 
67  /* if the brake generates a force, Dir is the direction
68  * with respect to node 1 (supposed to be the fixed one) */
69 #if 0
70  bool isForce;
71  Vec3 Dir;
72 #endif
73 
74  mutable doublereal dTheta;
75 
76  /* friction related data */
78  BasicFriction *const fc;
80  const doublereal r;
82  static const unsigned int NumSelfDof;
83  static const unsigned int NumDof;
84  /* end of friction related data */
85 
86  public:
87  /* Costruttore non banale */
88  Brake(unsigned int uL, const DofOwner* pDO,
89  const StructNode* pN1, const StructNode* pN2,
90  const Vec3& dTmp1, const Vec3& dTmp2,
91  const Mat3x3& R1hTmp, const Mat3x3& R2hTmp, flag fOut,
92  const doublereal rr,
93  const doublereal pref,
95  BasicFriction *const f,
96 #if 0
97  bool isforce,
98  const Vec3& dir,
99 #endif
100  DriveCaller *pdc);
101 
102  /* Distruttore */
103  ~Brake(void);
104 
105  /* Contributo al file di restart */
106  virtual std::ostream& Restart(std::ostream& out) const;
107 
108  /* Tipo di Joint */
109  virtual Joint::Type GetJointType(void) const {
110  return Joint::BRAKE;
111  };
112 
113  virtual unsigned int iGetNumDof(void) const;
114 
115  DofOrder::Order GetDofType(unsigned int i) const;
116 
117  virtual void SetValue(DataManager *pDM,
119  SimulationEntity::Hints *ph = 0);
120 
121  virtual void AfterConvergence(const VectorHandler& X,
122  const VectorHandler& XP);
123 
124  void WorkSpaceDim(integer* piNumRows, integer* piNumCols) const {
125  *piNumRows = NumDof;
126  *piNumCols = NumDof;
127  if (fc) {
128  *piNumRows += fc->iGetNumDof();
129  *piNumCols += fc->iGetNumDof();
130  }
131  };
132 
133 
135  doublereal dCoef,
136  const VectorHandler& XCurr,
137  const VectorHandler& XPrimeCurr);
139  doublereal dCoef,
140  const VectorHandler& XCurr,
141  const VectorHandler& XPrimeCurr);
142 
143  DofOrder::Order GetEqType(unsigned int i) const;
144 
145  void Output(OutputHandler& OH) const;
146 
147 
148  /* funzioni usate nell'assemblaggio iniziale */
149 
150  virtual unsigned int iGetInitialNumDof(void) const {
151  return 10;
152  };
153  virtual void InitialWorkSpaceDim(integer* piNumRows,
154  integer* piNumCols) const {
155  *piNumRows = 34;
156  *piNumCols = 34;
157  };
158 
159  /* Contributo allo jacobiano durante l'assemblaggio iniziale */
161  const VectorHandler& XCurr);
162 
163  /* Contributo al residuo durante l'assemblaggio iniziale */
165  const VectorHandler& XCurr);
166 
167  /* Dati privati */
168  virtual unsigned int iGetNumPrivData(void) const;
169  virtual unsigned int iGetPrivDataIdx(const char *s) const;
170  virtual doublereal dGetPrivData(unsigned int i) const;
171 
172  /* *******PER IL SOLUTORE PARALLELO******** */
173  /* Fornisce il tipo e la label dei nodi che sono connessi all'elemento
174  utile per l'assemblaggio della matrice di connessione fra i dofs */
175  virtual void GetConnectedNodes(std::vector<const Node *>& connectedNodes) const {
176  connectedNodes.resize(2);
177  connectedNodes[0] = pNode1;
178  connectedNodes[1] = pNode2;
179  };
180  /* ************************************************ */
181 };
182 
183 /* Brake - end */
184 
185 
186 
187 #endif /* PLANEJ_H */
188 
Mat3x3 R2h
Definition: brake.h:63
Type
Definition: joint.h:66
Definition: brake.h:42
static void sh(int signum)
long int flag
Definition: mbdyn.h:43
Definition: matvec3.h:98
doublereal dTheta
Definition: brake.h:74
VariableSubMatrixHandler & InitialAssJac(VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
Definition: brake.cc:460
const StructNode * pNode2
Definition: brake.h:59
static const unsigned int NumDof
Definition: brake.h:83
VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: brake.cc:133
const doublereal preF
Definition: brake.h:79
Vec3 d1
Definition: brake.h:60
std::vector< Hint * > Hints
Definition: simentity.h:89
DofOrder::Order GetDofType(unsigned int i) const
Definition: brake.cc:417
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: brake.h:153
DofOrder::Order GetEqType(unsigned int i) const
Definition: brake.cc:427
virtual std::ostream & Restart(std::ostream &out) const
Definition: brake.cc:115
virtual Joint::Type GetJointType(void) const
Definition: brake.h:109
void Output(OutputHandler &OH) const
Definition: brake.cc:439
virtual doublereal dGetPrivData(unsigned int i) const
Definition: brake.cc:509
virtual void GetConnectedNodes(std::vector< const Node * > &connectedNodes) const
Definition: brake.h:175
virtual unsigned int iGetNumDof(void) const
Definition: brake.cc:407
virtual void SetValue(DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *ph=0)
Definition: brake.cc:76
virtual unsigned int iGetPrivDataIdx(const char *s) const
Definition: brake.cc:493
BasicFriction *const fc
Definition: brake.h:78
~Brake(void)
Definition: brake.cc:70
DriveOwner brakeForce
Definition: brake.h:81
SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: brake.cc:317
virtual unsigned int iGetNumDof(void) const =0
virtual void AfterConvergence(const VectorHandler &X, const VectorHandler &XP)
Definition: brake.cc:89
virtual unsigned int iGetNumPrivData(void) const
Definition: brake.cc:486
Definition: elem.h:75
void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: brake.h:124
BasicShapeCoefficient *const Sh_c
Definition: brake.h:77
Definition: joint.h:50
const StructNode * pNode1
Definition: brake.h:58
double doublereal
Definition: colamd.c:52
Brake(unsigned int uL, const DofOwner *pDO, const StructNode *pN1, const StructNode *pN2, const Vec3 &dTmp1, const Vec3 &dTmp2, const Mat3x3 &R1hTmp, const Mat3x3 &R2hTmp, flag fOut, const doublereal rr, const doublereal pref, BasicShapeCoefficient *const sh, BasicFriction *const f, DriveCaller *pdc)
Definition: brake.cc:44
long int integer
Definition: colamd.c:51
virtual unsigned int iGetInitialNumDof(void) const
Definition: brake.h:150
static const unsigned int NumSelfDof
Definition: brake.h:82
Vec3 d2
Definition: brake.h:62
SubVectorHandler & InitialAssRes(SubVectorHandler &WorkVec, const VectorHandler &XCurr)
Definition: brake.cc:473
const doublereal r
Definition: brake.h:80
Vec3 M
Definition: brake.h:65
Mat3x3 R1h
Definition: brake.h:61