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

#include <drive_.h>

Inheritance diagram for TanhDriveCaller:
Collaboration diagram for TanhDriveCaller:

Public Member Functions

 TanhDriveCaller (const DriveHandler *pDH, doublereal ds, doublereal da, doublereal db, doublereal di)
 
 ~TanhDriveCaller (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 dStart
 
doublereal dA
 
doublereal dB
 
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 916 of file drive_.h.

Constructor & Destructor Documentation

TanhDriveCaller::TanhDriveCaller ( const DriveHandler pDH,
doublereal  ds,
doublereal  da,
doublereal  db,
doublereal  di 
)

Definition at line 751 of file drive_.cc.

References NO_OP.

Referenced by pCopy().

754 : DriveCaller(pDH),
755 dStart(ds), dA(da), dB(db), dInitialValue(di)
756 {
757  NO_OP;
758 }
doublereal dB
Definition: drive_.h:920
#define NO_OP
Definition: myassert.h:74
doublereal dA
Definition: drive_.h:919
doublereal dInitialValue
Definition: drive_.h:921
doublereal dStart
Definition: drive_.h:918
DriveCaller(const DriveHandler *pDH)
Definition: drive.cc:475
TanhDriveCaller::~TanhDriveCaller ( void  )

Definition at line 760 of file drive_.cc.

References NO_OP.

761 {
762  NO_OP;
763 }
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

bool TanhDriveCaller::bIsDifferentiable ( void  ) const
inlinevirtual

Reimplemented from DriveCaller.

Definition at line 948 of file drive_.h.

949 {
950  return true;
951 }
doublereal TanhDriveCaller::dGet ( const doublereal dVar) const
inlinevirtual

Implements DriveCaller.

Definition at line 942 of file drive_.h.

References dA, dB, dInitialValue, dStart, and grad::tanh().

943 {
944  return dInitialValue + dA*std::tanh(dB*(dVar - dStart));
945 }
GradientExpression< UnaryExpr< FuncTanh, Expr > > tanh(const GradientExpression< Expr > &u)
Definition: gradient.h:2982
doublereal dB
Definition: drive_.h:920
doublereal dA
Definition: drive_.h:919
doublereal dInitialValue
Definition: drive_.h:921
doublereal dStart
Definition: drive_.h:918

Here is the call graph for this function:

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

Reimplemented from DriveCaller.

Definition at line 954 of file drive_.h.

References dA, dB, dStart, and grad::tanh().

955 {
956  return dA*dB*(1. - std::tanh(dB*(dVar - dStart)));
957 }
GradientExpression< UnaryExpr< FuncTanh, Expr > > tanh(const GradientExpression< Expr > &u)
Definition: gradient.h:2982
doublereal dB
Definition: drive_.h:920
doublereal dA
Definition: drive_.h:919
doublereal dStart
Definition: drive_.h:918

Here is the call graph for this function:

DriveCaller * TanhDriveCaller::pCopy ( void  ) const
virtual

Implements DriveCaller.

Definition at line 767 of file drive_.cc.

References dA, dB, dInitialValue, dStart, DriveCaller::pDrvHdl, SAFENEWWITHCONSTRUCTOR, and TanhDriveCaller().

768 {
769  DriveCaller* pDC = 0;
773  return pDC;
774 }
doublereal dB
Definition: drive_.h:920
doublereal dA
Definition: drive_.h:919
doublereal dInitialValue
Definition: drive_.h:921
doublereal dStart
Definition: drive_.h:918
DriveHandler * pDrvHdl
Definition: drive.h:444
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
Definition: mynewmem.h:698
TanhDriveCaller(const DriveHandler *pDH, doublereal ds, doublereal da, doublereal db, doublereal di)
Definition: drive_.cc:751

Here is the call graph for this function:

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

Implements DriveCaller.

Definition at line 778 of file drive_.cc.

References dA, dB, dInitialValue, and dStart.

779 {
780  return out
781  << " tanh, " << dStart
782  << ", " << dA
783  << ", " << dB
784  << ", " << dInitialValue;
785 }
doublereal dB
Definition: drive_.h:920
doublereal dA
Definition: drive_.h:919
doublereal dInitialValue
Definition: drive_.h:921
doublereal dStart
Definition: drive_.h:918

Member Data Documentation

doublereal TanhDriveCaller::dA
private

Definition at line 919 of file drive_.h.

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

doublereal TanhDriveCaller::dB
private

Definition at line 920 of file drive_.h.

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

doublereal TanhDriveCaller::dInitialValue
private

Definition at line 921 of file drive_.h.

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

doublereal TanhDriveCaller::dStart
private

Definition at line 918 of file drive_.h.

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


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