MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
hbeam.h
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/mbdyn/struct/hbeam.h,v 1.39 2017/05/12 17:29:26 morandini 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 /* Trave a volumi finiti, con predisposizione per forze di inerzia consistenti
33  * e legame cositutivo piezoelettico */
34 
35 
36 #ifndef HBEAM_H
37 #define HBEAM_H
38 
39 #include "myassert.h"
40 #include "except.h"
41 
42 #include <matvecexp.h>
43 
44 #include "strnode.h"
45 #include "elem.h"
46 #include "gravity.h"
47 
48 #include "constltp.h"
49 
50 // #define VISCOELASTIC_BEAM /* uncomment when ViscoElasticBeam is available */
51 #undef VISCOELASTIC_BEAM
52 // #define PIEZO_BEAM /* uncomment when PiezoBeam is available */
53 #undef PIEZO_BEAM
54 
55 /* Beam - begin */
56 
57 class HBeam
58 : virtual public Elem, public ElemGravityOwner, public InitialAssemblyElem {
59  friend class AerodynamicBeam;
60 
61  public:
62  class ErrGeneric : public MBDynErrBase {
63  public:
65  };
66 
67  private:
69 
70  protected:
71  enum NodeName { NODE1 = 0, NODE2 = 1, NUMNODES = 2 };
72  enum Deformations { STRAIN = 0, CURVAT = 1, NUMDEFORM = 2 };
73 
74  /* Puntatori ai nodi */
76 
77  /* Offset dei nodi */
80 
81  /* Matarici di rotazione iniziali dei nodi */
83 
84  /* Matrice di rotazione delle sezioni - non sono const perche' vengono
85  * aggiornate ad ogni iterazione */
88 
89  /* Constitutive laws*/
91 
92  /* Reference constitutive laws */
94 
95  /* Velocita' angolare delle sezioni */
98 
99  /* Dati temporanei che vengono passati da AssRes ad AssJac */
105 
108 
112 
116 
117  /* Is first res? */
118  bool bFirstRes;
119 
120  /* Temporanei per interpolazione elicoidale */
121  /* posiz. punto medio: p */
122  /* orientazione punto medio: R */
123  /* F (dp/ds) L */
124  /* assiale di dR/ds*R^T Rho */
127  /* derivate di p e L rispetto a p e PhiDelta,
128  * di R e Rho rispetto a PhiDelta */
135 
136  /*
137  * Nota: Rho0 e L0 non sono derivate "iniziali" nel sistema iniziale,
138  * ma nel sistema del materiale: "L0" = R0^T L0, "Rho0" = R0^T Rho0
139  */
140 
141  /* pesi e derivate */
142 
143  /* Funzioni di calcolo delle matrici */
144  virtual void
147  doublereal dCoef,
148  const VectorHandler& XCurr,
149  const VectorHandler& XPrimeCurr);
150 
151  virtual void
153  doublereal dCoef,
154  const VectorHandler& XCurr,
155  const VectorHandler& XPrimeCurr);
156 
157  /* Per le beam che aggiungono qualcosa alle az. interne */
158  virtual void
159  AddInternalForces(Vec6& /* AzLoc */) {
160  NO_OP;
161  };
162 
163  /* Inizializza le derivate delle funzioni di forma
164  * e calcola le deformazioni geometriche iniziali */
165  virtual void DsDxi(void);
166 
167  /* Calcola la velocita' angolare delle sezioni a partire da quelle
168  * dei nodi; per ora lo fa in modo brutale, ma si puo' fare anche
169  * in modo consistente */
170  virtual void Omega0(void);
171 
172  /* cambia il tipo (?) */
174  BeamT = T;
175  };
176 
177  /* Funzione interna di restart */
178  virtual std::ostream& Restart_(std::ostream& out) const;
179 
180  public:
181  /* Costruttore normale */
182  HBeam(unsigned int uL,
183  const StructNode* pN1, const StructNode* pN2,
184  const Vec3& F1, const Vec3& F2,
185  const Mat3x3& R1, const Mat3x3& R2,
186  const ConstitutiveLaw6D* pd,
187  flag fOut);
188 
189  /* Distruttore banale */
190  virtual ~HBeam(void);
191 
192  /* Tipo di trave */
193  virtual Beam::Type GetBeamType(void) const {
194  return Beam::ELASTIC;
195  };
196 
197  /* Tipo di elemento */
198  virtual Elem::Type GetElemType(void) const {
199  return Elem::BEAM;
200  };
201 
202  /* Contributo al file di restart */
203  virtual std::ostream& Restart(std::ostream& out) const;
204 
205  virtual void
206  AfterConvergence(const VectorHandler& X, const VectorHandler& XP);
207 
208  /* funzioni proprie */
209 
210  /* Dimensioni del workspace; sono 36 righe perche' se genera anche le
211  * forze d'inerzia consistenti deve avere accesso alle righe di definizione
212  * della quantita' di moto */
213  virtual void WorkSpaceDim(integer* piNumRows, integer* piNumCols) const {
214  *piNumRows = 12;
215  *piNumCols = 12;
216  };
217 
218  /* Settings iniziali, prima della prima soluzione */
219  void SetValue(DataManager *pDM,
220  VectorHandler& /* X */ , VectorHandler& /* XP */ ,
221  SimulationEntity::Hints *ph = 0);
222 
223  /* Prepara i parametri di riferimento dopo la predizione */
224  virtual void
225  AfterPredict(VectorHandler& /* X */ , VectorHandler& /* XP */ );
226 
227  /* assemblaggio residuo */
228  virtual SubVectorHandler&
229  AssRes(SubVectorHandler& WorkVec,
230  doublereal dCoef,
231  const VectorHandler& XCurr,
232  const VectorHandler& XPrimeCurr);
233 
234  /* assemblaggio jacobiano */
235  virtual VariableSubMatrixHandler&
237  doublereal dCoef,
238  const VectorHandler& XCurr,
239  const VectorHandler& XPrimeCurr);
240 
241  /* output; si assume che ogni tipo di elemento sappia, attraverso
242  * l'OutputHandler, dove scrivere il proprio output */
243  virtual void Output(OutputHandler& OH) const;
244 
245  /* Funzioni proprie tipiche dei vincoli, usate durante l'assemblaggio
246  * iniziale. Le travi non sono vincoli (o meglio, non vengono considerate
247  * tali), ma richiedono comunque assemblaggio iniziale. Innanzitutto
248  * le coordinate dei nodi che sono fornite vengono usate per calcolare
249  * la lunghezza della trave e per la metrica della trave stessa.
250  * Inoltre durante l'assemblaggio la trave esplica la propria
251  * deformabilita' quando i vincoli tentano di muovere i nodi. */
252 
253  /* Numero di gradi di liberta' definiti durante l'assemblaggio iniziale
254  * e' dato dai gradi di liberta' soliti piu' le loro derivate necessarie;
255  * tipicamente per un vincolo di posizione il numero di dof raddoppia, in
256  * quanto vengono derivate tutte le equazioni, mentre per un vincolo di
257  * velocita' rimane inalterato. Sono possibili casi intermedi per vincoli
258  * misti di posizione e velocita' */
259  virtual unsigned int iGetInitialNumDof(void) const {
260  return 0;
261  };
262 
263  /* Dimensione del workspace durante l'assemblaggio iniziale. Occorre tener
264  * conto del numero di dof che l'elemento definisce in questa fase e dei
265  * dof dei nodi che vengono utilizzati. Sono considerati dof indipendenti
266  * la posizione e la velocita' dei nodi */
267  virtual void
269  integer* piNumCols) const {
270  *piNumRows = 12;
271  *piNumCols = 12;
272  };
273 
274  /* Setta il valore iniziale delle proprie variabili */
275  virtual void SetInitialValue(VectorHandler& /* X */ ) {
276  NO_OP;
277  };
278 
279  /* Contributo allo jacobiano durante l'assemblaggio iniziale */
280  virtual VariableSubMatrixHandler&
282  const VectorHandler& XCurr);
283 
284  /* Contributo al residuo durante l'assemblaggio iniziale */
285  virtual SubVectorHandler&
286  InitialAssRes(SubVectorHandler& WorkVec, const VectorHandler& XCurr);
287 
288  /* Accesso ai dati privati */
289  virtual unsigned int iGetNumPrivData(void) const;
290  virtual unsigned int iGetPrivDataIdx(const char *s) const;
291  virtual doublereal dGetPrivData(unsigned int i) const;
292 
293 
294  /* Accesso ai nodi */
295  virtual const StructNode* pGetNode(unsigned int i) const;
296 
297  /******** PER IL SOLUTORE PARALLELO *********/
298  /* Fornisce il tipo e la label dei nodi che sono connessi all'elemento
299  * utile per l'assemblaggio della matrice di connessione fra i dofs */
300  virtual void
301  GetConnectedNodes(std::vector<const Node *>& connectedNodes) const {
302  connectedNodes.resize(NUMNODES);
303  for (int i = 0; i < NUMNODES; i++) {
304  connectedNodes[i] = pNode[i];
305  }
306  };
307  /**************************************************/
308 };
309 
310 /* Beam - end */
311 
312 
313 #ifdef VISCOELASTIC_BEAM
314 /* ViscoElasticBeam - begin */
315 
316 class ViscoElasticHBeam : virtual public Elem, public HBeam {
317  protected:
318 
319  /* Derivate di deformazioni e curvature */
320  Vec3 LPrime;
321  Vec3 gPrime;
322 
323  Vec3 LPrimeRef;
324 
325  Vec6 DefPrimeLoc;
326  Vec6 DefPrimeLocRef;
327 
328  Mat6x6 ERef;
329 
330  /* Funzioni di calcolo delle matrici */
331  virtual void
334  doublereal dCoef,
335  const VectorHandler& XCurr,
336  const VectorHandler& XPrimeCurr);
337 
338  virtual void
340  doublereal dCoef,
341  const VectorHandler& XCurr,
342  const VectorHandler& XPrimeCurr);
343 
344  public:
345  /* Costruttore normale */
346  ViscoElasticHBeam(unsigned int uL,
347  const StructNode* pN1,
348  const StructNode* pN2,
349  const Vec3& F1,
350  const Vec3& F2,
351  const Mat3x3& r,
352  const ConstitutiveLaw6D* pd,
353  flag fOut);
354 
355  /* Distruttore banale */
356  virtual ~ViscoElasticHBeam(void) {
357  NO_OP;
358  };
359 
360  /* Tipo di trave */
361  virtual Beam::Type GetBeamType(void) const {
362  return Beam::VISCOELASTIC;
363  };
364 
365  /* Settings iniziali, prima della prima soluzione */
366  void SetValue(DataManager *pDM,
367  VectorHandler& /* X */ , VectorHandler& /* XP */ ,
368  SimulationEntity::Hints *ph = 0);
369 
370  /* Prepara i parametri di riferimento dopo la predizione */
371  virtual void
372  AfterPredict(VectorHandler& /* X */ , VectorHandler& /* XP */ );
373 };
374 
375 /* ViscoElasticBeam - end */
376 #endif /* VISCOELASTIC_BEAM */
377 
378 class DataManager;
379 class MBDynParser;
380 
381 extern Elem*
382 ReadHBeam(DataManager* pDM, MBDynParser& HP, unsigned int uLabel);
383 
384 #endif /* BEAM2_H */
Beam::Type BeamT
Definition: hbeam.h:68
Vec3 Rho
Definition: hbeam.h:125
Vec3 OmegaRef
Definition: hbeam.h:97
virtual SubVectorHandler & InitialAssRes(SubVectorHandler &WorkVec, const VectorHandler &XCurr)
Definition: hbeam.cc:682
HBeam(unsigned int uL, const StructNode *pN1, const StructNode *pN2, const Vec3 &F1, const Vec3 &F2, const Mat3x3 &R1, const Mat3x3 &R2, const ConstitutiveLaw6D *pd, flag fOut)
Definition: hbeam.cc:67
long int flag
Definition: mbdyn.h:43
virtual unsigned int iGetPrivDataIdx(const char *s) const
Definition: hbeam.cc:135
Vec3 Omega
Definition: hbeam.h:96
Definition: matvec3.h:98
Vec3 LRef
Definition: hbeam.h:111
virtual void SetInitialValue(VectorHandler &)
Definition: hbeam.h:275
#define MBDYN_EXCEPT_ARGS_PASSTHRU
Definition: except.h:55
Mat3x3 RdP[NUMNODES]
Definition: hbeam.h:133
Deformations
Definition: hbeam.h:72
Mat3x3 pdP[NUMNODES]
Definition: hbeam.h:130
virtual doublereal dGetPrivData(unsigned int i) const
Definition: hbeam.cc:197
#define MBDYN_EXCEPT_ARGS_DECL
Definition: except.h:43
Mat3x3 Rn[NUMNODES]
Definition: hbeam.h:82
#define NO_OP
Definition: myassert.h:74
doublereal dxids
Definition: hbeam.h:115
std::vector< Hint * > Hints
Definition: simentity.h:89
virtual std::ostream & Restart(std::ostream &out) const
Definition: hbeam.cc:325
bool bFirstRes
Definition: hbeam.h:118
virtual unsigned int iGetNumPrivData(void) const
Definition: hbeam.cc:129
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: hbeam.h:213
Vec3 fRef[NUMNODES]
Definition: hbeam.h:79
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: hbeam.h:268
virtual void Omega0(void)
Definition: hbeam.cc:285
virtual void AssStiffnessVec(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: hbeam.cc:447
virtual ~HBeam(void)
Definition: hbeam.cc:118
virtual unsigned int iGetInitialNumDof(void) const
Definition: hbeam.h:259
Definition: hbeam.h:57
virtual Beam::Type GetBeamType(void) const
Definition: hbeam.h:193
Definition: matvec6.h:37
doublereal dsdxi
Definition: hbeam.h:114
virtual SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: hbeam.cc:529
virtual void AfterPredict(VectorHandler &, VectorHandler &)
Definition: hbeam.cc:577
DataManager * pDM
Definition: mbpar.h:252
Vec3 L
Definition: hbeam.h:110
Mat3x3 pdp[NUMNODES]
Definition: hbeam.h:129
virtual void DsDxi(void)
Definition: hbeam.cc:234
Vec3 f[NUMNODES]
Definition: hbeam.h:78
doublereal xi
Definition: hbeam.h:113
Vec6 DefLocRef
Definition: hbeam.h:104
Vec3 L0
Definition: hbeam.h:109
Mat3x3 R
Definition: hbeam.h:86
Mat3x3 RhodP[NUMNODES]
Definition: hbeam.h:134
virtual void AfterConvergence(const VectorHandler &X, const VectorHandler &XP)
Definition: hbeam.cc:347
Mat3x3 Ldp[NUMNODES]
Definition: hbeam.h:131
Vec6 DefLoc
Definition: hbeam.h:103
Type
Definition: beam.h:64
virtual void Output(OutputHandler &OH) const
Definition: hbeam.cc:645
ConstitutiveLaw6DOwner * pD
Definition: hbeam.h:90
virtual void AddInternalForces(Vec6 &)
Definition: hbeam.h:159
virtual void AssStiffnessMat(FullSubMatrixHandler &WMA, FullSubMatrixHandler &WMB, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: hbeam.cc:354
virtual VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: hbeam.cc:497
Vec3 Rho0
Definition: hbeam.h:126
Vec6 AzLoc
Definition: hbeam.h:102
Definition: elem.h:75
Mat3x3 LdP[NUMNODES]
Definition: hbeam.h:132
Type
Definition: elem.h:91
Vec3 g
Definition: hbeam.h:107
NodeName
Definition: hbeam.h:71
Mat6x6 DRef
Definition: hbeam.h:93
Vec6 AzRef
Definition: hbeam.h:101
Elem * ReadHBeam(DataManager *pDM, MBDynParser &HP, unsigned int uLabel)
Definition: hbeam.cc:1091
Vec6 Az
Definition: hbeam.h:100
Mat3x3 RRef
Definition: hbeam.h:87
virtual VariableSubMatrixHandler & InitialAssJac(VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
Definition: hbeam.cc:656
virtual void AfterPredict(VectorHandler &X, VectorHandler &XP)
Definition: simentity.cc:91
void SetBeamType(Beam::Type T)
Definition: hbeam.h:173
virtual void SetValue(DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *h=0)
Definition: simentity.cc:63
double doublereal
Definition: colamd.c:52
ErrGeneric(MBDYN_EXCEPT_ARGS_DECL)
Definition: hbeam.h:64
Vec3 p
Definition: hbeam.h:106
long int integer
Definition: colamd.c:51
void SetValue(DataManager *pDM, VectorHandler &, VectorHandler &, SimulationEntity::Hints *ph=0)
Definition: hbeam.cc:555
virtual std::ostream & Restart_(std::ostream &out) const
Definition: hbeam.cc:331
const StructNode * pNode[NUMNODES]
Definition: hbeam.h:75
virtual void GetConnectedNodes(std::vector< const Node * > &connectedNodes) const
Definition: hbeam.h:301
virtual const StructNode * pGetNode(unsigned int i) const
Definition: hbeam.cc:704
virtual Elem::Type GetElemType(void) const
Definition: hbeam.h:198