mbsimflexiblebody  4.0.0
MBSim Flexible Body Module
MBSimFlexibleBody::FlexibleBodyLinearExternal Class Reference

Linear models from external preprocessing, e.g. Finite Element model. More...

#include <linear_external.h>

Inheritance diagram for MBSimFlexibleBody::FlexibleBodyLinearExternal:
[legend]

Public Member Functions

 FlexibleBodyLinearExternal (const std::string &name)
 constructor More...
 
virtual ~FlexibleBodyLinearExternal ()
 destructor
 
virtual void init (InitStage stage, const MBSim::InitConfigSet &config)
 
virtual void facLLM ()
 
virtual void BuildElements ()
 references finite element coordinates to assembled coordinates More...
 
virtual void GlobalVectorContribution (int n, const fmatvec::Vec &locVec, fmatvec::Vec &gloVec)
 insert 'local' information in global vectors More...
 
virtual void GlobalMatrixContribution (int n, const fmatvec::Mat &locMat, fmatvec::Mat &gloMat)
 insert 'local' information in global matrices More...
 
virtual void GlobalMatrixContribution (int n, const fmatvec::SymMat &locMat, fmatvec::SymMat &gloMat)
 insert 'local' information in global matrices More...
 
virtual void updateKinematicsForFrame (MBSim::ContourPointData &cp, MBSim::Frame::Feature ff, MBSim::Frame *frame=0)
 
virtual void updateJacobiansForFrame (MBSim::ContourPointData &data, MBSim::Frame *frame=0)
 
void readMassMatrix (const std::string &massfilename)
 
void setMassMatrix (const fmatvec::SymMat &mat)
 
void readStiffnessMatrix (const std::string &stiffnessfilename)
 
void setStiffnessMatrix (const fmatvec::SqrMat &mat)
 
void setProportionalDamping (const double &a, const double &b)
 
void setWrON00 (const fmatvec::Vec &WrON00_)
 
fmatvec::Mat computeJacobianMatrix (const MBSim::ContourPointData &CP)
 
- Public Member Functions inherited from MBSimFlexibleBody::FlexibleBody
 FlexibleBody (const std::string &name)
 constructor More...
 
 ~FlexibleBody () override
 destructor
 
void updateqd () override
 
void updateh (int k=0) override
 
void updateM () override
 
void updatedhdz () override
 
void initializeUsingXML (xercesc::DOMElement *element) override
 
void init (InitStage stage, const MBSim::InitConfigSet &config) override
 
virtual double computeKineticEnergy ()
 
virtual double computePotentialEnergy ()
 
void setFrameOfReference (MBSim::Frame *frame) override
 
virtual void setq0 (const fmatvec::Vec &q0_)
 
virtual void setu0 (const fmatvec::Vec &u0_)
 
virtual void BuildElements ()=0
 references finite element coordinates to assembled coordinates More...
 
const fmatvec::Vec & getqElement (int i)
 
const fmatvec::Vec & getuElement (int i)
 
virtual fmatvec::Vec3 getAngles (int i)
 
virtual fmatvec::Vec3 getDerivativeOfAngles (int i)
 
virtual void GlobalVectorContribution (int CurrentElement, const fmatvec::Vec &locVec, fmatvec::Vec &gloVec)=0
 insert 'local' information in global vectors More...
 
virtual void GlobalMatrixContribution (int CurrentElement, const fmatvec::Mat &locMat, fmatvec::Mat &gloMat)=0
 insert 'local' information in global matrices More...
 
virtual void GlobalMatrixContribution (int CurrentElement, const fmatvec::SymMat &locMat, fmatvec::SymMat &gloMat)=0
 insert 'local' information in global matrices More...
 
void setMassProportionalDamping (const double d_)
 Jacobians and gyroscopes for contour or external frame are set by implementation class. More...
 
void addFrame (MBSim::ContourFrame *frame)
 
void addFrame (MBSim::FixedRelativeFrame *frame)
 
void addContour (MBSim::Contour *contour) override
 
virtual void exportPositionVelocity (const std::string &filenamePos, const std::string &filenameVel=std::string(), const int &deg=3, const bool &writePsFile=false)
 interpolates the position and optional the velocity coordinates of the flexible body with Nurbs-package and exports the nurbs curve in the specified file More...
 
virtual void importPositionVelocity (const std::string &filenamePos, const std::string &filenameVel=std::string())
 imports the interpolated position and optional the velocity files (created with exportPositionVelocity) and fits the rigid and flexible coordinate dofs and optional the translatory velocity components of flexible body to the imported nurbs curve More...
 
void resetUpToDate () override
 
void addFrame (NodeBasedFrame *frame)
 
- Public Member Functions inherited from MBSimFlexibleBody::NodeBasedBody
 NodeBasedBody (const std::string &name)
 
void resetUpToDate () override
 
virtual void updatePositions (int i)
 
virtual void updateVelocities (int i)
 
virtual void updateAccelerations (int i)
 
virtual void updateJacobians (int i, int j=0)
 
virtual void updateGyroscopicAccelerations (int i)
 
virtual void updateStresses (int i)
 
const fmatvec::Vec3 & evalNodalPosition (int i)
 
const fmatvec::Vec3 & evalNodalVelocity (int i)
 
const fmatvec::Vec3 & evalNodalAcceleration (int i)
 
const fmatvec::Mat3xV & evalNodalJacobianOfTranslation (int i, int j=0)
 
const fmatvec::Vec3 & evalNodalGyroscopicAccelerationOfTranslation (int i)
 
const fmatvec::Vec3 & evalNodalDisplacement (int i)
 
const fmatvec::Vector< fmatvec::Fixed< 6 >, double > & evalNodalStress (int i)
 
fmatvec::SqrMat3 & getNodalOrientation (int i, bool check=true)
 
fmatvec::Vec3 & getNodalAngularVelocity (int i, bool check=true)
 
fmatvec::Vec3 & getNodalAngularAcceleration (int i, bool check=true)
 
fmatvec::Mat3xV & getNodalJacobianOfRotation (int i, int j=0, bool check=true)
 
fmatvec::Vec3 & getNodalGyroscopicAccelerationOfRotation (int i, bool check=true)
 
void addFrame (NodeBasedFrame *frame)
 
void init (InitStage stage, const MBSim::InitConfigSet &config) override
 
int getNumberOfNodes ()
 
int getNodeIndex (int nodeNumber) const
 
- Public Member Functions inherited from MBSim::Body
 Body (const std::string &name)
 
void plot () override
 
void setDynamicSystemSolver (DynamicSystemSolver *sys) override
 
void init (InitStage stage, const InitConfigSet &config) override
 
void createPlotGroup () override
 
virtual ContourgetContour (const std::string &name, bool check=true) const
 
virtual FramegetFrame (const std::string &name, bool check=true) const
 
virtual FramegetFrameOfReference ()
 
virtual const FramegetFrameOfReference () const
 
virtual void setFrameOfReference (Frame *frame)
 
int frameIndex (const Frame *frame_) const
 
int contourIndex (const Contour *contour_) const
 
ElementgetChildByContainerAndName (const std::string &container, const std::string &name) const override
 
virtual void addFrame (Frame *frame)
 
virtual void addContour (Contour *contour)
 
- Public Member Functions inherited from MBSim::Object
 Object (const std::string &name)
 
void plot () override
 
virtual void updateqRef (fmatvec::Vec &qRef)
 
virtual void updateqdRef (fmatvec::Vec &qdRef)
 
virtual void updatedqRef (fmatvec::Vec &dqRef)
 
virtual void updateuRef (fmatvec::Vec &uRef)
 
virtual void updateuallRef (fmatvec::Vec &uallRef)
 
virtual void updateudRef (fmatvec::Vec &udRef)
 
virtual void updateduRef (fmatvec::Vec &duRef)
 
virtual void updateudallRef (fmatvec::Vec &udallRef)
 
virtual void updatehRef (fmatvec::Vec &hRef, int i=0)
 
virtual void updatedhdqRef (fmatvec::Mat &dhdqRef, int i=0)
 
virtual void updatedhduRef (fmatvec::SqrMat &dhduRef, int i=0)
 
virtual void updatedhdtRef (fmatvec::Vec &dhdtRef, int i=0)
 
virtual void updaterRef (fmatvec::Vec &ref, int i=0)
 
virtual void updaterdtRef (fmatvec::Vec &ref)
 
virtual void updateTRef (fmatvec::Mat &ref)
 
virtual void updateMRef (fmatvec::SymMat &ref)
 
virtual void updateLLMRef (fmatvec::SymMat &ref)
 
void init (InitStage stage, const InitConfigSet &config) override
 
virtual void initz ()
 
virtual void writez (H5::GroupBase *group)
 
virtual void readz0 (H5::GroupBase *group)
 
virtual void updateLLM ()
 
virtual void setUpInverseKinetics ()
 
void createPlotGroup () override
 
- Public Member Functions inherited from MBSim::Element
 Element (const std::string &name)
 
virtual void setDynamicSystemSolver (DynamicSystemSolver *sys)
 
virtual void plot ()
 
virtual void plotAtSpecialEvent ()
 
const std::string & getName () const
 
void setName (const std::string &str)
 
DynamicSystemSolvergetDynamicSystemSolver ()
 
virtual void init (InitStage stage, const InitConfigSet &config=InitConfigSet())
 
virtual void createPlotGroup ()
 
H5::GroupBasegetPlotGroup ()
 
bool getPlotFeature (const PlotFeatureEnum &pf)
 
virtual void setPlotFeature (const PlotFeatureEnum &pf, bool value)
 
void setPlotFeatureForChildren (const PlotFeatureEnum &pf, bool value)
 
void setPlotFeatureRecursive (const PlotFeatureEnum &pf, bool value)
 
void setPlotAttribute (const std::string &name, const T &value, PlotAttributeStorage storage=PlotAttributeStorage::attribute)
 
T * getByPath (const std::string &path, bool initialCaller=true) const
 
std::string getPath (const Element *relTo=nullptr, std::string sep="/") const
 
virtual ElementgetChildByContainerAndName (const std::string &container, const std::string &name) const
 
std::vector< Element * > getDependencies () const
 
int computeLevel ()
 

Protected Member Functions

void updateStateDependentVariables (double t)
 
void updateContours (double t)
 
MBSim::ContourPointData addInterface (const std::string &jacbifilename)
 
MBSim::ContourPointData addInterface (const fmatvec::Mat &J, const fmatvec::Vec &r)
 
void updateJh_internal (double t)
 

Protected Attributes

int nContours
 
std::vector< MBSim::ContourPointData > contourType
 
fmatvec::Vec WrON00
 
- Protected Attributes inherited from MBSimFlexibleBody::FlexibleBody
std::vector< DiscretizationInterface * > discretization
 stl-vector of discretizations/finite elements
 
std::vector< fmatvec::Vec > qElement
 stl-vector of finite element wise positions
 
std::vector< fmatvec::Vec > uElement
 stl-vector of finite element wise velocities
 
double d_massproportional
 damping factor for mass proportion, see BodyFlexible::setMassProportionalDamping()
 
bool updEle
 vector of contour parameters each describing a frame More...
 
- Protected Attributes inherited from MBSimFlexibleBody::NodeBasedBody
std::vector< fmatvec::Vec3 > WrOP
 
std::vector< fmatvec::Vec3 > WvP
 
std::vector< fmatvec::Vec3 > Wom
 
std::vector< fmatvec::Vec3 > WaP
 
std::vector< fmatvec::Vec3 > Wpsi
 
std::vector< fmatvec::Vec3 > WjP
 
std::vector< fmatvec::Vec3 > WjR
 
std::vector< fmatvec::Vec3 > disp
 
std::vector< fmatvec::SqrMat3 > AWK
 
std::vector< fmatvec::Mat3xV > WJP [2]
 
std::vector< fmatvec::Mat3xV > WJR [2]
 
std::vector< bool > updNodalPos
 
std::vector< bool > updNodalVel
 
std::vector< bool > updNodalAcc
 
std::vector< bool > updNodalGA
 
std::vector< bool > updNodalStress
 
std::vector< bool > updNodalJac [2]
 
std::vector< fmatvec::Vector< fmatvec::Fixed< 6 >, double > > sigma
 
int nn {0}
 
std::vector< int > nodeMap
 
std::vector< int > nodeNumbers
 
- Protected Attributes inherited from MBSim::Body
std::vector< Frame * > frame
 
FrameR
 
fmatvec::Mat3xV PJT [2]
 
- Protected Attributes inherited from MBSim::Object
int qSize
 
int uSize [2]
 
int hSize [2]
 
int qInd
 
fmatvec::Vec q
 
fmatvec::Vec q0
 
fmatvec::Vec qd
 
fmatvec::Vec h [2]
 
fmatvec::Mat dhdq
 
fmatvec::Mat T
 
fmatvec::SymMat M
 
fmatvec::SymMat LLM
 
- Protected Attributes inherited from MBSim::Element
std::string name
 
std::string path
 
MBXMLUtils::DOMEvalException domEvalError
 
DynamicSystemSolverds
 
H5::VectorSerie< double > * plotVectorSerie
 
std::vector< double > plotVector
 
std::vector< std::string > plotColumns
 
H5::GroupBaseplotGroup
 
std::vector< Element * > dependency
 
PlotFeatureMap plotFeature
 

Additional Inherited Members

- Public Types inherited from MBSim::Element
enum  InitStage
 
- Public Attributes inherited from MBSim::Element
 resolveStringRef
 
 preInit
 
 plotting
 
 unknownStage
 

Detailed Description

Linear models from external preprocessing, e.g. Finite Element model.

Author
Roland Zander
Date
2009-03-26 initial kernel_dev commit (Roland Zander)
2009-04-05 minor change: parent class is not template class (Schindler / Zander)
2009-07-23 implicit integration (Thorsten Schindler)

Systems equation of motion:

\[ \vM{\rm d}\vu = -( \vK \vq + \vD \vu){\rm d}t - \vW{\rm d}\vLambda \]

with CONSTANT matrices \(\vM,\vK,\vD\). The model uses n degrees of freedom (dimension of \(\vq,\vu\)) and d translational directions (dimension of Jacobi-matrizes \(n\times d\))

Constructor & Destructor Documentation

◆ FlexibleBodyLinearExternal()

MBSimFlexibleBody::FlexibleBodyLinearExternal::FlexibleBodyLinearExternal ( const std::string &  name)

constructor

Parameters
nameof body

Member Function Documentation

◆ addInterface() [1/2]

MBSim::ContourPointData MBSimFlexibleBody::FlexibleBodyLinearExternal::addInterface ( const fmatvec::Mat &  J,
const fmatvec::Vec &  r 
)
protected

create interface in form of ContourPointData based on Jacobian matrix and undeformed position

Returns
cpData for refering to Port or Contour added
Parameters
JJacobian matrix
rundeformed position in body coordinate system

◆ addInterface() [2/2]

MBSim::ContourPointData MBSimFlexibleBody::FlexibleBodyLinearExternal::addInterface ( const std::string &  jacbifilename)
protected

create interface in form of ContourPointData based on file

Returns
cpData for refering to Port or Contour added
Parameters
jacbifilenamefile containing interface data

◆ BuildElements()

virtual void MBSimFlexibleBody::FlexibleBodyLinearExternal::BuildElements ( )
inlinevirtual

references finite element coordinates to assembled coordinates

Implements MBSimFlexibleBody::FlexibleBody.

◆ GlobalMatrixContribution() [1/2]

void MBSimFlexibleBody::FlexibleBodyLinearExternal::GlobalMatrixContribution ( int  CurrentElement,
const fmatvec::Mat &  locMat,
fmatvec::Mat &  gloMat 
)
virtual

insert 'local' information in global matrices

Parameters
CurrentElementnumber of current finite element
locMatlocal matrix
gloMatglobal matrix

Implements MBSimFlexibleBody::FlexibleBody.

◆ GlobalMatrixContribution() [2/2]

void MBSimFlexibleBody::FlexibleBodyLinearExternal::GlobalMatrixContribution ( int  CurrentElement,
const fmatvec::SymMat &  locMat,
fmatvec::SymMat &  gloMat 
)
virtual

insert 'local' information in global matrices

Parameters
CurrentElementnumber of current finite element
locMatlocal matrix
gloMatglobal matrix

Implements MBSimFlexibleBody::FlexibleBody.

◆ GlobalVectorContribution()

void MBSimFlexibleBody::FlexibleBodyLinearExternal::GlobalVectorContribution ( int  CurrentElement,
const fmatvec::Vec &  locVec,
fmatvec::Vec &  gloVec 
)
virtual

insert 'local' information in global vectors

Parameters
numberof finite element
localvector
globalvector

Implements MBSimFlexibleBody::FlexibleBody.

◆ readMassMatrix()

void MBSimFlexibleBody::FlexibleBodyLinearExternal::readMassMatrix ( const std::string &  massfilename)

read mass matrix: style e.g. for 2*2 matrix
n x n
[1.0 0.0
 0.0 1.0]

Parameters
massfilenamename of file holding mass matrix

◆ readStiffnessMatrix()

void MBSimFlexibleBody::FlexibleBodyLinearExternal::readStiffnessMatrix ( const std::string &  stiffnessfilename)

read stiffness matrix form given file readMassMatrix(const std::string &massfilename)

Parameters
stiffnessfilenamename of file holding stiffness matrix

◆ setMassMatrix()

void MBSimFlexibleBody::FlexibleBodyLinearExternal::setMassMatrix ( const fmatvec::SymMat &  mat)

set mass matrix:

Parameters
matmass matrix

◆ setProportionalDamping()

void MBSimFlexibleBody::FlexibleBodyLinearExternal::setProportionalDamping ( const double &  a,
const double &  b 
)

set damping \(\vD\) proportional to mass and stiffness

\[ \vD = \alpha * \vM + \beta*\vK \]

Parameters
a_\(\alpha\)
b_\(\beta \)

◆ setStiffnessMatrix()

void MBSimFlexibleBody::FlexibleBodyLinearExternal::setStiffnessMatrix ( const fmatvec::SqrMat &  mat)

read stiffness matrix

Parameters
matstiffness matrix

◆ setWrON00()

void MBSimFlexibleBody::FlexibleBodyLinearExternal::setWrON00 ( const fmatvec::Vec &  WrON00_)
inline

plot parameters of "BodyFlexibleLinearExternal" ‍/ void plotParameters();

  using FlexibleBody::addFrame;
  /*!
     add Port using JACOBIAN matrix and frame location form given file
     n x d   \n   [1.0  \n  0.0 ] \n
     \n
     d x 1   \n   [1.0  \n  0.0   \n  0.0 ]
     \param name name of Port create
     \param jacobifilename name of file holding matrices

add Port using JACOBIAN matrix and location of reference point

Parameters
nameof Port to
JJacobian matrix create
rundeformed reference point in body coordinate system

add Contour using information given in file for JACOBIAN matrix and location of reference point

Parameters
contourContour to add
jacobifilenamename of file holding matrices

add Contour using JACOBIAN matrix and location of reference point

Parameters
contourContour to add
JJacobian matrix
rundeformed reference point in body coordinate system

add a ContourInterpolation, no additional information needed

set origin BodyFlexibleLinearExternal::WrON00, \(_W \vr_{K0}\) of model

◆ updateContours()

void MBSimFlexibleBody::FlexibleBodyLinearExternal::updateContours ( double  t)
protected

Kinematical update of postition and velocities of every Contour:

\[ \vr_{C} = \vr_{K} + \vJ_T(\vr_{P0} + \vW^T\vq) \]

Parameters
ttime
Todo:
angular kinematics

◆ updateKinematicsForFrame()

void MBSimFlexibleBody::FlexibleBodyLinearExternal::updateKinematicsForFrame ( MBSim::ContourPointData &  cp,
MBSim::Frame::Feature  ff,
MBSim::Frame frame = 0 
)
virtual

Kinematical update of postition and velocities of every attached Frame:

\[ \vr_{P} = \vr_{K} + \vJ_T(\vr_{P0} + \vW^T\vq) \]

Parameters
ttime
Todo:
angular kinematics

◆ updateStateDependentVariables()

void MBSimFlexibleBody::FlexibleBodyLinearExternal::updateStateDependentVariables ( double  t)
protected

update kinematical values
Call to updateFrames(double t) and updateContours(double t)

Parameters
ttime

Member Data Documentation

◆ contourType

std::vector<MBSim::ContourPointData> MBSimFlexibleBody::FlexibleBodyLinearExternal::contourType
protected

vector of ContourPointData controlling type of interface: node/interpolation

◆ nContours

int MBSimFlexibleBody::FlexibleBodyLinearExternal::nContours
protected

number of Contours directly asoziated to body

◆ WrON00

fmatvec::Vec MBSimFlexibleBody::FlexibleBodyLinearExternal::WrON00
protected

origin \(_W \vr_{K0}\) of model


The documentation for this class was generated from the following files: