MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
inplanej.h
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/mbdyn/struct/inplanej.h,v 1.26 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 /* Vincolo di giacitura in un piano */
33 
34 #ifndef INPLANEJ_H
35 #define INPLANEJ_H
36 
37 #include "joint.h"
38 
39 /* InPlaneJoint - begin */
40 
41 /* Vincolo di giacenza in un piano:
42  * si impone che il corpo b giaccia in un piano solidale al corpo a,
43  * definito dalla posizione di un punto p
44  * e da una direzione a partire da tale punto, v.
45  * La reazione vincolare e' una forza di modulo F e direzione v
46  * applicata nel punto di contatto. Quindi per ipotesi la forza e' applicata
47  * al sorpo b e non da' momento su di esso, mentre e' applicata nel punto
48  * di contatto al corpo a e da' un momento pari alla distanza tra il punto
49  * di contatto ed il corpo a moltiplicato per la forza.
50  */
51 
52 class InPlaneJoint : virtual public Elem, public Joint {
53  private:
56 
57  const Vec3 v;
58  const Vec3 p;
59 
61 
62  public:
63  /* Costruttore non banale */
64  InPlaneJoint(unsigned int uL, const DofOwner* pDO,
65  const StructNode* pN1, const StructNode* pN2,
66  const Vec3& vTmp, const Vec3& pTmp, flag fOut);
67 
68  ~InPlaneJoint(void);
69 
70  /* Tipo di joint */
71  virtual Joint::Type GetJointType(void) const {
72  return INPLANE;
73  };
74 
75  /* Contributo al file di restart */
76  virtual std::ostream& Restart(std::ostream& out) const;
77 
78  virtual unsigned int iGetNumDof(void) const {
79  return 1;
80  };
81 
82 #ifdef DEBUG
83  virtual DofOrder::Order GetDofType(unsigned int i) const
84 #else
85  virtual DofOrder::Order GetDofType(unsigned int /* i */ ) const
86 #endif
87  {
88  ASSERT(i == 0);
89  return DofOrder::ALGEBRAIC;
90  };
91 
92  virtual void WorkSpaceDim(integer* piNumRows, integer* piNumCols) const {
93  *piNumRows = 13;
94  *piNumCols = 13;
95  };
96 
98  doublereal dCoef,
99  const VectorHandler& XCurr,
100  const VectorHandler& XPrimeCurr);
102  doublereal dCoef,
103  const VectorHandler& XCurr,
104  const VectorHandler& XPrimeCurr);
105 
106  virtual void Output(OutputHandler& OH) const;
107 
108 
109  /* funzioni usate nell'assemblaggio iniziale */
110 
111  virtual unsigned int iGetInitialNumDof(void) const { return 2; };
112  virtual void InitialWorkSpaceDim(integer* piNumRows,
113  integer* piNumCols) const
114  { *piNumRows = 26; *piNumCols = 26; };
115 
116  /* Contributo allo jacobiano durante l'assemblaggio iniziale */
118  const VectorHandler& XCurr);
119 
120  /* Contributo al residuo durante l'assemblaggio iniziale */
122  const VectorHandler& XCurr);
123 
124  /* Setta il valore iniziale delle proprie variabili */
125  virtual void SetInitialValue(VectorHandler& X);
126 
127 #ifdef DEBUG
128  virtual const char* sClassName(void) const { return "InPlaneJoint"; };
129 #endif
130 
131  /* *******PER IL SOLUTORE PARALLELO******** */
132  /* Fornisce il tipo e la label dei nodi che sono connessi all'elemento
133  utile per l'assemblaggio della matrice di connessione fra i dofs */
134  virtual void GetConnectedNodes(std::vector<const Node *>& connectedNodes) const {
135  connectedNodes.resize(2);
136  connectedNodes[0] = pNode1;
137  connectedNodes[1] = pNode2;
138  };
139  /* ************************************************ */
140 
141 };
142 
143 /* InPlaneJoint - end */
144 
145 
146 /* InPlaneWithOffsetJoint - begin */
147 
148 /* Vincolo di giacenza in un piano, con offset:
149  * si impone che il punto q del corpo b giaccia in un piano solidale
150  * al corpo a, definito dalla posizione di un punto p
151  * e da una direzione a partire da tale punto, v.
152  * La reazione vincolare e' una forza di modulo F e direzione v
153  * applicata nel punto di contatto.
154  */
155 
156 class InPlaneWithOffsetJoint : virtual public Elem, public Joint {
157  private:
160 
161  const Vec3 v; /* Direzione normale al piano */
162  const Vec3 p; /* Offset del piano dal nodo 1 */
163  const Vec3 q; /* Offset del punto di contatto dal nodo 2 */
164 
166 
167  public:
168  /* Costruttore non banale */
169  InPlaneWithOffsetJoint(unsigned int uL, const DofOwner* pDO,
170  const StructNode* pN1, const StructNode* pN2,
171  const Vec3& vT, const Vec3& pT, const Vec3& qT,
172  flag fOut);
173 
175 
176  /* Tipo di joint */
177  virtual Joint::Type GetJointType(void) const {
178  return INPLANE;
179  };
180 
181  /* Contributo al file di restart */
182  virtual std::ostream& Restart(std::ostream& out) const;
183 
184  virtual unsigned int iGetNumDof(void) const {
185  return 1;
186  };
187 
188 #ifdef DEBUG
189  virtual DofOrder::Order GetDofType(unsigned int i) const
190 #else
191  virtual DofOrder::Order GetDofType(unsigned int /* i */ ) const
192 #endif
193  {
194  ASSERT(i >= 0 && i < 1);
195  return DofOrder::ALGEBRAIC;
196  };
197 
198  virtual void WorkSpaceDim(integer* piNumRows, integer* piNumCols) const
199  { *piNumRows = 13; *piNumCols = 13; };
200 
202  doublereal dCoef,
203  const VectorHandler& XCurr,
204  const VectorHandler& XPrimeCurr);
206  doublereal dCoef,
207  const VectorHandler& XCurr,
208  const VectorHandler& XPrimeCurr);
209 
210  virtual void Output(OutputHandler& OH) const;
211 
212 
213  /* funzioni usate nell'assemblaggio iniziale */
214 
215  virtual unsigned int iGetInitialNumDof(void) const { return 2; };
216  virtual void InitialWorkSpaceDim(integer* piNumRows,
217  integer* piNumCols) const
218  { *piNumRows = 26; *piNumCols = 26; };
219 
220  /* Contributo allo jacobiano durante l'assemblaggio iniziale */
222  const VectorHandler& XCurr);
223 
224  /* Contributo al residuo durante l'assemblaggio iniziale */
226  const VectorHandler& XCurr);
227 
228  /* Setta il valore iniziale delle proprie variabili */
229  virtual void SetInitialValue(VectorHandler& X);
230 
231 #ifdef DEBUG
232  virtual const char* sClassName(void) const { return "InPlaneWithOffsetJoint"; };
233 #endif
234 
235  /* *******PER IL SOLUTORE PARALLELO******** */
236  /* Fornisce il tipo e la label dei nodi che sono connessi all'elemento
237  utile per l'assemblaggio della matrice di connessione fra i dofs */
238  virtual void GetConnectedNodes(std::vector<const Node *>& connectedNodes) const {
239  connectedNodes.resize(2);
240  connectedNodes[0] = pNode1;
241  connectedNodes[1] = pNode2;
242  };
243  /* ************************************************ */
244 };
245 
246 /* InPlaneWithOffsetJoint - end */
247 
248 #endif
virtual DofOrder::Order GetDofType(unsigned int) const
Definition: inplanej.h:85
Type
Definition: joint.h:66
virtual DofOrder::Order GetDofType(unsigned int) const
Definition: inplanej.h:191
virtual std::ostream & Restart(std::ostream &out) const
Definition: inplanej.cc:57
long int flag
Definition: mbdyn.h:43
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: inplanej.h:198
Definition: matvec3.h:98
const StructNode * pNode2
Definition: inplanej.h:55
SubVectorHandler & InitialAssRes(SubVectorHandler &WorkVec, const VectorHandler &XCurr)
Definition: inplanej.cc:670
const Vec3 p
Definition: inplanej.h:58
const StructNode * pNode2
Definition: inplanej.h:159
virtual std::ostream & Restart(std::ostream &out) const
Definition: inplanej.cc:375
VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: inplanej.cc:71
virtual unsigned int iGetNumDof(void) const
Definition: inplanej.h:184
VariableSubMatrixHandler & InitialAssJac(VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
Definition: inplanej.cc:519
virtual void Output(OutputHandler &OH) const
Definition: inplanej.cc:167
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: inplanej.h:112
virtual void SetInitialValue(VectorHandler &X)
Definition: inplanej.cc:726
virtual void GetConnectedNodes(std::vector< const Node * > &connectedNodes) const
Definition: inplanej.h:238
SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: inplanej.cc:464
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: inplanej.h:92
virtual unsigned int iGetInitialNumDof(void) const
Definition: inplanej.h:111
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: inplanej.h:216
virtual void SetInitialValue(VectorHandler &X)
Definition: inplanej.cc:343
#define ASSERT(expression)
Definition: colamd.c:977
virtual Joint::Type GetJointType(void) const
Definition: inplanej.h:177
doublereal dF
Definition: inplanej.h:60
SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: inplanej.cc:127
~InPlaneJoint(void)
Definition: inplanej.cc:51
Definition: elem.h:75
InPlaneWithOffsetJoint(unsigned int uL, const DofOwner *pDO, const StructNode *pN1, const StructNode *pN2, const Vec3 &vT, const Vec3 &pT, const Vec3 &qT, flag fOut)
Definition: inplanej.cc:354
InPlaneJoint(unsigned int uL, const DofOwner *pDO, const StructNode *pN1, const StructNode *pN2, const Vec3 &vTmp, const Vec3 &pTmp, flag fOut)
Definition: inplanej.cc:41
virtual void Output(OutputHandler &OH) const
Definition: inplanej.cc:507
const Vec3 v
Definition: inplanej.h:57
virtual void GetConnectedNodes(std::vector< const Node * > &connectedNodes) const
Definition: inplanej.h:134
virtual unsigned int iGetNumDof(void) const
Definition: inplanej.h:78
Definition: joint.h:50
const StructNode * pNode1
Definition: inplanej.h:54
VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: inplanej.cc:389
SubVectorHandler & InitialAssRes(SubVectorHandler &WorkVec, const VectorHandler &XCurr)
Definition: inplanej.cc:291
double doublereal
Definition: colamd.c:52
const StructNode * pNode1
Definition: inplanej.h:158
long int integer
Definition: colamd.c:51
virtual unsigned int iGetInitialNumDof(void) const
Definition: inplanej.h:215
virtual Joint::Type GetJointType(void) const
Definition: inplanej.h:71
VariableSubMatrixHandler & InitialAssJac(VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
Definition: inplanej.cc:179