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

#include <force.h>

Inheritance diagram for AbstractInternalForce:
Collaboration diagram for AbstractInternalForce:

Public Member Functions

 AbstractInternalForce (unsigned int uL, const Node *pN1, const Node *pN2, const DriveCaller *pDC, flag fOut)
 
virtual ~AbstractInternalForce (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 NodepNode1
 
const NodepNode2
 
- 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 198 of file force.h.

Constructor & Destructor Documentation

AbstractInternalForce::AbstractInternalForce ( unsigned int  uL,
const Node pN1,
const Node pN2,
const DriveCaller pDC,
flag  fOut 
)

Definition at line 148 of file force.cc.

References NO_OP.

151 : Elem(uL, fOut),
152 Force(uL, fOut),
153 DriveOwner(pDC),
154 pNode1(pN1), pNode2(pN2)
155 {
156  NO_OP;
157 }
Force(unsigned int uL, flag fOut)
Definition: force.h:87
#define NO_OP
Definition: myassert.h:74
const Node * pNode2
Definition: force.h:201
const Node * pNode1
Definition: force.h:200
Elem(unsigned int uL, flag fOut)
Definition: elem.cc:41
DriveOwner(const DriveCaller *pDC=0)
Definition: drive.cc:627
AbstractInternalForce::~AbstractInternalForce ( void  )
virtual

Definition at line 159 of file force.cc.

References pNode1, pNode2, and SAFEDELETE.

160 {
161  const Node2Scalar *pn2s;
162 
163  pn2s = dynamic_cast<const Node2Scalar *>(pNode1);
164  if (pn2s) {
165  SAFEDELETE(pn2s);
166  }
167 
168  pn2s = dynamic_cast<const Node2Scalar *>(pNode2);
169  if (pn2s) {
170  SAFEDELETE(pn2s);
171  }
172 }
const Node * pNode2
Definition: force.h:201
const Node * pNode1
Definition: force.h:200
#define SAFEDELETE(pnt)
Definition: mynewmem.h:710

Member Function Documentation

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

Implements Elem.

Definition at line 189 of file force.cc.

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

Referenced by InitialAssRes().

193 {
194  DEBUGCOUT("Entering AbstractInternalForce::AssRes()" << std::endl);
195 
196  WorkVec.ResizeReset(2);
197 
198  /* Dati */
199  doublereal dAmplitude = pGetDriveCaller()->dGet();
200 
201  /* Indici delle incognite del nodo */
202  integer iFirstIndex1 = pNode1->iGetFirstRowIndex();
203  integer iFirstIndex2 = pNode2->iGetFirstRowIndex();
204  WorkVec.PutRowIndex(1, iFirstIndex1 + 1);
205  WorkVec.PutRowIndex(2, iFirstIndex2 + 1);
206 
207  WorkVec.PutCoef(1, dAmplitude);
208  WorkVec.PutCoef(2, -dAmplitude);
209 
210  return WorkVec;
211 }
virtual void ResizeReset(integer)
Definition: vh.cc:55
const Node * pNode2
Definition: force.h:201
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
const Node * pNode1
Definition: force.h:200
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

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

Reimplemented from Elem.

Definition at line 247 of file force.h.

References pNode1, and pNode2.

247  {
248  connectedNodes.resize(2);
249  connectedNodes[0] = pNode1;
250  connectedNodes[1] = pNode2;
251  };
const Node * pNode2
Definition: force.h:201
const Node * pNode1
Definition: force.h:200
virtual Force::Type AbstractInternalForce::GetForceType ( void  ) const
inlinevirtual

Implements Force.

Definition at line 211 of file force.h.

References Force::ABSTRACTINTERNALFORCE.

211  {
213  };
SubVectorHandler & AbstractInternalForce::InitialAssRes ( SubVectorHandler WorkVec,
const VectorHandler XCurr 
)
virtual

Implements SubjectToInitialAssembly.

Definition at line 232 of file force.cc.

References AssRes(), and DEBUGCOUT.

234 {
235  DEBUGCOUT("Entering AbstractInternalForce::InitialAssRes()" << std::endl);
236 
237  return AssRes(WorkVec, 1., XCurr, XCurr);
238 }
#define DEBUGCOUT(msg)
Definition: myassert.h:232
SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: force.cc:189

Here is the call graph for this function:

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

Implements SubjectToInitialAssembly.

Definition at line 233 of file force.h.

234  {
235  *piNumRows = 2;
236  *piNumCols = 2;
237  };
void AbstractInternalForce::Output ( OutputHandler OH) const
virtual

Reimplemented from ToBeOutput.

Definition at line 214 of file force.cc.

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

215 {
216  if (bToBeOutput()) {
217  if (OH.UseText(OutputHandler::FORCES)) {
218  doublereal d = dGet();
219  OH.Forces()
220  << GetLabel()
221  << " " << pNode1->GetLabel() << " " << d
222  << " " << pNode2->GetLabel() << " " << -d
223  << std::endl;
224  }
225 
226  /* TODO: NetCDF */
227  }
228 }
virtual bool bToBeOutput(void) const
Definition: output.cc:890
doublereal dGet(void) const
Definition: drive.cc:671
const Node * pNode2
Definition: force.h:201
const Node * pNode1
Definition: force.h:200
double doublereal
Definition: colamd.c:52
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 & AbstractInternalForce::Restart ( std::ostream &  out) const
virtual

Implements Elem.

Definition at line 176 of file force.cc.

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

177 {
178  Force::Restart(out) << ", abstract internal, "
179  << pNode1->GetLabel() << ", "
180  << psReadNodesNodes[pNode1->GetNodeType()] << ", "
181  << pNode1->GetLabel() << ", "
182  << psReadNodesNodes[pNode1->GetNodeType()] << ", ";
183  return pGetDriveCaller()->Restart(out) << ';' << std::endl;
184 }
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 * pNode1
Definition: force.h:200
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

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

Implements Elem.

Definition at line 218 of file force.h.

218  {
219  *piNumRows = 2;
220  *piNumCols = 2;
221  };

Member Data Documentation

const Node* AbstractInternalForce::pNode1
protected

Definition at line 200 of file force.h.

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

const Node* AbstractInternalForce::pNode2
protected

Definition at line 201 of file force.h.

Referenced by AssRes(), GetConnectedNodes(), Output(), and ~AbstractInternalForce().


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