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

#include <drive_.h>

Inheritance diagram for PeriodicDriveCaller:
Collaboration diagram for PeriodicDriveCaller:

Public Member Functions

 PeriodicDriveCaller (const DriveHandler *pDH, const DriveCaller *pDC, doublereal dT0, doublereal dPeriod)
 
virtual ~PeriodicDriveCaller (void)
 
virtual std::ostream & Restart (std::ostream &out) const
 
virtual DriveCallerpCopy (void) const
 
doublereal dGet (void) const
 
doublereal dGet (const doublereal &dVar) const
 
virtual bool bIsDifferentiable (void) const
 
virtual doublereal dGetP (const doublereal &dVar) const
 
- Public Member Functions inherited from DriveCaller
 DriveCaller (const DriveHandler *pDH)
 
virtual ~DriveCaller (void)
 
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)
 

Protected Attributes

DriveOwner DO
 
doublereal dT0
 
doublereal dPeriod
 
- Protected Attributes inherited from DriveCaller
DriveHandlerpDrvHdl
 
- 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 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 1578 of file drive_.h.

Constructor & Destructor Documentation

PeriodicDriveCaller::PeriodicDriveCaller ( const DriveHandler pDH,
const DriveCaller pDC,
doublereal  dT0,
doublereal  dPeriod 
)

Definition at line 1173 of file drive_.cc.

References NO_OP.

Referenced by pCopy().

1175 : DriveCaller(pDH),
1176 DO(pDC), dT0(dT0), dPeriod(dPeriod)
1177 {
1178  NO_OP;
1179 }
doublereal dPeriod
Definition: drive_.h:1582
#define NO_OP
Definition: myassert.h:74
DriveCaller(const DriveHandler *pDH)
Definition: drive.cc:475
doublereal dT0
Definition: drive_.h:1581
DriveOwner DO
Definition: drive_.h:1580
PeriodicDriveCaller::~PeriodicDriveCaller ( void  )
virtual

Definition at line 1181 of file drive_.cc.

References NO_OP.

1182 {
1183  NO_OP;
1184 }
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

bool PeriodicDriveCaller::bIsDifferentiable ( void  ) const
inlinevirtual

Reimplemented from DriveCaller.

Definition at line 1627 of file drive_.h.

References DriveCaller::bIsDifferentiable(), DO, and DriveOwner::pGetDriveCaller().

1628 {
1629  return DO.pGetDriveCaller()->bIsDifferentiable();
1630 }
virtual bool bIsDifferentiable(void) const
Definition: drive.h:495
DriveCaller * pGetDriveCaller(void) const
Definition: drive.cc:658
DriveOwner DO
Definition: drive_.h:1580

Here is the call graph for this function:

doublereal PeriodicDriveCaller::dGet ( void  ) const
inlinevirtual

Reimplemented from DriveCaller.

Definition at line 1604 of file drive_.h.

References DriveCaller::dGet(), DriveHandler::dGetTime(), DO, dPeriod, dT0, DriveCaller::pDrvHdl, and DriveOwner::pGetDriveCaller().

1605 {
1606  doublereal dTime = pDrvHdl->dGetTime();
1607  if (dTime < dT0) {
1608  return 0.;
1609  }
1610  dTime -= dT0;
1611  dTime -= floor(dTime/dPeriod)*dPeriod;
1612  return DO.pGetDriveCaller()->dGet(dTime);
1613 }
doublereal dPeriod
Definition: drive_.h:1582
doublereal dT0
Definition: drive_.h:1581
DriveHandler * pDrvHdl
Definition: drive.h:444
DriveCaller * pGetDriveCaller(void) const
Definition: drive.cc:658
virtual doublereal dGet(const doublereal &dVar) const =0
doublereal dGetTime(void) const
Definition: drive.h:386
double doublereal
Definition: colamd.c:52
DriveOwner DO
Definition: drive_.h:1580

Here is the call graph for this function:

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

Implements DriveCaller.

Definition at line 1616 of file drive_.h.

References DriveCaller::dGet(), DO, dPeriod, dT0, and DriveOwner::pGetDriveCaller().

1617 {
1618  if (dVar < dT0) {
1619  return 0.;
1620  }
1621  doublereal dTime = dVar - dT0;
1622  dTime -= floor(dTime/dPeriod)*dPeriod;
1623  return DO.pGetDriveCaller()->dGet(dTime);
1624 }
doublereal dPeriod
Definition: drive_.h:1582
doublereal dT0
Definition: drive_.h:1581
DriveCaller * pGetDriveCaller(void) const
Definition: drive.cc:658
virtual doublereal dGet(const doublereal &dVar) const =0
double doublereal
Definition: colamd.c:52
DriveOwner DO
Definition: drive_.h:1580

Here is the call graph for this function:

doublereal PeriodicDriveCaller::dGetP ( const doublereal dVar) const
inlinevirtual

Reimplemented from DriveCaller.

Definition at line 1633 of file drive_.h.

References DriveCaller::dGetP(), DO, dPeriod, dT0, and DriveOwner::pGetDriveCaller().

1634 {
1635  if (dVar < dT0) {
1636  return 0.;
1637  }
1638  doublereal dTime = dVar - dT0;
1639  dTime -= floor(dTime/dPeriod)*dPeriod;
1640  return DO.pGetDriveCaller()->dGetP(dTime);
1641 }
doublereal dPeriod
Definition: drive_.h:1582
virtual doublereal dGetP(const doublereal &dVar) const
Definition: drive.cc:499
doublereal dT0
Definition: drive_.h:1581
DriveCaller * pGetDriveCaller(void) const
Definition: drive.cc:658
double doublereal
Definition: colamd.c:52
DriveOwner DO
Definition: drive_.h:1580

Here is the call graph for this function:

DriveCaller * PeriodicDriveCaller::pCopy ( void  ) const
virtual

Implements DriveCaller.

Definition at line 1188 of file drive_.cc.

References DO, dPeriod, dT0, DriveCaller::pCopy(), DriveCaller::pDrvHdl, PeriodicDriveCaller(), DriveOwner::pGetDriveCaller(), and SAFENEWWITHCONSTRUCTOR.

1189 {
1190  DriveCaller* pDC = 0;
1193  DO.pGetDriveCaller()->pCopy(), dT0, dPeriod));
1194  return pDC;
1195 }
doublereal dPeriod
Definition: drive_.h:1582
doublereal dT0
Definition: drive_.h:1581
DriveHandler * pDrvHdl
Definition: drive.h:444
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
Definition: mynewmem.h:698
DriveCaller * pGetDriveCaller(void) const
Definition: drive.cc:658
virtual DriveCaller * pCopy(void) const =0
DriveOwner DO
Definition: drive_.h:1580
PeriodicDriveCaller(const DriveHandler *pDH, const DriveCaller *pDC, doublereal dT0, doublereal dPeriod)
Definition: drive_.cc:1173

Here is the call graph for this function:

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

Implements DriveCaller.

Definition at line 1199 of file drive_.cc.

References DO, dPeriod, dT0, DriveOwner::pGetDriveCaller(), and DriveCaller::Restart().

1200 {
1201  return out << "periodic, " << dT0 << ", " << dPeriod << ", ",
1202  DO.pGetDriveCaller()->Restart(out);
1203 }
doublereal dPeriod
Definition: drive_.h:1582
virtual std::ostream & Restart(std::ostream &out) const =0
doublereal dT0
Definition: drive_.h:1581
DriveCaller * pGetDriveCaller(void) const
Definition: drive.cc:658
DriveOwner DO
Definition: drive_.h:1580

Here is the call graph for this function:

Member Data Documentation

DriveOwner PeriodicDriveCaller::DO
protected

Definition at line 1580 of file drive_.h.

Referenced by bIsDifferentiable(), dGet(), dGetP(), pCopy(), and Restart().

doublereal PeriodicDriveCaller::dPeriod
protected

Definition at line 1582 of file drive_.h.

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

doublereal PeriodicDriveCaller::dT0
protected

Definition at line 1581 of file drive_.h.

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


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