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

#include <privdrive.h>

Inheritance diagram for PrivDriveCaller:
Collaboration diagram for PrivDriveCaller:

Public Member Functions

 PrivDriveCaller (const DriveHandler *pDH, const DriveCaller *pDC, const SimulationEntity *p, unsigned int i, const std::string &s)
 
virtual ~PrivDriveCaller (void)
 
virtual DriveCallerpCopy (void) const
 
virtual std::ostream & Restart (std::ostream &out) const
 
doublereal dGet (const doublereal &dVar) const
 
doublereal dGet (void) const
 
unsigned int iGetIndex (void) const
 
const SimulationEntityiGetSE (void) const
 
- Public Member Functions inherited from DriveCaller
 DriveCaller (const DriveHandler *pDH)
 
virtual ~DriveCaller (void)
 
virtual bool bIsDifferentiable (void) const
 
virtual doublereal dGetP (const doublereal &dVar) const
 
virtual doublereal dGetP (void) const
 
virtual void SetDrvHdl (const DriveHandler *pDH)
 
virtual const DriveHandlerpGetDrvHdl (void) const
 
virtual void Output (OutputHandler &OH) const
 
virtual void Trace (OutputHandler &OH) 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 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 Traceable
 Traceable (flag fTrace=0)
 
virtual ~Traceable (void)
 
virtual flag fToBeTraced (void) const
 
virtual void SetTraceFlag (flag f=TRACE)
 
- 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 SimulationEntitypSE
 
unsigned int iIndex
 
std::string sIndexName
 
- Protected Attributes inherited from DriveCaller
DriveHandlerpDrvHdl
 
- 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 DriveCaller
enum  OutputFlags { OUTPUT_VALUE = OUTPUT_PRIVATE << 0, OUTPUT_DERIVATIVE = OUTPUT_PRIVATE << 1 }
 
enum  TraceFlags { TRACE_VALUE = TRACE_PRIVATE << 0, TRACE_DERIVATIVE = TRACE_PRIVATE << 1 }
 
- Public Types inherited from ToBeOutput
enum  { OUTPUT = 0x1U, OUTPUT_MASK = 0xFU, OUTPUT_PRIVATE = 0x10U, OUTPUT_PRIVATE_MASK = ~OUTPUT_MASK }
 
- Public Types inherited from Traceable
enum  { TRACE = 0x01U, TRACE_PUBLIC_MASK = 0x0FU, TRACE_PRIVATE = 0x10U, TRACE_PRIVATE_MASK = ~TRACE_PUBLIC_MASK }
 

Detailed Description

Definition at line 48 of file privdrive.h.

Constructor & Destructor Documentation

PrivDriveCaller::PrivDriveCaller ( const DriveHandler pDH,
const DriveCaller pDC,
const SimulationEntity p,
unsigned int  i,
const std::string &  s 
)

Definition at line 41 of file privdrive.cc.

References NO_OP.

Referenced by pCopy().

44 : DriveCaller(pDH), DriveOwner(pDC), pSE(p), iIndex(i), sIndexName(s)
45 {
46  NO_OP;
47 };
const SimulationEntity * pSE
Definition: privdrive.h:51
#define NO_OP
Definition: myassert.h:74
DriveCaller(const DriveHandler *pDH)
Definition: drive.cc:475
std::string sIndexName
Definition: privdrive.h:53
unsigned int iIndex
Definition: privdrive.h:52
DriveOwner(const DriveCaller *pDC=0)
Definition: drive.cc:627
PrivDriveCaller::~PrivDriveCaller ( void  )
virtual

Definition at line 49 of file privdrive.cc.

References NO_OP.

50 {
51  NO_OP;
52 }
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

doublereal PrivDriveCaller::dGet ( const doublereal dVar) const
inlinevirtual

Implements DriveCaller.

Definition at line 72 of file privdrive.h.

References dGet().

73 {
74  silent_cerr("warning, possible improper call of element drive with real argument; \"dVar\" is ignored and private data is returned instead"
75  << std::endl);
76 
77  // ignore dVar; return private data
78  return dGet();
79 }
doublereal dGet(void) const
Definition: privdrive.h:82

Here is the call graph for this function:

doublereal PrivDriveCaller::dGet ( void  ) const
inlinevirtual

Reimplemented from DriveCaller.

Definition at line 82 of file privdrive.h.

References DriveCaller::dGet(), SimulationEntity::dGetPrivData(), iIndex, DriveOwner::pGetDriveCaller(), and pSE.

Referenced by dGet().

83 {
85 }
const SimulationEntity * pSE
Definition: privdrive.h:51
DriveCaller * pGetDriveCaller(void) const
Definition: drive.cc:658
virtual doublereal dGetPrivData(unsigned int i) const
Definition: simentity.cc:149
virtual doublereal dGet(const doublereal &dVar) const =0
unsigned int iIndex
Definition: privdrive.h:52

Here is the call graph for this function:

unsigned int PrivDriveCaller::iGetIndex ( void  ) const

Definition at line 104 of file privdrive.cc.

References iIndex.

104  {
105  return iIndex;
106 }
unsigned int iIndex
Definition: privdrive.h:52
const SimulationEntity * PrivDriveCaller::iGetSE ( void  ) const

Definition at line 109 of file privdrive.cc.

References pSE.

109  {
110  return pSE;
111 }
const SimulationEntity * pSE
Definition: privdrive.h:51
DriveCaller * PrivDriveCaller::pCopy ( void  ) const
virtual

Implements DriveCaller.

Definition at line 56 of file privdrive.cc.

References iIndex, DriveCaller::pDrvHdl, DriveOwner::pGetDriveCaller(), PrivDriveCaller(), pSE, SAFENEWWITHCONSTRUCTOR, and sIndexName.

57 {
58  DriveCaller* pDC = NULL;
59 
64  pSE, iIndex, sIndexName));
65 
66  return pDC;
67 }
const SimulationEntity * pSE
Definition: privdrive.h:51
PrivDriveCaller(const DriveHandler *pDH, const DriveCaller *pDC, const SimulationEntity *p, unsigned int i, const std::string &s)
Definition: privdrive.cc:41
DriveHandler * pDrvHdl
Definition: drive.h:444
virtual DriveCaller * pCopy(void) const
Definition: privdrive.cc:56
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
Definition: mynewmem.h:698
DriveCaller * pGetDriveCaller(void) const
Definition: drive.cc:658
std::string sIndexName
Definition: privdrive.h:53
unsigned int iIndex
Definition: privdrive.h:52

Here is the call graph for this function:

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

Implements DriveCaller.

Definition at line 72 of file privdrive.cc.

References Elem::GetElemType(), WithLabel::GetLabel(), Node::GetNodeType(), SimulationEntity::iGetNumPrivData(), iIndex, MBDYN_EXCEPT_ARGS, DriveOwner::pGetDriveCaller(), pSE, psReadElemsElems, psReadNodesNodes, DriveCaller::Restart(), and sIndexName.

73 {
74  const Elem *pElem = dynamic_cast<const Elem *>(pSE);
75  const Node *pNode = dynamic_cast<const Node *>(pSE);
76 
77  if (pElem != 0) {
78  out << " element, "
79  << pElem->GetLabel() << ", "
80  << psReadElemsElems[pElem->GetElemType()] << ", ";
81 
82  } else if (pNode != 0) {
83  out << " node, "
84  << pNode->GetLabel() << ", "
85  << psReadNodesNodes[pNode->GetNodeType()] << ", ";
86 
87  } else {
89  }
90 
91  if (!sIndexName.empty()) {
92  out << "string, " << sIndexName;
93 
94  } else if (pElem->iGetNumPrivData() > 1) {
95  out << "index, " << iIndex;
96  }
97 
98  out << ", ";
99 
100  return DriveOwner::pGetDriveCaller()->Restart(out);
101 }
const char * psReadNodesNodes[]
Definition: enums.cc:398
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
Definition: node.h:67
const SimulationEntity * pSE
Definition: privdrive.h:51
virtual Elem::Type GetElemType(void) const =0
virtual std::ostream & Restart(std::ostream &out) const =0
DriveCaller * pGetDriveCaller(void) const
Definition: drive.cc:658
virtual unsigned int iGetNumPrivData(void) const
Definition: simentity.cc:136
Definition: elem.h:75
virtual Node::Type GetNodeType(void) const =0
std::string sIndexName
Definition: privdrive.h:53
const char * psReadElemsElems[]
Definition: enums.cc:79
unsigned int GetLabel(void) const
Definition: withlab.cc:62
unsigned int iIndex
Definition: privdrive.h:52

Here is the call graph for this function:

Member Data Documentation

unsigned int PrivDriveCaller::iIndex
protected

Definition at line 52 of file privdrive.h.

Referenced by dGet(), iGetIndex(), pCopy(), and Restart().

const SimulationEntity* PrivDriveCaller::pSE
protected

Definition at line 51 of file privdrive.h.

Referenced by dGet(), iGetSE(), pCopy(), and Restart().

std::string PrivDriveCaller::sIndexName
protected

Definition at line 53 of file privdrive.h.

Referenced by pCopy(), and Restart().


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