MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
ReferenceFrame Class Reference

#include <reffrm.h>

Inheritance diagram for ReferenceFrame:
Collaboration diagram for ReferenceFrame:

Public Member Functions

 ReferenceFrame (void)
 
 ReferenceFrame (unsigned int uLabel, const Vec3 &xIn, const Mat3x3 &RIn, const Vec3 &vIn, const Vec3 &wIn, const OrientationDescription &ood)
 
 ReferenceFrame (const RigidBodyKinematics *pRBK)
 
 ~ReferenceFrame (void)
 
const Vec3GetX (void) const
 
const Mat3x3GetR (void) const
 
const Vec3GetV (void) const
 
const Vec3GetW (void) const
 
const Vec3GetXPP (void) const
 
const Vec3GetWP (void) const
 
ReferenceFrameoperator= (const ReferenceFrame &rf)
 
std::ostream & Output (std::ostream &out) const
 
- Public Member Functions inherited from WithLabel
 WithLabel (unsigned int uL=0, const std::string &sN="")
 
virtual ~WithLabel (void)
 
void PutLabel (unsigned int uL)
 
void PutName (const std::string &sN)
 
unsigned int GetLabel (void) const
 
const std::string & GetName (void) const
 
- Public Member Functions inherited from RigidBodyKinematics
virtual ~RigidBodyKinematics (void)
 
virtual void Update (void)
 

Private Attributes

Vec3 x
 
Mat3x3 R
 
Vec3 v
 
Vec3 w
 
OrientationDescription od
 

Additional Inherited Members

- Protected Attributes inherited from WithLabel
unsigned int uLabel
 
std::string sName
 

Detailed Description

Definition at line 46 of file reffrm.h.

Constructor & Destructor Documentation

ReferenceFrame::ReferenceFrame ( void  )

Definition at line 41 of file reffrm.cc.

References NO_OP.

42 : WithLabel(0),
43 x(::mb_zero<Vec3>()),
44 R(::mb_deye<Mat3x3>(1.)),
45 v(::mb_zero<Vec3>()),
46 w(::mb_zero<Vec3>()),
48 {
49  NO_OP;
50 }
const Vec3 & mb_zero< Vec3 >(void)
Definition: matvec3.h:1560
Mat3x3 mb_deye< Mat3x3 >(const doublereal d)
Definition: matvec3.h:1584
#define NO_OP
Definition: myassert.h:74
OrientationDescription od
Definition: reffrm.h:53
Mat3x3 R
Definition: reffrm.h:49
WithLabel(unsigned int uL=0, const std::string &sN="")
Definition: withlab.cc:38
ReferenceFrame::ReferenceFrame ( unsigned int  uLabel,
const Vec3 xIn,
const Mat3x3 RIn,
const Vec3 vIn,
const Vec3 wIn,
const OrientationDescription ood 
)

Definition at line 52 of file reffrm.cc.

References ASSERT, IsSame(), Mat3x3::MulTM(), and R.

56 : WithLabel(uLabel), x(xIn), R(RIn), v(vIn), w(wIn), od(ood)
57 {
58  ASSERT(Mat3x3(1., 0., 0., 0., 1., 0., 0., 0., 1.).IsSame(R.MulTM(R), 1e-12));
59 }
bool IsSame(const doublereal &d1, const doublereal &d2, const doublereal &dTol)
Definition: matvec3.cc:1138
OrientationDescription od
Definition: reffrm.h:53
Mat3x3 R
Definition: reffrm.h:49
unsigned int uLabel
Definition: withlab.h:44
#define ASSERT(expression)
Definition: colamd.c:977
Mat3x3 MulTM(const Mat3x3 &m) const
Definition: matvec3.cc:500
WithLabel(unsigned int uL=0, const std::string &sN="")
Definition: withlab.cc:38

Here is the call graph for this function:

ReferenceFrame::ReferenceFrame ( const RigidBodyKinematics pRBK)

Definition at line 61 of file reffrm.cc.

References ASSERT, Eye3, Mat3x3::IsSame(), Mat3x3::MulTM(), and R.

62 : WithLabel(0),
63 x(pRBK->GetX()), R(pRBK->GetR()),
64 v(pRBK->GetV()), w(pRBK->GetW()),
66 {
67  ASSERT(Eye3.IsSame(R.MulTM(R), 1e-12));
68 }
const Mat3x3 Eye3(1., 0., 0., 0., 1., 0., 0., 0., 1.)
virtual const Vec3 & GetV(void) const =0
OrientationDescription od
Definition: reffrm.h:53
virtual const Vec3 & GetX(void) const =0
Mat3x3 R
Definition: reffrm.h:49
#define ASSERT(expression)
Definition: colamd.c:977
Mat3x3 MulTM(const Mat3x3 &m) const
Definition: matvec3.cc:500
virtual const Vec3 & GetW(void) const =0
virtual const Mat3x3 & GetR(void) const =0
WithLabel(unsigned int uL=0, const std::string &sN="")
Definition: withlab.cc:38
bool IsSame(const Mat3x3 &m, const doublereal &dTol) const
Definition: matvec3.h:1249

Here is the call graph for this function:

ReferenceFrame::~ReferenceFrame ( void  )

Definition at line 70 of file reffrm.cc.

References NO_OP.

70  {
71  NO_OP;
72 }
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

const Vec3 & ReferenceFrame::GetV ( void  ) const
virtual

Implements RigidBodyKinematics.

Definition at line 87 of file reffrm.cc.

References v.

Referenced by MBDynParser::GetVelAbs(), MBDynParser::GetVelRel(), and MBDynParser::Reference_int().

88 {
89  return v;
90 }
const Vec3 & ReferenceFrame::GetW ( void  ) const
virtual

Implements RigidBodyKinematics.

Definition at line 93 of file reffrm.cc.

References w.

Referenced by MBDynParser::GetOmeAbs(), MBDynParser::GetOmeRel(), MBDynParser::GetVelAbs(), MBDynParser::GetVelRel(), and MBDynParser::Reference_int().

94 {
95  return w;
96 }
const Vec3 & ReferenceFrame::GetWP ( void  ) const
virtual

Implements RigidBodyKinematics.

Definition at line 105 of file reffrm.cc.

References MBDYN_EXCEPT_ARGS.

106 {
108 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
const Vec3 & ReferenceFrame::GetX ( void  ) const
virtual

Implements RigidBodyKinematics.

Definition at line 75 of file reffrm.cc.

References x.

Referenced by MBDynParser::GetPosAbs(), MBDynParser::GetPosRel(), MBDynParser::GetVelAbs(), MBDynParser::GetVelRel(), and MBDynParser::Reference_int().

76 {
77  return x;
78 }
const Vec3 & ReferenceFrame::GetXPP ( void  ) const
virtual

Implements RigidBodyKinematics.

Definition at line 99 of file reffrm.cc.

References MBDYN_EXCEPT_ARGS.

100 {
102 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
ReferenceFrame & ReferenceFrame::operator= ( const ReferenceFrame rf)

Definition at line 111 of file reffrm.cc.

References WithLabel::GetLabel(), od, WithLabel::PutLabel(), R, v, w, and x.

112 {
113  PutLabel(rf.GetLabel());
114  x = rf.x;
115  R = rf.R;
116  v = rf.v;
117  w = rf.w;
118  od = rf.od;
119  return *this;
120 }
OrientationDescription od
Definition: reffrm.h:53
Mat3x3 R
Definition: reffrm.h:49
void PutLabel(unsigned int uL)
Definition: withlab.cc:50
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

std::ostream & ReferenceFrame::Output ( std::ostream &  out) const

Definition at line 123 of file reffrm.cc.

References dRaDegr, EULER_123, EULER_313, EULER_321, WithLabel::GetLabel(), MatR2EulerAngles123(), MatR2EulerAngles313(), MatR2EulerAngles321(), MBDYN_EXCEPT_ARGS, od, ORIENTATION_MATRIX, ORIENTATION_VECTOR, R, v, RotManip::VecRot(), w, and x.

124 {
125  out
126  << std::setw(8) << GetLabel() << " "
127  << x << " ";
128 
129  switch (od) {
130  case EULER_123:
131  out << MatR2EulerAngles123(R)*dRaDegr;
132  break;
133 
134  case EULER_313:
135  out << MatR2EulerAngles313(R)*dRaDegr;
136  break;
137 
138  case EULER_321:
139  out << MatR2EulerAngles321(R)*dRaDegr;
140  break;
141 
142  case ORIENTATION_VECTOR:
143  out << RotManip::VecRot(R);
144  break;
145 
146  case ORIENTATION_MATRIX:
147  out << R;
148  break;
149 
150  default:
152  }
153 
154  return out << " "
155  << v << " " << w << " " << std::endl;
156 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
OrientationDescription od
Definition: reffrm.h:53
Vec3 VecRot(const Mat3x3 &Phi)
Definition: Rot.cc:136
Mat3x3 R
Definition: reffrm.h:49
Vec3 MatR2EulerAngles313(const Mat3x3 &R)
Definition: matvec3.cc:927
Vec3 MatR2EulerAngles123(const Mat3x3 &R)
Definition: matvec3.cc:893
const doublereal dRaDegr
Definition: matvec3.cc:884
Vec3 MatR2EulerAngles321(const Mat3x3 &R)
Definition: matvec3.cc:941
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

Member Data Documentation

OrientationDescription ReferenceFrame::od
private

Definition at line 53 of file reffrm.h.

Referenced by operator=(), and Output().

Mat3x3 ReferenceFrame::R
private

Definition at line 49 of file reffrm.h.

Referenced by GetR(), operator=(), Output(), and ReferenceFrame().

Vec3 ReferenceFrame::v
private

Definition at line 50 of file reffrm.h.

Referenced by GetV(), operator=(), and Output().

Vec3 ReferenceFrame::w
private

Definition at line 51 of file reffrm.h.

Referenced by GetW(), operator=(), and Output().

Vec3 ReferenceFrame::x
private

Definition at line 48 of file reffrm.h.

Referenced by GetX(), operator=(), and Output().


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