MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
beamslider.h
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/mbdyn/struct/beamslider.h,v 1.33 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 /* Trave a volumi finiti, con predisposizione per forze di inerzia consistenti
33  * e legame cositutivo piezoelettico */
34 
35 
36 #ifndef BEAMSLIDER_H
37 #define BEAMSLIDER_H
38 
39 #include <myassert.h>
40 #include <except.h>
41 
42 #include <strnode.h>
43 #include <elem.h>
44 #include <beam.h>
45 #include <joint.h>
46 
47 /*
48  * Beam connection:
49  * struttura che contiene i nodi e gli offset di una trave a tre nodi
50  *
51  * BeamConn - begin
52  */
53 class BeamConn {
54 protected:
55  const Beam *m_pBeam;
56  Vec3 m_f[3];
57  Mat3x3 m_R[3];
58 public:
59  BeamConn(const Beam *pB,
60  const Vec3& f1, const Vec3& f2, const Vec3& f3,
61  const Mat3x3& R1 = Eye3,
62  const Mat3x3& R2 = Eye3,
63  const Mat3x3& R3 = Eye3);
64 
65  virtual ~BeamConn(void);
66 
67  const Beam *
68  pGetBeam(void) const {
69  return m_pBeam;
70  };
71 
72  const StructNode *
73  pGetNode(unsigned int i) const {
74  return m_pBeam->pGetNode(i);
75  };
76 
77  const Vec3 &
78  Getf(unsigned int i) const {
79  ASSERT(i >= 1 && i <= 3);
80  return m_f[--i];
81  };
82 
83  const Mat3x3 &
84  GetR(unsigned int i) const {
85  ASSERT(i >= 1 && i <= 3);
86  return m_R[--i];
87  };
88 };
89 
90 /* BeamConn - end */
91 
92 
93 /* BeamSliderJoint - begin */
94 
95 class BeamSliderJoint: virtual public Elem, public Joint {
96 public:
98 private:
99  unsigned int nRotConstr;
100  unsigned int nBeams;
101  unsigned int iCurrBeam;
102 
103  enum Type iType;
104 
106  const BeamConn *const *ppBeam;
117 
126 
130 
131 public:
132  /* Costruttore non banale */
133  BeamSliderJoint(unsigned int uL, const DofOwner* pDO,
134  const StructNode* pN, enum Type iT,
135  unsigned int nB, const BeamConn *const *pB,
136  unsigned int uIB, unsigned int uIN,
137  doublereal dl,
138  const Vec3& fTmp, const Mat3x3& RTmp, flag fOut);
139 
140  /* Distruttore */
141  ~BeamSliderJoint(void);
142 
143  /* Contributo al file di restart */
144  virtual std::ostream& Restart(std::ostream& out) const;
145 
146  /* Tipo di Joint */
147  virtual Joint::Type GetJointType(void) const {
148  return Joint::BEAMSLIDER;
149  };
150 
151  virtual unsigned int iGetNumDof(void) const {
152  return 4+nRotConstr;
153  };
154 
155  DofOrder::Order GetDofType(unsigned int i) const {
156  ASSERT(i >= 0 && i < iGetNumDof());
157  return DofOrder::ALGEBRAIC;
158  }
159 
160  void WorkSpaceDim(integer* piNumRows, integer* piNumCols) const {
161  *piNumRows = 6*(1+Beam::NUMNODES)+iGetNumDof();
162  *piNumCols = *piNumRows;
163  };
164 
167  doublereal dCoef,
168  const VectorHandler& XCurr,
169  const VectorHandler& XPrimeCurr);
170 
172  AssRes(SubVectorHandler& WorkVec,
173  doublereal dCoef,
174  const VectorHandler& XCurr,
175  const VectorHandler& XPrimeCurr);
176 
177  void Output(OutputHandler& OH) const;
178 
179  /* funzioni usate nell'assemblaggio iniziale */
180  virtual unsigned int iGetInitialNumDof(void) const {
181  // return 8+2*nRotConstr;
182  return 0;
183  };
184  virtual void
185  InitialWorkSpaceDim(integer* piNumRows, integer* piNumCols) const {
186  *piNumRows = 12*(1+Beam::NUMNODES)+iGetInitialNumDof();
187  *piNumCols = *piNumRows;
188  };
189 
190  /* Contributo allo jacobiano durante l'assemblaggio iniziale */
193  const VectorHandler& XCurr);
194 
195  /* Contributo al residuo durante l'assemblaggio iniziale */
197  InitialAssRes(SubVectorHandler& WorkVec, const VectorHandler& XCurr);
198 
199 #if 0
200  /* Dati privati */
201  virtual unsigned int iGetNumPrivData(void) const;
202  virtual unsigned int iGetPrivDataIdx(const char *s) const;
203  virtual doublereal dGetPrivData(unsigned int i = 0) const;
204 #endif
205 
206  /* *******PER IL SOLUTORE PARALLELO******** */
207  /*
208  * Fornisce il tipo e la label dei nodi che sono connessi all'elemento
209  * utile per l'assemblaggio della matrice di connessione fra i dofs
210  */
211  virtual void
212  GetConnectedNodes(std::vector<const Node *>& connectedNodes) const {
213  connectedNodes.resize(1 + nBeams*Beam::NUMNODES);
214  connectedNodes[0] = pNode;
215 
216  /* for each beam */
217  for (unsigned int i = 0; i < nBeams; i++) {
218  /* for each node */
219  for (int j = 1; j <= Beam::NUMNODES; j++) {
220  connectedNodes[Beam::NUMNODES*i + j] = ppBeam[i]->pGetNode(j);
221  }
222  }
223  };
224  /* ************************************************ */
225 };
226 
227 #endif /* BEAMSLIDER_H */
228 
virtual std::ostream & Restart(std::ostream &out) const
Definition: beamslider.cc:141
Type
Definition: joint.h:66
const Vec3 & Getf(unsigned int i) const
Definition: beamslider.h:78
Vec3 m_f[3]
Definition: beamslider.h:56
DofOrder::Order GetDofType(unsigned int i) const
Definition: beamslider.h:155
unsigned int nBeams
Definition: beamslider.h:100
long int flag
Definition: mbdyn.h:43
SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: beamslider.cc:509
Definition: matvec3.h:98
Vec3 xNod[Beam::NUMNODES]
Definition: beamslider.h:118
unsigned int iCurrBeam
Definition: beamslider.h:101
virtual unsigned int iGetPrivDataIdx(const char *s) const
Definition: simentity.cc:142
const Mat3x3 Eye3(1., 0., 0., 0., 1., 0., 0., 0., 1.)
doublereal dNp[Beam::NUMNODES]
Definition: beamslider.h:122
doublereal dNpp[Beam::NUMNODES]
Definition: beamslider.h:123
virtual const StructNode * pGetNode(unsigned int i) const
Definition: beam.cc:1290
BeamConn(const Beam *pB, const Vec3 &f1, const Vec3 &f2, const Vec3 &f3, const Mat3x3 &R1=Eye3, const Mat3x3 &R2=Eye3, const Mat3x3 &R3=Eye3)
Definition: beamslider.cc:46
doublereal dN[Beam::NUMNODES]
Definition: beamslider.h:121
const StructNode * pNode
Definition: beamslider.h:105
virtual void GetConnectedNodes(std::vector< const Node * > &connectedNodes) const
Definition: beamslider.h:212
const StructNode * pGetNode(unsigned int i) const
Definition: beamslider.h:73
void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: beamslider.h:160
const Beam * m_pBeam
Definition: beamslider.h:55
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: beamslider.h:185
VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: beamslider.cc:183
const BeamConn *const * ppBeam
Definition: beamslider.h:106
Definition: beam.h:56
Mat3x3 m_R[3]
Definition: beamslider.h:57
const Beam * pGetBeam(void) const
Definition: beamslider.h:68
#define ASSERT(expression)
Definition: colamd.c:977
doublereal dL
Definition: beamslider.h:115
void Output(OutputHandler &OH) const
Definition: beamslider.cc:148
doublereal sRef
Definition: beamslider.h:112
enum Type iType
Definition: beamslider.h:103
BeamSliderJoint(unsigned int uL, const DofOwner *pDO, const StructNode *pN, enum Type iT, unsigned int nB, const BeamConn *const *pB, unsigned int uIB, unsigned int uIN, doublereal dl, const Vec3 &fTmp, const Mat3x3 &RTmp, flag fOut)
Definition: beamslider.cc:74
Vec3 fTmp[Beam::NUMNODES]
Definition: beamslider.h:119
virtual doublereal dGetPrivData(unsigned int i) const
Definition: simentity.cc:149
virtual unsigned int iGetNumPrivData(void) const
Definition: simentity.cc:136
doublereal s
Definition: beamslider.h:113
const Mat3x3 & GetR(unsigned int i) const
Definition: beamslider.h:84
~BeamSliderJoint(void)
Definition: beamslider.cc:135
Definition: elem.h:75
virtual unsigned int iGetInitialNumDof(void) const
Definition: beamslider.h:180
doublereal dW[2]
Definition: beamslider.h:116
virtual unsigned int iGetNumDof(void) const
Definition: beamslider.h:151
virtual Joint::Type GetJointType(void) const
Definition: beamslider.h:147
Definition: joint.h:50
SubVectorHandler & InitialAssRes(SubVectorHandler &WorkVec, const VectorHandler &XCurr)
Definition: beamslider.cc:730
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
Vec3 xTmp[Beam::NUMNODES]
Definition: beamslider.h:120
unsigned int nRotConstr
Definition: beamslider.h:99
virtual ~BeamConn(void)
Definition: beamslider.cc:60
VariableSubMatrixHandler & InitialAssJac(VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
Definition: beamslider.cc:718