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

#include <node.h>

Inheritance diagram for ScalarAlgebraicNode:
Collaboration diagram for ScalarAlgebraicNode:

Public Member Functions

 ScalarAlgebraicNode (unsigned int uL, const DofOwner *pDO, doublereal dx, flag fOut)
 
virtual ~ScalarAlgebraicNode (void)
 
virtual Node::Type GetNodeType (void) const
 
virtual DofOrder::Order GetDofType (unsigned int i) const
 
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 void SetValue (DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *ph=0)
 
virtual void Update (const class VectorHandler &, const class VectorHandler &)
 
std::ostream & Restart (std::ostream &out) 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)
 
virtual void Output (OutputHandler &OH) const
 
virtual unsigned int iGetNumDof (void) const
 
virtual void AfterPredict (VectorHandler &X, VectorHandler &XP)
 
- 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 unsigned int iGetNumPrivData (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 Update (const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
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 Member Functions

virtual std::ostream & Output (std::ostream &out) const
 

Protected Attributes

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 }
 

Detailed Description

Definition at line 402 of file node.h.

Constructor & Destructor Documentation

ScalarAlgebraicNode::ScalarAlgebraicNode ( unsigned int  uL,
const DofOwner pDO,
doublereal  dx,
flag  fOut 
)

Definition at line 347 of file node.cc.

References NO_OP.

351 : ScalarNode(uL, pDO, fOut), dX(dx), dXPrev(dx)
352 {
353  NO_OP;
354 }
doublereal dXPrev
Definition: node.h:408
#define NO_OP
Definition: myassert.h:74
doublereal dX
Definition: node.h:405
ScalarNode(unsigned int uL, const DofOwner *pDO, flag fOut)
Definition: node.cc:110
ScalarAlgebraicNode::~ScalarAlgebraicNode ( void  )
virtual

Definition at line 356 of file node.cc.

References NO_OP.

357 {
358  NO_OP;
359 }
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

const doublereal & ScalarAlgebraicNode::dGetDofValue ( int  iDof,
int  iOrder = 0 
) const
virtual

Implements Node.

Reimplemented in StrainGageParam, and Elem2Param.

Definition at line 383 of file node.cc.

References ASSERT, and dX.

384 {
385  ASSERT(iDof == 1);
386  ASSERT(iOrder == 0);
387  return dX;
388 }
doublereal dX
Definition: node.h:405
#define ASSERT(expression)
Definition: colamd.c:977
const doublereal & ScalarAlgebraicNode::dGetDofValuePrev ( int  iDof,
int  iOrder = 0 
) const
virtual

Implements Node.

Definition at line 393 of file node.cc.

References ASSERT, and dXPrev.

394 {
395  ASSERT(iDof == 1);
396  ASSERT(iOrder == 0);
397  return dXPrev;
398 }
doublereal dXPrev
Definition: node.h:408
#define ASSERT(expression)
Definition: colamd.c:977
const doublereal & ScalarAlgebraicNode::dGetXPrime ( void  ) const
inlinevirtual

Implements ScalarNode.

Definition at line 498 of file node.h.

References DEBUGCERR, and MBDYN_EXCEPT_ARGS.

499 {
500  DEBUGCERR("Error, getting derivative from algebraic dof!" << std::endl);
502 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
#define DEBUGCERR(msg)
Definition: myassert.h:235
DofOrder::Order ScalarAlgebraicNode::GetDofType ( unsigned int  i) const
virtual

Implements SimulationEntity.

Reimplemented in ParameterNode.

Definition at line 374 of file node.cc.

References DofOrder::ALGEBRAIC, ASSERT, and ScalarNode::iGetNumDof().

375 {
376  ASSERT(i < iGetNumDof());
377  return DofOrder::ALGEBRAIC;
378 }
#define ASSERT(expression)
Definition: colamd.c:977
virtual unsigned int iGetNumDof(void) const
Definition: node.cc:136

Here is the call graph for this function:

Node::Type ScalarAlgebraicNode::GetNodeType ( void  ) const
virtual

Implements Node.

Reimplemented in ParameterNode, and PressureNode.

Definition at line 363 of file node.cc.

References Node::ABSTRACT.

Referenced by Restart().

364 {
365  /* Should be Node::SCALAR; keep using Node::ABSTRACT
366  * for backward compatibility */
367  return Node::ABSTRACT;
368 }
unsigned int ScalarAlgebraicNode::iGetPrivDataIdx ( const char *  s) const
virtual

Reimplemented from Node.

Definition at line 476 of file node.cc.

References ASSERT.

477 {
478  ASSERT(s != 0);
479 
480  /*
481  * "x" => 1
482  */
483 
484  if (s[0] == 'x' && s[1] == '\0') {
485  return 1;
486  }
487 
488  return 0;
489 }
#define ASSERT(expression)
Definition: colamd.c:977
std::ostream & ScalarAlgebraicNode::Output ( std::ostream &  out) const
protectedvirtual

Reimplemented from ScalarNode.

Definition at line 450 of file node.cc.

References ToBeOutput::bToBeOutput(), dX, and WithLabel::GetLabel().

Referenced by PressureNode::Output().

451 {
452  if (bToBeOutput()) {
453  out << std::setw(8) << GetLabel()
454  << " " << dX << std::endl;
455  }
456  return out;
457 }
virtual bool bToBeOutput(void) const
Definition: output.cc:890
doublereal dX
Definition: node.h:405
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

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

Implements Node.

Reimplemented in SampleAndHold.

Definition at line 463 of file node.cc.

References dX, WithLabel::GetLabel(), WithLabel::GetName(), GetNodeType(), and psReadNodesNodes.

464 {
465  out << " " << psReadNodesNodes[GetNodeType()]
466  << ": " << GetLabel();
467 
468  if (!GetName().empty()) {
469  out << ", name, \"" << GetName() << "\"";
470  }
471 
472  return out << ", value, " << dX << ";" << std::endl;
473 }
const char * psReadNodesNodes[]
Definition: enums.cc:398
virtual Node::Type GetNodeType(void) const
Definition: node.cc:363
doublereal dX
Definition: node.h:405
const std::string & GetName(void) const
Definition: withlab.cc:68
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

void ScalarAlgebraicNode::SetDofValue ( const doublereal dValue,
unsigned int  iDof,
unsigned int  iOrder = 0 
)
virtual

Implements Node.

Reimplemented in Elem2Param.

Definition at line 403 of file node.cc.

References ASSERT, and dX.

406 {
407  ASSERT(iDof == 1);
408  ASSERT(iOrder == 0);
409  dX = dValue;
410 }
doublereal dX
Definition: node.h:405
#define ASSERT(expression)
Definition: colamd.c:977
void ScalarAlgebraicNode::SetValue ( DataManager pDM,
VectorHandler X,
VectorHandler XP,
SimulationEntity::Hints ph = 0 
)
virtual

Reimplemented from SimulationEntity.

Reimplemented in ParameterNode, Elem2Param, and SampleAndHold.

Definition at line 431 of file node.cc.

References dX, DofOwnerOwner::iGetFirstIndex(), and VectorHandler::PutCoef().

434 {
435  integer iIndex = iGetFirstIndex();
436  X.PutCoef(iIndex + 1, dX);
437 }
doublereal dX
Definition: node.h:405
virtual void PutCoef(integer iRow, const doublereal &dCoef)=0
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

void ScalarAlgebraicNode::SetX ( const doublereal d)
virtual

Implements ScalarNode.

Definition at line 416 of file node.cc.

References dX.

417 {
418  dX = d;
419 }
doublereal dX
Definition: node.h:405
void ScalarAlgebraicNode::SetXPrime ( const doublereal d)
virtual

Implements ScalarNode.

Definition at line 424 of file node.cc.

References DEBUGCERR, and MBDYN_EXCEPT_ARGS.

425 {
426  DEBUGCERR("Error, setting derivative from algebraic dof" << std::endl);
428 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
#define DEBUGCERR(msg)
Definition: myassert.h:235
void ScalarAlgebraicNode::Update ( const class VectorHandler X,
const class VectorHandler  
)
virtual

Reimplemented in SampleAndHold.

Definition at line 440 of file node.cc.

References dX, dXPrev, and DofOwnerOwner::iGetFirstIndex().

442 {
443  integer iFirstIndex = iGetFirstIndex()+1;
444 
445  dXPrev = dX;
446  dX = X(iFirstIndex);
447 }
doublereal dXPrev
Definition: node.h:408
doublereal dX
Definition: node.h:405
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

Member Data Documentation

doublereal ScalarAlgebraicNode::dXPrev
protected

Definition at line 408 of file node.h.

Referenced by dGetDofValuePrev(), and Update().


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