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

#include <extforce.h>

Inheritance diagram for ExtForce:
Collaboration diagram for ExtForce:

Public Types

enum  { COUPLING_NONE = -2, COUPLING_STAGGERED = -1, COUPLING_LOOSE = 0, COUPLING_TIGHT = 1 }
 
- 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
}
 

Public Member Functions

 ExtForce (unsigned int uL, DataManager *pDM, ExtFileHandlerBase *pEFH, bool bSendAfterPredict, int iCoupling, flag fOut)
 
virtual ~ExtForce (void)
 
virtual void SetValue (DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *h=0)
 
virtual void Update (const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual void AfterConvergence (const VectorHandler &X, const VectorHandler &XP)
 
virtual void AfterPredict (VectorHandler &X, VectorHandler &XP)
 
virtual void InitialWorkSpaceDim (integer *piNumRows, integer *piNumCols) const
 
virtual VariableSubMatrixHandlerInitialAssJac (VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
 
virtual SubVectorHandlerInitialAssRes (SubVectorHandler &WorkVec, const VectorHandler &XCurr)
 
- 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 WorkSpaceDim (integer *piNumRows, integer *piNumCols) const =0
 
virtual void AssMats (VariableSubMatrixHandler &WorkMatA, VariableSubMatrixHandler &WorkMatB, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual SubVectorHandlerAssRes (SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)=0
 
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
 
virtual void GetConnectedNodes (std::vector< const Node * > &connectedNodes) 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 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, 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 Force
 Force (unsigned int uL, flag fOut)
 
virtual ~Force (void)
 
virtual Elem::Type GetElemType (void) const
 
virtual Force::Type GetForceType (void) const =0
 
virtual VariableSubMatrixHandlerAssJac (VariableSubMatrixHandler &WorkMat, doublereal, const VectorHandler &, const VectorHandler &)
 
virtual std::ostream & Restart (std::ostream &out) const
 
virtual unsigned int iGetInitialNumDof (void) const
 
- 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)
 

Protected Member Functions

void Send (ExtFileHandlerBase::SendWhen when)
 
void Recv (void)
 
virtual bool Prepare (ExtFileHandlerBase *pEFH)=0
 
virtual void Send (ExtFileHandlerBase *pEFH, ExtFileHandlerBase::SendWhen when)=0
 
virtual void Recv (ExtFileHandlerBase *pEFH)=0
 

Protected Attributes

Converged c
 
ExtFileHandlerBasepEFH
 
bool bSendAfterPredict
 
int iCoupling
 
int iCouplingCounter
 
bool bFirstSend
 
bool bFirstRecv
 
- Protected Attributes inherited from WithLabel
unsigned int uLabel
 
std::string sName
 
- Protected Attributes inherited from ToBeOutput
flag fOutput
 

Detailed Description

Definition at line 190 of file extforce.h.

Member Enumeration Documentation

anonymous enum
Enumerator
COUPLING_NONE 
COUPLING_STAGGERED 
COUPLING_LOOSE 
COUPLING_TIGHT 

Definition at line 204 of file extforce.h.

Constructor & Destructor Documentation

ExtForce::ExtForce ( unsigned int  uL,
DataManager pDM,
ExtFileHandlerBase pEFH,
bool  bSendAfterPredict,
int  iCoupling,
flag  fOut 
)

Definition at line 677 of file extforce.cc.

References NO_OP.

683 : Elem(uL, fOut),
684 Force(uL, fOut),
685 c(iCoupling > COUPLING_LOOSE ? pDM : NULL),
686 pEFH(pEFH),
688 iCoupling(iCoupling),
690 bFirstSend(true),
691 bFirstRecv(true)
692 {
693  NO_OP;
694 }
bool bSendAfterPredict
Definition: extforce.h:196
Force(unsigned int uL, flag fOut)
Definition: force.h:87
Converged c
Definition: extforce.h:192
#define NO_OP
Definition: myassert.h:74
int iCouplingCounter
Definition: extforce.h:215
ExtFileHandlerBase * pEFH
Definition: extforce.h:193
bool bFirstSend
Definition: extforce.h:218
bool bFirstRecv
Definition: extforce.h:219
Elem(unsigned int uL, flag fOut)
Definition: elem.cc:41
int iCoupling
Definition: extforce.h:212
ExtForce::~ExtForce ( void  )
virtual

Definition at line 696 of file extforce.cc.

References pEFH, and SAFEDELETE.

697 {
698  if (pEFH) {
699  SAFEDELETE(pEFH);
700  }
701 }
ExtFileHandlerBase * pEFH
Definition: extforce.h:193
#define SAFEDELETE(pnt)
Definition: mynewmem.h:710

Member Function Documentation

void ExtForce::AfterConvergence ( const VectorHandler X,
const VectorHandler XP 
)
virtual

Reimplemented from SimulationEntity.

Definition at line 770 of file extforce.cc.

References bSendAfterPredict, COUPLING_TIGHT, iCoupling, Send(), and ExtFileHandlerBase::SEND_AFTER_CONVERGENCE.

772 {
773  /* If not running tight coupling, send kinematics only at convergence */
776 #if 0
777  if (bRemoveIn) {
778  Unlink();
779  }
780 #endif
781  }
782 }
bool bSendAfterPredict
Definition: extforce.h:196
void Send(ExtFileHandlerBase::SendWhen when)
Definition: extforce.cc:788
int iCoupling
Definition: extforce.h:212

Here is the call graph for this function:

void ExtForce::AfterPredict ( VectorHandler X,
VectorHandler XP 
)
virtual

Reimplemented from SimulationEntity.

Definition at line 751 of file extforce.cc.

References ExtFileHandlerBase::AfterPredict(), bFirstRecv, bFirstSend, bSendAfterPredict, iCouplingCounter, pEFH, and Update().

752 {
753  /* After prediction, mark next residual as first */
754  iCouplingCounter = 0;
755  bFirstSend = true;
756  bFirstRecv = true;
757 
758  pEFH->AfterPredict();
759 
760  /* needed to send predicted data */
761  if (bSendAfterPredict) {
762  Update(X, XP);
763  }
764 }
virtual void AfterPredict(void)=0
bool bSendAfterPredict
Definition: extforce.h:196
int iCouplingCounter
Definition: extforce.h:215
ExtFileHandlerBase * pEFH
Definition: extforce.h:193
bool bFirstSend
Definition: extforce.h:218
bool bFirstRecv
Definition: extforce.h:219
virtual void Update(const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: extforce.cc:726

Here is the call graph for this function:

VariableSubMatrixHandler & ExtForce::InitialAssJac ( VariableSubMatrixHandler WorkMat,
const VectorHandler XCurr 
)
virtual

Reimplemented from Force.

Definition at line 828 of file extforce.cc.

References VariableSubMatrixHandler::SetNullMatrix().

830 {
831  WorkMat.SetNullMatrix();
832  return WorkMat;
833 }
void SetNullMatrix(void)
Definition: submat.h:1159

Here is the call graph for this function:

SubVectorHandler & ExtForce::InitialAssRes ( SubVectorHandler WorkVec,
const VectorHandler XCurr 
)
virtual

Implements SubjectToInitialAssembly.

Definition at line 837 of file extforce.cc.

References VectorHandler::ResizeReset().

839 {
840  WorkVec.ResizeReset(0);
841  return WorkVec;
842 }
virtual void ResizeReset(integer)
Definition: vh.cc:55

Here is the call graph for this function:

void ExtForce::InitialWorkSpaceDim ( integer piNumRows,
integer piNumCols 
) const
virtual

Implements SubjectToInitialAssembly.

Definition at line 820 of file extforce.cc.

821 {
822  *piNumRows = 0;
823  *piNumCols = 0;
824 }
virtual bool ExtForce::Prepare ( ExtFileHandlerBase pEFH)
protectedpure virtual
void ExtForce::Recv ( void  )
protected

Definition at line 798 of file extforce.cc.

References bFirstRecv, bFirstSend, c, Converged::CONVERGED, COUPLING_LOOSE, COUPLING_NONE, COUPLING_STAGGERED, COUPLING_TIGHT, iCoupling, iCouplingCounter, pEFH, ExtFileHandlerBase::Recv_post(), ExtFileHandlerBase::Recv_pre(), and Converged::Set().

Referenced by ModalMappingExt::AssRes(), StructExtForce::AssRes(), StructMappingExtForce::AssRes(), and ModalExt::AssRes().

799 {
801  || ((iCoupling == COUPLING_LOOSE || iCoupling == COUPLING_STAGGERED) && bFirstRecv))
802  {
803  if (pEFH->Recv_pre()) {
804  Recv(pEFH);
805  bFirstRecv = false;
806  }
807 
808  if (pEFH->Recv_post()) {
809  // TODO: need to handle requests for end of simulation
811  }
812  }
813 
814  if (iCoupling == COUPLING_NONE) {
816  }
817 }
void Recv(void)
Definition: extforce.cc:798
Converged c
Definition: extforce.h:192
virtual void Set(Converged::State s)
Definition: converged.cc:62
virtual bool Recv_pre(void)=0
int iCouplingCounter
Definition: extforce.h:215
ExtFileHandlerBase * pEFH
Definition: extforce.h:193
bool bFirstSend
Definition: extforce.h:218
virtual bool Recv_post(void)=0
bool bFirstRecv
Definition: extforce.h:219
int iCoupling
Definition: extforce.h:212

Here is the call graph for this function:

virtual void ExtForce::Recv ( ExtFileHandlerBase pEFH)
protectedpure virtual
void ExtForce::Send ( ExtFileHandlerBase::SendWhen  when)
protected

Definition at line 788 of file extforce.cc.

References bFirstSend, pEFH, ExtFileHandlerBase::Send_post(), and ExtFileHandlerBase::Send_pre().

Referenced by AfterConvergence(), SetValue(), and Update().

789 {
790  if (pEFH->Send_pre(when)) {
791  Send(pEFH, when);
792  bFirstSend = false;
793  }
794  pEFH->Send_post(when);
795 }
virtual bool Send_pre(SendWhen when)=0
void Send(ExtFileHandlerBase::SendWhen when)
Definition: extforce.cc:788
ExtFileHandlerBase * pEFH
Definition: extforce.h:193
bool bFirstSend
Definition: extforce.h:218
virtual void Send_post(SendWhen when)=0

Here is the call graph for this function:

virtual void ExtForce::Send ( ExtFileHandlerBase pEFH,
ExtFileHandlerBase::SendWhen  when 
)
protectedpure virtual
void ExtForce::SetValue ( DataManager pDM,
VectorHandler X,
VectorHandler XP,
SimulationEntity::Hints h = 0 
)
virtual

Reimplemented from SimulationEntity.

Definition at line 704 of file extforce.cc.

References bFirstRecv, bFirstSend, COUPLING_TIGHT, iCoupling, MBDYN_EXCEPT_ARGS, pEFH, Prepare(), ExtFileHandlerBase::Prepare_post(), ExtFileHandlerBase::Prepare_pre(), Send(), and ExtFileHandlerBase::SEND_AFTER_CONVERGENCE.

707 {
708  bFirstSend = true;
709  bFirstRecv = true;
710 
711  bool ok = false;
712  if (pEFH->Prepare_pre()) {
713  ok = Prepare(pEFH);
714  }
715  pEFH->Prepare_post(ok);
716  if (!ok) {
718  }
719 
720  if (iCoupling < COUPLING_TIGHT) {
722  }
723 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
virtual bool Prepare(ExtFileHandlerBase *pEFH)=0
void Send(ExtFileHandlerBase::SendWhen when)
Definition: extforce.cc:788
ExtFileHandlerBase * pEFH
Definition: extforce.h:193
bool bFirstSend
Definition: extforce.h:218
virtual bool Prepare_pre(void)=0
bool bFirstRecv
Definition: extforce.h:219
virtual void Prepare_post(bool ok)=0
int iCoupling
Definition: extforce.h:212

Here is the call graph for this function:

void ExtForce::Update ( const VectorHandler XCurr,
const VectorHandler XPrimeCurr 
)
virtual

Reimplemented from SimulationEntity.

Definition at line 726 of file extforce.cc.

References bFirstSend, bSendAfterPredict, COUPLING_LOOSE, COUPLING_TIGHT, iCoupling, iCouplingCounter, Send(), ExtFileHandlerBase::SEND_AFTER_CONVERGENCE, ExtFileHandlerBase::SEND_FIRST_TIME, and ExtFileHandlerBase::SEND_REGULAR.

Referenced by AfterPredict().

728 {
729  /* If running tight coupling, send kinematics every iteration */
730  /* NOTE: tight coupling may need relaxation */
732  || (iCoupling == COUPLING_LOOSE && bSendAfterPredict))
733  {
735  if (iCoupling == COUPLING_LOOSE) {
737  } else if (bFirstSend) {
739  } else {
741  }
742 
743  Send(when);
744  }
745 }
bool bSendAfterPredict
Definition: extforce.h:196
int iCouplingCounter
Definition: extforce.h:215
void Send(ExtFileHandlerBase::SendWhen when)
Definition: extforce.cc:788
bool bFirstSend
Definition: extforce.h:218
int iCoupling
Definition: extforce.h:212

Here is the call graph for this function:

Member Data Documentation

bool ExtForce::bFirstRecv
mutableprotected

Definition at line 219 of file extforce.h.

Referenced by AfterPredict(), Recv(), and SetValue().

bool ExtForce::bFirstSend
mutableprotected

Definition at line 218 of file extforce.h.

Referenced by AfterPredict(), Recv(), Send(), SetValue(), and Update().

bool ExtForce::bSendAfterPredict
protected

Definition at line 196 of file extforce.h.

Referenced by AfterConvergence(), AfterPredict(), and Update().

Converged ExtForce::c
protected

Definition at line 192 of file extforce.h.

Referenced by Recv(), and StructExtEDGEForce::SendToStream().

int ExtForce::iCouplingCounter
mutableprotected

Definition at line 215 of file extforce.h.

Referenced by AfterPredict(), Recv(), and Update().


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