All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
MBSim::Element Class Reference

basic class of MBSim mainly for plotting More...

#include <element.h>

Inheritance diagram for MBSim::Element:
fmatvec::Atom MBSim::Contour MBSim::DynamicSystem MBSim::Frame MBSim::FrictionForceLaw MBSim::FrictionImpactLaw MBSim::GeneralizedForceLaw MBSim::GeneralizedImpactLaw MBSim::Link MBSim::Object MBSim::Observer

Public Types

enum  PlotFeatureStatus { enabled, disabled, unset }
 Plot feature status. More...
 
enum  PlotFeature {
  plotRecursive =0, separateFilePerGroup, state, stateDerivative,
  notMinimalState, rightHandSide, globalPosition, globalVelocity,
  globalAcceleration, energy, openMBV, generalizedLinkForce,
  linkKinematics, stopVector, debug, LASTPLOTFEATURE
}
 Plot Features. More...
 
enum  InitStage {
  modelBuildup =0, resolveXMLPath, preInit, resize,
  relativeFrameContourLocation, worldFrameContourLocation, plotting, reorganizeHierarchy,
  unknownStage, calculateLocalInitialValues, LASTINITSTAGE
}
 The stages of the initialization. More...
 
- Public Types inherited from fmatvec::Atom
enum  MsgType
 

Public Member Functions

 Element (const std::string &name)
 constructor
 
virtual ~Element ()
 destructor
 
virtual void initDataInterfaceBase (DynamicSystemSolver *parentds)
 TODO.
 
virtual std::string getType () const
 
virtual void setDynamicSystemSolver (DynamicSystemSolver *sys)
 sets the used dynamics system solver to the element More...
 
virtual void plot (double t, double dt=1)
 plots time dependent data More...
 
virtual void plotAtSpecialEvent (double t, double dt=1)
 plots time dependent data at special events More...
 
virtual void closePlot ()
 closes plot file
 
const std::string & getName () const
 
void setName (const std::string &str)
 
void setPath (const std::string &str)
 
DynamicSystemSolvergetDynamicSystemSolver ()
 
virtual void init (InitStage stage)
 plots time series header More...
 
virtual void createPlotGroup ()
 creates the plotGroup for H5-output
 
H5::GroupBasegetPlotGroup ()
 
virtual void setPlotFeature (PlotFeature pf, PlotFeatureStatus value)
 Set a plot feature. More...
 
void setPlotFeatureForChildren (PlotFeature pf, PlotFeatureStatus value)
 Set a plot feature for the children of this object. More...
 
void setPlotFeatureRecursive (PlotFeature pf, PlotFeatureStatus value)
 Set a plot feature for this object and the children of this object. More...
 
PlotFeatureStatus getPlotFeature (PlotFeature pf)
 
PlotFeatureStatus getPlotFeatureForChildren (PlotFeature pf)
 
virtual void initializeUsingXML (xercesc::DOMElement *element)
 
virtual xercesc::DOMElement * writeXMLFile (xercesc::DOMNode *element)
 
const std::vector
< MBXMLUtils::EmbedDOMLocator > & 
getLocationStack () const
 
template<class T >
T * getByPath (const std::string &path, bool initialCaller=true) const
 Get the object of type T represented by the path path. Do not set any argurment other than path!
 
std::string getPath (const Element *relTo=NULL, std::string sep="/") const
 Return the path of this object. If relativeTo is not NULL return a relative path to relativeTo. Do not set any argurment other than relTo and sep!
 
virtual ElementgetChildByContainerAndName (const std::string &container, const std::string &name) const
 Get the Element named name in the container named container.
 
virtual ElementgetParent ()
 
virtual const ElementgetParent () const
 
virtual void setParent (Element *parent_)
 
std::vector< Element * > getElementsDependingOn () const
 checks dependency on other elements. More...
 
void addDependency (Element *ele)
 
int computeLevel ()
 computes the length of the pathes in the graph that represents the dependencies between all elements. More...
 
- Public Member Functions inherited from fmatvec::Atom
Atomoperator= (const Atom &)
 
void setMessageStreamActive (MsgType type, bool active)
 
void getMessageStream (MsgType type, boost::shared_ptr< bool > &a, boost::shared_ptr< std::ostream > &s)
 
void adoptMessageStreams (const Atom *src=NULL)
 
std::ostream & msg (MsgType type)
 
bool msgAct (MsgType type)
 

Static Public Member Functions

static double getDouble (xercesc::DOMElement *e)
 
static int getInt (xercesc::DOMElement *e)
 
static bool getBool (xercesc::DOMElement *e)
 
static fmatvec::Vec3 getVec3 (xercesc::DOMElement *e)
 
static fmatvec::Vec getVec (xercesc::DOMElement *e, int rows=0)
 
static fmatvec::Mat3xV getMat3xV (xercesc::DOMElement *e, int cols=0)
 
static fmatvec::Mat getMat (xercesc::DOMElement *e, int rows=0, int cols=0)
 
static fmatvec::SqrMat3 getSqrMat3 (xercesc::DOMElement *e)
 
static fmatvec::SqrMat getSqrMat (xercesc::DOMElement *e, int size=0)
 
static fmatvec::SymMat3 getSymMat3 (xercesc::DOMElement *e)
 
static fmatvec::SymMat getSymMat (xercesc::DOMElement *e, int size=0)
 
- Static Public Member Functions inherited from fmatvec::Atom
static void setCurrentMessageStream (MsgType type, const boost::shared_ptr< bool > &a=boost::make_shared< bool >(true), const boost::shared_ptr< std::ostream > &s=boost::make_shared< std::ostream >(std::cout.rdbuf()))
 
static std::ostream & msgStatic (MsgType type)
 
static bool msgActStatic (MsgType type)
 

Protected Member Functions

void updatePlotFeatures ()
 
- Protected Member Functions inherited from fmatvec::Atom
 Atom (const Atom &src)
 

Protected Attributes

Elementparent
 
std::string name
 name of element
 
std::string path
 The path of this object. Is set during the init stage reorganizeHierarchy. Before this the path is calculated dynamically using getPath() after this stage getPath just returns this value.
 
std::vector
< MBXMLUtils::EmbedDOMLocator > 
locationStack
 
DynamicSystemSolverds
 dynamic system
 
H5::VectorSerie< double > * plotVectorSerie
 time series
 
std::vector< double > plotVector
 one entry of time series
 
std::vector< std::string > plotColumns
 columns of time series
 
H5::GroupBaseplotGroup
 associated plot group
 
std::vector< Element * > dependency
 vector containing all dependencies.
 

Private Attributes

PlotFeatureStatus plotFeature [LASTPLOTFEATURE]
 plot feature
 
PlotFeatureStatus plotFeatureForChildren [LASTPLOTFEATURE]
 

Detailed Description

basic class of MBSim mainly for plotting

Author
Martin Foerg
Date
2009-03-24 plot feature energy (Thorsten Schindler)
2009-07-28 splitted interfaces (Thorsten Schindler)

Member Enumeration Documentation

The stages of the initialization.

see also DynamicSystemSolver::init()

Enumerator
resolveXMLPath 

resolve the path (given by the XML ref* attributes) to the corrosponding pointer

preInit 

Make some early initialization. TODO This should be split into detailed stages.

resize 

Do the resizing of all vectors, matrices and containers, ...

relativeFrameContourLocation 

Set the relative position and orientation of all Frame's/Contour's in all Group's/RigidBody's

worldFrameContourLocation 

Set the world position and orientation of all Frame's/Contour's in all Group's

plotting 

Build/initialize the plot structure

reorganizeHierarchy 

Reorganize the hierarchy (build invisible tree structur)

unknownStage 

Init all the rest. TODO This should be split into detailed stages.

calculateLocalInitialValues 

calculation of non-linear initial values in complex internal models

Plot Features.

Enumerator
plotRecursive 

enables/disables all plotting beyond this hierarchy

separateFilePerGroup 

create a separate h5 file for the Group

state 

plot the state vector (x, q, u)

stateDerivative 

plot the derivative of the state vector (xd, qd, ud)

rightHandSide 

plot the smooth and non smooth right hand size (h, r=W*l)

globalPosition 

plot some global (world) positions/orientation

globalVelocity 

plot some global (world) velocities

globalAcceleration 

plot some global (world) accelerations

energy 

plot the energy

openMBV 

plot the OpenMBV part

generalizedLinkForce 

plot the smooth/non smooth generalized link force (l)

linkKinematics 

plot the kinematic of links (g, gd)

stopVector 

plot the stop vector (sv)

debug 

plot internal sizes

Plot feature status.

Enumerator
enabled 

set the feature enabled

disabled 

set the feature disabled

unset 

use the default value for the feature

Member Function Documentation

int MBSim::Element::computeLevel ( )

computes the length of the pathes in the graph that represents the dependencies between all elements.

Returns
the length of the longest path in the graph.
DynamicSystemSolver* MBSim::Element::getDynamicSystemSolver ( )
inline
Returns
dynamic system solver
std::vector<Element*> MBSim::Element::getElementsDependingOn ( ) const
inline

checks dependency on other elements.

Returns
a vector of elements the calling element depends on.
const std::string& MBSim::Element::getName ( ) const
inline
Returns
element name
PlotFeatureStatus MBSim::Element::getPlotFeature ( PlotFeature  pf)
inline
Returns
plot feature
PlotFeatureStatus MBSim::Element::getPlotFeatureForChildren ( PlotFeature  pf)
inline
Returns
plot feature for derived classes
H5::GroupBase* MBSim::Element::getPlotGroup ( )
inline
Returns
associated plot group
virtual std::string MBSim::Element::getType ( ) const
inlinevirtual
void MBSim::Element::init ( InitStage  stage)
virtual
void MBSim::Element::plot ( double  t,
double  dt = 1 
)
virtual
virtual void MBSim::Element::plotAtSpecialEvent ( double  t,
double  dt = 1 
)
inlinevirtual

plots time dependent data at special events

Parameters
simulationtime
simulationtime step size for derivative calculation

Reimplemented in MBSim::DynamicSystem.

virtual void MBSim::Element::setDynamicSystemSolver ( DynamicSystemSolver sys)
inlinevirtual

sets the used dynamics system solver to the element

Parameters
pointerto the dynamic system solver of which the element is part of

Reimplemented in MBSim::DynamicSystem, MBSim::Body, and MBSim::Contact.

void MBSim::Element::setName ( const std::string &  str)
inline
Parameters
elementname
virtual void MBSim::Element::setPlotFeature ( PlotFeature  pf,
PlotFeatureStatus  value 
)
inlinevirtual

Set a plot feature.

Set the plot feature pf of this object to enabled, disabled or unset. If unset, this object uses the value of the plot feature pf of its parent object.

void MBSim::Element::setPlotFeatureForChildren ( PlotFeature  pf,
PlotFeatureStatus  value 
)
inline

Set a plot feature for the children of this object.

Set the plot feature pf of all children which plot feature is unset to enabled, disabled or unset.

void MBSim::Element::setPlotFeatureRecursive ( PlotFeature  pf,
PlotFeatureStatus  value 
)
inline

Set a plot feature for this object and the children of this object.

This is a convenience function. It simply calls setPlotFeature and setPlotFeatureForChildren.


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

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML