All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
finite_element_1S_reference_curve.h
1 /* Copyright (C) 2004-2015 MBSim Development Team
2  *
3  * This library is free software; you can redistribute it and/or
4  * modify it under the terms of the GNU Lesser General Public
5  * License as published by the Free Software Foundation; either
6  * version 2.1 of the License, or (at your option) any later version.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  * Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public
14  * License along with this library; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16  *
17  * Created on: Jul 30, 2013
18  * Contact: kilian.grundl@gmail.com
19  */
20 
21 #ifndef FINITE_ELEMENT_1S_REFERENCE_CURVE_H_
22 #define FINITE_ELEMENT_1S_REFERENCE_CURVE_H_
23 
24 #include <mbsimFlexibleBody/flexible_body/flexible_body_1S_reference_curve.h>
25 
26 #include <mbsimFlexibleBody/contours/neutral_contour/contour_1s_neutral_reference_curve.h>
27 
28 #include <mbsim/discretization_interface.h>
29 
30 #include <mbsim/functions/function.h>
31 
32 namespace MBSimFlexibleBody {
33 
38  friend class funcPTP;
39  friend class funcPTdPdxi;
40  friend class funcPTdPdt;
41  friend class funcPTdPdqk;
42  friend class funcForWgamma;
43  friend class funcForWb;
44 
45  public:
49  FlexibleBody1SReferenceCurveFE(FlexibleBody1SReferenceCurve * parent, int eleNo, Vec2 alpha, int order, int nodeDofs);
50 
52 
56  virtual void init(MBSim::Element::InitStage stage);
57  virtual int getqSize() const {
58  throw MBSim::MBSimError("Not implemented" + string(__func__));
59  }
60 
61  virtual fmatvec::Vec getq() const {
62  return parent->qElement[element];
63  }
64 
65  virtual int getuSize() const {
66  throw MBSim::MBSimError("Not implemented" + string(__func__));
67  }
68 
69  virtual const fmatvec::SymMat& getM() const {
70  return M;
71  }
72  virtual const fmatvec::Vec& geth() const {
73  return h;
74  }
75 
76  virtual const fmatvec::SqrMat& getdhdq() const {
77  throw MBSim::MBSimError("Not implemented" + string(__func__));
78  }
79  virtual const fmatvec::SqrMat& getdhdu() const {
80  throw MBSim::MBSimError("Not implemented");
81  }
82  virtual void computeM(const fmatvec::Vec& q);
83  virtual void computeh(const fmatvec::Vec& q, const fmatvec::Vec& u);
84  virtual void computedhdz(const fmatvec::Vec& q, const fmatvec::Vec& u) {
85  throw MBSim::MBSimError("Not implemented");
86  }
87  virtual double computeKineticEnergy(const fmatvec::Vec& q, const fmatvec::Vec& u) {
88  throw MBSim::MBSimError("Not implemented");
89  }
90  virtual double computeGravitationalEnergy(const fmatvec::Vec& q) {
91  throw MBSim::MBSimError("Not implemented");
92  }
93  virtual double computeElasticEnergy(const fmatvec::Vec& q) {
94  throw MBSim::MBSimError("Not implemented");
95  }
96  virtual fmatvec::Vec computePosition(const fmatvec::Vec& q, const MBSim::ContourPointData &data) {
97  throw MBSim::MBSimError("Not implemented");
98  }
99  virtual fmatvec::SqrMat computeOrientation(const fmatvec::Vec& q, const MBSim::ContourPointData &data) {
100  throw MBSim::MBSimError("Not implemented");
101  }
102  virtual fmatvec::Vec computeVelocity(const fmatvec::Vec& q, const fmatvec::Vec& u, const MBSim::ContourPointData &data) {
103  throw MBSim::MBSimError("Not implemented");
104  }
105  virtual fmatvec::Vec computeAngularVelocity(const fmatvec::Vec& q, const fmatvec::Vec& u, const MBSim::ContourPointData &data) {
106  throw MBSim::MBSimError("Not implemented");
107  }
108  virtual fmatvec::Mat computeJacobianOfMotion(const fmatvec::Vec& q, const MBSim::ContourPointData &data) {
109  throw MBSim::MBSimError("Not implemented");
110  }
111 
112  virtual void setDofDir(fmatvec::VecInt dofDirElement_) {
113  dofDirs = dofDirElement_;
114  }
115 
116  virtual fmatvec::VecInt getDofDirs() {
117  return dofDirs;
118  }
119 
123  virtual int getAddDoFSizeMax() const {
124  return getNodesSize() * nodeDirs;
125  }
126 
130  virtual int getNodesSize() const {
131  return (order + 1);
132  }
133 
134  FlexibleBody1SReferenceCurve * getParent() {
135  return parent;
136  }
137 
138  const std::vector<int> getFreeDofs() {
139  return freeDoFs;
140  }
141 
142  const fmatvec::Vec2 getAlpha() {
143  return alpha;
144  }
145 
146  int findLocalDof(int globalDof) {
147  for (size_t i = 0; i < freeDoFs.size(); i++) {
148  if (dofDirs(freeDoFs[i]) == globalDof)
149  return freeDoFs[i];
150  }
151  return -1;
152  }
153 
157  virtual double computeXiLoc(double xiGlob);
158 
162  virtual double computeXiGlob(double xiLoc);
163 
167  fmatvec::Vec3 computer(double xi, int derXi = 0, int derTheta = 0);
168 
172  fmatvec::Vec3 computev(double xi, int derXi = 0);
173 
177  fmatvec::Vec3 computedrdqk(double xi, int derXi, int qIndLoc);
178 
186  virtual double computeN(int j, double xiLoc, int derXi);
187 
191  virtual double computeLegendre(int j, double xiLoc, int derXi);
192 
197  fmatvec::Vec3 computeB(int dofDirLocal, double xiGlob, int derXi, int derTheta);
198 
202  fmatvec::Vec3 computeBqf(double xi, int derXi, int derTheta);
203 
207  fmatvec::Vec3 computeBuf(double xi, int derXi, int derTheta);
208 
213  virtual fmatvec::Vec3 computeS(int columnEle, double xiGlob, int derXi);
214 
218  virtual fmatvec::Vec3 computeSTimeslocVec(double xiGlob, int derXi, const fmatvec::Vec & locVec);
219 
223  virtual fmatvec::Vec3 computeAnodeTimesSTimeslocVec(double xiGlob, int derXi, int derTheta, const fmatvec::Vec & locVec);
224 
228  fmatvec::Mat3xV computeP(double xi, int derXi);
229 
233  fmatvec::Mat3xV computedPdqk(double xi, int dofDirLocal);
234 
238  double computeeps(double xiGlob);
239 
243  double computedepsdqk(int localDofDir, double xiGlob);
244 
248  double computeKappan(double xiGlob);
249 
253  double computeKappab(double xiGlob);
254 
258  double computedKappandqk(double xiGlob, int qIndLocal);
259 
263  double computedKappabdqk(double xiGlob, int qIndLocal);
264 
268  double dWndqk(double xiGlob, int qInd);
269 
273  void updateIntegrationBorders(double t);
274 
275  private:
280 
284  int element;
285 
290  fmatvec::VecInt dofDirs;
291 
292  /*
293  * \brief start and end node in the global system
294  */
295  fmatvec::Vec2 alpha;
296 
300  std::vector<double> borders;
301 
305  int order;
306 
310  int nodeDirs;
311 
315  std::vector<int> freeDoFs;
316 
323  std::vector<std::vector<std::vector<double> > > coeffs;
324 
328  std::vector<double> getLagrangeCoeffs(int nodeNo);
329 
333  std::vector<double> getHermiteCoeffs(int nodeNo);
334 
339 
344 
348  fmatvec::VecV hT1;
349 
353  fmatvec::VecV hT2;
354 
358  fmatvec::VecV hT3;
359 
363  fmatvec::VecV hV1;
364 
368  fmatvec::VecV hV2;
369 
373  fmatvec::VecV hV3;
374 
378  fmatvec::VecV hV4;
379 
383  fmatvec::SymMatV integratePTP();
384 
388  fmatvec::SqrMatV integratePTdPdxi();
389 
393  fmatvec::SqrMatV integratePTdPdt();
394 
398  fmatvec::SqrMatV integratePTdPdqk(int qInd);
399 
403  double integrateForWgamma(int qInd);
404 
408  double integrateForWn(int qIndLoc);
409 
413  double integrateForWb(int qIndLoc);
414 
415  /*
416  * \brief compute the global xi value of the given local dof direction
417  * \remark the input values [0,1] have to global xi-values!
418  */
419  double computeXiOfDOF(int dofDirLocal);
420 
424  int AVers = 2;
425  };
426 
427 }
428 
429 #endif /* FINITE_ELEMENT_1S_REFERENCE_CURVE_H_ */
virtual fmatvec::Vec3 computeS(int columnEle, double xiGlob, int derXi)
return the column of DOF with column i
Definition: finite_element_1S_reference_curve.cc:481
int nodeDirs
Degrees of freedom for one node (number of directions)
Definition: finite_element_1S_reference_curve.h:310
fmatvec::SymMatV integratePTP()
computes the integral needed for the mass matrix ( P^T P)
Definition: finite_element_1S_reference_curve.cc:782
fmatvec::Mat3xV computeP(double xi, int derXi)
compute the P matrix
Definition: finite_element_1S_reference_curve.cc:739
virtual double computeLegendre(int j, double xiLoc, int derXi)
compute Legendre Polynomial
Definition: finite_element_1S_reference_curve.cc:315
virtual double computeGravitationalEnergy(const fmatvec::Vec &q)
compute gravitational energy
Definition: finite_element_1S_reference_curve.h:90
double integrateForWb(int qIndLoc)
computes the integral for the second part of the h vector coming from the potential energy (intForWb)...
Definition: finite_element_1S_reference_curve.cc:860
virtual void computedhdz(const fmatvec::Vec &q, const fmatvec::Vec &u)
compute Jacobian for implicit integration
Definition: finite_element_1S_reference_curve.h:84
fmatvec::Vec3 computeBuf(double xi, int derXi, int derTheta)
compute the multiplication of the B matrix with uf
Definition: finite_element_1S_reference_curve.cc:436
std::vector< int > freeDoFs
number of free DoFs in the element
Definition: finite_element_1S_reference_curve.h:315
fmatvec::VecV hV1
first part of h-vector coming from the potential energy (elongation)
Definition: finite_element_1S_reference_curve.h:363
virtual double computeXiGlob(double xiLoc)
compute the global position
Definition: finite_element_1S_reference_curve.cc:253
virtual fmatvec::Vec3 computeAnodeTimesSTimeslocVec(double xiGlob, int derXi, int derTheta, const fmatvec::Vec &locVec)
compute A of the node times the respective shape functions times the given vector ...
Definition: finite_element_1S_reference_curve.cc:519
this function returns basically three values. As these share some values it makes sense to not comput...
Definition: finite_element_1S_reference_curve_functions.h:157
fmatvec::Vec h
the right hand side vector
Definition: finite_element_1S_reference_curve.h:343
double computedKappabdqk(double xiGlob, int qIndLocal)
compute derivative of kappab w.r.t. the given DoF
Definition: finite_element_1S_reference_curve.cc:1010
virtual int getNodesSize() const
get the number of Nodes
Definition: finite_element_1S_reference_curve.h:130
FlexibleBody1SReferenceCurve * parent
parent body
Definition: finite_element_1S_reference_curve.h:279
void updateIntegrationBorders(double t)
update the borders as
Definition: finite_element_1S_reference_curve.cc:1046
Definition: finite_element_1S_reference_curve_functions.h:118
virtual double computeN(int j, double xiLoc, int derXi)
compute the result of the ansatz function N of number j Here hierarchical basis is used...
Definition: finite_element_1S_reference_curve.cc:290
fmatvec::SqrMatV integratePTdPdqk(int qInd)
computes the integral for the third part of the h vector coming from the kinetic energy ( P^T * dPdqk...
Definition: finite_element_1S_reference_curve.cc:818
fmatvec::Vec3 computeB(int dofDirLocal, double xiGlob, int derXi, int derTheta)
compute the column i of the B matrix (the column that is connected to the localDOF) ...
Definition: finite_element_1S_reference_curve.cc:344
double integrateForWn(int qIndLoc)
computes the integral of the h vector coming from the potential energy (intForWn) ...
Definition: finite_element_1S_reference_curve.cc:846
std::vector< double > borders
borders for the integration
Definition: finite_element_1S_reference_curve.h:300
double computedepsdqk(int localDofDir, double xiGlob)
compute the derivative of the local elongation w.r.t. local Dof direction
Definition: finite_element_1S_reference_curve.cc:882
Definition: finite_element_1S_reference_curve_functions.h:78
fmatvec::VecV hT2
second part of h-vector coming from the kinetic energy
Definition: finite_element_1S_reference_curve.h:353
Definition: finite_element_1S_reference_curve_functions.h:216
fmatvec::VecV hV3
third part of the h-vector coming from the potential energy (binormal bending)
Definition: finite_element_1S_reference_curve.h:373
std::vector< double > getHermiteCoeffs(int nodeNo)
function that holds the coefficient for the hermite polynoms
Definition: finite_element_1S_reference_curve.cc:642
virtual const fmatvec::SqrMat & getdhdu() const
Definition: finite_element_1S_reference_curve.h:79
fmatvec::VecV hT3
second part of h-vector coming from the kinetic energy
Definition: finite_element_1S_reference_curve.h:358
virtual const fmatvec::Vec & geth() const
Definition: finite_element_1S_reference_curve.h:72
FlexibleBody1SReferenceCurveFE(FlexibleBody1SReferenceCurve *parent, int eleNo, Vec2 alpha, int order, int nodeDofs)
standard constructor
Definition: finite_element_1S_reference_curve.cc:37
virtual int getuSize() const
Definition: finite_element_1S_reference_curve.h:65
virtual const fmatvec::SqrMat & getdhdq() const
Definition: finite_element_1S_reference_curve.h:76
double dWndqk(double xiGlob, int qInd)
compute the change of bending energy in the t/n-plane at the position w.r.t the given DoF ...
Definition: finite_element_1S_reference_curve.cc:1039
double computeKappab(double xiGlob)
compute the bending in t/b-plane
Definition: finite_element_1S_reference_curve.cc:923
double integrateForWgamma(int qInd)
computes the integral for the first part of the h vector coming from the potential energy (intForWgam...
Definition: finite_element_1S_reference_curve.cc:832
fmatvec::SqrMatV integratePTdPdxi()
computes the integral for the first part of the h vector coming from the kinetic energy ( P^T * P&#39;) ...
Definition: finite_element_1S_reference_curve.cc:794
virtual double computeKineticEnergy(const fmatvec::Vec &q, const fmatvec::Vec &u)
compute kinetic energy
Definition: finite_element_1S_reference_curve.h:87
class that implements an one dimensional nonlinear beam that uses a reference curve for the nonlinear...
Definition: flexible_body_1S_reference_curve.h:66
virtual const fmatvec::SymMat & getM() const
Definition: finite_element_1S_reference_curve.h:69
std::vector< fmatvec::Vec > qElement
stl-vector of finite element wise positions
Definition: flexible_body.h:204
fmatvec::VecInt dofDirs
vector that connects local DOFs of an element to the global DOFs
Definition: finite_element_1S_reference_curve.h:290
Finite-Element class for the body FlexibleBody1SReferenceCurve.
Definition: finite_element_1S_reference_curve.h:37
double computedKappandqk(double xiGlob, int qIndLocal)
compute derivative of kappan w.r.t. the given DoF
Definition: finite_element_1S_reference_curve.cc:928
fmatvec::Vec3 computer(double xi, int derXi=0, int derTheta=0)
compute the position and/or its derivative w.r.t. xi and/or theta
Definition: finite_element_1S_reference_curve.cc:261
fmatvec::SymMat M
Mass matrix of the element.
Definition: finite_element_1S_reference_curve.h:338
int element
number of the element
Definition: finite_element_1S_reference_curve.h:284
virtual double computeElasticEnergy(const fmatvec::Vec &q)
compute elastic energy
Definition: finite_element_1S_reference_curve.h:93
fmatvec::Vec3 computeBqf(double xi, int derXi, int derTheta)
compute the multiplication of the B matrix with qf
Definition: finite_element_1S_reference_curve.cc:391
virtual fmatvec::Vec3 computeSTimeslocVec(double xiGlob, int derXi, const fmatvec::Vec &locVec)
compute S times the given vector
Definition: finite_element_1S_reference_curve.cc:498
virtual void computeh(const fmatvec::Vec &q, const fmatvec::Vec &u)
compute smooth right hand side
Definition: finite_element_1S_reference_curve.cc:159
fmatvec::SqrMatV integratePTdPdt()
computes the integral for the second part of the h vector coming from the kinetic energy ( P^T * dPdt...
Definition: finite_element_1S_reference_curve.cc:806
virtual int getqSize() const
Definition: finite_element_1S_reference_curve.h:57
fmatvec::Vec3 computev(double xi, int derXi=0)
compute the velocity and/or its derivative w.r.t. xi and/or theta
Definition: finite_element_1S_reference_curve.cc:268
int AVers
switch between different versions of the A-Matrix
Definition: finite_element_1S_reference_curve.h:424
fmatvec::VecV hV4
fourth part of the h-vector coming from the potential energy (torsion)
Definition: finite_element_1S_reference_curve.h:378
discretization interface for flexible systems
Definition: discretization_interface.h:36
Definition: finite_element_1S_reference_curve_functions.h:28
std::vector< std::vector< std::vector< double > > > coeffs
list of polynomial coefficients First index is the node Second index is the derivative third index is...
Definition: finite_element_1S_reference_curve.h:323
int order
degree of the element
Definition: finite_element_1S_reference_curve.h:305
double computeeps(double xiGlob)
compute the local elongation
Definition: finite_element_1S_reference_curve.cc:874
double computeKappan(double xiGlob)
compute the bending in t/n-plane
Definition: finite_element_1S_reference_curve.cc:915
std::vector< double > getLagrangeCoeffs(int nodeNo)
function that holds the coefficient for the lagrange polynoms
Definition: finite_element_1S_reference_curve.cc:547
virtual double computeXiLoc(double xiGlob)
compute the local position
Definition: finite_element_1S_reference_curve.cc:245
fmatvec::VecV hV2
second part of h-vector coming from the potential energy (normal bending)
Definition: finite_element_1S_reference_curve.h:368
Definition: finite_element_1S_reference_curve_functions.h:52
fmatvec::Mat3xV computedPdqk(double xi, int dofDirLocal)
compute the P matrix derived wrt the generalized position
Definition: finite_element_1S_reference_curve.cc:754
fmatvec::Vec3 computedrdqk(double xi, int derXi, int qIndLoc)
computes the derivative wrt the generalized position of the local element
Definition: finite_element_1S_reference_curve.cc:275
virtual int getAddDoFSizeMax() const
get the number of possible degrees of freedom (some may be locked, but this is not covered in the num...
Definition: finite_element_1S_reference_curve.h:123
fmatvec::VecV hT1
first part of h-vector coming from the kinetic energy
Definition: finite_element_1S_reference_curve.h:348
virtual void computeM(const fmatvec::Vec &q)
compute mass matrix
Definition: finite_element_1S_reference_curve.cc:227
virtual void init(MBSim::Element::InitStage stage)
initialize the FE
Definition: finite_element_1S_reference_curve.cc:56

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML