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

#include <bufferstream_out_elem.h>

Inheritance diagram for BufferStreamElem_base:
Collaboration diagram for BufferStreamElem_base:

Public Member Functions

 BufferStreamElem_base (unsigned int uL, unsigned int oe, StreamContent *pSC, StreamOutEcho *pSOE)
 
virtual ~BufferStreamElem_base (void)
 
const integer GetBufSize (void) const
 
virtual const doublerealGetBufRaw (void) const =0
 
virtual void SetValue (DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *ph=0)
 
virtual void AfterConvergence (const VectorHandler &X, const VectorHandler &XP)
 
virtual void AfterConvergence (const VectorHandler &X, const VectorHandler &XP, const VectorHandler &XPP)
 
- Public Member Functions inherited from StreamOutElem
 StreamOutElem (unsigned int uL, const std::string &name, unsigned int oe)
 
virtual ~StreamOutElem (void)
 
virtual Elem::Type GetElemType (void) const
 
virtual void WorkSpaceDim (integer *piRows, integer *piCols) const
 
virtual SubVectorHandlerAssRes (SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &X, const VectorHandler &XP)
 
virtual VariableSubMatrixHandlerAssJac (VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &X, const VectorHandler &XP)
 
- Public Member Functions inherited from Elem
 Elem (unsigned int uL, flag fOut)
 
virtual ~Elem (void)
 
virtual std::ostream & Restart (std::ostream &out) const =0
 
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
 
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 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 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))
 

Protected Attributes

StreamContentpSC
 
StreamOutEchopSOE
 
- Protected Attributes inherited from StreamOutElem
std::string name
 
unsigned int OutputEvery
 
unsigned int OutputCounter
 
- Protected Attributes inherited from WithLabel
unsigned int uLabel
 
std::string sName
 
- Protected Attributes inherited from ToBeOutput
flag fOutput
 

Additional Inherited Members

- Public Types inherited from StreamOutElem
enum  Type { UNDEFINED = -1, RTAI, SOCKETSTREAM, BUFFERSTREAM }
 
- 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 }
 

Detailed Description

Definition at line 43 of file bufferstream_out_elem.h.

Constructor & Destructor Documentation

BufferStreamElem_base::BufferStreamElem_base ( unsigned int  uL,
unsigned int  oe,
StreamContent pSC,
StreamOutEcho pSOE 
)

Definition at line 45 of file bufferstream_out_elem.cc.

References StreamContent::GetNumChannels(), StreamOutEcho::Init(), and WithLabel::uLabel.

48 : Elem(uL, flag(0)),
49 StreamOutElem(uL, "buffer", oe),
50 pSC(pSC), pSOE(pSOE)
51 {
52  if (pSOE != 0) {
53  pSOE->Init("BufferStreamElem_base", uLabel, pSC->GetNumChannels());
54  }
55 }
long int flag
Definition: mbdyn.h:43
StreamOutElem(unsigned int uL, const std::string &name, unsigned int oe)
virtual unsigned GetNumChannels(void) const =0
bool Init(const std::string &msg, unsigned uLabel, unsigned nChannels)
unsigned int uLabel
Definition: withlab.h:44
Elem(unsigned int uL, flag fOut)
Definition: elem.cc:41

Here is the call graph for this function:

BufferStreamElem_base::~BufferStreamElem_base ( void  )
virtual

Definition at line 57 of file bufferstream_out_elem.cc.

References pSC, pSOE, and SAFEDELETE.

58 {
59  if (pSC != 0) {
60  SAFEDELETE(pSC);
61  }
62 
63  if (pSOE != 0) {
64  delete pSOE;
65  }
66 }
#define SAFEDELETE(pnt)
Definition: mynewmem.h:710

Member Function Documentation

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

Reimplemented from SimulationEntity.

Definition at line 84 of file bufferstream_out_elem.cc.

References StreamOutEcho::Echo(), StreamContent::GetBuf(), GetBufRaw(), StreamContent::GetNumChannels(), StreamOutElem::OutputCounter, StreamOutElem::OutputEvery, StreamContent::Prepare(), pSC, and pSOE.

Referenced by AfterConvergence().

86 {
87  /* output only every OutputEvery steps */
88  OutputCounter++;
89  if (OutputCounter != OutputEvery) {
90  return;
91  }
92  OutputCounter = 0;
93 
94  // prepare the output buffer
95  pSC->Prepare();
96 
97  // check whether echo is needed
98  const doublereal *pd = (const doublereal *)pSC->GetBuf();
99  if (pSOE != 0) {
100  pSOE->Echo(pd, pSC->GetNumChannels());
101  }
102 
103  doublereal *pBuffer = const_cast<doublereal *>(GetBufRaw());
104  for (unsigned i = 0; i < pSC->GetNumChannels(); i++) {
105  pBuffer[i] = pd[i];
106  }
107 }
unsigned int OutputCounter
Definition: streamoutelem.h:60
void Echo(const doublereal *pbuf, unsigned nChannels)
void * GetBuf(void) const
virtual unsigned GetNumChannels(void) const =0
unsigned int OutputEvery
Definition: streamoutelem.h:59
virtual void Prepare(void)=0
virtual const doublereal * GetBufRaw(void) const =0
double doublereal
Definition: colamd.c:52

Here is the call graph for this function:

void BufferStreamElem_base::AfterConvergence ( const VectorHandler X,
const VectorHandler XP,
const VectorHandler XPP 
)
virtual

Reimplemented from SimulationEntity.

Definition at line 110 of file bufferstream_out_elem.cc.

References AfterConvergence().

112 {
113  AfterConvergence(X, XP);
114 }
virtual void AfterConvergence(const VectorHandler &X, const VectorHandler &XP)

Here is the call graph for this function:

virtual const doublereal* BufferStreamElem_base::GetBufRaw ( void  ) const
pure virtual
const integer BufferStreamElem_base::GetBufSize ( void  ) const

Definition at line 69 of file bufferstream_out_elem.cc.

References StreamContent::GetNumChannels(), and pSC.

70 {
71  return pSC->GetNumChannels();
72 }
virtual unsigned GetNumChannels(void) const =0

Here is the call graph for this function:

void BufferStreamElem_base::SetValue ( DataManager pDM,
VectorHandler X,
VectorHandler XP,
SimulationEntity::Hints ph = 0 
)
virtual

Reimplemented from SimulationEntity.

Definition at line 75 of file bufferstream_out_elem.cc.

References StreamOutElem::OutputCounter.

78 {
79  // do not send "derivatives"
80  OutputCounter = -1;
81 }
unsigned int OutputCounter
Definition: streamoutelem.h:60

Member Data Documentation

StreamOutEcho* BufferStreamElem_base::pSOE
protected

Definition at line 46 of file bufferstream_out_elem.h.

Referenced by AfterConvergence(), and ~BufferStreamElem_base().


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