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

#include <sah.h>

Inheritance diagram for SampleAndHold:
Collaboration diagram for SampleAndHold:

Public Member Functions

 SampleAndHold (unsigned int uL, const DofOwner *pDO, const ScalarNode *pN, DriveCaller *pDC, const doublereal &dSP, flag fOut)
 
virtual ~SampleAndHold (void)
 
virtual std::ostream & Restart (std::ostream &out) const
 
virtual void SetValue (DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *ph=0)
 
virtual void Update (const class VectorHandler &, const class VectorHandler &)
 
- Public Member Functions inherited from ParameterNode
 ParameterNode (unsigned int uL, const DofOwner *pDO, doublereal dx, flag fOut)
 
virtual ~ParameterNode (void)
 
virtual Node::Type GetNodeType (void) const
 
virtual unsigned int iGetNumDof (void) const
 
virtual DofOrder::Order GetDofType (unsigned int i) const
 
virtual void Output (OutputHandler &OH) const
 
virtual void Update (const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual void Update (const VectorHandler &XCurr, const int iOrder)
 
virtual void AfterPredict (VectorHandler &X, VectorHandler &XP)
 
virtual unsigned int iGetNumPrivData (void) const
 
- Public Member Functions inherited from ScalarAlgebraicNode
 ScalarAlgebraicNode (unsigned int uL, const DofOwner *pDO, doublereal dx, flag fOut)
 
virtual ~ScalarAlgebraicNode (void)
 
virtual const doublerealdGetDofValue (int iDof, int iOrder=0) const
 
virtual const doublerealdGetDofValuePrev (int iDof, int iOrder=0) const
 
virtual void SetDofValue (const doublereal &dValue, unsigned int iDof, unsigned int iOrder=0)
 
virtual void SetX (const doublereal &d)
 
virtual const doublerealdGetX (void) const
 
virtual void SetXPrime (const doublereal &d)
 
virtual const doublerealdGetXPrime (void) const
 
virtual unsigned int iGetPrivDataIdx (const char *s) const
 
- Public Member Functions inherited from ScalarNode
 ScalarNode (unsigned int uL, const DofOwner *pDO, flag fOut)
 
virtual ~ScalarNode (void)
 
- Public Member Functions inherited from Node
 Node (unsigned int uL, const DofOwner *pDO, flag fOut)
 
virtual ~Node (void)
 
const NodeGetNode (void) const
 
virtual std::ostream & DescribeDof (std::ostream &out, const char *prefix="", bool bInitial=false) const
 
virtual void DescribeDof (std::vector< std::string > &desc, bool bInitial=false, int i=-1) const
 
virtual std::ostream & DescribeEq (std::ostream &out, const char *prefix="", bool bInitial=false) const
 
virtual void DescribeEq (std::vector< std::string > &desc, bool bInitial=false, int i=-1) const
 
virtual integer iGetFirstRowIndex (void) const
 
virtual integer iGetFirstColIndex (void) const
 
virtual doublereal dGetPrivData (unsigned int i) 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 SimulationEntity
 SimulationEntity (void)
 
virtual ~SimulationEntity (void)
 
virtual bool bIsValidIndex (unsigned int i) const
 
virtual DofOrder::Order GetEqType (unsigned int i) const
 
virtual HintParseHint (DataManager *pDM, const char *s) const
 
virtual void BeforePredict (VectorHandler &, VectorHandler &, VectorHandler &, VectorHandler &) const
 
virtual void DerivativesUpdate (const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual void Update (const VectorHandler &XCurr, InverseDynamics::Order iOrder)
 
virtual void AfterConvergence (const VectorHandler &X, const VectorHandler &XP)
 
virtual void AfterConvergence (const VectorHandler &X, const VectorHandler &XP, const VectorHandler &XPP)
 
virtual std::ostream & OutputAppend (std::ostream &out) const
 
virtual void ReadInitialState (MBDynParser &HP)
 
- Public Member Functions inherited from DofOwnerOwner
 DofOwnerOwner (const DofOwner *pDO)
 
virtual ~DofOwnerOwner ()
 
virtual const DofOwnerpGetDofOwner (void) const
 
virtual integer iGetFirstIndex (void) const
 
virtual void SetInitialValue (VectorHandler &X)
 
- 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))
 

Protected Attributes

const ScalarNodepNode
 
const DriveOwner Time
 
const doublereal dSamplePeriod
 
doublereal dSampleTime
 
- Protected Attributes inherited from ScalarAlgebraicNode
doublereal dX
 
doublereal dXPrev
 
- 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 Node
enum  Type {
  UNKNOWN = -1, ABSTRACT = 0, STRUCTURAL, ELECTRIC,
  THERMAL, PARAMETER, HYDRAULIC, LASTNODETYPE
}
 
- Public Types inherited from SimulationEntity
typedef std::vector< Hint * > Hints
 
- Public Types inherited from ToBeOutput
enum  { OUTPUT = 0x1U, OUTPUT_MASK = 0xFU, OUTPUT_PRIVATE = 0x10U, OUTPUT_PRIVATE_MASK = ~OUTPUT_MASK }
 
- Protected Member Functions inherited from ScalarAlgebraicNode
virtual std::ostream & Output (std::ostream &out) const
 

Detailed Description

Definition at line 40 of file sah.h.

Constructor & Destructor Documentation

SampleAndHold::SampleAndHold ( unsigned int  uL,
const DofOwner pDO,
const ScalarNode pN,
DriveCaller pDC,
const doublereal dSP,
flag  fOut 
)

Definition at line 38 of file sah.cc.

References ASSERT, DriveOwner::dGet(), dSamplePeriod, dSampleTime, and Time.

44 : ParameterNode(uL, pDO, 0., fOut),
45 pNode(pN),
46 Time(pDC),
47 dSamplePeriod(dSP)
48 {
49  ASSERT(pN != 0);
50  ASSERT(pDC != 0);
51  ASSERT(dSP > 0.);
52 
54 }
const doublereal dSamplePeriod
Definition: sah.h:44
ParameterNode(unsigned int uL, const DofOwner *pDO, doublereal dx, flag fOut)
Definition: node.cc:496
doublereal dSampleTime
Definition: sah.h:45
const DriveOwner Time
Definition: sah.h:43
const ScalarNode * pNode
Definition: sah.h:42
#define ASSERT(expression)
Definition: colamd.c:977
doublereal dGet(const doublereal &dVar) const
Definition: drive.cc:664

Here is the call graph for this function:

SampleAndHold::~SampleAndHold ( void  )
virtual

Definition at line 56 of file sah.cc.

References NO_OP.

57 {
58  NO_OP;
59 }
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

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

Reimplemented from ScalarAlgebraicNode.

Definition at line 63 of file sah.cc.

64 {
65  return out << "# sample and hold parameter to be implemented"
66  << std::endl;
67 }
void SampleAndHold::SetValue ( DataManager pDM,
VectorHandler X,
VectorHandler XP,
SimulationEntity::Hints ph = 0 
)
virtual

Reimplemented from ParameterNode.

Definition at line 70 of file sah.cc.

References DriveOwner::dGet(), ScalarNode::dGetX(), dSamplePeriod, dSampleTime, ScalarAlgebraicNode::dX, pNode, and Time.

73 {
75  dX = pNode->dGetX();
76 }
const doublereal dSamplePeriod
Definition: sah.h:44
virtual const doublereal & dGetX(void) const =0
doublereal dSampleTime
Definition: sah.h:45
doublereal dX
Definition: node.h:405
const DriveOwner Time
Definition: sah.h:43
const ScalarNode * pNode
Definition: sah.h:42
doublereal dGet(const doublereal &dVar) const
Definition: drive.cc:664

Here is the call graph for this function:

void SampleAndHold::Update ( const class VectorHandler ,
const class VectorHandler  
)
virtual

Reimplemented from ScalarAlgebraicNode.

Definition at line 80 of file sah.cc.

References DriveOwner::dGet(), ScalarNode::dGetX(), dSamplePeriod, dSampleTime, ScalarAlgebraicNode::dX, pNode, and Time.

82 {
83  doublereal dT = Time.dGet();
84  if (dT >= dSampleTime) {
85  dX = pNode->dGetX();
87  }
88 }
const doublereal dSamplePeriod
Definition: sah.h:44
virtual const doublereal & dGetX(void) const =0
doublereal dSampleTime
Definition: sah.h:45
doublereal dX
Definition: node.h:405
const DriveOwner Time
Definition: sah.h:43
const ScalarNode * pNode
Definition: sah.h:42
doublereal dGet(const doublereal &dVar) const
Definition: drive.cc:664
double doublereal
Definition: colamd.c:52

Here is the call graph for this function:

Member Data Documentation

const doublereal SampleAndHold::dSamplePeriod
protected

Definition at line 44 of file sah.h.

Referenced by SampleAndHold(), SetValue(), and Update().

doublereal SampleAndHold::dSampleTime
mutableprotected

Definition at line 45 of file sah.h.

Referenced by SampleAndHold(), SetValue(), and Update().

const ScalarNode* SampleAndHold::pNode
protected

Definition at line 42 of file sah.h.

Referenced by SetValue(), and Update().

const DriveOwner SampleAndHold::Time
protected

Definition at line 43 of file sah.h.

Referenced by SampleAndHold(), SetValue(), and Update().


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