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

#include <genel_.h>

Inheritance diagram for GenelMass:
Collaboration diagram for GenelMass:

Public Member Functions

 GenelMass (unsigned int uLabel, const DofOwner *pDO, const DriveCaller *pDC, const ScalarDof &sd, flag fOutput)
 
virtual ~GenelMass (void)
 
virtual unsigned int iGetNumDof (void) const
 
virtual DofOrder::Order GetDofType (unsigned int i) const
 
virtual std::ostream & Restart (std::ostream &out) const
 
virtual Genel::Type GetGenelType (void) const
 
virtual void WorkSpaceDim (integer *piNumRows, integer *piNumCols) const
 
virtual VariableSubMatrixHandlerAssJac (VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual SubVectorHandlerAssRes (SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
void SetValue (DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *ph=0)
 
virtual void GetConnectedNodes (std::vector< const Node * > &connectedNodes) const
 
- Public Member Functions inherited from Elem
 Elem (unsigned int uL, flag fOut)
 
virtual ~Elem (void)
 
virtual std::ostream & DescribeDof (std::ostream &out, const char *prefix="", bool bInitial=false) const
 
virtual void DescribeDof (std::vector< std::string > &desc, bool bInitial=false, int i=-1) const
 
virtual std::ostream & DescribeEq (std::ostream &out, const char *prefix="", bool bInitial=false) const
 
virtual void DescribeEq (std::vector< std::string > &desc, bool bInitial=false, int i=-1) const
 
virtual void AssMats (VariableSubMatrixHandler &WorkMatA, VariableSubMatrixHandler &WorkMatB, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual bool bInverseDynamics (void) const
 
void SetInverseDynamicsFlags (unsigned uIDF)
 
unsigned GetInverseDynamicsFlags (void) const
 
bool bIsErgonomy (void) const
 
bool bIsRightHandSide (void) const
 
virtual VariableSubMatrixHandlerAssJac (VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
 
virtual SubVectorHandlerAssRes (SubVectorHandler &WorkVec, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr, const VectorHandler &XPrimePrimeCurr, InverseDynamics::Order iOrder=InverseDynamics::INVERSE_DYNAMICS)
 
virtual int GetNumConnectedNodes (void) 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 SimulationEntity
 SimulationEntity (void)
 
virtual ~SimulationEntity (void)
 
virtual bool bIsValidIndex (unsigned int i) const
 
virtual DofOrder::Order GetEqType (unsigned int i) const
 
virtual HintParseHint (DataManager *pDM, const char *s) const
 
virtual void BeforePredict (VectorHandler &, VectorHandler &, VectorHandler &, VectorHandler &) const
 
virtual void AfterPredict (VectorHandler &X, VectorHandler &XP)
 
virtual void Update (const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual void DerivativesUpdate (const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual void Update (const VectorHandler &XCurr, InverseDynamics::Order iOrder)
 
virtual void AfterConvergence (const VectorHandler &X, const VectorHandler &XP)
 
virtual void AfterConvergence (const VectorHandler &X, const VectorHandler &XP, const VectorHandler &XPP)
 
virtual unsigned int iGetNumPrivData (void) const
 
virtual unsigned int iGetPrivDataIdx (const char *s) const
 
virtual doublereal dGetPrivData (unsigned int i) const
 
virtual std::ostream & OutputAppend (std::ostream &out) const
 
virtual void ReadInitialState (MBDynParser &HP)
 
- Public Member Functions inherited from ToBeOutput
 ToBeOutput (flag fOut=fDefaultOut)
 
virtual ~ToBeOutput (void)
 
virtual void OutputPrepare (OutputHandler &OH)
 
virtual void Output (OutputHandler &OH) const
 
virtual void Output (OutputHandler &OH, const VectorHandler &X, const VectorHandler &XP) const
 
virtual flag fToBeOutput (void) const
 
virtual bool bToBeOutput (void) const
 
virtual void SetOutputFlag (flag f=flag(1))
 
- Public Member Functions inherited from Genel
 Genel (unsigned int uL, const DofOwner *pDO, flag fOut)
 
virtual ~Genel (void)
 
virtual Elem::Type GetElemType (void) const
 
- Public Member Functions inherited from ElemWithDofs
 ElemWithDofs (unsigned int uL, const DofOwner *pDO, flag fOut)
 
virtual ~ElemWithDofs (void)
 
- Public Member Functions inherited from DofOwnerOwner
 DofOwnerOwner (const DofOwner *pDO)
 
virtual ~DofOwnerOwner ()
 
virtual const DofOwnerpGetDofOwner (void) const
 
virtual integer iGetFirstIndex (void) const
 
virtual void SetInitialValue (VectorHandler &X)
 
- Public Member Functions inherited from DriveOwner
 DriveOwner (const DriveCaller *pDC=0)
 
 DriveOwner (const DriveOwner &drive)
 
virtual ~DriveOwner (void)
 
void Set (const DriveCaller *pDC)
 
DriveCallerpGetDriveCaller (void) const
 
doublereal dGet (const doublereal &dVar) const
 
doublereal dGet (void) const
 
bool bIsDifferentiable (void) const
 
doublereal dGetP (const doublereal &dVar) const
 
doublereal dGetP (void) const
 

Protected Attributes

ScalarDof SD
 
- Protected Attributes inherited from WithLabel
unsigned int uLabel
 
std::string sName
 
- Protected Attributes inherited from ToBeOutput
flag fOutput
 
- Protected Attributes inherited from DriveOwner
DriveCallerpDriveCaller
 

Additional Inherited Members

- Public Types inherited from Elem
enum  Type {
  UNKNOWN = -1, AIRPROPERTIES = 0, INDUCEDVELOCITY, AUTOMATICSTRUCTURAL,
  GRAVITY, BODY, JOINT, JOINT_REGULARIZATION,
  BEAM, PLATE, FORCE, INERTIA,
  ELECTRICBULK, ELECTRIC, THERMAL, HYDRAULIC,
  BULK, LOADABLE, DRIVEN, EXTERNAL,
  AEROMODAL, AERODYNAMIC, GENEL, SOCKETSTREAM_OUTPUT,
  RTAI_OUTPUT = SOCKETSTREAM_OUTPUT, LASTELEMTYPE
}
 
- Public Types inherited from SimulationEntity
typedef std::vector< Hint * > Hints
 
- Public Types inherited from ToBeOutput
enum  { OUTPUT = 0x1U, OUTPUT_MASK = 0xFU, OUTPUT_PRIVATE = 0x10U, OUTPUT_PRIVATE_MASK = ~OUTPUT_MASK }
 
- Public Types inherited from Genel
enum  Type {
  UNKNOWN = -1, SWASHPLATE = 0, ROTORTRIM, CLAMP,
  DISTANCE, SPRING, SPRINGSUPPORT, CROSSSPRINGSUPPORT,
  SPRINGDAMPER, SPRINGDAMPERSUPPORT, CROSSSPRINGDAMPERSUPPORT, MASS,
  SCALARFILTER, STATESPACESISO, STATESPACEMIMO, LASTGENELTYPE
}
 

Detailed Description

Definition at line 431 of file genel_.h.

Constructor & Destructor Documentation

GenelMass::GenelMass ( unsigned int  uLabel,
const DofOwner pDO,
const DriveCaller pDC,
const ScalarDof sd,
flag  fOutput 
)

Definition at line 1014 of file genel_.cc.

References NO_OP.

1017 : Elem(uLabel, fOutput),
1018 Genel(uLabel, pDO, fOutput),
1019 DriveOwner(pDC), SD(sd)
1020 {
1021  NO_OP;
1022 }
ScalarDof SD
Definition: genel_.h:433
flag fOutput
Definition: output.h:658
#define NO_OP
Definition: myassert.h:74
unsigned int uLabel
Definition: withlab.h:44
Genel(unsigned int uL, const DofOwner *pDO, flag fOut)
Definition: genel.cc:44
Elem(unsigned int uL, flag fOut)
Definition: elem.cc:41
DriveOwner(const DriveCaller *pDC=0)
Definition: drive.cc:627
GenelMass::~GenelMass ( void  )
virtual

Definition at line 1024 of file genel_.cc.

References ScalarDof::pNode, SAFEDELETE, and SD.

1025 {
1026  const Node2Scalar *pn2s;
1027 
1028  pn2s = dynamic_cast<const Node2Scalar *>(SD.pNode);
1029  if (pn2s) {
1030  SAFEDELETE(pn2s);
1031  }
1032 }
ScalarNode * pNode
Definition: node.h:708
ScalarDof SD
Definition: genel_.h:433
#define SAFEDELETE(pnt)
Definition: mynewmem.h:710

Member Function Documentation

VariableSubMatrixHandler & GenelMass::AssJac ( VariableSubMatrixHandler WorkMat,
doublereal  dCoef,
const VectorHandler XCurr,
const VectorHandler XPrimeCurr 
)
virtual

Implements Elem.

Definition at line 1072 of file genel_.cc.

References DEBUGCOUT, DriveOwner::dGet(), Node::iGetFirstColIndex(), DofOwnerOwner::iGetFirstIndex(), Node::iGetFirstRowIndex(), ScalarDof::pNode, SparseSubMatrixHandler::PutItem(), SparseSubMatrixHandler::ResizeReset(), SD, and VariableSubMatrixHandler::SetSparse().

1076 {
1077  DEBUGCOUT("Entering GenelMass::AssJac()" << std::endl);
1078 
1079  SparseSubMatrixHandler& WM = WorkMat.SetSparse();
1080  WM.ResizeReset(3, 0);
1081 
1082  integer iRowIndex = SD.pNode->iGetFirstRowIndex() + 1;
1083  integer iColIndex = SD.pNode->iGetFirstColIndex() + 1;
1084  integer iDerivativeIndex = iGetFirstIndex() + 1;
1085 
1086  WM.PutItem(1, iRowIndex, iDerivativeIndex, dGet());
1087  WM.PutItem(2, iDerivativeIndex, iColIndex, -1.);
1088  WM.PutItem(3, iDerivativeIndex, iDerivativeIndex, dCoef);
1089 
1090  return WorkMat;
1091 }
ScalarNode * pNode
Definition: node.h:708
ScalarDof SD
Definition: genel_.h:433
doublereal dGet(void) const
Definition: drive.cc:671
void ResizeReset(integer iNewRow, integer iNewCol)
Definition: submat.cc:1084
void PutItem(integer iSubIt, integer iRow, integer iCol, const doublereal &dCoef)
Definition: submat.h:997
#define DEBUGCOUT(msg)
Definition: myassert.h:232
virtual integer iGetFirstRowIndex(void) const
Definition: node.cc:82
SparseSubMatrixHandler & SetSparse(void)
Definition: submat.h:1178
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
long int integer
Definition: colamd.c:51
virtual integer iGetFirstColIndex(void) const
Definition: node.cc:88

Here is the call graph for this function:

SubVectorHandler & GenelMass::AssRes ( SubVectorHandler WorkVec,
doublereal  dCoef,
const VectorHandler XCurr,
const VectorHandler XPrimeCurr 
)
virtual

Implements Elem.

Definition at line 1095 of file genel_.cc.

References DEBUGCOUT, DriveOwner::dGet(), ScalarNode::dGetXPrime(), DofOwnerOwner::iGetFirstIndex(), Node::iGetFirstRowIndex(), ScalarDof::pNode, SubVectorHandler::PutItem(), VectorHandler::ResizeReset(), and SD.

1099 {
1100  DEBUGCOUT("Entering GenelMass::AssRes()" << std::endl);
1101 
1102  WorkVec.ResizeReset(2);
1103 
1104  integer iRowIndex = SD.pNode->iGetFirstRowIndex()+1;
1105  integer iDerivativeIndex = iGetFirstIndex()+1;
1106 
1107  doublereal dVal = SD.pNode->dGetXPrime();
1108  doublereal dDer = XCurr(iDerivativeIndex);
1109  doublereal dDerPrime = XPrimeCurr(iDerivativeIndex);
1110 
1111  WorkVec.PutItem(1, iRowIndex, -dGet()*dDerPrime);
1112  WorkVec.PutItem(2, iDerivativeIndex, dVal - dDer);
1113 
1114  return WorkVec;
1115 }
ScalarNode * pNode
Definition: node.h:708
ScalarDof SD
Definition: genel_.h:433
virtual void ResizeReset(integer)
Definition: vh.cc:55
doublereal dGet(void) const
Definition: drive.cc:671
virtual void PutItem(integer iSubRow, integer iRow, const doublereal &dCoef)
Definition: submat.h:1445
virtual const doublereal & dGetXPrime(void) const =0
#define DEBUGCOUT(msg)
Definition: myassert.h:232
virtual integer iGetFirstRowIndex(void) const
Definition: node.cc:82
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

void GenelMass::GetConnectedNodes ( std::vector< const Node * > &  connectedNodes) const
virtual

Reimplemented from Elem.

Definition at line 1129 of file genel_.cc.

References ScalarDof::pNode, and SD.

1129  {
1130  connectedNodes.resize(1);
1131  connectedNodes[0] = SD.pNode;
1132 }
ScalarNode * pNode
Definition: node.h:708
ScalarDof SD
Definition: genel_.h:433
DofOrder::Order GenelMass::GetDofType ( unsigned int  i) const
virtual

Reimplemented from Elem.

Definition at line 1042 of file genel_.cc.

References ASSERT, and DofOrder::DIFFERENTIAL.

1043 {
1044  ASSERT(i == 0);
1045  return DofOrder::DIFFERENTIAL;
1046 }
#define ASSERT(expression)
Definition: colamd.c:977
Genel::Type GenelMass::GetGenelType ( void  ) const
virtual

Implements Genel.

Definition at line 1057 of file genel_.cc.

References Genel::MASS.

1058 {
1059  return Genel::MASS;
1060 }
unsigned int GenelMass::iGetNumDof ( void  ) const
virtual

Reimplemented from Elem.

Definition at line 1035 of file genel_.cc.

1036 {
1037  return 1;
1038 }
std::ostream & GenelMass::Restart ( std::ostream &  out) const
virtual

Implements Elem.

Definition at line 1050 of file genel_.cc.

1051 {
1052  return out;
1053 }
void GenelMass::SetValue ( DataManager pDM,
VectorHandler X,
VectorHandler XP,
SimulationEntity::Hints ph = 0 
)
virtual

Reimplemented from SimulationEntity.

Definition at line 1118 of file genel_.cc.

References ScalarNode::dGetXPrime(), DofOwnerOwner::iGetFirstIndex(), ScalarDof::pNode, VectorHandler::PutCoef(), and SD.

1121 {
1122  X.PutCoef(iGetFirstIndex() + 1, SD.pNode->dGetXPrime());
1123 }
ScalarNode * pNode
Definition: node.h:708
ScalarDof SD
Definition: genel_.h:433
virtual const doublereal & dGetXPrime(void) const =0
virtual void PutCoef(integer iRow, const doublereal &dCoef)=0
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127

Here is the call graph for this function:

void GenelMass::WorkSpaceDim ( integer piNumRows,
integer piNumCols 
) const
virtual

Implements Elem.

Definition at line 1064 of file genel_.cc.

1065 {
1066  *piNumRows = 2;
1067  *piNumCols = 2;
1068 }

Member Data Documentation

ScalarDof GenelMass::SD
protected

Definition at line 433 of file genel_.h.

Referenced by AssJac(), AssRes(), GetConnectedNodes(), SetValue(), and ~GenelMass().


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