MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
spherj.h
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/mbdyn/struct/spherj.h,v 1.28 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 /* Giunti sferici */
33 
34 #ifndef SPHERJ_H
35 #define SPHERJ_H
36 
37 #include "joint.h"
38 
39 
40 /* SphericalHingeJoint - begin */
41 
42 class SphericalHingeJoint : virtual public Elem, public Joint {
43  private:
46 #ifdef USE_NETCDF
47  NcVar *Var_Phi;
48 #endif // USE_NETCDF
54 
55  protected:
57 
58  public:
59  /* Costruttore non banale */
60  SphericalHingeJoint(unsigned int uL, const DofOwner* pDO,
61  const StructNode* pN1, const StructNode* pN2,
62  const Vec3& dTmp1, const Mat3x3& RTmp1h,
63  const Vec3& dTmp2, const Mat3x3& RTmp2h,
65  flag fOut);
66 
68 
69  /* Tipo di Joint */
70  virtual Joint::Type GetJointType(void) const {
71  return Joint::SPHERICALHINGE;
72  };
73 
74  /* Contributo al file di restart */
75  virtual std::ostream& Restart(std::ostream& out) const;
76 
77  virtual unsigned int iGetNumDof(void) const {
78  return 3;
79  };
80 
81  virtual DofOrder::Order GetDofType(unsigned int i) const {
82  ASSERT(i >= 0 && i < 3);
83  return DofOrder::ALGEBRAIC;
84  };
85 
86  virtual void WorkSpaceDim(integer* piNumRows, integer* piNumCols) const {
87  *piNumRows = 15;
88  *piNumCols = 15;
89  };
90 
92  doublereal dCoef,
93  const VectorHandler& XCurr,
94  const VectorHandler& XPrimeCurr);
96  doublereal dCoef,
97  const VectorHandler& XCurr,
98  const VectorHandler& XPrimeCurr);
99 
100  DofOrder::Order GetEqType(unsigned int i) const;
101 
102  void OutputPrepare(OutputHandler &OH);
103  virtual void Output(OutputHandler& OH) const;
104 
105  virtual void SetValue(DataManager *pDM,
107  SimulationEntity::Hints *ph = 0);
108 
109  virtual Hint *
110  ParseHint(DataManager *pDM, const char *s) const;
111 
112  /* funzioni usate nell'assemblaggio iniziale */
113 
114  virtual unsigned int iGetInitialNumDof(void) const {
115  return 6;
116  };
117  virtual void InitialWorkSpaceDim(integer* piNumRows,
118  integer* piNumCols) const {
119  *piNumRows = 30;
120  *piNumCols = 30;
121  };
122 
123  /* Contributo allo jacobiano durante l'assemblaggio iniziale */
125  const VectorHandler& XCurr);
126 
127  /* Contributo al residuo durante l'assemblaggio iniziale */
129  const VectorHandler& XCurr);
130 
131 #ifdef DEBUG
132  virtual const char* sClassName(void) const {
133  return "SphericalHingeJoint";
134  };
135 #endif
136 
137  /* *******PER IL SOLUTORE PARALLELO******** */
138  /* Fornisce il tipo e la label dei nodi che sono connessi all'elemento
139  utile per l'assemblaggio della matrice di connessione fra i dofs */
140  virtual void GetConnectedNodes(std::vector<const Node *>& connectedNodes) const {
141  connectedNodes.resize(2);
142  connectedNodes[0] = pNode1;
143  connectedNodes[1] = pNode2;
144  };
145  /* ************************************************ */
146 };
147 
148 /* SphericalHingeJoint - end */
149 
150 
151 /* PinJoint - begin */
152 
153 /* Incastro con liberta' di rotazione sui tre assi */
154 
155 class PinJoint : virtual public Elem, public Joint {
156  private:
161 
162  public:
163  /* Costruttore non banale */
164  PinJoint(unsigned int uL, const DofOwner* pDO,
165  const StructNode* pN,
166  const Vec3& X0Tmp, const Vec3& dTmp, flag fOut);
167 
168  ~PinJoint(void);
169 
170  /* Tipo di Joint */
171  virtual Joint::Type GetJointType(void) const {
172  return Joint::PIN;
173  };
174 
175  /* Contributo al file di restart */
176  virtual std::ostream& Restart(std::ostream& out) const;
177 
178  virtual unsigned int iGetNumDof(void) const {
179  return 3;
180  };
181 
182  virtual DofOrder::Order GetDofType(unsigned int i) const {
183  ASSERT(i >= 0 && i < 3);
184  return DofOrder::ALGEBRAIC;
185  };
186 
187  virtual void WorkSpaceDim(integer* piNumRows, integer* piNumCols) const {
188  *piNumRows = 9;
189  *piNumCols = 9;
190  };
191 
193  doublereal dCoef,
194  const VectorHandler& XCurr,
195  const VectorHandler& XPrimeCurr);
197  doublereal dCoef,
198  const VectorHandler& XCurr,
199  const VectorHandler& XPrimeCurr);
200 
201  DofOrder::Order GetEqType(unsigned int i) const;
202 
203  virtual void Output(OutputHandler& OH) const;
204 
205 
206  /* funzioni usate nell'assemblaggio iniziale */
207 
208  virtual unsigned int iGetInitialNumDof(void) const {
209  return 6;
210  };
211  virtual void InitialWorkSpaceDim(integer* piNumRows,
212  integer* piNumCols) const {
213  *piNumRows = 18;
214  *piNumCols = 18;
215  };
216 
217  /* Contributo allo jacobiano durante l'assemblaggio iniziale */
219  const VectorHandler& XCurr);
220 
221  /* Contributo al residuo durante l'assemblaggio iniziale */
223  const VectorHandler& XCurr);
224 
225 #ifdef DEBUG
226  virtual const char* sClassName(void) const {
227  return "PinJoint";
228  };
229 #endif
230 
231  /* *******PER IL SOLUTORE PARALLELO******** */
232  /* Fornisce il tipo e la label dei nodi che sono connessi all'elemento
233  utile per l'assemblaggio della matrice di connessione fra i dofs */
234  virtual void GetConnectedNodes(std::vector<const Node *>& connectedNodes) const {
235  connectedNodes.resize(1);
236  connectedNodes[0] = pNode;
237  };
238  /* ************************************************ */
239 };
240 
241 /* PinJoint - end */
242 
243 #endif
Definition: hint.h:38
virtual void SetValue(DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *ph=0)
Definition: spherj.cc:321
Type
Definition: joint.h:66
long int flag
Definition: mbdyn.h:43
Vec3 X0
Definition: spherj.h:158
~PinJoint(void)
Definition: spherj.cc:586
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: spherj.h:211
Definition: matvec3.h:98
const StructNode * pNode1
Definition: spherj.h:44
VariableSubMatrixHandler & InitialAssJac(VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
Definition: spherj.cc:376
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: spherj.h:86
VariableSubMatrixHandler & InitialAssJac(VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
Definition: spherj.cc:735
const StructNode * pNode
Definition: spherj.h:157
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: spherj.h:117
virtual void Output(OutputHandler &OH) const
Definition: spherj.cc:238
OrientationDescription
Definition: matvec3.h:1597
virtual std::ostream & Restart(std::ostream &out) const
Definition: spherj.cc:593
virtual unsigned int iGetInitialNumDof(void) const
Definition: spherj.h:208
virtual unsigned int iGetNumDof(void) const
Definition: spherj.h:77
DofOrder::Order GetEqType(unsigned int i) const
Definition: spherj.cc:215
std::vector< Hint * > Hints
Definition: simentity.h:89
virtual DofOrder::Order GetDofType(unsigned int i) const
Definition: spherj.h:182
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: spherj.h:187
Vec3 d
Definition: spherj.h:159
OrientationDescription od
Definition: spherj.h:56
SubVectorHandler & InitialAssRes(SubVectorHandler &WorkVec, const VectorHandler &XCurr)
Definition: spherj.cc:497
const StructNode * pNode2
Definition: spherj.h:45
virtual unsigned int iGetInitialNumDof(void) const
Definition: spherj.h:114
SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: spherj.cc:166
virtual Joint::Type GetJointType(void) const
Definition: spherj.h:70
SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: spherj.cc:673
virtual std::ostream & Restart(std::ostream &out) const
Definition: spherj.cc:73
SphericalHingeJoint(unsigned int uL, const DofOwner *pDO, const StructNode *pN1, const StructNode *pN2, const Vec3 &dTmp1, const Mat3x3 &RTmp1h, const Vec3 &dTmp2, const Mat3x3 &RTmp2h, const OrientationDescription &od, flag fOut)
Definition: spherj.cc:43
PinJoint(unsigned int uL, const DofOwner *pDO, const StructNode *pN, const Vec3 &X0Tmp, const Vec3 &dTmp, flag fOut)
Definition: spherj.cc:575
VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: spherj.cc:89
#define ASSERT(expression)
Definition: colamd.c:977
virtual DofOrder::Order GetDofType(unsigned int i) const
Definition: spherj.h:81
virtual void GetConnectedNodes(std::vector< const Node * > &connectedNodes) const
Definition: spherj.h:140
virtual void Output(OutputHandler &OH) const
Definition: spherj.cc:724
virtual void GetConnectedNodes(std::vector< const Node * > &connectedNodes) const
Definition: spherj.h:234
Definition: elem.h:75
virtual Joint::Type GetJointType(void) const
Definition: spherj.h:171
DofOrder::Order GetEqType(unsigned int i) const
Definition: spherj.cc:717
~SphericalHingeJoint(void)
Definition: spherj.cc:66
Definition: joint.h:50
VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: spherj.cc:606
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
Vec3 F
Definition: spherj.h:160
SubVectorHandler & InitialAssRes(SubVectorHandler &WorkVec, const VectorHandler &XCurr)
Definition: spherj.cc:819
void OutputPrepare(OutputHandler &OH)
Definition: spherj.cc:222
virtual Hint * ParseHint(DataManager *pDM, const char *s) const
Definition: spherj.cc:353
virtual unsigned int iGetNumDof(void) const
Definition: spherj.h:178