MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
rodbezj.h
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/mbdyn/struct/rodbezj.h,v 1.3 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 * GNU General Public License for more details.
25  *
26  * You should have received a copy of the GNU General Public License
27  * along with this program; if not, write to the Free Software
28  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29  */
30 /*
31  * Author: Andrea Zanoni <andrea.zanoni@polimi.it>
32  */
33 
34 /* Bezier Rod */
35 
36 #ifndef RODBEZJ_H
37 #define RODBEZJ_H
38 
39 #include "joint.h"
40 #include "constltp.h"
41 #include "gauss.h"
42 
43 extern const char* psRodBezNames[];
44 
45 
46 /* Bezier Rod - begin */
47 
48 class RodBezier :
49 virtual public Elem, public Joint, public ConstitutiveLaw1DOwner {
50 protected:
53  const Vec3 fO;
54  const Vec3 fA;
55  const Vec3 fB;
56  const Vec3 fI;
58 
64 
65  unsigned int iIntOrd;
66  unsigned int iIntSeg;
67 
69 
70 public:
71  /* Costructor */
72  RodBezier(unsigned int uL, const DofOwner* pDO,
73  const ConstitutiveLaw1D* pCL,
74  const StructNode* pN1, const StructNode* pN2,
75  const Vec3& fOTmp, const Vec3& fATmp,
76  const Vec3& fBTmp, const Vec3& fITmp,
77  doublereal dLength, bool bFromNodes,
78  const unsigned int iIntOrder, const unsigned int iIntSegments,
79  flag fOut);
80 
81  /* Destructor */
82  virtual ~RodBezier(void);
83 
84  /* Joint type */
85  virtual Joint::Type GetJointType(void) const {
86  return Joint::RODBEZIER;
87  };
88 
89  /* Restart file contribute */
90  virtual std::ostream& Restart(std::ostream& out) const;
91 
92  virtual void
93  AfterConvergence(const VectorHandler& X, const VectorHandler& XP);
94 
95  virtual unsigned int iGetNumDof(void) const {
96  return 0;
97  };
98 
99  virtual void
100  WorkSpaceDim(integer* piNumRows, integer* piNumCols) const {
101  *piNumRows = 12;
102  *piNumCols = 12;
103  };
104 
105  virtual VariableSubMatrixHandler&
107  const VectorHandler& XCurr,
108  const VectorHandler& XPrimeCurr);
109 
110  virtual SubVectorHandler&
111  AssRes(SubVectorHandler& WorkVec, doublereal dCoef,
112  const VectorHandler& XCurr,
113  const VectorHandler& XPrimeCurr);
114 
115  void AssVec(SubVectorHandler& WorkVec);
116 
117  void Output(OutputHandler& OH) const;
118 
119  /* initial assembly functions */
120 
121  virtual unsigned int iGetInitialNumDof(void) const {
122  return 0;
123  }
124 
125  virtual void
126  InitialWorkSpaceDim(integer* piNumRows, integer* piNumCols) const {
127  *piNumRows = 12;
128  *piNumCols = 24;
129  };
130 
131  /* jacobian contribute during initial assembly */
132  virtual VariableSubMatrixHandler&
134  const VectorHandler& XCurr);
135 
136  /* residual contribue during initial assembly */
137  virtual SubVectorHandler&
138  InitialAssRes(SubVectorHandler& WorkVec, const VectorHandler& XCurr);
139 
140  /* Inverse Dynamics */
141  /* Inverse Dynamics capable element */
142  virtual bool bInverseDynamics(void) const;
143 
144  /* Inverse Dynamics Jacobian matrix assembly */
147  const VectorHandler& XCurr);
148 
149  /* Inverse Dynamics residual assembly */
151  AssRes(SubVectorHandler& WorkVec,
152  const VectorHandler& XCurr,
153  const VectorHandler& XPrimeCurr,
154  const VectorHandler& XPrimePrimeCurr,
156 
157  /* Inverse Dynamics update */
158  void Update(const VectorHandler& XCurr,
160 
161  /* Inverse Dynamics after convergence */
162  void AfterConvergence(const VectorHandler& X,
163  const VectorHandler& XP, const VectorHandler& XPP);
164 
165  /* ******* PARALLEL SOLVER ******** */
166  /* Outputs the type and the label of the nodes that are connected to
167  * the element. Useful for dof connection matrix assembly */
168  virtual void
169  GetConnectedNodes(std::vector<const Node *>& connectedNodes) const {
170  connectedNodes.resize(2);
171  connectedNodes[0] = pNode1;
172  connectedNodes[1] = pNode2;
173  };
174  /* ************************************************ */
175 
176  virtual unsigned int iGetNumPrivData(void) const;
177  virtual unsigned int iGetPrivDataIdx(const char *s) const;
178  doublereal dGetPrivData(unsigned int i) const;
179 
180 private:
181  inline doublereal Ap1(doublereal u) { return (-3*u*u + 6*u -3); };
182  inline doublereal Ap2(doublereal u) { return (9*u*u - 12*u + 3); };
183  inline doublereal Ap3(doublereal u) { return (-9*u*u + 6*u); };
184  inline doublereal Ap4(doublereal u) { return (3*u*u); };
185 
186 };
187 
188 /* RodBezier - end */
189 
190 #endif /* RODBEZJ_H */
191 
192 
193 
194 
195 
196 
197 
198 
199 
200 
201 
202 
203 
204 
205 
RodBezier(unsigned int uL, const DofOwner *pDO, const ConstitutiveLaw1D *pCL, const StructNode *pN1, const StructNode *pN2, const Vec3 &fOTmp, const Vec3 &fATmp, const Vec3 &fBTmp, const Vec3 &fITmp, doublereal dLength, bool bFromNodes, const unsigned int iIntOrder, const unsigned int iIntSegments, flag fOut)
Definition: rodbezj.cc:52
void AssVec(SubVectorHandler &WorkVec)
Definition: rodbezj.cc:361
virtual ~RodBezier(void)
Definition: rodbezj.cc:130
Type
Definition: joint.h:66
virtual unsigned int iGetInitialNumDof(void) const
Definition: rodbezj.h:121
virtual Joint::Type GetJointType(void) const
Definition: rodbezj.h:85
const Vec3 fI
Definition: rodbezj.h:56
long int flag
Definition: mbdyn.h:43
Definition: matvec3.h:98
Vec3 l2
Definition: rodbezj.h:60
unsigned int iIntOrd
Definition: rodbezj.h:65
const Vec3 fB
Definition: rodbezj.h:55
virtual bool bInverseDynamics(void) const
Definition: rodbezj.cc:800
virtual void AfterConvergence(const VectorHandler &X, const VectorHandler &XP)
Definition: rodbezj.cc:155
virtual SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: rodbezj.cc:332
doublereal Ap2(doublereal u)
Definition: rodbezj.h:182
void Output(OutputHandler &OH) const
Definition: rodbezj.cc:452
virtual VariableSubMatrixHandler & InitialAssJac(VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
Definition: rodbezj.cc:470
GaussDataIterator * gdi
Definition: rodbezj.h:68
virtual std::ostream & Restart(std::ostream &out) const
Definition: rodbezj.cc:137
unsigned int iIntSeg
Definition: rodbezj.h:66
const Vec3 fA
Definition: rodbezj.h:54
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: rodbezj.h:126
const char * psRodBezNames[]
Vec3 l1
Definition: rodbezj.h:59
doublereal Ap4(doublereal u)
Definition: rodbezj.h:184
virtual unsigned int iGetPrivDataIdx(const char *s) const
Definition: rodbezj.cc:852
doublereal dElle
Definition: rodbezj.h:61
const StructNode * pNode1
Definition: rodbezj.h:51
virtual void GetConnectedNodes(std::vector< const Node * > &connectedNodes) const
Definition: rodbezj.h:169
Definition: elem.h:75
doublereal Ap3(doublereal u)
Definition: rodbezj.h:183
virtual SubVectorHandler & InitialAssRes(SubVectorHandler &WorkVec, const VectorHandler &XCurr)
Definition: rodbezj.cc:772
Definition: joint.h:50
const Vec3 fO
Definition: rodbezj.h:53
double doublereal
Definition: colamd.c:52
virtual unsigned int iGetNumDof(void) const
Definition: rodbezj.h:95
long int integer
Definition: colamd.c:51
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: rodbezj.h:100
void Update(const VectorHandler &XCurr, InverseDynamics::Order iOrder=InverseDynamics::INVERSE_DYNAMICS)
Definition: rodbezj.cc:832
doublereal dEpsilon
Definition: rodbezj.h:62
const StructNode * pNode2
Definition: rodbezj.h:52
doublereal dL0
Definition: rodbezj.h:57
doublereal dGetPrivData(unsigned int i) const
Definition: rodbezj.cc:878
virtual VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: rodbezj.cc:163
virtual unsigned int iGetNumPrivData(void) const
Definition: rodbezj.cc:846
doublereal dEpsilonPrime
Definition: rodbezj.h:63
doublereal Ap1(doublereal u)
Definition: rodbezj.h:181