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

#include <genel_.h>

Inheritance diagram for GenelClamp:
Collaboration diagram for GenelClamp:

Public Member Functions

 GenelClamp (unsigned int uLabel, const DofOwner *pDO, const DriveCaller *pDC, const ScalarDof &sd, flag fOutput)
 
virtual ~GenelClamp (void)
 
virtual unsigned int iGetNumDof (void) const
 
virtual DofOrder::Order GetDofType (unsigned int i) const
 
virtual DofOrder::Order GetEqType (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
 
void Output (OutputHandler &OH) const
 
virtual VariableSubMatrixHandlerAssJac (VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual SubVectorHandlerAssRes (SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &)
 
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 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 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
 
doublereal dRct
 
- 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 42 of file genel_.h.

Constructor & Destructor Documentation

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

Definition at line 39 of file genel_.cc.

References NO_OP.

44 : Elem(uLabel, fOutput),
45 Genel(uLabel, pDO, fOutput),
46 DriveOwner(pDC), SD(sd), dRct(0.)
47 {
48  NO_OP;
49 }
ScalarDof SD
Definition: genel_.h:44
doublereal dRct
Definition: genel_.h:45
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
GenelClamp::~GenelClamp ( void  )
virtual

Definition at line 51 of file genel_.cc.

References ScalarDof::pNode, SAFEDELETE, and SD.

52 {
53  const Node2Scalar *pn2s;
54 
55  pn2s = dynamic_cast<const Node2Scalar *>(SD.pNode);
56  if (pn2s) {
57  SAFEDELETE(pn2s);
58  }
59 }
ScalarNode * pNode
Definition: node.h:708
ScalarDof SD
Definition: genel_.h:44
#define SAFEDELETE(pnt)
Definition: mynewmem.h:710

Member Function Documentation

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

Implements Elem.

Definition at line 116 of file genel_.cc.

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

120 {
121  DEBUGCOUT("Entering GenelClamp::AssJac()" << std::endl);
122 
123  SparseSubMatrixHandler& WM = WorkMat.SetSparse();
124  WM.Resize(2, 0);
125 
126  integer iRowIndex = SD.pNode->iGetFirstRowIndex() + 1;
127  integer iColIndex = SD.pNode->iGetFirstColIndex() + 1;
128  integer iFirstReactionIndex = iGetFirstIndex() + 1;
129 
130  WM.PutItem(1, iRowIndex, iFirstReactionIndex, 1.);
131  WM.PutItem(2, iFirstReactionIndex, iColIndex, 1.);
132 
133  return WorkMat;
134 }
ScalarNode * pNode
Definition: node.h:708
ScalarDof SD
Definition: genel_.h:44
void Resize(integer iNewRow, integer iNewCol)
Definition: submat.cc:1053
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 & GenelClamp::AssRes ( SubVectorHandler WorkVec,
doublereal  dCoef,
const VectorHandler XCurr,
const VectorHandler XPrimeCurr 
)
virtual

Implements Elem.

Definition at line 138 of file genel_.cc.

References DEBUGCOUT, DriveOwner::dGet(), Node::dGetDofValue(), DofOrder::DIFFERENTIAL, dRct, SimulationEntity::GetDofType(), DofOwnerOwner::iGetFirstIndex(), Node::iGetFirstRowIndex(), ScalarDof::iOrder, ScalarDof::pNode, SubVectorHandler::PutItem(), VectorHandler::Resize(), and SD.

142 {
143  DEBUGCOUT("Entering GenelClamp::AssRes()" << std::endl);
144 
145  WorkVec.Resize(2);
146 
147  integer iRowIndex = SD.pNode->iGetFirstRowIndex() + 1;
148  integer iFirstReactionIndex = iGetFirstIndex() + 1;
149 
150  doublereal dVal = SD.pNode->dGetDofValue(1, SD.iOrder);
151  dRct = XCurr(iFirstReactionIndex);
152 
153  WorkVec.PutItem(1, iRowIndex, -dRct);
154 
155  doublereal dConstr = dGet() - dVal;
156  if (SD.iOrder == 0
158  && dCoef != 0.)
159  {
160  dConstr /= dCoef;
161  }
162  WorkVec.PutItem(2, iFirstReactionIndex, dConstr);
163 
164  return WorkVec;
165 }
ScalarNode * pNode
Definition: node.h:708
virtual const doublereal & dGetDofValue(int iDof, int iOrder=0) const =0
ScalarDof SD
Definition: genel_.h:44
doublereal dRct
Definition: genel_.h:45
int iOrder
Definition: node.h:710
doublereal dGet(void) const
Definition: drive.cc:671
virtual void PutItem(integer iSubRow, integer iRow, const doublereal &dCoef)
Definition: submat.h:1445
#define DEBUGCOUT(msg)
Definition: myassert.h:232
virtual integer iGetFirstRowIndex(void) const
Definition: node.cc:82
virtual DofOrder::Order GetDofType(unsigned int i) const =0
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
virtual void Resize(integer iNewSize)=0

Here is the call graph for this function:

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

Reimplemented from Elem.

Definition at line 183 of file genel_.cc.

References ScalarDof::pNode, and SD.

183  {
184  connectedNodes.resize(1);
185  connectedNodes[0] = SD.pNode;
186 }
ScalarNode * pNode
Definition: node.h:708
ScalarDof SD
Definition: genel_.h:44
DofOrder::Order GenelClamp::GetDofType ( unsigned int  i) const
virtual

Reimplemented from Elem.

Definition at line 69 of file genel_.cc.

References DofOrder::ALGEBRAIC, and ASSERT.

70 {
71  ASSERT(i == 0);
72  return DofOrder::ALGEBRAIC;
73 }
#define ASSERT(expression)
Definition: colamd.c:977
DofOrder::Order GenelClamp::GetEqType ( unsigned int  i) const
virtual

Reimplemented from SimulationEntity.

Definition at line 77 of file genel_.cc.

References DofOrder::ALGEBRAIC, and ASSERT.

78 {
79  ASSERT(i == 0);
80  return DofOrder::ALGEBRAIC;
81 }
#define ASSERT(expression)
Definition: colamd.c:977
Genel::Type GenelClamp::GetGenelType ( void  ) const
virtual

Implements Genel.

Definition at line 92 of file genel_.cc.

References Genel::CLAMP.

93 {
94  return Genel::CLAMP;
95 }
unsigned int GenelClamp::iGetNumDof ( void  ) const
virtual

Reimplemented from Elem.

Definition at line 62 of file genel_.cc.

63 {
64  return 1;
65 }
void GenelClamp::Output ( OutputHandler OH) const
virtual

Reimplemented from ToBeOutput.

Definition at line 106 of file genel_.cc.

References ToBeOutput::bToBeOutput(), dRct, OutputHandler::Genels(), and WithLabel::GetLabel().

107 {
108  if (bToBeOutput()) {
109  std::ostream& out = OH.Genels();
110  out << std::setw(8) << GetLabel() << " " << dRct << std::endl;
111  }
112 }
std::ostream & Genels(void) const
Definition: output.h:513
virtual bool bToBeOutput(void) const
Definition: output.cc:890
doublereal dRct
Definition: genel_.h:45
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

std::ostream & GenelClamp::Restart ( std::ostream &  out) const
virtual

Implements Elem.

Definition at line 85 of file genel_.cc.

86 {
87  return out;
88 }
void GenelClamp::SetValue ( DataManager pDM,
VectorHandler X,
VectorHandler XP,
SimulationEntity::Hints ph = 0 
)
virtual

Reimplemented from SimulationEntity.

Definition at line 168 of file genel_.cc.

References DriveOwner::dGet(), Node::iGetFirstRowIndex(), ScalarDof::iOrder, ScalarDof::pNode, VectorHandler::PutCoef(), and SD.

171 {
172  if (SD.iOrder == 0) {
173  X.PutCoef(SD.pNode->iGetFirstRowIndex() + 1, dGet());
174  } else if (SD.iOrder == 1) {
175  XP.PutCoef(SD.pNode->iGetFirstRowIndex() + 1, dGet());
176  }
177 }
ScalarNode * pNode
Definition: node.h:708
ScalarDof SD
Definition: genel_.h:44
int iOrder
Definition: node.h:710
doublereal dGet(void) const
Definition: drive.cc:671
virtual integer iGetFirstRowIndex(void) const
Definition: node.cc:82
virtual void PutCoef(integer iRow, const doublereal &dCoef)=0

Here is the call graph for this function:

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

Implements Elem.

Definition at line 99 of file genel_.cc.

100 {
101  *piNumRows = 2;
102  *piNumCols = 2;
103 }

Member Data Documentation

doublereal GenelClamp::dRct
protected

Definition at line 45 of file genel_.h.

Referenced by AssRes(), and Output().

ScalarDof GenelClamp::SD
protected

Definition at line 44 of file genel_.h.

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


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