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

#include <drive_.h>

Inheritance diagram for StepDriveCaller:
Collaboration diagram for StepDriveCaller:

Public Member Functions

 StepDriveCaller (const DriveHandler *pDH, doublereal d1, doublereal d2, doublereal d3)
 
 ~StepDriveCaller (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 dStepTime
 
doublereal dStepValue
 
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 436 of file drive_.h.

Constructor & Destructor Documentation

StepDriveCaller::StepDriveCaller ( const DriveHandler pDH,
doublereal  d1,
doublereal  d2,
doublereal  d3 
)

Definition at line 385 of file drive_.cc.

References NO_OP.

Referenced by pCopy().

387 : DriveCaller(pDH),
388 dStepTime(d1), dStepValue(d2), dInitialValue(d3)
389 {
390  NO_OP;
391 }
#define NO_OP
Definition: myassert.h:74
doublereal dStepTime
Definition: drive_.h:438
DriveCaller(const DriveHandler *pDH)
Definition: drive.cc:475
doublereal dStepValue
Definition: drive_.h:439
doublereal dInitialValue
Definition: drive_.h:440
StepDriveCaller::~StepDriveCaller ( void  )

Definition at line 393 of file drive_.cc.

References NO_OP.

394 {
395  NO_OP;
396 }
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

bool StepDriveCaller::bIsDifferentiable ( void  ) const
inlinevirtual

Reimplemented from DriveCaller.

Definition at line 482 of file drive_.h.

483 {
484  return true;
485 }
doublereal StepDriveCaller::dGet ( const doublereal dVar) const
inlinevirtual

Implements DriveCaller.

Definition at line 467 of file drive_.h.

References dInitialValue, dStepTime, and dStepValue.

468 {
469  if (dVar > dStepTime) {
470  return dStepValue;
471  }
472 
473  if (dVar < dStepTime) {
474  return dInitialValue;
475  }
476 
477  /* else if dVar == dStepTime */
478  return (dInitialValue + dStepValue)/2.;
479 }
doublereal dStepTime
Definition: drive_.h:438
doublereal dStepValue
Definition: drive_.h:439
doublereal dInitialValue
Definition: drive_.h:440
doublereal StepDriveCaller::dGetP ( const doublereal dVar) const
inlinevirtual

Reimplemented from DriveCaller.

Definition at line 488 of file drive_.h.

References dStepTime, and MBDYN_EXCEPT_ARGS.

489 {
490  /* FIXME: what if we get exactly to the step time? */
491  if (dVar == dStepTime) {
492  silent_cerr("singularity in step drive derivative at " << dVar << std::endl);
494  }
495 
496  return 0.;
497 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
doublereal dStepTime
Definition: drive_.h:438
DriveCaller * StepDriveCaller::pCopy ( void  ) const
virtual

Implements DriveCaller.

Definition at line 400 of file drive_.cc.

References dInitialValue, dStepTime, dStepValue, DriveCaller::pDrvHdl, SAFENEWWITHCONSTRUCTOR, and StepDriveCaller().

401 {
402  DriveCaller* pDC = 0;
406  return pDC;
407 }
doublereal dStepTime
Definition: drive_.h:438
doublereal dStepValue
Definition: drive_.h:439
DriveHandler * pDrvHdl
Definition: drive.h:444
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
Definition: mynewmem.h:698
doublereal dInitialValue
Definition: drive_.h:440
StepDriveCaller(const DriveHandler *pDH, doublereal d1, doublereal d2, doublereal d3)
Definition: drive_.cc:385

Here is the call graph for this function:

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

Implements DriveCaller.

Definition at line 411 of file drive_.cc.

References dInitialValue, dStepTime, and dStepValue.

412 {
413  return out
414  << " step, " << dStepTime
415  << ", " << dStepValue
416  << ", " << dInitialValue;
417 }
doublereal dStepTime
Definition: drive_.h:438
doublereal dStepValue
Definition: drive_.h:439
doublereal dInitialValue
Definition: drive_.h:440

Member Data Documentation

doublereal StepDriveCaller::dInitialValue
private

Definition at line 440 of file drive_.h.

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

doublereal StepDriveCaller::dStepTime
private

Definition at line 438 of file drive_.h.

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

doublereal StepDriveCaller::dStepValue
private

Definition at line 439 of file drive_.h.

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


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