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

#include <drive_.h>

Inheritance diagram for DoubleRampDriveCaller:
Collaboration diagram for DoubleRampDriveCaller:

Public Member Functions

 DoubleRampDriveCaller (const DriveHandler *pDH, doublereal d1, doublereal d2, doublereal d3, doublereal d4, doublereal d5, doublereal d6, doublereal d7)
 
 ~DoubleRampDriveCaller (void)
 
virtual DriveCallerpCopy (void) const
 
virtual std::ostream & Restart (std::ostream &out) 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 dGet (void) 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)
 

Private Attributes

doublereal dAscendingSlope
 
doublereal dAscendingStartTime
 
doublereal dAscendingEndTime
 
doublereal dDescendingSlope
 
doublereal dDescendingStartTime
 
doublereal dDescendingEndTime
 
doublereal dInitialValue
 

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 }
 
- Protected Attributes inherited from DriveCaller
DriveHandlerpDrvHdl
 
- Protected Attributes inherited from WithLabel
unsigned int uLabel
 
std::string sName
 
- Protected Attributes inherited from ToBeOutput
flag fOutput
 

Detailed Description

Definition at line 654 of file drive_.h.

Constructor & Destructor Documentation

DoubleRampDriveCaller::DoubleRampDriveCaller ( const DriveHandler pDH,
doublereal  d1,
doublereal  d2,
doublereal  d3,
doublereal  d4,
doublereal  d5,
doublereal  d6,
doublereal  d7 
)

Definition at line 505 of file drive_.cc.

References NO_OP.

Referenced by pCopy().

509 : DriveCaller(pDH),
512 dInitialValue(d7)
513 {
514  NO_OP;
515 }
doublereal dInitialValue
Definition: drive_.h:662
#define NO_OP
Definition: myassert.h:74
doublereal dAscendingEndTime
Definition: drive_.h:658
doublereal dDescendingSlope
Definition: drive_.h:659
doublereal dAscendingStartTime
Definition: drive_.h:657
DriveCaller(const DriveHandler *pDH)
Definition: drive.cc:475
doublereal dDescendingEndTime
Definition: drive_.h:661
doublereal dDescendingStartTime
Definition: drive_.h:660
doublereal dAscendingSlope
Definition: drive_.h:656
DoubleRampDriveCaller::~DoubleRampDriveCaller ( void  )

Definition at line 517 of file drive_.cc.

References NO_OP.

518 {
519  NO_OP;
520 }
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

bool DoubleRampDriveCaller::bIsDifferentiable ( void  ) const
inlinevirtual

Reimplemented from DriveCaller.

Definition at line 724 of file drive_.h.

725 {
726  return true;
727 }
doublereal DoubleRampDriveCaller::dGet ( const doublereal dVar) const
inlinevirtual

Implements DriveCaller.

Definition at line 691 of file drive_.h.

References dAscendingEndTime, dAscendingSlope, dAscendingStartTime, dDescendingEndTime, dDescendingSlope, dDescendingStartTime, and dInitialValue.

692 {
693  doublereal dVal;
694 
695  dVal = dInitialValue;
696  if (dVar > dAscendingStartTime) {
697  doublereal dEnd;
698 
699  if (dVar > dAscendingEndTime) {
700  dEnd = dAscendingEndTime;
701 
702  } else {
703  dEnd = dVar;
704  }
705 
706  dVal += dAscendingSlope*(dEnd - dAscendingStartTime);
707 
708  if (dVar > dDescendingStartTime) {
709  if (dVar > dDescendingEndTime) {
710  dEnd = dDescendingEndTime;
711 
712  } else {
713  dEnd = dVar;
714  }
715 
716  dVal += dDescendingSlope*(dEnd - dDescendingStartTime);
717  }
718  }
719 
720  return dVal;
721 }
doublereal dInitialValue
Definition: drive_.h:662
doublereal dAscendingEndTime
Definition: drive_.h:658
doublereal dDescendingSlope
Definition: drive_.h:659
doublereal dAscendingStartTime
Definition: drive_.h:657
doublereal dDescendingEndTime
Definition: drive_.h:661
double doublereal
Definition: colamd.c:52
doublereal dDescendingStartTime
Definition: drive_.h:660
doublereal dAscendingSlope
Definition: drive_.h:656
doublereal DoubleRampDriveCaller::dGetP ( const doublereal dVar) const
inlinevirtual

Reimplemented from DriveCaller.

Definition at line 730 of file drive_.h.

References dAscendingEndTime, dAscendingSlope, dAscendingStartTime, dDescendingEndTime, dDescendingSlope, and dDescendingStartTime.

731 {
732  if (dVar < dAscendingStartTime || dVar > dDescendingEndTime
733  || (dVar > dAscendingEndTime && dVar < dDescendingStartTime))
734  {
735  return 0.;
736  }
737 
738  if (dVar == dAscendingStartTime || dVar == dAscendingEndTime) {
739  return dAscendingSlope/2.;
740  }
741 
742  if (dVar == dDescendingStartTime || dVar == dDescendingEndTime) {
743  return dDescendingSlope/2.;
744  }
745 
746  if (dVar < dAscendingEndTime) {
747  return dAscendingSlope;
748  }
749 
750  return dDescendingSlope;
751 }
doublereal dAscendingEndTime
Definition: drive_.h:658
doublereal dDescendingSlope
Definition: drive_.h:659
doublereal dAscendingStartTime
Definition: drive_.h:657
doublereal dDescendingEndTime
Definition: drive_.h:661
doublereal dDescendingStartTime
Definition: drive_.h:660
doublereal dAscendingSlope
Definition: drive_.h:656
DriveCaller * DoubleRampDriveCaller::pCopy ( void  ) const
virtual

Implements DriveCaller.

Definition at line 524 of file drive_.cc.

References dAscendingEndTime, dAscendingSlope, dAscendingStartTime, dDescendingEndTime, dDescendingSlope, dDescendingStartTime, dInitialValue, DoubleRampDriveCaller(), DriveCaller::pDrvHdl, and SAFENEWWITHCONSTRUCTOR.

525 {
526  DriveCaller* pDC = 0;
531  return pDC;
532 }
doublereal dInitialValue
Definition: drive_.h:662
doublereal dAscendingEndTime
Definition: drive_.h:658
doublereal dDescendingSlope
Definition: drive_.h:659
doublereal dAscendingStartTime
Definition: drive_.h:657
doublereal dDescendingEndTime
Definition: drive_.h:661
DriveHandler * pDrvHdl
Definition: drive.h:444
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
Definition: mynewmem.h:698
DoubleRampDriveCaller(const DriveHandler *pDH, doublereal d1, doublereal d2, doublereal d3, doublereal d4, doublereal d5, doublereal d6, doublereal d7)
Definition: drive_.cc:505
doublereal dDescendingStartTime
Definition: drive_.h:660
doublereal dAscendingSlope
Definition: drive_.h:656

Here is the call graph for this function:

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

Implements DriveCaller.

Definition at line 536 of file drive_.cc.

References dAscendingEndTime, dAscendingSlope, dAscendingStartTime, dDescendingEndTime, dDescendingSlope, dDescendingStartTime, and dInitialValue.

537 {
538  return out
539  << " double ramp, " << dAscendingSlope
540  << ", " << dAscendingStartTime
541  << ", " << dAscendingEndTime
542  << ", " << dDescendingSlope
543  << ", " << dDescendingStartTime
544  << ", " << dDescendingEndTime
545  << ", " << dInitialValue;
546 }
doublereal dInitialValue
Definition: drive_.h:662
doublereal dAscendingEndTime
Definition: drive_.h:658
doublereal dDescendingSlope
Definition: drive_.h:659
doublereal dAscendingStartTime
Definition: drive_.h:657
doublereal dDescendingEndTime
Definition: drive_.h:661
doublereal dDescendingStartTime
Definition: drive_.h:660
doublereal dAscendingSlope
Definition: drive_.h:656

Member Data Documentation

doublereal DoubleRampDriveCaller::dAscendingEndTime
private

Definition at line 658 of file drive_.h.

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

doublereal DoubleRampDriveCaller::dAscendingSlope
private

Definition at line 656 of file drive_.h.

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

doublereal DoubleRampDriveCaller::dAscendingStartTime
private

Definition at line 657 of file drive_.h.

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

doublereal DoubleRampDriveCaller::dDescendingEndTime
private

Definition at line 661 of file drive_.h.

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

doublereal DoubleRampDriveCaller::dDescendingSlope
private

Definition at line 659 of file drive_.h.

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

doublereal DoubleRampDriveCaller::dDescendingStartTime
private

Definition at line 660 of file drive_.h.

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

doublereal DoubleRampDriveCaller::dInitialValue
private

Definition at line 662 of file drive_.h.

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


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