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

#include <force.h>

Inheritance diagram for AbstractForce:
Collaboration diagram for AbstractForce:

Public Member Functions

 AbstractForce (unsigned int uL, const Node *pN, const DriveCaller *pDC, flag fOut)
 
virtual ~AbstractForce (void)
 
virtual Force::Type GetForceType (void) const
 
virtual std::ostream & Restart (std::ostream &out) const
 
void WorkSpaceDim (integer *piNumRows, integer *piNumCols) const
 
SubVectorHandlerAssRes (SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual void Output (OutputHandler &OH) const
 
virtual void InitialWorkSpaceDim (integer *piNumRows, integer *piNumCols) const
 
SubVectorHandlerInitialAssRes (SubVectorHandler &WorkVec, const VectorHandler &XCurr)
 
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 unsigned int iGetNumDof (void) const
 
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 DofOrder::Order GetDofType (unsigned int) 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 void SetValue (DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *h=0)
 
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 Force
 Force (unsigned int uL, flag fOut)
 
virtual ~Force (void)
 
virtual Elem::Type GetElemType (void) const
 
virtual VariableSubMatrixHandlerAssJac (VariableSubMatrixHandler &WorkMat, doublereal, const VectorHandler &, const VectorHandler &)
 
virtual unsigned int iGetInitialNumDof (void) const
 
virtual VariableSubMatrixHandlerInitialAssJac (VariableSubMatrixHandler &WorkMat, const VectorHandler &)
 
- Public Member Functions inherited from InitialAssemblyElem
 InitialAssemblyElem (unsigned int uL, flag fOut)
 
virtual ~InitialAssemblyElem (void)
 
- Public Member Functions inherited from SubjectToInitialAssembly
 SubjectToInitialAssembly (void)
 
virtual ~SubjectToInitialAssembly (void)
 
- 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

const NodepNode
 
- 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 Force
enum  Type {
  UNKNOWN = -1, ABSTRACTFORCE = 0, ABSTRACTINTERNALFORCE, ABSOLUTEDISPFORCE,
  ABSOLUTEINTERNALDISPFORCE, ABSOLUTEFORCE, FOLLOWERFORCE, ABSOLUTECOUPLE,
  FOLLOWERCOUPLE, ABSOLUTEINTERNALFORCE, FOLLOWERINTERNALFORCE, ABSOLUTEINTERNALCOUPLE,
  FOLLOWERINTERNALCOUPLE, TOTALFORCE, TOTALINTERNALFORCE, EXTERNALSTRUCTURAL,
  MODALFORCE, EXTERNALMODAL, LASTFORCETYPE
}
 

Detailed Description

Definition at line 139 of file force.h.

Constructor & Destructor Documentation

AbstractForce::AbstractForce ( unsigned int  uL,
const Node pN,
const DriveCaller pDC,
flag  fOut 
)

Definition at line 64 of file force.cc.

References NO_OP.

66 : Elem(uL, fOut),
67 Force(uL, fOut),
68 DriveOwner(pDC),
69 pNode(pN)
70 {
71  NO_OP;
72 }
Force(unsigned int uL, flag fOut)
Definition: force.h:87
#define NO_OP
Definition: myassert.h:74
Elem(unsigned int uL, flag fOut)
Definition: elem.cc:41
const Node * pNode
Definition: force.h:141
DriveOwner(const DriveCaller *pDC=0)
Definition: drive.cc:627
AbstractForce::~AbstractForce ( void  )
virtual

Definition at line 74 of file force.cc.

References pNode, and SAFEDELETE.

75 {
76  const Node2Scalar *pn2s = dynamic_cast<const Node2Scalar *>(pNode);
77  if (pn2s) {
78  SAFEDELETE(pn2s);
79  }
80 }
const Node * pNode
Definition: force.h:141
#define SAFEDELETE(pnt)
Definition: mynewmem.h:710

Member Function Documentation

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

Implements Elem.

Definition at line 95 of file force.cc.

References DEBUGCOUT, DriveCaller::dGet(), Node::iGetFirstRowIndex(), DriveOwner::pGetDriveCaller(), pNode, VectorHandler::PutCoef(), SubVectorHandler::PutRowIndex(), and VectorHandler::ResizeReset().

Referenced by InitialAssRes().

99 {
100  DEBUGCOUT("Entering AbstractForce::AssRes()" << std::endl);
101 
102  WorkVec.ResizeReset(1);
103 
104  /* Dati */
105  doublereal dAmplitude = pGetDriveCaller()->dGet();
106 
107  /* Indici delle incognite del nodo */
108  integer iFirstIndex = pNode->iGetFirstRowIndex();
109  WorkVec.PutRowIndex(1, iFirstIndex+1);
110 
111  WorkVec.PutCoef(1, dAmplitude);
112 
113  return WorkVec;
114 }
virtual void ResizeReset(integer)
Definition: vh.cc:55
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
#define DEBUGCOUT(msg)
Definition: myassert.h:232
virtual integer iGetFirstRowIndex(void) const
Definition: node.cc:82
virtual void PutCoef(integer iRow, const doublereal &dCoef)=0
DriveCaller * pGetDriveCaller(void) const
Definition: drive.cc:658
virtual doublereal dGet(const doublereal &dVar) const =0
double doublereal
Definition: colamd.c:52
const Node * pNode
Definition: force.h:141
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

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

Reimplemented from Elem.

Definition at line 186 of file force.h.

References pNode.

186  {
187  connectedNodes.resize(1);
188  connectedNodes[0] = pNode;
189  };
const Node * pNode
Definition: force.h:141
virtual Force::Type AbstractForce::GetForceType ( void  ) const
inlinevirtual

Implements Force.

Definition at line 151 of file force.h.

References Force::ABSTRACTFORCE.

151  {
152  return Force::ABSTRACTFORCE;
153  };
SubVectorHandler & AbstractForce::InitialAssRes ( SubVectorHandler WorkVec,
const VectorHandler XCurr 
)
virtual

Implements SubjectToInitialAssembly.

Definition at line 133 of file force.cc.

References AssRes(), and DEBUGCOUT.

135 {
136  DEBUGCOUT("Entering AbstractForce::InitialAssRes()" << std::endl);
137 
138  return AssRes(WorkVec, 1., XCurr, XCurr);
139 }
#define DEBUGCOUT(msg)
Definition: myassert.h:232
SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: force.cc:95

Here is the call graph for this function:

virtual void AbstractForce::InitialWorkSpaceDim ( integer piNumRows,
integer piNumCols 
) const
inlinevirtual

Implements SubjectToInitialAssembly.

Definition at line 172 of file force.h.

173  {
174  *piNumRows = 1;
175  *piNumCols = 1;
176  };
void AbstractForce::Output ( OutputHandler OH) const
virtual

Reimplemented from ToBeOutput.

Definition at line 117 of file force.cc.

References ToBeOutput::bToBeOutput(), DriveOwner::dGet(), OutputHandler::FORCES, OutputHandler::Forces(), WithLabel::GetLabel(), pNode, and OutputHandler::UseText().

118 {
119  if (bToBeOutput()) {
120  if (OH.UseText(OutputHandler::FORCES)) {
121  OH.Forces()
122  << GetLabel()
123  << " " << pNode->GetLabel() << " " << dGet()
124  << std::endl;
125  }
126 
127  /* TODO: NetCDF */
128  }
129 }
virtual bool bToBeOutput(void) const
Definition: output.cc:890
doublereal dGet(void) const
Definition: drive.cc:671
const Node * pNode
Definition: force.h:141
unsigned int GetLabel(void) const
Definition: withlab.cc:62
std::ostream & Forces(void) const
Definition: output.h:450
bool UseText(int out) const
Definition: output.cc:446

Here is the call graph for this function:

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

Implements Elem.

Definition at line 84 of file force.cc.

References WithLabel::GetLabel(), Node::GetNodeType(), DriveOwner::pGetDriveCaller(), pNode, psReadNodesNodes, Force::Restart(), and DriveCaller::Restart().

85 {
86  Force::Restart(out) << ", abstract, "
87  << pNode->GetLabel() << ", "
88  << psReadNodesNodes[pNode->GetNodeType()] << ", ";
89  return pGetDriveCaller()->Restart(out) << ';' << std::endl;
90 }
const char * psReadNodesNodes[]
Definition: enums.cc:398
virtual std::ostream & Restart(std::ostream &out) const
Definition: force.cc:52
virtual std::ostream & Restart(std::ostream &out) const =0
DriveCaller * pGetDriveCaller(void) const
Definition: drive.cc:658
virtual Node::Type GetNodeType(void) const =0
const Node * pNode
Definition: force.h:141
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

void AbstractForce::WorkSpaceDim ( integer piNumRows,
integer piNumCols 
) const
inlinevirtual

Implements Elem.

Definition at line 158 of file force.h.

158  {
159  *piNumRows = 1;
160  *piNumCols = 1;
161  };

Member Data Documentation

const Node* AbstractForce::pNode
protected

Definition at line 141 of file force.h.

Referenced by AssRes(), GetConnectedNodes(), Output(), Restart(), and ~AbstractForce().


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