All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
superelement_linear_external.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  * Contact: thorsten.schindler@mytum.de
18  * rzander@users.berlios.de
19  */
20 
21 #ifndef _SUPERELEMENT_LINEAR_EXTERNAL_H_
22 #define _SUPERELEMENT_LINEAR_EXTERNAL_H_
23 
24 #include "fmatvec/fmatvec.h"
25 #include "mbsim/discretization_interface.h"
26 #include "mbsim/mbsim_event.h"
27 #include "mbsim/contour_pdata.h"
28 
29 namespace MBSimFlexibleBody {
30 
39  public:
41  void init(MBSim::Element::InitStage stage);
42 
46  void setM(const fmatvec::SymMat &M_);
47 
51  void setK(const fmatvec::SqrMat &K_);
52 
59  void setProportionalDamping(double alpha_,double beta_) { alpha=alpha_; beta=beta_; }
60 
61  const fmatvec::SymMat& getM() const { return M; }
62  const fmatvec::Vec& geth() const { return h; }
63 
64  const fmatvec::SqrMat& getdhdq() const { return Dhq; }
65  const fmatvec::SqrMat& getdhdu() const { return Dhqp; }
66  int getqSize() const { return K.size(); }
67  int getuSize() const { return M.size(); }
68 
69  void computeM(const fmatvec::Vec& qElement) {}
73  void computeh(const fmatvec::Vec& qElement,const fmatvec::Vec& uElement) { h = - K * qElement - D * uElement; }
74  void computedhdz(const fmatvec::Vec& qElement,const fmatvec::Vec& uElement) {}
75  double computeKineticEnergy(const fmatvec::Vec& q,const fmatvec::Vec& u) { return 0.5*u.T()*M*u;}
76  double computeGravitationalEnergy(const fmatvec::Vec& q) { return 0.0;}
77  double computeElasticEnergy(const fmatvec::Vec& q) { return 0.5*q.T()*K*q;}
78 
79  fmatvec::Vec computeVelocity(const fmatvec::Vec&q,const fmatvec::Vec&u,const MBSim::ContourPointData& cp) { return computeJacobianOfMotion(q,cp).T()*u;}
80  fmatvec::Vec computeAngularVelocity(const fmatvec::Vec&q,const fmatvec::Vec&u,const MBSim::ContourPointData& cp) { return computeJacobianOfMotion(q,cp).T()*u;}
81  fmatvec::Vec computePosition(const fmatvec::Vec&q,const MBSim::ContourPointData& cp);
82  fmatvec::SqrMat computeOrientation(const fmatvec::Vec&q,const MBSim::ContourPointData& cp) { throw MBSim::MBSimError("(SuperElementLinearExternal::computeOrientation): Not Implemented");}
83  fmatvec::Mat computeJacobianOfMotion(const fmatvec::Vec&q,const MBSim::ContourPointData& cp);
84 
85  MBSim::ContourPointData addInterface(fmatvec::Mat J_, fmatvec::Vec KrP_);
86 
87  protected:
97  double alpha;
99  double beta;
103  std::vector<fmatvec::Mat> J;
105  std::vector<fmatvec::Vec> KrP;
106  };
107 
108 }
109 
110 #endif /* _SUPERELEMENT_LINEAR_EXTERNAL_H_ */
111 
double beta
Definition: superelement_linear_external.h:99
void computeh(const fmatvec::Vec &qElement, const fmatvec::Vec &uElement)
Definition: superelement_linear_external.h:73
void setProportionalDamping(double alpha_, double beta_)
Definition: superelement_linear_external.h:59
double computeElasticEnergy(const fmatvec::Vec &q)
compute elastic energy
Definition: superelement_linear_external.h:77
fmatvec::SqrMat Dhq
Definition: superelement_linear_external.h:101
const fmatvec::SqrMat & getdhdu() const
Definition: superelement_linear_external.h:65
std::vector< fmatvec::Vec > KrP
Definition: superelement_linear_external.h:105
fmatvec::SqrMat D
Definition: superelement_linear_external.h:95
const fmatvec::SymMat & getM() const
Definition: superelement_linear_external.h:61
std::vector< fmatvec::Mat > J
Definition: superelement_linear_external.h:103
const fmatvec::Vec & geth() const
Definition: superelement_linear_external.h:62
int getqSize() const
Definition: superelement_linear_external.h:66
double computeGravitationalEnergy(const fmatvec::Vec &q)
compute gravitational energy
Definition: superelement_linear_external.h:76
void setK(const fmatvec::SqrMat &K_)
Definition: superelement_linear_external.cc:45
void computedhdz(const fmatvec::Vec &qElement, const fmatvec::Vec &uElement)
compute Jacobian for implicit integration
Definition: superelement_linear_external.h:74
double computeKineticEnergy(const fmatvec::Vec &q, const fmatvec::Vec &u)
compute kinetic energy
Definition: superelement_linear_external.h:75
double alpha
Definition: superelement_linear_external.h:97
fmatvec::SymMat M
Definition: superelement_linear_external.h:89
discretization interface for flexible systems
Definition: discretization_interface.h:36
int getuSize() const
Definition: superelement_linear_external.h:67
void setM(const fmatvec::SymMat &M_)
Definition: superelement_linear_external.cc:40
void computeM(const fmatvec::Vec &qElement)
compute mass matrix
Definition: superelement_linear_external.h:69
superelement for linear models from external preprocessing.
Definition: superelement_linear_external.h:38
fmatvec::SqrMat K
Definition: superelement_linear_external.h:93
fmatvec::Vec h
Definition: superelement_linear_external.h:91
const fmatvec::SqrMat & getdhdq() const
Definition: superelement_linear_external.h:64

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML